X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fpe.pl;h=0fd351dbe409545ab85fad472b27a769e0a3368a;hb=eadefca5b4f50d7ec0d109efde75b6ee4c0f5e12;hp=201e96b225e356bcf944418044b47f569dffdd1c;hpb=0576299f2aa98125991c4ffcd2f75073ea583d7d;p=kivitendo-erp.git diff --git a/bin/mozilla/pe.pl b/bin/mozilla/pe.pl index 201e96b22..0fd351dbe 100644 --- a/bin/mozilla/pe.pl +++ b/bin/mozilla/pe.pl @@ -65,7 +65,9 @@ sub edit { if ($form->{type} eq 'partsgroup') { PE->get_partsgroup(\%myconfig, \%$form); } - + if ($form->{type} eq 'pricegroup') { + PE->get_pricegroup(\%myconfig, \%$form); + } &{"form_$form->{type}_header"}; &{"form_$form->{type}_footer"}; @@ -106,6 +108,21 @@ sub search { } + # for pricesgroups + if ($form->{type} eq 'pricegroup') { + $report = "pricegroup_report"; + $sort = 'pricegroup'; + $form->{title} = $locale->text('Pricegroup'); + + $number = qq| + + | . $locale->text('Pricegroup') . qq| + + +|; + + } + $form->header; print qq| @@ -130,8 +147,7 @@ sub search {  | . $locale->text('All') . qq|  | - . $locale->text('Orphaned') - . qq| + . $locale->text('Orphaned') . qq| @@ -397,6 +413,13 @@ sub save { $form->redirect($locale->text('Group saved!')); } + # choice pricegroup and save + if ($form->{type} eq 'pricegroup') { + $form->isblank("pricegroup", $locale->text('Pricegroup missing!')); + PE->save_pricegroup(\%myconfig, \%$form); + $form->redirect($locale->text('Pricegroup saved!')); + } + $lxdebug->leave_sub(); } @@ -411,6 +434,9 @@ sub delete { if ($form->{type} eq 'partsgroup') { $form->redirect($locale->text('Group deleted!')); } + if ($form->{type} eq 'pricegroup') { + $form->redirect($locale->text('Pricegroup deleted!')); + } $lxdebug->leave_sub(); } @@ -611,3 +637,208 @@ sub form_partsgroup_footer { $lxdebug->leave_sub(); } + +################################# +# get pricesgroups and build up html-code +# +sub pricegroup_report { + $lxdebug->enter_sub(); + + map { $form->{$_} = $form->unescape($form->{$_}) } (pricegroup); + PE->pricegroups(\%myconfig, \%$form); + + $callback = + "$form->{script}?action=pricegroup_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}"; + + if ($form->{status} eq 'all') { + $option = $locale->text('All'); + } + if ($form->{status} eq 'orphaned') { + $option .= $locale->text('Orphaned'); + } + if ($form->{pricegroup}) { + $callback .= "&pricegroup=$form->{pricegroup}"; + $option .= + "\n
" . $locale->text('Pricegroup') . " : $form->{pricegroup}"; + } + + @column_index = $form->sort_columns(qw(pricegroup)); + + $column_header{pricegroup} = + qq|| + . $locale->text('Pricegroup') + . qq||; + + $form->{title} = $locale->text('Pricegroup'); + + $form->header; + + print qq| + + + + + + + + + + + + + + + + +
$form->{title}
$option
+ + +|; + + map { print "$column_header{$_}\n" } @column_index; + + print qq| + +|; + + # escape callback + $form->{callback} = $callback; + + # escape callback for href + $callback = $form->escape($callback); + + foreach $ref (@{ $form->{item_list} }) { + + $i++; + $i %= 2; + + print qq| + +|; + $column_data{pricegroup} = + qq||; + + map { print "$column_data{$_}\n" } @column_index; + + print " + +"; + } + + print qq| +
{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{pricegroup}
+

+ +
+
{script}> + + + +{type}> + +{path}> +{login}> +{password}> + +|; + + if ($form->{menubar}) { + require "$form->{path}/menu.pl"; + &menubar; + } + + print qq| +
+ + + +|; + + $lxdebug->leave_sub(); +} + +####################### +#build up pricegroup_header +# +sub form_pricegroup_header { + $lxdebug->enter_sub(); + + # $locale->text('Add Pricegroup') + # $locale->text('Edit Pricegroup') + + $form->{title} = $locale->text("$form->{title} Pricegroup"); + + $form->{pricegroup} =~ s/\"/"/g; + + $form->header; + + print qq| + + +
{script}> + +{id}> +{type}> + + + + + + + + + + + + +
$form->{title}
+ + + + + +
| . $locale->text('Preisgruppe') . qq|
+

+|; + + $lxdebug->leave_sub(); +} +###################### +#build up pricegroup_footer +# +sub form_pricegroup_footer { + $lxdebug->enter_sub(); + + print qq| + + + +{path}> +{login}> +{password}> + +
+|; + + if ($form->{id} && $form->{orphaned}) { + print qq| +|; + } + + if ($form->{menubar}) { + require "$form->{path}/menu.pl"; + &menubar; + } + + print qq| +
+ + + +|; + + $lxdebug->leave_sub(); +}