diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-24 00:01:16 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-10-24 00:01:16 +0000 |
commit | c3c9871298597e417d67f691fca24cd913ef802a (patch) | |
tree | c743f476ab241b97069518fbd90f89a1f2ae5f00 /bin | |
parent | 0dc5b99d6e3bd63c2e20e131b39b38503add2dc0 (diff) |
Moved all scalars out of ledger-smb.conf
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@268 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/aa.pl | 8 | ||||
-rwxr-xr-x | bin/admin.pl | 74 | ||||
-rwxr-xr-x | bin/am.pl | 14 | ||||
-rwxr-xr-x | bin/arap.pl | 2 | ||||
-rwxr-xr-x | bin/arapprn.pl | 18 | ||||
-rwxr-xr-x | bin/bp.pl | 12 | ||||
-rwxr-xr-x | bin/cp.pl | 14 | ||||
-rwxr-xr-x | bin/hr.pl | 4 | ||||
-rwxr-xr-x | bin/io.pl | 16 | ||||
-rwxr-xr-x | bin/is.pl | 6 | ||||
-rwxr-xr-x | bin/jc.pl | 18 | ||||
-rwxr-xr-x | bin/login.pl | 12 | ||||
-rwxr-xr-x | bin/oe.pl | 6 | ||||
-rwxr-xr-x | bin/pe.pl | 2 | ||||
-rwxr-xr-x | bin/pos.pl | 4 | ||||
-rwxr-xr-x | bin/rp.pl | 10 |
16 files changed, 110 insertions, 110 deletions
@@ -132,7 +132,7 @@ sub create_links { $form->{selectformname} = qq|<option value="transaction">|.$locale->text('Transaction'); - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { if ($form->{ARAP} eq 'AR') { $form->{selectformname} .= qq| <option value="receipt">|.$locale->text('Receipt'); @@ -721,14 +721,14 @@ sub form_footer { for ("Post", "Print and Post", "Delete") { delete $button{$_} } } - if (!$latex) { + if (!${LedgerSMB::Sysconfig::latex}) { for ("Print and Post", "Print and Post as new") { delete $button{$_} } } } else { for ("Post as new", "Print and Post as new", "Delete") { delete $button{$_} } - delete $button{"Print and Post"} if ! $latex; + delete $button{"Print and Post"} if ! ${LedgerSMB::Sysconfig::latex}; if ($transdate <= $closedto) { for ("Post", "Print and Post") { delete $button{$_} } @@ -944,7 +944,7 @@ sub delete { sub yes { - if (AA->delete_transaction(\%myconfig, \%$form, $spool)) { + if (AA->delete_transaction(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) { $form->redirect($locale->text('Transaction deleted!')); } else { $form->error($locale->text('Cannot delete transaction!')); diff --git a/bin/admin.pl b/bin/admin.pl index ce96cd6e..e1a6f420 100755 --- a/bin/admin.pl +++ b/bin/admin.pl @@ -43,7 +43,7 @@ use LedgerSMB::User; $form = new Form; -$locale = LedgerSMB::Locale->get_handle($language); +$locale = LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language}); $locale->encoding('UTF-8'); $form->{charset} = 'UTF-8'; #$form->{charset} = $locale->encoding; @@ -78,8 +78,8 @@ if ($form->{action}) { $form->error($locale->text('No Database Drivers available!')) unless (User->dbdrivers); # create memberfile - if (! -f $memberfile) { - open(FH, ">$memberfile") or $form->error("$memberfile : $!"); + if (! -f ${LedgerSMB::Sysconfig::memberfile}) { + open(FH, ">${LedgerSMB::Sysconfig::memberfile}") or $form->error("$memberfile : $!"); print FH qq|# LedgerSMB Accounting members [root login] @@ -88,7 +88,7 @@ password= close FH; } - $root = new User "$memberfile", "root login"; + $root = new User "${LedgerSMB::Sysconfig::memberfile}", "root login"; unless($root && $root->{password}) { &setup_initial_password(); @@ -192,7 +192,7 @@ sub login { sub logout { $form->{callback} = "$form->{script}?path=$form->{path}&endsession=1"; - unlink "$userspath/adminhash"; + unlink "${LedgerSMB::Sysconfig::userspath}/adminhash"; print qq|Set-Cookie: LedgerSMB=; path=/;\n|; $form->redirect($locale->text('You are logged out')); @@ -248,11 +248,11 @@ sub form_footer { sub list_users { - open(FH, "$memberfile") or $form->error("$memberfile : $!"); + open(FH, "${LedgerSMB::Sysconfig::memberfile}") or $form->error("$memberfile : $!"); $nologin = qq|<button type="submit" class="submit" name="action" value="lock_system">|.$locale->text('Lock System').qq|</button>|; - if (-e "$userspath/nologin") { + if (-e "${LedgerSMB::Sysconfig::userspath}/nologin") { $nologin = qq|<button type="submit" class="submit" name="action" value="unlock_system">|.$locale->text('Unlock System').qq|</button>|; } @@ -318,7 +318,7 @@ sub list_users { $href = "$script?action=edit&login=$key&path=$form->{path}&sessionid=$form->{sessionid}"; $href =~ s/ /%20/g; - $member{$key}{templates} =~ s/^$templates\///; + $member{$key}{templates} =~ s/^${LedgerSMB::Sysconfig::templates}\///; $member{$key}{dbhost} = $locale->text('localhost') unless $member{$key}{dbhost}; $column_data{login} = qq|<td><a href="$href">$key</a></td>|; @@ -372,13 +372,13 @@ sub form_header { if ($form->{login}) { # get user - $myconfig = new User "$memberfile", "$form->{login}"; + $myconfig = new User "${LedgerSMB::Sysconfig::memberfile}", "$form->{login}"; for (qw(company address signature)) { $myconfig->{$_} = $form->quote($myconfig->{$_}) } for (qw(address signature)) { $myconfig->{$_} =~ s/\\n/\n/g } # strip basedir from templates directory - $myconfig->{templates} =~ s/^$templates\///; + $myconfig->{templates} =~ s/^${LedgerSMB::Sysconfig::templates}\///; $myconfig->{dbpasswd} = unpack 'u', $myconfig->{dbpasswd}; } @@ -404,11 +404,11 @@ sub form_header { $countrycodes = qq|<option value="">English</option>\n$countrycodes|; # is there a templates basedir - if (! -d "$templates") { - $form->error($locale->text('Directory').": $templates ".$locale->text('does not exist')); + if (! -d "${LedgerSMB::Sysconfig::templates}") { + $form->error($locale->text('Directory').": ${LedgerSMB::Sysconfig::templates} ".$locale->text('does not exist')); } - opendir TEMPLATEDIR, "$templates/." or $form->error("$templates : $!"); + opendir TEMPLATEDIR, "${LedgerSMB::Sysconfig::templates}/." or $form->error("$templates : $!"); @all = grep !/^\.\.?$/, readdir TEMPLATEDIR; closedir TEMPLATEDIR; @@ -417,7 +417,7 @@ sub form_header { @alldir = (); for (@all) { - if (-d "$templates/$_") { + if (-d "${LedgerSMB::Sysconfig::templates}/$_") { push @alldir, $_; } } @@ -464,7 +464,7 @@ sub form_header { $selectstylesheet .= "<option></option>\n"; - if (%printer && $latex) { + if (%printer && ${LedgerSMB::Sysconfig::latex}) { $selectprinter = "<option></option>\n"; @@ -770,7 +770,7 @@ sub save { # check for duplicates if (!$form->{edit}) { - $temp = new User "$memberfile", "$form->{login}"; + $temp = new User "${LedgerSMB::Sysconfig::memberfile}", "$form->{login}"; if ($temp->{login}) { $form->error("$form->{login} ".$locale->text('is already a member!')); @@ -787,15 +787,15 @@ sub save { } # is there a basedir - if (! -d "$templates") { - $form->error($locale->text('Directory').": $templates ".$locale->text('does not exist')); + if (! -d "${LedgerSMB::Sysconfig::templates}") { + $form->error($locale->text('Directory').": ${LedgerSMB::Sysconfig::templates} ".$locale->text('does not exist')); } # add base directory to $form->{templates} - $form->{templates} = "$templates/$form->{templates}"; + $form->{templates} = "${LedgerSMB::Sysconfig::templates}/$form->{templates}"; - $myconfig = new User "$memberfile", "$form->{login}"; + $myconfig = new User "${LedgerSMB::Sysconfig::memberfile}", "$form->{login}"; # redo acs variable and delete all the acs codes @acs = split /;/, $form->{acs}; @@ -838,7 +838,7 @@ sub save { $myconfig->{packpw} = 1; - $myconfig->save_member($memberfile, $userspath); + $myconfig->save_member(${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath}); # create user template directory and copy master files if (! -d "$form->{templates}") { @@ -849,13 +849,13 @@ sub save { umask(007); # copy templates to the directory - opendir TEMPLATEDIR, "$templates/." or $form->error("$templates : $!"); + opendir TEMPLATEDIR, "${LedgerSMB::Sysconfig::templates}/." or $form->error("$templates : $!"); @templates = grep /$form->{mastertemplates}-/, readdir TEMPLATEDIR; closedir TEMPLATEDIR; foreach $file (@templates) { - open(TEMP, "$templates/$file") or $form->error("$templates/$file : $!"); + open(TEMP, "${LedgerSMB::Sysconfig::templates}/$file") or $form->error("$templates/$file : $!"); $file =~ s/$form->{mastertemplates}-//; open(NEW, ">$form->{templates}/$file") or $form->error("$form->{templates}/$file : $!"); @@ -879,16 +879,16 @@ sub save { sub delete { - $form->{templates} = ($form->{templates}) ? "$templates/$form->{templates}" : "$templates/$form->{login}"; + $form->{templates} = ($form->{templates}) ? "${LedgerSMB::Sysconfig::templates}/$form->{templates}" : "$templates/$form->{login}"; - $form->error("$memberfile ".$locale->text('locked!')) if (-f ${memberfile}.LCK); + $form->error("${LedgerSMB::Sysconfig::memberfile} ".$locale->text('locked!')) if (-f ${memberfile}.LCK); open(FH, ">${memberfile}.LCK") or $form->error("${memberfile}.LCK : $!"); close(FH); - if (! open(CONF, "+<$memberfile")) { + if (! open(CONF, "+<${LedgerSMB::Sysconfig::memberfile}")) { unlink "${memberfile}.LCK"; - $form->error("$memberfile : $!"); + $form->error("${LedgerSMB::Sysconfig::memberfile} : $!"); } @config = <CONF>; @@ -972,7 +972,7 @@ sub delete { User->delete_login(\%$form); # delete config file for user - unlink "$userspath/$form->{login}.conf"; + unlink "${LedgerSMB::Sysconfig::userspath}/$form->{login}.conf"; } $form->redirect($locale->text('User deleted!')); @@ -1035,7 +1035,7 @@ sub change_password { $form->error($locale->text('Passwords do not match!')) if $form->{new_password} ne $form->{confirm_password}; $root->{password} = $form->{new_password}; $root->{'root login'} = 1; - $root->save_member($memberfile); + $root->save_member(${LedgerSMB::Sysconfig::memberfile}); $form->{callback} = "$form->{script}?action=list_users&path=$form->{path}&sessionid=$form->{sessionid}"; $form->redirect($locale->text('Password changed!')); } @@ -1048,7 +1048,7 @@ sub get_hash { sub check_password { - $root = new User "$memberfile", "root login"; + $root = new User "${LedgerSMB::Sysconfig::memberfile}", "root login"; if ($root->{password}) { @@ -1064,7 +1064,7 @@ sub check_password { &get_hash; - open(HASHFILE, "> $userspath/adminhash") || $form->error("Can't Open Hashfile: $!"); + open(HASHFILE, "> ${LedgerSMB::Sysconfig::userspath}/adminhash") || $form->error("Can't Open Hashfile: $!"); print HASHFILE $form->{hash}; print qq|Set-Cookie: LedgerSMB=$form->{hash}; path=/;\n|; @@ -1077,14 +1077,14 @@ sub check_password { $cookie = ($form->{path} eq 'bin/lynx') ? $cookie{login} : $cookie{"LedgerSMB-root login"}; #fixes problem with first login and such - if (!(-f "$userspath/adminhash")) { + if (!(-f "${LedgerSMB::Sysconfig::userspath}/adminhash")) { &get_hash; - open(HASHFILE, "> $userspath/adminhash") || $form->error("Can't Open Hashfile: $!"); + open(HASHFILE, "> ${LedgerSMB::Sysconfig::userspath}/adminhash") || $form->error("Can't Open Hashfile: $!"); print HASHFILE $form->{hash}; close(HASHFILE); } - open (HASHFILE, "< $userspath/adminhash") || $form->error("Can't Open Hashfile: $!"); + open (HASHFILE, "< ${LedgerSMB::Sysconfig::userspath}/adminhash") || $form->error("Can't Open Hashfile: $!"); chomp($form->{hash} = <HASHFILE>); %cookies = split /[=;]/, $ENV{HTTP_COOKIE}; @@ -1372,7 +1372,7 @@ sub dbcreate { sub delete_dataset { - if (@dbsources = User->dbsources_unused(\%$form, $memberfile)) { + if (@dbsources = User->dbsources_unused(\%$form, ${LedgerSMB::Sysconfig::memberfile})) { foreach $item (sort @dbsources) { $dbsources .= qq|<input name="db" class="radio" type="radio" value="$item" /> $item |; @@ -1463,7 +1463,7 @@ sub dbdelete { sub unlock_system { - unlink "$userspath/nologin"; + unlink "${LedgerSMB::Sysconfig::userspath}/nologin"; $form->{callback} = "$form->{script}?action=list_users&path=$form->{path}&sessionid=$form->{sessionid}"; $form->redirect($locale->text('Lockfile removed!')); } @@ -1471,7 +1471,7 @@ sub unlock_system { sub lock_system { - open(FH, ">$userspath/nologin") or $form->error($locale->text('Cannot create Lock!')); + open(FH, ">${LedgerSMB::Sysconfig::userspath}/nologin") or $form->error($locale->text('Cannot create Lock!')); close(FH); $form->{callback} = "$form->{script}?action=list_users&path=$form->{path}&sessionid=$form->{sessionid}"; $form->redirect($locale->text('Lockfile created!')); @@ -2064,7 +2064,7 @@ sub config { } $selectstylesheet .= "<option>\n"; - if (%printer && $latex) { + if (%printer && ${LedgerSMB::Sysconfig::latex}) { $selectprinter = "<option>\n"; foreach $item (sort keys %printer) { if ($myconfig{printer} eq $item) { @@ -2233,7 +2233,7 @@ sub save_preferences { $form->error($locale->text('Password does not match!')) if $form->{new_password} ne $form->{confirm_password}; } - if (AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath)) { + if (AM->save_preferences(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath})) { $form->redirect($locale->text('Preferences saved!')); } else { $form->error($locale->text('Cannot save preferences!')); @@ -2247,12 +2247,12 @@ sub backup { if ($form->{media} eq 'email') { $form->error($locale->text('No email address for')." $myconfig{name}") unless ($myconfig{email}); - $form->{OUT} = "$sendmail"; + $form->{OUT} = "${LedgerSMB::Sysconfig::sendmail}"; } $SIG{INT} = 'IGNORE'; - AM->backup(\%myconfig, \%$form, $userspath, $gzip); + AM->backup(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::userspath}, ${LedgerSMB::Sysconfig::gzip}); if ($form->{media} eq 'email') { $form->redirect($locale->text('Backup sent to').qq| $myconfig{email}|); @@ -2954,7 +2954,7 @@ sub edit_recurring { } $form->{selectformat} = qq|<option value="html">html\n|; - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { $form->{selectformat} .= qq| <option value="postscript">|.$locale->text('Postscript').qq| <option value="pdf">|.$locale->text('PDF'); @@ -3083,7 +3083,7 @@ sub process_transactions { $form->info(" ..... ".$locale->text('done')); # print form - if ($latex && $ok) { + if (${LedgerSMB::Sysconfig::latex} && $ok) { $ok = &print_recurring(\%$pt, $defaultprinter); } @@ -3136,7 +3136,7 @@ sub process_transactions { } # print form - if ($latex && $ok) { + if (${LedgerSMB::Sysconfig::latex} && $ok) { &print_recurring(\%$pt, $defaultprinter); } diff --git a/bin/arap.pl b/bin/arap.pl index 29191aaa..4f3c61c1 100755 --- a/bin/arap.pl +++ b/bin/arap.pl @@ -615,7 +615,7 @@ sub schedule { } - if (%printer && $latex && %formname) { + if (%printer && ${LedgerSMB::Sysconfig::latex} && %formname) { $selectprinter = qq|<option>\n|; for (sort keys %printer) { $selectprinter .= qq|<option value="$_">$_\n| } diff --git a/bin/arapprn.pl b/bin/arapprn.pl index 45ded305..f5d120f5 100755 --- a/bin/arapprn.pl +++ b/bin/arapprn.pl @@ -107,7 +107,7 @@ sub print { } if ($filename = $queued{$form->{formname}}) { $form->{queued} =~ s/$form->{formname} $filename//; - unlink "$spool/$filename"; + unlink "${LedgerSMB::Sysconfig::spool}/$filename"; $filename =~ s/\..*$//g; } else { $filename = time; @@ -115,7 +115,7 @@ sub print { } $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf'; - $form->{OUT} = ">$spool/$filename"; + $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename"; $form->{queued} .= " $form->{formname} $filename"; $form->{queued} =~ s/^ //; @@ -215,7 +215,7 @@ sub print_check { id => $form->{id} ); $form->{audittrail} .= $form->audittrail("", \%myconfig, \%audittrail); - $form->{OUT} = ">$spool/$filename"; + $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename"; $form->{queued} .= " $form->{formname} $filename"; $form->{queued} =~ s/^ //; @@ -252,7 +252,7 @@ sub print_check { $form->{fileid} = $invnumber; $form->{fileid} =~ s/(\s|\W)+//g; - $form->parse_template(\%myconfig, $userspath); + $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath}); if ($form->{previousform}) { @@ -415,7 +415,7 @@ sub print_transaction { if ($filename = $queued{$form->{formname}}) { $form->{queued} =~ s/$form->{formname} $filename//; - unlink "$spool/$filename"; + unlink "${LedgerSMB::Sysconfig::spool}/$filename"; $filename =~ s/\..*$//g; } else { $filename = time; @@ -423,7 +423,7 @@ sub print_transaction { } $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf'; - $form->{OUT} = ">$spool/$filename"; + $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename"; $form->{queued} .= " $form->{formname} $filename"; $form->{queued} =~ s/^ //; @@ -468,7 +468,7 @@ sub print_transaction { $form->{fileid} = $form->{invnumber}; $form->{fileid} =~ s/(\s|\W)+//g; - $form->parse_template(\%myconfig, $userspath); + $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath}); if (%$old_form) { $old_form->{invnumber} = $form->{invnumber}; @@ -625,12 +625,12 @@ sub print_options { $form->{selectformat} = qq|<option value="html">html\n|; - if (%printer && $latex) { + if (%printer && ${LedgerSMB::Sysconfig::latex}) { for (sort keys %printer) { $media .= qq| <option value="$_">$_| } } - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { $form->{selectformat} .= qq| <option value="postscript">|.$locale->text('Postscript').qq| <option value="pdf">|.$locale->text('PDF'); @@ -253,7 +253,7 @@ sub yes { $form->info($locale->text('Removing marked entries from queue ...')); $form->{callback} .= "&header=1" if $form->{callback}; - if (BP->delete_spool(\%myconfig, \%$form, $spool)) { + if (BP->delete_spool(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) { $form->redirect($locale->text('Removed spoolfiles!')); } else { $form->error($locale->text('Cannot remove files!')); @@ -274,7 +274,7 @@ sub print { $form->{OUT} = "| $printer{$form->{media}}"; $form->info($locale->text('Printing')." ..."); - if (BP->print_spool(\%myconfig, \%$form, $spool)) { + if (BP->print_spool(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) { print $locale->text('done'); $form->redirect($locale->text('Marked entries printed!')); } @@ -432,7 +432,7 @@ sub list_spool { $column_data{transdate} = "<td>$ref->{transdate} </td>"; - if ($spoolfile eq $ref->{spoolfile}) { + if (${LedgerSMB::Sysconfig::spool}file eq $ref->{spoolfile}) { $column_data{checked} = qq|<td></td>|; } else { $column_data{checked} = qq|<td><input name=checked_$i type=checkbox class=checkbox $form->{"checked_$i"} $form->{"checked_$i"}></td>|; @@ -458,11 +458,11 @@ sub list_spool { $column_data{name} = "<td>$ref->{name}</td>"; - $column_data{spoolfile} = qq|<td><a href=$spool/$ref->{spoolfile}>$ref->{spoolfile}</a></td> + $column_data{spoolfile} = qq|<td><a href=${LedgerSMB::Sysconfig::spool}/$ref->{spoolfile}>$ref->{spoolfile}</a></td> |; - $spoolfile = $ref->{spoolfile}; + ${LedgerSMB::Sysconfig::spool}file = $ref->{spoolfile}; $j++; $j %= 2; print " @@ -496,7 +496,7 @@ sub list_spool { $form->hide_form(qw(callback title vc type sort module account path login sessionid)); - if (%printer && $latex) { + if (%printer && ${LedgerSMB::Sysconfig::latex}) { foreach $key (sort keys %printer) { print qq| <input name=media type=radio class=radio value="$key" |; @@ -452,7 +452,7 @@ sub payments_footer { $transdate = $form->datetonum(\%myconfig, $form->{datepaid}); $closedto = $form->datetonum(\%myconfig, $form->{closedto}); - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { $media = qq|<select name=media> <option value=screen>|.$locale->text('Screen'); @@ -486,7 +486,7 @@ sub payments_footer { 'Post' => { ndx => 4, key => 'O', value => $locale->text('Post') }, ); - if (! $latex) { + if (! ${LedgerSMB::Sysconfig::latex}) { delete $button{'Print'}; } @@ -1051,7 +1051,7 @@ sub payment_footer { $transdate = $form->datetonum(\%myconfig, $form->{datepaid}); $closedto = $form->datetonum(\%myconfig, $form->{closedto}); - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { if ($form->{selectlanguage}) { $form->{"selectlanguage"} = $form->unescape($form->{"selectlanguage"}); $form->{"selectlanguage"} =~ s/ selected//; @@ -1088,7 +1088,7 @@ sub payment_footer { 'Post' => { ndx => 4, key => 'O', value => $locale->text('Post') }, ); - if (! $latex) { + if (! ${LedgerSMB::Sysconfig::latex}) { delete $button{'Print'}; } @@ -1269,7 +1269,7 @@ sub print_form { $form->{OUT} = "| $printer{$form->{media}}"; } - $form->parse_template(\%myconfig, $userspath); + $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath}); } @@ -1286,8 +1286,8 @@ sub print_payment { %temp = (); for (@a) { $temp{$_} = $form->{$_} } - if (scalar @{$form->{invnumber}} > $check_max_invoices) { - $#{$form->{invnumber}} = $check_max_invoices - 1; + if (scalar @{$form->{invnumber}} > ${LedgerSMB::Sysconfig::check_max_invoices}) { + $#{$form->{invnumber}} = ${LedgerSMB::Sysconfig::check_max_invoices} - 1; $form->{invnumbers_maxed} = 1; $form->{message} = $locale->text("Please see attatched report for list of invoices paid."); } @@ -716,7 +716,7 @@ sub save_employee { # if it is a login change memberfile and .conf if ($form->{employeelogin}) { - $user = new User $memberfile, $form->{employeelogin}; + $user = new User ${LedgerSMB::Sysconfig::memberfile}, $form->{employeelogin}; for (qw(name email role)) { $user->{$_} = $form->{$_} } @@ -726,7 +726,7 @@ sub save_employee { for (qw(dbpasswd password)) { $user->{"old_$_"} = $user->{$_} } $user->{packpw} = 1; - $user->save_member($memberfile, $userspath) if $user->{login}; + $user->save_member(${LedgerSMB::Sysconfig::memberfile}, ${LedgerSMB::Sysconfig::userspath}) if $user->{login}; } $form->redirect($locale->text('Employee saved!')); @@ -1099,11 +1099,11 @@ sub print_options { $media = qq|<select name=media> <option value="screen">|.$locale->text('Screen'); - if (%printer && $latex) { + if (%printer && ${LedgerSMB::Sysconfig::latex}) { for (sort keys %printer) { $media .= qq| <option value="$_">$_| } } - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { $media .= qq| <option value="queue">|.$locale->text('Queue'); } @@ -1118,7 +1118,7 @@ sub print_options { $form->{selectformat} = qq|<option value="html">html\n|; # <option value="txt">|.$locale->text('Text'); - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { $form->{selectformat} .= qq| <option value="postscript">|.$locale->text('Postscript').qq| <option value="pdf">|.$locale->text('PDF'); @@ -1138,7 +1138,7 @@ sub print_options { <td>$media</td> |; - if (%printer && $latex && $form->{media} ne 'email') { + if (%printer && ${LedgerSMB::Sysconfig::latex} && $form->{media} ne 'email') { print qq| <td nowrap>|.$locale->text('Copies').qq| <input name=copies size=2 value=$form->{copies}></td> @@ -1457,7 +1457,7 @@ sub print_form { $form->{subject} = qq|$form->{label} $form->{"${inv}number"}| unless $form->{subject}; $form->{plainpaper} = 1; - $form->{OUT} = "$sendmail"; + $form->{OUT} = "${LedgerSMB::Sysconfig::sendmail}"; if ($form->{emailed} !~ /$form->{formname}/) { $form->{emailed} .= " $form->{formname}"; @@ -1505,7 +1505,7 @@ sub print_form { if ($filename = $queued{$form->{formname}}) { $form->{queued} =~ s/$form->{formname} $filename//; - unlink "$spool/$filename"; + unlink "${LedgerSMB::Sysconfig::spool}/$filename"; $filename =~ s/\..*$//g; } else { $filename = time; @@ -1513,7 +1513,7 @@ sub print_form { } $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf'; - $form->{OUT} = ">$spool/$filename"; + $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename"; $form->{queued} .= " $form->{formname} $filename"; $form->{queued} =~ s/^ //; @@ -1539,7 +1539,7 @@ sub print_form { $form->{fileid} = $form->{"${inv}number"}; $form->{fileid} =~ s/(\s|\W)+//g; - $form->parse_template(\%myconfig, $userspath); + $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath}); # if we got back here restore the previous form if (defined %$old_form) { @@ -663,7 +663,7 @@ sub form_footer { for ("Post", "Print and Post", "Delete") { delete $button{$_} } } - if (!$latex) { + if (!${LedgerSMB::Sysconfig::latex}) { for ("Print and Post", "Print and Post as new") { delete $button{$_} } } @@ -672,7 +672,7 @@ sub form_footer { if ($transdate > $closedto) { for ("Update", "Ship to", "Print", "E-mail", "Post", "Schedule") { $a{$_} = 1 } - $a{'Print and Post'} = 1 if $latex; + $a{'Print and Post'} = 1 if ${LedgerSMB::Sysconfig::latex}; } for (keys %button) { delete $button{$_} if ! $a{$_} } @@ -962,7 +962,7 @@ sub delete { sub yes { - if (IS->delete_invoice(\%myconfig, \%$form, $spool)) { + if (IS->delete_invoice(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) { $form->redirect($locale->text('Invoice deleted!')); } else { $form->error($locale->text('Cannot delete invoice!')); @@ -629,7 +629,7 @@ sub timecard_footer { if (!$form->{locked}) { for ('Update', 'Print', 'Save', 'Save as new') { $a{$_} = 1 } - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { for ('Print and Save', 'Print and Save as new') { $a{$_} = 1 } } @@ -645,7 +645,7 @@ sub timecard_footer { for ('Update', 'Print', 'Save') { $a{$_} = 1 } - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { $a{'Print and Save'} = 1; } @@ -842,7 +842,7 @@ sub storescard_footer { if (!$form->{locked}) { for ('Update', 'Print', 'Save', 'Save as new') { $a{$_} = 1 } - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { for ('Print and Save', 'Print and Save as new') { $a{$_} = 1 } } if ($form->{orphaned}) { @@ -855,7 +855,7 @@ sub storescard_footer { if ($transdate > $closedto) { for ('Update', 'Print', 'Save') { $a{$_} = 1 } - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { $a{'Print and Save'} = 1; } } @@ -1761,12 +1761,12 @@ sub print_options { $form->{selectformat} = qq|<option value="html">html\n|; - if (%printer && $latex) { + if (%printer && ${LedgerSMB::Sysconfig::latex}) { for (sort keys %printer) { $media .= qq| <option value="$_">$_| } } - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { $media .= qq| <option value="queue">|.$locale->text('Queue'); @@ -1886,7 +1886,7 @@ sub print_timecard { if ($filename = $queued{$form->{formname}}) { $form->{queued} =~ s/$form->{formname} $filename//; - unlink "$spool/$filename"; + unlink "${LedgerSMB::Sysconfig::spool}/$filename"; $filename =~ s/\..*$//g; } else { $filename = time; @@ -1894,7 +1894,7 @@ sub print_timecard { } $filename .= ($form->{format} eq 'postscript') ? '.ps' : '.pdf'; - $form->{OUT} = ">$spool/$filename"; + $form->{OUT} = ">${LedgerSMB::Sysconfig::spool}/$filename"; $form->{queued} = "$form->{formname} $filename"; $form->update_status(\%myconfig); @@ -1911,7 +1911,7 @@ sub print_timecard { $status{audittrail} .= $form->audittrail("", \%myconfig, \%audittrail); } - $form->parse_template(\%myconfig, $userspath); + $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath}); if (defined %$old_form) { diff --git a/bin/login.pl b/bin/login.pl index c52c3b9e..a3a70b9b 100755 --- a/bin/login.pl +++ b/bin/login.pl @@ -47,7 +47,7 @@ use LedgerSMB::Locale; $form = new Form; -$locale = LedgerSMB::Locale->get_handle($language); +$locale = LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language}); $locale->encoding('UTF-8'); $form->{charset} = 'UTF-8'; #$form->{charset} = $locale->encoding; @@ -235,7 +235,7 @@ sub login { $form->error($locale->text('You did not enter a name!')) unless ($form->{login}); if (! $form->{beenthere}) { - open(FH, "$memberfile") or $form->error("$memberfile : $!"); + open(FH, "${LedgerSMB::Sysconfig::memberfile}") or $form->error("$memberfile : $!"); @a = <FH>; close(FH); @@ -262,10 +262,10 @@ sub login { } - $user = new User $memberfile, $form->{login}; + $user = new User ${LedgerSMB::Sysconfig::memberfile}, $form->{login}; # if we get an error back, bale out - if (($errno = $user->login(\%$form, $userspath)) <= -1) { + if (($errno = $user->login(\%$form, ${LedgerSMB::Sysconfig::userspath})) <= -1) { $errno *= -1; $err[1] = $locale->text('Access Denied!'); @@ -274,7 +274,7 @@ sub login { if ($errno == 4) { # upgrade dataset and log in again - open FH, ">$userspath/nologin" or $form->error($!); + open FH, ">${LedgerSMB::Sysconfig::userspath}/nologin" or $form->error($!); for (qw(dbname dbhost dbport dbdriver dbuser dbpasswd)) { $form->{$_} = $user->{$_} } @@ -293,7 +293,7 @@ sub login { $user->dbupdate(\%$form); # remove lock file - unlink "$userspath/nologin"; + unlink "${LedgerSMB::Sysconfig::userspath}/nologin"; print $locale->text('done'); @@ -723,13 +723,13 @@ sub form_footer { %a = (); for ("Update", "Ship to", "Print", "E-mail", "Save") { $a{$_} = 1 } - $a{'Print and Save'} = 1 if $latex; + $a{'Print and Save'} = 1 if ${LedgerSMB::Sysconfig::latex}; if ($form->{id}) { $a{'Delete'} = 1; $a{'Save as new'} = 1; - $a{'Print and Save as new'} = 1 if $latex; + $a{'Print and Save as new'} = 1 if ${LedgerSMB::Sysconfig::latex}; if ($form->{type} =~ /sales_/) { if ($myconfig{acs} !~ /AR--Sales Invoice/) { @@ -1861,7 +1861,7 @@ sub yes { $err = $locale->text('Cannot delete quotation!'); } - if (OE->delete(\%myconfig, \%$form, $spool)) { + if (OE->delete(\%myconfig, \%$form, ${LedgerSMB::Sysconfig::spool})) { $form->redirect($msg); } else { $form->error($err); @@ -2552,7 +2552,7 @@ sub generate_sales_orders { if (OE->save(\%myconfig, \%$order)) { if (! PE->allocate_projectitems(\%myconfig, \%$order)) { - OE->delete(\%myconfig, \%$order, $spool); + OE->delete(\%myconfig, \%$order, ${LedgerSMB::Sysconfig::spool}); } } else { $order->error($locale->text('Failed to save order!')); @@ -550,7 +550,7 @@ sub form_footer { delete $button{'Delete'}; } - delete $button{'Print and Post'} unless $latex; + delete $button{'Print and Post'} unless ${LedgerSMB::Sysconfig::latex}; } else { for ('Print', 'Post', 'Print and Post', 'Delete') { delete $button{$_} } } @@ -850,7 +850,7 @@ sub print_form { delete $form->{stylesheet}; $form->{cd_open} = $pos_config{rp_cash_drawer_open}; - $form->parse_template(\%myconfig, $userspath); + $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath}); if ($form->{printed} !~ /$form->{formname}/) { $form->{printed} .= " $form->{formname}"; @@ -1751,7 +1751,7 @@ sub print_options { $media = qq| <td><select name=media> <option value=screen>|.$locale->text('Screen'); - if (%printer && $latex) { + if (%printer && ${LedgerSMB::Sysconfig::latex}) { for (sort keys %printer) { $media .= qq| <option value="$_">$_| } } @@ -1760,7 +1760,7 @@ sub print_options { $media =~ s/(<option value="\Q$form->{media}\E")/$1 selected/; $media .= qq|</select></td>|; - if ($latex) { + if (${LedgerSMB::Sysconfig::latex}) { $format .= qq| <option value=postscript $form->{DF}{postscript}>|.$locale->text('Postscript').qq| <option value=pdf $form->{DF}{pdf}>|.$locale->text('PDF'); @@ -1774,7 +1774,7 @@ sub print_options { $media |; - if (%printer && $latex && $form->{media} ne 'email') { + if (%printer && ${LedgerSMB::Sysconfig::latex} && $form->{media} ne 'email') { print qq| <td>|.$locale->text('Copies').qq| <input name=copies size=2 value=$form->{copies}></td> @@ -1891,7 +1891,7 @@ sub e_mail { sub send_email { - $form->{OUT} = "$sendmail"; + $form->{OUT} = "${LedgerSMB::Sysconfig::sendmail}"; $form->{subject} = $locale->text('Statement').qq| - $form->{todate}| unless $form->{subject}; $form->isblank("email", $locale->text('E-mail address missing!')); @@ -2020,7 +2020,7 @@ sub print_form { for ("c0", "c30", "c60", "c90", "") { $form->{"${_}total"} = $form->format_amount(\%myconfig, $form->{"${_}total"}, 2) } - $form->parse_template(\%myconfig, $userspath); + $form->parse_template(\%myconfig, ${LedgerSMB::Sysconfig::userspath}); } } |