From: <rc...@us...> - 2017-01-06 04:30:40
|
Revision: 7719 http://sourceforge.net/p/web-erp/reponame/7719 Author: rchacon Date: 2017-01-06 04:30:38 +0000 (Fri, 06 Jan 2017) Log Message: ----------- Add Turn off/on the page help and the field help. Modified Paths: -------------- trunk/GLCashFlowsIndirect.php trunk/PurchasesReport.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/UserLogin.php trunk/sql/mysql/upgrade4.13.1-4.14.sql Modified: trunk/GLCashFlowsIndirect.php =================================================================== --- trunk/GLCashFlowsIndirect.php 2017-01-06 00:44:21 UTC (rev 7718) +++ trunk/GLCashFlowsIndirect.php 2017-01-06 04:30:38 UTC (rev 7719) @@ -76,10 +76,8 @@ $Title, '" /> ', // Icon title. $Title, '<br />', // Page title, reporting statement. stripslashes($_SESSION['CompanyRecord']['coyname']), '<br />'; // Page title, reporting entity. - $Result = DB_query('SELECT lastdate_in_period FROM `periods` WHERE `periodno`=' . $_POST['PeriodFrom']); - $PeriodFromName = DB_fetch_array($Result); - $Result = DB_query('SELECT lastdate_in_period FROM `periods` WHERE `periodno`=' . $_POST['PeriodTo']); - $PeriodToName = DB_fetch_array($Result); + $PeriodFromName = DB_fetch_array(DB_query('SELECT lastdate_in_period FROM `periods` WHERE `periodno`=' . $_POST['PeriodFrom'])); + $PeriodToName = DB_fetch_array(DB_query('SELECT lastdate_in_period FROM `periods` WHERE `periodno`=' . $_POST['PeriodTo'])); echo _('From'), ' ', MonthAndYearFromSQLDate($PeriodFromName['lastdate_in_period']), ' ', _('to'), ' ', MonthAndYearFromSQLDate($PeriodToName['lastdate_in_period']), '<br />'; // Page title, reporting period. include_once('includes/CurrenciesArray.php');// Array to retrieve currency name. echo _('All amounts stated in'), ': ', _($CurrencyName[$_SESSION['CompanyRecord']['currencydefault']]), '</p>';// Page title, reporting presentation currency and level of rounding used. @@ -99,8 +97,7 @@ // Gets the net profit for the period GL account: if(!isset($_SESSION['PeriodProfitAccount'])) { $_SESSION['PeriodProfitAccount'] = ''; - $Result = DB_query("SELECT confvalue FROM `config` WHERE confname ='PeriodProfitAccount'"); - $MyRow = DB_fetch_array($Result); + $MyRow = DB_fetch_array(DB_query("SELECT confvalue FROM `config` WHERE confname ='PeriodProfitAccount'")); if($MyRow) { $_SESSION['PeriodProfitAccount'] = $MyRow['confvalue']; } @@ -470,8 +467,7 @@ INNER JOIN chartdetails ON chartmaster.accountcode=chartdetails.accountcode INNER JOIN accountgroups ON chartmaster.group_=accountgroups.groupname WHERE accountgroups.pandl=1"; - $Result1 = DB_query($Sql); - $MyRow1 = DB_fetch_array($Result1); + $MyRow1 = DB_fetch_array(DB_query($Sql)); echo colDebitCredit($MyRow1['ActualProfit']), colDebitCredit($MyRow1['LastProfit']), '</tr> @@ -488,8 +484,7 @@ WHERE accountgroups.pandl=0 AND chartdetails.accountcode!='" . $_SESSION['PeriodProfitAccount'] . "' AND chartdetails.accountcode!='" . $_SESSION['RetainedEarningsAccount'] . "'";// Gets retained earnings by the complement method to include differences. The complement method: Changes(retained earnings) = -Changes(other accounts). - $Result2 = DB_query($Sql); - $MyRow2 = DB_fetch_array($Result2); + $MyRow2 = DB_fetch_array(DB_query($Sql)); echo colDebitCredit($MyRow2['ActualRetained'] - $MyRow1['ActualProfit']), colDebitCredit($MyRow2['LastRetained'] - $MyRow1['LastProfit']), '</tr><tr>', @@ -752,7 +747,7 @@ '/images/reports.png" title="', // Icon image. $Title, '" /> ', // Icon title. $Title, '</p>';// Page title. - if(!isset($page_help) OR $page_help) {// If it is not set the $page_help parameter OR it is TRUE, shows the page help text: + if(!isset($_SESSION['ShowPageHelp']) OR $_SESSION['ShowPageHelp']) {// If it is not set the $_SESSION['ShowPageHelp'] parameter OR it is TRUE, shows the page help text: echo '<div class="page_help_text">', _('The statement of cash flows, also known as the successor of the old source and application of funds statement, reports how changes in balance sheet accounts and income affect cash and cash equivalents, and breaks the analysis down to operating, investing and financing activities.'), '<br />', _('The purpose of the statement of cash flows is to show where the company got their money from and how it was spent during the period being reported for a user selectable range of periods.'), '<br />', @@ -802,7 +797,7 @@ echo '<option',($MyRow['periodno'] == $_POST['PeriodFrom'] ? ' selected="selected"' : '' ), ' value="', $MyRow['periodno'], '">', MonthAndYearFromSQLDate($MyRow['lastdate_in_period']), '</option>'; } echo '</select>', - (!isset($field_help) || $field_help ? _('Select the beginning of the reporting period') : ''), // If it is not set the $field_help parameter OR it is TRUE, shows the page help text. + (!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Select the beginning of the reporting period') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text. '</td> </tr>', // Select period to: @@ -816,28 +811,28 @@ echo '<option',($MyRow['periodno'] == $_POST['PeriodTo'] ? ' selected="selected"' : '' ), ' value="', $MyRow['periodno'], '">', MonthAndYearFromSQLDate($MyRow['lastdate_in_period']), '</option>'; } echo '</select>', - (!isset($field_help) || $field_help ? _('Select the end of the reporting period') : ''), // If it is not set the $field_help parameter OR it is TRUE, shows the page help text. + (!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Select the end of the reporting period') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text. '</td> </tr>', // Show the budget for the period: '<tr>', - '<td><label for="ShowBudget">', _('Show the budget for the period'), ':</label></td> + '<td><label for="ShowBudget">', _('Show the budget for the period'), '</label></td> <td><input',($_POST['ShowBudget'] ? ' checked="checked"' : ''), ' id="ShowBudget" name="ShowBudget" type="checkbox">', // "Checked" if ShowBudget is set AND it is TRUE. - (!isset($field_help) || $field_help ? _('Check this box to show the budget for the period') : ''), // If it is not set the $field_help parameter OR it is TRUE, shows the page help text. + (!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Check this box to show the budget for the period') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text. '</td> </tr>', // Show accounts with zero balance: '<tr>', - '<td><label for="ShowZeroBalance">', _('Show accounts with zero balance'), ':</label></td> + '<td><label for="ShowZeroBalance">', _('Show accounts with zero balance'), '</label></td> <td><input',(isset($_POST['ShowZeroBalance']) && $_POST['ShowZeroBalance'] ? ' checked="checked"' : ''), ' id="ShowZeroBalance" name="ShowZeroBalance" type="checkbox">', // "Checked" if ShowZeroBalance is set AND it is TRUE. - (!isset($field_help) || $field_help ? _('Check this box to show all accounts including those with zero balance') : ''), // If it is not set the $field_help parameter OR it is TRUE, shows the page help text. + (!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Check this box to show all accounts including those with zero balance') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text. '</td> </tr>', // Show cash and cash equivalents accounts: '<tr>', - '<td><label for="ShowCash">', _('Show cash and cash equivalents accounts'), ':</label></td> + '<td><label for="ShowCash">', _('Show cash and cash equivalents accounts'), '</label></td> <td><input',($_POST['ShowCash'] ? ' checked="checked"' : ''), ' id="ShowCash" name="ShowCash" type="checkbox">', // "Checked" if ShowZeroBalance is set AND it is TRUE. - (!isset($field_help) || $field_help ? _('Check this box to show cash and cash equivalents accounts') : ''), // If it is not set the $field_help parameter OR it is TRUE, shows the page help text. + (!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Check this box to show cash and cash equivalents accounts') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text. '</td> </tr>', '</tbody></table>'; Modified: trunk/PurchasesReport.php =================================================================== --- trunk/PurchasesReport.php 2017-01-06 00:44:21 UTC (rev 7718) +++ trunk/PurchasesReport.php 2017-01-06 04:30:38 UTC (rev 7719) @@ -263,7 +263,7 @@ $_POST['PeriodFrom'] = date($_SESSION['DefaultDateFormat'], strtotime("-1 year", time()));// One year before current date. } echo '<td><input alt="', $_SESSION['DefaultDateFormat'], '" class="date" id="PeriodFrom" maxlength="10" minlength="0" name="PeriodFrom" required="required" size="12" type="text" value="', $_POST['PeriodFrom'], '" />', - (!isset($field_help) || $field_help ? _('Select the beginning of the reporting period') : ''), // If it is not set the $field_help parameter OR it is TRUE, shows the page help text. + (!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Select the beginning of the reporting period') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text. '</td> </tr>', // Select period to: @@ -273,14 +273,14 @@ $_POST['PeriodTo'] = date($_SESSION['DefaultDateFormat']); } echo '<td><input alt="', $_SESSION['DefaultDateFormat'], '" class="date" id="PeriodTo" maxlength="10" minlength="0" name="PeriodTo" required="required" size="12" type="text" value="', $_POST['PeriodTo'], '" />', - (!isset($field_help) || $field_help ? _('Select the end of the reporting period') : ''), // If it is not set the $field_help parameter OR it is TRUE, shows the page help text. + (!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Select the end of the reporting period') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text. '</td> </tr>', // Show the budget for the period: '<tr>', '<td><label for="ShowDetails">', _('Show details'), '</label></td> <td><input',($_POST['ShowDetails'] ? ' checked="checked"' : ''), ' id="ShowDetails" name="ShowDetails" type="checkbox">', // "Checked" if ShowDetails is set AND it is TRUE. - (!isset($field_help) || $field_help ? _('Check this box to show purchase invoices') : ''), // If it is not set the $field_help parameter OR it is TRUE, shows the page help text. + (!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Check this box to show purchase invoices') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text. '</td> </tr>', '</tbody></table>'; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2017-01-06 00:44:21 UTC (rev 7718) +++ trunk/WWW_Users.php 2017-01-06 04:30:38 UTC (rev 7719) @@ -173,12 +173,16 @@ defaultlocation='" . $_POST['DefaultLocation'] ."', modulesallowed='" . $ModulesAllowed . "', showdashboard='" . $_POST['ShowDashboard'] . "', + showpagehelp='" . $_POST['ShowPageHelp'] . "', + showfieldhelp='" . $_POST['ShowFieldHelp'] . "', blocked='" . $_POST['Blocked'] . "', pdflanguage='" . $_POST['PDFLanguage'] . "', department='" . $_POST['Department'] . "' WHERE userid = '". $SelectedUser . "'"; + prnMsg( _('The selected user record has been updated'), 'success' ); + $_SESSION['ShowPageHelp'] = $_POST['ShowPageHelp']; + $_SESSION['ShowFieldHelp'] = $_POST['ShowFieldHelp']; - prnMsg( _('The selected user record has been updated'), 'success' ); } elseif($InputError !=1) { $sql = "INSERT INTO www_users (userid, @@ -220,6 +224,8 @@ '" . $_POST['PDFLanguage'] . "', '" . $_POST['Department'] . "')"; prnMsg( _('A new user record has been inserted'), 'success' ); + $_SESSION['ShowPageHelp'] = $_POST['ShowPageHelp']; + $_SESSION['ShowFieldHelp'] = $_POST['ShowFieldHelp']; $LocationSql = "INSERT INTO locationusers (loccode, userid, @@ -267,6 +273,8 @@ unset($_POST['DefaultLocation']); unset($_POST['ModulesAllowed']); unset($_POST['ShowDashboard']); + unset($_POST['ShowPageHelp']); + unset($_POST['ShowFieldHelp']); unset($_POST['Blocked']); unset($_POST['Theme']); unset($_POST['UserLanguage']); @@ -411,6 +419,8 @@ defaultlocation, modulesallowed, showdashboard, + showpagehelp, + showfieldhelp, blocked, theme, language, @@ -438,6 +448,8 @@ $_POST['Theme'] = $myrow['theme']; $_POST['UserLanguage'] = $myrow['language']; $_POST['ShowDashboard'] = $myrow['showdashboard']; + $_POST['ShowPageHelp'] = $myrow['showpagehelp']; + $_POST['ShowFieldHelp'] = $myrow['showfieldhelp']; $_POST['Blocked'] = $myrow['blocked']; $_POST['PDFLanguage'] = $myrow['pdflanguage']; $_POST['Department'] = $myrow['department']; @@ -719,6 +731,34 @@ echo '</select></td> </tr>'; +// Turn off/on page help: +echo '<tr> + <td><label for="ShowPageHelp">', _('Display page help'), ':</label></td> + <td><select id="ShowPageHelp" name="ShowPageHelp">'; +if($_POST['ShowPageHelp']==0) { + echo '<option selected="selected" value="0">' . _('No') . '</option>', + '<option value="1">', _('Yes'), '</option>'; +} else { + echo '<option value="0">', _('No'), '</option>', + '<option selected="selected" value="1">' . _('Yes') . '</option>'; +} +echo '</select></td> + </tr>'; + +// Turn off/on field help: +echo '<tr> + <td><label for="ShowFieldHelp">', _('Display field help'), ':</label></td> + <td><select id="ShowFieldHelp" name="ShowFieldHelp">'; +if($_POST['ShowFieldHelp']==0) { + echo '<option selected="selected" value="0">' . _('No') . '</option>', + '<option value="1">', _('Yes'), '</option>'; +} else { + echo '<option value="0">', _('No'), '</option>', + '<option selected="selected" value="1">' . _('Yes') . '</option>'; +} +echo '</select></td> + </tr>'; + if(!isset($_POST['PDFLanguage'])) { $_POST['PDFLanguage']=0; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-01-06 00:44:21 UTC (rev 7718) +++ trunk/doc/Change.log 2017-01-06 04:30:38 UTC (rev 7719) @@ -1,5 +1,6 @@ webERP Change Log +06/01/17 RChacon: Add Turn off/on the page help and the field help. 05/01/17 RChacon: In GLCashFlowsIndirect.php, fix named key in Associative array with config value. Thanks Tim. 05/01/17 RChacon: For strict Standards, removes the "&" before the variable in DB_fetch_row() and in DB_fetch_array() in ConnectDB_XXX.inc. Thanks Tim. 21/12/16 RChacon: In PurchasesReport.php, fix date comparison and title. Thanks Tim. Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2017-01-06 00:44:21 UTC (rev 7718) +++ trunk/includes/UserLogin.php 2017-01-06 04:30:38 UTC (rev 7719) @@ -111,6 +111,8 @@ $_SESSION['CanCreateTender'] = $myrow['cancreatetender']; $_SESSION['AllowedDepartment'] = $myrow['department']; $_SESSION['ShowDashboard'] = $myrow['showdashboard']; + $_SESSION['ShowPageHelp'] = $myrow['showpagehelp']; + $_SESSION['ShowFieldHelp'] = $myrow['showfieldhelp']; if (isset($myrow['pdflanguage'])) { $_SESSION['PDFLanguage'] = $myrow['pdflanguage']; Modified: trunk/sql/mysql/upgrade4.13.1-4.14.sql =================================================================== --- trunk/sql/mysql/upgrade4.13.1-4.14.sql 2017-01-06 00:44:21 UTC (rev 7718) +++ trunk/sql/mysql/upgrade4.13.1-4.14.sql 2017-01-06 04:30:38 UTC (rev 7719) @@ -1,5 +1,8 @@ --- Add new script: -INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('PurchasesReport.php', '2', 'Shows a report of purchases from suppliers for the range of selected dates'); +-- Add the CashFlowsSection identificator: +ALTER TABLE `chartmaster` ADD `cashflowsactivity` TINYINT(1) NOT NULL DEFAULT '-1' COMMENT 'Cash flows activity' AFTER `group_`; +-- Add new user's options: +ALTER TABLE `www_users` ADD `showpagehelp` TINYINT(1) NOT NULL DEFAULT '1' COMMENT 'Turn off/on page help' AFTER `showdashboard`, ADD `showfieldhelp` TINYINT(1) NOT NULL DEFAULT '1' COMMENT 'Turn off/on field help' AFTER `showpagehelp`; + -- Update version number: UPDATE config SET confvalue='4.14' WHERE confname='VersionNumber'; |