From: <rc...@us...> - 2015-09-13 17:21:50
|
Revision: 7348 http://sourceforge.net/p/web-erp/reponame/7348 Author: rchacon Date: 2015-09-13 17:21:49 +0000 (Sun, 13 Sep 2015) Log Message: ----------- In AccountSections.php, add modifications for direct printing. Modified Paths: -------------- trunk/AccountSections.php trunk/doc/Change.log Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2015-09-05 22:20:44 UTC (rev 7347) +++ trunk/AccountSections.php 2015-09-13 17:21:49 UTC (rev 7348) @@ -1,11 +1,11 @@ <?php /* $Id$*/ +/* Defines the sections in the general ledger reports. */ include('includes/session.inc'); $Title = _('Account Sections'); -/* Manual links before header.inc */ -$ViewTopic = 'GeneralLedger';// Filename in ManualContents.php's TOC. -$BookMark = 'AccountSections';// Anchor's id in the manual's html document. +$ViewTopic = 'GeneralLedger'; +$BookMark = 'AccountSections'; include('includes/header.inc'); // SOME TEST TO ENSURE THAT AT LEAST INCOME AND COST OF SALES ARE THERE @@ -33,13 +33,13 @@ // DONE WITH MINIMUM TESTS -if (isset($Errors)) { +if(isset($Errors)) { unset($Errors); } $Errors = array(); -if (isset($_POST['submit'])) { +if(isset($_POST['submit'])) { //initialise no input errors assumed initially before we test @@ -50,45 +50,45 @@ ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['SectionID'])) { + if(isset($_POST['SectionID'])) { $sql="SELECT sectionid FROM accountsection WHERE sectionid='".$_POST['SectionID']."'"; $result=DB_query($sql); - 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'; $i++; } } - if (ContainsIllegalCharacters($_POST['SectionName'])) { + if(ContainsIllegalCharacters($_POST['SectionName'])) { $InputError = 1; prnMsg( _('The account section name cannot contain any illegal characters') ,'error'); $Errors[$i] = 'SectionName'; $i++; } - if (mb_strlen($_POST['SectionName'])==0) { + if(mb_strlen($_POST['SectionName'])==0) { $InputError = 1; prnMsg( _('The account section name must contain at least one character') ,'error'); $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*/ @@ -96,7 +96,7 @@ WHERE sectionid = '" . $_POST['SelectedSectionID'] . "'"; $msg = _('Record Updated'); - } elseif ($InputError !=1) { + } elseif($InputError !=1) { /*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 */ @@ -108,7 +108,7 @@ $msg = _('Record inserted'); } - if ($InputError!=1){ + if($InputError!=1) { //run the SQL from either of the above possibilites $result = DB_query($sql); prnMsg($msg,'success'); @@ -117,14 +117,14 @@ unset ($_POST['SectionName']); } -} 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 'accountgroups' $sql= "SELECT COUNT(sectioninaccounts) AS sections FROM accountgroups WHERE sectioninaccounts='" . $_GET['SelectedSectionID'] . "'"; $result = DB_query($sql); $myrow = DB_fetch_array($result); - if ($myrow['sections']>0) { + if($myrow['sections']>0) { prnMsg( _('Cannot delete this account section because general ledger accounts groups have been created using this section'),'warn'); echo '<div>'; echo '<br />' . _('There are') . ' ' . $myrow['sections'] . ' ' . _('general ledger accounts groups that refer to this account section'); @@ -149,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 @@ -166,19 +166,24 @@ $ErrMsg = _('Could not get account group sections because'); $result = DB_query($sql,$ErrMsg); - echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Search') . '" />' . ' ' . $Title . '</p><br />'; +/* echo '<div id="Report">';// Division to identify the report block.*/ + echo '<p class="page_title_text"><img alt="" class="noprint" src="', $RootPath, '/css/', $Theme, + '/images/maintenance.png" title="', // Icon image. + _('Account Sections'), '" /> ', // Icon title. + _('Account Sections'), '</p>';// Page title. - echo '<table class="selection"> + echo '<br /> + <table class="selection"> <tr> - <th class="ascending">' . _('Section Number') . '</th> - <th class="ascending">' . _('Section Description') . '</th> - <th colspan="2"> </th> + <th class="ascending">', _('Section Number'), '</th> + <th class="ascending">', _('Section Description'), '</th> + <th class="noprint" colspan="2"> </th> </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { - if ($k==1){ + if($k==1) { echo '<tr class="EvenTableRows">'; $k=0; } else { @@ -186,31 +191,32 @@ $k++; } - echo '<td class="number">' . $myrow['sectionid'] . '</td> - <td>' . $myrow['sectionname'] . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?SelectedSectionID=' . urlencode($myrow['sectionid']), ENT_QUOTES, 'UTF-8') . '">' . _('Edit') . '</a></td>'; - if ( $myrow['sectionid'] == '1' or $myrow['sectionid'] == '2' ) { - echo '<td><b>' . _('Restricted') . '</b></td>'; + echo '<td class="number">', $myrow['sectionid'], '</td> + <td class="text">', $myrow['sectionname'], '</td> + <td class="noprint"><a href="', htmlspecialchars($_SERVER['PHP_SELF'], '?SelectedSectionID=', urlencode($myrow['sectionid']), ENT_QUOTES, 'UTF-8'), '">', _('Edit'), '</a></td>'; + if( $myrow['sectionid'] == '1' or $myrow['sectionid'] == '2' ) { + echo '<td class="noprint"><b>', _('Restricted'), '</b></td>'; } else { - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . '?SelectedSectionID=' . urlencode($myrow['sectionid']) . '&delete=1', ENT_QUOTES, 'UTF-8') . '">' . _('Delete') . '</a></td>'; + echo '<td class="noprint"><a href="', htmlspecialchars($_SERVER['PHP_SELF'], '?SelectedSectionID=', urlencode($myrow['sectionid']), '&delete=1', ENT_QUOTES, 'UTF-8'), '">', _('Delete'), '</a></td>'; } echo '</tr>'; } //END WHILE LIST LOOP echo '</table>'; +/* echo '</div>';// End div id="Report".*/ } //end of ifs and buts! -if (isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { +if(isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Account Sections') . '</a></div>'; } -if (! isset($_GET['delete'])) { +if(! isset($_GET['delete'])) { - echo '<form method="post" id="AccountSections" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; - echo '<div><br />'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<form action="', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), '" id="AccountSections" method="post">'; + echo '<div class="noprint"><br />'; + echo '<input name="FormID" type="hidden" value="', $_SESSION['FormID'], '" />'; - if (isset($_GET['SelectedSectionID'])) { + if(isset($_GET['SelectedSectionID'])) { //editing an existing section $sql = "SELECT sectionid, @@ -219,7 +225,7 @@ WHERE sectionid='" . $_GET['SelectedSectionID'] ."'"; $result = DB_query($sql); - if ( DB_num_rows($result) == 0 ) { + if( DB_num_rows($result) == 0 ) { prnMsg( _('Could not retrieve the requested section please try again.'),'warn'); unset($_GET['SelectedSectionID']); } else { @@ -238,13 +244,13 @@ } else { - if (!isset($_POST['SelectedSectionID'])){ + if(!isset($_POST['SelectedSectionID'])) { $_POST['SelectedSectionID']=''; } - if (!isset($_POST['SectionID'])){ + if(!isset($_POST['SectionID'])) { $_POST['SectionID']=''; } - if (!isset($_POST['SectionName'])) { + if(!isset($_POST['SectionName'])) { $_POST['SectionName']=''; } echo '<table class="selection"> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-09-05 22:20:44 UTC (rev 7347) +++ trunk/doc/Change.log 2015-09-13 17:21:49 UTC (rev 7348) @@ -1,5 +1,6 @@ webERP Change Log +13/9/15 RChacon: In AccountSections.php, add modifications for direct printing. 4/9/15 Wes Wolfenbarger: Fix to Z_ImportStocks.php added quotes to descriptions - also fixes error message when the csv does not match the template 27/08/15 Exson: Fixed the allocation status of involved invoice and credit notes in Credit_Invoice.php. 19/08/15 RChacon: In AnalysisHorizontalIncome.php, delete variable $period because it is not used anywhere (thanks Tim). Extract header.inc from if. |