Commit 585f1ef1 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Fix reading in options file.

parent 7df9728f
<?php //Do not edit this file by hand, it will be overwritten by the configuration utility.
$TIMESHEET_CONFIG['items_per_page'] = '4';
$TIMESHEET_CONFIG['approval_by'] = '2';
?>
......@@ -63,7 +63,7 @@ while ( $row = $q->fetchRow()) {
*/
$config_options = array(
"heading1" => $AppUI->_('Timesheet rights'),
"items_per_page" => array(
"approval_by" => array(
"description" => $AppUI->_('Approval by'),
"value" => '',
'type' => 'select',
......@@ -74,7 +74,6 @@ $config_options = array(
//if this is a submitted page, overwrite the config file.
if(dPgetParam( $_POST, "Save", '' )!='')
{
if (is_writable($CONFIG_FILE)) {
if (!$handle = fopen($CONFIG_FILE, 'w')) {
$AppUI->setMsg( $CONFIG_FILE." ".$AppUI->_('cannot be opened'), UI_MSG_ERROR );
......@@ -120,14 +119,13 @@ if(dPgetParam( $_POST, "Save", '' )!='')
$AppUI->redirect("m=system&a=viewmods");
}
//$HELPDESK_CONFIG = array();
//$TIMESHEET_CONFIG = array();
require_once( $CONFIG_FILE );
//Read the current config values from the config file and update the array.
foreach ($config_options as $key=>$value){
if(isset($TIMESHEET_CONFIG[$key])){
$config_options[$key]['value']=$HELPDESK_CONFIG[$key];
$config_options[$key]['value']=$TIMESHEET_CONFIG[$key];
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment