Browse files

Should fix #620

  • Loading branch information...
1 parent 3abe0a5 commit 0288c5ce97d37fcb49f9a2aa01926bc6b48cc813 Andrew Smith committed Jun 16, 2010
Showing with 22 additions and 21 deletions.
  1. +1 −1 addons/ajax/gtdajax.js
  2. +4 −2 defaultconfig.inc.php
  3. +1 −1 gtd_constants.inc.php
  4. +14 −0 gtdfuncs.inc.php
  5. +0 −17 gtdfuncs.js
  6. +2 −0 processPreferences.php
View
2 addons/ajax/gtdajax.js
@@ -732,7 +732,7 @@ function createAjaxEditor(cell,EditorConstructor) {
return false;
}
/* ======================================================================================
- context toggling - author Aur�lien Bompard
+ context toggling - author Aurélien Bompard
*/
function toggleContext(e) {
/*
View
6 defaultconfig.inc.php
@@ -1,8 +1,11 @@
<?php
+
+// DO NOT MESS WITH THIS FILE! IF YOU WANT TO CHANGE YOUR PREFERENCES,
+// DO SO WITHIN THE APPLICATION'S CONFIG SCREEN. NOT HERE.
+
/********* Interface Settings ************/
// The following settings change settings for the user interface.
-// These can be left at their default values, or changed if you have a different preference.
$config=array();
$config["title"]= 'GTD-PHP'; // site name (appears at the top of each page)
$config["datemask"] = 'Y-m-d D'; // date format - required
@@ -38,7 +41,6 @@
/********* Behavior Settings ************/
// The following settings change how the interface behaves.
-// These can be left at their default values, or changed if you have a different preference.
$config["contextsummary"] = 'all'; //all | nextaction (Show all actions on context report, or nextactions only?)
$config["afterCreate"] = array ( // parent | item | list | another - default view after creating an item
View
2 gtd_constants.inc.php
@@ -1,5 +1,5 @@
<?php
-define('_GTD_REVISION',614);
+define('_GTD_REVISION',615);
define('_GTD_VERSION','0.8z.09'); // DATABASE version
define('_GTDPHP_VERSION','0.9beta'); // gtd-php version, as per the TRAC system
View
14 gtdfuncs.inc.php
@@ -727,11 +727,25 @@ function retrieveConfig() {
else
$_SESSION[$key]=$_SESSION['config'][$key]=$val;
+ checkConfigFields();
+
// go through the list of installed addons, and register them
foreach($_SESSION['addons'] as $addon=>$dummy)
getEvents($addon);
}
//----------------------------------------------------------------
+function checkConfigFields() {
+ // TODO do something clever with compulsory config fields - maybe some flag in defaultconfig
+ // But for now, we'll just brute-force it:
+ $compulsory_fields=array('datemask', 'separator', 'charset');
+ if ( false===(@include 'defaultconfig.inc.php') || !isset($config) ) return;
+ foreach ($config as $key=>$val) {
+ if (!array_key_exists($key,$_SESSION['config']) ||
+ (in_array($key, $compulsory_fields) && empty($_SESSION['config'][$key])) )
+ $_SESSION['config'][$key] = $val;
+ }
+}
+//----------------------------------------------------------------
function savePerspective($values) {
// first save the view to a table
if (query('newperspective',$values)) {
View
17 gtdfuncs.js
@@ -936,23 +936,6 @@ GTD.ParentSelector.prototype.makeline=function gtd_ps_ml(id,title,type,typename,
return line.get(0);
-/*
- var line=document.createElement('p'),
- thisi='',
- that=this,
- anchor=document.createElement('a'),
- linetext=title;
- anchor.href='#';
- $(anchor).click(function anchor_click() {
- that.gotparent(id,title,type,typename,thisi);
- });
- anchor.appendChild(document.createTextNode('+'));
- anchor.className='add';
- line.appendChild(anchor);
- if (useTypes) {linetext += " ("+typename+")";}
- line.appendChild(document.createTextNode(linetext));
- line.style.display=(!useTypes || typename===onetype)?'block':'none';
- return line;*/
};
// -------------------------------------------------------------------------
GTD.ParentSelector.prototype.refinesearch=function gtd_ps_rs(needle) {
View
2 processPreferences.php
@@ -77,6 +77,8 @@ function cleanpref($field) {
if (strtolower($_SESSION['config']['charset'])==='utf-8') checkUTF8();
+checkConfigFields();
+
log_value('Changed preferences stored in session:',$_SESSION);
$result=saveConfig(); // store preferences in the table

0 comments on commit 0288c5c

Please sign in to comment.