phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] etemplate/inc class.boetemplate.inc.php class.d...


From: Dave Hall
Subject: [Phpgroupware-cvs] etemplate/inc class.boetemplate.inc.php class.d...
Date: Sat, 30 Sep 2006 07:10:52 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    etemplate
Changes by:     Dave Hall <skwashd>     06/09/30 07:10:52

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

Log message:
        more notices for dbtools

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.boetemplate.inc.php?cvsroot=phpgroupware&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.db_tools.inc.php?cvsroot=phpgroupware&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.soetemplate.inc.php?cvsroot=phpgroupware&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.uietemplate.inc.php?cvsroot=phpgroupware&r1=1.70&r2=1.71

Patches:
Index: class.boetemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.boetemplate.inc.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- class.boetemplate.inc.php   6 Sep 2006 11:35:33 -0000       1.38
+++ class.boetemplate.inc.php   30 Sep 2006 07:10:52 -0000      1.39
@@ -5,7 +5,7 @@
 * @author Ralf Becker <address@hidden>
 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public 
License
 * @package etemplate
-* @version $Id: class.boetemplate.inc.php,v 1.38 2006/09/06 11:35:33 skwashd 
Exp $
+* @version $Id: class.boetemplate.inc.php,v 1.39 2006/09/30 07:10:52 skwashd 
Exp $
 */
        include_once(PHPGW_INCLUDE_ROOT . 
'/etemplate/inc/class.soetemplate.inc.php');
 
@@ -502,7 +502,7 @@
                */
                function haveExtension($type,$function='')
                {
-                       return 
($GLOBALS['phpgw_info']['etemplate']['extension'][$type] || 
$this->loadExtension($type,$ui)) &&
+                       return ( 
(isset($GLOBALS['phpgw_info']['etemplate']['extension'][$type]) && 
$GLOBALS['phpgw_info']['etemplate']['extension'][$type]) || 
$this->loadExtension($type,$ui)) &&
                                        ($function == '' || 
$GLOBALS['phpgw_info']['etemplate']['extension'][$type]->public_functions[$function]);
                }
 

Index: class.db_tools.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.db_tools.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- class.db_tools.inc.php      6 Sep 2006 11:35:33 -0000       1.21
+++ class.db_tools.inc.php      30 Sep 2006 07:10:52 -0000      1.22
@@ -5,7 +5,7 @@
 * @author Ralf Becker <address@hidden>
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
 * @package etemplate
