From 46b5ee69606969a990eaae920bda522a56374c0e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 23 Jan 2017 13:59:38 +0100 Subject: [PATCH] arap.pl entfernt MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sie enthielt nur noch drei Funktionen: • select_project — wurde nirgends mehr verwendet • project_selected — war nur eine Helferfunktion für select_project • continue — diese wurde nach common.pl verschoben --- bin/mozilla/ap.pl | 1 - bin/mozilla/arap.pl | 131 -------------------- bin/mozilla/common.pl | 2 + bin/mozilla/cp.pl | 1 - bin/mozilla/do.pl | 2 - bin/mozilla/ir.pl | 1 - bin/mozilla/is.pl | 2 +- bin/mozilla/oe.pl | 2 +- bin/mozilla/rp.pl | 1 - bin/mozilla/vk.pl | 1 - locale/de/all | 1 - templates/webpages/arap/select_project.html | 36 ------ 12 files changed, 4 insertions(+), 177 deletions(-) delete mode 100644 bin/mozilla/arap.pl delete mode 100644 templates/webpages/arap/select_project.html diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 5aa3713a2..8d55d01ac 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -48,7 +48,6 @@ use SL::DB::PurchaseInvoice; use SL::Webdav; use SL::Locale::String qw(t8); -require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; require "bin/mozilla/reportgenerator.pl"; diff --git a/bin/mozilla/arap.pl b/bin/mozilla/arap.pl deleted file mode 100644 index 35a7761cb..000000000 --- a/bin/mozilla/arap.pl +++ /dev/null @@ -1,131 +0,0 @@ -#===================================================================== -# LX-Office ERP -# Copyright (C) 2004 -# Based on SQL-Ledger Version 2.1.9 -# Web http://www.lx-office.org -# -#===================================================================== -# SQL-Ledger Accounting -# Copyright (c) 2002 -# -# Author: Dieter Simader -# Email: dsimader@sql-ledger.org -# Web: http://www.sql-ledger.org -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1335, USA. -#====================================================================== -# -# common routines for gl, ar, ap, is, ir, oe -# - -use strict; - -# any custom scripts for this one -if (-f "bin/mozilla/custom_arap.pl") { - eval { require "bin/mozilla/custom_arap.pl"; }; -} -if (-f "bin/mozilla/$::myconfig{login}_arap.pl") { - eval { require "bin/mozilla/$::myconfig{login}_arap.pl"; }; -} - -1; - -require "bin/mozilla/common.pl"; - -# end of main - -sub select_project { - $::lxdebug->enter_sub; - - $::auth->assert('ar_transactions | ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit |' . - 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash | report'); - - my ($is_global, $nextsub) = @_; - my $project_list = delete $::form->{project_list}; - - map { delete $::form->{$_} } qw(action header update); - - my @hiddens; - for my $key (keys %$::form) { - next if $key eq 'login' || $key eq 'password' || '' ne ref $::form->{$key}; - push @hiddens, { key => $key, value => $::form->{$key} }; - } - push @hiddens, { key => 'is_global', value => $is_global }, - { key => 'project_selected_nextsub', value => $nextsub }; - - $::form->header; - print $::form->parse_html_template('arap/select_project', { hiddens => \@hiddens, project_list => $project_list }); - - $::lxdebug->leave_sub; -} - -sub project_selected { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - - $main::auth->assert('ar_transactions | ap_transactions | vendor_invoice_edit | sales_order_edit | invoice_edit |' . - 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | cash | report'); - - # replace the variable with the one checked - - # index for new item - my $i = $form->{ndx}; - - my $prefix = $form->{"is_global"} ? "global" : ""; - my $suffix = $form->{"is_global"} ? "" : "_$form->{rownumber}"; - - $form->{"${prefix}projectnumber${suffix}"} = - $form->{"new_projectnumber_$i"}; - $form->{"old${prefix}projectnumber${suffix}"} = - $form->{"new_projectnumber_$i"}; - $form->{"${prefix}project_id${suffix}"} = $form->{"new_id_$i"}; - - # delete all the new_ variables - for $i (1 .. $form->{lastndx}) { - map { delete $form->{"new_${_}_$i"} } qw(id projectnumber description); - } - - my $nextsub = $form->{project_selected_nextsub} || 'update'; - - map { delete $form->{$_} } qw(ndx lastndx nextsub is_global project_selected_nextsub); - - call_sub($nextsub); - - $main::lxdebug->leave_sub(); -} - -sub continue { call_sub($main::form->{"nextsub"}); } - -1; - -__END__ - -=head1 NAME - -arap.pl - helper functions or customer/vendor retrieval - -=head1 SYNOPSIS - - check_name('vendor') - -=head1 DESCRIPTION - -Don't use anyting in this file without extreme care, and even then be prepared for massive headaches. - -It's a collection of helper routines that wrap the customer/vendor dropdown/textfield duality into something even complexer. - -=cut diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 8e77f6309..e21b3c505 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -437,4 +437,6 @@ sub db { goto &SL::DB::Helper::Mappings::db; } +sub continue { call_sub($::form->{nextsub}); } + 1; diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl index d30acaf9b..2bc2c1aa9 100644 --- a/bin/mozilla/cp.pl +++ b/bin/mozilla/cp.pl @@ -41,7 +41,6 @@ use Data::Dumper; use strict; #use warnings; -require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; our ($form, %myconfig, $lxdebug, $locale, $auth); diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 0eaf86b1f..69df28eeb 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -45,7 +45,6 @@ use SL::MoreCommon qw(ary_diff restore_form save_form); use SL::ReportGenerator; use SL::WH; use Sort::Naturally (); -require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; require "bin/mozilla/io.pl"; require "bin/mozilla/reportgenerator.pl"; @@ -1820,7 +1819,6 @@ __END__ do.pl - Script for all calls to delivery order - =head1 FUNCTIONS =over 2 diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 16eb69eca..5691c443e 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -43,7 +43,6 @@ use List::Util qw(max sum); use List::UtilsBy qw(sort_by); require "bin/mozilla/io.pl"; -require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; use strict; diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index e73dc4f53..942323fa9 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -49,8 +49,8 @@ use SL::DB::Department; use SL::DB::Invoice; use SL::DB::PaymentTerm; +require "bin/mozilla/common.pl"; require "bin/mozilla/io.pl"; -require "bin/mozilla/arap.pl"; use strict; diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 856276c6e..17d9fb500 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -52,8 +52,8 @@ use SL::DB::Customer; use SL::DB::TaxZone; use SL::DB::PaymentTerm; +require "bin/mozilla/common.pl"; require "bin/mozilla/io.pl"; -require "bin/mozilla/arap.pl"; require "bin/mozilla/reportgenerator.pl"; use strict; diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index 5d8b86616..a4ba678e6 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -47,7 +47,6 @@ use SL::ReportGenerator; use Data::Dumper; use List::MoreUtils qw(any); -require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; require "bin/mozilla/reportgenerator.pl"; diff --git a/bin/mozilla/vk.pl b/bin/mozilla/vk.pl index 25e351d0d..ea05ab41b 100644 --- a/bin/mozilla/vk.pl +++ b/bin/mozilla/vk.pl @@ -42,7 +42,6 @@ use SL::IS; use SL::ReportGenerator; use Data::Dumper; -require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; require "bin/mozilla/reportgenerator.pl"; diff --git a/locale/de/all b/locale/de/all index 6dc8f79b9..d0c78559c 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2512,7 +2512,6 @@ $self->{texts} = { 'Select federal state...' => 'Bundesland auswählen...', 'Select file to upload' => 'Datei zum Hochladen auswählen', 'Select from one of the items below' => 'Wählen Sie einen der untenstehenden Einträge', - 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte', 'Select postscript or PDF!' => 'Postscript oder PDF auswählen!', 'Select tax office...' => 'Finanzamt auswählen...', 'Select template to paste' => 'Einzufügende Vorlage auswählen', diff --git a/templates/webpages/arap/select_project.html b/templates/webpages/arap/select_project.html deleted file mode 100644 index ffd0b8654..000000000 --- a/templates/webpages/arap/select_project.html +++ /dev/null @@ -1,36 +0,0 @@ -[%- USE HTML %] -[%- USE T8 %] -[%- USE L %] -[%- USE LxERP %] - -

[% 'Select from one of the projects below' | $T8 %]

- -
- - - - - - - -[%- FOREACH row IN project_list %] - - - - - [% L.hidden_tag('new_id_' _ loop.count, row.id) %] - [% L.hidden_tag('new_projectnumber_' _ loop.count, row.projectnumber) %] - -[%- END %] -
 [% 'Number' | $T8 %][% 'Description' | $T8 %]
[% L.radio_button_tag('ndx', value=loop.count, checked=loop.first) %][% row.projectnumber | html %][% row.description | html %]
- -
- -[% L.hidden_tag(row.key, row.value) FOREACH row = hiddens %] -[% L.hidden_tag('lastndx', project_list.size) %] -[% L.hidden_tag('nextsub', 'project_selected') %] -[% L.hidden_tag('rownumber', rownumber) %] -[% L.submit_tag('action', LxERP.t8('Continue')) %] - -
- -- 2.20.1