This list is closed, nobody may subscribe to it.
2011 |
Jan
(14) |
Feb
(42) |
Mar
(56) |
Apr
(60) |
May
(54) |
Jun
(48) |
Jul
(74) |
Aug
(52) |
Sep
(68) |
Oct
(64) |
Nov
(42) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(142) |
Feb
(270) |
Mar
(374) |
Apr
(230) |
May
(214) |
Jun
(116) |
Jul
(234) |
Aug
(66) |
Sep
(120) |
Oct
(16) |
Nov
(17) |
Dec
(41) |
2013 |
Jan
(19) |
Feb
(18) |
Mar
(8) |
Apr
(40) |
May
(121) |
Jun
(42) |
Jul
(127) |
Aug
(145) |
Sep
(27) |
Oct
(38) |
Nov
(83) |
Dec
(61) |
2014 |
Jan
(33) |
Feb
(35) |
Mar
(59) |
Apr
(41) |
May
(38) |
Jun
(45) |
Jul
(17) |
Aug
(58) |
Sep
(46) |
Oct
(51) |
Nov
(55) |
Dec
(36) |
2015 |
Jan
(57) |
Feb
(67) |
Mar
(70) |
Apr
(34) |
May
(32) |
Jun
(11) |
Jul
(3) |
Aug
(17) |
Sep
(16) |
Oct
(13) |
Nov
(30) |
Dec
(30) |
2016 |
Jan
(17) |
Feb
(12) |
Mar
(17) |
Apr
(20) |
May
(47) |
Jun
(15) |
Jul
(13) |
Aug
(30) |
Sep
(32) |
Oct
(20) |
Nov
(32) |
Dec
(24) |
2017 |
Jan
(16) |
Feb
|
Mar
(11) |
Apr
(11) |
May
(5) |
Jun
(42) |
Jul
(9) |
Aug
(10) |
Sep
(14) |
Oct
(15) |
Nov
(2) |
Dec
(29) |
2018 |
Jan
(28) |
Feb
(49) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dai...@us...> - 2012-02-16 08:51:37
|
Revision: 4914 http://web-erp.svn.sourceforge.net/web-erp/?rev=4914&view=rev Author: daintree Date: 2012-02-16 08:51:26 +0000 (Thu, 16 Feb 2012) Log Message: ----------- roll back stable to pre Tims menu changes Modified Paths: -------------- branches/stable/AccountGroups.php branches/stable/AccountSections.php branches/stable/AddCustomerContacts.php branches/stable/AddCustomerTypeNotes.php branches/stable/UpgradeDatabase.php branches/stable/css/fresh/default.css branches/stable/css/fresh/images/maintenance.png branches/stable/css/fresh/images/reports.png branches/stable/css/fresh/images/transactions.png branches/stable/css/fresh/login.css branches/stable/css/silverwolf/default.css branches/stable/includes/ConnectDB.inc branches/stable/includes/footer.inc branches/stable/includes/header.inc branches/stable/includes/session.inc branches/stable/index.php Removed Paths: ------------- branches/stable/includes/IndexArray.php branches/stable/sql/mysql/upgrade4.07-4.08.sql Modified: branches/stable/AccountGroups.php =================================================================== --- branches/stable/AccountGroups.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/AccountGroups.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -52,8 +52,7 @@ $i=1; $sql="SELECT count(groupname) - FROM accountgroups - WHERE groupname='".$_POST['GroupName']."'"; + FROM accountgroups WHERE groupname='".$_POST['GroupName']."'"; $DbgMsg = _('The SQL that was used to retrieve the information was'); $ErrMsg = _('Could not check whether the group exists because'); @@ -116,7 +115,7 @@ $Errors[$i] = 'SequenceInTB'; $i++; } - if (!ctype_digit($_POST['SequenceInTB']) OR $_POST['SequenceInTB'] > 10000) { + if (!ctype_digit($_POST['SequenceInTB']) or $_POST['SequenceInTB'] > 10000) { $InputError = 1; prnMsg( _('The sequence in the TB must be numeric and less than') . ' 10,000','error'); $Errors[$i] = 'SequenceInTB'; Modified: branches/stable/AccountSections.php =================================================================== --- branches/stable/AccountSections.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/AccountSections.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -14,8 +14,9 @@ if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, - sectionname) - VALUES (1, + sectionname + ) VALUES ( + 1, 'Income')"; $result = DB_query($sql,$db); } @@ -25,8 +26,9 @@ if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, - sectionname) - VALUES (2, + sectionname + ) VALUES ( + 2, 'Cost Of Sales')"; $result = DB_query($sql,$db); } @@ -56,7 +58,7 @@ WHERE sectionid='".$_POST['SectionID']."'"; $result=DB_query($sql, $db); - if ((DB_num_rows($result)!=0 AND !isset($_POST['SelectedSectionID']))) { + if ((DB_num_rows($result)!=0 and !isset($_POST['SelectedSectionID']))) { $InputError = 1; prnMsg( _('The account section already exists in the database'),'error'); $Errors[$i] = 'SectionID'; @@ -75,20 +77,20 @@ $Errors[$i] = 'SectionName'; $i++; } - if (isset($_POST['SectionID']) AND (!is_numeric($_POST['SectionID']))) { + if (isset($_POST['SectionID']) and (!is_numeric($_POST['SectionID']))) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SectionID']) AND mb_strpos($_POST['SectionID'],".")>0) { + if (isset($_POST['SectionID']) and mb_strpos($_POST['SectionID'],".")>0) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SelectedSectionID']) AND $_POST['SelectedSectionID']!='' AND $InputError !=1) { + if (isset($_POST['SelectedSectionID']) and $_POST['SelectedSectionID']!='' AND $InputError !=1) { /*SelectedSectionID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -147,7 +149,7 @@ unset ($_POST['SectionName']); } -if (!isset($_GET['SelectedSectionID']) AND !isset($_POST['SelectedSectionID'])) { +if (!isset($_GET['SelectedSectionID']) and !isset($_POST['SelectedSectionID'])) { /* An account section could be posted when one has been edited and is being updated or GOT when selected for modification Modified: branches/stable/AddCustomerContacts.php =================================================================== --- branches/stable/AddCustomerContacts.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/AddCustomerContacts.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -34,7 +34,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['Con_ID']) AND !is_long((integer)$_POST['Con_ID'])) { + if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (mb_strlen($_POST['ContactName']) >40) { @@ -43,12 +43,12 @@ } elseif( trim($_POST['ContactName']) == '' ) { $InputError = 1; prnMsg( _('The contact name may not be empty'), 'error'); - } elseif (!IsEmailAddress($_POST['ContactEmail']) AND mb_strlen($_POST['ContactEmail'])>0){ + } elseif (!IsEmailAddress($_POST['ContactEmail']) and mb_strlen($_POST['ContactEmail'])>0){ $InputError = 1; prnMsg( _('The contact email address is not a valid email address'), 'error'); } - if (isset($Id) AND ($Id AND $InputError !=1)) { + if (isset($Id) and ($Id and $InputError !=1)) { $sql = "UPDATE custcontacts SET contactname='" . $_POST['ContactName'] . "', role='" . $_POST['ContactRole'] . "', phoneno='" . $_POST['ContactPhone'] . "', @@ -89,7 +89,7 @@ unset($_POST['ContactEmail']); unset($_POST['Con_ID']); } -} elseif (isset($_GET['delete']) AND $_GET['delete']) { +} elseif (isset($_GET['delete']) and $_GET['delete']) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' @@ -127,8 +127,7 @@ <th>' . _('Role') . '</th> <th>' . _('Phone no') . '</th> <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th> - </tr>'; + <th>' . _('Notes') . '</th>'; $k=0; //row colour counter @@ -209,8 +208,7 @@ echo '<table class="selection">'; } - echo '<tr> - <td>'. _('Contact Name') . '</td>'; + echo '<tr><td>'. _('Contact Name') . '</td>'; if (isset($_POST['ContactName'])) { echo '<td><input type="text" name="ContactName" value="' . $_POST['ContactName']. '" size="35" maxlength="40" /></td> </tr>'; @@ -227,8 +225,7 @@ echo '<td><input type="text" name="ContactRole" size="35" maxlength="40" /></td> </tr>'; } - echo '<tr> - <td>' . _('Phone') . '</td>'; + echo '<tr><td>' . _('Phone') . '</td>'; if (isset($_POST['ContactPhone'])) { echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> </tr>'; Modified: branches/stable/AddCustomerTypeNotes.php =================================================================== --- branches/stable/AddCustomerTypeNotes.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/AddCustomerTypeNotes.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -111,8 +111,7 @@ <th>' . _('Date') . '</th> <th>' . _('Note') . '</th> <th>' . _('href') . '</th> - <th>' . _('Priority') . '</th> - </tr>'; + <th>' . _('Priority') . '</th>'; $k=0; //row colour counter Modified: branches/stable/UpgradeDatabase.php =================================================================== --- branches/stable/UpgradeDatabase.php 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/UpgradeDatabase.php 2012-02-16 08:51:26 UTC (rev 4914) @@ -134,8 +134,6 @@ case '4.06.6': $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; case '4.07.0': - $SQLScripts[] = './sql/mysql/upgrade4.07-4.08.sql'; - case '4.08': break; } //end switch } Modified: branches/stable/css/fresh/default.css =================================================================== --- branches/stable/css/fresh/default.css 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/css/fresh/default.css 2012-02-16 08:51:26 UTC (rev 4914) @@ -2,7 +2,7 @@ | | | default.css | |---------------------------------------------------| | For use with: | -| Web-ERP - http://weberp.sourceforge.net | +| Web-ERP - http://web-erp.sourceforge.net | | by Logic Works Ltd | |---------------------------------------------------| | Developer: | @@ -19,11 +19,11 @@ body { font-family: Arial, Verdana, Helvetica, sans-serif;; font-size: 10px; - background-color: #FFF; - margin-left: 0px; - margin-top: 0px; + background-color: #F1FFDD; + margin-left: 10px; + margin-top: 5px; margin-bottom: 0px; - margin-right: 0px; + margin-right: 10px; padding: 0px; } @@ -37,7 +37,7 @@ font-size: 10px; font-weight: bold; text-decoration: none; - color: #4D4E1A; + color: black; } /*links on any screen when mouse is hovering over them */ @@ -47,7 +47,7 @@ } table { - background-color: #ffffff; + background-color: #B4BB86; margin: 0 auto; } @@ -106,11 +106,11 @@ } .EvenTableRows { - background-color: #72824D; + background-color: #CCCCCC; } .OddTableRows { - background-color: #CAF17C; + background-color: #EEEEEE; } th { @@ -147,7 +147,7 @@ div.info { background-color:#c7ccf6; color: navy; - border: 0px solid navy; + border: 1px solid navy; } input { @@ -190,7 +190,7 @@ #topMenu { width: 100%; color: black; - background-color: #A0C462; + background-color: #ffffff; border: none; border-bottom: 1px solid #999999; } @@ -248,16 +248,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } @@ -302,12 +296,18 @@ /* Main page heading with quick menu within */ .quick_menu { width: 100%; - background-color: #C9D392; + background-color: #ffffff; border: none; margin: 0px; padding: 0px; color: black; + /*border-top: 2px #aaaaaa solid; + border-left: 2px #aaaaaa solid; + border-right: 2px #ffffff solid; + border-bottom: 4px #ffffff solid; */ text-align: right; + /* position: relative; + top: 3px; */ } #quick_menu{ @@ -319,14 +319,14 @@ font-size: 11px; border: 0px; white-space: nowrap; - margin: 0px; + margin: 2px; padding: 0px; color: black; } /*the Select Customer / Item / Supplier Menu tabs */ .quick_menu_tabs { - background-color: #5A5F00; + background-color: #ffffff; white-space: nowrap; border: none; margin: 0px; @@ -399,7 +399,6 @@ .main_menu { border: 2px inset #ffffff; - background-color: #ffffff; } .main_menu table { @@ -411,21 +410,11 @@ .main_menu_unselected { background-color: #617C4F; - border: 1px solid #5C874D; + border: 2px #f1ffdd outset; text-align: center; white-space: nowrap; - height: 16pt; } -.main_menu_selected { - background-color: #C9D392; - border: 1px solid #5C874D; - text-align: center; - white-space: nowrap; - color: #2B570F; - height: 16pt; -} - .main_menu_unselected:hover{ } .main_menu_selected:hover{ @@ -437,13 +426,20 @@ .main_menu_unselected a:hover{ } +.main_menu_selected { + background-color: #617C4F; + border: 2px inset #41437D; + text-align: center; + white-space: nowrap; +} + .main_menu_selected a{ - color: #2B570F; + color: #eee; font-weight:bold; } .main_menu_selected a:hover{ - color: #2B570F; + color: #fff; text-decoration: none; } @@ -480,7 +476,7 @@ } .menu_group_area { - border: 0px inset #ffffff; + border: 2px inset #ffffff; } .blank_area table { @@ -489,8 +485,7 @@ } .menu_group_headers { - border: 0px #aaaaaa; - background-color: #C9D392; + border: 2px outset #aaaaaa; width: 25%; } @@ -507,32 +502,30 @@ .menu_group_items { vertical-align: top; background-color: #ffffff; - border: 0px #aaaaaa; + border: 2px outset #aaaaaa; padding: 10px; } .menu_group_item { + background-color: #ffffff; padding-top: 2px; padding-bottom: 2px; } .menu_group_item p { - color: #5AAE34; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ + color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ text-indent: -12px; /* this makes the bullet to appear as the li tag previously used */ margin: 0 0 0 12px; /* One thing that I didn´t like of the li was that it had no left margin applied */ } -p.page_title_text { +.page_title_text { font-family: Arial, Verdana, Helvetica, sans-serif; - padding-top: 2px; - padding-bottom: 2px; + padding-top: 2px; + padding-bottom: 2px; font-weight: bold; font-size: 10px; color: black; - background-color: #C9D392; - width: 30%; TEXT-ALIGN:center; - margin: 10px auto; } DIV.page_help_text { @@ -593,21 +586,20 @@ #footer { position: relative; bottom: -3px; - background-color: #C9D392; } a.footer { font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; - font-size: 10px; + font-size: 8px; } .footer { font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; - font-size: 10px; + font-size: 8px; text-align: center; } @@ -696,4 +688,4 @@ li { list-style-image: url(bullet.gif); -} +} \ No newline at end of file Modified: branches/stable/css/fresh/images/maintenance.png =================================================================== --- branches/stable/css/fresh/images/maintenance.png 2012-02-16 08:38:39 UTC (rev 4913) +++ branches/stable/css/fresh/images/maintenance.png 2012-02-16 08:51:26 UTC (rev 4914) @@ -1,7 +1,7 @@ \x89PNG |
From: <dai...@us...> - 2012-02-16 08:38:49
|
Revision: 4913 http://web-erp.svn.sourceforge.net/web-erp/?rev=4913&view=rev Author: daintree Date: 2012-02-16 08:38:39 +0000 (Thu, 16 Feb 2012) Log Message: ----------- stable branch Added Paths: ----------- branches/stable/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-16 08:38:49
|
Revision: 4913 http://web-erp.svn.sourceforge.net/web-erp/?rev=4913&view=rev Author: daintree Date: 2012-02-16 08:38:39 +0000 (Thu, 16 Feb 2012) Log Message: ----------- stable branch Added Paths: ----------- branches/stable/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-16 07:36:45
|
Revision: 4912 http://web-erp.svn.sourceforge.net/web-erp/?rev=4912&view=rev Author: daintree Date: 2012-02-16 07:36:36 +0000 (Thu, 16 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/AccountGroups.php trunk/AccountSections.php trunk/AddCustomerContacts.php trunk/AddCustomerTypeNotes.php trunk/UpgradeDatabase.php trunk/index.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/AccountGroups.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -52,7 +52,8 @@ $i=1; $sql="SELECT count(groupname) - FROM accountgroups WHERE groupname='".$_POST['GroupName']."'"; + FROM accountgroups + WHERE groupname='".$_POST['GroupName']."'"; $DbgMsg = _('The SQL that was used to retrieve the information was'); $ErrMsg = _('Could not check whether the group exists because'); @@ -115,7 +116,7 @@ $Errors[$i] = 'SequenceInTB'; $i++; } - if (!ctype_digit($_POST['SequenceInTB']) or $_POST['SequenceInTB'] > 10000) { + if (!ctype_digit($_POST['SequenceInTB']) OR $_POST['SequenceInTB'] > 10000) { $InputError = 1; prnMsg( _('The sequence in the TB must be numeric and less than') . ' 10,000','error'); $Errors[$i] = 'SequenceInTB'; Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/AccountSections.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -14,9 +14,8 @@ if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, - sectionname - ) VALUES ( - 1, + sectionname) + VALUES (1, 'Income')"; $result = DB_query($sql,$db); } @@ -26,9 +25,8 @@ if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, - sectionname - ) VALUES ( - 2, + sectionname) + VALUES (2, 'Cost Of Sales')"; $result = DB_query($sql,$db); } @@ -58,7 +56,7 @@ WHERE sectionid='".$_POST['SectionID']."'"; $result=DB_query($sql, $db); - if ((DB_num_rows($result)!=0 and !isset($_POST['SelectedSectionID']))) { + if ((DB_num_rows($result)!=0 AND !isset($_POST['SelectedSectionID']))) { $InputError = 1; prnMsg( _('The account section already exists in the database'),'error'); $Errors[$i] = 'SectionID'; @@ -77,20 +75,20 @@ $Errors[$i] = 'SectionName'; $i++; } - if (isset($_POST['SectionID']) and (!is_numeric($_POST['SectionID']))) { + if (isset($_POST['SectionID']) AND (!is_numeric($_POST['SectionID']))) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SectionID']) and mb_strpos($_POST['SectionID'],".")>0) { + if (isset($_POST['SectionID']) AND mb_strpos($_POST['SectionID'],".")>0) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SelectedSectionID']) and $_POST['SelectedSectionID']!='' AND $InputError !=1) { + if (isset($_POST['SelectedSectionID']) AND $_POST['SelectedSectionID']!='' AND $InputError !=1) { /*SelectedSectionID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -149,7 +147,7 @@ unset ($_POST['SectionName']); } -if (!isset($_GET['SelectedSectionID']) and !isset($_POST['SelectedSectionID'])) { +if (!isset($_GET['SelectedSectionID']) AND !isset($_POST['SelectedSectionID'])) { /* An account section could be posted when one has been edited and is being updated or GOT when selected for modification Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/AddCustomerContacts.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -34,7 +34,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { + if (isset($_POST['Con_ID']) AND !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (mb_strlen($_POST['ContactName']) >40) { @@ -43,12 +43,12 @@ } elseif( trim($_POST['ContactName']) == '' ) { $InputError = 1; prnMsg( _('The contact name may not be empty'), 'error'); - } elseif (!IsEmailAddress($_POST['ContactEmail']) and mb_strlen($_POST['ContactEmail'])>0){ + } elseif (!IsEmailAddress($_POST['ContactEmail']) AND mb_strlen($_POST['ContactEmail'])>0){ $InputError = 1; prnMsg( _('The contact email address is not a valid email address'), 'error'); } - if (isset($Id) and ($Id and $InputError !=1)) { + if (isset($Id) AND ($Id AND $InputError !=1)) { $sql = "UPDATE custcontacts SET contactname='" . $_POST['ContactName'] . "', role='" . $_POST['ContactRole'] . "', phoneno='" . $_POST['ContactPhone'] . "', @@ -89,7 +89,7 @@ unset($_POST['ContactEmail']); unset($_POST['Con_ID']); } -} elseif (isset($_GET['delete']) and $_GET['delete']) { +} elseif (isset($_GET['delete']) AND $_GET['delete']) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' @@ -127,7 +127,8 @@ <th>' . _('Role') . '</th> <th>' . _('Phone no') . '</th> <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th>'; + <th>' . _('Notes') . '</th> + </tr>'; $k=0; //row colour counter @@ -208,7 +209,8 @@ echo '<table class="selection">'; } - echo '<tr><td>'. _('Contact Name') . '</td>'; + echo '<tr> + <td>'. _('Contact Name') . '</td>'; if (isset($_POST['ContactName'])) { echo '<td><input type="text" name="ContactName" value="' . $_POST['ContactName']. '" size="35" maxlength="40" /></td> </tr>'; @@ -225,7 +227,8 @@ echo '<td><input type="text" name="ContactRole" size="35" maxlength="40" /></td> </tr>'; } - echo '<tr><td>' . _('Phone') . '</td>'; + echo '<tr> + <td>' . _('Phone') . '</td>'; if (isset($_POST['ContactPhone'])) { echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> </tr>'; Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/AddCustomerTypeNotes.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -111,7 +111,8 @@ <th>' . _('Date') . '</th> <th>' . _('Note') . '</th> <th>' . _('href') . '</th> - <th>' . _('Priority') . '</th>'; + <th>' . _('Priority') . '</th> + </tr>'; $k=0; //row colour counter Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/UpgradeDatabase.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -133,9 +133,9 @@ $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06.6': $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; - case '4.06.7': + case '4.07.0': $SQLScripts[] = './sql/mysql/upgrade4.07-4.08.sql'; - case '4.07.0': + case '4.08': break; } //end switch } Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/index.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -8,7 +8,7 @@ /*The module link codes are hard coded in a switch statement below to determine the options to show for each tab */ include('includes/IndexArray.php'); -if (isset($SupplierLogin) and $SupplierLogin==1){ +if (isset($SupplierLogin) AND $SupplierLogin==1){ echo '<table class="table_index"> <tr> <td class="menu_group_item"> @@ -28,7 +28,7 @@ </table>'; include('includes/footer.inc'); exit; -} elseif (isset($SupplierLogin) and $SupplierLogin==0){ +} elseif (isset($SupplierLogin) AND $SupplierLogin==0){ echo '<table class="table_index"> <tr> <td class="menu_group_item"> @@ -72,9 +72,13 @@ $_SESSION['Module']=$ModuleLink[$i]; } if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr> + <td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td> + </tr>'; } else { - echo '<tr><td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr> + <td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td> + </tr>'; } } $i++; @@ -199,13 +203,13 @@ $Title= array(_('Custom Reports'), _('Standard Reports and Forms')); $sql= "SELECT id, - reporttype, - defaultreport, - groupname, - reportname - FROM reports - ORDER BY groupname, - reportname"; + reporttype, + defaultreport, + groupname, + reportname + FROM reports + ORDER BY groupname, + reportname"; $Result=DB_query($sql,$db,'','',false,true); $ReportList = ''; while ($Temp = DB_fetch_array($Result)) $ReportList[] = $Temp; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-16 07:36:42
|
Revision: 4912 http://web-erp.svn.sourceforge.net/web-erp/?rev=4912&view=rev Author: daintree Date: 2012-02-16 07:36:36 +0000 (Thu, 16 Feb 2012) Log Message: ----------- Modified Paths: -------------- trunk/AccountGroups.php trunk/AccountSections.php trunk/AddCustomerContacts.php trunk/AddCustomerTypeNotes.php trunk/UpgradeDatabase.php trunk/index.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/AccountGroups.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -52,7 +52,8 @@ $i=1; $sql="SELECT count(groupname) - FROM accountgroups WHERE groupname='".$_POST['GroupName']."'"; + FROM accountgroups + WHERE groupname='".$_POST['GroupName']."'"; $DbgMsg = _('The SQL that was used to retrieve the information was'); $ErrMsg = _('Could not check whether the group exists because'); @@ -115,7 +116,7 @@ $Errors[$i] = 'SequenceInTB'; $i++; } - if (!ctype_digit($_POST['SequenceInTB']) or $_POST['SequenceInTB'] > 10000) { + if (!ctype_digit($_POST['SequenceInTB']) OR $_POST['SequenceInTB'] > 10000) { $InputError = 1; prnMsg( _('The sequence in the TB must be numeric and less than') . ' 10,000','error'); $Errors[$i] = 'SequenceInTB'; Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/AccountSections.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -14,9 +14,8 @@ if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, - sectionname - ) VALUES ( - 1, + sectionname) + VALUES (1, 'Income')"; $result = DB_query($sql,$db); } @@ -26,9 +25,8 @@ if( DB_num_rows($result) == 0 ) { $sql = "INSERT INTO accountsection (sectionid, - sectionname - ) VALUES ( - 2, + sectionname) + VALUES (2, 'Cost Of Sales')"; $result = DB_query($sql,$db); } @@ -58,7 +56,7 @@ WHERE sectionid='".$_POST['SectionID']."'"; $result=DB_query($sql, $db); - if ((DB_num_rows($result)!=0 and !isset($_POST['SelectedSectionID']))) { + if ((DB_num_rows($result)!=0 AND !isset($_POST['SelectedSectionID']))) { $InputError = 1; prnMsg( _('The account section already exists in the database'),'error'); $Errors[$i] = 'SectionID'; @@ -77,20 +75,20 @@ $Errors[$i] = 'SectionName'; $i++; } - if (isset($_POST['SectionID']) and (!is_numeric($_POST['SectionID']))) { + if (isset($_POST['SectionID']) AND (!is_numeric($_POST['SectionID']))) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SectionID']) and mb_strpos($_POST['SectionID'],".")>0) { + if (isset($_POST['SectionID']) AND mb_strpos($_POST['SectionID'],".")>0) { $InputError = 1; prnMsg( _('The section number must be an integer'),'error'); $Errors[$i] = 'SectionID'; $i++; } - if (isset($_POST['SelectedSectionID']) and $_POST['SelectedSectionID']!='' AND $InputError !=1) { + if (isset($_POST['SelectedSectionID']) AND $_POST['SelectedSectionID']!='' AND $InputError !=1) { /*SelectedSectionID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -149,7 +147,7 @@ unset ($_POST['SectionName']); } -if (!isset($_GET['SelectedSectionID']) and !isset($_POST['SelectedSectionID'])) { +if (!isset($_GET['SelectedSectionID']) AND !isset($_POST['SelectedSectionID'])) { /* An account section could be posted when one has been edited and is being updated or GOT when selected for modification Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/AddCustomerContacts.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -34,7 +34,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { + if (isset($_POST['Con_ID']) AND !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (mb_strlen($_POST['ContactName']) >40) { @@ -43,12 +43,12 @@ } elseif( trim($_POST['ContactName']) == '' ) { $InputError = 1; prnMsg( _('The contact name may not be empty'), 'error'); - } elseif (!IsEmailAddress($_POST['ContactEmail']) and mb_strlen($_POST['ContactEmail'])>0){ + } elseif (!IsEmailAddress($_POST['ContactEmail']) AND mb_strlen($_POST['ContactEmail'])>0){ $InputError = 1; prnMsg( _('The contact email address is not a valid email address'), 'error'); } - if (isset($Id) and ($Id and $InputError !=1)) { + if (isset($Id) AND ($Id AND $InputError !=1)) { $sql = "UPDATE custcontacts SET contactname='" . $_POST['ContactName'] . "', role='" . $_POST['ContactRole'] . "', phoneno='" . $_POST['ContactPhone'] . "', @@ -89,7 +89,7 @@ unset($_POST['ContactEmail']); unset($_POST['Con_ID']); } -} elseif (isset($_GET['delete']) and $_GET['delete']) { +} elseif (isset($_GET['delete']) AND $_GET['delete']) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' @@ -127,7 +127,8 @@ <th>' . _('Role') . '</th> <th>' . _('Phone no') . '</th> <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th>'; + <th>' . _('Notes') . '</th> + </tr>'; $k=0; //row colour counter @@ -208,7 +209,8 @@ echo '<table class="selection">'; } - echo '<tr><td>'. _('Contact Name') . '</td>'; + echo '<tr> + <td>'. _('Contact Name') . '</td>'; if (isset($_POST['ContactName'])) { echo '<td><input type="text" name="ContactName" value="' . $_POST['ContactName']. '" size="35" maxlength="40" /></td> </tr>'; @@ -225,7 +227,8 @@ echo '<td><input type="text" name="ContactRole" size="35" maxlength="40" /></td> </tr>'; } - echo '<tr><td>' . _('Phone') . '</td>'; + echo '<tr> + <td>' . _('Phone') . '</td>'; if (isset($_POST['ContactPhone'])) { echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> </tr>'; Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/AddCustomerTypeNotes.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -111,7 +111,8 @@ <th>' . _('Date') . '</th> <th>' . _('Note') . '</th> <th>' . _('href') . '</th> - <th>' . _('Priority') . '</th>'; + <th>' . _('Priority') . '</th> + </tr>'; $k=0; //row colour counter Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/UpgradeDatabase.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -133,9 +133,9 @@ $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06.6': $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; - case '4.06.7': + case '4.07.0': $SQLScripts[] = './sql/mysql/upgrade4.07-4.08.sql'; - case '4.07.0': + case '4.08': break; } //end switch } Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-02-15 16:52:21 UTC (rev 4911) +++ trunk/index.php 2012-02-16 07:36:36 UTC (rev 4912) @@ -8,7 +8,7 @@ /*The module link codes are hard coded in a switch statement below to determine the options to show for each tab */ include('includes/IndexArray.php'); -if (isset($SupplierLogin) and $SupplierLogin==1){ +if (isset($SupplierLogin) AND $SupplierLogin==1){ echo '<table class="table_index"> <tr> <td class="menu_group_item"> @@ -28,7 +28,7 @@ </table>'; include('includes/footer.inc'); exit; -} elseif (isset($SupplierLogin) and $SupplierLogin==0){ +} elseif (isset($SupplierLogin) AND $SupplierLogin==0){ echo '<table class="table_index"> <tr> <td class="menu_group_item"> @@ -72,9 +72,13 @@ $_SESSION['Module']=$ModuleLink[$i]; } if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr> + <td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td> + </tr>'; } else { - echo '<tr><td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr> + <td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td> + </tr>'; } } $i++; @@ -199,13 +203,13 @@ $Title= array(_('Custom Reports'), _('Standard Reports and Forms')); $sql= "SELECT id, - reporttype, - defaultreport, - groupname, - reportname - FROM reports - ORDER BY groupname, - reportname"; + reporttype, + defaultreport, + groupname, + reportname + FROM reports + ORDER BY groupname, + reportname"; $Result=DB_query($sql,$db,'','',false,true); $ReportList = ''; while ($Temp = DB_fetch_array($Result)) $ReportList[] = $Temp; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 16:52:31
|
Revision: 4911 http://web-erp.svn.sourceforge.net/web-erp/?rev=4911&view=rev Author: tim_schofield Date: 2012-02-15 16:52:21 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Improvements to Fresh theme Modified Paths: -------------- trunk/css/fresh/default.css trunk/css/fresh/images/maintenance.png trunk/css/fresh/images/reports.png trunk/css/fresh/images/transactions.png trunk/css/fresh/login.css Modified: trunk/css/fresh/default.css =================================================================== --- trunk/css/fresh/default.css 2012-02-15 16:27:49 UTC (rev 4910) +++ trunk/css/fresh/default.css 2012-02-15 16:52:21 UTC (rev 4911) @@ -2,7 +2,7 @@ | | | default.css | |---------------------------------------------------| | For use with: | -| Web-ERP - http://web-erp.sourceforge.net | +| Web-ERP - http://weberp.sourceforge.net | | by Logic Works Ltd | |---------------------------------------------------| | Developer: | @@ -19,11 +19,11 @@ body { font-family: Arial, Verdana, Helvetica, sans-serif;; font-size: 10px; - background-color: #F1FFDD; - margin-left: 10px; - margin-top: 5px; + background-color: #FFF; + margin-left: 0px; + margin-top: 0px; margin-bottom: 0px; - margin-right: 10px; + margin-right: 0px; padding: 0px; } @@ -37,7 +37,7 @@ font-size: 10px; font-weight: bold; text-decoration: none; - color: black; + color: #4D4E1A; } /*links on any screen when mouse is hovering over them */ @@ -47,7 +47,7 @@ } table { - background-color: #B4BB86; + background-color: #ffffff; margin: 0 auto; } @@ -106,11 +106,11 @@ } .EvenTableRows { - background-color: #CCCCCC; + background-color: #72824D; } .OddTableRows { - background-color: #EEEEEE; + background-color: #CAF17C; } th { @@ -147,7 +147,7 @@ div.info { background-color:#c7ccf6; color: navy; - border: 1px solid navy; + border: 0px solid navy; } input { @@ -190,7 +190,7 @@ #topMenu { width: 100%; color: black; - background-color: #ffffff; + background-color: #A0C462; border: none; border-bottom: 1px solid #999999; } @@ -248,10 +248,16 @@ .table1 { width:90%; background: #eee; - border: 1px solid #222; + border: 0px 0px 2px 2px #222 solid; margin: 0 auto; } - +/* Table type is used for UI tables type 2 */ +.table2 { + width:90%; + background: #eee; + border: 0px 0px 2px 2px #222 solid; + margin: 0 auto; +} input.address3 { text-transform: uppercase; } @@ -296,18 +302,12 @@ /* Main page heading with quick menu within */ .quick_menu { width: 100%; - background-color: #ffffff; + background-color: #C9D392; border: none; margin: 0px; padding: 0px; color: black; - /*border-top: 2px #aaaaaa solid; - border-left: 2px #aaaaaa solid; - border-right: 2px #ffffff solid; - border-bottom: 4px #ffffff solid; */ text-align: right; - /* position: relative; - top: 3px; */ } #quick_menu{ @@ -319,14 +319,14 @@ font-size: 11px; border: 0px; white-space: nowrap; - margin: 2px; + margin: 0px; padding: 0px; color: black; } /*the Select Customer / Item / Supplier Menu tabs */ .quick_menu_tabs { - background-color: #ffffff; + background-color: #5A5F00; white-space: nowrap; border: none; margin: 0px; @@ -399,6 +399,7 @@ .main_menu { border: 2px inset #ffffff; + background-color: #ffffff; } .main_menu table { @@ -410,11 +411,21 @@ .main_menu_unselected { background-color: #617C4F; - border: 2px #f1ffdd outset; + border: 1px solid #5C874D; text-align: center; white-space: nowrap; + height: 16pt; } +.main_menu_selected { + background-color: #C9D392; + border: 1px solid #5C874D; + text-align: center; + white-space: nowrap; + color: #2B570F; + height: 16pt; +} + .main_menu_unselected:hover{ } .main_menu_selected:hover{ @@ -426,20 +437,13 @@ .main_menu_unselected a:hover{ } -.main_menu_selected { - background-color: #617C4F; - border: 2px inset #41437D; - text-align: center; - white-space: nowrap; -} - .main_menu_selected a{ - color: #eee; + color: #2B570F; font-weight:bold; } .main_menu_selected a:hover{ - color: #fff; + color: #2B570F; text-decoration: none; } @@ -476,7 +480,7 @@ } .menu_group_area { - border: 2px inset #ffffff; + border: 0px inset #ffffff; } .blank_area table { @@ -485,7 +489,8 @@ } .menu_group_headers { - border: 2px outset #aaaaaa; + border: 0px #aaaaaa; + background-color: #C9D392; width: 25%; } @@ -502,30 +507,32 @@ .menu_group_items { vertical-align: top; background-color: #ffffff; - border: 2px outset #aaaaaa; + border: 0px #aaaaaa; padding: 10px; } .menu_group_item { - background-color: #ffffff; padding-top: 2px; padding-bottom: 2px; } .menu_group_item p { - color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ + color: #5AAE34; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ text-indent: -12px; /* this makes the bullet to appear as the li tag previously used */ margin: 0 0 0 12px; /* One thing that I didn´t like of the li was that it had no left margin applied */ } -.page_title_text { +p.page_title_text { font-family: Arial, Verdana, Helvetica, sans-serif; - padding-top: 2px; - padding-bottom: 2px; + padding-top: 2px; + padding-bottom: 2px; font-weight: bold; font-size: 10px; color: black; + background-color: #C9D392; + width: 30%; TEXT-ALIGN:center; + margin: 10px auto; } DIV.page_help_text { @@ -586,20 +593,21 @@ #footer { position: relative; bottom: -3px; + background-color: #C9D392; } a.footer { font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; - font-size: 8px; + font-size: 10px; } .footer { font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; - font-size: 8px; + font-size: 10px; text-align: center; } @@ -688,4 +696,4 @@ li { list-style-image: url(bullet.gif); -} \ No newline at end of file +} Modified: trunk/css/fresh/images/maintenance.png =================================================================== --- trunk/css/fresh/images/maintenance.png 2012-02-15 16:27:49 UTC (rev 4910) +++ trunk/css/fresh/images/maintenance.png 2012-02-15 16:52:21 UTC (rev 4911) @@ -1,7 +1,7 @@ \x89PNG |
From: <tim...@us...> - 2012-02-15 16:52:31
|
Revision: 4911 http://web-erp.svn.sourceforge.net/web-erp/?rev=4911&view=rev Author: tim_schofield Date: 2012-02-15 16:52:21 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Improvements to Fresh theme Modified Paths: -------------- trunk/css/fresh/default.css trunk/css/fresh/images/maintenance.png trunk/css/fresh/images/reports.png trunk/css/fresh/images/transactions.png trunk/css/fresh/login.css Modified: trunk/css/fresh/default.css =================================================================== --- trunk/css/fresh/default.css 2012-02-15 16:27:49 UTC (rev 4910) +++ trunk/css/fresh/default.css 2012-02-15 16:52:21 UTC (rev 4911) @@ -2,7 +2,7 @@ | | | default.css | |---------------------------------------------------| | For use with: | -| Web-ERP - http://web-erp.sourceforge.net | +| Web-ERP - http://weberp.sourceforge.net | | by Logic Works Ltd | |---------------------------------------------------| | Developer: | @@ -19,11 +19,11 @@ body { font-family: Arial, Verdana, Helvetica, sans-serif;; font-size: 10px; - background-color: #F1FFDD; - margin-left: 10px; - margin-top: 5px; + background-color: #FFF; + margin-left: 0px; + margin-top: 0px; margin-bottom: 0px; - margin-right: 10px; + margin-right: 0px; padding: 0px; } @@ -37,7 +37,7 @@ font-size: 10px; font-weight: bold; text-decoration: none; - color: black; + color: #4D4E1A; } /*links on any screen when mouse is hovering over them */ @@ -47,7 +47,7 @@ } table { - background-color: #B4BB86; + background-color: #ffffff; margin: 0 auto; } @@ -106,11 +106,11 @@ } .EvenTableRows { - background-color: #CCCCCC; + background-color: #72824D; } .OddTableRows { - background-color: #EEEEEE; + background-color: #CAF17C; } th { @@ -147,7 +147,7 @@ div.info { background-color:#c7ccf6; color: navy; - border: 1px solid navy; + border: 0px solid navy; } input { @@ -190,7 +190,7 @@ #topMenu { width: 100%; color: black; - background-color: #ffffff; + background-color: #A0C462; border: none; border-bottom: 1px solid #999999; } @@ -248,10 +248,16 @@ .table1 { width:90%; background: #eee; - border: 1px solid #222; + border: 0px 0px 2px 2px #222 solid; margin: 0 auto; } - +/* Table type is used for UI tables type 2 */ +.table2 { + width:90%; + background: #eee; + border: 0px 0px 2px 2px #222 solid; + margin: 0 auto; +} input.address3 { text-transform: uppercase; } @@ -296,18 +302,12 @@ /* Main page heading with quick menu within */ .quick_menu { width: 100%; - background-color: #ffffff; + background-color: #C9D392; border: none; margin: 0px; padding: 0px; color: black; - /*border-top: 2px #aaaaaa solid; - border-left: 2px #aaaaaa solid; - border-right: 2px #ffffff solid; - border-bottom: 4px #ffffff solid; */ text-align: right; - /* position: relative; - top: 3px; */ } #quick_menu{ @@ -319,14 +319,14 @@ font-size: 11px; border: 0px; white-space: nowrap; - margin: 2px; + margin: 0px; padding: 0px; color: black; } /*the Select Customer / Item / Supplier Menu tabs */ .quick_menu_tabs { - background-color: #ffffff; + background-color: #5A5F00; white-space: nowrap; border: none; margin: 0px; @@ -399,6 +399,7 @@ .main_menu { border: 2px inset #ffffff; + background-color: #ffffff; } .main_menu table { @@ -410,11 +411,21 @@ .main_menu_unselected { background-color: #617C4F; - border: 2px #f1ffdd outset; + border: 1px solid #5C874D; text-align: center; white-space: nowrap; + height: 16pt; } +.main_menu_selected { + background-color: #C9D392; + border: 1px solid #5C874D; + text-align: center; + white-space: nowrap; + color: #2B570F; + height: 16pt; +} + .main_menu_unselected:hover{ } .main_menu_selected:hover{ @@ -426,20 +437,13 @@ .main_menu_unselected a:hover{ } -.main_menu_selected { - background-color: #617C4F; - border: 2px inset #41437D; - text-align: center; - white-space: nowrap; -} - .main_menu_selected a{ - color: #eee; + color: #2B570F; font-weight:bold; } .main_menu_selected a:hover{ - color: #fff; + color: #2B570F; text-decoration: none; } @@ -476,7 +480,7 @@ } .menu_group_area { - border: 2px inset #ffffff; + border: 0px inset #ffffff; } .blank_area table { @@ -485,7 +489,8 @@ } .menu_group_headers { - border: 2px outset #aaaaaa; + border: 0px #aaaaaa; + background-color: #C9D392; width: 25%; } @@ -502,30 +507,32 @@ .menu_group_items { vertical-align: top; background-color: #ffffff; - border: 2px outset #aaaaaa; + border: 0px #aaaaaa; padding: 10px; } .menu_group_item { - background-color: #ffffff; padding-top: 2px; padding-bottom: 2px; } .menu_group_item p { - color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ + color: #5AAE34; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ text-indent: -12px; /* this makes the bullet to appear as the li tag previously used */ margin: 0 0 0 12px; /* One thing that I didn´t like of the li was that it had no left margin applied */ } -.page_title_text { +p.page_title_text { font-family: Arial, Verdana, Helvetica, sans-serif; - padding-top: 2px; - padding-bottom: 2px; + padding-top: 2px; + padding-bottom: 2px; font-weight: bold; font-size: 10px; color: black; + background-color: #C9D392; + width: 30%; TEXT-ALIGN:center; + margin: 10px auto; } DIV.page_help_text { @@ -586,20 +593,21 @@ #footer { position: relative; bottom: -3px; + background-color: #C9D392; } a.footer { font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; - font-size: 8px; + font-size: 10px; } .footer { font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; - font-size: 8px; + font-size: 10px; text-align: center; } @@ -688,4 +696,4 @@ li { list-style-image: url(bullet.gif); -} \ No newline at end of file +} Modified: trunk/css/fresh/images/maintenance.png =================================================================== --- trunk/css/fresh/images/maintenance.png 2012-02-15 16:27:49 UTC (rev 4910) +++ trunk/css/fresh/images/maintenance.png 2012-02-15 16:52:21 UTC (rev 4911) @@ -1,7 +1,7 @@ \x89PNG |
From: <tim...@us...> - 2012-02-15 16:27:59
|
Revision: 4910 http://web-erp.svn.sourceforge.net/web-erp/?rev=4910&view=rev Author: tim_schofield Date: 2012-02-15 16:27:49 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Improvements to silverwolf theme Modified Paths: -------------- trunk/css/silverwolf/default.css Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2012-02-15 16:24:39 UTC (rev 4909) +++ trunk/css/silverwolf/default.css 2012-02-15 16:27:49 UTC (rev 4910) @@ -1,9 +1,9 @@ -@charset "UTF-8"; +@charset "utf-8"; /*--------------------------------------------------\ | | | default.css | |---------------------------------------------------| | For use with: | -| Web-ERP - http://web-erp.sourceforge.net | +| Web-ERP - http://weberp.sourceforge.net | | by Logic Works Ltd | |---------------------------------------------------| | Developer: | @@ -44,12 +44,12 @@ font-size: 100%; font-weight: normal; text-decoration: none; - color: #00f; + color: #5B5B68; } /*links on any screen except quick menu which is overridden when mouse is hovering over them */ a:hover { - color: #00a; + color: #000; text-decoration: underline; } @@ -60,7 +60,7 @@ th { font-weight: normal; - background-color: #cccce5; + background-color: #C3C3C3; font-size: 100%; color: #300; text-align: center; @@ -93,7 +93,7 @@ } table.selection { - background-color:#eee; + background-color:#DCDCDC; outline-style:solid; outline-color: #8e8a8a; outline-width:1px; @@ -322,9 +322,18 @@ .table1 { width:90%; background: #eee; - border: 1px solid #222; + border: 0px 0px 2px 2px #222 solid; + background: #eee; margin: 0 auto; } +// Table type is used for UI tables type 2 +.table2 { + width:90%; + background: #eee; + border: 0px 0px 2px 2px #222 solid; + background: #eee; + margin: 0 auto; +} input.address3 { text-transform: uppercase; @@ -516,7 +525,7 @@ } .main_menu_selected { - background: #aaa url(images/menu_bg_blue.png) 0px -10px repeat-x; + background: #241D1D; border: 1px solid #888; /* position: relative; it's not a div but a table */ text-align: center; @@ -528,11 +537,11 @@ .main_menu_selected:hover { } */ .main_menu_selected a { - color: #00F; + color: #ddd; } .main_menu_selected a:hover { - color: #000; + color: #ffe; text-decoration: none; } @@ -568,14 +577,14 @@ } .menu_group_headers { - background: #aaa url(images/menu_bg_white.png) 0px -3px repeat-x; + background: #B3B3B3; width: 25%; vertical-align: top; padding: 0 0 2px 0; } .menu_group_headers table { - background: #aaa url(images/menu_bg_white.png) 0px -3px repeat-x; + background: #B3B3B3; } .menu_group_headers_text { @@ -597,7 +606,7 @@ } .menu_group_item p { - color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ + color: #000; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ text-indent: -11px; /* this makes the bullet to appear as the li tag previously used */ margin: 0 0 0 12px; /* One thing that I didn´t like of the li was that it had no left margin applied */ } @@ -607,9 +616,9 @@ padding-top: 2px; padding-bottom: 2px; font-weight: bold; - font-size: 100%; - color: black; - background-color: #cccce5; + font-size: 150%; + color: white; + background-color: #7A7A89; width: 33%; border-style: solid; border-width: 1px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 16:27:58
|
Revision: 4910 http://web-erp.svn.sourceforge.net/web-erp/?rev=4910&view=rev Author: tim_schofield Date: 2012-02-15 16:27:49 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Improvements to silverwolf theme Modified Paths: -------------- trunk/css/silverwolf/default.css Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2012-02-15 16:24:39 UTC (rev 4909) +++ trunk/css/silverwolf/default.css 2012-02-15 16:27:49 UTC (rev 4910) @@ -1,9 +1,9 @@ -@charset "UTF-8"; +@charset "utf-8"; /*--------------------------------------------------\ | | | default.css | |---------------------------------------------------| | For use with: | -| Web-ERP - http://web-erp.sourceforge.net | +| Web-ERP - http://weberp.sourceforge.net | | by Logic Works Ltd | |---------------------------------------------------| | Developer: | @@ -44,12 +44,12 @@ font-size: 100%; font-weight: normal; text-decoration: none; - color: #00f; + color: #5B5B68; } /*links on any screen except quick menu which is overridden when mouse is hovering over them */ a:hover { - color: #00a; + color: #000; text-decoration: underline; } @@ -60,7 +60,7 @@ th { font-weight: normal; - background-color: #cccce5; + background-color: #C3C3C3; font-size: 100%; color: #300; text-align: center; @@ -93,7 +93,7 @@ } table.selection { - background-color:#eee; + background-color:#DCDCDC; outline-style:solid; outline-color: #8e8a8a; outline-width:1px; @@ -322,9 +322,18 @@ .table1 { width:90%; background: #eee; - border: 1px solid #222; + border: 0px 0px 2px 2px #222 solid; + background: #eee; margin: 0 auto; } +// Table type is used for UI tables type 2 +.table2 { + width:90%; + background: #eee; + border: 0px 0px 2px 2px #222 solid; + background: #eee; + margin: 0 auto; +} input.address3 { text-transform: uppercase; @@ -516,7 +525,7 @@ } .main_menu_selected { - background: #aaa url(images/menu_bg_blue.png) 0px -10px repeat-x; + background: #241D1D; border: 1px solid #888; /* position: relative; it's not a div but a table */ text-align: center; @@ -528,11 +537,11 @@ .main_menu_selected:hover { } */ .main_menu_selected a { - color: #00F; + color: #ddd; } .main_menu_selected a:hover { - color: #000; + color: #ffe; text-decoration: none; } @@ -568,14 +577,14 @@ } .menu_group_headers { - background: #aaa url(images/menu_bg_white.png) 0px -3px repeat-x; + background: #B3B3B3; width: 25%; vertical-align: top; padding: 0 0 2px 0; } .menu_group_headers table { - background: #aaa url(images/menu_bg_white.png) 0px -3px repeat-x; + background: #B3B3B3; } .menu_group_headers_text { @@ -597,7 +606,7 @@ } .menu_group_item p { - color: #00f; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ + color: #000; /* This is the color for bullets, I like it to be the same as the anchor color, but it's up to you */ text-indent: -11px; /* this makes the bullet to appear as the li tag previously used */ margin: 0 0 0 12px; /* One thing that I didn´t like of the li was that it had no left margin applied */ } @@ -607,9 +616,9 @@ padding-top: 2px; padding-bottom: 2px; font-weight: bold; - font-size: 100%; - color: black; - background-color: #cccce5; + font-size: 150%; + color: white; + background-color: #7A7A89; width: 33%; border-style: solid; border-width: 1px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 16:24:52
|
Revision: 4909 http://web-erp.svn.sourceforge.net/web-erp/?rev=4909&view=rev Author: tim_schofield Date: 2012-02-15 16:24:39 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Upload new menuing system moving menu items to an array, only showing items that the user has access to Modified Paths: -------------- trunk/UpgradeDatabase.php trunk/includes/ConnectDB.inc trunk/includes/footer.inc trunk/includes/header.inc trunk/includes/session.inc trunk/index.php Added Paths: ----------- trunk/includes/IndexArray.php trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/UpgradeDatabase.php 2012-02-15 16:24:39 UTC (rev 4909) @@ -133,6 +133,8 @@ $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06.6': $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; + case '4.06.7': + $SQLScripts[] = './sql/mysql/upgrade4.07-4.08.sql'; case '4.07.0': break; } //end switch Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/ConnectDB.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.06.7'; //must update manually every time there is a DB change +$Version='4.07.1'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Added: trunk/includes/IndexArray.php =================================================================== --- trunk/includes/IndexArray.php (rev 0) +++ trunk/includes/IndexArray.php 2012-02-15 16:24:39 UTC (rev 4909) @@ -0,0 +1,515 @@ +<?php +$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); +$ReportList = array('orders'=>'ord', + 'AR'=>'ar', + 'AP'=>'ap', + 'PO'=>'prch', + 'stock'=>'inv', + 'manuf'=>'man', + 'GL'=>'gl', + 'FA'=>'fa', + 'PC'=>'pc', + 'system'=>'sys' + ); + +/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ +$ModuleList = array(_('Sales'), + _('Receivables'), + _('Payables'), + _('Purchases'), + _('Inventory'), + _('Manufacturing'), + _('General Ledger'), + _('Asset Manager'), + _('Petty Cash'), + _('Setup')); + +$MenuItems['orders']['Transactions']['Caption'] = array( _('Enter An Order or Quotation'), + _('Enter Counter Sales'), + _('Print Picking Lists'), + _('Outstanding Sales Orders/Quotations'), + _('Special Order'), + _('Recurring Order Template'), + _('Process Recurring Orders') + ); +$MenuItems['orders']['Transactions']['URL'] = array( '/SelectOrderItems.php?NewOrder=Yes', + '/CounterSales.php', + '/PDFPickingList.php', + '/SelectSalesOrder.php', + '/SpecialOrder.php', + '/SelectRecurringSalesOrder.php', + '/RecurringSalesOrdersProcess.php' + ); + +$MenuItems['orders']['Reports']['Caption'] = array( _('Order Inquiry'), + _('Print Price Lists'), + _('Order Status Report'), + _('Orders Invoiced Reports'), + _('Daily Sales Inquiry'), + _('Sales By Sales Type Inquiry'), + _('Sales By Category Inquiry'), + _('Top Sellers Inquiry'), + _('Order Delivery Differences Report'), + _('Delivery In Full On Time (DIFOT) Report'), + _('Sales Order Detail Or Summary Inquiries'), + _('Top Sales Items Report'), + _('Sales With Low Gross Profit Report') + ); + +$MenuItems['orders']['Reports']['URL'] = array( '/SelectCompletedOrder.php', + '/PDFPriceList.php', + '/PDFOrderStatus.php', + '/PDFOrdersInvoiced.php', + '/DailySalesInquiry.php', + '/SalesByTypePeriodInquiry.php', + '/SalesCategoryPeriodInquiry.php', + '/SalesTopItemsInquiry.php', + '/PDFDeliveryDifferences.php', + '/PDFDIFOT.php', + '/SalesInquiry.php', + '/TopItems.php', + '/PDFLowGP.php' + ); + +$MenuItems['orders']['Maintenance']['Caption'] = array( _('Select Contract'), + _('Create Contract') + ); + +$MenuItems['orders']['Maintenance']['URL'] = array( '/SelectContract.php', + '/Contracts.php' + ); + +$MenuItems['AR']['Transactions']['Caption'] = array (_('Select Order to Invoice'), + _('Create A Credit Note'), + _('Enter Receipts'), + _('Allocate Receipts or Credit Notes') + ); +$MenuItems['AR']['Transactions']['URL'] = array ('/SelectSalesOrder.php', + '/SelectCreditItems.php?NewCredit=Yes', + '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer', + '/CustomerAllocations.php' + ); + +$MenuItems['AR']['Reports']['Caption'] = array (_('Where Allocated Inquiry'), + _('Print Invoices or Credit Notes'), + _('Print Statements'), + _('Sales Analysis Reports'), + _('Aged Customer Balances/Overdues Report'), + _('Re-Print A Deposit Listing'), + _('Debtor Balances At A Prior Month End'), + _('Customer Listing By Area/Salesperson'), + _('Sales Graphs'), + _('List Daily Transactions'), + _('Customer Transaction Inquiries') + ); + +$MenuItems['AR']['Reports']['URL'] = array ('/CustWhereAlloc.php', + '/PrintCustTrans.php', + '/PrintCustStatements.php', + '/SalesAnalRepts.php', + '/AgedDebtors.php', + '/PDFBankingSummary.php', + '/DebtorsAtPeriodEnd.php', + '/PDFCustomerList.php', + '/SalesGraph.php', + '/PDFCustTransListing.php', + '/CustomerTransInquiry.php' + ); + +$MenuItems['AR']['Maintenance']['Caption'] = array (_('Add Customer'), + _('Customers') + ); +$MenuItems['AR']['Maintenance']['URL'] = array ('/Customers.php', + '/SelectCustomer.php' + ); + +$MenuItems['AP']['Transactions']['Caption'] = array (_('Select Supplier'), + _('Supplier Allocations') + ); +$MenuItems['AP']['Transactions']['URL'] = array ('/SelectSupplier.php', + '/SupplierAllocations.php' + ); + +$MenuItems['AP']['Reports']['Caption'] = array (_('Aged Supplier Report'), + _('Payment Run Report'), + _('Remittance Advices'), + _('Outstanding GRNs Report'), + _('Supplier Balances At A Prior Month End'), + _('List Daily Transactions'), + _('Supplier Transaction Inquiries') + ); + +$MenuItems['AP']['Reports']['URL'] = array ('/AgedSuppliers.php', + '/SuppPaymentRun.php', + '/PDFRemittanceAdvice.php', + '/OutstandingGRNs.php', + '/SupplierBalsAtPeriodEnd.php', + '/PDFSuppTransListing.php', + '/SupplierTransInquiry.php' + ); + +$MenuItems['AP']['Maintenance']['Caption'] = array (_('Add Supplier'), + _('Maintain Factor Companies') + ); +$MenuItems['AP']['Maintenance']['URL'] = array ('/Suppliers.php', + '/Factors.php' + ); + +$MenuItems['PO']['Transactions']['Caption'] = array (_('Purchase Orders'), + _('Add Purchase Order'), + _('Create a New Tender'), + _('Edit Existing Tenders'), + _('Process Tenders and Offers'), + _('Orders to Authorise'), + _('Shipment Entry'), + _('Select A Shipment') + ); +$MenuItems['PO']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', + '/PO_Header.php?NewOrder=Yes', + '/SupplierTenderCreate.php?New=Yes', + '/SupplierTenderCreate.php?Edit=Yes', + '/OffersReceived.php', + '/PO_AuthoriseMyOrders.php', + '/SelectSupplier.php', + '/Shipt_Select.php' + ); + +$MenuItems['PO']['Reports']['Caption'] = array (_('Purchase Order Inquiry'), + _('Purchase Order Detail Or Summary Inquiries'), + _('Supplier Price List') + ); + +$MenuItems['PO']['Reports']['URL'] = array ('/PO_SelectPurchOrder.php', + '/POReport.php', + '/SuppPriceList.php' + ); + +$MenuItems['PO']['Maintenance']['Caption'] = array ( + ); +$MenuItems['PO']['Maintenance']['URL'] = array ( + ); +$MenuItems['stock']['Transactions']['Caption'] = array (_('Receive Purchase Orders'), + _('Bulk Inventory Transfer') . ' - ' . _('Dispatch'), + _('Bulk Inventory Transfer') . ' - ' . _('Receive'), + _('Inventory Location Transfers'), + _('Inventory Adjustments'), + _('Reverse Goods Received'), + _('Enter Stock Counts') + ); +$MenuItems['stock']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', + '/StockLocTransfer.php', + '/StockLocTransferReceive.php', + '/StockTransfers.php?New=Yes', + '/StockAdjustments.php?NewAdjustment=Yes', + '/ReverseGRN.php', + '/StockCounts.php' + ); + +$MenuItems['stock']['Reports']['Caption'] = array (_('Serial Item Research Tool'), + _('Print Price Labels'), + _('Reprint GRN'), + _('Inventory Item Movements'), + _('Inventory Item Status'), + _('Inventory Item Usage'), + _('Inventory Quantities'), + _('Reorder Level'), + _('Stock Dispatch'), + _('Inventory Valuation Report'), + _('Inventory Planning Report'), + _('Inventory Planning Based On Preferred Supplier Data'), + _('Inventory Stock Check Sheets'), + _('Make Inventory Quantities CSV'), + _('Compare Counts Vs Stock Check Data'), + _('All Inventory Movements By Location/Date'), + _('List Inventory Status By Location/Category'), + _('Historical Stock Quantity By Location/Category'), + _('List Negative Stocks'), + _('Period Stock Transaction Listing'), + _('Stock Transfer Note') + ); + +$MenuItems['stock']['Reports']['URL'] = array ('/StockSerialItemResearch.php', + '/PDFPrintLabel.php', + '/ReprintGRN.php', + '/StockMovements.php', + '/StockStatus.php', + '/StockUsage.php', + '/InventoryQuantities.php', + '/ReorderLevel.php', + '/StockDispatch.php', + '/InventoryValuation.php', + '/InventoryPlanning.php', + '/InventoryPlanningPrefSupplier.php', + '/StockCheck.php', + '/StockQties_csv.php', + '/PDFStockCheckComparison.php', + '/StockLocMovements.php', + '/StockLocStatus.php', + '/StockQuantityByDate.php', + '/PDFStockNegatives.php', + '/PDFPeriodStockTransListing.php', + '/PDFStockTransfer.php' + ); + +$MenuItems['stock']['Maintenance']['Caption'] = array (_('Add A New Item'), + _('Select An Item'), + _('Sales Category Maintenance'), + _('Add or Update Prices Based On Costs'), + _('View or Update Prices Based On Costs'), + _('Reorder Level By Category/Location') + ); +$MenuItems['stock']['Maintenance']['URL'] = array ('/Stocks.php', + '/SelectProduct.php', + '/SalesCategories.php', + '/PricesBasedOnMarkUp.php', + '/PricesByCost.php', + '/ReorderLevelLocation.php' + ); + +$MenuItems['manuf']['Transactions']['Caption'] = array (_('Work Order Entry'), + _('Select A Work Order') + ); +$MenuItems['manuf']['Transactions']['URL'] = array ('/WorkOrderEntry.php', + '/SelectWorkOrder.php' + ); + +$MenuItems['manuf']['Reports']['Caption'] = array (_('Select A Work Order'), + _('Costed Bill Of Material Inquiry'), + _('Where Used Inquiry'), + _('Bill Of Material Listing'), + _('Indented Bill Of Material Listing'), + _('List Components Required'), + _('Indented Where Used Listing'), + _('MRP'), + _('MRP Shortages'), + _('MRP Suggested Purchase Orders'), + _('MRP Suggested Work Orders'), + _('MRP Reschedules Required') + ); + +$MenuItems['manuf']['Reports']['URL'] = array ('/WorkOrderEntry.php', + '/BOMInquiry.php', + '/WhereUsedInquiry.php', + '/BOMListing.php', + '/BOMIndented.php', + '/BOMExtendedQty.php', + '/BOMIndentedReverse.php', + '/MRPReport.php', + '/MRPShortages.php', + '/MRPPlannedPurchaseOrders.php', + '/MRPPlannedWorkOrders.php', + '/MRPReschedules.php' + ); + +$MenuItems['manuf']['Maintenance']['Caption'] = array (_('Work Centre'), + _('Bills Of Material'), + _('Master Schedule'), + _('Auto Create Master Schedule'), + _('MRP Calculation') + ); + +$MenuItems['manuf']['Maintenance']['URL'] = array ('/WorkCentres.php', + '/BOMs.php', + '/MRPDemands.php', + '/MRPCreateDemands.php', + '/MRP.php' + ); + +$MenuItems['GL']['Transactions']['Caption'] = array (_('Bank Account Payments Entry'), + _('Bank Account Receipts Entry'), + _('Journal Entry'), + _('Bank Account Payments Matching'), + _('Bank Account Receipts Matching') + ); + +$MenuItems['GL']['Transactions']['URL'] = array ('/Payments.php?NewPayment=Yes', + '/CustomerReceipt.php?NewReceipt=Yes&Type=GL', + '/GLJournal.php?NewJournal=Yes', + '/BankMatching.php?Type=Payments', + '/BankMatching.php?Type=Receipts' + ); + +$MenuItems['GL']['Reports']['Caption'] = array (_('Trial Balance'), + _('Account Inquiry'), + _('Account Listing'), + _('Account Listing to CSV File'), + _('Bank Account Reconciliation Statement'), + _('Cheque Payments Listing'), + _('Daily Bank Transactions'), + _('Profit and Loss Statement'), + _('Balance Sheet'), + _('Tag Reports'), + _('Tax Reports') + ); + +$MenuItems['GL']['Reports']['URL'] = array ('/GLTrialBalance.php', + '/SelectGLAccount.php', + '/GLAccountReport.php', + '/GLAccountCSV.php', + '/BankReconciliation.php', + '/PDFChequeListing.php', + '/DailyBankTransactions.php', + '/GLProfit_Loss.php', + '/GLBalanceSheet.php', + '/GLTagProfit_Loss.php', + '/Tax.php' + ); + +$MenuItems['GL']['Maintenance']['Caption'] = array (_('GL Account'), + _('GL Budgets'), + _('Account Groups'), + _('Account Sections'), + _('GL Tags') + ); + +$MenuItems['GL']['Maintenance']['URL'] = array ('/GLAccounts.php', + '/GLBudgets.php', + '/AccountGroups.php', + '/AccountSections.php', + '/GLTags.php' + ); + +$MenuItems['FA']['Transactions']['Caption'] = array (_('Add a new Asset'), + _('Select an Asset'), + _('Change Asset Location'), + _('Depreciation Journal') + ); + +$MenuItems['FA']['Transactions']['URL'] = array ('/FixedAssetItems.php', + '/SelectAsset.php', + '/FixedAssetTransfer.php', + '/FixedAssetDepreciation.php' + ); + +$MenuItems['FA']['Reports']['Caption'] = array (_('Asset Register'), + ); + +$MenuItems['FA']['Reports']['URL'] = array ('/FixedAssetRegister.php', + ); + +$MenuItems['FA']['Maintenance']['Caption'] = array (_('Asset Categories Maintenance'), + _('Add or Maintain Asset Locations') + ); + +$MenuItems['FA']['Maintenance']['URL'] = array ('/FixedAssetCategories.php', + '/FixedAssetLocations.php' + ); + +$MenuItems['PC']['Transactions']['Caption'] = array (_('Assign Cash to PC Tab'), + _('Claim Expenses From PC Tab'), + _('Expenses Authorisation') + ); + +$MenuItems['PC']['Transactions']['URL'] = array ('/PcAssignCashToTab.php', + '/PcClaimExpensesFromTab.php', + '/PcAuthorizeExpenses.php' + ); + +$MenuItems['PC']['Reports']['Caption'] = array (_('PC Tab General Report'), + ); + +$MenuItems['PC']['Reports']['URL'] = array ('/PcReportTab.php', + ); + +$MenuItems['PC']['Maintenance']['Caption'] = array (_('Types of PC Tabs'), + _('PC Tabs'), + _('PC Expenses'), + _('Expenses for Type of PC Tab') + ); + +$MenuItems['PC']['Maintenance']['URL'] = array ('/PcTypeTabs.php', + '/PcTabs.php', + '/PcExpenses.php', + '/PcExpensesTypeTab.php' + ); + +$MenuItems['system']['Transactions']['Caption'] = array (_('Company Preferences'), + _('Configuration Settings'), + _('User Maintenance'), + _('Maintain Security Tokens'), + _('Role Permissions'), + _('Page Security Settings'), + _('Bank Accounts'), + _('Currency Maintenance'), + _('Tax Authorities and Rates Maintenance'), + _('Tax Group Maintenance'), + _('Dispatch Tax Province Maintenance'), + _('Tax Category Maintenance'), + _('List Periods Defined'), + _('Report Builder Tool'), + _('View Audit Trail'), + _('Geocode Setup'), + _('Form Layout Editor'), + _('Label Templates Maintenance'), + _('SMTP Server Details') + ); + +$MenuItems['system']['Transactions']['URL'] = array ('/CompanyPreferences.php', + '/SystemParameters.php', + '/WWW_Users.php', + '/SecurityTokens.php', + '/WWW_Access.php', + '/PageSecurity.php', + '/BankAccounts.php', + '/Currencies.php', + '/TaxAuthorities.php', + '/TaxGroups.php', + '/TaxProvinces.php', + '/TaxCategories.php', + '/PeriodsInquiry.php', + '/reportwriter/admin/ReportCreator.php', + '/AuditTrail.php', + '/GeocodeSetup.php', + '/FormDesigner.php', + '/Labels.php', + '/SMTPServer.php' + ); + +$MenuItems['system']['Reports']['Caption'] = array (_('Sales Types'), + _('Customer Types'), + _('Supplier Types'), + _('Credit Status'), + _('Payment Terms'), + _('Set Purchase Order Authorisation levels'), + _('Payment Methods'), + _('Sales People'), + _('Sales Areas'), + _('Shippers'), + _('Sales GL Interface Postings'), + _('COGS GL Interface Postings'), + _('Freight Costs Maintenance'), + _('Discount Matrix') + ); + +$MenuItems['system']['Reports']['URL'] = array ('/SalesTypes.php', + '/CustomerTypes.php', + '/SupplierTypes.php', + '/CreditStatus.php', + '/PaymentTerms.php', + '/PO_AuthorisationLevels.php', + '/PaymentMethods.php', + '/SalesPeople.php', + '/Areas.php', + '/Shippers.php', + '/SalesGLPostings.php', + '/COGSGLPostings.php', + '/FreightCosts.php', + '/DiscountMatrix.php' + ); + +$MenuItems['system']['Maintenance']['Caption'] = array (_('Inventory Categories Maintenance'), + _('Inventory Locations Maintenance'), + _('Discount Category Maintenance'), + _('Units of Measure'), + _('MRP Available Production Days'), + _('MRP Demand Types') + ); + +$MenuItems['system']['Maintenance']['URL'] = array ('/StockCategories.php', + '/Locations.php', + '/DiscountCategories.php', + '/UnitsOfMeasure.php', + '/MRPCalendar.php', + '/MRPDemandTypes.php' + ); +?> \ No newline at end of file Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/footer.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -2,34 +2,23 @@ /* $Id$*/ - echo '</td>'; - echo '</tr>'; - echo '</table>'; +echo '<table width="100%" id="footer">'; - echo '</td></tr>'; -/*Do the borders */ +echo '<tr>'; +echo '<td style="width:33%"></td><td class="footer">'; +echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © webrp.org - ' . date('Y') . '" /></td>'; +echo '<td class="footer" style="text-align: right;width:33%">'.(strftime('%A')).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M'))).'</td>'; - echo '</table>'; - - echo '<table width="100%" id="footer">'; - echo '<tr> - <td width="29%"> </td> - <td class="footer"><a href="http://www.weberp.org" rel="external"><img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" /></a></td> - <td class="footer">'.(strftime('%A')).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M'))).'</td> - </tr>'; +echo '</tr>'; - echo '<tr> - <td class="footer"> </td> - <td class="footer">webERP v' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © weberp.org 2002 - '.date('Y').'</td> - </tr>'; +echo '<tr><td colspan="3" class="footer">webERP v' . $_SESSION['VersionNumber'] . '</td></tr>'; - if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) { - echo '<tr> - <td class="footer"></td> - <td class="footer"><a href="https://sourceforge.net/projects/web-erp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=70949&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td> - </tr>'; - } - echo '</table>'; - echo '</body>'; - echo '</html>'; -?> +// if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) { +// echo '<tr><td class="footer"><a href="https://sourceforge.net/projects/weberp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=391629&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td></tr>'; +// } + +echo '</table>'; + +echo '</body>'; +echo '</html>'; +?> \ No newline at end of file Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/header.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -3,13 +3,9 @@ // Titles and screen header // Needs the file config.php loaded where the variables are defined for + // $rootpath // $title - should be defined in the page this file is included with - if (!isset($rootpath)){ - $rootpath = dirname(htmlspecialchars($_SERVER['PHP_SELF'])); - if ($rootpath == '/' OR $rootpath == "\\") { - $rootpath = ''; - } - } + $StrictXHTML=False; if (!headers_sent()){ @@ -22,6 +18,7 @@ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; + echo '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>' . $title . '</title>'; echo '<link rel="shortcut icon" href="'. $rootpath.'/favicon.ico" />'; echo '<link rel="icon" href="' . $rootpath.'/favicon.ico" />'; @@ -39,39 +36,32 @@ echo '<tr>'; echo '<td colspan="2" rowspan="2">'; - echo '<table class="main_page" cellpadding="0" cellspacing="0">'; - echo '<tr>'; - echo '<td>'; - echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" >'; - echo '<tr>'; - echo '<td>'; - if (isset($title)) { echo '<table cellpadding="0" cellspacing="0" border="0" id="quick_menu" class="quick_menu">'; echo '<tr>'; echo '<td align="left" style="width:100%;" class="quick_menu_left">'; -// Use icons for company and user data, saves screen realestate, use ALT tag in case theme icon not avail. - echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" alt="' . _('Company') . '"></img>'; - echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="User" alt="' . _('User') . '"></img>' . stripslashes($_SESSION['UsersRealName']) . '</a>'; +// Use icons for company and user data, saves screen realestate, use alt tag in case theme icon not avail. + echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" alt="' . _('Company') . '" />'; + echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="User" alt="' . _('User') . '" />' . stripslashes($_SESSION['UsersRealName']) . '</a>'; // Make the title text a class, can be set to display:none is some themes - echo '<br /><p class="header_title"> ' . $title . '</p></td>'; + echo '<br />' . $title . '</td>'; echo '<td class="quick_menu_tabs">'; echo '<table cellpadding="0" cellspacing="0" class="quick_menu_tabs"><tr>'; - echo '<td class="quick_menu_tab" align="center"><a accesskey="1" href="' . $rootpath . '/index.php"><span style="text-decoration:underline;">1</span> ' . _('Main Menu') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/index.php"><span style="text-decoration:underline;">1</span> ' . _('Main Menu') . '</a></td>'; if (count($_SESSION['AllowedPageSecurityTokens'])>1){ - echo '<td class="quick_menu_tab" align="center"><a accesskey="2" href="' . $rootpath . '/SelectCustomer.php"><span style="text-decoration:underline;">2</span> ' . _('Customers') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/SelectCustomer.php"><span style="text-decoration:underline;">2</span> ' . _('Customers') . '</a></td>'; - echo '<td class="quick_menu_tab" align="center"><a accesskey="3" href="' . $rootpath . '/SelectProduct.php"><span style="text-decoration:underline;">3</span> ' . _('Items') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/SelectProduct.php"><span style="text-decoration:underline;">3</span> ' . _('Items') . '</a></td>'; - echo '<td class="quick_menu_tab" align="center"><a accesskey="4" href="' . $rootpath . '/SelectSupplier.php"><span style="text-decoration:underline;">4</span> ' . _('Suppliers') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/SelectSupplier.php"><span style="text-decoration:underline;">4</span> ' . _('Suppliers') . '</a></td>'; - $DefaultManualLink = '<td class="quick_menu_tab" align="center"><a rel="external" accesskey="8" href="' . $rootpath . '/doc/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; + $DefaultManualLink = '<td class="quick_menu_tab" align="center"><a rel="external" href="' . $rootpath . '/doc/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; if (mb_substr($_SESSION['Language'],0,2) !='en'){ if (file_exists('locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php')){ - echo '<td class="quick_menu_tab" align="center"><a target="_blank" accesskey="8" href="' . $rootpath . '/locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a target="_blank" href="' . $rootpath . '/locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; } else { echo $DefaultManualLink; } @@ -80,7 +70,7 @@ } } - echo '<td class="quick_menu_tab" align="center"><a accesskey="0" href="' . $rootpath . '/Logout.php" onclick="return confirm(\'' . _('Are you sure you wish to logout?') . '\');"><span style="text-decoration:underline;">0</span> ' . _('Logout') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/Logout.php" onclick="return confirm(\'' . _('Are you sure you wish to logout?') . '\');"><span style="text-decoration:underline;">0</span> ' . _('Logout') . '</a></td>'; echo '</tr></table>'; echo '</td></tr></table>'; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/session.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -21,10 +21,10 @@ ini_set('session.gc_Maxlifetime',$SessionLifeTime); -if( !ini_get('safe_mode') ){ - set_time_limit($MaximumExecutionTime); +if( !ini_get('safe_mode') ){ + set_time_limit($MaximumExecutionTime); ini_set('max_execution_time',$MaximumExecutionTime); -} +} session_write_close(); //in case a previous session is not closed session_start(); @@ -75,7 +75,7 @@ if (!isset($AllowAnyone)){ /* only do security checks if AllowAnyone is not true */ - + include $PathPrefix . 'includes/UserLogin.php'; /* Login checking and setup */ if (isset($_POST['UserNameEntryField']) and isset($_POST['Password'])) { @@ -125,9 +125,9 @@ include($PathPrefix . 'includes/GetConfig.php'); /*The page security variable is now retrieved from the database in GetConfig.php and stored in the $SESSION['PageSecurityArray'] array - * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) + * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) */ -if (!isset($PageSecurity)){ +if (!isset($PageSecurity)){ //only hardcoded in the UpgradeDatabase script - so old versions that don't have the scripts.pagesecurity field do not choke $PageSecurity = $_SESSION['PageSecurityArray'][basename($_SERVER['SCRIPT_NAME'])]; } @@ -273,17 +273,6 @@ exit; } -/* Nasty kludge to allow Supplier only logins as well as Customer logins */ -if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND - $_SESSION['AllowedPageSecurityTokens'][0]==9 AND $PageSecurity==1){ - - $_SESSION['AllowedPageSecurityTokens'][0]=1; - $SupplierLogin=1; -} else { - $SupplierLogin=0; -} - - if (!isset($AllowAnyone)){ if ((!in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { $title = _('Security Permissions Problem'); @@ -305,12 +294,12 @@ } } -/* Nasty kludge to allow Supplier only logins as well as Customer logins - .... hmmmmm some work to do here then! */ -if ($SupplierLogin==1) { - $_SESSION['AllowedPageSecurityTokens'][0]=9; +if (in_array(9,$_SESSION['AllowedPageSecurityTokens']) and $PageSecurity==0 and count($_SESSION['AllowedPageSecurityTokens'])==2){ + $SupplierLogin=1; +} else if (in_array(1,$_SESSION['AllowedPageSecurityTokens']) and $PageSecurity==0 and count($_SESSION['AllowedPageSecurityTokens'])==2){ + $SupplierLogin=0; } - if (in_array(15, $_SESSION['AllowedPageSecurityTokens'])) { /*System administrator login */ $debug = 1; //allow debug messages } else { Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/index.php 2012-02-15 16:24:39 UTC (rev 4909) @@ -1,1533 +1,190 @@ <?php +$PageSecurity=0; -/* $Id$*/ - include('includes/session.inc'); $title=_('Main Menu'); +include('includes/header.inc'); /*The module link codes are hard coded in a switch statement below to determine the options to show for each tab */ -$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); -/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ -$ModuleList = array(_('Sales'), - _('Receivables'), - _('Payables'), - _('Purchases'), - _('Inventory'), - _('Manufacturing'), - _('General Ledger'), - _('Asset Manager'), - _('Petty Cash'), - _('Setup')); +include('includes/IndexArray.php'); -if (isset($_GET['Application'])){ /*This is sent by this page (to itself) when the user clicks on a tab */ - $_SESSION['Module'] = $_GET['Application']; -} - -include('includes/header.inc'); - -if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND $SupplierLogin==0){ - -/* if there is only one security access and its 1 (it has to be 1 for this page came up at all)- it must be a customer log on - * need to limit the menu to show only the customer accessible stuff this is what the page looks like for customers logging in - */ -?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table class="table_index"> +if (isset($SupplierLogin) and $SupplierLogin==1){ + echo '<table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=1">' . _('View or Amend outstanding offers') . '</a></p> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=2">' . _('Create a new offer') . '</a></p> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=3">' . _('View any open tenders without an offer') . '</a></p> </td> </tr> - </table> - </td> -<?php + </table>'; include('includes/footer.inc'); exit; -} else if (count($_SESSION['AllowedPageSecurityTokens'])==1 and $SupplierLogin==1){ -?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table class="table_index"> +} elseif (isset($SupplierLogin) and $SupplierLogin==0){ + echo '<table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php">' . _('Supplier Tenders') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p> </td> </tr> - </table> - </td> -<?php -} else { /* Security settings DO allow seeing the main menu */ - -?> - <table width="100%"><td width="10%" valign="top"><table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0"> - - <?php - - - $i=0; - - while ($i < count($ModuleLink)){ - - // This determines if the user has display access to the module see config.php and header.inc - // for the authorisation and security code - if ($_SESSION['ModulesEnabled'][$i]==1) { - - // If this is the first time the application is loaded then it is possible that - // SESSION['Module'] is not set if so set it to the first module that is enabled for the user - if (!isset($_SESSION['Module'])OR $_SESSION['Module']==''){ - $_SESSION['Module']=$ModuleLink[$i]; - } - if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; - } else { - echo '<tr><td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; - } - } - $i++; - } - - ?> - </table></td><td> - <?php - - - switch ($_SESSION['Module']) { - - case 'orders': //Sales Orders - ?> - - <table width="100%"> <tr> - <td class="menu_group_area"> - <table width="100%" > - - <?php - // displays the main area headings - OptionHeadings(); - ?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CounterSales.php">' . _('Enter Counter Sales') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPickingList.php">' . _('Print Picking Lists') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectRecurringSalesOrder.php">' . _('Recurring Order Template') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/RecurringSalesOrdersProcess.php">' . _('Process Recurring Orders') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- Orders Inquiry options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php">' . _('Order Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php">' . _('Print Price Lists') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php">' . _('Order Status Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php">' . _('Orders Invoiced Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php">' . _('Daily Sales Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesByTypePeriodInquiry.php">' . _('Sales By Sales Type Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesCategoryPeriodInquiry.php">' . _('Sales By Category Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesTopItemsInquiry.php">' . _('Top Sellers Inquiry') . '</a></p>'; ?> - </td> - </tr> - - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php">' . _('Order Delivery Differences Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php">' . _('Top Sales Items Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ord'); ?> - </td> - </tr> - </table> - </td> - - <td class="menu_group_items"> <!-- Orders Maintenance options --> - <table width="100%" class="table_index" > - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectContract.php">' . _('Select Contract') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Contracts.php">' . _('Create Contract') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Place An Order') . '</a></p> </td> </tr> - </table> - <?php - break; - /* ****************** END OF ORDERS MENU ITEMS **************************** */ - - - Case 'AR': //Debtors Module - - unset($ReceiptBatch); - unset($AllocTrans); - - ?> - <table width="100%"> <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Select Order to Invoice') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - - <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php">' . _('Where Allocated Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php - if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; - } else { - echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; - } - ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php">' . _('Print Statements') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php">' . _('Sales Analysis Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php">' . _('Sales Graphs') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ar'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Customers.php">' . _('Add Customer') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php">' . _('Customers') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p> </td> </tr> - </table> - <?php + </table>'; + include('includes/footer.inc'); + exit; +} - /* ********************* END OF AR OPTIONS **************************** */ - break; +if (isset($_GET['Application'])){ /*This is sent by this page (to itself) when the user clicks on a tab */ + $_SESSION['Module'] = $_GET['Application']; +} - Case 'AP': //Creditors Module +echo '<table width="99%"> + <tr> + <td style="width:10%" valign="top">'; +echo '<table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0">'; - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> + $i=0; - <?php OptionHeadings(); ?> +while ($i < count($ModuleLink)){ - <tr> - <td class="menu_group_items"> <!-- AP transaction options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Select Supplier') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierAllocations.php">' . _('Supplier Allocations') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- AP Inquiries --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php">' . _('Aged Supplier Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php">' . _('Payment Run Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php">' . _('Remittance Advices') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php">' . _('Outstanding GRNs Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTransInquiry.php">' . _('Supplier Transaction Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ap'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- AP Maintenance Options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php">' . _('Add Supplier') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Factors.php">' . _('Maintain Factor Companies') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; + // This determines if the user has display access to the module see config.php and header.inc + // for the authorisation and security code + if ($_SESSION['ModulesEnabled'][$i]==1) { + // If this is the first time the application is loaded then it is possible that + // SESSION['Module'] is not set if so set it to the first module that is enabled for the user + if (!isset($_SESSION['Module'])OR $_SESSION['Module']==''){ + $_SESSION['Module']=$ModuleLink[$i]; + } + if ($ModuleLink[$i] == $_SESSION['Module']){ + echo '<tr><td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + } else { + echo '<tr><td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + } + } + $i++; +} - Case 'PO': /* Purchase Ordering */ +echo '</table>'; - ?> - <table width="100%"> +echo '</td>'; +echo '<td style="width:30%" valign="top">'; +if ($_SESSION['Module']=='system') { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/company.png" title="' . _('General Setup Options') . '" alt="' . _('General Setup Options') . '" /><b>' . _('General Setup Options') . '</b>'; +} else { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/transactions.png" title="' . _('Transactions') . '" alt="' . _('Transactions') . '" /><b>'. _('Transactions') . '</b>'; +} +echo ' <table width="100%" class="selection"> <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> + <td class="menu_group_headers"> + <div class="centre"> + ' . $Header . ' + </div> + </td> + </tr>'; - <?php OptionHeadings(); ?> +$i=0; +foreach ($MenuItems[$_SESSION['Module']]['Transactions']['Caption'] as $Caption) { +/* Transactions Menu Item */ + $ScriptNameArray = explode('?', substr($MenuItems[$_SESSION['Module']]['Transactions']['URL'][$i],1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + echo '<tr> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . $MenuItems[$_SESSION['Module']]['Transactions']['URL'][$i] .'">' . $Caption . '</a></p> + </td> + </tr>'; + } + $i++; +} +echo '</table>'; +echo '</td>'; - <tr> - <td class="menu_group_items"> <!-- PO Transactions --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Purchase Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_Header.php?&NewOrder=Yes">' . _('Add Purchase Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenderCreate.php?New=Yes">' . _('Create a New Tender') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenderCreate.php?Edit=Yes">' . _('Edit Existing Tenders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php">' . _('Process Tenders and Offers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php">' . _('Orders to Authorise') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Shipment Entry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php">' . _('Select A Shipment') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- PO Inquiries and Reports --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php">' . _('Purchase Order Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/POReport.php">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPriceList.php">' . _('Supplier Price List') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('prch'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- PO Maintenance --> - <table width="100%" class="table_index"> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - /* ****************************** END OF PURCHASING OPTIONS ******************************** */ - - - Case 'stock': //Inventory Module - - ?> - <table width="100%"> +echo '<td style="width:30%" valign="top">'; +if ($_SESSION['Module']=='system') { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/ar.png" title="' . _('Receivables/Payables Setup') . '" alt="' . _('Receivables/Payables Setup') . '" /><b>' . _('Receivables/Payables Setup') . '</b>'; +} else { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/reports.png" title="' . _('Inquiries and Reports') . '" alt="' . _('Inquiries and Reports') . '" /><b>'. _('Inquiries and Reports') . '</b>'; +} +echo ' <table width="100%" class="selection"> <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> + <td class="menu_group_headers"> + <div class="centre"> + ' . $Header . ' + </div> + </td> + </tr>'; +$i=0; +foreach ($MenuItems[$_SESSION['Module']]['Reports']['Caption'] as $Caption) { +/* Transactions Menu Item */ + $ScriptNameArray = explode('?', substr($MenuItems[$_SESSION['Module']]['Reports']['URL'][$i],1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + echo '<tr> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . $MenuItems[$_SESSION['Module']]['Reports']['URL'][$i] .'">' . $Caption . '</a></p> + </td> + </tr>'; + } + $i++; +} +echo GetRptLinks($_SESSION['Module']); +echo '</table>'; +echo '</td>'; - <?php OptionHeadings(); ?> - <tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Receive Purchase Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransfer.php">' . _('Bulk Inventory Transfer') . ' - ' . _('Dispatch') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?New=Yes">' . _('Inventory Location Transfers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">' . _('Inventory Adjustments') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php">' . _('Reverse Goods Received') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php">' . _('Enter Stock Counts') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> -... [truncated message content] |
From: <tim...@us...> - 2012-02-15 16:24:52
|
Revision: 4909 http://web-erp.svn.sourceforge.net/web-erp/?rev=4909&view=rev Author: tim_schofield Date: 2012-02-15 16:24:39 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Upload new menuing system moving menu items to an array, only showing items that the user has access to Modified Paths: -------------- trunk/UpgradeDatabase.php trunk/includes/ConnectDB.inc trunk/includes/footer.inc trunk/includes/header.inc trunk/includes/session.inc trunk/index.php Added Paths: ----------- trunk/includes/IndexArray.php trunk/sql/mysql/upgrade4.07-4.08.sql Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/UpgradeDatabase.php 2012-02-15 16:24:39 UTC (rev 4909) @@ -133,6 +133,8 @@ $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06.6': $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; + case '4.06.7': + $SQLScripts[] = './sql/mysql/upgrade4.07-4.08.sql'; case '4.07.0': break; } //end switch Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/ConnectDB.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.06.7'; //must update manually every time there is a DB change +$Version='4.07.1'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Added: trunk/includes/IndexArray.php =================================================================== --- trunk/includes/IndexArray.php (rev 0) +++ trunk/includes/IndexArray.php 2012-02-15 16:24:39 UTC (rev 4909) @@ -0,0 +1,515 @@ +<?php +$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); +$ReportList = array('orders'=>'ord', + 'AR'=>'ar', + 'AP'=>'ap', + 'PO'=>'prch', + 'stock'=>'inv', + 'manuf'=>'man', + 'GL'=>'gl', + 'FA'=>'fa', + 'PC'=>'pc', + 'system'=>'sys' + ); + +/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ +$ModuleList = array(_('Sales'), + _('Receivables'), + _('Payables'), + _('Purchases'), + _('Inventory'), + _('Manufacturing'), + _('General Ledger'), + _('Asset Manager'), + _('Petty Cash'), + _('Setup')); + +$MenuItems['orders']['Transactions']['Caption'] = array( _('Enter An Order or Quotation'), + _('Enter Counter Sales'), + _('Print Picking Lists'), + _('Outstanding Sales Orders/Quotations'), + _('Special Order'), + _('Recurring Order Template'), + _('Process Recurring Orders') + ); +$MenuItems['orders']['Transactions']['URL'] = array( '/SelectOrderItems.php?NewOrder=Yes', + '/CounterSales.php', + '/PDFPickingList.php', + '/SelectSalesOrder.php', + '/SpecialOrder.php', + '/SelectRecurringSalesOrder.php', + '/RecurringSalesOrdersProcess.php' + ); + +$MenuItems['orders']['Reports']['Caption'] = array( _('Order Inquiry'), + _('Print Price Lists'), + _('Order Status Report'), + _('Orders Invoiced Reports'), + _('Daily Sales Inquiry'), + _('Sales By Sales Type Inquiry'), + _('Sales By Category Inquiry'), + _('Top Sellers Inquiry'), + _('Order Delivery Differences Report'), + _('Delivery In Full On Time (DIFOT) Report'), + _('Sales Order Detail Or Summary Inquiries'), + _('Top Sales Items Report'), + _('Sales With Low Gross Profit Report') + ); + +$MenuItems['orders']['Reports']['URL'] = array( '/SelectCompletedOrder.php', + '/PDFPriceList.php', + '/PDFOrderStatus.php', + '/PDFOrdersInvoiced.php', + '/DailySalesInquiry.php', + '/SalesByTypePeriodInquiry.php', + '/SalesCategoryPeriodInquiry.php', + '/SalesTopItemsInquiry.php', + '/PDFDeliveryDifferences.php', + '/PDFDIFOT.php', + '/SalesInquiry.php', + '/TopItems.php', + '/PDFLowGP.php' + ); + +$MenuItems['orders']['Maintenance']['Caption'] = array( _('Select Contract'), + _('Create Contract') + ); + +$MenuItems['orders']['Maintenance']['URL'] = array( '/SelectContract.php', + '/Contracts.php' + ); + +$MenuItems['AR']['Transactions']['Caption'] = array (_('Select Order to Invoice'), + _('Create A Credit Note'), + _('Enter Receipts'), + _('Allocate Receipts or Credit Notes') + ); +$MenuItems['AR']['Transactions']['URL'] = array ('/SelectSalesOrder.php', + '/SelectCreditItems.php?NewCredit=Yes', + '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer', + '/CustomerAllocations.php' + ); + +$MenuItems['AR']['Reports']['Caption'] = array (_('Where Allocated Inquiry'), + _('Print Invoices or Credit Notes'), + _('Print Statements'), + _('Sales Analysis Reports'), + _('Aged Customer Balances/Overdues Report'), + _('Re-Print A Deposit Listing'), + _('Debtor Balances At A Prior Month End'), + _('Customer Listing By Area/Salesperson'), + _('Sales Graphs'), + _('List Daily Transactions'), + _('Customer Transaction Inquiries') + ); + +$MenuItems['AR']['Reports']['URL'] = array ('/CustWhereAlloc.php', + '/PrintCustTrans.php', + '/PrintCustStatements.php', + '/SalesAnalRepts.php', + '/AgedDebtors.php', + '/PDFBankingSummary.php', + '/DebtorsAtPeriodEnd.php', + '/PDFCustomerList.php', + '/SalesGraph.php', + '/PDFCustTransListing.php', + '/CustomerTransInquiry.php' + ); + +$MenuItems['AR']['Maintenance']['Caption'] = array (_('Add Customer'), + _('Customers') + ); +$MenuItems['AR']['Maintenance']['URL'] = array ('/Customers.php', + '/SelectCustomer.php' + ); + +$MenuItems['AP']['Transactions']['Caption'] = array (_('Select Supplier'), + _('Supplier Allocations') + ); +$MenuItems['AP']['Transactions']['URL'] = array ('/SelectSupplier.php', + '/SupplierAllocations.php' + ); + +$MenuItems['AP']['Reports']['Caption'] = array (_('Aged Supplier Report'), + _('Payment Run Report'), + _('Remittance Advices'), + _('Outstanding GRNs Report'), + _('Supplier Balances At A Prior Month End'), + _('List Daily Transactions'), + _('Supplier Transaction Inquiries') + ); + +$MenuItems['AP']['Reports']['URL'] = array ('/AgedSuppliers.php', + '/SuppPaymentRun.php', + '/PDFRemittanceAdvice.php', + '/OutstandingGRNs.php', + '/SupplierBalsAtPeriodEnd.php', + '/PDFSuppTransListing.php', + '/SupplierTransInquiry.php' + ); + +$MenuItems['AP']['Maintenance']['Caption'] = array (_('Add Supplier'), + _('Maintain Factor Companies') + ); +$MenuItems['AP']['Maintenance']['URL'] = array ('/Suppliers.php', + '/Factors.php' + ); + +$MenuItems['PO']['Transactions']['Caption'] = array (_('Purchase Orders'), + _('Add Purchase Order'), + _('Create a New Tender'), + _('Edit Existing Tenders'), + _('Process Tenders and Offers'), + _('Orders to Authorise'), + _('Shipment Entry'), + _('Select A Shipment') + ); +$MenuItems['PO']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', + '/PO_Header.php?NewOrder=Yes', + '/SupplierTenderCreate.php?New=Yes', + '/SupplierTenderCreate.php?Edit=Yes', + '/OffersReceived.php', + '/PO_AuthoriseMyOrders.php', + '/SelectSupplier.php', + '/Shipt_Select.php' + ); + +$MenuItems['PO']['Reports']['Caption'] = array (_('Purchase Order Inquiry'), + _('Purchase Order Detail Or Summary Inquiries'), + _('Supplier Price List') + ); + +$MenuItems['PO']['Reports']['URL'] = array ('/PO_SelectPurchOrder.php', + '/POReport.php', + '/SuppPriceList.php' + ); + +$MenuItems['PO']['Maintenance']['Caption'] = array ( + ); +$MenuItems['PO']['Maintenance']['URL'] = array ( + ); +$MenuItems['stock']['Transactions']['Caption'] = array (_('Receive Purchase Orders'), + _('Bulk Inventory Transfer') . ' - ' . _('Dispatch'), + _('Bulk Inventory Transfer') . ' - ' . _('Receive'), + _('Inventory Location Transfers'), + _('Inventory Adjustments'), + _('Reverse Goods Received'), + _('Enter Stock Counts') + ); +$MenuItems['stock']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', + '/StockLocTransfer.php', + '/StockLocTransferReceive.php', + '/StockTransfers.php?New=Yes', + '/StockAdjustments.php?NewAdjustment=Yes', + '/ReverseGRN.php', + '/StockCounts.php' + ); + +$MenuItems['stock']['Reports']['Caption'] = array (_('Serial Item Research Tool'), + _('Print Price Labels'), + _('Reprint GRN'), + _('Inventory Item Movements'), + _('Inventory Item Status'), + _('Inventory Item Usage'), + _('Inventory Quantities'), + _('Reorder Level'), + _('Stock Dispatch'), + _('Inventory Valuation Report'), + _('Inventory Planning Report'), + _('Inventory Planning Based On Preferred Supplier Data'), + _('Inventory Stock Check Sheets'), + _('Make Inventory Quantities CSV'), + _('Compare Counts Vs Stock Check Data'), + _('All Inventory Movements By Location/Date'), + _('List Inventory Status By Location/Category'), + _('Historical Stock Quantity By Location/Category'), + _('List Negative Stocks'), + _('Period Stock Transaction Listing'), + _('Stock Transfer Note') + ); + +$MenuItems['stock']['Reports']['URL'] = array ('/StockSerialItemResearch.php', + '/PDFPrintLabel.php', + '/ReprintGRN.php', + '/StockMovements.php', + '/StockStatus.php', + '/StockUsage.php', + '/InventoryQuantities.php', + '/ReorderLevel.php', + '/StockDispatch.php', + '/InventoryValuation.php', + '/InventoryPlanning.php', + '/InventoryPlanningPrefSupplier.php', + '/StockCheck.php', + '/StockQties_csv.php', + '/PDFStockCheckComparison.php', + '/StockLocMovements.php', + '/StockLocStatus.php', + '/StockQuantityByDate.php', + '/PDFStockNegatives.php', + '/PDFPeriodStockTransListing.php', + '/PDFStockTransfer.php' + ); + +$MenuItems['stock']['Maintenance']['Caption'] = array (_('Add A New Item'), + _('Select An Item'), + _('Sales Category Maintenance'), + _('Add or Update Prices Based On Costs'), + _('View or Update Prices Based On Costs'), + _('Reorder Level By Category/Location') + ); +$MenuItems['stock']['Maintenance']['URL'] = array ('/Stocks.php', + '/SelectProduct.php', + '/SalesCategories.php', + '/PricesBasedOnMarkUp.php', + '/PricesByCost.php', + '/ReorderLevelLocation.php' + ); + +$MenuItems['manuf']['Transactions']['Caption'] = array (_('Work Order Entry'), + _('Select A Work Order') + ); +$MenuItems['manuf']['Transactions']['URL'] = array ('/WorkOrderEntry.php', + '/SelectWorkOrder.php' + ); + +$MenuItems['manuf']['Reports']['Caption'] = array (_('Select A Work Order'), + _('Costed Bill Of Material Inquiry'), + _('Where Used Inquiry'), + _('Bill Of Material Listing'), + _('Indented Bill Of Material Listing'), + _('List Components Required'), + _('Indented Where Used Listing'), + _('MRP'), + _('MRP Shortages'), + _('MRP Suggested Purchase Orders'), + _('MRP Suggested Work Orders'), + _('MRP Reschedules Required') + ); + +$MenuItems['manuf']['Reports']['URL'] = array ('/WorkOrderEntry.php', + '/BOMInquiry.php', + '/WhereUsedInquiry.php', + '/BOMListing.php', + '/BOMIndented.php', + '/BOMExtendedQty.php', + '/BOMIndentedReverse.php', + '/MRPReport.php', + '/MRPShortages.php', + '/MRPPlannedPurchaseOrders.php', + '/MRPPlannedWorkOrders.php', + '/MRPReschedules.php' + ); + +$MenuItems['manuf']['Maintenance']['Caption'] = array (_('Work Centre'), + _('Bills Of Material'), + _('Master Schedule'), + _('Auto Create Master Schedule'), + _('MRP Calculation') + ); + +$MenuItems['manuf']['Maintenance']['URL'] = array ('/WorkCentres.php', + '/BOMs.php', + '/MRPDemands.php', + '/MRPCreateDemands.php', + '/MRP.php' + ); + +$MenuItems['GL']['Transactions']['Caption'] = array (_('Bank Account Payments Entry'), + _('Bank Account Receipts Entry'), + _('Journal Entry'), + _('Bank Account Payments Matching'), + _('Bank Account Receipts Matching') + ); + +$MenuItems['GL']['Transactions']['URL'] = array ('/Payments.php?NewPayment=Yes', + '/CustomerReceipt.php?NewReceipt=Yes&Type=GL', + '/GLJournal.php?NewJournal=Yes', + '/BankMatching.php?Type=Payments', + '/BankMatching.php?Type=Receipts' + ); + +$MenuItems['GL']['Reports']['Caption'] = array (_('Trial Balance'), + _('Account Inquiry'), + _('Account Listing'), + _('Account Listing to CSV File'), + _('Bank Account Reconciliation Statement'), + _('Cheque Payments Listing'), + _('Daily Bank Transactions'), + _('Profit and Loss Statement'), + _('Balance Sheet'), + _('Tag Reports'), + _('Tax Reports') + ); + +$MenuItems['GL']['Reports']['URL'] = array ('/GLTrialBalance.php', + '/SelectGLAccount.php', + '/GLAccountReport.php', + '/GLAccountCSV.php', + '/BankReconciliation.php', + '/PDFChequeListing.php', + '/DailyBankTransactions.php', + '/GLProfit_Loss.php', + '/GLBalanceSheet.php', + '/GLTagProfit_Loss.php', + '/Tax.php' + ); + +$MenuItems['GL']['Maintenance']['Caption'] = array (_('GL Account'), + _('GL Budgets'), + _('Account Groups'), + _('Account Sections'), + _('GL Tags') + ); + +$MenuItems['GL']['Maintenance']['URL'] = array ('/GLAccounts.php', + '/GLBudgets.php', + '/AccountGroups.php', + '/AccountSections.php', + '/GLTags.php' + ); + +$MenuItems['FA']['Transactions']['Caption'] = array (_('Add a new Asset'), + _('Select an Asset'), + _('Change Asset Location'), + _('Depreciation Journal') + ); + +$MenuItems['FA']['Transactions']['URL'] = array ('/FixedAssetItems.php', + '/SelectAsset.php', + '/FixedAssetTransfer.php', + '/FixedAssetDepreciation.php' + ); + +$MenuItems['FA']['Reports']['Caption'] = array (_('Asset Register'), + ); + +$MenuItems['FA']['Reports']['URL'] = array ('/FixedAssetRegister.php', + ); + +$MenuItems['FA']['Maintenance']['Caption'] = array (_('Asset Categories Maintenance'), + _('Add or Maintain Asset Locations') + ); + +$MenuItems['FA']['Maintenance']['URL'] = array ('/FixedAssetCategories.php', + '/FixedAssetLocations.php' + ); + +$MenuItems['PC']['Transactions']['Caption'] = array (_('Assign Cash to PC Tab'), + _('Claim Expenses From PC Tab'), + _('Expenses Authorisation') + ); + +$MenuItems['PC']['Transactions']['URL'] = array ('/PcAssignCashToTab.php', + '/PcClaimExpensesFromTab.php', + '/PcAuthorizeExpenses.php' + ); + +$MenuItems['PC']['Reports']['Caption'] = array (_('PC Tab General Report'), + ); + +$MenuItems['PC']['Reports']['URL'] = array ('/PcReportTab.php', + ); + +$MenuItems['PC']['Maintenance']['Caption'] = array (_('Types of PC Tabs'), + _('PC Tabs'), + _('PC Expenses'), + _('Expenses for Type of PC Tab') + ); + +$MenuItems['PC']['Maintenance']['URL'] = array ('/PcTypeTabs.php', + '/PcTabs.php', + '/PcExpenses.php', + '/PcExpensesTypeTab.php' + ); + +$MenuItems['system']['Transactions']['Caption'] = array (_('Company Preferences'), + _('Configuration Settings'), + _('User Maintenance'), + _('Maintain Security Tokens'), + _('Role Permissions'), + _('Page Security Settings'), + _('Bank Accounts'), + _('Currency Maintenance'), + _('Tax Authorities and Rates Maintenance'), + _('Tax Group Maintenance'), + _('Dispatch Tax Province Maintenance'), + _('Tax Category Maintenance'), + _('List Periods Defined'), + _('Report Builder Tool'), + _('View Audit Trail'), + _('Geocode Setup'), + _('Form Layout Editor'), + _('Label Templates Maintenance'), + _('SMTP Server Details') + ); + +$MenuItems['system']['Transactions']['URL'] = array ('/CompanyPreferences.php', + '/SystemParameters.php', + '/WWW_Users.php', + '/SecurityTokens.php', + '/WWW_Access.php', + '/PageSecurity.php', + '/BankAccounts.php', + '/Currencies.php', + '/TaxAuthorities.php', + '/TaxGroups.php', + '/TaxProvinces.php', + '/TaxCategories.php', + '/PeriodsInquiry.php', + '/reportwriter/admin/ReportCreator.php', + '/AuditTrail.php', + '/GeocodeSetup.php', + '/FormDesigner.php', + '/Labels.php', + '/SMTPServer.php' + ); + +$MenuItems['system']['Reports']['Caption'] = array (_('Sales Types'), + _('Customer Types'), + _('Supplier Types'), + _('Credit Status'), + _('Payment Terms'), + _('Set Purchase Order Authorisation levels'), + _('Payment Methods'), + _('Sales People'), + _('Sales Areas'), + _('Shippers'), + _('Sales GL Interface Postings'), + _('COGS GL Interface Postings'), + _('Freight Costs Maintenance'), + _('Discount Matrix') + ); + +$MenuItems['system']['Reports']['URL'] = array ('/SalesTypes.php', + '/CustomerTypes.php', + '/SupplierTypes.php', + '/CreditStatus.php', + '/PaymentTerms.php', + '/PO_AuthorisationLevels.php', + '/PaymentMethods.php', + '/SalesPeople.php', + '/Areas.php', + '/Shippers.php', + '/SalesGLPostings.php', + '/COGSGLPostings.php', + '/FreightCosts.php', + '/DiscountMatrix.php' + ); + +$MenuItems['system']['Maintenance']['Caption'] = array (_('Inventory Categories Maintenance'), + _('Inventory Locations Maintenance'), + _('Discount Category Maintenance'), + _('Units of Measure'), + _('MRP Available Production Days'), + _('MRP Demand Types') + ); + +$MenuItems['system']['Maintenance']['URL'] = array ('/StockCategories.php', + '/Locations.php', + '/DiscountCategories.php', + '/UnitsOfMeasure.php', + '/MRPCalendar.php', + '/MRPDemandTypes.php' + ); +?> \ No newline at end of file Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/footer.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -2,34 +2,23 @@ /* $Id$*/ - echo '</td>'; - echo '</tr>'; - echo '</table>'; +echo '<table width="100%" id="footer">'; - echo '</td></tr>'; -/*Do the borders */ +echo '<tr>'; +echo '<td style="width:33%"></td><td class="footer">'; +echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © webrp.org - ' . date('Y') . '" /></td>'; +echo '<td class="footer" style="text-align: right;width:33%">'.(strftime('%A')).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M'))).'</td>'; - echo '</table>'; - - echo '<table width="100%" id="footer">'; - echo '<tr> - <td width="29%"> </td> - <td class="footer"><a href="http://www.weberp.org" rel="external"><img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" /></a></td> - <td class="footer">'.(strftime('%A')).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M'))).'</td> - </tr>'; +echo '</tr>'; - echo '<tr> - <td class="footer"> </td> - <td class="footer">webERP v' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © weberp.org 2002 - '.date('Y').'</td> - </tr>'; +echo '<tr><td colspan="3" class="footer">webERP v' . $_SESSION['VersionNumber'] . '</td></tr>'; - if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) { - echo '<tr> - <td class="footer"></td> - <td class="footer"><a href="https://sourceforge.net/projects/web-erp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=70949&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td> - </tr>'; - } - echo '</table>'; - echo '</body>'; - echo '</html>'; -?> +// if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) { +// echo '<tr><td class="footer"><a href="https://sourceforge.net/projects/weberp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=391629&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td></tr>'; +// } + +echo '</table>'; + +echo '</body>'; +echo '</html>'; +?> \ No newline at end of file Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/header.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -3,13 +3,9 @@ // Titles and screen header // Needs the file config.php loaded where the variables are defined for + // $rootpath // $title - should be defined in the page this file is included with - if (!isset($rootpath)){ - $rootpath = dirname(htmlspecialchars($_SERVER['PHP_SELF'])); - if ($rootpath == '/' OR $rootpath == "\\") { - $rootpath = ''; - } - } + $StrictXHTML=False; if (!headers_sent()){ @@ -22,6 +18,7 @@ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; + echo '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>' . $title . '</title>'; echo '<link rel="shortcut icon" href="'. $rootpath.'/favicon.ico" />'; echo '<link rel="icon" href="' . $rootpath.'/favicon.ico" />'; @@ -39,39 +36,32 @@ echo '<tr>'; echo '<td colspan="2" rowspan="2">'; - echo '<table class="main_page" cellpadding="0" cellspacing="0">'; - echo '<tr>'; - echo '<td>'; - echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" >'; - echo '<tr>'; - echo '<td>'; - if (isset($title)) { echo '<table cellpadding="0" cellspacing="0" border="0" id="quick_menu" class="quick_menu">'; echo '<tr>'; echo '<td align="left" style="width:100%;" class="quick_menu_left">'; -// Use icons for company and user data, saves screen realestate, use ALT tag in case theme icon not avail. - echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" alt="' . _('Company') . '"></img>'; - echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="User" alt="' . _('User') . '"></img>' . stripslashes($_SESSION['UsersRealName']) . '</a>'; +// Use icons for company and user data, saves screen realestate, use alt tag in case theme icon not avail. + echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" alt="' . _('Company') . '" />'; + echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="User" alt="' . _('User') . '" />' . stripslashes($_SESSION['UsersRealName']) . '</a>'; // Make the title text a class, can be set to display:none is some themes - echo '<br /><p class="header_title"> ' . $title . '</p></td>'; + echo '<br />' . $title . '</td>'; echo '<td class="quick_menu_tabs">'; echo '<table cellpadding="0" cellspacing="0" class="quick_menu_tabs"><tr>'; - echo '<td class="quick_menu_tab" align="center"><a accesskey="1" href="' . $rootpath . '/index.php"><span style="text-decoration:underline;">1</span> ' . _('Main Menu') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/index.php"><span style="text-decoration:underline;">1</span> ' . _('Main Menu') . '</a></td>'; if (count($_SESSION['AllowedPageSecurityTokens'])>1){ - echo '<td class="quick_menu_tab" align="center"><a accesskey="2" href="' . $rootpath . '/SelectCustomer.php"><span style="text-decoration:underline;">2</span> ' . _('Customers') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/SelectCustomer.php"><span style="text-decoration:underline;">2</span> ' . _('Customers') . '</a></td>'; - echo '<td class="quick_menu_tab" align="center"><a accesskey="3" href="' . $rootpath . '/SelectProduct.php"><span style="text-decoration:underline;">3</span> ' . _('Items') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/SelectProduct.php"><span style="text-decoration:underline;">3</span> ' . _('Items') . '</a></td>'; - echo '<td class="quick_menu_tab" align="center"><a accesskey="4" href="' . $rootpath . '/SelectSupplier.php"><span style="text-decoration:underline;">4</span> ' . _('Suppliers') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/SelectSupplier.php"><span style="text-decoration:underline;">4</span> ' . _('Suppliers') . '</a></td>'; - $DefaultManualLink = '<td class="quick_menu_tab" align="center"><a rel="external" accesskey="8" href="' . $rootpath . '/doc/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; + $DefaultManualLink = '<td class="quick_menu_tab" align="center"><a rel="external" href="' . $rootpath . '/doc/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; if (mb_substr($_SESSION['Language'],0,2) !='en'){ if (file_exists('locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php')){ - echo '<td class="quick_menu_tab" align="center"><a target="_blank" accesskey="8" href="' . $rootpath . '/locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a target="_blank" href="' . $rootpath . '/locale/' . $_SESSION['Language'] . '/Manual/ManualContents.php"><span style="text-decoration:underline;">8</span> ' . _('Manual') . '</a></td>'; } else { echo $DefaultManualLink; } @@ -80,7 +70,7 @@ } } - echo '<td class="quick_menu_tab" align="center"><a accesskey="0" href="' . $rootpath . '/Logout.php" onclick="return confirm(\'' . _('Are you sure you wish to logout?') . '\');"><span style="text-decoration:underline;">0</span> ' . _('Logout') . '</a></td>'; + echo '<td class="quick_menu_tab" align="center"><a href="' . $rootpath . '/Logout.php" onclick="return confirm(\'' . _('Are you sure you wish to logout?') . '\');"><span style="text-decoration:underline;">0</span> ' . _('Logout') . '</a></td>'; echo '</tr></table>'; echo '</td></tr></table>'; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/includes/session.inc 2012-02-15 16:24:39 UTC (rev 4909) @@ -21,10 +21,10 @@ ini_set('session.gc_Maxlifetime',$SessionLifeTime); -if( !ini_get('safe_mode') ){ - set_time_limit($MaximumExecutionTime); +if( !ini_get('safe_mode') ){ + set_time_limit($MaximumExecutionTime); ini_set('max_execution_time',$MaximumExecutionTime); -} +} session_write_close(); //in case a previous session is not closed session_start(); @@ -75,7 +75,7 @@ if (!isset($AllowAnyone)){ /* only do security checks if AllowAnyone is not true */ - + include $PathPrefix . 'includes/UserLogin.php'; /* Login checking and setup */ if (isset($_POST['UserNameEntryField']) and isset($_POST['Password'])) { @@ -125,9 +125,9 @@ include($PathPrefix . 'includes/GetConfig.php'); /*The page security variable is now retrieved from the database in GetConfig.php and stored in the $SESSION['PageSecurityArray'] array - * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) + * the key for the array is the script name - the script name is retrieved from the basename ($_SERVER['SCRIPT_NAME']) */ -if (!isset($PageSecurity)){ +if (!isset($PageSecurity)){ //only hardcoded in the UpgradeDatabase script - so old versions that don't have the scripts.pagesecurity field do not choke $PageSecurity = $_SESSION['PageSecurityArray'][basename($_SERVER['SCRIPT_NAME'])]; } @@ -273,17 +273,6 @@ exit; } -/* Nasty kludge to allow Supplier only logins as well as Customer logins */ -if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND - $_SESSION['AllowedPageSecurityTokens'][0]==9 AND $PageSecurity==1){ - - $_SESSION['AllowedPageSecurityTokens'][0]=1; - $SupplierLogin=1; -} else { - $SupplierLogin=0; -} - - if (!isset($AllowAnyone)){ if ((!in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { $title = _('Security Permissions Problem'); @@ -305,12 +294,12 @@ } } -/* Nasty kludge to allow Supplier only logins as well as Customer logins - .... hmmmmm some work to do here then! */ -if ($SupplierLogin==1) { - $_SESSION['AllowedPageSecurityTokens'][0]=9; +if (in_array(9,$_SESSION['AllowedPageSecurityTokens']) and $PageSecurity==0 and count($_SESSION['AllowedPageSecurityTokens'])==2){ + $SupplierLogin=1; +} else if (in_array(1,$_SESSION['AllowedPageSecurityTokens']) and $PageSecurity==0 and count($_SESSION['AllowedPageSecurityTokens'])==2){ + $SupplierLogin=0; } - if (in_array(15, $_SESSION['AllowedPageSecurityTokens'])) { /*System administrator login */ $debug = 1; //allow debug messages } else { Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-02-15 13:32:44 UTC (rev 4908) +++ trunk/index.php 2012-02-15 16:24:39 UTC (rev 4909) @@ -1,1533 +1,190 @@ <?php +$PageSecurity=0; -/* $Id$*/ - include('includes/session.inc'); $title=_('Main Menu'); +include('includes/header.inc'); /*The module link codes are hard coded in a switch statement below to determine the options to show for each tab */ -$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); -/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ -$ModuleList = array(_('Sales'), - _('Receivables'), - _('Payables'), - _('Purchases'), - _('Inventory'), - _('Manufacturing'), - _('General Ledger'), - _('Asset Manager'), - _('Petty Cash'), - _('Setup')); +include('includes/IndexArray.php'); -if (isset($_GET['Application'])){ /*This is sent by this page (to itself) when the user clicks on a tab */ - $_SESSION['Module'] = $_GET['Application']; -} - -include('includes/header.inc'); - -if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND $SupplierLogin==0){ - -/* if there is only one security access and its 1 (it has to be 1 for this page came up at all)- it must be a customer log on - * need to limit the menu to show only the customer accessible stuff this is what the page looks like for customers logging in - */ -?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table class="table_index"> +if (isset($SupplierLogin) and $SupplierLogin==1){ + echo '<table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=1">' . _('View or Amend outstanding offers') . '</a></p> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=2">' . _('Create a new offer') . '</a></p> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=3">' . _('View any open tenders without an offer') . '</a></p> </td> </tr> - </table> - </td> -<?php + </table>'; include('includes/footer.inc'); exit; -} else if (count($_SESSION['AllowedPageSecurityTokens'])==1 and $SupplierLogin==1){ -?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table class="table_index"> +} elseif (isset($SupplierLogin) and $SupplierLogin==0){ + echo '<table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php">' . _('Supplier Tenders') . '</a></p>'; ?> + <p>• <a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p> </td> </tr> - </table> - </td> -<?php -} else { /* Security settings DO allow seeing the main menu */ - -?> - <table width="100%"><td width="10%" valign="top"><table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0"> - - <?php - - - $i=0; - - while ($i < count($ModuleLink)){ - - // This determines if the user has display access to the module see config.php and header.inc - // for the authorisation and security code - if ($_SESSION['ModulesEnabled'][$i]==1) { - - // If this is the first time the application is loaded then it is possible that - // SESSION['Module'] is not set if so set it to the first module that is enabled for the user - if (!isset($_SESSION['Module'])OR $_SESSION['Module']==''){ - $_SESSION['Module']=$ModuleLink[$i]; - } - if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; - } else { - echo '<tr><td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; - } - } - $i++; - } - - ?> - </table></td><td> - <?php - - - switch ($_SESSION['Module']) { - - case 'orders': //Sales Orders - ?> - - <table width="100%"> <tr> - <td class="menu_group_area"> - <table width="100%" > - - <?php - // displays the main area headings - OptionHeadings(); - ?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CounterSales.php">' . _('Enter Counter Sales') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPickingList.php">' . _('Print Picking Lists') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectRecurringSalesOrder.php">' . _('Recurring Order Template') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/RecurringSalesOrdersProcess.php">' . _('Process Recurring Orders') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- Orders Inquiry options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php">' . _('Order Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php">' . _('Print Price Lists') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php">' . _('Order Status Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php">' . _('Orders Invoiced Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php">' . _('Daily Sales Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesByTypePeriodInquiry.php">' . _('Sales By Sales Type Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesCategoryPeriodInquiry.php">' . _('Sales By Category Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesTopItemsInquiry.php">' . _('Top Sellers Inquiry') . '</a></p>'; ?> - </td> - </tr> - - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php">' . _('Order Delivery Differences Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php">' . _('Top Sales Items Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ord'); ?> - </td> - </tr> - </table> - </td> - - <td class="menu_group_items"> <!-- Orders Maintenance options --> - <table width="100%" class="table_index" > - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectContract.php">' . _('Select Contract') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Contracts.php">' . _('Create Contract') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Place An Order') . '</a></p> </td> </tr> - </table> - <?php - break; - /* ****************** END OF ORDERS MENU ITEMS **************************** */ - - - Case 'AR': //Debtors Module - - unset($ReceiptBatch); - unset($AllocTrans); - - ?> - <table width="100%"> <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Select Order to Invoice') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - - <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php">' . _('Where Allocated Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php - if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; - } else { - echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; - } - ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php">' . _('Print Statements') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php">' . _('Sales Analysis Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php">' . _('Sales Graphs') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ar'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Customers.php">' . _('Add Customer') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php">' . _('Customers') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p> </td> </tr> - </table> - <?php + </table>'; + include('includes/footer.inc'); + exit; +} - /* ********************* END OF AR OPTIONS **************************** */ - break; +if (isset($_GET['Application'])){ /*This is sent by this page (to itself) when the user clicks on a tab */ + $_SESSION['Module'] = $_GET['Application']; +} - Case 'AP': //Creditors Module +echo '<table width="99%"> + <tr> + <td style="width:10%" valign="top">'; +echo '<table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0">'; - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> + $i=0; - <?php OptionHeadings(); ?> +while ($i < count($ModuleLink)){ - <tr> - <td class="menu_group_items"> <!-- AP transaction options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Select Supplier') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierAllocations.php">' . _('Supplier Allocations') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- AP Inquiries --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php">' . _('Aged Supplier Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php">' . _('Payment Run Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php">' . _('Remittance Advices') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php">' . _('Outstanding GRNs Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTransInquiry.php">' . _('Supplier Transaction Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ap'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- AP Maintenance Options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php">' . _('Add Supplier') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Factors.php">' . _('Maintain Factor Companies') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; + // This determines if the user has display access to the module see config.php and header.inc + // for the authorisation and security code + if ($_SESSION['ModulesEnabled'][$i]==1) { + // If this is the first time the application is loaded then it is possible that + // SESSION['Module'] is not set if so set it to the first module that is enabled for the user + if (!isset($_SESSION['Module'])OR $_SESSION['Module']==''){ + $_SESSION['Module']=$ModuleLink[$i]; + } + if ($ModuleLink[$i] == $_SESSION['Module']){ + echo '<tr><td class="main_menu_selected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + } else { + echo '<tr><td class="main_menu_unselected"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + } + } + $i++; +} - Case 'PO': /* Purchase Ordering */ +echo '</table>'; - ?> - <table width="100%"> +echo '</td>'; +echo '<td style="width:30%" valign="top">'; +if ($_SESSION['Module']=='system') { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/company.png" title="' . _('General Setup Options') . '" alt="' . _('General Setup Options') . '" /><b>' . _('General Setup Options') . '</b>'; +} else { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/transactions.png" title="' . _('Transactions') . '" alt="' . _('Transactions') . '" /><b>'. _('Transactions') . '</b>'; +} +echo ' <table width="100%" class="selection"> <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> + <td class="menu_group_headers"> + <div class="centre"> + ' . $Header . ' + </div> + </td> + </tr>'; - <?php OptionHeadings(); ?> +$i=0; +foreach ($MenuItems[$_SESSION['Module']]['Transactions']['Caption'] as $Caption) { +/* Transactions Menu Item */ + $ScriptNameArray = explode('?', substr($MenuItems[$_SESSION['Module']]['Transactions']['URL'][$i],1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + echo '<tr> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . $MenuItems[$_SESSION['Module']]['Transactions']['URL'][$i] .'">' . $Caption . '</a></p> + </td> + </tr>'; + } + $i++; +} +echo '</table>'; +echo '</td>'; - <tr> - <td class="menu_group_items"> <!-- PO Transactions --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Purchase Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_Header.php?&NewOrder=Yes">' . _('Add Purchase Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenderCreate.php?New=Yes">' . _('Create a New Tender') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenderCreate.php?Edit=Yes">' . _('Edit Existing Tenders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php">' . _('Process Tenders and Offers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php">' . _('Orders to Authorise') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Shipment Entry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php">' . _('Select A Shipment') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- PO Inquiries and Reports --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php">' . _('Purchase Order Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/POReport.php">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPriceList.php">' . _('Supplier Price List') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('prch'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- PO Maintenance --> - <table width="100%" class="table_index"> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - /* ****************************** END OF PURCHASING OPTIONS ******************************** */ - - - Case 'stock': //Inventory Module - - ?> - <table width="100%"> +echo '<td style="width:30%" valign="top">'; +if ($_SESSION['Module']=='system') { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/ar.png" title="' . _('Receivables/Payables Setup') . '" alt="' . _('Receivables/Payables Setup') . '" /><b>' . _('Receivables/Payables Setup') . '</b>'; +} else { + $Header='<img src="' . $rootpath . '/css/' . $theme . '/images/reports.png" title="' . _('Inquiries and Reports') . '" alt="' . _('Inquiries and Reports') . '" /><b>'. _('Inquiries and Reports') . '</b>'; +} +echo ' <table width="100%" class="selection"> <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> + <td class="menu_group_headers"> + <div class="centre"> + ' . $Header . ' + </div> + </td> + </tr>'; +$i=0; +foreach ($MenuItems[$_SESSION['Module']]['Reports']['Caption'] as $Caption) { +/* Transactions Menu Item */ + $ScriptNameArray = explode('?', substr($MenuItems[$_SESSION['Module']]['Reports']['URL'][$i],1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + echo '<tr> + <td class="menu_group_item"> + <p>• <a href="' . $rootpath . $MenuItems[$_SESSION['Module']]['Reports']['URL'][$i] .'">' . $Caption . '</a></p> + </td> + </tr>'; + } + $i++; +} +echo GetRptLinks($_SESSION['Module']); +echo '</table>'; +echo '</td>'; - <?php OptionHeadings(); ?> - <tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Receive Purchase Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransfer.php">' . _('Bulk Inventory Transfer') . ' - ' . _('Dispatch') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?New=Yes">' . _('Inventory Location Transfers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">' . _('Inventory Adjustments') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php">' . _('Reverse Goods Received') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php">' . _('Enter Stock Counts') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> -... [truncated message content] |
From: <tim...@us...> - 2012-02-15 13:32:56
|
Revision: 4908 http://web-erp.svn.sourceforge.net/web-erp/?rev=4908&view=rev Author: tim_schofield Date: 2012-02-15 13:32:44 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AccountGroups.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2012-02-15 13:16:30 UTC (rev 4907) +++ trunk/AccountGroups.php 2012-02-15 13:32:44 UTC (rev 4908) @@ -18,8 +18,8 @@ $DbgMsg = _('The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was'); do { - $sql = "SELECT parentgroupname - FROM accountgroups + $sql = "SELECT parentgroupname + FROM accountgroups WHERE groupname='" . $GroupName ."'"; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -54,11 +54,11 @@ $sql="SELECT count(groupname) FROM accountgroups WHERE groupname='".$_POST['GroupName']."'"; - $DbgMsg = _('The SQL that was used to retrieve the information was'); - $ErrMsg = _('Could not check whether the group exists because'); + $DbgMsg = _('The SQL that was used to retrieve the information was'); + $ErrMsg = _('Could not check whether the group exists because'); - $result=DB_query($sql, $db,$ErrMsg,$DbgMsg); - $myrow=DB_fetch_row($result); + $result=DB_query($sql, $db,$ErrMsg,$DbgMsg); + $myrow=DB_fetch_row($result); if ($myrow[0]!=0 and $_POST['SelectedAccountGroup']=='') { $InputError = 1; @@ -72,14 +72,6 @@ $Errors[$i] = 'GroupName'; $i++; } - if (!is_numeric(filter_number_format($_POST['SequenceInTB']))){ - $InputError = 1; - prnMsg( _('The sequence that the account group is listed in the trial balance is expected to be numeric'),'error'); - $Errors[$i] = 'SequenceInTB'; - $i++; - } else { - $_POST['SequenceInTB'] = filter_number_format($_POST['SequenceInTB']); - } if (mb_strlen($_POST['GroupName'])==0){ $InputError = 1; prnMsg( _('The account group name must be at least one character long'),'error'); @@ -99,60 +91,69 @@ FROM accountgroups WHERE groupname='" . $_POST['ParentGroupName'] . "'"; - $DbgMsg = _('The SQL that was used to retrieve the information was'); - $ErrMsg = _('Could not check whether the group is recursive because'); + $DbgMsg = _('The SQL that was used to retrieve the information was'); + $ErrMsg = _('Could not check whether the group is recursive because'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $ParentGroupRow = DB_fetch_array($result); + $ParentGroupRow = DB_fetch_array($result); $_POST['SequenceInTB'] = $ParentGroupRow['sequenceintb']; $_POST['PandL'] = $ParentGroupRow['pandl']; $_POST['SectionInAccounts']= $ParentGroupRow['sectioninaccounts']; prnMsg(_('Since this account group is a child group, the sequence in the trial balance, the section in the accounts and whether or not the account group appears in the balance sheet or profit and loss account are all properties inherited from the parent account group. Any changes made to these fields will have no effect.'),'warn'); } } - if (!is_long((int) $_POST['SectionInAccounts'])) { + if (!ctype_digit($_POST['SectionInAccounts'])) { $InputError = 1; prnMsg( _('The section in accounts must be an integer'),'error'); $Errors[$i] = 'SectionInAccounts'; $i++; } - + if (!ctype_digit($_POST['SequenceInTB'])) { + $InputError = 1; + prnMsg( _('The sequence in the trial balance must be an integer'),'error'); + $Errors[$i] = 'SequenceInTB'; + $i++; + } + if (!ctype_digit($_POST['SequenceInTB']) or $_POST['SequenceInTB'] > 10000) { + $InputError = 1; + prnMsg( _('The sequence in the TB must be numeric and less than') . ' 10,000','error'); + $Errors[$i] = 'SequenceInTB'; + $i++; + } + if ($_POST['SelectedAccountGroup']!='' AND $InputError !=1) { /*SelectedAccountGroup could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE accountgroups - SET groupname='" . $_POST['GroupName'] . "', - sectioninaccounts=" . $_POST['SectionInAccounts'] . ", - pandl=" . $_POST['PandL'] . ", - sequenceintb=" . $_POST['SequenceInTB'] . ", - parentgroupname='" . $_POST['ParentGroupName'] . "' - WHERE groupname = '" . $_POST['SelectedAccountGroup'] . "'"; - $ErrMsg = _('An error occurred in updating the account group'); - $DbgMsg = _('The SQL that was used to update the account group was'); + $sql = "UPDATE accountgroups SET groupname='" . $_POST['GroupName'] . "', + sectioninaccounts='" . $_POST['SectionInAccounts'] . "', + pandl='" . $_POST['PandL'] . "', + sequenceintb='" . $_POST['SequenceInTB'] . "', + parentgroupname='" . $_POST['ParentGroupName'] . "' + WHERE groupname = '" . $_POST['SelectedAccountGroup'] . "'"; + $ErrMsg = _('An error occurred in updating the account group'); + $DbgMsg = _('The SQL that was used to update the account group was'); $msg = _('Record Updated'); } elseif ($InputError !=1) { /*Selected group is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new account group form */ - $sql = "INSERT INTO accountgroups ( - groupname, - sectioninaccounts, - sequenceintb, - pandl, - parentgroupname) - VALUES ( - '" . $_POST['GroupName'] . "', - '" . $_POST['SectionInAccounts'] . "', - '" . $_POST['SequenceInTB'] . "', - '" . $_POST['PandL'] . "', - '" . $_POST['ParentGroupName'] . "' - )"; - $ErrMsg = _('An error occurred in inserting the account group'); - $DbgMsg = _('The SQL that was used to insert the account group was'); + $sql = "INSERT INTO accountgroups ( groupname, + sectioninaccounts, + sequenceintb, + pandl, + parentgroupname + ) VALUES ( + '" . $_POST['GroupName'] . "', + '" . $_POST['SectionInAccounts'] . "', + '" . $_POST['SequenceInTB'] . "', + '" . $_POST['PandL'] . "', + '" . $_POST['ParentGroupName'] . "')"; + $ErrMsg = _('An error occurred in inserting the account group'); + $DbgMsg = _('The SQL that was used to insert the account group was'); $msg = _('Record inserted'); } @@ -169,28 +170,28 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'ChartMaster' - $sql= "SELECT COUNT(*) FROM chartmaster WHERE chartmaster.group_='" . $_GET['SelectedAccountGroup'] . "'"; - $ErrMsg = _('An error occurred in retrieving the group information from chartmaster'); - $DbgMsg = _('The SQL that was used to retrieve the information was'); + $sql= "SELECT COUNT(group_) AS groups FROM chartmaster WHERE chartmaster.group_='" . $_GET['SelectedAccountGroup'] . "'"; + $ErrMsg = _('An error occurred in retrieving the group information from chartmaster'); + $DbgMsg = _('The SQL that was used to retrieve the information was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['groups']>0) { prnMsg( _('Cannot delete this account group because general ledger accounts have been created using this group'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts that refer to this account group') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow['groups'] . ' ' . _('general ledger accounts that refer to this account group') . '</font>'; } else { - $sql = "SELECT COUNT(groupname) FROM accountgroups WHERE parentgroupname = '" . $_GET['SelectedAccountGroup'] . "'"; - $ErrMsg = _('An error occurred in retrieving the parent group information'); - $DbgMsg = _('The SQL that was used to retrieve the information was'); + $sql = "SELECT COUNT(groupname) groupnames FROM accountgroups WHERE parentgroupname = '" . $_GET['SelectedAccountGroup'] . "'"; + $ErrMsg = _('An error occurred in retrieving the parent group information'); + $DbgMsg = _('The SQL that was used to retrieve the information was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['groupnames']>0) { prnMsg( _('Cannot delete this account group because it is a parent account group of other account group(s)'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('account groups that have this group as its/there parent account group') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow['groupnames'] . ' ' . _('account groups that have this group as its/there parent account group') . '</font>'; } else { $sql="DELETE FROM accountgroups WHERE groupname='" . $_GET['SelectedAccountGroup'] . "'"; - $ErrMsg = _('An error occurred in deleting the account group'); - $DbgMsg = _('The SQL that was used to delete the account group was'); + $ErrMsg = _('An error occurred in deleting the account group'); + $DbgMsg = _('The SQL that was used to delete the account group was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); prnMsg( $_GET['SelectedAccountGroup'] . ' ' . _('group has been deleted') . '!','success'); } @@ -217,19 +218,19 @@ LEFT JOIN accountsection ON sectionid = sectioninaccounts ORDER BY sequenceintb"; - $DbgMsg = _('The sql that was used to retrieve the account group information was '); + $DbgMsg = _('The sql that was used to retrieve the account group information was '); $ErrMsg = _('Could not get account groups because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; echo '<table class="selection"> - <tr> - <th>' . _('Group Name') . '</th> - <th>' . _('Section') . '</th> - <th>' . _('Sequence In TB') . '</th> - <th>' . _('Profit and Loss') . '</th> - <th>' . _('Parent Group') . '</th> - </tr>'; + <tr> + <th>' . _('Group Name') . '</th> + <th>' . _('Section') . '</th> + <th>' . _('Sequence In TB') . '</th> + <th>' . _('Profit and Loss') . '</th> + <th>' . _('Parent Group') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -253,30 +254,29 @@ $PandLText=_('No'); break; } //end of switch statement - + echo '<td>' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '</td> <td>' . $myrow['sectionname'] . '</td> <td>' . $myrow['sequenceintb'] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow['parentgroupname'] . '</td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this account group?') . '\');">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this account group?') . '\');">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; } //end of ifs and buts! -if (isset($_POST['SelectedAccountGroup']) OR isset($_GET['SelectedAccountGroup'])) { - echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">' . _('Review Account Groups') . '</a></div>'; +if (isset($_POST['SelectedAccountGroup']) or isset($_GET['SelectedAccountGroup'])) { + echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Account Groups') . '</a></div>'; } -if (! isset($_GET['delete'])) { +if (!isset($_GET['delete'])) { - echo '<br /><form method="post" id="AccountGroups" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; + echo '<br /><form method="post" id="AccountGroups" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection"><tr><td>'; if (isset($_GET['SelectedAccountGroup'])) { //editing an existing account group @@ -304,13 +304,18 @@ $_POST['PandL'] = $myrow['pandl']; $_POST['ParentGroupName'] = $myrow['parentgroupname']; + echo '<table class="selection">'; + echo '<tr> + <th colspan="2"><font size="2" color="#616161">' . _('Edit Account Group Details') . '</th> + </tr>'; echo '<input type="hidden" name="SelectedAccountGroup" value="' . $_GET['SelectedAccountGroup'] . '" />'; echo '<input type="hidden" name="GroupName" value="' . $_POST['GroupName'] . '" />'; - echo _('Account Group') . ':' . '</td>'; + echo '<tr> + <td>' . _('Account Group') . ':' . '</td> + <td>' . $_POST['GroupName'] . '</td> + </tr>'; - echo '<td>' . $_POST['GroupName'] . '</td></tr>'; - } else { //end of if $_POST['SelectedAccountGroup'] only do the else when a new record is being entered if (!isset($_POST['SelectedAccountGroup'])){ @@ -329,11 +334,18 @@ $_POST['PandL']=''; } + echo '<br /><table class="selection">'; echo '<input type="hidden" name="SelectedAccountGroup" value="' . $_POST['SelectedAccountGroup'] . '" />'; - echo _('Account Group Name') . ':' . '</td><td> - <input tabindex="1" ' . (in_array('GroupName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="GroupName" size="50" maxlength="50" value="' . $_POST['GroupName'] . '" /></td></tr>'; + echo '<tr> + <th colspan="2"><font size="2" color="#616161">' . _('New Account Group Details') . '</th> + </tr>'; + echo '<tr> + <td>' . _('Account Group Name') . ':' . '</td> + <td><input tabindex="1" ' . (in_array('GroupName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="GroupName" size="50" maxlength="50" value="' . $_POST['GroupName'] . '" /></td> + </tr>'; } - echo '<tr><td>' . _('Parent Group') . ':' . '</td> + echo '<tr> + <td>' . _('Parent Group') . ':' . '</td> <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="ParentGroupName">'; $sql = "SELECT groupname FROM accountgroups"; @@ -355,9 +367,9 @@ echo '</select>'; echo '</td></tr>'; - echo '<tr><td>' . _('Section In Accounts') . ':' . '</td> - <td><select tabindex="3" ' . (in_array('SectionInAccounts',$Errors) ? 'class="selecterror"' : '' ) . - ' name="SectionInAccounts">'; + echo '<tr> + <td>' . _('Section In Accounts') . ':' . '</td> + <td><select tabindex="3" ' . (in_array('SectionInAccounts',$Errors) ? 'class="selecterror"' : '' ) . ' name="SectionInAccounts">'; $sql = "SELECT sectionid, sectionname FROM accountsection ORDER BY sectionid"; $secresult = DB_query($sql, $db,$ErrMsg,$DbgMsg); @@ -371,8 +383,9 @@ echo '</select>'; echo '</td></tr>'; - echo '<tr><td>' . _('Profit and Loss') . ':' . '</td> - <td><select tabindex="4" name="PandL">'; + echo '<tr> + <td>' . _('Profit and Loss') . ':' . '</td> + <td><select tabindex="4" name="PandL">'; if ($_POST['PandL']!=0 ) { echo '<option selected="selected" value="1">' . _('Yes').'</option>'; @@ -387,12 +400,14 @@ echo '</select></td></tr>'; - echo '<tr><td>' . _('Sequence In TB') . ':' . '</td>'; - echo '<td><input tabindex="5" ' . (in_array('SequenceInTB',$Errors) ? 'class="inputerror"' : '' ) . - ' type="text" maxlength="4" name="SequenceInTB" class="number" - value="' . $_POST['SequenceInTB'] . '" /></td></tr>'; + echo '<tr> + <td>' . _('Sequence In TB') . ':' . '</td> + <td><input tabindex="5" type="text" maxlength="4" name="SequenceInTB" class="number" value="' . $_POST['SequenceInTB'] . '" /></td> + </tr>'; - echo '<tr><td colspan="2"><div class="centre"><input tabindex="6" type="submit" name="submit" value="' . _('Enter Information') . '" /></div></td></tr>'; + echo '<tr> + <td colspan="2"><div class="centre"><input tabindex="6" type="submit" name="submit" value="' . _('Enter Information') . '" /></div></td> + </tr>'; echo '</table><br />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 13:32:54
|
Revision: 4908 http://web-erp.svn.sourceforge.net/web-erp/?rev=4908&view=rev Author: tim_schofield Date: 2012-02-15 13:32:44 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AccountGroups.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2012-02-15 13:16:30 UTC (rev 4907) +++ trunk/AccountGroups.php 2012-02-15 13:32:44 UTC (rev 4908) @@ -18,8 +18,8 @@ $DbgMsg = _('The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was'); do { - $sql = "SELECT parentgroupname - FROM accountgroups + $sql = "SELECT parentgroupname + FROM accountgroups WHERE groupname='" . $GroupName ."'"; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -54,11 +54,11 @@ $sql="SELECT count(groupname) FROM accountgroups WHERE groupname='".$_POST['GroupName']."'"; - $DbgMsg = _('The SQL that was used to retrieve the information was'); - $ErrMsg = _('Could not check whether the group exists because'); + $DbgMsg = _('The SQL that was used to retrieve the information was'); + $ErrMsg = _('Could not check whether the group exists because'); - $result=DB_query($sql, $db,$ErrMsg,$DbgMsg); - $myrow=DB_fetch_row($result); + $result=DB_query($sql, $db,$ErrMsg,$DbgMsg); + $myrow=DB_fetch_row($result); if ($myrow[0]!=0 and $_POST['SelectedAccountGroup']=='') { $InputError = 1; @@ -72,14 +72,6 @@ $Errors[$i] = 'GroupName'; $i++; } - if (!is_numeric(filter_number_format($_POST['SequenceInTB']))){ - $InputError = 1; - prnMsg( _('The sequence that the account group is listed in the trial balance is expected to be numeric'),'error'); - $Errors[$i] = 'SequenceInTB'; - $i++; - } else { - $_POST['SequenceInTB'] = filter_number_format($_POST['SequenceInTB']); - } if (mb_strlen($_POST['GroupName'])==0){ $InputError = 1; prnMsg( _('The account group name must be at least one character long'),'error'); @@ -99,60 +91,69 @@ FROM accountgroups WHERE groupname='" . $_POST['ParentGroupName'] . "'"; - $DbgMsg = _('The SQL that was used to retrieve the information was'); - $ErrMsg = _('Could not check whether the group is recursive because'); + $DbgMsg = _('The SQL that was used to retrieve the information was'); + $ErrMsg = _('Could not check whether the group is recursive because'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $ParentGroupRow = DB_fetch_array($result); + $ParentGroupRow = DB_fetch_array($result); $_POST['SequenceInTB'] = $ParentGroupRow['sequenceintb']; $_POST['PandL'] = $ParentGroupRow['pandl']; $_POST['SectionInAccounts']= $ParentGroupRow['sectioninaccounts']; prnMsg(_('Since this account group is a child group, the sequence in the trial balance, the section in the accounts and whether or not the account group appears in the balance sheet or profit and loss account are all properties inherited from the parent account group. Any changes made to these fields will have no effect.'),'warn'); } } - if (!is_long((int) $_POST['SectionInAccounts'])) { + if (!ctype_digit($_POST['SectionInAccounts'])) { $InputError = 1; prnMsg( _('The section in accounts must be an integer'),'error'); $Errors[$i] = 'SectionInAccounts'; $i++; } - + if (!ctype_digit($_POST['SequenceInTB'])) { + $InputError = 1; + prnMsg( _('The sequence in the trial balance must be an integer'),'error'); + $Errors[$i] = 'SequenceInTB'; + $i++; + } + if (!ctype_digit($_POST['SequenceInTB']) or $_POST['SequenceInTB'] > 10000) { + $InputError = 1; + prnMsg( _('The sequence in the TB must be numeric and less than') . ' 10,000','error'); + $Errors[$i] = 'SequenceInTB'; + $i++; + } + if ($_POST['SelectedAccountGroup']!='' AND $InputError !=1) { /*SelectedAccountGroup could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE accountgroups - SET groupname='" . $_POST['GroupName'] . "', - sectioninaccounts=" . $_POST['SectionInAccounts'] . ", - pandl=" . $_POST['PandL'] . ", - sequenceintb=" . $_POST['SequenceInTB'] . ", - parentgroupname='" . $_POST['ParentGroupName'] . "' - WHERE groupname = '" . $_POST['SelectedAccountGroup'] . "'"; - $ErrMsg = _('An error occurred in updating the account group'); - $DbgMsg = _('The SQL that was used to update the account group was'); + $sql = "UPDATE accountgroups SET groupname='" . $_POST['GroupName'] . "', + sectioninaccounts='" . $_POST['SectionInAccounts'] . "', + pandl='" . $_POST['PandL'] . "', + sequenceintb='" . $_POST['SequenceInTB'] . "', + parentgroupname='" . $_POST['ParentGroupName'] . "' + WHERE groupname = '" . $_POST['SelectedAccountGroup'] . "'"; + $ErrMsg = _('An error occurred in updating the account group'); + $DbgMsg = _('The SQL that was used to update the account group was'); $msg = _('Record Updated'); } elseif ($InputError !=1) { /*Selected group is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new account group form */ - $sql = "INSERT INTO accountgroups ( - groupname, - sectioninaccounts, - sequenceintb, - pandl, - parentgroupname) - VALUES ( - '" . $_POST['GroupName'] . "', - '" . $_POST['SectionInAccounts'] . "', - '" . $_POST['SequenceInTB'] . "', - '" . $_POST['PandL'] . "', - '" . $_POST['ParentGroupName'] . "' - )"; - $ErrMsg = _('An error occurred in inserting the account group'); - $DbgMsg = _('The SQL that was used to insert the account group was'); + $sql = "INSERT INTO accountgroups ( groupname, + sectioninaccounts, + sequenceintb, + pandl, + parentgroupname + ) VALUES ( + '" . $_POST['GroupName'] . "', + '" . $_POST['SectionInAccounts'] . "', + '" . $_POST['SequenceInTB'] . "', + '" . $_POST['PandL'] . "', + '" . $_POST['ParentGroupName'] . "')"; + $ErrMsg = _('An error occurred in inserting the account group'); + $DbgMsg = _('The SQL that was used to insert the account group was'); $msg = _('Record inserted'); } @@ -169,28 +170,28 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'ChartMaster' - $sql= "SELECT COUNT(*) FROM chartmaster WHERE chartmaster.group_='" . $_GET['SelectedAccountGroup'] . "'"; - $ErrMsg = _('An error occurred in retrieving the group information from chartmaster'); - $DbgMsg = _('The SQL that was used to retrieve the information was'); + $sql= "SELECT COUNT(group_) AS groups FROM chartmaster WHERE chartmaster.group_='" . $_GET['SelectedAccountGroup'] . "'"; + $ErrMsg = _('An error occurred in retrieving the group information from chartmaster'); + $DbgMsg = _('The SQL that was used to retrieve the information was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['groups']>0) { prnMsg( _('Cannot delete this account group because general ledger accounts have been created using this group'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts that refer to this account group') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow['groups'] . ' ' . _('general ledger accounts that refer to this account group') . '</font>'; } else { - $sql = "SELECT COUNT(groupname) FROM accountgroups WHERE parentgroupname = '" . $_GET['SelectedAccountGroup'] . "'"; - $ErrMsg = _('An error occurred in retrieving the parent group information'); - $DbgMsg = _('The SQL that was used to retrieve the information was'); + $sql = "SELECT COUNT(groupname) groupnames FROM accountgroups WHERE parentgroupname = '" . $_GET['SelectedAccountGroup'] . "'"; + $ErrMsg = _('An error occurred in retrieving the parent group information'); + $DbgMsg = _('The SQL that was used to retrieve the information was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['groupnames']>0) { prnMsg( _('Cannot delete this account group because it is a parent account group of other account group(s)'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('account groups that have this group as its/there parent account group') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow['groupnames'] . ' ' . _('account groups that have this group as its/there parent account group') . '</font>'; } else { $sql="DELETE FROM accountgroups WHERE groupname='" . $_GET['SelectedAccountGroup'] . "'"; - $ErrMsg = _('An error occurred in deleting the account group'); - $DbgMsg = _('The SQL that was used to delete the account group was'); + $ErrMsg = _('An error occurred in deleting the account group'); + $DbgMsg = _('The SQL that was used to delete the account group was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); prnMsg( $_GET['SelectedAccountGroup'] . ' ' . _('group has been deleted') . '!','success'); } @@ -217,19 +218,19 @@ LEFT JOIN accountsection ON sectionid = sectioninaccounts ORDER BY sequenceintb"; - $DbgMsg = _('The sql that was used to retrieve the account group information was '); + $DbgMsg = _('The sql that was used to retrieve the account group information was '); $ErrMsg = _('Could not get account groups because'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; echo '<table class="selection"> - <tr> - <th>' . _('Group Name') . '</th> - <th>' . _('Section') . '</th> - <th>' . _('Sequence In TB') . '</th> - <th>' . _('Profit and Loss') . '</th> - <th>' . _('Parent Group') . '</th> - </tr>'; + <tr> + <th>' . _('Group Name') . '</th> + <th>' . _('Section') . '</th> + <th>' . _('Sequence In TB') . '</th> + <th>' . _('Profit and Loss') . '</th> + <th>' . _('Parent Group') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -253,30 +254,29 @@ $PandLText=_('No'); break; } //end of switch statement - + echo '<td>' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '</td> <td>' . $myrow['sectionname'] . '</td> <td>' . $myrow['sequenceintb'] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow['parentgroupname'] . '</td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this account group?') . '\');">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this account group?') . '\');">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; } //end of ifs and buts! -if (isset($_POST['SelectedAccountGroup']) OR isset($_GET['SelectedAccountGroup'])) { - echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">' . _('Review Account Groups') . '</a></div>'; +if (isset($_POST['SelectedAccountGroup']) or isset($_GET['SelectedAccountGroup'])) { + echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Account Groups') . '</a></div>'; } -if (! isset($_GET['delete'])) { +if (!isset($_GET['delete'])) { - echo '<br /><form method="post" id="AccountGroups" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; + echo '<br /><form method="post" id="AccountGroups" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection"><tr><td>'; if (isset($_GET['SelectedAccountGroup'])) { //editing an existing account group @@ -304,13 +304,18 @@ $_POST['PandL'] = $myrow['pandl']; $_POST['ParentGroupName'] = $myrow['parentgroupname']; + echo '<table class="selection">'; + echo '<tr> + <th colspan="2"><font size="2" color="#616161">' . _('Edit Account Group Details') . '</th> + </tr>'; echo '<input type="hidden" name="SelectedAccountGroup" value="' . $_GET['SelectedAccountGroup'] . '" />'; echo '<input type="hidden" name="GroupName" value="' . $_POST['GroupName'] . '" />'; - echo _('Account Group') . ':' . '</td>'; + echo '<tr> + <td>' . _('Account Group') . ':' . '</td> + <td>' . $_POST['GroupName'] . '</td> + </tr>'; - echo '<td>' . $_POST['GroupName'] . '</td></tr>'; - } else { //end of if $_POST['SelectedAccountGroup'] only do the else when a new record is being entered if (!isset($_POST['SelectedAccountGroup'])){ @@ -329,11 +334,18 @@ $_POST['PandL']=''; } + echo '<br /><table class="selection">'; echo '<input type="hidden" name="SelectedAccountGroup" value="' . $_POST['SelectedAccountGroup'] . '" />'; - echo _('Account Group Name') . ':' . '</td><td> - <input tabindex="1" ' . (in_array('GroupName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="GroupName" size="50" maxlength="50" value="' . $_POST['GroupName'] . '" /></td></tr>'; + echo '<tr> + <th colspan="2"><font size="2" color="#616161">' . _('New Account Group Details') . '</th> + </tr>'; + echo '<tr> + <td>' . _('Account Group Name') . ':' . '</td> + <td><input tabindex="1" ' . (in_array('GroupName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="GroupName" size="50" maxlength="50" value="' . $_POST['GroupName'] . '" /></td> + </tr>'; } - echo '<tr><td>' . _('Parent Group') . ':' . '</td> + echo '<tr> + <td>' . _('Parent Group') . ':' . '</td> <td><select tabindex="2" ' . (in_array('ParentGroupName',$Errors) ? 'class="selecterror"' : '' ) . ' name="ParentGroupName">'; $sql = "SELECT groupname FROM accountgroups"; @@ -355,9 +367,9 @@ echo '</select>'; echo '</td></tr>'; - echo '<tr><td>' . _('Section In Accounts') . ':' . '</td> - <td><select tabindex="3" ' . (in_array('SectionInAccounts',$Errors) ? 'class="selecterror"' : '' ) . - ' name="SectionInAccounts">'; + echo '<tr> + <td>' . _('Section In Accounts') . ':' . '</td> + <td><select tabindex="3" ' . (in_array('SectionInAccounts',$Errors) ? 'class="selecterror"' : '' ) . ' name="SectionInAccounts">'; $sql = "SELECT sectionid, sectionname FROM accountsection ORDER BY sectionid"; $secresult = DB_query($sql, $db,$ErrMsg,$DbgMsg); @@ -371,8 +383,9 @@ echo '</select>'; echo '</td></tr>'; - echo '<tr><td>' . _('Profit and Loss') . ':' . '</td> - <td><select tabindex="4" name="PandL">'; + echo '<tr> + <td>' . _('Profit and Loss') . ':' . '</td> + <td><select tabindex="4" name="PandL">'; if ($_POST['PandL']!=0 ) { echo '<option selected="selected" value="1">' . _('Yes').'</option>'; @@ -387,12 +400,14 @@ echo '</select></td></tr>'; - echo '<tr><td>' . _('Sequence In TB') . ':' . '</td>'; - echo '<td><input tabindex="5" ' . (in_array('SequenceInTB',$Errors) ? 'class="inputerror"' : '' ) . - ' type="text" maxlength="4" name="SequenceInTB" class="number" - value="' . $_POST['SequenceInTB'] . '" /></td></tr>'; + echo '<tr> + <td>' . _('Sequence In TB') . ':' . '</td> + <td><input tabindex="5" type="text" maxlength="4" name="SequenceInTB" class="number" value="' . $_POST['SequenceInTB'] . '" /></td> + </tr>'; - echo '<tr><td colspan="2"><div class="centre"><input tabindex="6" type="submit" name="submit" value="' . _('Enter Information') . '" /></div></td></tr>'; + echo '<tr> + <td colspan="2"><div class="centre"><input tabindex="6" type="submit" name="submit" value="' . _('Enter Information') . '" /></div></td> + </tr>'; echo '</table><br />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 13:16:42
|
Revision: 4907 http://web-erp.svn.sourceforge.net/web-erp/?rev=4907&view=rev Author: tim_schofield Date: 2012-02-15 13:16:30 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AccountSections.php Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2012-02-15 13:00:43 UTC (rev 4906) +++ trunk/AccountSections.php 2012-02-15 13:16:30 UTC (rev 4907) @@ -9,31 +9,27 @@ include('includes/header.inc'); // SOME TEST TO ENSURE THAT AT LEAST INCOME AND COST OF SALES ARE THERE - $sql= "SELECT COUNT(*) FROM accountsection WHERE sectionid=1"; + $sql= "SELECT sectionid FROM accountsection WHERE sectionid=1"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if( $myrow[0] == 0 ) { - $sql = "INSERT INTO accountsection ( - sectionid, - sectionname - ) VALUES ( - 1, - 'Income' - )"; + + if( DB_num_rows($result) == 0 ) { + $sql = "INSERT INTO accountsection (sectionid, + sectionname + ) VALUES ( + 1, + 'Income')"; $result = DB_query($sql,$db); } - $sql= "SELECT COUNT(*) FROM accountsection WHERE sectionid=2"; + $sql= "SELECT sectionid FROM accountsection WHERE sectionid=2"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if( $myrow[0] == 0 ) { - $sql = "INSERT INTO accountsection ( - sectionid, - sectionname - ) VALUES ( - 2, - 'Cost Of Sales' - )"; + + if( DB_num_rows($result) == 0 ) { + $sql = "INSERT INTO accountsection (sectionid, + sectionname + ) VALUES ( + 2, + 'Cost Of Sales')"; $result = DB_query($sql,$db); } // DONE WITH MINIMUM TESTS @@ -57,20 +53,21 @@ //first off validate inputs sensible if (isset($_POST['SectionID'])) { - $sql="SELECT count(sectionid) - FROM accountsection WHERE sectionid='".$_POST['SectionID']."'"; + $sql="SELECT sectionid + FROM accountsection + WHERE sectionid='".$_POST['SectionID']."'"; $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if (($myrow[0]!=0 and !isset($_POST['SelectedSectionID']))) { + + if ((DB_num_rows($result)!=0 and !isset($_POST['SelectedSectionID']))) { $InputError = 1; prnMsg( _('The account section already exists in the database'),'error'); $Errors[$i] = 'SectionID'; $i++; } } - if (ContainsIllegalCharacters($_POST['SectionName'])>0) { + if (ContainsIllegalCharacters($_POST['SectionName'])) { $InputError = 1; - prnMsg( _('The account section name cannot contain any of the illegal characters') ." '",'error'); + prnMsg( _('The account section name cannot contain any illegal characters') ,'error'); $Errors[$i] = 'SectionName'; $i++; } @@ -97,8 +94,7 @@ /*SelectedSectionID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE accountsection - SET sectionname='" . $_POST['SectionName'] . "' + $sql = "UPDATE accountsection SET sectionname='" . $_POST['SectionName'] . "' WHERE sectionid = " . $_POST['SelectedSectionID']; $msg = _('Record Updated'); @@ -106,13 +102,11 @@ /*SelectedSectionID is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new account section form */ - $sql = "INSERT INTO accountsection ( - sectionid, - sectionname ) - VALUES ( - " . $_POST['SectionID'] . ", - '" . $_POST['SectionName'] ."' - )"; + $sql = "INSERT INTO accountsection (sectionid, + sectionname + ) VALUES ( + " . $_POST['SectionID'] . ", + '" . $_POST['SectionName'] .")"; $msg = _('Record inserted'); } @@ -129,19 +123,19 @@ //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'accountgroups' - $sql= "SELECT COUNT(*) FROM accountgroups WHERE sectioninaccounts='" . $_GET['SelectedSectionID'] . "'"; + $sql= "SELECT COUNT(sectioninaccounts) AS sections FROM accountgroups WHERE sectioninaccounts='" . $_GET['SelectedSectionID'] . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if (DB_num_rows($result)>0) { prnMsg( _('Cannot delete this account section because general ledger accounts groups have been created using this section'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow['sections'] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; } else { //Fetch section name $sql = "SELECT sectionname FROM accountsection WHERE sectionid='".$_GET['SelectedSectionID'] . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - $SectionName = $myrow[0]; + $myrow = DB_fetch_array($result); + $SectionName = $myrow['sectionname']; $sql="DELETE FROM accountsection WHERE sectionid='" . $_GET['SelectedSectionID'] . "'"; $result = DB_query($sql,$db); @@ -176,13 +170,13 @@ <br />'; echo '<table name="SectionList" class="selection"> - <tr> - <th>' . _('Section Number') . '</th> - <th>' . _('Section Description') . '</th> - </tr>'; + <tr> + <th>' . _('Section Number') . '</th> + <th>' . _('Section Description') . '</th> + </tr>'; $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -192,12 +186,12 @@ $k++; } - echo '<td>' . $myrow[0] . '</td><td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - if ( $myrow[0] == '1' || $myrow[0] == '2' ) { + echo '<td>' . $myrow['sectionid'] . '</td><td>' . $myrow['sectionname'] . '</td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedSectionID=' . $myrow['sectionid'] . '">' . _('Edit') . '</a></td>'; + if ( $myrow['sectionid'] == '1' or $myrow['sectionid'] == '2' ) { echo '<td><b>'._('Restricted').'</b></td>'; } else { - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedSectionID=' . $myrow['sectionid'] . '&delete=1">' . _('Delete') .'</a></td>'; } echo '</tr>'; } //END WHILE LIST LOOP @@ -206,12 +200,12 @@ if (isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { - echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Review Account Sections') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Account Sections') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" name="AccountSections" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; + echo '<form method="post" name="AccountSections" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedSectionID'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 13:16:42
|
Revision: 4907 http://web-erp.svn.sourceforge.net/web-erp/?rev=4907&view=rev Author: tim_schofield Date: 2012-02-15 13:16:30 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AccountSections.php Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2012-02-15 13:00:43 UTC (rev 4906) +++ trunk/AccountSections.php 2012-02-15 13:16:30 UTC (rev 4907) @@ -9,31 +9,27 @@ include('includes/header.inc'); // SOME TEST TO ENSURE THAT AT LEAST INCOME AND COST OF SALES ARE THERE - $sql= "SELECT COUNT(*) FROM accountsection WHERE sectionid=1"; + $sql= "SELECT sectionid FROM accountsection WHERE sectionid=1"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if( $myrow[0] == 0 ) { - $sql = "INSERT INTO accountsection ( - sectionid, - sectionname - ) VALUES ( - 1, - 'Income' - )"; + + if( DB_num_rows($result) == 0 ) { + $sql = "INSERT INTO accountsection (sectionid, + sectionname + ) VALUES ( + 1, + 'Income')"; $result = DB_query($sql,$db); } - $sql= "SELECT COUNT(*) FROM accountsection WHERE sectionid=2"; + $sql= "SELECT sectionid FROM accountsection WHERE sectionid=2"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if( $myrow[0] == 0 ) { - $sql = "INSERT INTO accountsection ( - sectionid, - sectionname - ) VALUES ( - 2, - 'Cost Of Sales' - )"; + + if( DB_num_rows($result) == 0 ) { + $sql = "INSERT INTO accountsection (sectionid, + sectionname + ) VALUES ( + 2, + 'Cost Of Sales')"; $result = DB_query($sql,$db); } // DONE WITH MINIMUM TESTS @@ -57,20 +53,21 @@ //first off validate inputs sensible if (isset($_POST['SectionID'])) { - $sql="SELECT count(sectionid) - FROM accountsection WHERE sectionid='".$_POST['SectionID']."'"; + $sql="SELECT sectionid + FROM accountsection + WHERE sectionid='".$_POST['SectionID']."'"; $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if (($myrow[0]!=0 and !isset($_POST['SelectedSectionID']))) { + + if ((DB_num_rows($result)!=0 and !isset($_POST['SelectedSectionID']))) { $InputError = 1; prnMsg( _('The account section already exists in the database'),'error'); $Errors[$i] = 'SectionID'; $i++; } } - if (ContainsIllegalCharacters($_POST['SectionName'])>0) { + if (ContainsIllegalCharacters($_POST['SectionName'])) { $InputError = 1; - prnMsg( _('The account section name cannot contain any of the illegal characters') ." '",'error'); + prnMsg( _('The account section name cannot contain any illegal characters') ,'error'); $Errors[$i] = 'SectionName'; $i++; } @@ -97,8 +94,7 @@ /*SelectedSectionID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE accountsection - SET sectionname='" . $_POST['SectionName'] . "' + $sql = "UPDATE accountsection SET sectionname='" . $_POST['SectionName'] . "' WHERE sectionid = " . $_POST['SelectedSectionID']; $msg = _('Record Updated'); @@ -106,13 +102,11 @@ /*SelectedSectionID is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new account section form */ - $sql = "INSERT INTO accountsection ( - sectionid, - sectionname ) - VALUES ( - " . $_POST['SectionID'] . ", - '" . $_POST['SectionName'] ."' - )"; + $sql = "INSERT INTO accountsection (sectionid, + sectionname + ) VALUES ( + " . $_POST['SectionID'] . ", + '" . $_POST['SectionName'] .")"; $msg = _('Record inserted'); } @@ -129,19 +123,19 @@ //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'accountgroups' - $sql= "SELECT COUNT(*) FROM accountgroups WHERE sectioninaccounts='" . $_GET['SelectedSectionID'] . "'"; + $sql= "SELECT COUNT(sectioninaccounts) AS sections FROM accountgroups WHERE sectioninaccounts='" . $_GET['SelectedSectionID'] . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if (DB_num_rows($result)>0) { prnMsg( _('Cannot delete this account section because general ledger accounts groups have been created using this section'),'warn'); - echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow['sections'] . ' ' . _('general ledger accounts groups that refer to this account section') . '</font>'; } else { //Fetch section name $sql = "SELECT sectionname FROM accountsection WHERE sectionid='".$_GET['SelectedSectionID'] . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - $SectionName = $myrow[0]; + $myrow = DB_fetch_array($result); + $SectionName = $myrow['sectionname']; $sql="DELETE FROM accountsection WHERE sectionid='" . $_GET['SelectedSectionID'] . "'"; $result = DB_query($sql,$db); @@ -176,13 +170,13 @@ <br />'; echo '<table name="SectionList" class="selection"> - <tr> - <th>' . _('Section Number') . '</th> - <th>' . _('Section Description') . '</th> - </tr>'; + <tr> + <th>' . _('Section Number') . '</th> + <th>' . _('Section Description') . '</th> + </tr>'; $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -192,12 +186,12 @@ $k++; } - echo '<td>' . $myrow[0] . '</td><td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - if ( $myrow[0] == '1' || $myrow[0] == '2' ) { + echo '<td>' . $myrow['sectionid'] . '</td><td>' . $myrow['sectionname'] . '</td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedSectionID=' . $myrow['sectionid'] . '">' . _('Edit') . '</a></td>'; + if ( $myrow['sectionid'] == '1' or $myrow['sectionid'] == '2' ) { echo '<td><b>'._('Restricted').'</b></td>'; } else { - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedSectionID=' . $myrow['sectionid'] . '&delete=1">' . _('Delete') .'</a></td>'; } echo '</tr>'; } //END WHILE LIST LOOP @@ -206,12 +200,12 @@ if (isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { - echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Review Account Sections') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Account Sections') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" name="AccountSections" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; + echo '<form method="post" name="AccountSections" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedSectionID'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 13:00:53
|
Revision: 4906 http://web-erp.svn.sourceforge.net/web-erp/?rev=4906&view=rev Author: tim_schofield Date: 2012-02-15 13:00:43 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AddCustomerTypeNotes.php Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2012-02-15 12:53:46 UTC (rev 4905) +++ trunk/AddCustomerTypeNotes.php 2012-02-15 13:00:43 UTC (rev 4906) @@ -28,24 +28,23 @@ //first off validate inputs sensible if (!is_long((integer)$_POST['priority'])) { $InputError = 1; - prnMsg(_('The Contact priority must be an integer.'), 'error'); + prnMsg( _('The Contact priority must be an integer.'), 'error'); } elseif (mb_strlen($_POST['note']) >200) { $InputError = 1; - prnMsg(_("The contact's notes must be two hundred characters or less long"), 'error'); + prnMsg( _('The contacts notes must be two hundred characters or less long'), 'error'); } elseif( trim($_POST['note']) == '' ) { $InputError = 1; - prnMsg( _("The contact's notes may not be empty"), 'error'); + prnMsg( _('The contacts notes may not be empty'), 'error'); } - if ($Id AND $InputError !=1) { + if ($Id and $InputError !=1) { - $sql = "UPDATE debtortypenotes SET - note='" . $_POST['note'] . "', - date='" . $_POST['date'] . "', - href='" . $_POST['href'] . "', - priority='" . $_POST['priority'] . "' - WHERE typeid ='".$DebtorType."' - AND noteid='".$Id."'"; + $sql = "UPDATE debtortypenotes SET note='" . $_POST['note'] . "', + date='" . $_POST['date'] . "', + href='" . $_POST['href'] . "', + priority='" . $_POST['priority'] . "' + WHERE typeid ='".$DebtorType."' + AND noteid='".$Id."'"; $msg = _('Customer Group Notes') . ' ' . $DebtorType . ' ' . _('has been updated'); } elseif ($InputError !=1) { @@ -54,11 +53,11 @@ note, date, priority) - VALUES ('" . $DebtorType. "', - '" . $_POST['href'] . "', - '" . $_POST['note'] . "', - '" . $_POST['date'] . "', - '" . $_POST['priority'] . "')"; + VALUES ('" . $DebtorType. "', + '" . $_POST['href'] . "', + '" . $_POST['note'] . "', + '" . $_POST['date'] . "', + '" . $_POST['priority'] . "')"; $msg = _('The contact group notes record has been added'); } @@ -71,45 +70,48 @@ unset($_POST['note']); unset($_POST['noteid']); } - } elseif (isset($_GET['delete'])) { +} elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' - $sql="DELETE FROM debtortypenotes + $sql="DELETE FROM debtortypenotes WHERE noteid='".$Id."' AND typeid='".$DebtorType."'"; - $result = DB_query($sql,$db); - //echo '<br />'.$sql; + $result = DB_query($sql,$db); - echo '<br />'; - prnMsg( _('The contact group note record has been deleted'), 'success'); - unset($Id); - unset($_GET['delete']); + echo '<br />'; + prnMsg( _('The contact group note record has been deleted'), 'success'); + unset($Id); + unset($_GET['delete']); - } +} if (!isset($Id)) { - $SQLname="SELECT * from debtortype where typeid='".$DebtorType."'"; - $Result = DB_query($SQLname,$db); - $row = DB_fetch_array($Result); - echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . - '" alt="" />' . _('Notes for Customer Type').': <b>' .$row['typename'].'</b> - </p> + $SQLname="SELECT typename from debtortype where typeid='".$DebtorType."'"; + $result = DB_query($SQLname,$db); + $myrow = DB_fetch_array($result); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="" />' . _('Notes for Customer Type').': <b>' .$myrow['typename'].'</b></p> <br />'; - - $sql = "SELECT * FROM debtortypenotes where typeid='".$DebtorType."' ORDER BY date DESC"; + $sql = "SELECT noteid, + typeid, + href, + note, + date, + priority + FROM debtortypenotes + WHERE typeid='".$DebtorType."' + ORDER BY date DESC"; $result = DB_query($sql,$db); + //echo '<br />'.$sql; - echo '<table class="selection"> - <tr> + echo '<table class="selection">'; + echo '<tr> <th>' . _('Date') . '</th> <th>' . _('Note') . '</th> <th>' . _('href') . '</th> - <th>' . _('Priority') . '</th> - </tr>'; + <th>' . _('Priority') . '</th>'; $k=0; //row colour counter @@ -126,24 +128,23 @@ <td>%s</td> <td>%s</td> <td><a href="%sId=%s&DebtorType=%s">'. _('Edit').' </td> - <td><a href="%sId=%s&DebtorType=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer type note?') . '\');">'. _('Delete'). '</td> - </tr>', - $myrow[4], - $myrow[3], - $myrow[2], - $myrow[5], - htmlspecialchars($_SERVER['PHP_SELF']) . '?', - $myrow[0], - $myrow[1], - htmlspecialchars($_SERVER['PHP_SELF']) . '?', - $myrow[0], - $myrow[1]); + <td><a href="%sId=%s&DebtorType=%s&delete=1">'. _('Delete'). '</td></tr>', + $myrow['date'], + $myrow['note'], + $myrow['href'], + $myrow['priority'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', + $myrow['noteid'], + $myrow['typeid'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', + $myrow['noteid'], + $myrow['typeid']); } //END WHILE LIST LOOP echo '</table>'; } -if (isset($Id)) { +if (isset($Id)) { echo '<div class="centre"> <a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorType=' . $DebtorType . '">' . _('Review all notes for this Customer Type') .'</a> </div>'; @@ -151,16 +152,24 @@ if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorType='.$DebtorType.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?DebtorType='.$DebtorType.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { //editing an existing - $sql = "SELECT * FROM debtortypenotes WHERE noteid=".$Id." - and typeid='".$DebtorType."'"; + $sql = "SELECT noteid, + typeid, + href, + note, + date, + priority + FROM debtortypenotes + WHERE noteid=".$Id." + AND typeid='".$DebtorType."'"; $result = DB_query($sql, $db); + //echo '<br />'.$sql; $myrow = DB_fetch_array($result); @@ -180,12 +189,12 @@ </tr>'; } else { echo '<table class="selection">'; - $_POST['noteid'] = ''; - $_POST['note'] = ''; - $_POST['href'] = ''; - $_POST['date'] = ''; - $_POST['priority'] = ''; - $_POST['typeid'] = ''; + $_POST['noteid'] = ''; + $_POST['note'] = ''; + $_POST['href'] = ''; + $_POST['date'] = ''; + $_POST['priority'] = ''; + $_POST['typeid'] = ''; } echo '<tr> @@ -214,4 +223,4 @@ } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 13:00:50
|
Revision: 4906 http://web-erp.svn.sourceforge.net/web-erp/?rev=4906&view=rev Author: tim_schofield Date: 2012-02-15 13:00:43 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AddCustomerTypeNotes.php Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2012-02-15 12:53:46 UTC (rev 4905) +++ trunk/AddCustomerTypeNotes.php 2012-02-15 13:00:43 UTC (rev 4906) @@ -28,24 +28,23 @@ //first off validate inputs sensible if (!is_long((integer)$_POST['priority'])) { $InputError = 1; - prnMsg(_('The Contact priority must be an integer.'), 'error'); + prnMsg( _('The Contact priority must be an integer.'), 'error'); } elseif (mb_strlen($_POST['note']) >200) { $InputError = 1; - prnMsg(_("The contact's notes must be two hundred characters or less long"), 'error'); + prnMsg( _('The contacts notes must be two hundred characters or less long'), 'error'); } elseif( trim($_POST['note']) == '' ) { $InputError = 1; - prnMsg( _("The contact's notes may not be empty"), 'error'); + prnMsg( _('The contacts notes may not be empty'), 'error'); } - if ($Id AND $InputError !=1) { + if ($Id and $InputError !=1) { - $sql = "UPDATE debtortypenotes SET - note='" . $_POST['note'] . "', - date='" . $_POST['date'] . "', - href='" . $_POST['href'] . "', - priority='" . $_POST['priority'] . "' - WHERE typeid ='".$DebtorType."' - AND noteid='".$Id."'"; + $sql = "UPDATE debtortypenotes SET note='" . $_POST['note'] . "', + date='" . $_POST['date'] . "', + href='" . $_POST['href'] . "', + priority='" . $_POST['priority'] . "' + WHERE typeid ='".$DebtorType."' + AND noteid='".$Id."'"; $msg = _('Customer Group Notes') . ' ' . $DebtorType . ' ' . _('has been updated'); } elseif ($InputError !=1) { @@ -54,11 +53,11 @@ note, date, priority) - VALUES ('" . $DebtorType. "', - '" . $_POST['href'] . "', - '" . $_POST['note'] . "', - '" . $_POST['date'] . "', - '" . $_POST['priority'] . "')"; + VALUES ('" . $DebtorType. "', + '" . $_POST['href'] . "', + '" . $_POST['note'] . "', + '" . $_POST['date'] . "', + '" . $_POST['priority'] . "')"; $msg = _('The contact group notes record has been added'); } @@ -71,45 +70,48 @@ unset($_POST['note']); unset($_POST['noteid']); } - } elseif (isset($_GET['delete'])) { +} elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' - $sql="DELETE FROM debtortypenotes + $sql="DELETE FROM debtortypenotes WHERE noteid='".$Id."' AND typeid='".$DebtorType."'"; - $result = DB_query($sql,$db); - //echo '<br />'.$sql; + $result = DB_query($sql,$db); - echo '<br />'; - prnMsg( _('The contact group note record has been deleted'), 'success'); - unset($Id); - unset($_GET['delete']); + echo '<br />'; + prnMsg( _('The contact group note record has been deleted'), 'success'); + unset($Id); + unset($_GET['delete']); - } +} if (!isset($Id)) { - $SQLname="SELECT * from debtortype where typeid='".$DebtorType."'"; - $Result = DB_query($SQLname,$db); - $row = DB_fetch_array($Result); - echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . - '" alt="" />' . _('Notes for Customer Type').': <b>' .$row['typename'].'</b> - </p> + $SQLname="SELECT typename from debtortype where typeid='".$DebtorType."'"; + $result = DB_query($SQLname,$db); + $myrow = DB_fetch_array($result); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="" />' . _('Notes for Customer Type').': <b>' .$myrow['typename'].'</b></p> <br />'; - - $sql = "SELECT * FROM debtortypenotes where typeid='".$DebtorType."' ORDER BY date DESC"; + $sql = "SELECT noteid, + typeid, + href, + note, + date, + priority + FROM debtortypenotes + WHERE typeid='".$DebtorType."' + ORDER BY date DESC"; $result = DB_query($sql,$db); + //echo '<br />'.$sql; - echo '<table class="selection"> - <tr> + echo '<table class="selection">'; + echo '<tr> <th>' . _('Date') . '</th> <th>' . _('Note') . '</th> <th>' . _('href') . '</th> - <th>' . _('Priority') . '</th> - </tr>'; + <th>' . _('Priority') . '</th>'; $k=0; //row colour counter @@ -126,24 +128,23 @@ <td>%s</td> <td>%s</td> <td><a href="%sId=%s&DebtorType=%s">'. _('Edit').' </td> - <td><a href="%sId=%s&DebtorType=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer type note?') . '\');">'. _('Delete'). '</td> - </tr>', - $myrow[4], - $myrow[3], - $myrow[2], - $myrow[5], - htmlspecialchars($_SERVER['PHP_SELF']) . '?', - $myrow[0], - $myrow[1], - htmlspecialchars($_SERVER['PHP_SELF']) . '?', - $myrow[0], - $myrow[1]); + <td><a href="%sId=%s&DebtorType=%s&delete=1">'. _('Delete'). '</td></tr>', + $myrow['date'], + $myrow['note'], + $myrow['href'], + $myrow['priority'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', + $myrow['noteid'], + $myrow['typeid'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', + $myrow['noteid'], + $myrow['typeid']); } //END WHILE LIST LOOP echo '</table>'; } -if (isset($Id)) { +if (isset($Id)) { echo '<div class="centre"> <a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorType=' . $DebtorType . '">' . _('Review all notes for this Customer Type') .'</a> </div>'; @@ -151,16 +152,24 @@ if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorType='.$DebtorType.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?DebtorType='.$DebtorType.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { //editing an existing - $sql = "SELECT * FROM debtortypenotes WHERE noteid=".$Id." - and typeid='".$DebtorType."'"; + $sql = "SELECT noteid, + typeid, + href, + note, + date, + priority + FROM debtortypenotes + WHERE noteid=".$Id." + AND typeid='".$DebtorType."'"; $result = DB_query($sql, $db); + //echo '<br />'.$sql; $myrow = DB_fetch_array($result); @@ -180,12 +189,12 @@ </tr>'; } else { echo '<table class="selection">'; - $_POST['noteid'] = ''; - $_POST['note'] = ''; - $_POST['href'] = ''; - $_POST['date'] = ''; - $_POST['priority'] = ''; - $_POST['typeid'] = ''; + $_POST['noteid'] = ''; + $_POST['note'] = ''; + $_POST['href'] = ''; + $_POST['date'] = ''; + $_POST['priority'] = ''; + $_POST['typeid'] = ''; } echo '<tr> @@ -214,4 +223,4 @@ } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 12:53:58
|
Revision: 4905 http://web-erp.svn.sourceforge.net/web-erp/?rev=4905&view=rev Author: tim_schofield Date: 2012-02-15 12:53:46 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AgedDebtors.php Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2012-02-15 12:39:49 UTC (rev 4904) +++ trunk/AgedDebtors.php 2012-02-15 12:53:46 UTC (rev 4905) @@ -17,9 +17,9 @@ $PageNumber = 0; $line_height = 12; - /*Now figure out the aged analysis for the customer range under review */ + /*Now figure out the aged analysis for the customer range under review */ if (trim($_POST['Salesman'])!=''){ - $SalesLimit = " AND debtorsmaster.debtorno IN (SELECT DISTINCT debtorno FROM custbranch where salesman = '".$_POST['Salesman']."') "; + $SalesLimit = " AND debtorsmaster.debtorno IN (SELECT DISTINCT debtorno FROM custbranch WHERE salesman = '".$_POST['Salesman']."') "; } else { $SalesLimit = ""; } @@ -34,7 +34,7 @@ holdreasons.reasondescription, SUM( debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ) as balance, + ) AS balance, SUM( CASE WHEN (paymentterms.daysbeforedue > 0) THEN @@ -84,7 +84,6 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, - currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -96,87 +95,86 @@ } elseif ($_POST['All_Or_Overdues']=='OverduesOnly') { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - currencies.currency, - currencies.decimalplaces, - paymentterms.terms, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription, + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + currencies.currency, + currencies.decimalplaces, + paymentterms.terms, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription, SUM( - debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ) AS balance, + debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ) AS balance, SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= paymentterms.daysbeforedue - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0 ) THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END END - ) AS due, + ) AS due, SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END END - ) AS overdue1, + ) AS overdue1, SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END END - ) AS overdue2 + ) AS overdue2 FROM debtorsmaster, - paymentterms, - holdreasons, - currencies, - debtortrans - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = debtortrans.debtorno + paymentterms, + holdreasons, + currencies, + debtortrans + WHERE debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.currcode = currencies.currabrev + AND debtorsmaster.holdreason = holdreasons.reasoncode + AND debtorsmaster.debtorno = debtortrans.debtorno AND debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' - AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' - AND debtorsmaster.currcode ='" . $_POST['Currency'] . "' + AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' + AND debtorsmaster.currcode ='" . $_POST['Currency'] . "' " . $SalesLimit . " GROUP BY debtorsmaster.debtorno, - debtorsmaster.name, - currencies.currency, - currencies.decimalplaces, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription + debtorsmaster.name, + currencies.currency, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription HAVING SUM( CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + THEN CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END END - ) > 0.01"; + ) > 0.01"; } elseif ($_POST['All_Or_Overdues']=='HeldOnly'){ @@ -247,7 +245,6 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, - currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -285,9 +282,9 @@ $TotOD1=0; $TotOD2=0; - $ListCount = DB_num_rows($CustomerResult); + $ListCount = DB_num_rows($CustomerResult); $CurrDecimalPlaces =2; //by default - + while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ $CurrDecimalPlaces = $AgedAnalysis['decimalplaces']; $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces); @@ -311,100 +308,100 @@ $YPos -=$line_height; if ($YPos < $Bottom_Margin + $line_height){ - include('includes/PDFAgedDebtorsPageHeader.inc'); + include('includes/PDFAgedDebtorsPageHeader.inc'); } if ($_POST['DetailedReport']=='Yes'){ - /*draw a line under the customer aged analysis*/ - $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); + /*draw a line under the customer aged analysis*/ + $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); - $sql = "SELECT systypes.typename, - debtortrans.transno, - debtortrans.trandate, - (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) as balance, + $sql = "SELECT systypes.typename, + debtortrans.transno, + debtortrans.trandate, + (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) as balance, (CASE WHEN (paymentterms.daysbeforedue > 0) THEN - (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= paymentterms.daysbeforedue - then debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) + (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= paymentterms.daysbeforedue + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) ELSE - (CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0 - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) + (CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0 + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) END) AS due, (CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + THEN (CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END) - ELSE + ELSE (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) END) AS overdue1, (CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + THEN (CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) + ELSE (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) END) AS overdue2 FROM debtorsmaster, - paymentterms, - debtortrans, - systypes + paymentterms, + debtortrans, + systypes WHERE systypes.typeid = debtortrans.type - AND debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.debtorno = debtortrans.debtorno - AND debtortrans.debtorno = '" . $AgedAnalysis['debtorno'] . "' - AND ABS(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)>0.004"; + AND debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.debtorno = debtortrans.debtorno + AND debtortrans.debtorno = '" . $AgedAnalysis['debtorno'] . "' + AND ABS(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)>0.004"; - $DetailResult = DB_query($sql,$db,'','',False,False); /*Dont trap errors */ - if (DB_error_no($db) !=0) { - $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; - include('includes/header.inc'); - prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); - echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; - if ($debug==1){ - echo '<br />' . _('The SQL that failed was') . '<br />' . $sql; + $DetailResult = DB_query($sql,$db,'','',False,False); /*Dont trap errors */ + if (DB_error_no($db) !=0) { + $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; + include('includes/header.inc'); + prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; + if ($debug==1){ + echo '<br />' . _('The SQL that failed was') . '<br />' . $sql; + } + include('includes/footer.inc'); + exit; } - include('includes/footer.inc'); - exit; - } - while ($DetailTrans = DB_fetch_array($DetailResult)){ + while ($DetailTrans = DB_fetch_array($DetailResult)){ - $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,60,$FontSize,$DetailTrans['typename'],'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,60,$FontSize,$DetailTrans['transno'],'left'); - $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,60,$FontSize,$DetailTrans['typename'],'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,60,$FontSize,$DetailTrans['transno'],'left'); + $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); - $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); - $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); - $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); - $LeftOvers = $pdf->addTextWrap(340,$YPos,60,$FontSize,$DisplayDue,'right'); - $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayOverdue1,'right'); - $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayOverdue2,'right'); + $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); + $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); + $LeftOvers = $pdf->addTextWrap(340,$YPos,60,$FontSize,$DisplayDue,'right'); + $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayOverdue1,'right'); + $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayOverdue2,'right'); - $YPos -=$line_height; - if ($YPos < $Bottom_Margin + $line_height){ - $PageNumber++; - include('includes/PDFAgedDebtorsPageHeader.inc'); - } + $YPos -=$line_height; + if ($YPos < $Bottom_Margin + $line_height){ + $PageNumber++; + include('includes/PDFAgedDebtorsPageHeader.inc'); + } - } /*end while there are detail transactions to show */ - $FontSize=8; - /*draw a line under the detailed transactions before the next customer aged analysis*/ - $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); + } /*end while there are detail transactions to show */ + $FontSize=8; + /*draw a line under the detailed transactions before the next customer aged analysis*/ + $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); } /*Its a detailed report */ } /*end customer aged analysis while loop */ @@ -432,7 +429,7 @@ if ($ListCount == 0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg(_('There are no customers meeting the criteria specified with balances to list'),'info'); + prnMsg(_('There are no customers with balances meeting the criteria specified to list'),'info'); echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; @@ -446,14 +443,13 @@ $title=_('Aged Debtor Analysis'); include('includes/header.inc'); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - if ((!isset($_POST['FromCriteria']) || !isset($_POST['ToCriteria']))) { + if ((!isset($_POST['FromCriteria']) or !isset($_POST['ToCriteria']))) { /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post"> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> <table class="selection"> <tr> @@ -494,11 +490,11 @@ $result=DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ - if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ + if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ echo '<option selected="selected" value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } else { - echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } + } else { + echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; + } } echo '</select></td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 12:53:58
|
Revision: 4905 http://web-erp.svn.sourceforge.net/web-erp/?rev=4905&view=rev Author: tim_schofield Date: 2012-02-15 12:53:46 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Merge from Tims branch and bring Phils code in line with coding guidelines Modified Paths: -------------- trunk/AgedDebtors.php Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2012-02-15 12:39:49 UTC (rev 4904) +++ trunk/AgedDebtors.php 2012-02-15 12:53:46 UTC (rev 4905) @@ -17,9 +17,9 @@ $PageNumber = 0; $line_height = 12; - /*Now figure out the aged analysis for the customer range under review */ + /*Now figure out the aged analysis for the customer range under review */ if (trim($_POST['Salesman'])!=''){ - $SalesLimit = " AND debtorsmaster.debtorno IN (SELECT DISTINCT debtorno FROM custbranch where salesman = '".$_POST['Salesman']."') "; + $SalesLimit = " AND debtorsmaster.debtorno IN (SELECT DISTINCT debtorno FROM custbranch WHERE salesman = '".$_POST['Salesman']."') "; } else { $SalesLimit = ""; } @@ -34,7 +34,7 @@ holdreasons.reasondescription, SUM( debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ) as balance, + ) AS balance, SUM( CASE WHEN (paymentterms.daysbeforedue > 0) THEN @@ -84,7 +84,6 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, - currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -96,87 +95,86 @@ } elseif ($_POST['All_Or_Overdues']=='OverduesOnly') { - $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name, - currencies.currency, - currencies.decimalplaces, - paymentterms.terms, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription, + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + currencies.currency, + currencies.decimalplaces, + paymentterms.terms, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription, SUM( - debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ) AS balance, + debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ) AS balance, SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= paymentterms.daysbeforedue - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0 ) THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END END - ) AS due, + ) AS due, SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END END - ) AS overdue1, + ) AS overdue1, SUM( - CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END END - ) AS overdue2 + ) AS overdue2 FROM debtorsmaster, - paymentterms, - holdreasons, - currencies, - debtortrans - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = debtortrans.debtorno + paymentterms, + holdreasons, + currencies, + debtortrans + WHERE debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.currcode = currencies.currabrev + AND debtorsmaster.holdreason = holdreasons.reasoncode + AND debtorsmaster.debtorno = debtortrans.debtorno AND debtorsmaster.debtorno >= '" . $_POST['FromCriteria'] . "' - AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' - AND debtorsmaster.currcode ='" . $_POST['Currency'] . "' + AND debtorsmaster.debtorno <= '" . $_POST['ToCriteria'] . "' + AND debtorsmaster.currcode ='" . $_POST['Currency'] . "' " . $SalesLimit . " GROUP BY debtorsmaster.debtorno, - debtorsmaster.name, - currencies.currency, - currencies.decimalplaces, - paymentterms.terms, - paymentterms.daysbeforedue, - paymentterms.dayinfollowingmonth, - debtorsmaster.creditlimit, - holdreasons.dissallowinvoices, - holdreasons.reasondescription + debtorsmaster.name, + currencies.currency, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription HAVING SUM( CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + THEN CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END END - ) > 0.01"; + ) > 0.01"; } elseif ($_POST['All_Or_Overdues']=='HeldOnly'){ @@ -247,7 +245,6 @@ GROUP BY debtorsmaster.debtorno, debtorsmaster.name, currencies.currency, - currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth, @@ -285,9 +282,9 @@ $TotOD1=0; $TotOD2=0; - $ListCount = DB_num_rows($CustomerResult); + $ListCount = DB_num_rows($CustomerResult); $CurrDecimalPlaces =2; //by default - + while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ $CurrDecimalPlaces = $AgedAnalysis['decimalplaces']; $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces); @@ -311,100 +308,100 @@ $YPos -=$line_height; if ($YPos < $Bottom_Margin + $line_height){ - include('includes/PDFAgedDebtorsPageHeader.inc'); + include('includes/PDFAgedDebtorsPageHeader.inc'); } if ($_POST['DetailedReport']=='Yes'){ - /*draw a line under the customer aged analysis*/ - $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); + /*draw a line under the customer aged analysis*/ + $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); - $sql = "SELECT systypes.typename, - debtortrans.transno, - debtortrans.trandate, - (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) as balance, + $sql = "SELECT systypes.typename, + debtortrans.transno, + debtortrans.trandate, + (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) as balance, (CASE WHEN (paymentterms.daysbeforedue > 0) THEN - (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= paymentterms.daysbeforedue - then debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) + (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= paymentterms.daysbeforedue + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) ELSE - (CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0 - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) + (CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0 + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) END) AS due, (CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + THEN (CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END) - ELSE + ELSE (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) END) AS overdue1, (CASE WHEN (paymentterms.daysbeforedue > 0) - THEN + THEN (CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) - ELSE + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) + ELSE (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") - THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc - ELSE 0 END) + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) END) AS overdue2 FROM debtorsmaster, - paymentterms, - debtortrans, - systypes + paymentterms, + debtortrans, + systypes WHERE systypes.typeid = debtortrans.type - AND debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.debtorno = debtortrans.debtorno - AND debtortrans.debtorno = '" . $AgedAnalysis['debtorno'] . "' - AND ABS(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)>0.004"; + AND debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.debtorno = debtortrans.debtorno + AND debtortrans.debtorno = '" . $AgedAnalysis['debtorno'] . "' + AND ABS(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)>0.004"; - $DetailResult = DB_query($sql,$db,'','',False,False); /*Dont trap errors */ - if (DB_error_no($db) !=0) { - $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; - include('includes/header.inc'); - prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); - echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; - if ($debug==1){ - echo '<br />' . _('The SQL that failed was') . '<br />' . $sql; + $DetailResult = DB_query($sql,$db,'','',False,False); /*Dont trap errors */ + if (DB_error_no($db) !=0) { + $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; + include('includes/header.inc'); + prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; + if ($debug==1){ + echo '<br />' . _('The SQL that failed was') . '<br />' . $sql; + } + include('includes/footer.inc'); + exit; } - include('includes/footer.inc'); - exit; - } - while ($DetailTrans = DB_fetch_array($DetailResult)){ + while ($DetailTrans = DB_fetch_array($DetailResult)){ - $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,60,$FontSize,$DetailTrans['typename'],'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,60,$FontSize,$DetailTrans['transno'],'left'); - $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,60,$FontSize,$DetailTrans['typename'],'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,60,$FontSize,$DetailTrans['transno'],'left'); + $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); - $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); - $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); - $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); - $LeftOvers = $pdf->addTextWrap(340,$YPos,60,$FontSize,$DisplayDue,'right'); - $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayOverdue1,'right'); - $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayOverdue2,'right'); + $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); + $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); + $LeftOvers = $pdf->addTextWrap(340,$YPos,60,$FontSize,$DisplayDue,'right'); + $LeftOvers = $pdf->addTextWrap(400,$YPos,60,$FontSize,$DisplayOverdue1,'right'); + $LeftOvers = $pdf->addTextWrap(460,$YPos,60,$FontSize,$DisplayOverdue2,'right'); - $YPos -=$line_height; - if ($YPos < $Bottom_Margin + $line_height){ - $PageNumber++; - include('includes/PDFAgedDebtorsPageHeader.inc'); - } + $YPos -=$line_height; + if ($YPos < $Bottom_Margin + $line_height){ + $PageNumber++; + include('includes/PDFAgedDebtorsPageHeader.inc'); + } - } /*end while there are detail transactions to show */ - $FontSize=8; - /*draw a line under the detailed transactions before the next customer aged analysis*/ - $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); + } /*end while there are detail transactions to show */ + $FontSize=8; + /*draw a line under the detailed transactions before the next customer aged analysis*/ + $pdf->line($Page_Width-$Right_Margin, $YPos+10,$Left_Margin, $YPos+10); } /*Its a detailed report */ } /*end customer aged analysis while loop */ @@ -432,7 +429,7 @@ if ($ListCount == 0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg(_('There are no customers meeting the criteria specified with balances to list'),'info'); + prnMsg(_('There are no customers with balances meeting the criteria specified to list'),'info'); echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; @@ -446,14 +443,13 @@ $title=_('Aged Debtor Analysis'); include('includes/header.inc'); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - if ((!isset($_POST['FromCriteria']) || !isset($_POST['ToCriteria']))) { + if ((!isset($_POST['FromCriteria']) or !isset($_POST['ToCriteria']))) { /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post"> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> <table class="selection"> <tr> @@ -494,11 +490,11 @@ $result=DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ - if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ + if ($myrow['currabrev'] == $_SESSION['CompanyRecord']['currencydefault']){ echo '<option selected="selected" value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } else { - echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; - } + } else { + echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; + } } echo '</select></td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 12:40:00
|
Revision: 4904 http://web-erp.svn.sourceforge.net/web-erp/?rev=4904&view=rev Author: tim_schofield Date: 2012-02-15 12:39:49 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Ensure all PHP keywords are in lower case for consistency across the code base, and tidy up the code Modified Paths: -------------- trunk/SupplierTenderCreate.php Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2012-02-15 10:15:55 UTC (rev 4903) +++ trunk/SupplierTenderCreate.php 2012-02-15 12:39:49 UTC (rev 4904) @@ -12,11 +12,11 @@ $identifier=$_GET['identifier']; } -if (isset($_GET['New']) AND isset($_SESSION['tender'.$identifier])) { +if (isset($_GET['New']) and isset($_SESSION['tender'.$identifier])) { unset($_SESSION['tender'.$identifier]); } -if (isset($_GET['New']) AND $_SESSION['CanCreateTender']==0) { +if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -26,7 +26,7 @@ exit; } -if (isset($_GET['Edit']) AND $_SESSION['CanCreateTender']==0) { +if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -75,10 +75,9 @@ WHERE tenderid='" . $_GET['ID'] . "'"; $result=DB_query($sql, $db); while ($myrow=DB_fetch_array($result)) { - $_SESSION['tender'.$identifier]->add_supplier_to_tender( - $myrow['supplierid'], - $myrow['suppname'], - $myrow['email']); + $_SESSION['tender'.$identifier]->add_supplier_to_tender($myrow['supplierid'], + $myrow['suppname'], + $myrow['email']); } $sql="SELECT tenderid, @@ -93,14 +92,13 @@ WHERE tenderid='" . $_GET['ID'] . "'"; $result=DB_query($sql, $db); while ($myrow=DB_fetch_array($result)) { - $_SESSION['tender'.$identifier]->add_item_to_tender( - $_SESSION['tender'.$identifier]->LinesOnTender, - $myrow['stockid'], - $myrow['quantity'], - $myrow['description'], - $myrow['units'], - $myrow['decimalplaces'], - DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + $_SESSION['tender'.$identifier]->add_item_to_tender($_SESSION['tender'.$identifier]->LinesOnTender, + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['units'], + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); } $ShowTender = 1; } @@ -196,7 +194,7 @@ $ShowTender = 1; } -if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -219,15 +217,15 @@ $ShowTender = 1; } -if (!isset($_SESSION['tender'.$identifier]) - OR isset($_POST['LookupDeliveryAddress']) - OR $ShowTender==1) { - +if (!isset($_SESSION['tender'.$identifier]) + or isset($_POST['LookupDeliveryAddress']) + or $ShowTender==1) { + /* Show Tender header screen */ if (!isset($_SESSION['tender'.$identifier])) { $_SESSION['tender'.$identifier]=new Tender(); } - echo '<form name="form1" action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier) . '" method="post">'; + echo '<form name="form1" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier='.$identifier . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; echo '<tr> @@ -238,7 +236,7 @@ <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredByDate" size="11" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td> </tr>'; - if (!isset($_POST['StkLocation']) OR $_POST['StkLocation']==''){ + if (!isset($_POST['StkLocation']) or $_POST['StkLocation']==''){ /* If this is the first time * the form loaded set up defaults */ @@ -330,7 +328,7 @@ $LocnResult = DB_query($sql,$db); while ($LocnRow=DB_fetch_array($LocnResult)){ - if ((isset($_SESSION['tender'.$identifier]->Location) AND $_SESSION['tender'.$identifier]->Location == $LocnRow['loccode'])){ + if ((isset($_SESSION['tender'.$identifier]->Location) and $_SESSION['tender'.$identifier]->Location == $LocnRow['loccode'])){ echo '<option selected="selected" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } else { echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; @@ -439,9 +437,9 @@ <input type="submit" name="Items" value="' . _('Select Item Details') . '" /> </div> <br />'; - if ($_SESSION['tender'.$identifier]->LinesOnTender > 0 - AND $_SESSION['tender'.$identifier]->SuppliersOnTender > 0) { - + if ($_SESSION['tender'.$identifier]->LinesOnTender > 0 + and $_SESSION['tender'.$identifier]->SuppliersOnTender > 0) { + echo '<div class="centre"> <input type="submit" name="Save" value="' . _('Save Tender') . '" /> </div>'; @@ -451,13 +449,13 @@ exit; } -if (isset($_POST['SearchSupplier']) OR isset($_POST['Go']) - OR isset($_POST['Next']) OR isset($_POST['Previous'])) { - - if (mb_strlen($_POST['Keywords']) > 0 AND mb_strlen($_POST['SupplierCode']) > 0) { +if (isset($_POST['SearchSupplier']) or isset($_POST['Go']) + or isset($_POST['Next']) or isset($_POST['Previous'])) { + + if (mb_strlen($_POST['Keywords']) > 0 and mb_strlen($_POST['SupplierCode']) > 0) { prnMsg( '<br />' . _('Supplier name keywords have been used in preference to the Supplier code extract entered'), 'info' ); } - if ($_POST['Keywords'] == '' AND $_POST['SupplierCode'] == '') { + if ($_POST['Keywords'] == '' and $_POST['SupplierCode'] == '') { $SQL = "SELECT supplierid, suppname, currcode, @@ -540,7 +538,7 @@ } if (isset($_POST['SearchSupplier'])) { - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier) . '" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier, ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $ListCount = DB_num_rows($result); $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); @@ -577,23 +575,22 @@ <br /> <br /> <table cellpadding="2" colspan="7">'; - $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Supplier Name') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Address 1') . '</th> - <th>' . _('Address 2') . '</th> - <th>' . _('Address 3') . '</th> - <th>' . _('Address 4') . '</th> - </tr>'; - echo $TableHeader; + echo '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; $j = 1; $k = 0; //row counter to determine background colour $RowIndex = 0; if (DB_num_rows($result) <> 0) { DB_data_seek($result, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); } - while (($myrow = DB_fetch_array($result)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { + while (($myrow = DB_fetch_array($result)) and ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { if ($k == 1) { echo '<tr class="EvenTableRows">'; $k = 0; @@ -619,7 +616,7 @@ /*The supplier has chosen option 2 */ if (isset($_POST['Items'])) { - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier) . '" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier, ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; $sql = "SELECT categoryid, @@ -686,7 +683,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items required on this tender').'</p>'; - if ($_POST['Keywords'] AND $_POST['StockCode']) { + if ($_POST['Keywords'] and $_POST['StockCode']) { prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); } if ($_POST['Keywords']) { @@ -701,11 +698,11 @@ ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' + AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, @@ -715,12 +712,12 @@ ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' + AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.description " . LIKE . " '$SearchString' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } @@ -736,11 +733,11 @@ ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' + AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, @@ -750,12 +747,12 @@ ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' + AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } @@ -771,7 +768,7 @@ AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, @@ -785,7 +782,7 @@ AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } } @@ -794,7 +791,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 AND $debug==1){ + if (DB_num_rows($SearchResult)==0 and $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -806,17 +803,15 @@ if (isset($SearchResult)) { - echo '<table cellpadding="1" colspan="7">'; + echo '<table cellpadding="1">'; + echo '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; - $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Image') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; - echo $TableHeader; - $i = 0; $k = 0; //row colour counter $PartsDisplayed=0; @@ -833,13 +828,12 @@ $FileName = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $FileName . '" width="50" height="50" />'; } else { $ImageSource = '<i>'._('No Image').'</i>'; } - echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> <td>'.$myrow['units'].'</td> @@ -849,13 +843,12 @@ <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> </tr>'; - $i++; #end of page full new headings if } #end of while loop echo '</table>'; - + echo '<a name="end"></a> <br /> <div class="centre"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 12:40:00
|
Revision: 4904 http://web-erp.svn.sourceforge.net/web-erp/?rev=4904&view=rev Author: tim_schofield Date: 2012-02-15 12:39:49 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Ensure all PHP keywords are in lower case for consistency across the code base, and tidy up the code Modified Paths: -------------- trunk/SupplierTenderCreate.php Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2012-02-15 10:15:55 UTC (rev 4903) +++ trunk/SupplierTenderCreate.php 2012-02-15 12:39:49 UTC (rev 4904) @@ -12,11 +12,11 @@ $identifier=$_GET['identifier']; } -if (isset($_GET['New']) AND isset($_SESSION['tender'.$identifier])) { +if (isset($_GET['New']) and isset($_SESSION['tender'.$identifier])) { unset($_SESSION['tender'.$identifier]); } -if (isset($_GET['New']) AND $_SESSION['CanCreateTender']==0) { +if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -26,7 +26,7 @@ exit; } -if (isset($_GET['Edit']) AND $_SESSION['CanCreateTender']==0) { +if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -75,10 +75,9 @@ WHERE tenderid='" . $_GET['ID'] . "'"; $result=DB_query($sql, $db); while ($myrow=DB_fetch_array($result)) { - $_SESSION['tender'.$identifier]->add_supplier_to_tender( - $myrow['supplierid'], - $myrow['suppname'], - $myrow['email']); + $_SESSION['tender'.$identifier]->add_supplier_to_tender($myrow['supplierid'], + $myrow['suppname'], + $myrow['email']); } $sql="SELECT tenderid, @@ -93,14 +92,13 @@ WHERE tenderid='" . $_GET['ID'] . "'"; $result=DB_query($sql, $db); while ($myrow=DB_fetch_array($result)) { - $_SESSION['tender'.$identifier]->add_item_to_tender( - $_SESSION['tender'.$identifier]->LinesOnTender, - $myrow['stockid'], - $myrow['quantity'], - $myrow['description'], - $myrow['units'], - $myrow['decimalplaces'], - DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + $_SESSION['tender'.$identifier]->add_item_to_tender($_SESSION['tender'.$identifier]->LinesOnTender, + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['units'], + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); } $ShowTender = 1; } @@ -196,7 +194,7 @@ $ShowTender = 1; } -if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -219,15 +217,15 @@ $ShowTender = 1; } -if (!isset($_SESSION['tender'.$identifier]) - OR isset($_POST['LookupDeliveryAddress']) - OR $ShowTender==1) { - +if (!isset($_SESSION['tender'.$identifier]) + or isset($_POST['LookupDeliveryAddress']) + or $ShowTender==1) { + /* Show Tender header screen */ if (!isset($_SESSION['tender'.$identifier])) { $_SESSION['tender'.$identifier]=new Tender(); } - echo '<form name="form1" action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier) . '" method="post">'; + echo '<form name="form1" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier='.$identifier . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; echo '<tr> @@ -238,7 +236,7 @@ <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredByDate" size="11" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td> </tr>'; - if (!isset($_POST['StkLocation']) OR $_POST['StkLocation']==''){ + if (!isset($_POST['StkLocation']) or $_POST['StkLocation']==''){ /* If this is the first time * the form loaded set up defaults */ @@ -330,7 +328,7 @@ $LocnResult = DB_query($sql,$db); while ($LocnRow=DB_fetch_array($LocnResult)){ - if ((isset($_SESSION['tender'.$identifier]->Location) AND $_SESSION['tender'.$identifier]->Location == $LocnRow['loccode'])){ + if ((isset($_SESSION['tender'.$identifier]->Location) and $_SESSION['tender'.$identifier]->Location == $LocnRow['loccode'])){ echo '<option selected="selected" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } else { echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; @@ -439,9 +437,9 @@ <input type="submit" name="Items" value="' . _('Select Item Details') . '" /> </div> <br />'; - if ($_SESSION['tender'.$identifier]->LinesOnTender > 0 - AND $_SESSION['tender'.$identifier]->SuppliersOnTender > 0) { - + if ($_SESSION['tender'.$identifier]->LinesOnTender > 0 + and $_SESSION['tender'.$identifier]->SuppliersOnTender > 0) { + echo '<div class="centre"> <input type="submit" name="Save" value="' . _('Save Tender') . '" /> </div>'; @@ -451,13 +449,13 @@ exit; } -if (isset($_POST['SearchSupplier']) OR isset($_POST['Go']) - OR isset($_POST['Next']) OR isset($_POST['Previous'])) { - - if (mb_strlen($_POST['Keywords']) > 0 AND mb_strlen($_POST['SupplierCode']) > 0) { +if (isset($_POST['SearchSupplier']) or isset($_POST['Go']) + or isset($_POST['Next']) or isset($_POST['Previous'])) { + + if (mb_strlen($_POST['Keywords']) > 0 and mb_strlen($_POST['SupplierCode']) > 0) { prnMsg( '<br />' . _('Supplier name keywords have been used in preference to the Supplier code extract entered'), 'info' ); } - if ($_POST['Keywords'] == '' AND $_POST['SupplierCode'] == '') { + if ($_POST['Keywords'] == '' and $_POST['SupplierCode'] == '') { $SQL = "SELECT supplierid, suppname, currcode, @@ -540,7 +538,7 @@ } if (isset($_POST['SearchSupplier'])) { - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier) . '" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier, ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $ListCount = DB_num_rows($result); $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); @@ -577,23 +575,22 @@ <br /> <br /> <table cellpadding="2" colspan="7">'; - $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Supplier Name') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Address 1') . '</th> - <th>' . _('Address 2') . '</th> - <th>' . _('Address 3') . '</th> - <th>' . _('Address 4') . '</th> - </tr>'; - echo $TableHeader; + echo '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; $j = 1; $k = 0; //row counter to determine background colour $RowIndex = 0; if (DB_num_rows($result) <> 0) { DB_data_seek($result, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); } - while (($myrow = DB_fetch_array($result)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { + while (($myrow = DB_fetch_array($result)) and ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { if ($k == 1) { echo '<tr class="EvenTableRows">'; $k = 0; @@ -619,7 +616,7 @@ /*The supplier has chosen option 2 */ if (isset($_POST['Items'])) { - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier) . '" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier, ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; $sql = "SELECT categoryid, @@ -686,7 +683,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items required on this tender').'</p>'; - if ($_POST['Keywords'] AND $_POST['StockCode']) { + if ($_POST['Keywords'] and $_POST['StockCode']) { prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); } if ($_POST['Keywords']) { @@ -701,11 +698,11 @@ ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' + AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, @@ -715,12 +712,12 @@ ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' + AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.description " . LIKE . " '$SearchString' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } @@ -736,11 +733,11 @@ ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' + AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, @@ -750,12 +747,12 @@ ON stockmaster.categoryid=stockcategory.categoryid WHERE stockmaster.mbflag!='D' AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' + AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } @@ -771,7 +768,7 @@ AND stockmaster.mbflag!='K' AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, @@ -785,7 +782,7 @@ AND stockmaster.mbflag!='G' AND stockmaster.discontinued!=1 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid + ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DisplayRecordsMax']; } } @@ -794,7 +791,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 AND $debug==1){ + if (DB_num_rows($SearchResult)==0 and $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -806,17 +803,15 @@ if (isset($SearchResult)) { - echo '<table cellpadding="1" colspan="7">'; + echo '<table cellpadding="1">'; + echo '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; - $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Image') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; - echo $TableHeader; - $i = 0; $k = 0; //row colour counter $PartsDisplayed=0; @@ -833,13 +828,12 @@ $FileName = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $FileName . '" width="50" height="50" />'; } else { $ImageSource = '<i>'._('No Image').'</i>'; } - echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> <td>'.$myrow['units'].'</td> @@ -849,13 +843,12 @@ <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> </tr>'; - $i++; #end of page full new headings if } #end of while loop echo '</table>'; - + echo '<a name="end"></a> <br /> <div class="centre"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 10:16:06
|
Revision: 4903 http://web-erp.svn.sourceforge.net/web-erp/?rev=4903&view=rev Author: tim_schofield Date: 2012-02-15 10:15:55 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Ensure all PHP keywords are in lower case for consistency across the code base Modified Paths: -------------- trunk/AddCustomerContacts.php Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2012-02-15 06:47:20 UTC (rev 4902) +++ trunk/AddCustomerContacts.php 2012-02-15 10:15:55 UTC (rev 4903) @@ -34,7 +34,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['Con_ID']) AND !is_long((integer)$_POST['Con_ID'])) { + if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (mb_strlen($_POST['ContactName']) >40) { @@ -43,12 +43,12 @@ } elseif( trim($_POST['ContactName']) == '' ) { $InputError = 1; prnMsg( _('The contact name may not be empty'), 'error'); - } elseif (!IsEmailAddress($_POST['ContactEmail']) AND mb_strlen($_POST['ContactEmail'])>0){ + } elseif (!IsEmailAddress($_POST['ContactEmail']) and mb_strlen($_POST['ContactEmail'])>0){ $InputError = 1; prnMsg( _('The contact email address is not a valid email address'), 'error'); } - if (isset($Id) AND ($Id AND $InputError !=1)) { + if (isset($Id) and ($Id and $InputError !=1)) { $sql = "UPDATE custcontacts SET contactname='" . $_POST['ContactName'] . "', role='" . $_POST['ContactRole'] . "', phoneno='" . $_POST['ContactPhone'] . "', @@ -89,7 +89,7 @@ unset($_POST['ContactEmail']); unset($_POST['Con_ID']); } -} elseif (isset($_GET['delete']) AND $_GET['delete']) { +} elseif (isset($_GET['delete']) and $_GET['delete']) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' @@ -209,24 +209,24 @@ } echo '<tr><td>'. _('Contact Name') . '</td>'; - if (isset($_POST['ContactName'])) { + if (isset($_POST['ContactName'])) { echo '<td><input type="text" name="ContactName" value="' . $_POST['ContactName']. '" size="35" maxlength="40" /></td> </tr>'; - } else { + } else { echo '<td><input type="text" name="ContactName" size="35" maxlength="40" /></td> </tr>'; - } + } echo '<tr> <td>' . _('Role') . '</td>'; - if (isset($_POST['ContactRole'])) { - echo '<td><input type="text" name="ContactRole" value="'. $_POST['ContactRole']. '" size="35" maxlength="40" /></td> + if (isset($_POST['ContactRole'])) { + echo '<td><input type="text" name="ContactRole" value="'. $_POST['ContactRole']. '" size="35" maxlength="40" /></td> </tr>'; - } else { - echo '<td><input type="text" name="ContactRole" size="35" maxlength="40" /></td> + } else { + echo '<td><input type="text" name="ContactRole" size="35" maxlength="40" /></td> </tr>'; - } + } echo '<tr><td>' . _('Phone') . '</td>'; - if (isset($_POST['ContactPhone'])) { + if (isset($_POST['ContactPhone'])) { echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> </tr>'; } else { @@ -241,7 +241,7 @@ } else { echo '<td><input type="text" name="ContactEmail" size="55" maxlength="55" /></td> </tr>'; - } + } echo '<tr> <td>' . _('Notes') . '</td>'; if (isset($_POST['ContactNotes'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 10:16:06
|
Revision: 4903 http://web-erp.svn.sourceforge.net/web-erp/?rev=4903&view=rev Author: tim_schofield Date: 2012-02-15 10:15:55 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Ensure all PHP keywords are in lower case for consistency across the code base Modified Paths: -------------- trunk/AddCustomerContacts.php Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2012-02-15 06:47:20 UTC (rev 4902) +++ trunk/AddCustomerContacts.php 2012-02-15 10:15:55 UTC (rev 4903) @@ -34,7 +34,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['Con_ID']) AND !is_long((integer)$_POST['Con_ID'])) { + if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (mb_strlen($_POST['ContactName']) >40) { @@ -43,12 +43,12 @@ } elseif( trim($_POST['ContactName']) == '' ) { $InputError = 1; prnMsg( _('The contact name may not be empty'), 'error'); - } elseif (!IsEmailAddress($_POST['ContactEmail']) AND mb_strlen($_POST['ContactEmail'])>0){ + } elseif (!IsEmailAddress($_POST['ContactEmail']) and mb_strlen($_POST['ContactEmail'])>0){ $InputError = 1; prnMsg( _('The contact email address is not a valid email address'), 'error'); } - if (isset($Id) AND ($Id AND $InputError !=1)) { + if (isset($Id) and ($Id and $InputError !=1)) { $sql = "UPDATE custcontacts SET contactname='" . $_POST['ContactName'] . "', role='" . $_POST['ContactRole'] . "', phoneno='" . $_POST['ContactPhone'] . "', @@ -89,7 +89,7 @@ unset($_POST['ContactEmail']); unset($_POST['Con_ID']); } -} elseif (isset($_GET['delete']) AND $_GET['delete']) { +} elseif (isset($_GET['delete']) and $_GET['delete']) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' @@ -209,24 +209,24 @@ } echo '<tr><td>'. _('Contact Name') . '</td>'; - if (isset($_POST['ContactName'])) { + if (isset($_POST['ContactName'])) { echo '<td><input type="text" name="ContactName" value="' . $_POST['ContactName']. '" size="35" maxlength="40" /></td> </tr>'; - } else { + } else { echo '<td><input type="text" name="ContactName" size="35" maxlength="40" /></td> </tr>'; - } + } echo '<tr> <td>' . _('Role') . '</td>'; - if (isset($_POST['ContactRole'])) { - echo '<td><input type="text" name="ContactRole" value="'. $_POST['ContactRole']. '" size="35" maxlength="40" /></td> + if (isset($_POST['ContactRole'])) { + echo '<td><input type="text" name="ContactRole" value="'. $_POST['ContactRole']. '" size="35" maxlength="40" /></td> </tr>'; - } else { - echo '<td><input type="text" name="ContactRole" size="35" maxlength="40" /></td> + } else { + echo '<td><input type="text" name="ContactRole" size="35" maxlength="40" /></td> </tr>'; - } + } echo '<tr><td>' . _('Phone') . '</td>'; - if (isset($_POST['ContactPhone'])) { + if (isset($_POST['ContactPhone'])) { echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> </tr>'; } else { @@ -241,7 +241,7 @@ } else { echo '<td><input type="text" name="ContactEmail" size="55" maxlength="55" /></td> </tr>'; - } + } echo '<tr> <td>' . _('Notes') . '</td>'; if (isset($_POST['ContactNotes'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-15 06:47:27
|
Revision: 4902 http://web-erp.svn.sourceforge.net/web-erp/?rev=4902&view=rev Author: daintree Date: 2012-02-15 06:47:20 +0000 (Wed, 15 Feb 2012) Log Message: ----------- more tidying Modified Paths: -------------- trunk/AddCustomerContacts.php Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2012-02-15 06:47:04 UTC (rev 4901) +++ trunk/AddCustomerContacts.php 2012-02-15 06:47:20 UTC (rev 4902) @@ -22,11 +22,9 @@ $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . - ' ' . _('Contacts for Customer') . ': <b>' .$row['name'].'</b></p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Contacts for Customer') . ': <b>' .$row['name'].'</b></p><br />'; } else { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . - ' ' . _('Edit contact for'). ': <b>' .$row['name'].'</b></p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Edit contact for'). ': <b>' .$row['name'].'</b></p><br />'; } if ( isset($_POST['submit']) ) { @@ -36,7 +34,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { + if (isset($_POST['Con_ID']) AND !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (mb_strlen($_POST['ContactName']) >40) { @@ -45,12 +43,12 @@ } elseif( trim($_POST['ContactName']) == '' ) { $InputError = 1; prnMsg( _('The contact name may not be empty'), 'error'); - } elseif (!IsEmailAddress($_POST['ContactEmail']) and mb_strlen($_POST['ContactEmail'])>0){ + } elseif (!IsEmailAddress($_POST['ContactEmail']) AND mb_strlen($_POST['ContactEmail'])>0){ $InputError = 1; prnMsg( _('The contact email address is not a valid email address'), 'error'); } - if (isset($Id) and ($Id and $InputError !=1)) { + if (isset($Id) AND ($Id AND $InputError !=1)) { $sql = "UPDATE custcontacts SET contactname='" . $_POST['ContactName'] . "', role='" . $_POST['ContactRole'] . "', phoneno='" . $_POST['ContactPhone'] . "', @@ -91,7 +89,7 @@ unset($_POST['ContactEmail']); unset($_POST['Con_ID']); } -} elseif (isset($_GET['delete']) and $_GET['delete']) { +} elseif (isset($_GET['delete']) AND $_GET['delete']) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' @@ -229,28 +227,28 @@ } echo '<tr><td>' . _('Phone') . '</td>'; if (isset($_POST['ContactPhone'])) { - echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> + echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> </tr>'; - } else { - echo '<td><input type="text" name="ContactPhone" size="35" maxlength="40" /></td> + } else { + echo '<td><input type="text" name="ContactPhone" size="35" maxlength="40" /></td> </tr>'; - } - echo '<tr> + } + echo '<tr> <td>' . _('Email') . '</td>'; - if (isset($_POST['ContactEmail'])) { - echo '<td><input type="text" name="ContactEmail" value="' . $_POST['ContactEmail'] . '" size="55" maxlength="55" /></td> + if (isset($_POST['ContactEmail'])) { + echo '<td><input type="text" name="ContactEmail" value="' . $_POST['ContactEmail'] . '" size="55" maxlength="55" /></td> </tr>'; - } else { - echo '<td><input type="text" name="ContactEmail" size="55" maxlength="55" /></td> + } else { + echo '<td><input type="text" name="ContactEmail" size="55" maxlength="55" /></td> </tr>'; } echo '<tr> <td>' . _('Notes') . '</td>'; - if (isset($_POST['ContactNotes'])) { - echo '<td><textarea name="ContactNotes">'. $_POST['ContactNotes'] . '</textarea>'; - } else { - echo '<td><textarea name="ContactNotes"></textarea>'; - } + if (isset($_POST['ContactNotes'])) { + echo '<td><textarea name="ContactNotes">'. $_POST['ContactNotes'] . '</textarea>'; + } else { + echo '<td><textarea name="ContactNotes"></textarea>'; + } echo '<tr> <td colspan="2"> <div class="centre"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-02-15 06:47:26
|
Revision: 4902 http://web-erp.svn.sourceforge.net/web-erp/?rev=4902&view=rev Author: daintree Date: 2012-02-15 06:47:20 +0000 (Wed, 15 Feb 2012) Log Message: ----------- more tidying Modified Paths: -------------- trunk/AddCustomerContacts.php Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2012-02-15 06:47:04 UTC (rev 4901) +++ trunk/AddCustomerContacts.php 2012-02-15 06:47:20 UTC (rev 4902) @@ -22,11 +22,9 @@ $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . - ' ' . _('Contacts for Customer') . ': <b>' .$row['name'].'</b></p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Contacts for Customer') . ': <b>' .$row['name'].'</b></p><br />'; } else { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . - ' ' . _('Edit contact for'). ': <b>' .$row['name'].'</b></p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Edit contact for'). ': <b>' .$row['name'].'</b></p><br />'; } if ( isset($_POST['submit']) ) { @@ -36,7 +34,7 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { + if (isset($_POST['Con_ID']) AND !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (mb_strlen($_POST['ContactName']) >40) { @@ -45,12 +43,12 @@ } elseif( trim($_POST['ContactName']) == '' ) { $InputError = 1; prnMsg( _('The contact name may not be empty'), 'error'); - } elseif (!IsEmailAddress($_POST['ContactEmail']) and mb_strlen($_POST['ContactEmail'])>0){ + } elseif (!IsEmailAddress($_POST['ContactEmail']) AND mb_strlen($_POST['ContactEmail'])>0){ $InputError = 1; prnMsg( _('The contact email address is not a valid email address'), 'error'); } - if (isset($Id) and ($Id and $InputError !=1)) { + if (isset($Id) AND ($Id AND $InputError !=1)) { $sql = "UPDATE custcontacts SET contactname='" . $_POST['ContactName'] . "', role='" . $_POST['ContactRole'] . "', phoneno='" . $_POST['ContactPhone'] . "', @@ -91,7 +89,7 @@ unset($_POST['ContactEmail']); unset($_POST['Con_ID']); } -} elseif (isset($_GET['delete']) and $_GET['delete']) { +} elseif (isset($_GET['delete']) AND $_GET['delete']) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' @@ -229,28 +227,28 @@ } echo '<tr><td>' . _('Phone') . '</td>'; if (isset($_POST['ContactPhone'])) { - echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> + echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> </tr>'; - } else { - echo '<td><input type="text" name="ContactPhone" size="35" maxlength="40" /></td> + } else { + echo '<td><input type="text" name="ContactPhone" size="35" maxlength="40" /></td> </tr>'; - } - echo '<tr> + } + echo '<tr> <td>' . _('Email') . '</td>'; - if (isset($_POST['ContactEmail'])) { - echo '<td><input type="text" name="ContactEmail" value="' . $_POST['ContactEmail'] . '" size="55" maxlength="55" /></td> + if (isset($_POST['ContactEmail'])) { + echo '<td><input type="text" name="ContactEmail" value="' . $_POST['ContactEmail'] . '" size="55" maxlength="55" /></td> </tr>'; - } else { - echo '<td><input type="text" name="ContactEmail" size="55" maxlength="55" /></td> + } else { + echo '<td><input type="text" name="ContactEmail" size="55" maxlength="55" /></td> </tr>'; } echo '<tr> <td>' . _('Notes') . '</td>'; - if (isset($_POST['ContactNotes'])) { - echo '<td><textarea name="ContactNotes">'. $_POST['ContactNotes'] . '</textarea>'; - } else { - echo '<td><textarea name="ContactNotes"></textarea>'; - } + if (isset($_POST['ContactNotes'])) { + echo '<td><textarea name="ContactNotes">'. $_POST['ContactNotes'] . '</textarea>'; + } else { + echo '<td><textarea name="ContactNotes"></textarea>'; + } echo '<tr> <td colspan="2"> <div class="centre"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |