phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] etemplate/inc class.soetemplate.inc.php class.b...


From: Caeies
Subject: [Phpgroupware-cvs] etemplate/inc class.soetemplate.inc.php class.b...
Date: Sun, 03 Sep 2006 17:00:05 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    etemplate
Changes by:     Caeies <Caeies> 06/09/03 17:00:05

Modified files:
        inc            : class.soetemplate.inc.php 
                         class.boetemplate.inc.php 

Log message:
        E_ALL fix

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.soetemplate.inc.php?cvsroot=phpgroupware&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.boetemplate.inc.php?cvsroot=phpgroupware&r1=1.35&r2=1.36

Patches:
Index: class.soetemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.soetemplate.inc.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- class.soetemplate.inc.php   5 May 2005 14:31:54 -0000       1.29
+++ class.soetemplate.inc.php   3 Sep 2006 17:00:05 -0000       1.30
@@ -10,7 +10,7 @@
        *  option) any later version.                                           
   *
        
\**************************************************************************/
 
-       /* $Id: class.soetemplate.inc.php,v 1.29 2005/05/05 14:31:54 powerstat 
Exp $ */
+       /* $Id: class.soetemplate.inc.php,v 1.30 2006/09/03 17:00:05 Caeies Exp 
$ */
 
        /*!
        @class soetemplate
@@ -96,11 +96,12 @@
                */
                function num2chrs($num)
                {
+                       $chrs = '';
                        $min = ord('A');
                        $max = ord('Z') - $min + 1;
                        if ($num >= $max)
                        {
-                               $chrs = chr(($num / $max) + $min - 1);
+                               $chrs .= chr(($num / $max) + $min - 1);
                        }
                        $chrs .= chr(($num % $max) + $min);
 
@@ -142,7 +143,20 @@
                        reset($this->db_cols);
                        while (list($db_col,$col) = each($this->db_cols))
                        {
-                               $this->$col = is_array($name) ? $name[$col] : 
$$col;
+                               if(is_array($name))
+                               {
+                                       if(isset($name[$col]))
+                                       {
+                                               $this->$col = $name[$col];
+                                       }
+                               }
+                               else
+                               {
+                                       if(isset($$col))
+                                       {
+                                               $this->$col = $$col;
+                                       }
+                               }
                        }
                        if ($this->template == 'default')
                        {
@@ -189,7 +203,7 @@
                        {
                                echo 
"<p>soetemplate::read('$this->name','$this->template','$this->lang',$this->group,'$this->version')</p>\n";
                        }
-                       if 
(($GLOBALS['phpgw_info']['server']['eTemplate-source'] == 'files' ||
+                       if 
(isset($GLOBALS['phpgw_info']['server']['eTemplate-source']) && 
($GLOBALS['phpgw_info']['server']['eTemplate-source'] == 'files' ||
                             
$GLOBALS['phpgw_info']['server']['eTemplate-source'] == 'xslt') && 
$this->readfile())
                        {
                                return True;
@@ -415,7 +429,7 @@
                                                        
$this->data[$row][$col]['type'] = $cell['type'][0];
                                                        //echo "corrected in 
$this->name cell $col$row attribute type<br>\n";
                                                }
-                                               if (is_array($cell['align']))
+                                               if (isset($cell['align']) && 
is_array($cell['align']))
                                                {
                                                        
$this->data[$row][$col]['align'] = $cell['align'][0];
                                                        //echo "corrected in 
$this->name cell $col$row attribute align<br>\n";
@@ -469,7 +483,7 @@
                        reset($this->db_cols);
                        while (list($db_col,$col) = each($this->db_cols))
                        {
-                               if ($col != 'data' || $data_too)
+                               if (isset($this->$col) && ($col != 'data' || 
$data_too) )
                                {
                                        $arr[$col] = $this->$col;
                                }
@@ -835,14 +849,14 @@
                {
                        list($app) = explode('.',$app);
 
-                       if (!$app || 
$GLOBALS['phpgw_info']['etemplate']['import_tested'][$app])
+                       if (!$app || 
(isset($GLOBALS['phpgw_info']['etemplate']) && 
$GLOBALS['phpgw_info']['etemplate']['import_tested'][$app]) )
                        {
                                return '';      // ensure test is done only 
once per call and app
                        }
                        
$GLOBALS['phpgw_info']['etemplate']['import_tested'][$app] = True;      // need 
to be done before new ...
 
                        $path = 
PHPGW_SERVER_ROOT."/$app/setup/etemplates.inc.php";
-
+                       $ret = false;
                        if ($time = @filemtime($path))
                        {
                                $templ = new soetemplate(".$app",'','##');

Index: class.boetemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.boetemplate.inc.php,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- class.boetemplate.inc.php   21 Apr 2003 20:29:18 -0000      1.35
+++ class.boetemplate.inc.php   3 Sep 2006 17:00:05 -0000       1.36
@@ -10,7 +10,7 @@
        *  option) any later version.                                           
   *
        
\**************************************************************************/
 
-       /* $Id: class.boetemplate.inc.php,v 1.35 2003/04/21 20:29:18 ralfbecker 
Exp $ */
+       /* $Id: class.boetemplate.inc.php,v 1.36 2006/09/03 17:00:05 Caeies Exp 
$ */
 
        include_once(PHPGW_INCLUDE_ROOT . 
'/etemplate/inc/class.soetemplate.inc.php');
 
@@ -107,6 +107,10 @@
                */
                function expand_name($name,$c,$row,$c_='',$row_='',$cont='')
                {
+                       if(empty($name))
+                       {
+                               return '';
+                       }
                        if (strstr($name,'$') !== False)
                        {
                                if (!$cont)
@@ -115,8 +119,8 @@
                                }
                                $col = $this->num2chrs($c-1);   // $c-1 to get: 
0:'@', 1:'A', ...
                                $col_ = $this->num2chrs($c_-1);
-                               $row_cont = $cont[$row];
-                               $col_row_cont = $cont[$col.$row];
+                               $row_cont = isset($cont[$row]) ? $cont[$row] : 
0;
+                               $col_row_cont = isset($cont[$col.$row]) ? 
$cont[$col.$row] : 0;
 
                                eval('$name = "'.$name.'";');
                        }
@@ -152,7 +156,21 @@
                */
                function 
autorepeat_idx($cell,$c,$r,&$idx,&$idx_cname,$check_col=False)
                {
-                       $org_idx = $idx = $cell[ $cell['type'] == 'template' ? 
'size' : 'name' ];
+                       $org_idx = $idx = '';
+                       if($cell['type'] == 'template')
+                       {
+                               if(isset($cell['size']))
+                               {
+                                       $org_idx = $idx = $cell['size'];
+                               }
+                       }
+                       else
+                       {
+                               if(isset($cell['name']))
+                               {
+                                       $org_idx = $idx = $cell['name'];
+                               }
+                       }
 
                        $idx = $this->expand_name($idx,$c,$r);
                        if (!($komma = strpos($idx,',')))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]