Den Dialog zum Bearbeiten der Mahnungskonfiguration auf die Verwendung von HTML-Vorla...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 4 May 2007 14:38:34 +0000 (14:38 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 4 May 2007 14:38:34 +0000 (14:38 +0000)
bin/mozilla/dn.pl
locale/de/all
locale/de/dn
locale/de/menuv3
templates/webpages/dunning/edit_config_de.html [new file with mode: 0644]
templates/webpages/dunning/edit_config_master.html [new file with mode: 0644]

index ee77c82..a81d945 100644 (file)
@@ -36,6 +36,7 @@ use SL::PE;
 use SL::DN;
 use Data::Dumper;
 
+require "bin/mozilla/common.pl";
 require "bin/mozilla/io.pl";
 require "bin/mozilla/arap.pl";
 
@@ -44,174 +45,15 @@ require "bin/mozilla/arap.pl";
 sub edit_config {
   $lxdebug->enter_sub();
 
-  # edit all dunning config data
-
-  $form->header;
   DN->get_config(\%myconfig, \%$form);
-  $form->{title} = $locale->text('Edit Dunning Process Config');
-  
-  $form->{callback} =
-    "$form->{script}?action=edit_config&login=$form->{login}&password=$form->{password}"
-    unless $form->{callback};
-
-  @column_index = qw(dunning_level dunning_description active auto email payment_terms terms fee interest_rate template);
-
-  $column_header{dunning_level} =
-      qq|<th class=listheading>|
-    . $locale->text('Dunning Level')
-    . qq|</th>|;
-  $column_header{dunning_description} =
-      qq|<th class=listheading>|
-    . $locale->text('Dunning Description')
-    . qq|</th>|;
-  $column_header{active} =
-      qq|<th class=listheading>|
-    . $locale->text('Active?')
-    . qq|</th>|;
-  $column_header{auto} =
-      qq|<th class=listheading>|
-    . $locale->text('Auto Send?')
-    . qq|</th>|;
-  $column_header{email} =
-      qq|<th class=listheading>|
-    . $locale->text('eMail Send?')
-    . qq|</th>|;
-  $column_header{payment_terms} =
-      qq|<th class=listheading>|
-    . $locale->text('Fristsetzung')
-    . qq|</th>|;
-  $column_header{terms} =
-      qq|<th class=listheading>|
-    . $locale->text('Duedate +Days')
-    . qq|</th>|;
-  $column_header{fee} =
-      qq|<th class=listheading>|
-    . $locale->text('Fee')
-    . qq|</th>|;
-  $column_header{interest_rate} =
-      qq|<th class=listheading>|
-    . $locale->text('Interest Rate')
-    . qq|</th>|;
-  $column_header{template} =
-      qq|<th class=listheading>|
-    . $locale->text('Template')
-    . qq|</th>|;
-  print qq|
-<body>
-<script type="text/javascript" src="js/common.js"></script>
-<script type="text/javascript" src="js/dunning.js"></script>
-<form method=post action=$form->{script}>
-
-
-<table width=100%>
-  <tr>
-    <th class=listtop colspan=10>$form->{title}</th>
-  </tr>
-  <tr height="5"></tr>
-  <tr>|;
-  map { print "$column_header{$_}\n" } @column_index;
-
-  print qq|
-        </tr>
-|;
-  my $i = 0;
-  foreach $ref (@{ $form->{DUNNING} }) {
-
-    $i++;
-    my $j = $i % 2;
-
-    print qq|
-        <tr valign=top class=listrow$j>
-|;
-
-
-    $column_data{dunning_level} =
-      qq|<td><input type=hidden name=dunning_level_$i size=2 value="$i"><input type=hidden name=id_$i value="$ref->{id}">$i</td>|;
-    $column_data{dunning_description}           = qq|<td><input name=dunning_description_$i value="$ref->{dunning_description}"></td>|;
-    my $active = ($ref->{active}) ? "checked" : "";
-    $column_data{active} =
-      qq|<td><input type=checkbox name=active_$i value=1 $active></td>|;
-    my $email = ($ref->{email}) ? "checked" : "";
-  $column_data{email} =
-    qq|<td><input type=checkbox name=email_$i value=1 $email><button type="button" onclick="set_email_window('email_subject_$i', 'email_body_$i', 'email_attachment_$i')">| . $locale->text('L') . qq|</button><input type=hidden name=email_body_$i value="$ref->{email_body}"><input type=hidden name=email_subject_$i value="$ref->{email_subject}"><input type=hidden name=email_attachment_$i value="$ref->{email_attachment}"></td>|;
-
-    my $auto = ($ref->{auto}) ? "checked" : "";
-    $column_data{auto} =
-      qq|<td><input type=checkbox name=auto_$i value=1 $auto></td>|;
-    $column_data{payment_terms}           = qq|<td><input name=payment_terms_$i size=3 value="$ref->{payment_terms}"></td>|;
-    $column_data{terms}           = qq|<td><input name=terms_$i size=3 value="$ref->{terms}"></td>|;
-    $column_data{fee}           = qq|<td><input name=fee_$i size=5 value="$ref->{fee}"></td>|;
-    $column_data{interest_rate}           = qq|<td><input name=interest_rate_$i size=4 value="$ref->{interest}">%</td>|;
-    $column_data{template}           = qq|<td><input name=template_$i value="$ref->{template}"></td>|;
-
-
-
-    map { print "$column_data{$_}\n" } @column_index;
-
-    print qq|
-       </tr>
-|;
-  }
-  $i++;
-  my $j = $i % 2;
-
-  print qq|
-        <tr valign=top class=listrow$j>
-|;
-
-
-  $column_data{dunning_level} =
-    qq|<td><input type=hidden size=2 name=dunning_level_$i value=$i>$i</td>|;
-  $column_data{dunning_description}           = qq|<td><input name=dunning_description_$i ></td>|;
-  $column_data{active} =
-    qq|<td><input type=checkbox name=active_$i value=1></td>|;
-  my $email = "";
-  $column_data{email} =
-    qq|<td><input type=checkbox name=email_$i value=1 $email><button type="button" onclick="set_email_window('email_subject_$i', 'email_body_$i', 'email_attachment_$i')">| . $locale->text('L') . qq|</button><input type=hidden name=email_body_$i><input type=hidden name=email_subject_$i><input type=hidden name=email_attachment_$i></td>|;
-  my $auto = "";
-  $column_data{auto} =
-    qq|<td><input type=checkbox name=auto_$i value=1 $auto></td>|;
-  $column_data{payment_terms}           = qq|<td><input  size=3 name=payment_terms_$i></td>|;
-  $column_data{terms}           = qq|<td><input  size=3 name=terms_$i></td>|;
-  $column_data{fee}           = qq|<td><input  size=5 name=fee_$i></td>|;
-  $column_data{interest_rate}           = qq|<td><input  size=4 name=interest_rate_$i>%</td>|;
-  $column_data{template}           = qq|<td><input name=template_$i></td>|;
-
-
-  $form->{rowcount} = $i;
-  map { print "$column_data{$_}\n" } @column_index;
-
-  print qq|
-      </tr>
-|;
-
-
-  print qq|
-      </table>
-    </td>
-  </tr>
-  <tr>
-  <td><hr size=3 noshade></td>
-  </tr>
-</table>
-
-<br>
-<form method=post action=$form->{script}>
-
-<input name=callback type=hidden value="$form->{callback}">
-<input name=rowcount type=hidden value="$form->{rowcount}">
-
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
 
-<input class=submit type=submit name=action value="|
-    . $locale->text('Save') . qq|">
-
-  </form>
+  $form->{title}          = $locale->text('Edit Dunning Process Config');
+  $form->{callback}     ||= build_std_url("action=edit_config");
+  $form->{rowcount}       = 1 + scalar @{ $form->{DUNNING} };
+  $form->{rowcount_odd}   = $form->{rowcount} % 2;
 
-  </body>
-  </html>
-|;
+  $form->header();
+  print $form->parse_html_template("dunning/edit_config");
 
   $lxdebug->leave_sub();
 }
index bf1d90f..d47514a 100644 (file)
@@ -922,6 +922,7 @@ gestartet',
   'Save and Order'              => 'Speichern und Auftrag erfassen',
   'Save and Quotation'          => 'Speichern und Angebot',
   'Save and RFQ'                => 'Speichern und Lieferantenanfrage',
+  'Save and close'              => 'Speichern und schlie&szlig;en',
   'Save as new'                 => 'als neu speichern',
   'Save draft'                  => 'Entwurf speichern',
   'Saving the file \'%s\' failed. OS error message: %s' => 'Das Speichern der Datei \'%s\' schlug fehl. Fehlermeldung des Betriebssystems: %s',
index 62096fd..d1dd556 100644 (file)
@@ -15,7 +15,6 @@ $self->{texts} = {
   'Attempt to call an undefined sub named \'%s\'' => 'Es wurde versucht, eine nicht definierte Unterfunktion namens \'%s\' aufzurufen.',
   'Aug'                         => 'Aug',
   'August'                      => 'August',
-  'Auto Send?'                  => 'Auto. Versand?',
   'Billing Address'             => 'Rechnungsadresse',
   'Bin'                         => 'Lagerplatz',
   'Bin List'                    => 'Lagerliste',
@@ -44,10 +43,8 @@ $self->{texts} = {
   'Dependency loop detected:'   => 'Schleife in den Abh&auml;ngigkeiten entdeckt:',
   'Description'                 => 'Beschreibung',
   'Discount'                    => 'Rabatt',
-  'Duedate +Days'               => 'Fällikeitsdatum +Tage',
   'Dunning Date'                => 'Mahndatum',
   'Dunning Date from'           => 'Mahnungen von',
-  'Dunning Description'         => 'Mahnstufenbeschreibung',
   'Dunning Description missing in row ' => 'Mahnstufenbeschreibung fehlt in Zeile ',
   'Dunning Duedate'             => 'Zahlbar bis',
   'Dunning Level'               => 'Mahnlevel',
@@ -67,14 +64,11 @@ gestartet',
   'Fax'                         => 'Fax',
   'Feb'                         => 'Feb',
   'February'                    => 'Februar',
-  'Fee'                         => 'Gebühr',
-  'Fristsetzung'                => 'Fristsetzung',
   'Group'                       => 'Warengruppe',
   'Group Invoices'              => 'Rechnungen zusammenfassen',
   'History'                     => 'Historie',
   'In-line'                     => 'im Text',
   'Interest'                    => 'Zinsen',
-  'Interest Rate'               => 'Zinssatz',
   'Inv. Duedate'                => 'Rg. Fälligkeit',
   'Invdate'                     => 'Rechnungsdatum',
   'Invdate from'                => 'Rechnungen von',
@@ -161,7 +155,6 @@ gestartet',
   'SAVED FOR DUNNING'           => 'Gespeichert',
   'SCREENED'                    => 'Angezeigt',
   'Sales Order'                 => 'Kundenauftrag',
-  'Save'                        => 'Speichern',
   'Screen'                      => 'Bildschirm',
   'Search Dunning'              => 'Mahnung suchen',
   'Select a Customer'           => 'Endkunde auswählen',
@@ -188,7 +181,6 @@ gestartet',
   'Storno Packing List'         => 'Stornolieferschein',
   'Street'                      => 'Straße',
   'Subtotal'                    => 'Zwischensumme',
-  'Template'                    => 'Druckvorlage',
   'Terms missing in row '       => '+Tage fehlen in Zeile ',
   'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.',
   'The dunning process started' => 'Der Mahnprozess ist gestartet.',
@@ -206,7 +198,6 @@ gestartet',
   'Zipcode'                     => 'PLZ',
   'bin_list'                    => 'Lagerliste',
   'button'                      => '?',
-  'eMail Send?'                 => 'eMail-Versand?',
   'eMail?'                      => 'eMail?',
   'emailed to'                  => 'gemailt an',
   'invoice'                     => 'Rechnung',
index 31a973a..4886d1d 100644 (file)
@@ -1,5 +1,6 @@
 $self->{texts} = {
   'Logout'                      => 'Abmeldung',
+  'User'                        => 'Benutzer',
 };
 
 $self->{subs} = {
diff --git a/templates/webpages/dunning/edit_config_de.html b/templates/webpages/dunning/edit_config_de.html
new file mode 100644 (file)
index 0000000..741108f
--- /dev/null
@@ -0,0 +1,94 @@
+<body>
+ <script type="text/javascript" src="js/common.js"></script>
+ <script type="text/javascript" src="js/dunning.js"></script>
+
+ <div class="listtop" width="100%"><TMPL_VAR title></div>
+
+ <form method="post" action="dn.pl">
+  <table>
+   <tr height="5"></tr>
+
+   <tr>
+    <th class="listheading">Mahnlevel</th>
+    <th class="listheading">Mahnstufenbeschreibung</th>
+    <th class="listheading">Aktiviert?</th>
+    <th class="listheading">Auto. Versand?</th>
+    <th class="listheading">eMail-Versand?</th>
+    <th class="listheading">Fristsetzung</th>
+    <th class="listheading">Fällikeitsdatum +Tage</th>
+    <th class="listheading">Gebühr</th>
+    <th class="listheading">Zinssatz</th>
+    <th class="listheading">Druckvorlage</th>
+   </tr>
+
+   <TMPL_LOOP DUNNING>
+    <tr valign="top" class="listrow<TMPL_IF __odd__>1<TMPL_ELSE>0</TMPL_IF>">
+     <td>
+      <input type="hidden" name="dunning_level_<TMPL_VAR __counter__>" size="2" value="<TMPL_VAR __counter__>">
+      <input type="hidden" name="id_<TMPL_VAR __counter__>" value="<TMPL_VAR id ESCAPE=HTML>">
+      <TMPL_VAR __counter__>
+     </td>
+
+     <td><input name="dunning_description_<TMPL_VAR __counter__>" value="<TMPL_VAR dunning_description ESCAPE=HTML>"></td>
+     <td><input type="checkbox" name="active_<TMPL_VAR __counter__>" value="1" <TMPL_IF active>checked</TMPL_IF>></td>
+
+     <td>
+      <input type="checkbox" name="email_<TMPL_VAR __counter__>" value="1" <TMPL_IF email>checked</TMPL_IF>>
+      <button type="button" onclick="set_email_window('email_subject_<TMPL_VAR __counter__>', 'email_body_<TMPL_VAR __counter__>', 'email_attachment_<TMPL_VAR __counter__>')">
+       L</button>
+      <input type="hidden" name="email_body_<TMPL_VAR __counter__>" value="<TMPL_VAR email_body ESCAPE=HTML>">
+      <input type="hidden" name="email_subject_<TMPL_VAR __counter__>" value="<TMPL_VAR email_subject ESCAPE=HTML>">
+      <input type="hidden" name="email_attachment_<TMPL_VAR __counter__>" value="<TMPL_VAR email_attachment ESCAPE=HTML>">
+     </td>
+
+     <td><input type="checkbox" name="auto_<TMPL_VAR __counter__>" value="1" <TMPL_IF auto>checked</TMPL_IF>></td>
+     <td><input name="payment_terms_<TMPL_VAR __counter__>" size="3" value="<TMPL_VAR payment_terms ESCAPE=HTML>"></td>
+     <td><input name="terms_<TMPL_VAR __counter__>" size="3" value="<TMPL_VAR terms ESCAPE=HTML>"></td>
+     <td><input name="fee_<TMPL_VAR __counter__>" size="5" value="<TMPL_VAR fee ESCAPE=HTML>"></td>
+     <td><input name="interest_rate_<TMPL_VAR __counter__>" size="4" value="<TMPL_VAR interest ESCAPE=HTML>">%</td>
+     <td><input name="template_<TMPL_VAR __counter__>" value="<TMPL_VAR template ESCAPE=HTML>"></td>
+    </tr>
+   </TMPL_LOOP>
+
+   <tr valign="top" class="listrow<TMPL_IF rowcount_odd>1<TMPL_ELSE>0</TMPL_IF>">
+    <td>
+     <input type="hidden" name="dunning_level_<TMPL_VAR rowcount>" size="2">
+     <input type="hidden" name="id_<TMPL_VAR rowcount>">
+     <TMPL_VAR rowcount>
+    </td>
+
+    <td><input name="dunning_description_<TMPL_VAR rowcount>"></td>
+    <td><input type="checkbox" name="active_<TMPL_VAR rowcount>" value="1" checked></td>
+
+    <td>
+     <input type="checkbox" name="email_<TMPL_VAR rowcount>" value="1" checked>
+     <button type="button" onclick="set_email_window('email_subject_<TMPL_VAR rowcount>', 'email_body_<TMPL_VAR rowcount>', 'email_attachment_<TMPL_VAR rowcount>')">
+      L</button>
+     <input type="hidden" name="email_body_<TMPL_VAR rowcount>">
+     <input type="hidden" name="email_subject_<TMPL_VAR rowcount>">
+     <input type="hidden" name="email_attachment_<TMPL_VAR rowcount>">
+    </td>
+
+    <td><input type="checkbox" name="auto_<TMPL_VAR rowcount>" value="1" checked></td>
+    <td><input name="payment_terms_<TMPL_VAR rowcount>" size="3"></td>
+    <td><input name="terms_<TMPL_VAR rowcount>" size="3"></td>
+    <td><input name="fee_<TMPL_VAR rowcount>" size="5"></td>
+    <td><input name="interest_rate_<TMPL_VAR rowcount>" size="4">%</td>
+    <td><input name="template_<TMPL_VAR rowcount>"></td>
+   </tr>
+  </table>
+
+  <hr size="3" noshade>
+
+  <input type="hidden" name="rowcount" value="<TMPL_VAR rowcount ESCAPE=HTML>">
+  <input type="hidden" name="callback" value="<TMPL_VAR callback ESCAPE=HTML>">
+
+  <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
+  <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
+
+  <input class="submit" type="submit" name="action" value="Speichern">
+
+ </form>
+</body>
+
+</html>
diff --git a/templates/webpages/dunning/edit_config_master.html b/templates/webpages/dunning/edit_config_master.html
new file mode 100644 (file)
index 0000000..ac336cb
--- /dev/null
@@ -0,0 +1,94 @@
+<body>
+ <script type="text/javascript" src="js/common.js"></script>
+ <script type="text/javascript" src="js/dunning.js"></script>
+
+ <div class="listtop" width="100%"><TMPL_VAR title></div>
+
+ <form method="post" action="dn.pl">
+  <table>
+   <tr height="5"></tr>
+
+   <tr>
+    <th class="listheading"><translate>Dunning Level</translate></th>
+    <th class="listheading"><translate>Dunning Description</translate></th>
+    <th class="listheading"><translate>Active?</translate></th>
+    <th class="listheading"><translate>Auto Send?</translate></th>
+    <th class="listheading"><translate>eMail Send?</translate></th>
+    <th class="listheading"><translate>Fristsetzung</translate></th>
+    <th class="listheading"><translate>Duedate +Days</translate></th>
+    <th class="listheading"><translate>Fee</translate></th>
+    <th class="listheading"><translate>Interest Rate</translate></th>
+    <th class="listheading"><translate>Template</translate></th>
+   </tr>
+
+   <TMPL_LOOP DUNNING>
+    <tr valign="top" class="listrow<TMPL_IF __odd__>1<TMPL_ELSE>0</TMPL_IF>">
+     <td>
+      <input type="hidden" name="dunning_level_<TMPL_VAR __counter__>" size="2" value="<TMPL_VAR __counter__>">
+      <input type="hidden" name="id_<TMPL_VAR __counter__>" value="<TMPL_VAR id ESCAPE=HTML>">
+      <TMPL_VAR __counter__>
+     </td>
+
+     <td><input name="dunning_description_<TMPL_VAR __counter__>" value="<TMPL_VAR dunning_description ESCAPE=HTML>"></td>
+     <td><input type="checkbox" name="active_<TMPL_VAR __counter__>" value="1" <TMPL_IF active>checked</TMPL_IF>></td>
+
+     <td>
+      <input type="checkbox" name="email_<TMPL_VAR __counter__>" value="1" <TMPL_IF email>checked</TMPL_IF>>
+      <button type="button" onclick="set_email_window('email_subject_<TMPL_VAR __counter__>', 'email_body_<TMPL_VAR __counter__>', 'email_attachment_<TMPL_VAR __counter__>')">
+       <translate>L</translate></button>
+      <input type="hidden" name="email_body_<TMPL_VAR __counter__>" value="<TMPL_VAR email_body ESCAPE=HTML>">
+      <input type="hidden" name="email_subject_<TMPL_VAR __counter__>" value="<TMPL_VAR email_subject ESCAPE=HTML>">
+      <input type="hidden" name="email_attachment_<TMPL_VAR __counter__>" value="<TMPL_VAR email_attachment ESCAPE=HTML>">
+     </td>
+
+     <td><input type="checkbox" name="auto_<TMPL_VAR __counter__>" value="1" <TMPL_IF auto>checked</TMPL_IF>></td>
+     <td><input name="payment_terms_<TMPL_VAR __counter__>" size="3" value="<TMPL_VAR payment_terms ESCAPE=HTML>"></td>
+     <td><input name="terms_<TMPL_VAR __counter__>" size="3" value="<TMPL_VAR terms ESCAPE=HTML>"></td>
+     <td><input name="fee_<TMPL_VAR __counter__>" size="5" value="<TMPL_VAR fee ESCAPE=HTML>"></td>
+     <td><input name="interest_rate_<TMPL_VAR __counter__>" size="4" value="<TMPL_VAR interest ESCAPE=HTML>">%</td>
+     <td><input name="template_<TMPL_VAR __counter__>" value="<TMPL_VAR template ESCAPE=HTML>"></td>
+    </tr>
+   </TMPL_LOOP>
+
+   <tr valign="top" class="listrow<TMPL_IF rowcount_odd>1<TMPL_ELSE>0</TMPL_IF>">
+    <td>
+     <input type="hidden" name="dunning_level_<TMPL_VAR rowcount>" size="2">
+     <input type="hidden" name="id_<TMPL_VAR rowcount>">
+     <TMPL_VAR rowcount>
+    </td>
+
+    <td><input name="dunning_description_<TMPL_VAR rowcount>"></td>
+    <td><input type="checkbox" name="active_<TMPL_VAR rowcount>" value="1" checked></td>
+
+    <td>
+     <input type="checkbox" name="email_<TMPL_VAR rowcount>" value="1" checked>
+     <button type="button" onclick="set_email_window('email_subject_<TMPL_VAR rowcount>', 'email_body_<TMPL_VAR rowcount>', 'email_attachment_<TMPL_VAR rowcount>')">
+      <translate>L</translate></button>
+     <input type="hidden" name="email_body_<TMPL_VAR rowcount>">
+     <input type="hidden" name="email_subject_<TMPL_VAR rowcount>">
+     <input type="hidden" name="email_attachment_<TMPL_VAR rowcount>">
+    </td>
+
+    <td><input type="checkbox" name="auto_<TMPL_VAR rowcount>" value="1" checked></td>
+    <td><input name="payment_terms_<TMPL_VAR rowcount>" size="3"></td>
+    <td><input name="terms_<TMPL_VAR rowcount>" size="3"></td>
+    <td><input name="fee_<TMPL_VAR rowcount>" size="5"></td>
+    <td><input name="interest_rate_<TMPL_VAR rowcount>" size="4">%</td>
+    <td><input name="template_<TMPL_VAR rowcount>"></td>
+   </tr>
+  </table>
+
+  <hr size="3" noshade>
+
+  <input type="hidden" name="rowcount" value="<TMPL_VAR rowcount ESCAPE=HTML>">
+  <input type="hidden" name="callback" value="<TMPL_VAR callback ESCAPE=HTML>">
+
+  <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
+  <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
+
+  <input class="submit" type="submit" name="action" value="<translate>Save</translate>">
+
+ </form>
+</body>
+
+</html>