commit c1e220bf981826b7f5a804f9143da8076c37500c
Author: Sven Schöling <s.schoeling@googlemail.com>
Date:   Tue Oct 13 14:02:53 2009 +0200

    CVars: In Masken die Cvars filtern. Muss über Userpräferenzen aktiviert werden.

diff --git a/SL/CVar.pm b/SL/CVar.pm
index 6b603d8ab..f9e2d8af5 100644
--- a/SL/CVar.pm
+++ b/SL/CVar.pm
@@ -388,6 +388,8 @@ sub render_search_options {
   my $myconfig = \%main::myconfig;
   my $form     = $main::form;
 
+  $params{hidden_cvar_filters} = $myconfig->{hide_cvar_search_options};
+
   $params{include_prefix}   = 'l_' unless defined($params{include_prefix});
   $params{include_value}  ||= '1';
 
diff --git a/SL/User.pm b/SL/User.pm
index 102b9382e..cde96f949 100644
--- a/SL/User.pm
+++ b/SL/User.pm
@@ -1002,7 +1002,7 @@ sub config_vars {
     bestellungen rechnungen anfragen lieferantenbestellungen einkaufsrechnungen
     taxnumber co_ustid duns menustyle template_format default_media
     default_printer_id copies show_form_details favorites
-    pdonumber sdonumber);
+    pdonumber sdonumber hide_cvar_search_options);
 
   $main::lxdebug->leave_sub();
 
diff --git a/locale/de/all b/locale/de/all
index 80bee63a2..557892970 100644
--- a/locale/de/all
+++ b/locale/de/all
@@ -1418,6 +1418,7 @@ $self->{texts} = {
   'Show'                        => 'Zeigen',
   'Show TODO list'              => 'Aufgabenliste anzeigen',
   'Show by default'             => 'Standardm&auml;&szlig;ig anzeigen',
+  'Show custom variable search inputs' => 'Suchoptionen f�r Benutzerdefinierte Variablen verstecken',
   'Show details'                => 'Details anzeigen',
   'Show follow ups...'          => 'Zeige Wiedervorlagen...',
   'Show old dunnings'           => 'Alte Mahnungen anzeigen',
@@ -1882,6 +1883,7 @@ $self->{texts} = {
   'chart_of_accounts'           => 'kontenuebersicht',
   'choice'                      => 'ausw�hlen',
   'choice part'                 => 'Artikel ausw�hlen',
+  'click here to edit cvars'    => 'Klicken Sie hier, um nach benutzerdefinierten Variablen zu suchen',
   'close'                       => 'schlie�en',
   'closed'                      => 'geschlossen',
   'config/authentication.pl: Key "DB_config" is missing.' => 'config/authentication.pl: Das Schl&uuml;sselwort "DB_config" fehlt.',
diff --git a/templates/webpages/am/config_de.html b/templates/webpages/am/config_de.html
index 82b4fb480..f064f8d99 100644
--- a/templates/webpages/am/config_de.html
+++ b/templates/webpages/am/config_de.html
@@ -147,6 +147,16 @@
        </select>
       </td>
      </tr>
+
+     <tr>
+      <th align="right">Suchoptionen f�r Benutzerdefinierte Variablen verstecken</th>
+      <td>
+       <select name="hide_cvar_search_options">
+        <option value="0"[% IF !myconfig_hide_cvar_search_options %] selected[% END %]>Standardm&auml;&szlig;ig anzeigen</option>
+        <option value="1"[% IF  myconfig_hide_cvar_search_options %] selected[% END %]>Standardm&auml;&szlig;ig verstecken</option>
+       </select>
+      </td>
+     </tr>
     </table>
 
     <br style="clear: left" />
diff --git a/templates/webpages/am/config_master.html b/templates/webpages/am/config_master.html
index 2c7faafde..e24919eb6 100644
--- a/templates/webpages/am/config_master.html
+++ b/templates/webpages/am/config_master.html
@@ -147,6 +147,16 @@
        </select>
       </td>
      </tr>
+
+     <tr>
+      <th align="right"><translate>Show custom variable search inputs</translate></th>
+      <td>
+       <select name="hide_cvar_search_options">
+        <option value="0"[% IF !myconfig_hide_cvar_search_options %] selected[% END %]><translate>Show by default</translate></option>
+        <option value="1"[% IF  myconfig_hide_cvar_search_options %] selected[% END %]><translate>Hide by default</translate></option>
+       </select>
+      </td>
+     </tr>
     </table>
 
     <br style="clear: left" />
diff --git a/templates/webpages/amcvar/search_filter_de.html b/templates/webpages/amcvar/search_filter_de.html
index 657609dd4..a8dbfe456 100644
--- a/templates/webpages/amcvar/search_filter_de.html
+++ b/templates/webpages/amcvar/search_filter_de.html
@@ -2,7 +2,7 @@
 
    [%- FOREACH var = variables %]
    [%- IF var.searchable %]
-   <tr>
+   <tr id='cvar_filter_[% var.name %]'>
     <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
     <td valign="top">
 
@@ -61,3 +61,10 @@
    </tr>
    [%- END %]
    [%- END %]
+[% IF hidden_cvar_filters %]
+   <tr><td></td><td colspan="3"><a href="#" id="cvar_filter-toggle"><i>Klicken Sie hier, um nach benutzerdefinierten Variablen zu suchen</i></a></td></tr>
+   <script type='text/javascript'>
+     $('#cvar_filter-toggle').click(function() { $('[id^="cvar_filter"]').toggle() });
+     $(document).ready(function(){ $('[id^="cvar_filter_"]').hide() });
+   </script>
+[% END %]
diff --git a/templates/webpages/amcvar/search_filter_master.html b/templates/webpages/amcvar/search_filter_master.html
index 796ecd60b..35274dcbf 100644
--- a/templates/webpages/amcvar/search_filter_master.html
+++ b/templates/webpages/amcvar/search_filter_master.html
@@ -2,7 +2,7 @@
 
    [%- FOREACH var = variables %]
    [%- IF var.searchable %]
-   <tr>
+   <tr id='cvar_filter_[% var.name %]'>
     <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
     <td valign="top">
 
@@ -61,3 +61,10 @@
    </tr>
    [%- END %]
    [%- END %]
+[% IF hidden_cvar_filters %]
+   <tr><td></td><td colspan="3"><a href="#" id="cvar_filter-toggle"><i><translate>click here to edit cvars</translate></i></a></td></tr>
+   <script type='text/javascript'>
+     $('#cvar_filter-toggle').click(function() { $('[id^="cvar_filter"]').toggle() });
+     $(document).ready(function(){ $('[id^="cvar_filter_"]').hide() });
+   </script>
+[% END %]
