X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fpe.pl;h=cae9bfc5db27b7af457fa1086457929c14519825;hb=4cedba163990bd449e05da972691ebf035d61de3;hp=d95a7ee1dabb402a21252f4afa0211528eb13825;hpb=59f8f1fad78635c084328f8bf726f107cbb5bba2;p=kivitendo-erp.git
diff --git a/bin/mozilla/pe.pl b/bin/mozilla/pe.pl
index d95a7ee1d..cae9bfc5d 100644
--- a/bin/mozilla/pe.pl
+++ b/bin/mozilla/pe.pl
@@ -47,18 +47,20 @@ sub 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}&login=$form->{login}&password=$form->{password}"
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();
}
sub edit {
$lxdebug->enter_sub();
-
+ # show history button
+ $form->{javascript} = qq||;
+ #/show hhistory button
$form->{title} = "Edit";
if ($form->{type} eq 'project') {
@@ -70,8 +72,8 @@ sub edit {
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();
}
@@ -171,7 +173,6 @@ sub search {
-{path}>
{login}>
{password}>
@@ -195,7 +196,7 @@ sub project_report {
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=" .
+ "$form->{script}?action=project_report&type=$form->{type}&login=$form->{login}&password=$form->{password}&status=$form->{status}&active=" .
E($form->{active});
$href = $callback;
@@ -276,7 +277,7 @@ sub project_report {
|;
$column_data{projectnumber} =
- 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->{projectnumber} | |;
+ qq|{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{projectnumber} | |;
$column_data{description} = qq|$ref->{description} | |;
$column_data{active} =
qq|| .
@@ -306,7 +307,6 @@ sub project_report {
{type}>
-{path}>
{login}>
{password}>
@@ -411,7 +411,6 @@ sub form_project_footer {
-{path}>
{login}>
{password}>
@@ -425,6 +424,17 @@ sub form_project_footer {
. $locale->text('Delete') . qq|">|;
}
+ if ($form->{id}) {
+ # button for saving history
+ print qq|
+ {id}
+ . qq|); name=history id=history value=|
+ . $locale->text('history')
+ . qq|>|;
+ # /button for saving history
+ }
+
print qq|
@@ -455,6 +465,13 @@ sub save {
PE->save_pricegroup(\%myconfig, \%$form);
$form->redirect($locale->text('Pricegroup saved!'));
}
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{snumbers} = qq|projectnumber_| . $form->{projectnumber};
+ $form->{addition} = "SAVED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$lxdebug->leave_sub();
}
@@ -473,11 +490,17 @@ sub delete {
if ($form->{type} eq 'pricegroup') {
$form->redirect($locale->text('Pricegroup deleted!'));
}
-
+ # saving the history
+ if(!exists $form->{addition}) {
+ $form->{snumbers} = qq|projectnumber_| . $form->{projectnumber};
+ $form->{addition} = "DELETED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$lxdebug->leave_sub();
}
-sub continue { &{ $form->{nextsub} } }
+sub continue { call_sub($form->{"nextsub"}); }
sub partsgroup_report {
$lxdebug->enter_sub();
@@ -486,7 +509,7 @@ sub partsgroup_report {
PE->partsgroups(\%myconfig, \%$form);
$callback =
- "$form->{script}?action=partsgroup_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
+ "$form->{script}?action=partsgroup_report&type=$form->{type}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
if ($form->{status} eq 'all') {
$option = $locale->text('All');
@@ -547,7 +570,7 @@ sub partsgroup_report {
|;
$column_data{partsgroup} =
- 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->{partsgroup} | |;
+ qq|{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{partsgroup} | |;
map { print "$column_data{$_}\n" } @column_index;
print "
@@ -571,7 +594,6 @@ sub partsgroup_report {
{type}>
-{path}>
{login}>
{password}>
@@ -639,7 +661,6 @@ sub form_partsgroup_footer {
-{path}>
{login}>
{password}>
@@ -653,6 +674,14 @@ sub form_partsgroup_footer {
. $locale->text('Delete') . qq|">|;
}
+# button for saving history
+print qq|
+ {id}
+ . qq|); name=history id=history value=|
+ . $locale->text('history')
+ . qq|>|;
+# /button for saving history
print qq|
@@ -673,7 +702,7 @@ sub pricegroup_report {
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}";
+ "$form->{script}?action=pricegroup_report&type=$form->{type}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
if ($form->{status} eq 'all') {
$option = $locale->text('All');
@@ -736,7 +765,7 @@ sub pricegroup_report {
|;
$column_data{pricegroup} =
- 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} | |;
+ qq|{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{pricegroup} | |;
map { print "$column_data{$_}\n" } @column_index;
@@ -761,7 +790,6 @@ sub pricegroup_report {
{type}>
-{path}>
{login}>
{password}>
@@ -833,7 +861,6 @@ sub form_pricegroup_footer {
-{path}>
{login}>
{password}>
@@ -847,6 +874,14 @@ sub form_pricegroup_footer {
. $locale->text('Delete') . qq|">|;
}
+# button for saving history
+print qq|
+ {id}
+ . qq|); name=history id=history value=|
+ . $locale->text('history')
+ . qq|>|;
+# /button for saving history
print qq|