phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php cla...


From: Dave Hall
Subject: [Phpgroupware-cvs] addressbook/inc class.uiaddressbook.inc.php cla...
Date: Mon, 11 Sep 2006 11:31:06 +0000

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

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

Log message:
        regression fix for owner id and some other clean ups

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/addressbook/inc/class.uiaddressbook.inc.php?cvsroot=phpgroupware&r1=1.70&r2=1.71
http://cvs.savannah.gnu.org/viewcvs/addressbook/inc/class.uifields.inc.php?cvsroot=phpgroupware&r1=1.18&r2=1.19

Patches:
Index: class.uiaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiaddressbook.inc.php,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- class.uiaddressbook.inc.php 11 Sep 2006 10:57:35 -0000      1.70
+++ class.uiaddressbook.inc.php 11 Sep 2006 11:31:05 -0000      1.71
@@ -12,7 +12,7 @@
  *  option) any later version.                                              *
  \**************************************************************************/
 
-/* $Id: class.uiaddressbook.inc.php,v 1.70 2006/09/11 10:57:35 skwashd Exp $ */
+/* $Id: class.uiaddressbook.inc.php,v 1.71 2006/09/11 11:31:05 skwashd Exp $ */
 
 
 class uiaddressbook
@@ -102,7 +102,6 @@
                 'delete_person'        => true,
                 'delete_org'   => true,
                 'java_script'  => true,
-                'css'                  => true
                         );
 
        function uiaddressbook()
@@ -112,10 +111,11 @@
                $this->nextmatchs             = 
CreateObject('phpgwapi.nextmatchs');
                $this->custom_fields          = 
CreateObject('addressbook.uifields');
                $this->bo                     = 
CreateObject('addressbook.boaddressbook');
-               $this->template               =&$GLOBALS['phpgw']->template;
+               $this->template                         =& 
$GLOBALS['phpgw']->template;
                $this->cat                    = 
CreateObject('phpgwapi.categories');
                $this->company                = 
CreateObject('phpgwapi.categories','addressbook_company');
                $this->prefs                  = 
$GLOBALS['phpgw_info']['user']['preferences']['addressbook'];
+               $this->owner                            = 
$GLOBALS['phpgw_info']['user']['account_id']; 
 
                $this->contact_type           = $this->bo->contact_type;
                $this->comm_descr             = $this->bo->comm_descr;
@@ -1928,7 +1928,7 @@
                $this->entry = get_var('entry', array('post','get'));
 
                $this->contact_id = get_var('ab_id', array('post','get'));
-               $this->owner = get_var('owner', array('post','get'));
+               $this->owner = (int) isset($_REQUEST['owner']) ? 
$_REQUEST['owner'] : $this->owner;
                $this->referer = get_var('referer', array('post','get'));
                $this->record_name = htmlentities(get_var('record_name', 
array('post','get')));
        }
@@ -3272,10 +3272,15 @@
                }
        }
 
+       /**
+       * Return some java_script
+       *
+       * @todo TODO switch to js class in the constructor for this
+       */
        function java_script()
        {
-               $tmp= '
-                       <SCRIPT LANGUAGE="JavaScript">
+               return '
+                       <script type="text/javascript">
                        function move(fboxname, tboxname, sboxname, cboxname) {
                                var arrFbox = new Array();
                                var arrTbox = new Array();
@@ -3374,45 +3379,6 @@
                                oDiv.style.display = oDiv.style.display == 
"none" ? "" : "none";
                }
                </script>';
-               return $tmp;
-       }
-
-       function css()
-       {
-               $tmp = 'input[type="submit"].button_style, 
input[type="button"].button_style {
-color: #555;
-          margin-left: 1px;
-          margin-right: 1px;
-
-          background-color: #ddd;
-border:1px #888 solid;
-          border-bottom-width: 0px;
-padding: 1px;
-width: 85px;
-               }
-
-               input[type="submit"].button_style_sel, 
input[type="button"].button_style_sel {
-color: #555;
-          margin-left: 1px;
-          margin-right: 1px;
-
-          /*background-color: #e5e5e5;*/
-border:1px #888 solid;
-          border-bottom-width: 0px;
-padding: 1px;
-width: 85px;
-               }
-
-               input[type="submit"]:hover.button_style, 
input[type="button"]:hover.button_style {
-                       background-color: #eee;
-color: #36c;
-               }
-
-               input[type="submit"]:active.button_style, 
input[type="button"]:active.button_style {
-                       background-color: #eee;
-color: #9ac;
-               }';
-               return $tmp;
        }
 
        function get_comm_descr($comm_selected, $type='')

