From: <rc...@us...> - 2015-01-04 18:02:38
|
Revision: 7061 http://sourceforge.net/p/web-erp/reponame/7061 Author: rchacon Date: 2015-01-04 18:02:35 +0000 (Sun, 04 Jan 2015) Log Message: ----------- In SystemParameters.php, remove root path to config.php and add comments. Modified Paths: -------------- trunk/SystemParameters.php trunk/doc/Change.log Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2015-01-04 14:02:33 UTC (rev 7060) +++ trunk/SystemParameters.php 2015-01-04 18:02:35 UTC (rev 7061) @@ -1,18 +1,20 @@ <?php - /* $Id$*/ +/* This script is for maintenance of the system parameters. */ include('includes/session.inc'); -$Title = _('System Parameters'); -$ViewTopic= 'GettingStarted'; -$BookMark = 'SystemConfiguration'; +$Title = _('System Parameters');// Screen identificator. +$ViewTopic= 'GettingStarted';// Filename's id in ManualContents.php's TOC. +$BookMark = 'SystemConfiguration';// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme. + '/images/maintenance.png" title="' .// Title icon. + $Title . '" />' .// Icon title. + $Title . '</p>';// Page title. + include('includes/CountriesArray.php'); -echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Supplier Types') - . '" alt="" />' . $Title. '</p>'; - if (isset($_POST['submit'])) { //initialise no input errors assumed initially before we test @@ -117,26 +119,25 @@ if ($_SESSION['DefaultDateFormat'] != $_POST['X_DefaultDateFormat'] ) { $sql[] = "UPDATE config SET confvalue = '".$_POST['X_DefaultDateFormat']."' WHERE confname = 'DefaultDateFormat'"; } - if ($_SESSION['DefaultTheme'] != $_POST['X_DefaultTheme'] ) {// If not equal, update the default theme. + if($_SESSION['DefaultTheme'] != $_POST['X_DefaultTheme']) {// If not equal, update the default theme. $sql[] = "UPDATE config SET confvalue = '".$_POST['X_DefaultTheme']."' WHERE confname = 'DefaultTheme'"; - // BEGIN Update config.php: - $FileName = $RootPath . 'config.php'; - $fhandle = fopen($FileName,"r"); + // BEGIN: Update the config.php file: + $fhandle = fopen('config.php', 'r'); if($fhandle) { - $content = fread($fhandle,filesize($FileName)); - $content = str_replace(" ;", ";", $content);// Clean space before end-of-php-line. - $content = str_replace("'".$_SESSION['DefaultTheme']."';", "'".$_POST['X_DefaultTheme']."';", $content); - $fhandle = fopen($FileName,"w"); + $content = fread($fhandle, filesize('config.php')); + $content = str_replace(' ;\n', ';\n', $content);// Clean space before the end-of-php-line. + $content = str_replace('\''.$_SESSION['DefaultTheme'].'\';', '\''.$_POST['X_DefaultTheme'].'\';', $content); + $fhandle = fopen('config.php','w'); if(!fwrite($fhandle,$content)) { - prnMsg(_("Cannot write to the configuration file").' '.$FileName,'error'); + prnMsg(_('Cannot write to the configuration file.'), 'error'); } else { - prnMsg(_("The configuration file was updated"),'info'); + prnMsg(_('The configuration file was updated.'), 'info'); } fclose($fhandle); } else { - prnMsg(_("Cannot open the configuration file").' '.$FileName,'error'); + prnMsg(_('Cannot open the configuration file.'), 'error'); } - // END Update config.php. + // END: Update the config.php file. } if ($_SESSION['PastDueDays1'] != $_POST['X_PastDueDays1'] ) { $sql[] = "UPDATE config SET confvalue = '".$_POST['X_PastDueDays1']."' WHERE confname = 'PastDueDays1'"; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-01-04 14:02:33 UTC (rev 7060) +++ trunk/doc/Change.log 2015-01-04 18:02:35 UTC (rev 7061) @@ -1,5 +1,6 @@ webERP Change Log +04/01/15 RChacon: In SystemParameters.php, remove root path to config.php and add comments. 01/01/15 RChacon: Move default theme from session.inc to config.php. Add the ability to change the default theme in SystemParameters.php. 01/01/15 Exson: Make StockCategories.php strict sql mode compatible. 28/12/14 RChacon: Standardise labels and texts in Prices_Customer.php SpecialOrder.php and WWW_Access.php. Add $ViewTopic and $BookMark to WWW_Access.php |