X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fam.pl;h=ee2b0e6486526a2d9ae137b180d8af58c573fc6c;hb=eb8d3de878876804b0465ec7cde9adfff436a5a0;hp=51f8f69815352725787ea2d930d5a572a1bddb04;hpb=8c7e44938a661e035f62840e1e177353240ace5d;p=kivitendo-erp.git
diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl
index 51f8f6981..ee2b0e648 100644
--- a/bin/mozilla/am.pl
+++ b/bin/mozilla/am.pl
@@ -38,6 +38,7 @@ use SL::Form;
use SL::User;
use SL::USTVA;
use SL::Iconv;
+use SL::TODO;
use CGI::Ajax;
use CGI;
@@ -1904,7 +1905,7 @@ sub list_printer {
|;
- $column_data{printer_description} = qq|
$ref->{printer_description}" | |;
+ $column_data{printer_description} = qq|$ref->{printer_description} | |;
$column_data{printer_command} = qq|$ref->{printer_command} | |;
$column_data{template_code} =
qq|$ref->{template_code} | |;
@@ -2491,6 +2492,7 @@ sub config {
$myconfig{show_form_details} = 1 unless (defined($myconfig{show_form_details}));
$form->{"menustyle_$myconfig{menustyle}"} = 1;
$form->{CAN_CHANGE_PASSWORD} = $auth->can_change_password();
+ $form->{todo_cfg} = { TODO->get_user_config('login' => $form->{login}) };
$form->{title} = $locale->text('Edit Preferences for #1', $form->{login});
@@ -2505,6 +2507,8 @@ sub save_preferences {
$form->{stylesheet} = $form->{usestylesheet};
+ TODO->save_user_config('login' => $form->{login}, %{ $form->{todo_cfg} || { } });
+
$form->redirect($locale->text('Preferences saved!')) if (AM->save_preferences(\%myconfig, \%$form, $webdav));
$form->error($locale->text('Cannot save preferences!'));
@@ -3132,3 +3136,131 @@ sub swap_price_factors {
$lxdebug->leave_sub();
}
+sub add_warehouse {
+ $lxdebug->enter_sub();
+
+ $auth->assert('config');
+
+ $form->{title} = $locale->text('Add Warehouse');
+ $form->{callback} ||= build_std_url('action=add_warehouse');
+ $form->{fokus} = 'description';
+
+ $form->header();
+ print $form->parse_html_template('am/edit_warehouse');
+
+ $lxdebug->leave_sub();
+}
+
+sub edit_warehouse {
+ $lxdebug->enter_sub();
+
+ $auth->assert('config');
+
+ AM->get_warehouse(\%myconfig, $form);
+
+ $form->get_lists('employees' => 'EMPLOYEES');
+
+ $form->{title} = $locale->text('Edit Warehouse');
+ $form->{callback} ||= build_std_url('action=list_warehouses');
+ $form->{fokus} = 'description';
+
+ $form->header();
+ print $form->parse_html_template('am/edit_warehouse');
+
+ $lxdebug->leave_sub();
+}
+
+sub list_warehouses {
+ $lxdebug->enter_sub();
+
+ $auth->assert('config');
+
+ AM->get_all_warehouses(\%myconfig, $form);
+
+ my $previous;
+ foreach my $current (@{ $form->{WAREHOUSES} }) {
+ if ($previous) {
+ $previous->{next_id} = $current->{id};
+ $current->{previous_id} = $previous->{id};
+ }
+
+ $previous = $current;
+ }
+
+ $form->{callback} = build_std_url('action=list_warehouses');
+ $form->{title} = $locale->text('Warehouses');
+ $form->{url_base} = build_std_url('callback');
+
+ $form->header();
+ print $form->parse_html_template('am/list_warehouses');
+
+ $lxdebug->leave_sub();
+}
+
+sub save_warehouse {
+ $lxdebug->enter_sub();
+
+ $auth->assert('config');
+
+ $form->isblank("description", $locale->text('Description missing!'));
+
+ $form->{number_of_new_bins} = $form->parse_amount(\%myconfig, $form->{number_of_new_bins});
+
+ AM->save_warehouse(\%myconfig, $form);
+
+ $form->{callback} .= '&saved_message=' . E($locale->text('Warehouse saved.')) if ($form->{callback});
+
+ $form->redirect($locale->text('Warehouse saved.'));
+
+ $lxdebug->leave_sub();
+}
+
+sub swap_warehouses {
+ $lxdebug->enter_sub();
+
+ $auth->assert('config');
+
+ AM->swap_sortkeys(\%myconfig, $form, 'warehouse');
+ list_warehouses();
+
+ $lxdebug->leave_sub();
+}
+
+sub delete_warehouse {
+ $lxdebug->enter_sub();
+
+ $auth->assert('config');
+
+ if (!$form->{confirmed}) {
+ $form->{title} = $locale->text('Confirmation');
+
+ $form->header();
+ print $form->parse_html_template('am/confirm_delete_warehouse');
+ exit 0;
+ }
+
+ if (AM->delete_warehouse(\%myconfig, $form)) {
+ $form->{callback} .= '&saved_message=' . E($locale->text('Warehouse deleted.')) if ($form->{callback});
+ $form->redirect($locale->text('Warehouse deleted.'));
+
+ } else {
+ $form->error($locale->text('The warehouse could not be deleted because it has already been used.'));
+ }
+
+ $lxdebug->leave_sub();
+}
+
+sub save_bin {
+ $lxdebug->enter_sub();
+
+ $auth->assert('config');
+
+ AM->save_bins(\%myconfig, $form);
+
+ $form->{callback} .= '&saved_message=' . E($locale->text('Bins saved.')) if ($form->{callback});
+
+ $form->redirect($locale->text('Bins saved.'));
+
+ $lxdebug->leave_sub();
+}
+