X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/0884406403ce36af3484924086527ba689807329..53593baa211863fbf66540cf1bcc36c8fb37257f:/bin/mozilla/pe.pl diff --git a/bin/mozilla/pe.pl b/bin/mozilla/pe.pl deleted file mode 100644 index 8c6132ecb..000000000 --- a/bin/mozilla/pe.pl +++ /dev/null @@ -1,605 +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) 1998-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., 675 Mass Ave, Cambridge, MA 02139, USA. -#====================================================================== -# -# partsgroup, pricegroup administration -# -#====================================================================== - -use SL::PE; - -require "bin/mozilla/common.pl"; - -1; - -# end of main - -sub add { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - $form->{title} = "Add"; - - # construct callback - $form->{callback} = - "$form->{script}?action=add&type=$form->{type}" - unless $form->{callback}; - - call_sub("form_$form->{type}_header"); - call_sub("form_$form->{type}_footer"); - - $lxdebug->leave_sub(); -} - -sub edit { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - # show history button - $form->{javascript} = qq||; - #/show hhistory button - $form->{title} = "Edit"; - - if ($form->{type} eq 'partsgroup') { - PE->get_partsgroup(\%myconfig, \%$form); - } - if ($form->{type} eq 'pricegroup') { - PE->get_pricegroup(\%myconfig, \%$form); - } - call_sub("form_$form->{type}_header"); - call_sub("form_$form->{type}_footer"); - - $lxdebug->leave_sub(); -} - -sub search { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - if ($form->{type} eq 'partsgroup') { - $report = "partsgroup_report"; - $sort = 'partsgroup'; - $form->{title} = $locale->text('Groups'); - - $number = qq| - - | . $locale->text('Group') . qq| - - -|; - - } - - # for pricesgroups - if ($form->{type} eq 'pricegroup') { - $report = "pricegroup_report"; - $sort = 'pricegroup'; - $form->{title} = $locale->text('Pricegroup'); - - $number = qq| - - | . $locale->text('Pricegroup') . qq| - - -|; - - } - - $form->header; - - print qq| - - -
{script}> - - -{type}> - - - - - - - - - - - - -
$form->{title}
- - $number - - - - -
 | - . $locale->text('All') . qq| -  | - . $locale->text('Orphaned') . qq|
-

