X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4dbb09950c9f5596646537c12d991c99086fe7c1..53593baa211863fbf66540cf1bcc36c8fb37257f:/bin/mozilla/pe.pl diff --git a/bin/mozilla/pe.pl b/bin/mozilla/pe.pl deleted file mode 100644 index 832734913..000000000 --- a/bin/mozilla/pe.pl +++ /dev/null @@ -1,602 +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. -#====================================================================== -# -# project administration -# partsgroup administration -# -#====================================================================== - - -use SL::PE; - -1; -# end of main - - - -sub add { - $lxdebug->enter_sub(); - - $form->{title} = "Add"; - - # construct callback - $form->{callback} = "$form->{script}?action=add&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; - - &{ "form_$form->{type}_header" }; - &{ "form_$form->{type}_footer" }; - - $lxdebug->leave_sub(); -} - - -sub edit { - $lxdebug->enter_sub(); - - $form->{title} = "Edit"; - - if ($form->{type} eq 'project') { - PE->get_project(\%myconfig, \%$form); - } - if ($form->{type} eq 'partsgroup') { - PE->get_partsgroup(\%myconfig, \%$form); - } - - &{ "form_$form->{type}_header" }; - &{ "form_$form->{type}_footer" }; - - $lxdebug->leave_sub(); -} - - -sub search { - $lxdebug->enter_sub(); - - if ($form->{type} eq 'project') { - $report = "project_report"; - $sort = 'projectnumber'; - $form->{title} = $locale->text('Projects'); - - $number = qq| - - |.$locale->text('Number').qq| - - - - |.$locale->text('Description').qq| - - -|; - - } - if ($form->{type} eq 'partsgroup') { - $report = "partsgroup_report"; - $sort = 'partsgroup'; - $form->{title} = $locale->text('Groups'); - - $number = qq| - - |.$locale->text('Group').qq| - - -|; - - } - - $form->header; - - print qq| - - -
{script}> - - -{type}> - - - - - - - - - - - - -
$form->{title}
- - $number - - - - -
 |.$locale->text('All').qq| -  |.$locale->text('Orphaned').qq|
-

- - - -{path}> -{login}> -{password}> - -
- -
- - - -|; - - $lxdebug->leave_sub(); -} - - - -sub project_report { - $lxdebug->enter_sub(); - - map { $form->{$_} = $form->unescape($form->{$_}) } (projectnumber, description); - 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}"; - $href = $callback; - - if ($form->{status} eq 'all') { - $option = $locale->text('All'); - } - if ($form->{status} eq 'orphaned') { - $option .= $locale->text('Orphaned'); - } - if ($form->{projectnumber}) { - $href .= "&projectnumber=".$form->escape($form->{projectnumber}); - $callback .= "&projectnumber=$form->{projectnumber}"; - $option .= "\n
".$locale->text('Project')." : $form->{projectnumber}"; - } - if ($form->{description}) { - $href .= "&description=".$form->escape($form->{description}); - $callback .= "&description=$form->{description}"; - $option .= "\n
".$locale->text('Description')." : $form->{description}"; - } - - - @column_index = $form->sort_columns(qw(projectnumber description)); - - $column_header{projectnumber} = qq||.$locale->text('Number').qq||; - $column_header{description} = qq||.$locale->text('Description').qq||; - - $form->{title} = $locale->text('Projects'); - - $form->header; - - print qq| - - - - - - - - - - - - - - - - -
$form->{title}
$option
- - -|; - - map { print "$column_header{$_}\n" } @column_index; - - print qq| - -|; - - # escape callback - $form->{callback} = $callback .= "&sort=$form->{sort}"; - - # escape callback for href - $callback = $form->escape($callback); - - foreach $ref (@{ $form->{project_list} }) { - - $i++; $i %= 2; - - print qq| - -|; - - $column_data{projectnumber} = qq||; - $column_data{description} = qq||; - - map { print "$column_data{$_}\n" } @column_index; - - print " - -"; - } - - print 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}$ref->{description} 
-

- -
-
{script}> - - - -{type}> - -{path}> -{login}> -{password}> - -|; - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| -
- - - -|; - - $lxdebug->leave_sub(); -} - - -sub form_project_header { - $lxdebug->enter_sub(); - - $form->{title} = $locale->text("$form->{title} Project"); - -# $locale->text('Add Project') -# $locale->text('Edit Project') - - $form->{description} =~ s/\"/"/g; - - if (($rows = $form->numtextrows($form->{description}, 60)) > 1) { - $description = qq||; - } else { - $description = qq||; - } - - $form->header; - - print qq| - - -
{script}> - -{id}> - - - - - - - - - - - - - -
$form->{title}
- - - - - - - - - -
|.$locale->text('Number').qq|
|.$locale->text('Description').qq|$description
-

-|; - - $lxdebug->leave_sub(); -} - - -sub form_project_footer { - $lxdebug->enter_sub(); - - print qq| - - - -{path}> -{login}> -{password}> - -
-|; - - if ($form->{id} && $form->{orphaned}) { - print qq| -|; - } - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| -
- - - -|; - - $lxdebug->leave_sub(); -} - - -sub save { - $lxdebug->enter_sub(); - - if ($form->{type} eq 'project') { - $form->isblank("projectnumber", $locale->text('Project Number missing!')); - PE->save_project(\%myconfig, \%$form); - $form->redirect($locale->text('Project saved!')); - } - if ($form->{type} eq 'partsgroup') { - $form->isblank("partsgroup", $locale->text('Group missing!')); - PE->save_partsgroup(\%myconfig, \%$form); - $form->redirect($locale->text('Group saved!')); - } - - $lxdebug->leave_sub(); -} - - -sub delete { - $lxdebug->enter_sub(); - - PE->delete_tuple(\%myconfig, \%$form); - - if ($form->{type} eq 'project') { - $form->redirect($locale->text('Project deleted!')); - } - if ($form->{type} eq 'partsgroup') { - $form->redirect($locale->text('Group deleted!')); - } - - $lxdebug->leave_sub(); -} - - -sub continue { &{ $form->{nextsub} } }; - - -sub partsgroup_report { - $lxdebug->enter_sub(); - - map { $form->{$_} = $form->unescape($form->{$_}) } (partsgroup); - 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}"; - - 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}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{partsgroup}
-

- -
-
{script}> - - - -{type}> - -{path}> -{login}> -{password}> - -|; - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| -
- - - -|; - - $lxdebug->leave_sub(); -} - - -sub form_partsgroup_header { - $lxdebug->enter_sub(); - - $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(); - - print qq| - - - -{path}> -{login}> -{password}> - -
-|; - - if ($form->{id} && $form->{orphaned}) { - print qq| -|; - } - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| -
- - - -|; - - $lxdebug->leave_sub(); -} - -