IC: dispatcher wird nicht mehr gebraucht
[kivitendo-erp.git] / bin / mozilla / ic.pl
index d54e83d..022422b 100644 (file)
@@ -84,9 +84,6 @@ sub search {
   $form->{lastsort}     = ""; # memory for which table was sort at last time
   $form->{ndxs_counter} = 0;  # counter for added entries to top100
 
-  # for seach all possibibilities, is_service only used as UNLESS so == 0
-  my %is_xyz     = ("is_part" => 1, "is_service" => 0, "is_assembly" =>1 );
-
   $form->{title} = (ucfirst $form->{searchitems}) . "s";
   $form->{title} =~ s/ys$/ies/;
   $form->{title} = $locale->text($form->{title});
@@ -100,7 +97,7 @@ sub search {
   $form->header;
 
   $form->get_lists('partsgroup'    => 'ALL_PARTSGROUPS');
-  print $form->parse_html_template('ic/search', { %is_xyz, });
+  print $form->parse_html_template('ic/search');
 
   $lxdebug->leave_sub();
 }    #end search()
@@ -153,7 +150,7 @@ sub confirm_price_update {
   $form->header();
 
   if (@errors) {
-    $form->show_generic_error(join('<br>', @errors), 'back_button' => 1);
+    $form->show_generic_error(join('<br>', @errors));
   }
 
   $form->{nextsub} = "update_prices";
@@ -243,15 +240,7 @@ sub generate_report {
 
   my $cvar_configs = CVar->get_configs('module' => 'IC');
 
-  my %titles = (
-    ''         => $locale->text('Articles'),
-    part       => $locale->text('Parts'),
-    service    => $locale->text('Services'),
-    assembly   => $locale->text('Assemblies'),
-    assortment => $locale->text('Assortments'),
-  );
-
-  $form->{title} = $titles{$form->{searchitems}};
+  $form->{title} = $locale->text('Articles');
 
   my %column_defs = (
     'bin'                => { 'text' => $locale->text('Bin'), },
@@ -679,44 +668,4 @@ sub generate_report {
   $lxdebug->leave_sub();
 }    #end generate_report
 
-sub ajax_autocomplete {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-
-  $form->{column}          = 'description'     unless $form->{column} =~ /^partnumber|description$/;
-  $form->{$form->{column}} = $form->{q}           || '';
-  $form->{limit}           = ($form->{limit} * 1) || 10;
-  $form->{searchitems}   ||= '';
-
-  my @results = IC->all_parts(\%myconfig, $form);
-
-  print $form->ajax_response_header(),
-        $form->parse_html_template('ic/ajax_autocomplete');
-
-  $main::lxdebug->leave_sub();
-}
-
-sub back_to_record {
-  _check_io_auth();
-
-
-  delete @{$::form}{qw(action action_add action_back_to_record back_sub description item notes partnumber sellprice taxaccount2 unit vc)};
-
-  $::auth->restore_form_from_session($::form->{previousform}, clobber => 1);
-  $::form->{rowcount}--;
-  $::form->{action}   = 'display_form';
-  $::form->{callback} = $::form->{script} . '?' . join('&', map { $::form->escape($_) . '=' . $::form->escape($::form->{$_}) } sort keys %{ $::form });
-  $::form->redirect;
-}
-
 sub continue { call_sub($form->{"nextsub"}); }
-
-sub dispatcher {
-  my $action = first { $::form->{"action_${_}"} } qw(add back_to_record);
-  $::form->error($::locale->text('No action defined.')) unless $action;
-
-  $::form->{dispatched_action} = $action;
-  call_sub($action);
-}