[Tutos-commits] SF.net SVN: tutos:[857] trunk/php
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
                
                Brought to you by:
                
                    gokohnert
                    
                
            
            
        
        
        
    | 
     
      
      
      From: <gok...@us...> - 2012-12-07 19:19:03
      
     
   | 
Revision: 857
          http://tutos.svn.sourceforge.net/tutos/?rev=857&view=rev
Author:   gokohnert
Date:     2012-12-07 19:18:56 +0000 (Fri, 07 Dec 2012)
Log Message:
-----------
fix
Modified Paths:
--------------
    trunk/php/admin/restore.php
    trunk/php/help.php
    trunk/php/minical.php
    trunk/php/minitimer.php
    trunk/php/task.pinc
Modified: trunk/php/admin/restore.php
===================================================================
--- trunk/php/admin/restore.php	2012-12-07 13:53:12 UTC (rev 856)
+++ trunk/php/admin/restore.php	2012-12-07 19:18:56 UTC (rev 857)
@@ -26,8 +26,6 @@
     }
 }
 
-
-
 $zipname  = $tutos[sessionpath] .'/backup.zip';
 $dbbackup = $tutos[sessionpath] .'/dbbackup';
 
@@ -38,16 +36,22 @@
 }
 $_SESSION['dbnr'] = $dbnr;
 $dbconn = DB_Open($dbnr,false);
+if (!is_object($dbconn)) {
+    die ('No database with id '.$dbnr.' found');
+}
 
+$current_user = new tutos_user($dbconn);
+$current_user->f_name = 'TUTOS';
+$current_user->m_name = '';
+$current_user->l_name = '(remember service)';
+$current_user->admin = 1;
+
 $lang = array();
 ReadLang($lang);
 
 $l = new Restore($current_user);
 $l->PageHeader('RESTORE');
 
-if (!is_object($dbconn)) {
-    die ('No database with id '.$dbnr.' found');
-}
 
 if (!file_exists($zipname)) {
     die('<br>Restore of '. $zipname .' failed ! File is not readable or does not exist<br />');
Modified: trunk/php/help.php
===================================================================
--- trunk/php/help.php	2012-12-07 13:53:12 UTC (rev 856)
+++ trunk/php/help.php	2012-12-07 19:18:56 UTC (rev 857)
@@ -1,6 +1,6 @@
 <?php
 /**
- *  Copyright 1999 - 2011 by Gero Kohnert
+ *  Copyright 1999 - 2012 by Gero Kohnert
  *
  *  This program is free software; you can redistribute it and/or modify it
  *  under the terms of the GNU General Public License as published by the
@@ -31,6 +31,7 @@
     function Like($fld1,$name,$fld2 = "",$fld3 = "",$not=false) {}
     function Like2($fld,$name,$not=false) {}
     function needCount() { return false; }
+    function getFullName() { return 'dummy db'; }
 }
 
 /**
Modified: trunk/php/minical.php
===================================================================
--- trunk/php/minical.php	2012-12-07 13:53:12 UTC (rev 856)
+++ trunk/php/minical.php	2012-12-07 19:18:56 UTC (rev 857)
@@ -1,6 +1,6 @@
 <?php
 /**
- *  Copyright 1999 - 2011 by Gero Kohnert
+ *  Copyright 1999 - 2012 by Gero Kohnert
  *
  *  This program is free software; you can redistribute it and/or modify it
  *  under the terms of the GNU General Public License as published by the
@@ -14,12 +14,17 @@
 session_write_close();
 loadlayout();
 
+class dummy extends layout {
+    Function info() {}
+    Function prepare() {}
+}
+
 $d = Date("d");
 $m = Date("n");
 $y = Date("Y");
 $f = "default";
 
-$l = new layout($current_user);
+$l = new dummy($current_user);
 echo $l->PrintHeader("MiniCal");
 
 if (isset($_GET['f']) ) {
@@ -177,5 +182,5 @@
 ?>
 <!--
 SVN Info  $Id$
-     $Author$
-     -->
\ No newline at end of file
+$Author$
+-->
\ No newline at end of file
Modified: trunk/php/minitimer.php
===================================================================
--- trunk/php/minitimer.php	2012-12-07 13:53:12 UTC (rev 856)
+++ trunk/php/minitimer.php	2012-12-07 19:18:56 UTC (rev 857)
@@ -1,5 +1,6 @@
 <?php
 /*
+ *  Copyright 1999 - 2012 by Gero Kohnert
  *
  *  This program is free software; you can redistribute it and/or modify it
  *  under the terms of the GNU General Public License as published by the
@@ -18,7 +19,12 @@
 check_user();
 loadlayout();
 
-$l = new layout($current_user);
+class dummy extends layout {
+    Function info() {}
+    Function prepare() {}
+}
+
+$l = new dummy($current_user);
 echo $l->PrintHeader("MiniTimer");
 
 $f = $_GET['f'];
Modified: trunk/php/task.pinc
===================================================================
--- trunk/php/task.pinc	2012-12-07 13:53:12 UTC (rev 856)
+++ trunk/php/task.pinc	2012-12-07 19:18:56 UTC (rev 857)
@@ -24,8 +24,7 @@
     $stc = getObject($current_user->dbconn,$tutos['task_state_stc']);
     if (!is_object($stc)) {
         $stc = new Stc(null);
-        $x = new Task($current_user->dbconn);
-        $stc->initByArray('TaskStates',$x->c_state);
+        $stc->initByArray('TaskStates',task::$c_state);
     }
 
     $r = "<select id=\"state\" name=\"state\">\n";
@@ -470,10 +469,10 @@
      */
     protected $showurl = 'task_show.php';
 
-    protected $c_state = array(TASK_PRE => "yellow",
-                               TASK_RUNNING => "orange",
-                               TASK_FINISH => "lightgreen",
-                               TASK_OVERDUE => "red"
+    static public $c_state = array(TASK_PRE => "yellow",
+                                   TASK_RUNNING => "orange",
+                                   TASK_FINISH => "lightgreen",
+                                   TASK_OVERDUE => "red"
         );
 
     /**
@@ -917,7 +916,7 @@
         $stc = getObject($this->dbconn,$tutos['task_state_stc']);
         if (!is_object($stc)) {
             $stc = new stc(null);
-            $stc->initByArray('TaskStates',$this->c_state);
+            $stc->initByArray('TaskStates',task::$c_state);
         }
         $r .= $stc->states[$s]->color;
         return $r;
@@ -974,7 +973,7 @@
         $stc = getObject($this->dbconn,$tutos['task_state_stc']);
         if (!is_object($stc)) {
             $stc = new stc(null);
-            $stc->initByArray('TaskStates',$this->c_state);
+            $stc->initByArray('TaskStates',task::$c_state);
         }
         $r .= $stc->getState($s);
         return $r;
@@ -990,7 +989,7 @@
         $stc = getObject($this->dbconn,$tutos['task_state_stc']);
         if (!is_object($stc)) {
             $stc = new stc(null);
-            $stc->initByArray('TaskStates',$this->c_state);
+            $stc->initByArray('TaskStates',task::$c_state);
         }
         $stc->stateowner = $this;
         $r .= $stc->getStateSelection($this->state,'state');
@@ -1322,7 +1321,7 @@
         $stc = getObject($this->dbconn,$tutos['task_state_stc']);
         if (!is_object($stc)) {
             $stc = new stc(null);
-            $stc->initByArray('TaskStates',$this->c_state);
+            $stc->initByArray('TaskStates',task::$c_state);
         }
 
         // set the real start
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |