Umstellung der Filtermaske für neue Mahnungen auf das HTML-Vorlagensystem.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 4 May 2007 15:04:20 +0000 (15:04 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 4 May 2007 15:04:20 +0000 (15:04 +0000)
bin/mozilla/dn.pl
locale/de/all
locale/de/dn
templates/webpages/dunning/add_de.html [new file with mode: 0644]
templates/webpages/dunning/add_master.html [new file with mode: 0644]

index a81d945..65b3bc3 100644 (file)
@@ -60,132 +60,24 @@ sub edit_config {
 
 sub add {
   $lxdebug->enter_sub();
+
   # setup customer selection
   $form->all_vc(\%myconfig, "customer", "AR");
 
   DN->get_config(\%myconfig, \%$form);
 
-  if (@{ $form->{all_customer} }) {
-    map { $customer .= "<option>$_->{name}--$_->{id}\n" }
-      @{ $form->{all_customer} };
-    $customer = qq|<select name=customer><option>\n$customer</select>|;
-  } else {
-    $customer = qq|<input name=customer size=35>|;
-  }
-
-  # dunning levels
-  if (@{ $form->{DUNNING} }) {
-    $form->{selectdunning_level} = "<option></option\n";
-    map {
-      $form->{selectdunning_level} .=
-        "<option value=$_->{id}>$_->{dunning_description}</option>\n"
-    } (@{ $form->{DUNNING} });
-  }
-  $dunning_level = qq| 
-    <tr> 
-    <th align=right nowrap>| . $locale->text('Next Dunning Level') . qq|</th>
-    <td colspan=3><select name=dunning_level>$form->{selectdunning_level}</select></td>
-    </tr>
-    | if $form->{selectdunning_level};
+  $form->{SHOW_CUSTOMER_SELECTION}      = $form->{all_customer}    && scalar @{ $form->{all_customer} };
+  $form->{SHOW_DUNNING_LEVEL_SELECTION} = $form->{DUNNING}         && scalar @{ $form->{DUNNING} };
+  $form->{SHOW_DEPARTMENT_SELECTION}    = $form->{all_departments} && scalar @{ $form->{all_departments} };
 
-  # departments
-  if (@{ $form->{all_departments} }) {
-    $form->{selectdepartment} = "<option>\n";
-    map {
-      $form->{selectdepartment} .=
-        "<option>$_->{description}--$_->{id}\n"
-    } (@{ $form->{all_departments} });
-  }
-  $department = qq| 
-    <tr> 
-    <th align=right nowrap>| . $locale->text('Department') . qq|</th>
-    <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
-    </tr>
-    | if $form->{selectdepartment};
-
-  $form->{title}       = $locale->text('Start Dunning Process');
-  $form->{nextsub}     = "show_invoices";
-
-  $form->{jsscript}    = 1;
-  $form->{fokus}       = "search.customer";
-  $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
+  $form->{title}    = $locale->text('Start Dunning Process');
+  $form->{jsscript} = 1;
+  $form->{fokus}    = "search.customer";
   $form->header();
 
-  $onload = qq|focus()|;
-  $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
-  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
-
-  print qq|
-<body onLoad="$onload">
-
-<form method=post name="search" action=$form->{script}>
-
-<table width=100%>
-  <tr><th class=listtop>$form->{title}</th></tr>
-  <tr height="5"></tr>
-  <tr>
-    <td>
-      <table>
-        <tr>
-          <th align=right>| . $locale->text('Customer') . qq|</th>
-          <td colspan=3>$customer</td>
-        </tr>
-        $dunning_level
-        $department
-        <tr>
-          <th align=right nowrap>| . $locale->text('Invoice Number') . qq|</th>
-          <td colspan=3><input name=invnumber size=20></td>
-        </tr>
-        <tr>
-          <th align=right nowrap>| . $locale->text('Order Number') . qq|</th>
-          <td colspan=3><input name=ordnumber size=20></td>
-        </tr>
-        <tr>
-          <th align=right nowrap>| . $locale->text('Notes') . qq|</th>
-          <td colspan=3><input name=notes size=40></td>
-        </tr>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td><hr size=3 noshade></td>
-  </tr>
-  <tr>
-    <td>
-      <table>
-        <tr>
-          <th align=right nowrap>| . $locale->text('Minimum Amount') . qq|</th>
-          <td><input name=minamount size=6></td>
-        </tr>
-        <tr>
-          <th align=right nowrap>| . $locale->text('Group Invoices') . qq|</th>
-          <td><input type=checkbox value=1 name=groupinvoices checked></td>
-        </tr>
-      </table>
-    </td>
-  </tr>
-</table>
-
-<input type=hidden name=nextsub value=$form->{nextsub}>
-
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<br>
-<input class=submit type=submit name=action value="|
-    . $locale->text('Continue') . qq|">
-
-</form>
-
-</body>
-
-$jsscript
-
-</html>
-|;
+  print $form->parse_html_template("dunning/add");
 
   $lxdebug->leave_sub();
-
 }
 
 sub show_invoices {
index d47514a..e6b4b9c 100644 (file)
@@ -1155,6 +1155,7 @@ gestartet',
   'Workflow sales_order'        => 'Workflow Auftrag',
   'Workflow sales_quotation'    => 'Workflow Angebot',
   'Wrong Period'                => 'Falscher Zeitraum',
+  'Wrong date format!'          => 'Falsches Datumsformat!',
   'YYYY'                        => 'JJJJ',
   'Year'                        => 'Jahr',
   'Year End'                    => 'Jahresende',
index d1dd556..1b09165 100644 (file)
@@ -65,7 +65,6 @@ gestartet',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
   'Group'                       => 'Warengruppe',
-  'Group Invoices'              => 'Rechnungen zusammenfassen',
   'History'                     => 'Historie',
   'In-line'                     => 'im Text',
   'Interest'                    => 'Zinsen',
@@ -93,7 +92,6 @@ gestartet',
   'March'                       => 'März',
   'May'                         => 'Mai',
   'May '                        => 'Mai',
-  'Minimum Amount'              => 'Mindestbetrag',
   'Missing \'description\' field.' => 'Fehlendes Feld \'description\'.',
   'Missing \'tag\' field.'      => 'Fehlendes Feld \'tag\'.',
   'More than one control file with the tag \'%s\' exist.' => 'Es gibt mehr als eine Kontrolldatei mit dem Tag \'%s\'.',
diff --git a/templates/webpages/dunning/add_de.html b/templates/webpages/dunning/add_de.html
new file mode 100644 (file)
index 0000000..f35601f
--- /dev/null
@@ -0,0 +1,97 @@
+<script type="text/javascript" src="js/common.js"></script>
+<script type="text/javascript">
+ <!--
+     function setup_controls() {
+       fokus();
+       setupDateFormat('<TMPL_VAR myconfig_dateformat>', 'Falsches Datumsformat!');
+       setupPoints('<TMPL_VAR myconfig_numberformat>', 'Falsches Format');
+     }
+   -->
+</script>
+
+<body onLoad="setup_controls();">
+
+ <div class="listtop"><TMPL_VAR title></div>
+
+ <form method="post" name="search" action="dn.pl">
+
+  <table>
+   <tr>
+    <th align="right">Kunde</th>
+    <td colspan="3">
+     <TMPL_IF SHOW_CUSTOMER_SELECTION>
+      <select name="customer">
+       <option></option>
+       <TMPL_LOOP all_customer><option><TMPL_VAR name ESCAPE=HTML>--<TMPL_VAR id ESCAPE=HTML></option></TMPL_LOOP>
+      </select>
+      <TMPL_ELSE>
+      <input name=customer size=35>
+     </TMPL_IF>
+    </td>
+   </tr>
+
+   <TMPL_IF SHOW_DUNNING_LEVEL_SELECTION>
+    <tr>
+     <th align="right">Nächste Mahnstufe</th>
+     <td colspan="3">
+      <select name="dunning_level">
+       <option></option>
+       <TMPL_LOOP DUNNING><option value="<TMPL_VAR id ESCAPE=HTML>"><TMPL_VAR dunning_description ESCAPE=HTML></option></TMPL_LOOP>
+      </select>
+     </td>
+    </tr>
+   </TMPL_IF>
+
+   <TMPL_IF SHOW_DEPARTMENT_SELECTION>
+    <tr>
+     <th align="right">Abteilung</th>
+     <td colspan="3">
+      <select name="department">
+       <option></option>
+       <TMPL_LOOP all_departments><option><TMPL_VAR description ESCAPE=HTML>--<TMPL_VAR id ESCAPE=HTML></option></TMPL_LOOP>
+      </select>
+     </td>
+    </tr>
+   </TMPL_IF>
+
+   <tr>
+    <th align="right" nowrap>Rechnungsnummer</th>
+    <td colspan="3"><input name="invnumber" size="20"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap>Auftragsnummer</th>
+    <td colspan="3"><input name="ordnumber" size="20"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap>Bemerkungen</th>
+    <td colspan="3"><input name="notes" size="40"></td>
+   </tr>
+
+   <tr><td colspan="2"><hr size="3" noshade></td></tr>
+
+   <tr>
+    <th align="right" nowrap>Mindestbetrag</th>
+    <td><input name="minamount" size="6"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap>Rechnungen zusammenfassen</th>
+    <td><input type="checkbox" value="1" name="groupinvoices" checked></td>
+   </tr>
+  </table>
+
+  <input type="hidden" name="nextsub" value="show_invoices">
+
+  <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
+  <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
+
+  <br>
+  <input class="submit" type="submit" name="action" value="Weiter">
+
+ </form>
+
+</body>
+
+</html>
diff --git a/templates/webpages/dunning/add_master.html b/templates/webpages/dunning/add_master.html
new file mode 100644 (file)
index 0000000..9989f6b
--- /dev/null
@@ -0,0 +1,97 @@
+<script type="text/javascript" src="js/common.js"></script>
+<script type="text/javascript">
+ <!--
+     function setup_controls() {
+       fokus();
+       setupDateFormat('<TMPL_VAR myconfig_dateformat>', '<translate>Wrong date format!</translate>');
+       setupPoints('<TMPL_VAR myconfig_numberformat>', '<translate>wrongformat</translate>');
+     }
+   -->
+</script>
+
+<body onLoad="setup_controls();">
+
+ <div class="listtop"><TMPL_VAR title></div>
+
+ <form method="post" name="search" action="dn.pl">
+
+  <table>
+   <tr>
+    <th align="right"><translate>Customer</translate></th>
+    <td colspan="3">
+     <TMPL_IF SHOW_CUSTOMER_SELECTION>
+      <select name="customer">
+       <option></option>
+       <TMPL_LOOP all_customer><option><TMPL_VAR name ESCAPE=HTML>--<TMPL_VAR id ESCAPE=HTML></option></TMPL_LOOP>
+      </select>
+      <TMPL_ELSE>
+      <input name=customer size=35>
+     </TMPL_IF>
+    </td>
+   </tr>
+
+   <TMPL_IF SHOW_DUNNING_LEVEL_SELECTION>
+    <tr>
+     <th align="right"><translate>Next Dunning Level</translate></th>
+     <td colspan="3">
+      <select name="dunning_level">
+       <option></option>
+       <TMPL_LOOP DUNNING><option value="<TMPL_VAR id ESCAPE=HTML>"><TMPL_VAR dunning_description ESCAPE=HTML></option></TMPL_LOOP>
+      </select>
+     </td>
+    </tr>
+   </TMPL_IF>
+
+   <TMPL_IF SHOW_DEPARTMENT_SELECTION>
+    <tr>
+     <th align="right"><translate>Department</translate></th>
+     <td colspan="3">
+      <select name="department">
+       <option></option>
+       <TMPL_LOOP all_departments><option><TMPL_VAR description ESCAPE=HTML>--<TMPL_VAR id ESCAPE=HTML></option></TMPL_LOOP>
+      </select>
+     </td>
+    </tr>
+   </TMPL_IF>
+
+   <tr>
+    <th align="right" nowrap><translate>Invoice Number</translate></th>
+    <td colspan="3"><input name="invnumber" size="20"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap><translate>Order Number</translate></th>
+    <td colspan="3"><input name="ordnumber" size="20"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap><translate>Notes</translate></th>
+    <td colspan="3"><input name="notes" size="40"></td>
+   </tr>
+
+   <tr><td colspan="2"><hr size="3" noshade></td></tr>
+
+   <tr>
+    <th align="right" nowrap><translate>Minimum Amount</translate></th>
+    <td><input name="minamount" size="6"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap><translate>Group Invoices</translate></th>
+    <td><input type="checkbox" value="1" name="groupinvoices" checked></td>
+   </tr>
+  </table>
+
+  <input type="hidden" name="nextsub" value="show_invoices">
+
+  <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
+  <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
+
+  <br>
+  <input class="submit" type="submit" name="action" value="<translate>Continue</translate>">
+
+ </form>
+
+</body>
+
+</html>