phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] addressbook/inc class.uifields.inc.php


From: Dave Hall
Subject: [Phpgroupware-cvs] addressbook/inc class.uifields.inc.php
Date: Mon, 11 Sep 2006 07:59:45 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    addressbook
Changes by:     Dave Hall <skwashd>     06/09/11 07:59:45

Modified files:
        inc            : class.uifields.inc.php 

Log message:
        E_ALL and phpgw::link()

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/addressbook/inc/class.uifields.inc.php?cvsroot=phpgroupware&r1=1.16&r2=1.17

Patches:
Index: class.uifields.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uifields.inc.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- class.uifields.inc.php      1 Sep 2006 14:47:28 -0000       1.16
+++ class.uifields.inc.php      11 Sep 2006 07:59:44 -0000      1.17
@@ -11,15 +11,16 @@
  *  option) any later version.                                              *
  \**************************************************************************/
 
-/* $Id: class.uifields.inc.php,v 1.16 2006/09/01 14:47:28 skwashd Exp $ */
+/* $Id: class.uifields.inc.php,v 1.17 2006/09/11 07:59:44 skwashd Exp $ */
 
        class uifields
        {
-               var $public_functions = array(
-                               'index'  => True,
-                               'add'    => True,
-                               'edit'   => True,
-                               'delete' => True
+               var $public_functions = array
+               (
+                       'index'  => true,
+                       'add'    => true,
+                       'edit'   => true,
+                       'delete' => true
                                );
 
                function uifields()
@@ -45,10 +46,10 @@
                                                ));
                        
$GLOBALS['phpgw']->template->set_block('field_list_t','field_list','list');
 
-                       $field  = $_REQUEST['field'];
-                       $start  = $_REQUEST['start'];
-                       $query  = $_REQUEST['query'];
-                       $sort   = $_REQUEST['sort'];
+                       $field  = isset($_REQUEST['field']) ? 
$_REQUEST['field'] : 0;
+                       $start  = (int) isset($_REQUEST['start']) ? 
$_REQUEST['start'] : 0;
+                       $query  = isset($_REQUEST['query']) ? 
$_REQUEST['query'] : '';
+                       $sort   = isset($_REQUEST['sort']) ? $_REQUEST['sort'] 
: 'ASC';
 
                        $common_hidden_vars =
                                '<input type="hidden" name="sort"   value="' . 
$sort   . '">' . "\n"
@@ -58,20 +59,20 @@
                                . '<input type="hidden" name="filter" value="' 
. $filter . '">' . "\n";
 
                        
$GLOBALS['phpgw']->template->set_var('lang_action',lang('Custom Fields'));
-                       
$GLOBALS['phpgw']->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.add'));
+                       
$GLOBALS['phpgw']->template->set_var('add_action',$GLOBALS['phpgw']->link('/index.php',
 array('menuaction' => 'addressbook.uifields.add') ) );
                        
$GLOBALS['phpgw']->template->set_var('lang_add',lang('Add'));
                        
$GLOBALS['phpgw']->template->set_var('title_fields',lang('addressbook').' - 
'.lang('Custom Fields'));
                        
$GLOBALS['phpgw']->template->set_var('lang_search',lang('Search'));
-                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'));
+                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',
 array('menuaction' => 'addressbook.uifields.index') ) );
                        
$GLOBALS['phpgw']->template->set_var('lang_done',lang('Done'));
                        
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
 
-                       if(!$start)
+                       if ( !$start )
                        {
                                $start = 0;
                        }
 
-                       if(!$sort)
+                       if ( $sort != 'DESC' )
                        {
                                $sort = 'ASC';
                        }
@@ -87,7 +88,6 @@
 
                        
$GLOBALS['phpgw']->template->set_var('lang_showing',$GLOBALS['phpgw']->nextmatchs->show_hits($total_records,$start));
 
-                       
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
                        
$GLOBALS['phpgw']->template->set_var('sort_field',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'name',$order,'/index.php',lang('Name')),'menuaction=addressbook.uifields.index');
                        
$GLOBALS['phpgw']->template->set_var('lang_edit',lang('Edit'));
                        
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete'));
@@ -103,7 +103,8 @@
 
                                
$GLOBALS['phpgw']->template->set_var('cfield',$title);
 