Index: class.uifields.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uifields.inc.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- class.uifields.inc.php      11 Sep 2006 10:57:35 -0000      1.18
+++ class.uifields.inc.php      11 Sep 2006 11:31:06 -0000      1.19
@@ -11,7 +11,7 @@
  *  option) any later version.                                              *
  \**************************************************************************/
 
-/* $Id: class.uifields.inc.php,v 1.18 2006/09/11 10:57:35 skwashd Exp $ */
+/* $Id: class.uifields.inc.php,v 1.19 2006/09/11 11:31:06 skwashd Exp $ */
 
        class uifields
        {
@@ -338,8 +338,7 @@
                {
                        if(!$GLOBALS['phpgw']->acl->check('run',1,'admin'))
                        {
-                               $GLOBALS['phpgw']->common->phpgw_header();
-                               echo parse_navbar();
+                               $GLOBALS['phpgw']->common->phpgw_header(true);
                                echo lang('access not permitted');
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
@@ -348,16 +347,18 @@
                        $field_name = stripslashes(get_var('field_name'));
                        $apply_for  = stripslashes(get_var('apply_for'));
 
-                       $start    = $_POST['start'] ? $_POST['start'] : 
$_GET['start'];
-                       $query    = $_POST['query'] ? $_POST['query'] : 
$_GET['query'];
-                       $sort     = $_POST['sort']  ? $_POST['sort']  : 
$_GET['sort'];
+                       $start  = (int) isset($_REQUEST['start']) ? 
$_REQUEST['start'] : 0;
+                       $start  = (int) isset($_REQUEST['start']) ? 
$_REQUEST['start'] : 0;
+                       $query  = isset($_REQUEST['query']) ? 
$_REQUEST['query'] : '';
+                       $order  = isset($_REQUEST['order']) ? 
$_REQUEST['order'] : '';
+                       $sort   = isset($_REQUEST['sort']) ? $_REQUEST['sort'] 
: 'ASC';
 
                        if(!$field)
                        {
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'addressbook.uifields.index') );
                        }
 
-                       if($_POST['confirm'])
+                       if ( isset($_POST['confirm']) )
                        {
                                $this->save_custom_field($field, '', 
$apply_for);
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'addressbook.uifields.index', 'start' => $start, 'query' 
=> $query, 'sort' => $sort) );
@@ -376,14 +377,14 @@
                                
$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', array('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' => $field, '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', array('menuaction' => 
'addressbook.uifieldsdelete', 'field_id' => $field_id, 'confirm' => 'True') );
+                               $yeslinkf = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'addressbook.uifieldsdelete', 'field' => $field, '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=\"field_id\"  value=\"$field\">"
                                        . '<input type="hidden" name="confirm"  
 value="True">'
                                        . '<input type="submit" 
name="yesbutton" value="Yes">'
                                        . 
'</form><script>document.yesbutton.yesbutton.focus()</script>';
@@ -403,6 +404,7 @@
 
                        $this->config->read_repository();
 
+                       $all_custom_fields = array();
                        if($apply=='person')
                        {
                                $this->per_custom_fields = 
isset($this->config->config_data['custom_fields']) ? 
$this->config->config_data['custom_fields'] : array();
@@ -432,8 +434,8 @@
                                }
                        }
 
-                       //while(list($name,$descr) = 
@each($this->config->config_data['custom_fields']))
-                       if ( is_array($all_custom_fields) )
+                       if ( is_array($all_custom_fields) 
+                               && count($all_custom_fields) )
                        {
                                foreach ( $all_custom_fields as $name => $descr 
)
                                {
@@ -585,9 +587,9 @@
 
                        if($edit_contacts)
                        {
+                               $owner = 
isset($GLOBALS['phpgw_info']['server']['addressmaster']) ? 
$GLOBALS['phpgw_info']['server']['addressmaster'] : 0;
                                $contacts = createObject('phpgwapi.contacts');
-                               
$contacts->edit_other_by_owner($GLOBALS['phpgw_info']['server']['addressmaster'],
-                                               $new, $old_field, 'other_name');
+                               $contacts->edit_other_by_owner($owner, $new, 
$old_field, 'other_name');
                        }
                }
        }




reply via email to

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