X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fpe.pl;h=8c6132ecb61adb2acd38cedd606cc9ad42d7500d;hb=d4c9b68ec69a5a04d8e185800718c665151b2bbc;hp=d95a7ee1dabb402a21252f4afa0211528eb13825;hpb=59f8f1fad78635c084328f8bf726f107cbb5bba2;p=kivitendo-erp.git
diff --git a/bin/mozilla/pe.pl b/bin/mozilla/pe.pl
index d95a7ee1d..8c6132ecb 100644
--- a/bin/mozilla/pe.pl
+++ b/bin/mozilla/pe.pl
@@ -27,8 +27,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#======================================================================
#
-# project administration
-# partsgroup administration
+# partsgroup, pricegroup administration
#
#======================================================================
@@ -43,15 +42,17 @@ require "bin/mozilla/common.pl";
sub add {
$lxdebug->enter_sub();
+ $auth->assert('config');
+
$form->{title} = "Add";
# construct callback
$form->{callback} =
- "$form->{script}?action=add&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}"
+ "$form->{script}?action=add&type=$form->{type}"
unless $form->{callback};
- &{"form_$form->{type}_header"};
- &{"form_$form->{type}_footer"};
+ call_sub("form_$form->{type}_header");
+ call_sub("form_$form->{type}_footer");
$lxdebug->leave_sub();
}
@@ -59,19 +60,21 @@ sub add {
sub edit {
$lxdebug->enter_sub();
+ $auth->assert('config');
+
+ # show history button
+ $form->{javascript} = qq||;
+ #/show hhistory button
$form->{title} = "Edit";
- if ($form->{type} eq 'project') {
- PE->get_project(\%myconfig, \%$form);
- }
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"};
+ call_sub("form_$form->{type}_header");
+ call_sub("form_$form->{type}_footer");
$lxdebug->leave_sub();
}
@@ -79,33 +82,8 @@ sub edit {
sub search {
$lxdebug->enter_sub();
- if ($form->{type} eq 'project') {
- $report = "project_report";
- $sort = 'projectnumber';
- $form->{title} = $locale->text('Projects');
+ $auth->assert('config');
- $number = qq|
-
- | . $locale->text('Number') . qq| |
- | . $cgi->textfield('-name' => 'projectnumber', '-size' => 20) . qq| |
-
-
- | . $locale->text('Description') . qq| |
- | . $cgi->textfield('-name' => 'description', '-size' => 60) . qq| |
-
-
- |
- | .
- $cgi->radio_group('-name' => 'active', '-default' => 'active',
- '-values' => ['active', 'inactive', 'both'],
- '-labels' => { 'active' => ' ' . $locale->text("Active"),
- 'inactive' => ' ' . $locale->text("Inactive"),
- 'both' => ' ' . $locale->text("Both") })
- . qq| |
-
-|;
-
- }
if ($form->{type} eq 'partsgroup') {
$report = "partsgroup_report";
$sort = 'partsgroup';
@@ -171,10 +149,6 @@ sub search {
-{path}>
-{login}>
-{password}>
-
@@ -187,262 +161,11 @@ sub search {
$lxdebug->leave_sub();
}
-sub project_report {
- $lxdebug->enter_sub();
-
- map { $form->{$_} = $form->unescape($form->{$_}) }
- (projectnumber, description);
- PE->projects(\%myconfig, \%$form);
-
- $callback =
- "$form->{script}?action=project_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}&active=" .
- E($form->{active});
- $href = $callback;
-
- if ($form->{status} eq 'all') {
- $option = $locale->text('All');
- }
- if ($form->{status} eq 'orphaned') {
- $option .= $locale->text('Orphaned');
- }
- if ($form->{projectnumber}) {
- $href .= "&projectnumber=" . $form->escape($form->{projectnumber});
- $callback .= "&projectnumber=$form->{projectnumber}";
- $option .=
- "\n
" . $locale->text('Project') . " : $form->{projectnumber}";
- }
- if ($form->{description}) {
- $href .= "&description=" . $form->escape($form->{description});
- $callback .= "&description=$form->{description}";
- $option .=
- "\n
" . $locale->text('Description') . " : $form->{description}";
- }
-
- @column_index = qw(projectnumber description);
-
- push(@column_index, "active") if ("both" eq $form->{active});
-
- $column_header{projectnumber} =
- qq||
- . $locale->text('Number')
- . qq| | |;
- $column_header{description} =
- qq||
- . $locale->text('Description')
- . qq| | |;
- $column_header{active} =
- qq|| . $locale->text('Active') . qq| | |;
-
- $form->{title} = $locale->text('Projects');
-
- $form->header;
-
- print qq|
-
-
-
-
- $form->{title} |
-
-
-
- $option |
-
-
-
-
- |
-
-
-
|
-
-
-
-
-
-
-
-