-                               $params = array(
+                               $params = array
+                               (
                                                'menuaction' => 
'addressbook.uifields.edit',
                                                'field'      => $field,
                                                'apply_for'  => $apply,
@@ -186,8 +187,8 @@
                        }
 
                        
$GLOBALS['phpgw']->template->set_var('title_fields',lang('Add Custom Field'));
-                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.add'));
-                       
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'));
+                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',
 array('menuaction' => 'addressbook.uifields.add') ) );
+                       
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',
 array('menuaction' => 'addressbook.uifields.index') ) );
                        
$GLOBALS['phpgw']->template->set_var('hidden_vars','<input type="hidden" 
name="field" value="' . $field . '">');
 
                        
$GLOBALS['phpgw']->template->set_var('lang_name',lang('Field name'));
@@ -233,7 +234,7 @@
 
                        if (!$field)
                        {
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.index&sort=$sort&query=$query&start=$start"));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'addressbook.uifields.index', 'sort' => $sort, 'query' => 
$query, 'start' => $start) );
                        }
 
                        $GLOBALS['phpgw']->template->set_file(array('form' => 
'field_form.tpl'));
@@ -287,9 +288,9 @@
                        }
 
                        
$GLOBALS['phpgw']->template->set_var('title_fields',lang('Edit Custom Field'));
-                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.edit'));
-                       
$GLOBALS['phpgw']->template->set_var('deleteurl',$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.delete&field=$fn&start=$start&query=$query&sort=$sort"));
-                       
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.index&start=$start&query=$query&sort=$sort"));
+                       
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php',
 array('menuaction' => 'addressbook.uifields.edit') ) );
+                       
$GLOBALS['phpgw']->template->set_var('deleteurl',$GLOBALS['phpgw']->link('/index.php',
 array('menuaction' => 'addressbook.uifields.delete', 'field' => $fn, 'start' 
=> $start, 'query' => $query, 'sort' => $sort) ) );
+                       
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',
 array('menuaction' => 'addressbook.uifields.index', 'start' => $start, 'query' 
=> $query, 'sort' => $sort) ) );
 
                        
$GLOBALS['phpgw']->template->set_var('hidden_vars',$hidden_vars);
                        
$GLOBALS['phpgw']->template->set_var('lang_name',lang('Field name'));
@@ -349,13 +350,13 @@
 
                        if(!$field)
                        {
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'addressbook.uifields.index') );
                        }
 
                        if($_POST['confirm'])
                        {
                                $this->save_custom_field($field, '', 
$apply_for);
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.index&start=$start&query=$query&sort=$sort"));
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'addressbook.uifields.index', 'start' => $start, 'query' 
=> $query, 'sort' => $sort) );
                        }
                        else
                        {
@@ -371,12 +372,12 @@
                                
$GLOBALS['phpgw']->template->set_file(array('field_delete' => 
'delete_common.tpl'));
                                
$GLOBALS['phpgw']->template->set_var('messages',lang('Are you sure you want to 
delete this field?'));
 
-                               $nolinkf = 
$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.index&field_id=$field_id&start=$start&query=$query&sort=$sort");
+                               $nolinkf = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uifields.index', 'field_id' => $field_id, 'start' => $start, 
'query' => $query, 'sort' => $sort) );
                                $nolink = '<a href="' . $nolinkf . '">' . 
lang('No') . '</a>';
                                
$GLOBALS['phpgw']->template->set_var('no',$nolink);
 
-                               $yeslinkf = 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifieldsdelete&field_id='
 . $field_id . '&confirm=True');
-                               $yeslinkf = '<form method="POST" 
name="yesbutton" action="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.delete') 
. '">'
+                               $yeslinkf = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uifieldsdelete', 'field_id' => $field_id, 'confirm' => 'True') );
+                               $yeslinkf = '<form method="POST" 
name="yesbutton" action="' . $GLOBALS['phpgw']->link('/index.php', 
array('menuaction' => 'addressbook.uifields.delete') ) . '">'
                                        . $hidden_vars
                                        . '<input type="hidden" name="field_id" 
 value="' . $field_id . '">'
                                        . '<input type="hidden" name="confirm"  
 value="True">'




reply via email to

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