Merge branch 'clients'
[kivitendo-erp.git] / bin / mozilla / amcvar.pl
index c0a0e88..343350a 100644 (file)
@@ -55,11 +55,14 @@ our %translations = ('text'      => $locale->text('Free-form text'),
                      'bool'      => $locale->text('Yes/No (Checkbox)'),
                      'select'    => $locale->text('Selection'),
                      'customer'  => $locale->text('Customer'),
+                     'vendor'    => $locale->text('Vendor'),
+                     'part'      => $locale->text('Part'),
                      );
 
-our @types = qw(text textfield number date bool select customer); # timestamp
+our @types = qw(text textfield number date bool select customer vendor part); # timestamp
 
 our @modules = ({ module => 'CT',       description => $locale->text('Customers and vendors')          },
+                { module => 'Contacts', description => $locale->text('Contact persons')                },
                 { module => 'IC',       description => $locale->text('Parts, services and assemblies') },
                 { module => 'Projects', description => $locale->text('Projects')                       },
                );
@@ -211,11 +214,27 @@ sub display_cvar_config_form {
   $main::lxdebug->leave_sub();
 }
 
+sub update {
+  $main::lxdebug->enter_sub();
+
+  my $form     = $main::form;
+
+  $main::auth->assert('config');
+
+  $form->{included_by_default} = $form->{inclusion} eq 'yes_default_on';
+  $form->{includeable}         = $form->{inclusion} ne 'no';
+
+  display_cvar_config_form();
+
+  $main::lxdebug->leave_sub();
+}
+
+
 sub dispatcher {
   my $form     = $main::form;
   my $locale   = $main::locale;
 
-  foreach my $action (qw(list_cvar_configs add_cvar_config)) {
+  foreach my $action (qw(list_cvar_configs add_cvar_config update)) {
     if ($form->{"action_${action}"}) {
       call_sub($action);
       return;
@@ -226,3 +245,4 @@ sub dispatcher {
 }
 
 1;
+