|
From: <dai...@us...> - 2015-01-13 09:10:36
|
Revision: 7079
http://sourceforge.net/p/web-erp/reponame/7079
Author: daintree
Date: 2015-01-13 09:10:28 +0000 (Tue, 13 Jan 2015)
Log Message:
-----------
Modified Paths:
--------------
trunk/SystemParameters.php
trunk/config.distrib.php
trunk/sql/mysql/upgrade4.11-4.12.sql
Modified: trunk/SystemParameters.php
===================================================================
--- trunk/SystemParameters.php 2015-01-12 10:49:04 UTC (rev 7078)
+++ trunk/SystemParameters.php 2015-01-13 09:10:28 UTC (rev 7079)
@@ -119,14 +119,13 @@
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.
- $sql[] = "UPDATE config SET confvalue = '".$_POST['X_DefaultTheme']."' WHERE confname = 'DefaultTheme'";
+ if($DefaultTheme != $_POST['X_DefaultTheme']) {// If not equal, update the default theme.
// BEGIN: Update the config.php file:
$fhandle = fopen('config.php', 'r');
if($fhandle) {
$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);
+ $content = str_replace('\''.$DefaultTheme .'\';', '\''.$_POST['X_DefaultTheme'].'\';', $content);
$fhandle = fopen('config.php','w');
if(!fwrite($fhandle,$content)) {
prnMsg(_('Cannot write to the configuration file.'), 'error');
@@ -427,21 +426,25 @@
<td>' . _('The default date format for entry of dates and display.') . '</td></tr>';
// DefaultTheme:
-echo '<tr style="outline: 1px solid"><td>' . _('Default Theme') . ':</td>
- <td><select name="X_DefaultTheme">';
-$ThemeDirectories = scandir('css/');// List directories inside ~/css. Each diretory is a theme.
-foreach($ThemeDirectories as $ThemeName) {
- if(is_dir('css/'.$ThemeName) AND $ThemeName!='.' AND $ThemeName!='..' AND $ThemeName!='.svn') {
- echo '<option';
- if($_SESSION['DefaultTheme'] == $ThemeName) {
- echo ' selected="selected"';
+if (is_writable('config.php')) {
+ echo '<tr style="outline: 1px solid"><td>' . _('Default Theme') . ':</td>
+ <td><select name="X_DefaultTheme">';
+ $ThemeDirectories = scandir('css');// List directories inside ~/css. Each diretory is a theme.
+ foreach($ThemeDirectories as $ThemeName) {
+ if(is_dir('css/'.$ThemeName) AND $ThemeName!='.' AND $ThemeName!='..' AND $ThemeName!='.svn') {
+ echo '<option';
+ if ($DefaultTheme == $ThemeName) {
+ echo ' selected="selected"';
+ }
+ echo ' value="'. $ThemeName.'">' . $ThemeName . '</option>';
}
- echo ' value="'.$ThemeName.'">'.$ThemeName.'</option>';
}
+ echo '</select></td>
+ <td>' . _("The default theme to use for the login screen and the setup of new users. The users' theme selection will override it.") . '</td>
+ </tr>';
+} else {
+ echo '<input type="hidden" name="X_DefaultTheme" value="' . $DefaultTheme . '" />';
}
-echo '</select></td>
- <td>' . _("The default theme to use for the login screen and the setup of new users. The users' theme selection will override it.") . '</td></tr>';
-
// ---------- New section:
echo '<tr><th colspan="3">' . _('Accounts Receivable/Payable Settings') . '</th></tr>';
@@ -504,8 +507,8 @@
echo '<tr style="outline: 1px solid">
<td>' . _('Order Entry allows Line Item Narrative') . ':</td>
<td><select name="X_AllowOrderLineItemNarrative">
- <option '.($_SESSION['AllowOrderLineItemNarrative']=='1'?'selected="selected" ':'').'value="1">' . _('Allow Narrative Entry') . '</option>
- <option '.($_SESSION['AllowOrderLineItemNarrative']=='0'?'selected="selected" ':'').'value="0">' . _('No Narrative Line') . '</option>
+ <option ' . ($_SESSION['AllowOrderLineItemNarrative']=='1'?'selected="selected" ':'').'value="1">' . _('Allow Narrative Entry') . '</option>
+ <option ' . ($_SESSION['AllowOrderLineItemNarrative']=='0'?'selected="selected" ':'').'value="0">' . _('No Narrative Line') . '</option>
</select></td>
<td>' . _('Select whether or not to allow entry of narrative on order line items. This narrative will appear on invoices and packing slips. Useful mainly for service businesses.') . '</td>
</tr>';
@@ -516,7 +519,8 @@
echo '<tr style="outline: 1px solid">
<td>' . _('Languages to Maintain Translations for Item Descriptions') . ':</td>
<td><select name="X_ItemDescriptionLanguages[]" size="5" multiple="multiple" >';
- echo '<option value="">' . _('None') . '</option>';
+
+ echo '<option value=""' . (count($LanguagesArray)==0 ? '':'selected="selected"') . '>' . _('None') . '</option>';
foreach ($LanguagesArray as $LanguageEntry => $LanguageName){
if (isset($_POST['X_ItemDescriptionLanguages']) AND in_array($LanguageEntry,$_POST['X_ItemDescriptionLanguages'])){
echo '<option selected="selected" value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] . '</option>';
Modified: trunk/config.distrib.php
===================================================================
--- trunk/config.distrib.php 2015-01-12 10:49:04 UTC (rev 7078)
+++ trunk/config.distrib.php 2015-01-13 09:10:28 UTC (rev 7079)
@@ -11,6 +11,10 @@
// Default theme to use for the login screen and the setup of new users.
//The users' theme selection will override
+//$DefaultTheme = 'professional';
+//$DefaultTheme = 'wood';
+//$DefaultTheme = 'silverwolf';
+//$DefaultTheme = 'gel';
$DefaultTheme = 'xenos';
// Whether to display the demo login and password or not on the login screen
Modified: trunk/sql/mysql/upgrade4.11-4.12.sql
===================================================================
--- trunk/sql/mysql/upgrade4.11-4.12.sql 2015-01-12 10:49:04 UTC (rev 7078)
+++ trunk/sql/mysql/upgrade4.11-4.12.sql 2015-01-13 09:10:28 UTC (rev 7079)
@@ -146,7 +146,7 @@
--
-- Insert default theme value for login screen
--
-INSERT INTO `config` (`confname`, `confvalue`) VALUES ('DefaultTheme', 'xenos');
+
INSERT INTO scripts (`script`,`pagesecurity`,`description`) VALUES ('SalesTopCustomersInquiry.php', '2', 'Shows the top customers sales for a selected date range');
|