-* @version $Id: class.db_tools.inc.php,v 1.21 2006/09/06 11:35:33 skwashd Exp $
+* @version $Id: class.db_tools.inc.php,v 1.22 2006/09/30 07:10:52 skwashd Exp $
 */
        class db_tools
        {
@@ -45,6 +45,7 @@
                 */
                function db_tools()
                {
+                       @set_time_limit(600); //@ to stop issues on safe_mode 
installs
                        $this->editor = 
createObject('etemplate.etemplate','etemplate.db-tools.edit');
                        $this->data = array();
 
@@ -56,12 +57,13 @@
                        //I know this formatting is ugly, but it needs to be 
ugly for now - skwashd
                        $this->setup_header = '<?php
 /**
-* ' . $app . ' Setup
+* ' . $this->app . ' Setup
+*
 * @copyright Copyright (C) 2006 Free Software Foundation, Inc. 
http://www.fsf.org/
 * @author Your Name <address@hidden>
 * @license http://www.gnu.org/licenses/gpl.html GNU Lesser General Public 
License
 * @package etemplate
-* @version $Id: class.db_tools.inc.php,v 1.21 2006/09/06 11:35:33 skwashd Exp $
+* @version $Id: class.db_tools.inc.php,v 1.22 2006/09/30 07:10:52 skwashd Exp $
 */
 ';
 
@@ -86,7 +88,7 @@
                                $this->app = $content['app'];   // this is what 
the user selected
                                $this->table = $content['table_name'];
                                $posted_app = $content['posted_app'];   // this 
is the old selection
-                               $posted_table = $content['posted_table'];
+                               $posted_table = isset($content['posted_table']) 
? $content['posted_table'] : '';
                        }
                        if ($posted_app && $posted_table &&             // user 
changed app or table
                                 ($posted_app != $this->app || $posted_table != 
$this->table))
@@ -120,7 +122,7 @@
                        {
                                $this->data[$posted_table] = 
$this->content2table($content);
                        }
-                       if ($content['write_tables'])
+                       if ( isset($content['write_tables']) && 
$content['write_tables'] )
                        {
                                if 
($this->needs_save('',$this->app,$this->table,$this->data[$posted_table]))
                                {
@@ -128,7 +130,7 @@
                                }
                                $msg .= lang('Table unchanged, no write 
necessary !!!');
                        }
-                       elseif ($content['delete'])
+                       elseif ( isset($content['delete']) && 
$content['delete'] )
                        {
                                list($col) = each($content['delete']);
 
@@ -138,11 +140,12 @@
                                unset($this->data[$posted_table]['fd'][$key]);
                                $this->changes[$posted_table][$key] = 
'**deleted**';
                        }
-                       elseif ($content['add_column'])
+                       elseif ( isset($content['add_column']) && 
$content['add_column'] )
                        {
                                $this->data[$posted_table]['fd'][''] = array();
                        }
-                       elseif ($content['add_table'] || $content['import'])
+                       elseif ( (isset($content['add_table']) && 
$content['add_table'])
+                               || (isset($content['import']) && 
$content['import']) )
                        {
                                if (!$this->app)
                                {
@@ -226,6 +229,7 @@
                 */
                function 
needs_save($cont='',$posted_app='',$posted_table='',$edited_table='')
                {
+                       $msg = '';
                        if (!$posted_app && is_array($cont))
                        {
                                if (isset($cont['yes']))
@@ -320,10 +324,10 @@
                                $col_defs['pk'] = 
in_array($col_name,$table['pk']);
                                $col_defs['uc']  = 
in_array($col_name,$table['uc']);
                                $col_defs['ix'] = 
in_array($col_name,$table['ix']);
-                               $col_defs['fk'] = $table['fk'][$col_name];
+                               $col_defs['fk'] = 
isset($table['fk'][$col_name]) ? $table['fk'][$col_name] : '';
                                if (isset($col_defs['default']) && 
$col_defs['default'] == '')
                                {
-                                       $col_defs['default'] = 
is_int($col_defs['default']) ? '0' : "''";       // spezial value for empty, 
but set, default
+                                       $col_defs['default'] = 
is_int($col_defs['default']) ? '0' : "''";       // special value for empty, 
but set, default
                                }
                                $col_defs['n'] = $n;
 
@@ -362,8 +366,9 @@
                        {
                                $col = $content["Row$n"];
 
-                               while ((list($old_name,$old_col) = 
@each($old_cols)) &&
-                                          
$this->changes[$posted_table][$old_name] == '**deleted**') ;
+                               while ( isset($this->changes[$posted_table]) 
+                                       && (list($old_name,$old_col) = 
@each($old_cols))
+                                       && 
$this->changes[$posted_table][$old_name] == '**deleted**');
 
                                if (($name = $col['name']) != '')               
// ignoring lines without column-name
                                {
@@ -453,12 +458,14 @@
 
                function write_array($arr,$depth,$parent='')
                {
+                       $only_vals = false;
+                       $tabs = '';
                        if (in_array($parent,array('pk','fk','ix','uc')))
                        {
                                $depth = 0;
                                if ($parent != 'fk')
                                {
-                                       $only_vals = True;
+                                       $only_vals = true;
                                }
                        }
                        if ($depth)
@@ -783,7 +790,8 @@
                                                        }
                                                }
                                        }
-                                       if (is_array($this->changes[$name]))
+                                       if ( isset($this->changes[$name])
+                                               && 
is_array($this->changes[$name]) )
                                        {
                                                foreach($this->changes[$name] 
as $col => $new_col)
                                                {
@@ -838,15 +846,17 @@
 
                        foreach($table['fd'] as $col => $props)
                        {
-                               $table['fd'][$col] = array(
-                                       'type' => ''.$props['type'],
-                                       'precision' => 0+$props['precision'],
-                                       'scale' => 0+$props['scale'],
-                                       'nullable' => !!$props['nullable'],
-                                       'default' => ''.$props['default']
+                               $table['fd'][$col] = array
+                               (
+                                       'type'          => 
strval($props['type']),
+                                       'precision'     => (int) 
(isset($props['precision']) ? $props['precision'] : 0),
+                                       'scale'         => (int) 
(isset($props['scale']) ? $props['scale'] : 0),
+                                       'nullable'      => 
isset($props['nullable']) ? !!$props['nullable'] : false,
+                                       'default'       => strval( 
isset($props['default']) ? $props['default'] : '' )
                                );
                        }
-                       return array(
+                       return array
+                       (
                                'fd' => $table['fd'],
                                'pk' => $table['pk'],
                                'fk' => $table['fk'],

Index: class.soetemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.soetemplate.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- class.soetemplate.inc.php   6 Sep 2006 11:13:30 -0000       1.31
+++ class.soetemplate.inc.php   30 Sep 2006 07:10:52 -0000      1.32
@@ -5,7 +5,7 @@
 * @author Ralf Becker <address@hidden>
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
 * @package etemplate
-* @version $Id: class.soetemplate.inc.php,v 1.31 2006/09/06 11:13:30 skwashd 
Exp $
+* @version $Id: class.soetemplate.inc.php,v 1.32 2006/09/30 07:10:52 skwashd 
Exp $
 */
 
        /**
@@ -205,7 +205,7 @@
                        {
                                $this->lang = '';
                        }
-                       $this->tpls_in_file = is_array($name) ? 
$name['tpls_in_file'] : 0;
+                       $this->tpls_in_file = is_array($name) && 
isset($name['tpls_in_file']) ? $name['tpls_in_file'] : 0;
 
                        if (is_array($name) && isset($name['data']))
                        {
@@ -884,7 +884,7 @@
                {
                        list($app) = explode('.',$app);
 
-                       if (!$app || 
(isset($GLOBALS['phpgw_info']['etemplate']) && 
$GLOBALS['phpgw_info']['etemplate']['import_tested'][$app]) )
+                       if (!$app || 
(isset($GLOBALS['phpgw_info']['etemplate']['import_tested']) && 
$GLOBALS['phpgw_info']['etemplate']['import_tested'][$app]) )
                        {
                                return '';      // ensure test is done only 
once per call and app
                        }

Index: class.uietemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate.inc.php,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- class.uietemplate.inc.php   6 Sep 2006 15:22:16 -0000       1.70
+++ class.uietemplate.inc.php   30 Sep 2006 07:10:52 -0000      1.71
@@ -5,7 +5,7 @@
 * @author Ralf Becker <address@hidden>
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
 * @package etemplate
-* @version $Id: class.uietemplate.inc.php,v 1.70 2006/09/06 15:22:16 skwashd 
Exp $
+* @version $Id: class.uietemplate.inc.php,v 1.71 2006/09/30 07:10:52 skwashd 
Exp $
 */
        include_once(PHPGW_INCLUDE_ROOT . 
'/etemplate/inc/class.boetemplate.inc.php');
 
@@ -173,7 +173,8 @@
                                {
                                        echo parse_navbar();
                                }
-                               echo 
$GLOBALS['phpgw_info']['etemplate']['hook_content'].$html;
+                               echo 
(isset($GLOBALS['phpgw_info']['etemplate']['hook_content']) ? 
$GLOBALS['phpgw_info']['etemplate']['hook_content'] : '')
+                                       . $html;
 
                                if 
(address@hidden'phpgw_info']['etemplate']['hooked'] &&
                                        (!isset($_GET['menuaction']) || 
strstr($_SERVER['PHP_SELF'],'process_exec.php')))
@@ -601,7 +602,7 @@
                                $ext_type = $type;
                                $extra_label = 
$this->extensionPreProcess($ext_type,$form_name,$value,$cell,$readonlys[$name]);
 
-                               $readonly = $readonly || $cell['readonly'];     
// might be set be extension
+                               $readonly = (isset($readonly) && $readonly) || 
(isset($cell['readonly']) && $cell['readonly']); // might be set be extension
                                $this->set_array($content,$name,$value);
                        }
 
@@ -938,7 +939,7 @@
                                        {
                                                $sels += 
$content["options-$name"];
                                        }
-                                       if ($readonly)
+                                       if ( isset($readonly) && $readonly )
                                        {
                                                $html .= $cell['no_lang'] ? 
$sels[$value] : lang($sels[$value]);
                                        }




reply via email to

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