fokus bei Mahnung erstellen gefixt.
[kivitendo-erp.git] / bin / mozilla / dn.pl
index 4b6210b..e9df309 100644 (file)
@@ -106,7 +106,7 @@ sub add {
 
   $form->{title}    = $locale->text('Start Dunning Process');
   $form->{jsscript} = 1;
-  $form->{fokus}    = "search.customer";
+  $::request->{layout}->focus('#customer');
   $form->header();
 
   print $form->parse_html_template("dunning/add");
@@ -135,7 +135,7 @@ sub show_invoices {
     map { $row->{$_} = $form->format_amount(\%myconfig, $row->{$_} * 1, -2) } qw(amount open_amount fee interest);
 
     if ($row->{'language_id'}) {
-      $row->{language} = SL::DB::Manager::Language->find_by('id' => $row->{'language_id'})->{'description'};
+      $row->{language} = SL::DB::Manager::Language->find_by_or_create('id' => $row->{'language_id'})->{'description'};
     }
   }
 
@@ -154,8 +154,6 @@ sub show_invoices {
                                           'no_opendocument' => 1,);
 
   $form->header();
-  $form->{onload} = "document.getElementsByName('language_id')[0].disabled =
-        !document.getElementsByName('force_lang')[0].checked;";
   print $form->parse_html_template("dunning/show_invoices");
 
   $main::lxdebug->leave_sub();
@@ -285,7 +283,7 @@ sub set_email {
   $main::auth->assert('dunning_edit');
 
   $form->{"title"} = $locale->text("Set eMail text");
-  $form->header();
+  $form->header(no_layout => 1);
   print($form->parse_html_template("dunning/set_email"));
 
   $main::lxdebug->leave_sub();
@@ -301,8 +299,8 @@ sub search {
   $main::auth->assert('dunning_edit');
 
   $form->get_lists("customers"   => "ALL_CUSTOMERS",
-                   "departments" => "ALL_DEPARTMENTS",
-                   "salesmen"     => "ALL_SALESMEN");
+                   "departments" => "ALL_DEPARTMENTS");
+  $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]);
 
   DN->get_config(\%myconfig, \%$form);
 
@@ -312,15 +310,10 @@ sub search {
 
   $form->{jsscript} = 1;
   $form->{title}    = $locale->text('Dunnings');
-  $form->{fokus}    = "search.customer";
-  $form->{salesman_labels} = sub { $_[0]->{"name"} || $_[0]->{"login"} };
+  $::request->{layout}->focus('#customer');
 
   $form->header();
 
-  $form->{onload} = qq|focus()|
-    . qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|
-    . qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
-
   print $form->parse_html_template("dunning/search");
 
   $main::lxdebug->leave_sub();
@@ -461,8 +454,6 @@ sub show_dunning {
 
   $report->set_options_from_form();
 
-  $form->{onload} = "document.getElementsByName('language_id')[0].disabled =
-        !document.getElementsByName('force_lang')[0].checked;";
   $report->generate_with_headers();
 
   $main::lxdebug->leave_sub();