Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 46b5ee69

Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt

  • ID 46b5ee69606969a990eaae920bda522a56374c0e
  • Vorgänger ac912929
  • Nachfolger aa63ebae

arap.pl entfernt

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

Unterschiede anzeigen:

bin/mozilla/ap.pl
use SL::Webdav;
use SL::Locale::String qw(t8);
require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
require "bin/mozilla/reportgenerator.pl";
bin/mozilla/arap.pl
#=====================================================================
# 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
bin/mozilla/common.pl
goto &SL::DB::Helper::Mappings::db;
}
sub continue { call_sub($::form->{nextsub}); }
1;
bin/mozilla/cp.pl
use strict;
#use warnings;
require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
our ($form, %myconfig, $lxdebug, $locale, $auth);
bin/mozilla/do.pl
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";
......
do.pl - Script for all calls to delivery order
=head1 FUNCTIONS
=over 2
bin/mozilla/ir.pl
use List::UtilsBy qw(sort_by);
require "bin/mozilla/io.pl";
require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
use strict;
bin/mozilla/is.pl
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;
bin/mozilla/oe.pl
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;
bin/mozilla/rp.pl
use Data::Dumper;
use List::MoreUtils qw(any);
require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
require "bin/mozilla/reportgenerator.pl";
bin/mozilla/vk.pl
use SL::ReportGenerator;
use Data::Dumper;
require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
require "bin/mozilla/reportgenerator.pl";
locale/de/all
'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',
templates/webpages/arap/select_project.html
[%- USE HTML %]
[%- USE T8 %]
[%- USE L %]
[%- USE LxERP %]
<h1>[% 'Select from one of the projects below' | $T8 %]</h1>
<form method=post action="[% script %]">
<table width=100%>
<tr class=listheading>
<th>&nbsp;</th>
<th>[% 'Number' | $T8 %]</th>
<th>[% 'Description' | $T8 %]</th>
</tr>
[%- FOREACH row IN project_list %]
<tr class=listrow[% loop.count % 2 %]>
<td>[% L.radio_button_tag('ndx', value=loop.count, checked=loop.first) %]</td>
<td>[% row.projectnumber | html %]</td>
<td>[% row.description | html %]</td>
[% L.hidden_tag('new_id_' _ loop.count, row.id) %]
[% L.hidden_tag('new_projectnumber_' _ loop.count, row.projectnumber) %]
</tr>
[%- END %]
</table>
<hr size=3 noshade>
[% 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')) %]
</form>

Auch abrufbar als: Unified diff