Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f0747a2f

Von Kivitendo Admin vor mehr als 7 Jahren hinzugefügt

  • ID f0747a2f9c8d7a9d261c20b0d2a9d5911a6ad9b5
  • Vorgänger 359506e5
  • Nachfolger 40cfb5ee

Dialogbuchen - Abteilung nutzt immer L.select_tag als Dropdown

Unterschiede anzeigen:

bin/mozilla/gl.pl
99 99
  $form->{credit} = 0;
100 100
  $form->{tax}    = 0;
101 101

  
102
  # departments
103
  $form->all_departments(\%myconfig);
104
  if (@{ $form->{all_departments} || [] }) {
105
    $form->{selectdepartment} = "<option>\n";
106

  
107
    map {
108
      $form->{selectdepartment} .=
109
        "<option>$_->{description}--$_->{id}\n"
110
    } (@{ $form->{all_departments} || [] });
111
  }
102
  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
112 103

  
113 104
  $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details};
114 105

  
......
129 120

  
130 121
  $form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2);
131 122

  
132
  # departments
133
  $form->all_departments(\%myconfig);
134
  if (@{ $form->{all_departments} || [] }) {
135
    $form->{selectdepartment} = "<option>\n";
136

  
137
    map {
138
      $form->{selectdepartment} .=
139
        "<option>$_->{description}--$_->{id}\n"
140
    } (@{ $form->{all_departments} || [] });
141
  }
123
  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
142 124

  
143 125
  my $i        = 1;
144 126
  my $tax      = 0;
......
226 208
  $::lxdebug->enter_sub;
227 209
  $::auth->assert('general_ledger | gl_transactions');
228 210

  
229
  $::form->all_departments(\%::myconfig);
230 211
  $::form->get_lists(
231 212
    projects  => { key => "ALL_PROJECTS", all => 1 },
232 213
  );
233 214
  $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
215
  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
234 216

  
235 217
  $::form->header;
236 218
  print $::form->parse_html_template('gl/search', {
237
    department_label => sub { ("$_[0]{description}--$_[0]{id}")x2 },
238 219
    employee_label => sub { "$_[0]{id}--$_[0]{name}" },
239 220
  });
240 221

  
......
316 297
  );
317 298

  
318 299
  # add employee here, so that variable is still known and passed in url when choosing a different sort order in resulting table
319
  my @hidden_variables = qw(accno source reference department description notes project_id datefrom dateto employee_id datesort category l_subtotal);
300
  my @hidden_variables = qw(accno source reference description notes project_id datefrom dateto employee_id datesort category l_subtotal);
320 301
  push @hidden_variables, map { "l_${_}" } @columns;
321 302

  
322 303
  my $employee = $form->{employee_id} ? SL::DB::Employee->new(id => $form->{employee_id})->load->name : '';
......
334 315
  push @date_options, $locale->text('Bis'),  $locale->date(\%myconfig, $form->{dateto},   1)          if ($form->{dateto});
335 316
  push @options,      join(' ', @date_options)                                                        if (scalar @date_options);
336 317

  
337
  if ($form->{department}) {
338
    my ($department) = split /--/, $form->{department};
339
    push @options, $locale->text('Department') . " : $department";
318
  if ($form->{department_id}) {
319
    my $department = SL::DB::Manager::Department->find_by( id => $form->{department_id} );
320
    push @options, $locale->text('Department') . " : " . $department->description;
340 321
  }
341 322

  
342

  
343 323
  my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
344 324

  
345 325
  $form->{l_credit_accno}     = 'Y';
......
877 857
  $::form->get_lists("projects"  => { "key"       => "ALL_PROJECTS",
878 858
                                    "all"       => 0,
879 859
                                    "old_id"    => \@old_project_ids },
860

  
880 861
                   "charts"    => { "key"       => "ALL_CHARTS",
881 862
                                    "transdate" => $::form->{transdate} });
882 863

  
864
  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
865

  
883 866
  GL->get_chart_balances('charts' => $::form->{ALL_CHARTS});
884 867

  
885 868
  my $title      = $::form->{title};
......
890 873
  map { $::form->{$_} =~ s/\"/&quot;/g }
891 874
    qw(chart taxchart);
892 875

  
893
  $::form->{selectdepartment} =~ s/ selected//;
894
  $::form->{selectdepartment} =~
895
    s/option>\Q$::form->{department}\E/option selected>$::form->{department}/;
896

  
897 876
  if ($init) {
898 877
    $::request->{layout}->focus("#reference");
899 878
    $::form->{taxincluded} = "1";
......
1172 1151
  my $form     = $main::form;
1173 1152
  my $locale   = $main::locale;
1174 1153

  
1175
  if ($::myconfig{mandatory_departments} && !$form->{department}) {
1154
  if ($::myconfig{mandatory_departments} && !$form->{department_id}) {
1176 1155
    $form->{saved_message} = $::locale->text('You have to specify a department.');
1177 1156
    update();
1178 1157
    exit;

Auch abrufbar als: Unified diff