summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-13 16:28:21 +0000
committerchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-13 16:28:21 +0000
commitedacf95ad24fca3c4ae08b44ffdfe4be5c68fdc1 (patch)
tree70407a0ef31c2cdf8a15170967f6ebbe45eb7073
parent2da98858e16ce370ece0bd79fae96b2e6312b2b5 (diff)
removing bin/lynx and bin/mozilla folders. All scripts are now at bin/ with bin/custom for custom scripts (user specific or otherwise)
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@208 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/Form.pm2
-rwxr-xr-xadmin.pl4
-rwxr-xr-xbin/aa.pl (renamed from bin/mozilla/aa.pl)14
-rwxr-xr-xbin/admin.pl (renamed from bin/mozilla/admin.pl)6
-rwxr-xr-xbin/am.pl (renamed from bin/mozilla/am.pl)34
-rwxr-xr-xbin/ap.pl (renamed from bin/mozilla/ap.pl)6
-rwxr-xr-xbin/ar.pl (renamed from bin/mozilla/ar.pl)6
-rwxr-xr-xbin/arap.pl (renamed from bin/mozilla/arap.pl)8
-rwxr-xr-xbin/arapprn.pl (renamed from bin/mozilla/arapprn.pl)8
-rwxr-xr-xbin/bp.pl (renamed from bin/mozilla/bp.pl)2
-rwxr-xr-xbin/ca.pl (renamed from bin/mozilla/ca.pl)0
-rwxr-xr-xbin/cp.pl (renamed from bin/mozilla/cp.pl)6
-rwxr-xr-xbin/ct.pl (renamed from bin/mozilla/ct.pl)10
-rwxr-xr-xbin/gl.pl (renamed from bin/mozilla/gl.pl)8
-rwxr-xr-xbin/hr.pl (renamed from bin/mozilla/hr.pl)10
-rwxr-xr-xbin/ic.pl (renamed from bin/mozilla/ic.pl)14
-rwxr-xr-xbin/io.pl (renamed from bin/mozilla/io.pl)10
-rwxr-xr-xbin/ir.pl (renamed from bin/mozilla/ir.pl)6
-rwxr-xr-xbin/is.pl (renamed from bin/mozilla/is.pl)6
-rwxr-xr-xbin/jc.pl (renamed from bin/mozilla/jc.pl)10
-rwxr-xr-xbin/login.pl (renamed from bin/mozilla/login.pl)8
-rwxr-xr-xbin/lynx/aa.pl7
-rwxr-xr-xbin/lynx/admin.pl3
-rwxr-xr-xbin/lynx/am.pl4
-rwxr-xr-xbin/lynx/ap.pl3
-rwxr-xr-xbin/lynx/ar.pl3
-rwxr-xr-xbin/lynx/arap.pl3
-rwxr-xr-xbin/lynx/arapprn.pl3
-rwxr-xr-xbin/lynx/bp.pl3
-rwxr-xr-xbin/lynx/ca.pl3
-rwxr-xr-xbin/lynx/cp.pl3
-rwxr-xr-xbin/lynx/ct.pl3
-rwxr-xr-xbin/lynx/gl.pl3
-rwxr-xr-xbin/lynx/hr.pl3
-rwxr-xr-xbin/lynx/ic.pl3
-rwxr-xr-xbin/lynx/io.pl3
-rwxr-xr-xbin/lynx/ir.pl3
-rwxr-xr-xbin/lynx/is.pl3
-rwxr-xr-xbin/lynx/jc.pl3
-rwxr-xr-xbin/lynx/login.pl3
-rwxr-xr-xbin/lynx/menu.pl174
-rwxr-xr-xbin/lynx/oe.pl3
-rwxr-xr-xbin/lynx/pe.pl4
-rwxr-xr-xbin/lynx/pos.pl3
-rwxr-xr-xbin/lynx/ps.pl3
-rwxr-xr-xbin/lynx/pw.pl3
-rwxr-xr-xbin/lynx/rc.pl3
-rwxr-xr-xbin/lynx/rp.pl3
-rwxr-xr-xbin/menu.pl351
-rwxr-xr-xbin/mozilla/menu.pl245
-rwxr-xr-xbin/oe.pl (renamed from bin/mozilla/oe.pl)30
-rwxr-xr-xbin/pe.pl (renamed from bin/mozilla/pe.pl)24
-rwxr-xr-xbin/pos.pl (renamed from bin/mozilla/pos.pl)4
-rwxr-xr-xbin/ps.pl (renamed from bin/mozilla/ps.pl)16
-rwxr-xr-xbin/pw.pl (renamed from bin/mozilla/pw.pl)0
-rwxr-xr-xbin/rc.pl (renamed from bin/mozilla/rc.pl)165
-rwxr-xr-xbin/rp.pl (renamed from bin/mozilla/rp.pl)8
-rwxr-xr-xlogin.pl4
-rwxr-xr-xmenu.pl12
59 files changed, 597 insertions, 698 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index be26daec..7e206071 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -62,6 +62,8 @@ sub new {
}
$self->{menubar} = 1 if $self->{path} =~ /lynx/i;
+ #menubar will be deprecated, replaced with below
+ $self->{lynx} = 1 if $self->{path} =~ /lynx/i;
$self->{version} = "1.1.1";
$self->{dbversion} = "2.6.18";
diff --git a/admin.pl b/admin.pl
index 9fd0cb6a..7f83eb74 100755
--- a/admin.pl
+++ b/admin.pl
@@ -100,7 +100,7 @@ if ($form{path}) {
if ($form{path} ne 'bin/lynx'){ $form{path} = 'bin/mozilla';}
$ARGV[0] = "$_&script=$script";
- require "$form{path}/$script";
+ require "bin/$script";
} else {
@@ -113,7 +113,7 @@ if ($form{path}) {
$ARGV[0] = "path=bin/$form{terminal}&script=$script";
map { $ARGV[0] .= "&${_}=$form{$_}" } keys %form;
- require "bin/$form{terminal}/$script";
+ require "bin/$script";
}
diff --git a/bin/mozilla/aa.pl b/bin/aa.pl
index 6e0b09ac..5f8edb83 100755
--- a/bin/mozilla/aa.pl
+++ b/bin/aa.pl
@@ -47,11 +47,11 @@
use LedgerSMB::Tax;
# any custom scripts for this one
-if (-f "$form->{path}/custom_aa.pl") {
- eval { require "$form->{path}/custom_aa.pl"; };
+if (-f "bin/custom/aa.pl") {
+ eval { require "bin/custom/aa.pl"; };
}
-if (-f "$form->{path}/$form->{login}_aa.pl") {
- eval { require "$form->{path}/$form->{login}_aa.pl"; };
+if (-f "bin/custom/$form->{login}_aa.pl") {
+ eval { require "bin/custom/$form->{login}_aa.pl"; };
}
@@ -740,7 +740,7 @@ sub form_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1199,7 +1199,7 @@ sub search {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1596,7 +1596,7 @@ sub transactions {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/admin.pl b/bin/admin.pl
index 686aee2e..9a90830a 100755
--- a/bin/mozilla/admin.pl
+++ b/bin/admin.pl
@@ -52,11 +52,11 @@ $form->{stylesheet} = "ledger-smb.css";
$form->{favicon} = "favicon.ico";
$form->{timeout} = 600;
-require "$form->{path}/pw.pl";
+require "bin/pw.pl";
# customization
-if (-f "$form->{path}/custom_$form->{script}") {
- eval { require "$form->{path}/custom_$form->{script}"; };
+if (-f "bin/custom/$form->{script}") {
+ eval { require "bin/custom/$form->{script}"; };
$form->error($@) if ($@);
}
diff --git a/bin/mozilla/am.pl b/bin/am.pl
index 666b5522..50d5c8cd 100755
--- a/bin/mozilla/am.pl
+++ b/bin/am.pl
@@ -263,7 +263,7 @@ sub form_footer {
for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) }
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -592,7 +592,7 @@ sub gifi_footer {
for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) }
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -751,7 +751,7 @@ sub list_department {
<input class=submit type=submit name=action value="|.$locale->text('Add Department').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -941,7 +941,7 @@ sub list_business {
<input class=submit type=submit name=action value="|.$locale->text('Add Business').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1142,7 +1142,7 @@ sub list_sic {
<input class=submit type=submit name=action value="|.$locale->text('Add SIC').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1330,7 +1330,7 @@ sub list_language {
<input class=submit type=submit name=action value="|.$locale->text('Add Language').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1575,7 +1575,7 @@ sub list_templates {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1627,7 +1627,7 @@ $form->{body}
<input name=action type=submit class=submit value="|.$locale->text('Edit').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1674,7 +1674,7 @@ $form->{body}
<input type=submit class=submit name=action value="|.$locale->text('Save').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1843,7 +1843,7 @@ sub defaults {
<input type=submit class=submit name=action value="|.$locale->text('Save').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1963,7 +1963,7 @@ sub display_taxes {
<input type=submit class=submit name=action value="|.$locale->text('Save').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2188,7 +2188,7 @@ sub config {
<input type=submit class=submit name=action value="|.$locale->text('Save').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2469,7 +2469,7 @@ sub list_warehouse {
<input class=submit type=submit name=action value="|.$locale->text('Add Warehouse').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2887,7 +2887,7 @@ print qq|
<input class=submit type=submit name=action value="|.$locale->text('Process Transactions').qq|">| if $k;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2941,7 +2941,7 @@ sub edit_recurring {
}
$form->{script} = "$form->{module}.pl";
- do "$form->{path}/$form->{script}";
+ do "bin/$form->{script}";
&{ $links{$form->{module}} };
@@ -3009,7 +3009,7 @@ sub process_transactions {
$form->{module} = "ap";
$invfld = "vinumber";
}
- do "$form->{path}/$form->{script}";
+ do "bin/$form->{script}";
if ($pt->{invoice}) {
&invoice_links;
@@ -3106,7 +3106,7 @@ sub process_transactions {
$ordfld = "ponumber";
$flabel = $locale->text('Purchase Order');
}
- require "$form->{path}/$form->{script}";
+ require "bin/$form->{script}";
&order_links;
&prepare_order;
diff --git a/bin/mozilla/ap.pl b/bin/ap.pl
index 74a0a5cb..c3ce73cf 100755
--- a/bin/mozilla/ap.pl
+++ b/bin/ap.pl
@@ -48,9 +48,9 @@
use LedgerSMB::PE;
use LedgerSMB::IR;
-require "$form->{path}/arap.pl";
-require "$form->{path}/arapprn.pl";
-require "$form->{path}/aa.pl";
+require "bin/arap.pl";
+require "bin/arapprn.pl";
+require "bin/aa.pl";
$form->{vc} = 'vendor';
$form->{ARAP} = 'AP';
diff --git a/bin/mozilla/ar.pl b/bin/ar.pl
index ae17ca82..dd08ee71 100755
--- a/bin/mozilla/ar.pl
+++ b/bin/ar.pl
@@ -43,9 +43,9 @@
use LedgerSMB::PE;
use LedgerSMB::IS;
-require "$form->{path}/arap.pl";
-require "$form->{path}/arapprn.pl";
-require "$form->{path}/aa.pl";
+require "bin/arap.pl";
+require "bin/arapprn.pl";
+require "bin/aa.pl";
$form->{vc} = 'customer';
$form->{ARAP} = 'AR';
diff --git a/bin/mozilla/arap.pl b/bin/arap.pl
index 198afe2c..1f92d5b0 100755
--- a/bin/mozilla/arap.pl
+++ b/bin/arap.pl
@@ -41,11 +41,11 @@
use LedgerSMB::AA;
# any custom scripts for this one
-if (-f "$form->{path}/custom_arap.pl") {
- eval { require "$form->{path}/custom_arap.pl"; };
+if (-f "bin/custom/arap.pl") {
+ eval { require "bin/custom/arap.pl"; };
}
-if (-f "$form->{path}/$form->{login}_arap.pl") {
- eval { require "$form->{path}/$form->{login}_arap.pl"; };
+if (-f "bin/custom/$form->{login}_arap.pl") {
+ eval { require "bin/custom/$form->{login}_arap.pl"; };
}
diff --git a/bin/mozilla/arapprn.pl b/bin/arapprn.pl
index 159ccffe..979ae578 100755
--- a/bin/mozilla/arapprn.pl
+++ b/bin/arapprn.pl
@@ -40,11 +40,11 @@
#
# any custom scripts for this one
-if (-f "$form->{path}/custom_arapprn.pl") {
- eval { require "$form->{path}/custom_arapprn.pl"; };
+if (-f "bin/custom/arapprn.pl") {
+ eval { require "bin/custom/arapprn.pl"; };
}
-if (-f "$form->{path}/$form->{login}_arapprn.pl") {
- eval { require "$form->{path}/$form->{login}_arapprn.pl"; };
+if (-f "bin/custom/$form->{login}_arapprn.pl") {
+ eval { require "bin/custom/$form->{login}_arapprn.pl"; };
}
diff --git a/bin/mozilla/bp.pl b/bin/bp.pl
index 8cfabb53..0e969dcf 100755
--- a/bin/mozilla/bp.pl
+++ b/bin/bp.pl
@@ -520,7 +520,7 @@ sub list_spool {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/ca.pl b/bin/ca.pl
index 7ec5a435..7ec5a435 100755
--- a/bin/mozilla/ca.pl
+++ b/bin/ca.pl
diff --git a/bin/mozilla/cp.pl b/bin/cp.pl
index fb230656..2caf4e7a 100755
--- a/bin/mozilla/cp.pl
+++ b/bin/cp.pl
@@ -51,7 +51,7 @@ use LedgerSMB::OP;
use LedgerSMB::IS;
use LedgerSMB::IR;
-require "$form->{path}/arap.pl";
+require "bin/arap.pl";
1;
# end of main
@@ -507,7 +507,7 @@ sub payments_footer {
$form->hide_form(qw(callback rowcount path login sessionid));
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1110,7 +1110,7 @@ sub payment_footer {
$form->hide_form(qw(callback rowcount path login sessionid));
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/ct.pl b/bin/ct.pl
index 82c65146..6392cbab 100755
--- a/bin/mozilla/ct.pl
+++ b/bin/ct.pl
@@ -183,7 +183,7 @@ sub history {
&search_name;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -371,7 +371,7 @@ sub search {
&search_name;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -955,7 +955,7 @@ sub list_names {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1254,7 +1254,7 @@ sub list_history {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1731,7 +1731,7 @@ sub form_footer {
for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) }
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/gl.pl b/bin/gl.pl
index 9a83675a..ac22be49 100755
--- a/bin/mozilla/gl.pl
+++ b/bin/gl.pl
@@ -49,7 +49,7 @@
use LedgerSMB::GL;
use LedgerSMB::PE;
-require "$form->{path}/arap.pl";
+require "bin/arap.pl";
1;
# end of main
@@ -354,7 +354,7 @@ sub search {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -690,7 +690,7 @@ sub generate_report {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1073,7 +1073,7 @@ sub form_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/hr.pl b/bin/hr.pl
index d2d5848e..446b516b 100755
--- a/bin/mozilla/hr.pl
+++ b/bin/hr.pl
@@ -171,7 +171,7 @@ sub search_employee {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -379,7 +379,7 @@ sub list_employees {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -691,7 +691,7 @@ sub employee_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -873,7 +873,7 @@ sub search_deduction {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1124,7 +1124,7 @@ sub deduction_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/ic.pl b/bin/ic.pl
index 16e67d24..05828ca2 100755
--- a/bin/mozilla/ic.pl
+++ b/bin/ic.pl
@@ -44,7 +44,7 @@
use LedgerSMB::IC;
use LedgerSMB::Tax;
-require "$form->{path}/io.pl";
+require "bin/io.pl";
1;
# end of main
@@ -775,7 +775,7 @@ sub form_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1145,7 +1145,7 @@ sub search {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1804,7 +1804,7 @@ sub generate_report {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1969,7 +1969,7 @@ sub requirements {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2172,7 +2172,7 @@ sub requirements_report {
$form->hide_form(qw(callback path login sessionid));
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -3092,7 +3092,7 @@ sub stock_assembly {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/io.pl b/bin/io.pl
index b2ea21b2..8243272f 100755
--- a/bin/mozilla/io.pl
+++ b/bin/io.pl
@@ -41,11 +41,11 @@
use LedgerSMB::Tax;
# any custom scripts for this one
-if (-f "$form->{path}/custom_io.pl") {
- eval { require "$form->{path}/custom_io.pl"; };
+if (-f "bin/custom/io.pl") {
+ eval { require "bin/custom/io.pl"; };
}
-if (-f "$form->{path}/$form->{login}_io.pl") {
- eval { require "$form->{path}/$form->{login}_io.pl"; };
+if (-f "bin/custom/$form->{login}_io.pl") {
+ eval { require "bin/custom/$form->{login}_io.pl"; };
}
@@ -934,7 +934,7 @@ sub create_form {
$form->{rowcount}-- if $form->{rowcount};
$form->{rowcount} = 0 if ! $form->{"$form->{vc}_id"};
- do "$form->{path}/$form->{script}";
+ do "bin/$form->{script}";
for ("$form->{vc}", "currency") { $form->{"select$_"} = "" }
diff --git a/bin/mozilla/ir.pl b/bin/ir.pl
index be87e9eb..4027098e 100755
--- a/bin/mozilla/ir.pl
+++ b/bin/ir.pl
@@ -43,8 +43,8 @@ use LedgerSMB::IR;
use LedgerSMB::PE;
use LedgerSMB::Tax;
-require "$form->{path}/io.pl";
-require "$form->{path}/arap.pl";
+require "bin/io.pl";
+require "bin/arap.pl";
1;
# end of main
@@ -614,7 +614,7 @@ sub form_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/is.pl b/bin/is.pl
index c93c2337..eeaf13cb 100755
--- a/bin/mozilla/is.pl
+++ b/bin/is.pl
@@ -48,8 +48,8 @@ use LedgerSMB::IS;
use LedgerSMB::PE;
use LedgerSMB::Tax;
-require "$form->{path}/arap.pl";
-require "$form->{path}/io.pl";
+require "bin/arap.pl";
+require "bin/io.pl";
1;
@@ -683,7 +683,7 @@ sub form_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/jc.pl b/bin/jc.pl
index b5aa0d11..91d32afb 100755
--- a/bin/mozilla/jc.pl
+++ b/bin/jc.pl
@@ -299,7 +299,7 @@ sub search {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -657,7 +657,7 @@ sub timecard_footer {
for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) }
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -867,7 +867,7 @@ sub storescard_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1526,7 +1526,7 @@ sub list_timecard {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1705,7 +1705,7 @@ sub list_storescard {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/login.pl b/bin/login.pl
index 466f741d..64d7bfa0 100755
--- a/bin/mozilla/login.pl
+++ b/bin/login.pl
@@ -50,14 +50,14 @@ $locale = new Locale $language, "login";
$form->{charset} = $locale->{charset};
# customization
-if (-f "$form->{path}/custom_$form->{script}") {
- eval { require "$form->{path}/custom_$form->{script}"; };
+if (-f "bin/custom/$form->{script}") {
+ eval { require "bin/custom/$form->{script}"; };
$form->error($@) if ($@);
}
# per login customization
-if (-f "$form->{path}/$form->{login}_$form->{script}") {
- eval { require "$form->{path}/$form->{login}_$form->{script}"; };
+if (-f "bin/custom/$form->{login}_$form->{script}") {
+ eval { require "bin/custom/$form->{login}_$form->{script}"; };
$form->error($@) if ($@);
}
diff --git a/bin/lynx/aa.pl b/bin/lynx/aa.pl
deleted file mode 100755
index ed093b04..00000000
--- a/bin/lynx/aa.pl
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/aa.pl";
-
-## Differing routines go here
-
-1;
diff --git a/bin/lynx/admin.pl b/bin/lynx/admin.pl
deleted file mode 100755
index 717ea889..00000000
--- a/bin/lynx/admin.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/admin.pl";
diff --git a/bin/lynx/am.pl b/bin/lynx/am.pl
deleted file mode 100755
index 3d93f1eb..00000000
--- a/bin/lynx/am.pl
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/perl
-
-
-require "bin/mozilla/am.pl";
diff --git a/bin/lynx/ap.pl b/bin/lynx/ap.pl
deleted file mode 100755
index a9dae7f2..00000000
--- a/bin/lynx/ap.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/ap.pl";
diff --git a/bin/lynx/ar.pl b/bin/lynx/ar.pl
deleted file mode 100755
index 562117c9..00000000
--- a/bin/lynx/ar.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/ar.pl";
diff --git a/bin/lynx/arap.pl b/bin/lynx/arap.pl
deleted file mode 100755
index a3d4feed..00000000
--- a/bin/lynx/arap.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/arap.pl";
diff --git a/bin/lynx/arapprn.pl b/bin/lynx/arapprn.pl
deleted file mode 100755
index 0b923c35..00000000
--- a/bin/lynx/arapprn.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/arapprn.pl";
diff --git a/bin/lynx/bp.pl b/bin/lynx/bp.pl
deleted file mode 100755
index fd88560b..00000000
--- a/bin/lynx/bp.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/bp.pl";
diff --git a/bin/lynx/ca.pl b/bin/lynx/ca.pl
deleted file mode 100755
index 152211ea..00000000
--- a/bin/lynx/ca.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/ca.pl";
diff --git a/bin/lynx/cp.pl b/bin/lynx/cp.pl
deleted file mode 100755
index 77999967..00000000
--- a/bin/lynx/cp.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/cp.pl";
diff --git a/bin/lynx/ct.pl b/bin/lynx/ct.pl
deleted file mode 100755
index e2063d80..00000000
--- a/bin/lynx/ct.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/ct.pl"
diff --git a/bin/lynx/gl.pl b/bin/lynx/gl.pl
deleted file mode 100755
index 3e95b48d..00000000
--- a/bin/lynx/gl.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/perl
-
-require "bin/mozilla/gl.pl";
diff --git a/bin/lynx/hr.pl b/bin/lynx/hr.pl
deleted file mode 100755
index 124365b0..00000000
--- a/bin/lynx/hr.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/hr.pl";
diff --git a/bin/lynx/ic.pl b/bin/lynx/ic.pl
deleted file mode 100755
index 635b9ab9..00000000
--- a/bin/lynx/ic.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/ic.pl";
diff --git a/bin/lynx/io.pl b/bin/lynx/io.pl
deleted file mode 100755
index 9ff32366..00000000
--- a/bin/lynx/io.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/io.pl";
diff --git a/bin/lynx/ir.pl b/bin/lynx/ir.pl
deleted file mode 100755
index f2195c7d..00000000
--- a/bin/lynx/ir.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/ir.pl";
diff --git a/bin/lynx/is.pl b/bin/lynx/is.pl
deleted file mode 100755
index d5717587..00000000
--- a/bin/lynx/is.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/is.pl";
diff --git a/bin/lynx/jc.pl b/bin/lynx/jc.pl
deleted file mode 100755
index c40eab2d..00000000
--- a/bin/lynx/jc.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/jc.pl";
diff --git a/bin/lynx/login.pl b/bin/lynx/login.pl
deleted file mode 100755
index 9ac6417d..00000000
--- a/bin/lynx/login.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/login.pl";
diff --git a/bin/lynx/menu.pl b/bin/lynx/menu.pl
deleted file mode 100755
index 7699f3a0..00000000
--- a/bin/lynx/menu.pl
+++ /dev/null
@@ -1,174 +0,0 @@
-######################################################################
-# LedgerSMB Small Medium Business Accounting
-# http://www.ledgersmb.org/
-#
-# Copyright (C) 2006
-# This work contains copyrighted information from a number of sources all used
-# with permission.
-#
-# This file contains source code included with or based on SQL-Ledger which
-# is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed
-# under the GNU General Public License version 2 or, at your option, any later
-# version. For a full list including contact information of contributors,
-# maintainers, and copyright holders, see the CONTRIBUTORS file.
-#
-# Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork):
-# Copyright (c) 2000
-#
-# Author: Dieter Simader
-# Email: dsimader@sql-ledger.org
-# Web: http://www.sql-ledger.org
-#
-# Contributors: Christopher Browne <cbrowne@acm.org>
-# Tony Fraser <tony@sybaspace.com>
-#
-#
-# Portions Copyright (c) 2000
-#
-# 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.
-#######################################################################
-#
-# menu for text based browsers (lynx)
-#
-#######################################################################
-
-$menufile = "menu.ini";
-use LedgerSMB::Menu;
-
-
-1;
-# end of main
-
-
-
-sub display {
-
- $menu = new Menu "$menufile";
- $menu->add_file("custom_$menufile") if -f "custom_$menufile";
- $menu->add_file("$form->{login}_$menufile") if -f "$form->{login}_$menufile";
-
- @menuorder = $menu->access_control(\%myconfig);
-
- $form->{title} = "LedgerSMB $form->{version}";
-
- $form->header(1);
-
- $offset = int (21 - $#menuorder)/2;
-
- print "<pre>";
- print "\n" x $offset;
- print "</pre>";
-
- print qq|<center><table>|;
-
- map { print "<tr><td>".$menu->menuitem(\%myconfig, \%$form, $_).$locale->text($_).qq|</a></td></tr>|; } @menuorder;
-
- print qq'
-</table>
-
-</body>
-</html>
-';
-
-}
-
-
-sub section_menu {
-
- $menu = new Menu "$menufile", $form->{level};
-
- $menu->add_file("custom_$menufile") if -f "custom_$menufile";
- $menu->add_file("$form->{login}_$menufile") if -f "$form->{login}_$menufile";
-
- # build tiered menus
- @menuorder = $menu->access_control(\%myconfig, $form->{level});
-
- foreach $item (@menuorder) {
- $a = $item;
- $item =~ s/^$form->{level}--//;
- push @neworder, $a unless ($item =~ /--/);
- }
- @menuorder = @neworder;
-
- $level = $form->{level};
- $level =~ s/--/ /g;
-
- $form->{title} = $locale->text($level);
-
- $form->header;
-
- $offset = int (21 - $#menuorder)/2;
- print "<pre>";
- print "\n" x $offset;
- print "</pre>";
-
- print qq|<center><table>|;
-
- foreach $item (@menuorder) {
- $label = $item;
- $label =~ s/$form->{level}--//g;
-
- # remove target
- $menu->{$item}{target} = "";
-
- print "<tr><td>".$menu->menuitem(\%myconfig, \%$form, $item, $form->{level}).$locale->text($label)."</a></td></tr>";
- }
-
- print qq'</table>
-
-</body>
-</html>
-';
-
-}
-
-
-sub acc_menu {
-
- &section_menu;
-
-}
-
-
-sub menubar {
- $menu = new Menu "$menufile", "";
-
- # build menubar
- @menuorder = $menu->access_control(\%myconfig, "");
-
- @neworder = ();
- map { push @neworder, $_ unless ($_ =~ /--/) } @menuorder;
- @menuorder = @neworder;
-
- print "<p>";
- $form->{script} = "menu.pl";
-
- print "| ";
- foreach $item (@menuorder) {
- $label = $item;
-
- # remove target
- $menu->{$item}{target} = "";
-
- print $menu->menuitem(\%myconfig, \%$form, $item, "").$locale->text($label)."</a> | ";
- }
-
-}
-
-
diff --git a/bin/lynx/oe.pl b/bin/lynx/oe.pl
deleted file mode 100755
index 97f5006c..00000000
--- a/bin/lynx/oe.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/oe.pl";
diff --git a/bin/lynx/pe.pl b/bin/lynx/pe.pl
deleted file mode 100755
index f461e19e..00000000
--- a/bin/lynx/pe.pl
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/perl
-
-
-require "bin/mozilla/pe.pl";
diff --git a/bin/lynx/pos.pl b/bin/lynx/pos.pl
deleted file mode 100755
index 09688320..00000000
--- a/bin/lynx/pos.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bim/mozilla/pos.pl";
diff --git a/bin/lynx/ps.pl b/bin/lynx/ps.pl
deleted file mode 100755
index 411cb0b0..00000000
--- a/bin/lynx/ps.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/ps.pl";
diff --git a/bin/lynx/pw.pl b/bin/lynx/pw.pl
deleted file mode 100755
index 0ce64df3..00000000
--- a/bin/lynx/pw.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/pw.pl";
diff --git a/bin/lynx/rc.pl b/bin/lynx/rc.pl
deleted file mode 100755
index 2d272b46..00000000
--- a/bin/lynx/rc.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/rc.pl";
diff --git a/bin/lynx/rp.pl b/bin/lynx/rp.pl
deleted file mode 100755
index 2903f65c..00000000
--- a/bin/lynx/rp.pl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-require "bin/mozilla/rp.pl";
diff --git a/bin/menu.pl b/bin/menu.pl
new file mode 100755
index 00000000..1a25014e
--- /dev/null
+++ b/bin/menu.pl
@@ -0,0 +1,351 @@
+#=====================================================================
+# LedgerSMB
+# Small Medium Business Accounting software
+# http://www.ledgersmb.org/
+#
+#
+# See COPYRIGHT file for copyright information
+#======================================================================
+#
+# This file has undergone whitespace cleanup.
+#
+#======================================================================
+#
+# two frame layout with refractured menu
+#
+#######################################################################
+
+$menufile = "menu.ini";
+use LedgerSMB::Menu;
+
+1;
+# end of main
+
+
+sub display {
+
+ if($form->{lynx}){
+
+ $menu = new Menu "$menufile";
+ $menu->add_file("custom_$menufile") if -f "custom_$menufile";
+ $menu->add_file("$form->{login}_$menufile") if -f "$form->{login}_$menufile";
+
+ @menuorder = $menu->access_control(\%myconfig);
+
+ $form->{title} = "LedgerSMB $form->{version}";
+ $form->header(1);
+
+ $offset = int (21 - $#menuorder)/2;
+
+ print "<pre>";
+ print "\n" x $offset;
+ print "</pre>";
+ print qq|<center><table>|;
+
+ map { print "<tr><td>".$menu->menuitem(\%myconfig, \%$form, $_).$locale->text($_).qq|</a></td></tr>|; } @menuorder;
+
+ print qq'</table></body></html>';
+
+
+ } else {
+
+ $menuwidth = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "155";
+ $menuwidth = $myconfig{menuwidth} if $myconfig{menuwidth};
+
+ $form->header(!$form->{duplicate});
+
+ print qq|
+ <frameset cols="$menuwidth,*" border="1">
+ <frame name="acc_menu" src="$form->{script}?login=$form->{login}&amp;sessionid=$form->{sessionid}&amp;action=acc_menu&amp;path=$form->{path}&amp;js=$form->{js}" />
+ <frame name="main_window" src="am.pl?login=$form->{login}&amp;sessionid=$form->{sessionid}&amp;action=$form->{main}&amp;path=$form->{path}" />
+ </frameset>
+ </html>
+ |;
+
+ }
+
+}
+
+
+
+sub acc_menu {
+
+ if($form->{lynx}){
+
+ &section_menu;
+
+ } else {
+
+ my $menu = new Menu "$menufile";
+ $menu->add_file("custom_$menufile") if -f "custom_$menufile";
+ $menu->add_file("$form->{login}_$menufile") if -f "$form->{login}_$menufile";
+
+ $form->{title} = $locale->text('Accounting Menu');
+
+ my $headeradd = q|
+ <script type="text/javascript">
+
+ function SwitchMenu(obj) {
+ if (document.getElementById) {
+ var el = document.getElementById(obj);
+
+ if (el.style.display == "none") {
+ el.style.display = "block"; //display the block of info
+ } else {
+ el.style.display = "none";
+ }
+ }
+ }
+
+ function ChangeClass(menu, newClass) {
+ if (document.getElementById) {
+ document.getElementById(menu).className = newClass;
+ }
+ }
+
+ document.onselectstart = new Function("return false");
+ </script>|;
+ $form->header(undef, $headeradd);
+ print q|
+
+ <body class="menu">
+ <img class="cornderlogo" src="ledger-smb_small.png" width="100" height="50" border="1" alt="ledger-smb" />
+ |;
+
+ if ($form->{js}) {
+ &js_menu($menu);
+ } else {
+ &section_menu($menu);
+ }
+
+ print q|
+ </body>
+ </html>
+ |;
+ }
+}
+
+
+sub section_menu {
+
+ if($form->{lynx}){
+
+ $menu = new Menu "$menufile", $form->{level};
+
+ $menu->add_file("custom_$menufile") if -f "custom_$menufile";
+ $menu->add_file("$form->{login}_$menufile") if -f "$form->{login}_$menufile";
+
+ # build tiered menus
+ @menuorder = $menu->access_control(\%myconfig, $form->{level});
+
+ foreach $item (@menuorder) {
+ $a = $item;
+ $item =~ s/^$form->{level}--//;
+ push @neworder, $a unless ($item =~ /--/);
+ }
+
+ @menuorder = @neworder;
+
+ $level = $form->{level};
+ $level =~ s/--/ /g;
+
+ $form->{title} = $locale->text($level);
+ $form->header;
+
+ $offset = int (21 - $#menuorder)/2;
+
+ print "<pre>";
+ print "\n" x $offset;
+ print "</pre>";
+ print qq|<center><table>|;
+
+ foreach $item (@menuorder) {
+ $label = $item;
+ $label =~ s/$form->{level}--//g;
+
+ # remove target
+ $menu->{$item}{target} = "";
+
+ print "<tr><td>".$menu->menuitem(\%myconfig, \%$form, $item, $form->{level}).$locale->text($label)."</a></td></tr>";
+ }
+
+ print qq'</table></body></html>';
+
+ } else {
+
+ my ($menu, $level) = @_;
+
+ # build tiered menus
+ my @menuorder = $menu->access_control(\%myconfig, $level);
+
+ while (@menuorder) {
+ $item = shift @menuorder;
+ $label = $item;
+ $label =~ s/$level--//g;
+
+ my $spacer = "&nbsp;" x (($item =~ s/--/--/g) * 2);
+
+ $label =~ s/.*--//g;
+ $label = $locale->text($label);
+ $label =~ s/ /&nbsp;/g if $label !~ /<img /i;
+
+ $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
+
+ if ($menu->{$item}{submenu}) {
+
+ $menu->{$item}{$item} = !$form->{$item};
+
+ if ($form->{level} && $item =~ $form->{level}) {
+
+ # expand menu
+ print qq|<br />\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
+
+ # remove same level items
+ map { shift @menuorder } grep /^$item/, @menuorder;
+
+ &section_menu($menu, $item);
+
+ print qq|<br />\n|;
+
+ } else {
+
+ print qq|<br />\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label&nbsp;...</a>|;
+
+ # remove same level items
+ map { shift @menuorder } grep /^$item/, @menuorder;
+
+ }
+
+ } else {
+
+ if ($menu->{$item}{module}) {
+
+ print qq|<br />\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
+
+ } else {
+
+ $form->{tag}++;
+ print qq|<a name="id$form->{tag}"></a><p><b>$label</b></p>|;
+
+ &section_menu($menu, $item);
+
+ print qq|<br />\n|;
+
+ }
+ }
+ }
+ }
+}
+
+
+sub js_menu {
+
+ my ($menu, $level) = @_;
+
+ print qq| <div id="div_$menu_$level"> |;
+
+ # build tiered menus
+ my @menuorder = $menu->access_control(\%myconfig, $level);
+
+ while (@menuorder){
+ $i++;
+ $item = shift @menuorder;
+ $label = $item;
+ $label =~ s/.*--//g;
+ $label = $locale->text($label);
+
+ $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
+
+ if ($menu->{$item}{submenu}) {
+
+ $display = "display: none;" unless $level eq ' ';
+
+ print qq|
+ <div id="menu$i" class="menuOut" onclick="SwitchMenu('sub$i')" onmouseover="ChangeClass('menu$i','menuOver')" onmouseout="ChangeClass('menu$i','menuOut')">$label</div>
+ <div class="submenu" id="sub$i" style="$display">|;
+
+ # remove same level items
+ map { shift @menuorder } grep /^$item/, @menuorder;
+
+ &js_menu($menu, $item);
+
+ print qq|
+
+ </div>
+ |;
+
+ } else {
+
+ if ($menu->{$item}{module}) {
+
+ if ($level eq "") {
+ print qq|<div id="menu$i" class="menuOut" onmouseover="ChangeClass('menu$i','menuOver')" onmouseout="ChangeClass('menu$i','menuOut')"> |.
+ $menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a></div>|;
+
+ # remove same level items
+ map { shift @menuorder } grep /^$item/, @menuorder;
+
+ &js_menu($menu, $item);
+
+ } else {
+
+ print qq|<div class="submenu"> |.
+ $menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a></div>|;
+ }
+
+ } else {
+
+ $display = "display: none;" unless $item eq ' ';
+
+ print qq|
+ <div id="menu$i" class="menuOut" onclick="SwitchMenu('sub$i')" onmouseover="ChangeClass('menu$i','menuOver')" onmouseout="ChangeClass('menu$i','menuOut')">$label</div>
+ <div class="submenu" id="sub$i" style="$display">|;
+
+ &js_menu($menu, $item);
+
+ print qq| </div> |;
+
+ }
+
+ }
+
+ }
+
+ print qq| </div> |;
+}
+
+
+sub menubar {
+
+ if($form->{lynx}){
+
+ $menu = new Menu "$menufile", "";
+
+ # build menubar
+ @menuorder = $menu->access_control(\%myconfig, "");
+
+ @neworder = ();
+ map { push @neworder, $_ unless ($_ =~ /--/) } @menuorder;
+ @menuorder = @neworder;
+
+ print "<p>";
+ $form->{script} = "menu.pl";
+
+ print "| ";
+
+ foreach $item (@menuorder) {
+ $label = $item;
+
+ # remove target
+ $menu->{$item}{target} = "";
+
+ print $menu->menuitem(\%myconfig, \%$form, $item, "").$locale->text($label)."</a> | ";
+ }
+
+ } else {
+
+ 1;
+ }
+}
+
+
diff --git a/bin/mozilla/menu.pl b/bin/mozilla/menu.pl
deleted file mode 100755
index 199a21cc..00000000
--- a/bin/mozilla/menu.pl
+++ /dev/null
@@ -1,245 +0,0 @@
-#=====================================================================
-# LedgerSMB
-# Small Medium Business Accounting software
-# http://www.ledgersmb.org/
-#
-#
-# See COPYRIGHT file for copyright information
-#======================================================================
-#
-# This file has undergone whitespace cleanup.
-#
-#======================================================================
-#
-# two frame layout with refractured menu
-#
-#######################################################################
-
-$menufile = "menu.ini";
-use LedgerSMB::Menu;
-
-1;
-# end of main
-
-
-sub display {
-
- $menuwidth = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "155";
- $menuwidth = $myconfig{menuwidth} if $myconfig{menuwidth};
-
- $form->header(!$form->{duplicate});
-
- print qq|
- <frameset cols="$menuwidth,*" border="1">
- <frame name="acc_menu" src="$form->{script}?login=$form->{login}&amp;sessionid=$form->{sessionid}&amp;action=acc_menu&amp;path=$form->{path}&amp;js=$form->{js}" />
- <frame name="main_window" src="am.pl?login=$form->{login}&amp;sessionid=$form->{sessionid}&amp;action=$form->{main}&amp;path=$form->{path}" />
- </frameset>
- </html>
- |;
-
-}
-
-
-
-sub acc_menu {
-
- my $menu = new Menu "$menufile";
- $menu->add_file("custom_$menufile") if -f "custom_$menufile";
- $menu->add_file("$form->{login}_$menufile") if -f "$form->{login}_$menufile";
-
- $form->{title} = $locale->text('Accounting Menu');
-
- my $headeradd = q|
- <script type="text/javascript">
-
- function SwitchMenu(obj) {
- if (document.getElementById) {
- var el = document.getElementById(obj);
-
- if (el.style.display == "none") {
- el.style.display = "block"; //display the block of info
- } else {
- el.style.display = "none";
- }
- }
- }
-
- function ChangeClass(menu, newClass) {
- if (document.getElementById) {
- document.getElementById(menu).className = newClass;
- }
- }
-
- document.onselectstart = new Function("return false");
- </script>|;
- $form->header(undef, $headeradd);
- print q|
-
- <body class="menu">
- <img class="cornderlogo" src="ledger-smb_small.png" width="100" height="50" border="1" alt="ledger-smb" />
- |;
-
- if ($form->{js}) {
- &js_menu($menu);
- } else {
- &section_menu($menu);
- }
-
- print q|
- </body>
- </html>
- |;
-
-}
-
-
-sub section_menu {
-
- my ($menu, $level) = @_;
-
- # build tiered menus
- my @menuorder = $menu->access_control(\%myconfig, $level);
-
- while (@menuorder) {
- $item = shift @menuorder;
- $label = $item;
- $label =~ s/$level--//g;
-
- my $spacer = "&nbsp;" x (($item =~ s/--/--/g) * 2);
-
- $label =~ s/.*--//g;
- $label = $locale->text($label);
- $label =~ s/ /&nbsp;/g if $label !~ /<img /i;
-
- $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
-
- if ($menu->{$item}{submenu}) {
-
- $menu->{$item}{$item} = !$form->{$item};
-
- if ($form->{level} && $item =~ $form->{level}) {
-
- # expand menu
- print qq|<br />\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
-
- # remove same level items
- map { shift @menuorder } grep /^$item/, @menuorder;
-
- &section_menu($menu, $item);
-
- print qq|<br />\n|;
-
- } else {
-
- print qq|<br />\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label&nbsp;...</a>|;
-
- # remove same level items
- map { shift @menuorder } grep /^$item/, @menuorder;
-
- }
-
- } else {
-
- if ($menu->{$item}{module}) {
-
- print qq|<br />\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
-
- } else {
-
- $form->{tag}++;
- print qq|<a name="id$form->{tag}"></a><p><b>$label</b></p>|;
-
- &section_menu($menu, $item);
-
- print qq|<br />\n|;
-
- }
- }
- }
-}
-
-
-sub js_menu {
-
- my ($menu, $level) = @_;
-
- print qq| <div id="div_$menu_$level"> |;
-
- # build tiered menus
- my @menuorder = $menu->access_control(\%myconfig, $level);
-
- while (@menuorder){
- $i++;
- $item = shift @menuorder;
- $label = $item;
- $label =~ s/.*--//g;
- $label = $locale->text($label);
-
- $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
-
- if ($menu->{$item}{submenu}) {
-
- $display = "display: none;" unless $level eq ' ';
-
- print qq|
- <div id="menu$i" class="menuOut" onclick="SwitchMenu('sub$i')" onmouseover="ChangeClass('menu$i','menuOver')" onmouseout="ChangeClass('menu$i','menuOut')">$label</div>
- <div class="submenu" id="sub$i" style="$display">|;
-
- # remove same level items
- map { shift @menuorder } grep /^$item/, @menuorder;
-
- &js_menu($menu, $item);
-
- print qq|
-
- </div>
- |;
-
- } else {
-
- if ($menu->{$item}{module}) {
-
- if ($level eq "") {
- print qq|<div id="menu$i" class="menuOut" onmouseover="ChangeClass('menu$i','menuOver')" onmouseout="ChangeClass('menu$i','menuOut')"> |.
- $menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a></div>|;
-
- # remove same level items
- map { shift @menuorder } grep /^$item/, @menuorder;
-
- &js_menu($menu, $item);
-
- } else {
-
- print qq|<div class="submenu"> |.
- $menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a></div>|;
- }
-
- } else {
-
- $display = "display: none;" unless $item eq ' ';
-
- print qq|
- <div id="menu$i" class="menuOut" onclick="SwitchMenu('sub$i')" onmouseover="ChangeClass('menu$i','menuOver')" onmouseout="ChangeClass('menu$i','menuOut')">$label</div>
- <div class="submenu" id="sub$i" style="$display">|;
-
- &js_menu($menu, $item);
-
- print qq| </div> |;
-
- }
-
- }
-
- }
-
- print qq| </div> |;
-}
-
-
-sub menubar {
-
-1;
-
-}
-
-
diff --git a/bin/mozilla/oe.pl b/bin/oe.pl
index d4b4bba3..39ab620e 100755
--- a/bin/mozilla/oe.pl
+++ b/bin/oe.pl
@@ -46,8 +46,8 @@ use LedgerSMB::IS;
use LedgerSMB::PE;
use LedgerSMB::Tax;
-require "$form->{path}/arap.pl";
-require "$form->{path}/io.pl";
+require "bin/arap.pl";
+require "bin/io.pl";
1;
@@ -775,7 +775,7 @@ sub form_footer {
for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) }
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1261,7 +1261,7 @@ sub search {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1673,7 +1673,7 @@ sub transactions {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1946,16 +1946,16 @@ sub invoice {
# locale messages
$locale = new Locale "$myconfig{countrycode}", "$script";
- require "$form->{path}/$form->{script}";
+ require "bin/$form->{script}";
# customized scripts
- if (-f "$form->{path}/custom_$form->{script}") {
- eval { require "$form->{path}/custom_$form->{script}"; };
+ if (-f "bin/custom/$form->{script}") {
+ eval { require "bin/custom/$form->{script}"; };
}
# customized scripts for login
- if (-f "$form->{path}/$form->{login}_$form->{script}") {
- eval { require "$form->{path}/$form->{login}_$form->{script}"; };
+ if (-f "bin/custom/$form->{login}_$form->{script}") {
+ eval { require "bin/custom/$form->{login}_$form->{script}"; };
}
for ("$form->{vc}", "currency") { $form->{"select$_"} = "" }
@@ -2440,7 +2440,7 @@ sub display_ship_receive {
$form->print_button(\%button, 'Done');
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2557,7 +2557,7 @@ sub search_transfer {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2709,7 +2709,7 @@ print qq|
<input class=submit type=submit name=action value="|.$locale->text('Transfer').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2918,7 +2918,7 @@ BLANKROW:
<input class=submit type=submit name=action value="|.$locale->text('Select Vendor').qq|">|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -3002,7 +3002,7 @@ sub select_vendor {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/pe.pl b/bin/pe.pl
index 3ccdd4a0..8fdc4aae 100755
--- a/bin/mozilla/pe.pl
+++ b/bin/pe.pl
@@ -399,7 +399,7 @@ sub job_footer {
for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) }
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -746,7 +746,7 @@ sub search {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -954,7 +954,7 @@ sub list_projects {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1066,7 +1066,7 @@ sub project_footer {
for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) }
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1285,7 +1285,7 @@ sub partsgroup_report {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1361,7 +1361,7 @@ sub partsgroup_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1481,7 +1481,7 @@ sub pricegroup_report {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1555,7 +1555,7 @@ sub pricegroup_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1764,7 +1764,7 @@ sub list_translations {
$form->hide_form(qw(path login sessionid));
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1900,7 +1900,7 @@ sub translation_footer {
for (sort { $button{$a}->{ndx} <=> $button{$b}->{ndx} } keys %button) { $form->print_button(\%button, $_) }
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2224,7 +2224,7 @@ sub project_sales_order {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2407,7 +2407,7 @@ sub jcitems {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/pos.pl b/bin/pos.pl
index ef2fbd92..3a1b2c99 100755
--- a/bin/mozilla/pos.pl
+++ b/bin/pos.pl
@@ -578,7 +578,7 @@ sub form_footer {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1042,7 +1042,7 @@ sub receipts {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/ps.pl b/bin/ps.pl
index 7601fd7e..f3df4c98 100755
--- a/bin/mozilla/ps.pl
+++ b/bin/ps.pl
@@ -46,18 +46,18 @@ use LedgerSMB::AA;
use LedgerSMB::IS;
use LedgerSMB::RP;
-require "$form->{path}/ar.pl";
-require "$form->{path}/is.pl";
-require "$form->{path}/rp.pl";
-require "$form->{path}/pos.pl";
+require "bin/ar.pl";
+require "bin/is.pl";
+require "bin/rp.pl";
+require "bin/pos.pl";
require "pos.conf.pl";
# customizations
-if (-f "$form->{path}/custom_pos.pl") {
- eval { require "$form->{path}/custom_pos.pl"; };
+if (-f "bin/custom/pos.pl") {
+ eval { require "bin/custom/pos.pl"; };
}
-if (-f "$form->{path}/$form->{login}_pos.pl") {
- eval { require "$form->{path}/$form->{login}_pos.pl"; };
+if (-f "bin/custom/$form->{login}_pos.pl") {
+ eval { require "bin/custom/$form->{login}_pos.pl"; };
}
1;
diff --git a/bin/mozilla/pw.pl b/bin/pw.pl
index a4aa2808..a4aa2808 100755
--- a/bin/mozilla/pw.pl
+++ b/bin/pw.pl
diff --git a/bin/mozilla/rc.pl b/bin/rc.pl
index e257a386..56ca3a72 100755
--- a/bin/mozilla/rc.pl
+++ b/bin/rc.pl
@@ -173,7 +173,7 @@ sub reconciliation {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -192,7 +192,6 @@ sub till_closing {
$form->{callback} = "$form->{script}?path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}";
@colheadings = qw(Source Actual Expected Error);
- my $curren = $pos_config{'curren'};
$form->{title} = "Closing Till For $form->{login}";
require "pos.conf.pl";
@@ -235,7 +234,7 @@ sub till_closing {
<td><input name="amount_$source">
<input type=hidden name="expected_$source"
value="$amount"></td>
- <td>${curren}$amount</td>
+ <td>\$$amount</td>
<td id="error_$source">&nbsp;</td></tr>|;
}
print qq|
@@ -248,22 +247,30 @@ function money_round(m){
}
function custom_calc_total(){
- |;
- my $subgen = 'document.forms[0].sub_sub.value = ';
- foreach my $unit ($pos_config{'breakdown'}) {
- # XXX Needs to take into account currencies that don't use 2 dp
- my $parsed = $form->parse_amount(\%pos_config, $unit);
- my $calcval = $parsed;
- $calcval = sprintf('%03d', $calcval * 100) if $calcval < 1;
- my $subval = 'sub_' . $calcval;
- $calcval = 'calc_' . $calcval;
- print qq|
- document.forms[0].${subval}.value = document.forms[0].${calcval}.value * $parsed;
- |;
- $subgen .= "document.forms[0].${subval}.value * 1 + ";
- }
- print $subgen . "0;";
- print qq|document.forms[0].sub_sub.value =
+ document.forms[0].sub_100.value = document.forms[0].calc_100.value * 100;
+ document.forms[0].sub_50.value = document.forms[0].calc_50.value * 50;
+ document.forms[0].sub_20.value = document.forms[0].calc_20.value * 20;
+ document.forms[0].sub_10.value = document.forms[0].calc_10.value * 10;
+ document.forms[0].sub_5.value = document.forms[0].calc_5.value * 5;
+ document.forms[0].sub_1.value = document.forms[0].calc_1.value * 1;
+ document.forms[0].sub_050.value = document.forms[0].calc_050.value * .5;
+ document.forms[0].sub_025.value = document.forms[0].calc_025.value * .25;
+ document.forms[0].sub_010.value = document.forms[0].calc_010.value * .10;
+ document.forms[0].sub_005.value = document.forms[0].calc_005.value * .05;
+ document.forms[0].sub_001.value = document.forms[0].calc_001.value * .01;
+ document.forms[0].sub_sub.value = document.forms[0].sub_100.value * 1 +
+ document.forms[0].sub_50.value*1 + document.forms[0].sub_20.value*1 +
+ document.forms[0].sub_10.value*1 + document.forms[0].sub_5.value*1 +
+ document.forms[0].sub_1.value*1 + document.forms[0].sub_050.value*1 +
+ document.forms[0].sub_025.value*1 + document.forms[0].sub_010.value*1 +
+ document.forms[0].sub_005.value*1 + document.forms[0].sub_001.value*1;
+ document.forms[0].sub_001.value =
+ money_round(document.forms[0].sub_001.value);
+ document.forms[0].sub_010.value =
+ money_round(document.forms[0].sub_010.value);
+ document.forms[0].sub_005.value =
+ money_round(document.forms[0].sub_005.value);
+ document.forms[0].sub_sub.value =
money_round(document.forms[0].sub_sub.value);
document.forms[0].amount_cash.value = money_round(
document.forms[0].sub_sub.value - $pos_config{till_cash});
@@ -280,33 +287,75 @@ function check_errors(){
document.forms[0].expected_$_.value);
cumulative_error = cumulative_error + source_error;
err_cell = document.getElementById('error_$_');
- err_cell.innerHTML = '$curren' + source_error;\n";
+ err_cell.innerHTML = '\$' + source_error;\n";
} (keys %pos_sources);
print qq|
- alert('Cumulative Error: $curren' + money_round(cumulative_error));
+ alert('Cumulative Error: \$' + money_round(cumulative_error));
}
</script>
<table>
-<col><col><col>|;
- foreach my $unit ($pos_config{'breakdown'}) {
- # XXX Needs to take into account currencies that don't use 2 dp
- my $calcval = $form->parse_amount(\%pos_config, $unit);
- $calcval = sprintf('%03d', $calcval * 100) if $calcval < 1;
- my $subval = 'sub_' . $calcval;
- $calcval = 'calc_' . $calcval;
- print qq|<tr>
- <td><input type=text name=$calcval value="$form->{$calcval}"></td>
- <th>X ${curren}${unit} = </th>
- <td><input type=text name=$subval value="$form->{$subval}"></td>
- </tr>|;
- }
- print qq|<tr>
+<col><col><col>
+ <tr>
+ <td><input type=text name=calc_100 value="$form->{calc_100}"></td>
+ <th>X \$100 = </th>
+ <td><input type=text name=sub_100 value="$form->{sub_100}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_50 value="$form->{calc_50}"></td>
+ <th>X \$50 = </th>
+ <td><input type=text name=sub_50 value="$form->{sub_50}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_20 value="$form->{calc_20}"></td>
+ <th>X \$20 = </th>
+ <td><input type=text name=sub_20 value="$form->{sub_20}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_10 value="$form->{calc_10}"></td>
+ <th>X \$10 = </th>
+ <td><input type=text name=sub_10 value="$form->{sub_10}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_5 value="$form->{calc_5}"></td>
+ <th>X \$5 = </th>
+ <td><input type=text name=sub_5 value="$form->{sub_5}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_1 value="$form->{calc_1}"></td>
+ <th>X \$1 = </th>
+ <td><input type=text name=sub_1 value="$form->{sub_1}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_050 value="$form->{calc_050}"></td>
+ <th>X \$0.50 = </th>
+ <td><input type=text name=sub_050 value="$form->{sub_050}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_025 value="$form->{calc_025}"></td>
+ <th>X \$.25 = </th>
+ <td><input type=text name=sub_025 value="$form->{sub_025}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_010 value="$form->{calc_010}"></td>
+ <th>X \$.10 = </th>
+ <td><input type=text name=sub_010 value="$form->{sub_010}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_005 value="$form->{calc_005}"></td>
+ <th>X \$.05 = </th>
+ <td><input type=text name=sub_005 value="$form->{sub_005}"></td>
+ </tr>
+ <tr>
+ <td><input type=text name=calc_001 value="$form->{calc_001}"></td>
+ <th>X \$.01 = </th>
+ <td><input type=text name=sub_001 value="$form->{sub_001}"></td>
+ </tr>
+ <tr>
<td>&nbsp;</td>
<th>Subtotal:</th>
<td><input type=text name=sub_sub value="$form->{sub_sub}"></td>
- </tr>
- </table>
+</table>
<input type=button name=calculate class=submit onClick="custom_calc_total()"
value='Calculate'>
|;
@@ -380,23 +429,23 @@ sub close_till {
$head = "Closing Till $pos_config{till} for $form->{login}\n".
"Date: $form->{transdate}\n\n\n";
- my @cashlines = [$locale->text("Cash Breakdown:")];
- foreach my $unit ($pos_config{'breakdown'}) {
- # XXX Needs to take into account currencies that don't use 2 dp
- my $parsed = $form->parse_amount(\%pos_config, $unit);
- my $calcval = $parsed;
- $calcval = sprintf('%03d', $calcval * 100) if $calcval < 1;
- my $subval = 'sub_' . $calcval;
- $calcval = 'calc_' . $calcval;
- push @cashlines, "$form->{$calcval} x $parseval = $form->{$subval}";
- }
- push @cashlines, $locale->text("Total Cash in Drawer:") . $form->{sub_sub};
- push @cashlines, $locale->text("Less Cash in Till At Start:") .
- $form->{till_cash};
- push @cashlines, "\n";
- $cash = join ("\n", @cashlines);
- $foot = $locale->text("Cumulative Error: ")."$difference\n";
- $foot .= $locale->text('Reset Till By ')."$amount\n\n\n\n\n\n\n\n\n\n";
+ $cash = join ("\n",
+ ("Cash Breakdown:",
+ "$form->{calc_100} x 100 = $form->{sub_100}",
+ "$form->{calc_50} x 50 = $form->{sub_50}",
+ "$form->{calc_20} x 20 = $form->{sub_20}",
+ "$form->{calc_10} x 10 = $form->{sub_10}",
+ "$form->{calc_5} x 5 = $form->{sub_5}",
+ "$form->{calc_1} x 1 = $form->{sub_1}",
+ "$form->{calc_050} x 0.50 = $form->{sub_050}",
+ "$form->{calc_025} x 0.25 = $form->{sub_025}",
+ "$form->{calc_010} x 0.10 = $form->{sub_010}",
+ "$form->{calc_005} x 0.05 = $form->{sub_005}",
+ "$form->{calc_001} x 0.01 = $form->{sub_001}",
+ "Total Cash in Drawer: $form->{sub_sub}",
+ "Less Cash in Till At Start: $pos_config{till_cash}",
+ "\n"));
+ $foot = "Cumulative Error: $difference\n Reset Till By $amount\n\n\n\n\n\n\n\n\n\n";
open (PRN, "|-", $printer{Printer});
print PRN $head;
print PRN $lines;
@@ -405,12 +454,12 @@ sub close_till {
print PRN $foot;
close PRN;
if ($difference > 0){
- $message = $locale->text("You are over by ").$difference;
+ $message = "You are over by ".$difference;
} elsif ($difference < 0){
- $message = $locale->text("You are under by ").$difference * -1;
+ $message = "You are under by ".$difference * -1;
}
else {
- $message = $local->text("Congratulations! Your till is exactly balanced.");
+ $message = "Congradulations! Your till is exactly balanced.";
}
$form->info($message);
}
@@ -745,7 +794,7 @@ sub display_form {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/bin/mozilla/rp.pl b/bin/rp.pl
index 393f17ee..c5b1d9cc 100755
--- a/bin/mozilla/rp.pl
+++ b/bin/rp.pl
@@ -42,7 +42,7 @@
#======================================================================
-require "$form->{path}/arap.pl";
+require "bin/arap.pl";
use LedgerSMB::PE;
use LedgerSMB::RP;
@@ -779,7 +779,7 @@ $gifi
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -1701,7 +1701,7 @@ sub aging {
}
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
@@ -2506,7 +2506,7 @@ sub list_payments {
|;
if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
+ require "bin/menu.pl";
&menubar;
}
diff --git a/login.pl b/login.pl
index f38434c6..2fe123f5 100755
--- a/login.pl
+++ b/login.pl
@@ -101,7 +101,7 @@ if ($form{path}) {
if ($form{path} ne 'bin/lynx'){ $form{path} = 'bin/mozilla';}
$ARGV[0] = "$_&script=$script";
- require "$form{path}/$script";
+ require "bin/$script";
} else {
@@ -114,7 +114,7 @@ if ($form{path}) {
$ARGV[0] = "path=bin/$form{terminal}&script=$script";
map { $ARGV[0] .= "&${_}=$form{$_}" } keys %form;
- require "bin/$form{terminal}/$script";
+ require "bin/$script";
}
diff --git a/menu.pl b/menu.pl
index 0146f5b0..6482a66d 100755
--- a/menu.pl
+++ b/menu.pl
@@ -117,16 +117,16 @@ if (-f "$userspath/nologin") {
}
# pull in the main code
-require "$form->{path}/$form->{script}";
+require "bin/$form->{script}";
# customized scripts
-if (-f "$form->{path}/custom_$form->{script}") {
- eval { require "$form->{path}/custom_$form->{script}"; };
+if (-f "bin/custom/$form->{script}") {
+ eval { require "bin/custom/$form->{script}"; };
}
# customized scripts for login
-if (-f "$form->{path}/$form->{login}_$form->{script}") {
- eval { require "$form->{path}/$form->{login}_$form->{script}"; };
+if (-f "bin/custom/$form->{login}_$form->{script}") {
+ eval { require "bin/custom/$form->{login}_$form->{script}"; };
}
@@ -154,7 +154,7 @@ sub check_password {
if ($myconfig{password}) {
- require "$form->{path}/pw.pl";
+ require "bin/pw.pl";
if ($form->{password}) {
if ((crypt $form->{password}, substr($form->{login}, 0, 2)) ne $myconfig{password}) {