Filtermaske für Kunden- und Liferantenstammdatenliste auf HTML-Templates umgestellt.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 19 Jun 2007 15:42:26 +0000 (15:42 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 19 Jun 2007 15:42:26 +0000 (15:42 +0000)
bin/mozilla/ct.pl
locale/de/all
locale/de/ct
templates/webpages/ct/search_de.html [new file with mode: 0644]
templates/webpages/ct/search_master.html [new file with mode: 0644]

index d0510e8..e3b516b 100644 (file)
@@ -71,149 +71,17 @@ sub add {
 sub search {
   $lxdebug->enter_sub();
 
-  my $vc_business_type = $form->{db} eq "customer" ?
-    $locale->text("Customer type") : $locale->text("Vendor type");
+  $form->{IS_CUSTOMER} = $form->{db} eq 'customer';
 
   $form->get_lists("business_types" => "ALL_BUSINESS_TYPES");
-  my (%labels, @values);
-
-  my $business_types;
-  if (scalar(@{ $form->{ALL_BUSINESS_TYPES} }) != 0) {
-    push(@values, undef);
-    foreach my $item (@{ $form->{ALL_BUSINESS_TYPES} }) {
-      push(@values, $item->{id});
-      $labels{$item->{id}} = $item->{description};
-    }
+  $form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0;
 
-    $business_types =
-      qq|  <tr>
-    <th align="right" nowrap>${vc_business_type}</th>
-    <td>|
-      . NTI($cgi->popup_menu('-name' => 'business_id', '-values' => \@values,
-                             '-labels' => \%labels))
-      . qq|</td>
-  </tr>
-|;
-  }
-
-  $label = ucfirst $form->{db};
-  $form->{title} = $locale->text($label . "s");
+  $form->{title} = $form->{IS_CUSTOMER} ? $locale->text('Customers') : $locale->text('Vendors');
   $form->{fokus} = 'Form.name';
 
-  $form->header;
-
-  print qq|
-<body onload="fokus()">
-
-<form method=post action=$form->{script} name="Form">
-
-<input type=hidden name=db value=$form->{db}>
-
-<table width=100%>
-  <tr>
-    <th class=listtop>$form->{title}</th>
-  </tr>
-  <tr height="5"></tr>
-  <tr valign=top>
-    <td>
-      <table>
-       <tr>
-         <th align=right nowrap>| . $locale->text($label . ' Number') . qq|</th>
-         <td><input name=$form->{db}number size=35></td>
-       </tr>
-       <tr>
-         <th align=right nowrap>| . $locale->text('Company Name') . qq|</th>
-         <td><input name=name size=35></td>
-       </tr>
-       <tr>
-         <th align=right nowrap>| . $locale->text('Contact') . qq|</th>
-         <td><input name=contact size=35></td>
-       </tr>
-       <tr>
-         <th align=right nowrap>| . $locale->text('E-mail') . qq|</th>
-         <td><input name=email size=35></td>
-       </tr>
-  $business_types
-       <tr>
-         <td></td>
-         <td><input name=status class=radio type=radio value=all checked>&nbsp;|
-    . $locale->text('All') . qq|
-         <input name=status class=radio type=radio value=orphaned>&nbsp;|
-    . $locale->text('Orphaned') . qq|</td>
-       </tr>
-       <tr>
-         <td></td>
-         <td><input name="obsolete" class="radio" type="radio" value="all">&nbsp;|
-    . $locale->text('All') . qq|
-         <input name="obsolete" class="radio" type="radio" value="Y">&nbsp;|
-    . $locale->text('Obsolete') . qq|
-         <input name="obsolete" class="radio" type="radio" value="N" checked>&nbsp;|
-    . $locale->text('Not obsolete') . qq|</td>
-       </tr>
-       <tr>
-         <th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
-         <td>
-           <table>
-             <tr>
-               <td><input name="l_id" type=checkbox class=checkbox value=Y> |
-    . $locale->text('ID') . qq|</td>
-               <td><input name="l_$form->{db}number" type=checkbox class=checkbox value=Y> |
-    . $locale->text($label . ' Number') . qq|</td>
-               <td><input name="l_name" type=checkbox class=checkbox value=Y checked> |
-    . $locale->text('Company Name') . qq|</td>
-               <td><input name="l_address" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Address') . qq|</td>
-             </tr>
-             <tr>
-               <td><input name="l_contact" type=checkbox class=checkbox value=Y checked> |
-    . $locale->text('Contact') . qq|</td>
-               <td><input name="l_phone" type=checkbox class=checkbox value=Y checked> |
-    . $locale->text('Phone') . qq|</td>
-               <td><input name="l_fax" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Fax') . qq|</td>
-               <td><input name="l_email" type=checkbox class=checkbox value=Y checked> |
-    . $locale->text('E-mail') . qq|</td>
-             </tr>
-             <tr>
-               <td><input name="l_taxnumber" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Tax Number') . qq|</td>
-               <td><input name="l_sic_code" type=checkbox class=checkbox value=Y> |
-    . $locale->text('SIC') . qq|</td>
-               <td><input name="l_business" type=checkbox class=checkbox value=Y> |
-    . $vc_business_type . qq|</td>
-             </tr>
-             <tr>
-               <td><input name="l_invnumber" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Invoices') . qq|</td>
-               <td><input name="l_ordnumber" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Orders') . qq|</td>
-               <td><input name="l_quonumber" type=checkbox class=checkbox value=Y> |
-    . $locale->text('Quotations') . qq|</td>
-             </tr>
-           </table>
-         </td>
-       </tr>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td><hr size=3 noshade></td>
-  </tr>
-</table>
-
-<input type=hidden name=nextsub value=list_names>
+  $form->header();
+  print $form->parse_html_template2('ct/search');
 
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<br>
-<input type=submit class=submit name=action value="|
-    . $locale->text('Continue') . qq|">
-</form>
-
-</body>
-</html>
-|;
   $lxdebug->leave_sub();
 }
 
index 8841566..54f2df4 100644 (file)
@@ -789,7 +789,6 @@ aktualisieren wollen?',
   'Order Number missing!'       => 'Auftragsnummer fehlt!',
   'Order deleted!'              => 'Auftrag gelöscht!',
   'Ordered'                     => 'Vom Kunde bestellt',
-  'Orders'                      => 'Aufträge',
   'Orientation'                 => 'Seitenformat',
   'Orphaned'                    => 'Nie benutzt',
   'Out of balance transaction!' => 'Buchung ist nicht ausgeglichen!',
@@ -1335,7 +1334,6 @@ aktualisieren wollen?',
   'request_quotation'           => 'Angebotsanforderung',
   'reset'                       => 'zurücksetzen',
   'rfq_list'                    => 'anfragenliste',
-  's'                           => 's',
   'sales_order'                 => 'Kundenauftrag',
   'sales_order_list'            => 'auftragsliste',
   'sales_quotation'             => 'Verkaufsangebot',
index 121e5ab..8876c83 100644 (file)
@@ -24,7 +24,6 @@ $self->{texts} = {
   'Company Name'                => 'Firmenname',
   'Confirmation'                => 'Auftragsbestätigung',
   'Contact'                     => 'Kontakt',
-  'Continue'                    => 'Weiter',
   'Could not spawn html2ps or GhostScript.' => 'html2ps oder GhostScript konnte nicht gestartet werden.',
   'Could not spawn the printer command.' => 'Die Druckanwendung konnte nicht gestartet werden.',
   'Could not write the html2ps config file.' => 'Die tempor&auml;re html2ps-Konfigurationsdatei konnte nicht geschrieben werden.',
@@ -36,7 +35,6 @@ $self->{texts} = {
   'Customer deleted!'           => 'Kunde gelöscht!',
   'Customer details'            => 'Kundendetails',
   'Customer saved!'             => 'Kunde gespeichert!',
-  'Customer type'               => 'Kundentyp',
   'Customers'                   => 'Kunden',
   'DELETED'                     => 'Gelöscht',
   'DUNNING STARTED'             => 'Mahnprozess gestartet',
@@ -59,10 +57,8 @@ $self->{texts} = {
   'History'                     => 'Historie',
   'Homepage'                    => 'Homepage',
   'ID'                          => 'Buchungsnummer',
-  'Include in Report'           => 'In Bericht aufnehmen',
   'Invdate'                     => 'Rechnungsdatum',
   'Invoice'                     => 'Rechnung',
-  'Invoices'                    => 'Rechnungen',
   'KNr. beim Kunden'            => 'KNr. beim Kunden',
   'Kundennummer'                => 'Kundennummer',
   'Language'                    => 'Sprache',
@@ -85,12 +81,10 @@ $self->{texts} = {
   'No part was found matching the search parameters.' => 'Es wurde kein Artikel gefunden, auf den die Suchparameter zutreffen.',
   'No project was found matching the search parameters.' => 'Es wurde kein Projekt gefunden, auf das die Suchparameter zutreffen.',
   'No vendor has been selected yet.' => 'Es wurde noch kein Lieferant ausgewählt.',
-  'Not obsolete'                => 'Gültig',
   'Notes'                       => 'Bemerkungen',
   'Number'                      => 'Nummer',
   'Obsolete'                    => 'Ungültig',
   'Order'                       => 'Auftrag',
-  'Orders'                      => 'Aufträge',
   'Orphaned'                    => 'Nie benutzt',
   'PAYMENT POSTED'              => 'Rechung gebucht',
   'PDF export -- options'       => 'PDF-Export -- Optionen',
@@ -116,7 +110,6 @@ $self->{texts} = {
   'Purchase Order'              => 'Lieferantenauftrag',
   'Qty'                         => 'Menge',
   'Quotation'                   => 'Angebot',
-  'Quotations'                  => 'Angebote',
   'RFQ'                         => 'Anfrage',
   'Request for Quotation'       => 'Anfrage',
   'SAVED'                       => 'Gespeichert',
@@ -163,7 +156,6 @@ $self->{texts} = {
   'Vendor deleted!'             => 'Lieferant gelöscht!',
   'Vendor details'              => 'Lieferantendetails',
   'Vendor saved!'               => 'Lieferant gespeichert!',
-  'Vendor type'                 => 'Lieferantentyp',
   'Vendors'                     => 'Lieferanten',
   'Zipcode'                     => 'PLZ',
   'bin_list'                    => 'Lagerliste',
@@ -179,7 +171,6 @@ $self->{texts} = {
   'report_generator_dispatch_to is not defined.' => 'report_generator_dispatch_to ist nicht definiert.',
   'report_generator_nextsub is not defined.' => 'report_generator_nextsub ist nicht definiert.',
   'request_quotation'           => 'Angebotsanforderung',
-  's'                           => 's',
   'sales_order'                 => 'Kundenauftrag',
   'sales_quotation'             => 'Verkaufsangebot',
   'vendor_list'                 => 'lieferantenliste',
diff --git a/templates/webpages/ct/search_de.html b/templates/webpages/ct/search_de.html
new file mode 100644 (file)
index 0000000..512778e
--- /dev/null
@@ -0,0 +1,142 @@
+[% USE HTML %]<body onload="fokus()">
+
+ <form method="post" action="ct.pl" name="Form">
+
+  <input type="hidden" name="db" value="[% HTML.escape(db) %]">
+
+  <div class="listtop" width="100%">[% title %]</div>
+
+  <table>
+   <tr>
+    <th align="right" nowrap>[% IF IS_CUSTOMER %]Kundennummer[% ELSE %]Lieferantennummer[% END %]</th>
+    <td><input name="[% IF IS_CUSTOMER %]customer[% ELSE %]vendor[% END %]number" size="35"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap>Firmenname</th>
+    <td><input name="name" size="35"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap>Kontakt</th>
+    <td><input name="contact" size="35"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap>eMail</th>
+    <td><input name="email" size="35"></td>
+   </tr>
+
+   [% IF SHOW_BUSINESS_TYPES %]
+   <tr>
+    <th align="right" nowrap>[% IF IS_CUSTOMER %]Kundentyp[% ELSE %]Lieferantentyp[% END %]</th>
+    <td>
+     <select name="business_id"><option value=""></option>
+      [% FOREACH bt = ALL_BUSINESS_TYPES %]<option value="[% HTML.escape(bt.id) %]">[% HTML.escape(bt.description) %]</option>[% END %]
+     </select>
+    </td>
+   </tr>
+   [% END %]
+
+   <tr>
+    <td></td>
+    <td>
+     <input name="status" class="radio" type="radio" value="all" checked> Alle
+     <input name="status" class="radio" type="radio" value="orphaned"> Nie benutzt
+    </td>
+   </tr>
+
+   <tr>
+    <td></td>
+    <td><input name="obsolete" class="radio" type="radio" value="all"> Alle
+     <input name="obsolete" class="radio" type="radio" value="Y"> Ungültig
+     <input name="obsolete" class="radio" type="radio" value="N" checked> Gültig
+    </td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap>In Bericht aufnehmen</th>
+    <td>
+     <table>
+      <tr>
+       <td>
+        <input name="l_id" id="l_id" type="checkbox" class="checkbox" value="Y">
+        <label for="l_id">Buchungsnummer</label>
+       </td>
+       <td>
+        <input name="l_[% db %]number" id="l_[% db %]number" type="checkbox" class="checkbox" value="Y">
+        <label for="l_[% db %]number">[% IF IS_CUSTOMER %]Kundennummer[% ELSE %]Lieferantennummer[% END %]</label>
+       </td>
+       <td>
+        <input name="l_name" id="l_name" type="checkbox" class="checkbox" value="Y" checked>
+        <label for="l_name">Firmenname</label>
+       </td>
+       <td>
+        <input name="l_address" id="l_address" type="checkbox" class="checkbox" value="Y">
+        <label for="l_address">Adresse</label>
+       </td>
+      </tr>
+
+      <tr>
+       <td>
+        <input name="l_contact" id="l_contact" type="checkbox" class="checkbox" value="Y" checked>
+        <label for="l_contact">Kontakt</label>
+       </td>
+       <td>
+        <input name="l_phone" id="l_phone" type="checkbox" class="checkbox" value="Y" checked>
+        <label for="l_phone">Telefon</label>
+       </td>
+       <td>
+        <input name="l_fax" id="l_fax" type="checkbox" class="checkbox" value="Y">
+        <label for="l_fax">Fax</label>
+       </td>
+       <td>
+        <input name="l_email" id="l_email" type="checkbox" class="checkbox" value="Y" checked>
+        <label for="l_email">eMail</label>
+       </td>
+      </tr>
+
+      <tr>
+       <td>
+        <input name="l_taxnumber" id="l_taxnumber" type="checkbox" class="checkbox" value="Y">
+        <label for="l_taxnumber">Steuernummer</label>
+       </td>
+       <td>
+        <input name="l_sic_code" id="l_sic_code" type="checkbox" class="checkbox" value="Y">
+        <label for="l_sic_code">SIC</label>
+       </td>
+       <td>
+        <input name="l_business" id="l_business" type="checkbox" class="checkbox" value="Y">
+        <label for="l_business">[% IF IS_CUSTOMER %]Kundentyp[% ELSE %]Lieferantentyp[% END %]</label>
+       </td>
+      </tr>
+
+      <tr>
+       <td>
+        <input name="l_invnumber" id="l_invnumber" type="checkbox" class="checkbox" value="Y">
+        <label for="l_invnumber">Rechnungen</label>
+       </td>
+       <td>
+        <input name="l_ordnumber" id="l_ordnumber" type="checkbox" class="checkbox" value="Y">
+        <label for="l_ordnumber">[% IF IS_CUSTOMER %]Aufträge[% ELSE %]Lieferantenaufträge[% END %]</label>
+       </td>
+       <td>
+        <input name="l_quonumber" id="l_quonumber" type="checkbox" class="checkbox" value="Y">
+        <label for="l_quonumber">[% IF IS_CUSTOMER %]Angebote[% ELSE %]Preisanfragen[% END %]</label>
+       </td>
+      </tr>
+     </table>
+    </td>
+   </tr>
+  </table>
+
+  <input type="hidden" name="nextsub" value="list_names">
+
+  <input type="hidden" name="login" value="[% HTML.escape(login) %]">
+  <input type="hidden" name="password" value="[% HTML.escape(password) %]">
+
+  <input type="submit" class="submit" name="action" value="Weiter">
+ </form>
+
+</body>
+</html>
diff --git a/templates/webpages/ct/search_master.html b/templates/webpages/ct/search_master.html
new file mode 100644 (file)
index 0000000..6c4a0ff
--- /dev/null
@@ -0,0 +1,142 @@
+[% USE HTML %]<body onload="fokus()">
+
+ <form method="post" action="ct.pl" name="Form">
+
+  <input type="hidden" name="db" value="[% HTML.escape(db) %]">
+
+  <div class="listtop" width="100%">[% title %]</div>
+
+  <table>
+   <tr>
+    <th align="right" nowrap>[% IF IS_CUSTOMER %]<translate>Customer Number</translate>[% ELSE %]<translate>Vendor Number</translate>[% END %]</th>
+    <td><input name="[% IF IS_CUSTOMER %]customer[% ELSE %]vendor[% END %]number" size="35"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap><translate>Company Name</translate></th>
+    <td><input name="name" size="35"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap><translate>Contact</translate></th>
+    <td><input name="contact" size="35"></td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap><translate>E-mail</translate></th>
+    <td><input name="email" size="35"></td>
+   </tr>
+
+   [% IF SHOW_BUSINESS_TYPES %]
+   <tr>
+    <th align="right" nowrap>[% IF IS_CUSTOMER %]<translate>Customer type</translate>[% ELSE %]<translate>Vendor type</translate>[% END %]</th>
+    <td>
+     <select name="business_id"><option value=""></option>
+      [% FOREACH bt = ALL_BUSINESS_TYPES %]<option value="[% HTML.escape(bt.id) %]">[% HTML.escape(bt.description) %]</option>[% END %]
+     </select>
+    </td>
+   </tr>
+   [% END %]
+
+   <tr>
+    <td></td>
+    <td>
+     <input name="status" class="radio" type="radio" value="all" checked> <translate>All</translate>
+     <input name="status" class="radio" type="radio" value="orphaned"> <translate>Orphaned</translate>
+    </td>
+   </tr>
+
+   <tr>
+    <td></td>
+    <td><input name="obsolete" class="radio" type="radio" value="all"> <translate>All</translate>
+     <input name="obsolete" class="radio" type="radio" value="Y"> <translate>Obsolete</translate>
+     <input name="obsolete" class="radio" type="radio" value="N" checked> <translate>Not obsolete</translate>
+    </td>
+   </tr>
+
+   <tr>
+    <th align="right" nowrap><translate>Include in Report</translate></th>
+    <td>
+     <table>
+      <tr>
+       <td>
+        <input name="l_id" id="l_id" type="checkbox" class="checkbox" value="Y">
+        <label for="l_id"><translate>ID</translate></label>
+       </td>
+       <td>
+        <input name="l_[% db %]number" id="l_[% db %]number" type="checkbox" class="checkbox" value="Y">
+        <label for="l_[% db %]number">[% IF IS_CUSTOMER %]<translate>Customer Number</translate>[% ELSE %]<translate>Vendor Number</translate>[% END %]</label>
+       </td>
+       <td>
+        <input name="l_name" id="l_name" type="checkbox" class="checkbox" value="Y" checked>
+        <label for="l_name"><translate>Company Name</translate></label>
+       </td>
+       <td>
+        <input name="l_address" id="l_address" type="checkbox" class="checkbox" value="Y">
+        <label for="l_address"><translate>Address</translate></label>
+       </td>
+      </tr>
+
+      <tr>
+       <td>
+        <input name="l_contact" id="l_contact" type="checkbox" class="checkbox" value="Y" checked>
+        <label for="l_contact"><translate>Contact</translate></label>
+       </td>
+       <td>
+        <input name="l_phone" id="l_phone" type="checkbox" class="checkbox" value="Y" checked>
+        <label for="l_phone"><translate>Phone</translate></label>
+       </td>
+       <td>
+        <input name="l_fax" id="l_fax" type="checkbox" class="checkbox" value="Y">
+        <label for="l_fax"><translate>Fax</translate></label>
+       </td>
+       <td>
+        <input name="l_email" id="l_email" type="checkbox" class="checkbox" value="Y" checked>
+        <label for="l_email"><translate>E-mail</translate></label>
+       </td>
+      </tr>
+
+      <tr>
+       <td>
+        <input name="l_taxnumber" id="l_taxnumber" type="checkbox" class="checkbox" value="Y">
+        <label for="l_taxnumber"><translate>Tax Number</translate></label>
+       </td>
+       <td>
+        <input name="l_sic_code" id="l_sic_code" type="checkbox" class="checkbox" value="Y">
+        <label for="l_sic_code"><translate>SIC</translate></label>
+       </td>
+       <td>
+        <input name="l_business" id="l_business" type="checkbox" class="checkbox" value="Y">
+        <label for="l_business">[% IF IS_CUSTOMER %]<translate>Customer type</translate>[% ELSE %]<translate>Vendor type</translate>[% END %]</label>
+       </td>
+      </tr>
+
+      <tr>
+       <td>
+        <input name="l_invnumber" id="l_invnumber" type="checkbox" class="checkbox" value="Y">
+        <label for="l_invnumber"><translate>Invoices</translate></label>
+       </td>
+       <td>
+        <input name="l_ordnumber" id="l_ordnumber" type="checkbox" class="checkbox" value="Y">
+        <label for="l_ordnumber">[% IF IS_CUSTOMER %]<translate>Sales Orders</translate>[% ELSE %]<translate>Purchase Orders</translate>[% END %]</label>
+       </td>
+       <td>
+        <input name="l_quonumber" id="l_quonumber" type="checkbox" class="checkbox" value="Y">
+        <label for="l_quonumber">[% IF IS_CUSTOMER %]<translate>Quotations</translate>[% ELSE %]<translate>RFQs</translate>[% END %]</label>
+       </td>
+      </tr>
+     </table>
+    </td>
+   </tr>
+  </table>
+
+  <input type="hidden" name="nextsub" value="list_names">
+
+  <input type="hidden" name="login" value="[% HTML.escape(login) %]">
+  <input type="hidden" name="password" value="[% HTML.escape(password) %]">
+
+  <input type="submit" class="submit" name="action" value="<translate>Continue</translate>">
+ </form>
+
+</body>
+</html>