X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Flicenses.pl;h=93efc243544626435b8367a2c082a97ac439ad55;hb=8c7e44938a661e035f62840e1e177353240ace5d;hp=300673a96bfe50553253d6830f6c3aa67de63296;hpb=9a22f14c16b2ba3ee47bc2ea0c97078260e3c167;p=kivitendo-erp.git diff --git a/bin/mozilla/licenses.pl b/bin/mozilla/licenses.pl index 300673a96..93efc2435 100644 --- a/bin/mozilla/licenses.pl +++ b/bin/mozilla/licenses.pl @@ -35,6 +35,8 @@ use SL::IC; use SL::IS; use SL::LICENSES; +require "bin/mozilla/common.pl"; + sub quot { $lxdebug->enter_sub(); $_[0] =~ s/\"/\"/g; @@ -44,6 +46,10 @@ sub quot { sub form_header { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + + $form->{jsscript} = 1; $form->header(); print( @@ -55,7 +61,10 @@ sub form_header { sub form_footer { $lxdebug->enter_sub(); - my @items = ("path", "login", "password", "old_callback", "previousform"); + + $auth->assert('license_edit'); + + my @items = qw(old_callback previousform); push(@items, @{ $form->{"hidden"} }); map({ print("{$_}) . "\">\n" @@ -78,6 +87,9 @@ sub set_std_hidden { sub print_part_selection { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + form_header(); set_std_hidden("business"); @@ -87,8 +99,7 @@ sub print_part_selection { + . $locale->text('Select from one of the items below') . qq| @@ -111,13 +122,9 @@ sub print_part_selection { qq| + . $p{"partnumber"} . qq|\">| . $p{"partnumber"} . qq| + . $p{"description"} . qq|\">| . $p{"description"} . qq||); @@ -137,6 +144,9 @@ sub print_part_selection { sub print_customer_selection { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + form_header(); set_std_hidden("parts_id", "partnumber", "description"); @@ -145,8 +155,7 @@ sub print_customer_selection {
| - . $locale->text('Select from one of the items below') - . qq|
| - . $p{"partnumber"} - . qq| | - . $p{"description"} - . qq|
+ . $locale->text('Select from one of the names below') . qq| @@ -174,11 +183,9 @@ sub print_customer_selection { qq| + . $c{"id"} . qq|\">$c{"customernumber"} + . $c{"name"} . qq|\">$c{"name"} @@ -200,6 +207,9 @@ sub print_customer_selection { sub print_license_form { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + print( qq|
| - . $locale->text('Select from one of the names below') - . qq|
$c{"customernumber"} $c{"name"} $c{"street"} $c{"zipcode"} $c{"city"}
@@ -211,14 +221,12 @@ sub print_license_form { + . quot($form->{"partnumber"}) . qq|\"> + . quot($form->{"description"}) . qq|\">|); @@ -242,26 +250,23 @@ sub print_license_form { + . quot($form->{"comment"}) . qq|\"> - + + . quot($form->{"quantity"}) . qq|\"> + . quot($form->{"licensenumber"}) . qq|\"> @@ -276,22 +281,28 @@ sub print_license_form { print( qq|  text('Save') - . qq|\">\n|); + . $locale->text('Save') . qq|\">\n|); } print( qq| -
| . $locale->text('Part Number') . qq| {"partnumber"}) - . qq|\">
| . $locale->text('Description') . qq| {"description"}) - . qq|\">
| . $locale->text('Company Name') . qq|
| . $locale->text('Comment') . qq| {"comment"}) - . qq|\">
| . $locale->text('Valid until') . qq|{"validuntil"}) - . qq|\">{"validuntil"}) . qq|\"> +
| . $locale->text('Quantity') . qq| {"quantity"}) - . qq|\">
| . $locale->text('License key') . qq| {"licensenumber"}) - . qq|\">
| . $locale->text('Own Product') . qq|
|); +| . + $form->write_trigger(\%myconfig, 1, "validuntil", "BL", + "trigger_validuntil")); + $lxdebug->leave_sub(); } sub add { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + if (!$lizenzen) { $form->error( - $locale->text('The licensing module has been deactivated in lx-erp.conf.') + $locale->text( + 'The licensing module has been deactivated in lx-erp.conf.') ); } @@ -303,6 +314,9 @@ sub add { sub do_add { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + $form->{"hidden"} = ["parts_id"]; form_header(); @@ -367,19 +381,25 @@ sub do_add { sub update { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + do_add(); + $lxdebug->leave_sub(); } sub continue { $lxdebug->enter_sub(); - &{ $form->{nextsub} }; + call_sub($form->{"nextsub"}); $lxdebug->leave_sub(); } sub save { $lxdebug->enter_sub(); + $auth->assert('license_edit'); + ($form->{customername}, $form->{customer_id}) = split /--/, $form->{customer}; @@ -428,6 +448,7 @@ sub save { # put callback together foreach $key (keys %$form) { + next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key})); # do single escape for Apache 2.0 $value = $form->escape($form->{$key}, 1); @@ -450,6 +471,9 @@ sub save { sub search { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + if (!$lizenzen) { $form->error( $locale->text( @@ -487,8 +511,7 @@ sub search { . $locale->text('Expiring in x month(s)') . qq| 
| - . $locale->text('Expired licenses') - . qq| + . $locale->text('Expired licenses') . qq| @@ -506,16 +529,14 @@ sub search { sub do_search { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + LICENSES->search(\%myconfig, $form); $callback = ""; - foreach ( - ("db", "path", "login", "password", - "partnumber", "description", "customer_name", "all", - "expiring_in", "show_expired") - ) { - $callback .= "\&${_}=" . $form->escape($form->{$_}, 1); - } + map { $callback .= "\&${_}=" . $form->escape($form->{$_}, 1) } + qw(db partnumber description customer_name all expiring_in show_expired); $details = $form->{"script"} . "?action=details" . $callback . "\&id="; $invdetails = "is.pl?action=edit" . $callback . "\&id="; $callback = $form->{"script"} . "?action=do_search" . $callback; @@ -542,7 +563,8 @@ sub do_search { |); if (scalar(@{ $form->{"licenses"} }) == 0) { print(qq|| - . $locale->text("No licenses were found that match the search criteria.") + . $locale->text( + "No licenses were found that match the search criteria.") . qq||); exit(0); } @@ -561,9 +583,7 @@ sub do_search { . $locale->text('Description') . qq| " - . $locale->text('Company Name') - . qq| + . $columns{"name"} . "\">" . $locale->text('Company Name') . qq| " . $locale->text('Valid until') @@ -620,6 +640,9 @@ sub do_search { sub details { $lxdebug->enter_sub(); + + $auth->assert('license_edit'); + LICENSES->get_license(\%myconfig, $form); map( { $form->{$_} = $form->{"license"}->{$_}; } keys(%{ $form->{"license"} }));