Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision dec270d2

Von Kivitendo Admin vor fast 8 Jahren hinzugefügt

  • ID dec270d227e4e9c199001064f32cef1ef37c4296
  • Vorgänger dd2ee66b
  • Nachfolger 77807bf5

Lieferscheine - Abteilung per ALL_DEPARTMENTS und L.select_tag

Unterschiede anzeigen:

bin/mozilla/do.pl
265 265
  my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
266 266
  $form->get_lists($vc              => "ALL_VC",
267 267
                   "price_factors"  => "ALL_PRICE_FACTORS",
268
                   "departments"    => "ALL_DEPARTMENTS",
269 268
                   "business_types" => "ALL_BUSINESS_TYPES",
270 269
    );
270
  $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
271 271

  
272 272
  # Projects
273 273
  my @old_project_ids = uniq grep { $_ } map { $_ * 1 } ($form->{"globalproject_id"}, map { $form->{"project_id_$_"} } 1..$form->{"rowcount"});
......
302 302
    ]
303 303
  ]);
304 304

  
305
  map { $_->{value} = "$_->{description}--$_->{id}" } @{ $form->{ALL_DEPARTMENTS} };
306 305
  map { $_->{value} = "$_->{name}--$_->{id}"        } @{ $form->{ALL_VC} };
307 306

  
308 307
  $form->{SHOW_VC_DROP_DOWN} =  $myconfig{vclimit} > scalar @{ $form->{ALL_VC} };
......
502 501

  
503 502
  $form->get_lists("projects"       => { "key" => "ALL_PROJECTS",
504 503
                                         "all" => 1 },
505
                   "departments"    => "ALL_DEPARTMENTS",
506 504
                   "$form->{vc}s"   => "ALL_VC",
507 505
                   "business_types" => "ALL_BUSINESS_TYPES");
508 506
  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
509

  
507
  $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
510 508
  $form->{SHOW_VC_DROP_DOWN} =  $myconfig{vclimit} > scalar @{ $form->{ALL_VC} };
511 509
  $form->{title}             = $locale->text('Delivery Orders');
512 510

  
......
527 525
  my $locale   = $main::locale;
528 526
  my $cgi      = $::request->{cgi};
529 527

  
530
  $form->{department_id} = (split /--/, $form->{department})[-1];
531 528
  ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = split(/--/, $form->{ $form->{vc} });
532 529

  
533 530
  report_generator_set_default_sort('transdate', 1);
......
612 609
  if ($form->{cp_name}) {
613 610
    push @options, $locale->text('Contact Person') . " : $form->{cp_name}";
614 611
  }
615
  if ($form->{department}) {
616
    my ($department) = split /--/, $form->{department};
617
    push @options, $locale->text('Department') . " : $department";
612
  if ($form->{department_id}) {
613
    push @options, $locale->text('Department') . " : " . SL::DB::Department->new(id => $form->{department_id})->load->description;
618 614
  }
619 615
  if ($form->{donumber}) {
620 616
    push @options, $locale->text('Delivery Order Number') . " : $form->{donumber}";
templates/webpages/do/search.html
61 61
    [%- IF ALL_DEPARTMENTS.size %]
62 62
    <tr>
63 63
     <th align="right" nowrap>[% 'Department' | $T8 %]</th>
64
     <td colspan="3">
65
      <select name="department" class="fixed_width">
66
       <option></option>
67
       [%- FOREACH row = ALL_DEPARTMENTS %]
68
       <option[% IF department == row.id %] selected[% END %]>[% HTML.escape(row.description) %]--[% HTML.escape(row.id) %]</option>
69
       [%- END %]
70
      </select>
71
     </td>
64
     <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, class="fixed_width") %]</td>
72 65
    </tr>
73 66
    [%- END %]
74 67

  

Auch abrufbar als: Unified diff