X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fic.pl;h=f2ca8a9294402060220869190525e0a0fd059285;hb=2994c1e9337b80e4e9a60cd4393fcf49595da5df;hp=e9b13a3271555b922cd99d808e8644106eb7cc68;hpb=83e061c063b3f6b9f34ee0c9b7ff5575362be9a4;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index e9b13a327..f2ca8a929 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -52,15 +52,25 @@ require "bin/mozilla/reportgenerator.pl"; 1; +# Parserhappy(R): +# type=submit $locale->text('Add Part') +# type=submit $locale->text('Add Service') +# type=submit $locale->text('Add Assembly') +# type=submit $locale->text('Edit Part') +# type=submit $locale->text('Edit Service') +# type=submit $locale->text('Edit Assembly') + # end of main sub add { $lxdebug->enter_sub(); + $auth->assert('part_service_assembly_edit'); + $form->{title} = $locale->text('Add ' . ucfirst $form->{item}); $form->{callback} = - "$form->{script}?action=add&item=$form->{item}&login=$form->{login}&password=$form->{password}" + "$form->{script}?action=add&item=$form->{item}" unless $form->{callback}; $form->{"unit_changeable"} = 1; @@ -75,6 +85,8 @@ sub add { sub search { $lxdebug->enter_sub(); + $auth->assert('part_service_assembly_edit'); + # switch for backward sorting $form->{revers} = 0; @@ -108,6 +120,8 @@ sub search { sub search_update_prices { $lxdebug->enter_sub(); + $auth->assert('part_service_assembly_edit'); + my $pricegroups = IC->get_pricegroups(\%myconfig, \%$form); $form->header; @@ -120,6 +134,8 @@ sub search_update_prices { sub confirm_price_update { $lxdebug->enter_sub(); + $auth->assert('part_service_assembly_edit'); + $form->{nextsub} = "update_prices"; $form->header; @@ -133,6 +149,8 @@ sub confirm_price_update { sub update_prices { $lxdebug->enter_sub(); + $auth->assert('part_service_assembly_edit'); + if (IC->update_prices(\%myconfig, \%$form)) { $form->redirect($form->{update_count} . $locale->text('prices updated!')); } else { @@ -145,6 +163,8 @@ sub update_prices { sub choice { $lxdebug->enter_sub(); + $auth->assert('part_service_assembly_edit'); + our ($j, $lastndx); my ($totop100); @@ -152,7 +172,7 @@ sub choice { $form->header; - push @custom_hiddens, qw(login password searchitems title bom titel revers lastsort sort ndxs_counter extras); + push @custom_hiddens, qw(searchitems title bom titel revers lastsort sort ndxs_counter extras); push @custom_hiddens, qw(itemstatus l_linetotal l_partnumber l_description l_onhand l_unit l_sellprice l_linetotalsellprice); my @HIDDENS = ( +{ name => 'row', value => $j }, @@ -164,49 +184,49 @@ sub choice { my ($partnumber, $description, $unit, $sellprice, $soldtotal); # if choice set data - if ($form->{ndx}) { - for (my $i = 0; $i < $form->{ndxs_counter}; $i++) { - - # prepeare data - $partnumber = $form->{"totop100_partnumber_$j"}; - $description = $form->{"totop100_description_$j"}; - $unit = $form->{"totop100_unit_$j"}; - $sellprice = $form->{"totop100_sellprice_$j"}; - $soldtotal = $form->{"totop100_soldtotal_$j"}; - - # insert data into top100 - push @{ $form->{parts} }, - { number => "", - partnumber => "$partnumber", - description => "$description", - unit => "$unit", - sellprice => "$sellprice", - soldtotal => "$soldtotal" }; - } #rof - } #fi +# if ($form->{ndx}) { +# for my $i (0 .. $form->{ndxs_counter}) { +# +# # insert data into top100 +# push @{ $form->{parts} }, +# { number => "", +# partnumber => $form->{"totop100_partnumber_$j"}, +# description => $form->{"totop100_description_$j"}, +# unit => $form->{"totop100_unit_$j"}, +# sellprice => $form->{"totop100_sellprice_$j"}, +# soldtotal => $form->{"totop100_soldtotal_$j"}, +# }; +# } #rof +# } #fi $totop100 = ""; # set data for next page - if (($form->{ndxs_counter}) > 0) { - for (my $i = 1; ($i < $form->{ndxs_counter} + 1); $i++) { - $partnumber = $form->{"totop100_partnumber_$i"}; - $description = $form->{"totop100_description_$i"}; - $unit = $form->{"totop100_unit_$i"}; - $sellprice = $form->{"totop100_sellprice_$i"}; - $soldtotal = $form->{"totop100_soldtotal_$i"}; - - $totop100 .= qq| -{"totop100_partnumber_$i"}> -{"totop100_description_$i"}> -{"totop100_unit_$i"}> -{"totop100_sellprice_$i"}> -{"totop100_soldtotal_$i"}> - |; - } #rof - } #fi - - print $form->parse_html_template('ic/choice', +{ HIDDENS => \@HIDDENS, totop100 => $totop100 }); + for my $i (1 .. $form->{ndxs_counter}) { + $partnumber = $form->{"totop100_partnumber_$i"}; + $description = $form->{"totop100_description_$i"}; + $unit = $form->{"totop100_unit_$i"}; + $sellprice = $form->{"totop100_sellprice_$i"}; + $soldtotal = $form->{"totop100_soldtotal_$i"}; + + push @PARTS, { + totop100_partnumber => $form->{"totop100_partnumber_$i"}, + totop100_description => $form->{"totop100_description_$i"}, + totop100_unit => $form->{"totop100_unit_$i"}, + totop100_sellprice => $form->{"totop100_sellprice_$i"}, + totop100_soldtotal => $form->{"totop100_soldtotal_$i"}, + } + +# $totop100 .= qq| +#{"totop100_partnumber_$i"}> +#{"totop100_description_$i"}> +#{"totop100_unit_$i"}> +#{"totop100_sellprice_$i"}> +#{"totop100_soldtotal_$i"}> +# |; + } #rof + + print $form->parse_html_template('ic/choice', +{ HIDDENS => \@HIDDENS, PARTS => \@PARTS }); $lxdebug->leave_sub(); } #end choice @@ -214,6 +234,8 @@ sub choice { sub list { $lxdebug->enter_sub(); + $auth->assert('part_service_assembly_edit'); + our ($lastndx); our ($partnumber, $description, $unit, $sellprice, $soldtotal); @@ -248,7 +270,7 @@ sub list { for ($j = 1; $j <= $i; $j++) { print qq| -