- - - -
- -
- - - -|; - - $lxdebug->leave_sub(); -} - -sub save { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - if ($form->{type} eq 'partsgroup') { - $form->isblank("partsgroup", $locale->text('Group missing!')); - PE->save_partsgroup(\%myconfig, \%$form); - $form->redirect($locale->text('Group saved!')); - } - - # choice pricegroup and save - if ($form->{type} eq 'pricegroup') { - $form->isblank("pricegroup", $locale->text('Pricegroup missing!')); - 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(); -} - -sub delete { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - PE->delete_tuple(\%myconfig, \%$form); - - if ($form->{type} eq 'partsgroup') { - $form->redirect($locale->text('Group deleted!')); - } - 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 { call_sub($form->{"nextsub"}); } - -sub partsgroup_report { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - map { $form->{$_} = $form->unescape($form->{$_}) } (partsgroup); - PE->partsgroups(\%myconfig, \%$form); - - $callback = - "$form->{script}?action=partsgroup_report&type=$form->{type}&status=$form->{status}"; - - if ($form->{status} eq 'all') { - $option = $locale->text('All'); - } - if ($form->{status} eq 'orphaned') { - $option .= $locale->text('Orphaned'); - } - if ($form->{partsgroup}) { - $callback .= "&partsgroup=$form->{partsgroup}"; - $option .= "\n
" . $locale->text('Group') . " : $form->{partsgroup}"; - } - - @column_index = $form->sort_columns(qw(partsgroup)); - - $column_header{partsgroup} = - qq|| . $locale->text('Group') . qq||; - - $form->{title} = $locale->text('Groups'); - - $form->header; - - print qq| - - - - - - - - - - - - - - - - -
$form->{title}
$option
- - -|; - - map { print "$column_header{$_}\n" } @column_index; - - print qq| - -|; - - # escape callback - $form->{callback} = $callback; - - # escape callback for href - $callback = $form->escape($callback); - - foreach $ref (@{ $form->{item_list} }) { - - $i++; - $i %= 2; - - print qq| - -|; - - $column_data{partsgroup} = - qq||; - map { print "$column_data{$_}\n" } @column_index; - - print " - -"; - } - - print qq| -
{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&callback=$callback>$ref->{partsgroup}
-

- -
-
{script}> - - - -{type}> - - - -
- - - -|; - - $lxdebug->leave_sub(); -} - -sub form_partsgroup_header { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - $form->{title} = $locale->text("$form->{title} Group"); - - # $locale->text('Add Group') - # $locale->text('Edit Group') - - $form->{partsgroup} =~ s/\"/"/g; - - $form->header; - - print qq| - - -
{script}> - -{id}> -{type}> - - - - - - - - - - - - -
$form->{title}
- - - - - - -
| . $locale->text('Group') . qq|
-

-|; - - $lxdebug->leave_sub(); -} - -sub form_partsgroup_footer { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - print qq| - - - -
-|; - - if ($form->{id} && $form->{orphaned}) { - print qq| -|; - } - -# button for saving history -print qq| - {id} - . qq|); name=history id=history value=| - . $locale->text('history') - . qq|>|; -# /button for saving history - print qq| -
- - - -|; - - $lxdebug->leave_sub(); -} - -################################# -# get pricesgroups and build up html-code -# -sub pricegroup_report { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - map { $form->{$_} = $form->unescape($form->{$_}) } (pricegroup); - PE->pricegroups(\%myconfig, \%$form); - - $callback = - "$form->{script}?action=pricegroup_report&type=$form->{type}&status=$form->{status}"; - - if ($form->{status} eq 'all') { - $option = $locale->text('All'); - } - if ($form->{status} eq 'orphaned') { - $option .= $locale->text('Orphaned'); - } - if ($form->{pricegroup}) { - $callback .= "&pricegroup=$form->{pricegroup}"; - $option .= - "\n
" . $locale->text('Pricegroup') . " : $form->{pricegroup}"; - } - - @column_index = $form->sort_columns(qw(pricegroup)); - - $column_header{pricegroup} = - qq|| - . $locale->text('Pricegroup') - . qq||; - - $form->{title} = $locale->text('Pricegroup'); - - $form->header; - - print qq| - - - - - - - - - - - - - - - - -
$form->{title}
$option
- - -|; - - map { print "$column_header{$_}\n" } @column_index; - - print qq| - -|; - - # escape callback - $form->{callback} = $callback; - - # escape callback for href - $callback = $form->escape($callback); - - foreach $ref (@{ $form->{item_list} }) { - - $i++; - $i %= 2; - - print qq| - -|; - $column_data{pricegroup} = - qq||; - - map { print "$column_data{$_}\n" } @column_index; - - print " - -"; - } - - print qq| -
{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&callback=$callback>$ref->{pricegroup}
-

- -
-
{script}> - - - -{type}> - - - -
- - - -|; - - $lxdebug->leave_sub(); -} - -####################### -#build up pricegroup_header -# -sub form_pricegroup_header { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - # $locale->text('Add Pricegroup') - # $locale->text('Edit Pricegroup') - - $form->{title} = $locale->text("$form->{title} Pricegroup"); - - $form->{pricegroup} =~ s/\"/"/g; - - $form->header; - - print qq| - - -
{script}> - -{id}> -{type}> - - - - - - - - - - - - -
$form->{title}
- - - - - -
| . $locale->text('Preisgruppe') . qq|
-

-|; - - $lxdebug->leave_sub(); -} -###################### -#build up pricegroup_footer -# -sub form_pricegroup_footer { - $lxdebug->enter_sub(); - - $auth->assert('config'); - - print qq| - - - -
-|; - - if ($form->{id} && $form->{orphaned}) { - print qq| -|; - } - -# button for saving history -print qq| - {id} - . qq|); name=history id=history value=| - . $locale->text('history') - . qq|>|; -# /button for saving history - print qq| -
- - - -|; - - $lxdebug->leave_sub(); -}