[20994] New feature: Custom fields on attribute org_person 4565:4680

Sigurd Nes <[email protected]> Sat, 30 Jan 2010 16:22:19 +0000
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 20994
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=20994
Author:   sigurdne
Date:     2010-01-30 16:22:18 +0000 (Sat, 30 Jan 2010)
Log Message:
-----------
New feature: Custom fields on attribute org_person 4565:4680

Modified Paths:
--------------
    people/sigurdne/modules/addressbook/trunk/inc/class.menu.inc.php
    people/sigurdne/modules/addressbook/trunk/setup/setup.inc.php
    people/sigurdne/modules/addressbook/trunk/setup/tables_update.inc.php

Added Paths:
-----------
    people/sigurdne/modules/addressbook/trunk/setup/default_records.inc.php

Modified: people/sigurdne/modules/addressbook/trunk/inc/class.menu.inc.php
===================================================================
--- people/sigurdne/modules/addressbook/trunk/inc/class.menu.inc.php	2010-01-27 21:06:19 UTC (rev 20993)
+++ people/sigurdne/modules/addressbook/trunk/inc/class.menu.inc.php	2010-01-30 16:22:18 UTC (rev 20994)
@@ -51,7 +51,9 @@
 					'group'	=> 'office'
 				)
 			);
-			if ( isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+//			if ( isset($GLOBALS['phpgw_info']['user']['apps']['admin']) )
+			if ( $GLOBALS['phpgw']->acl->check('run', phpgwapi_acl::READ, 'admin')
+			|| $GLOBALS['phpgw']->acl->check('admin', phpgwapi_acl::ADD, 'addressbook'))
 			{
 				$menus['admin'] = array
 				(
@@ -95,6 +97,12 @@
 					(
 						'text'	=> 'Notes Types Manager',
 						'url'	=>  $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'addressbook.uicatalog_contact_note_type.view') )
+					),
+
+					array
+					(
+						'text'	=> lang('Custom fields on org-person'),
+						'url'	=> $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.ui_custom.list_attribute', 'appname' => 'addressbook', 'location' =>'org_person', 'menu_selection' => '') )
 					)
 				);
 			}

Added: people/sigurdne/modules/addressbook/trunk/setup/default_records.inc.php
===================================================================
--- people/sigurdne/modules/addressbook/trunk/setup/default_records.inc.php	                        (rev 0)
+++ people/sigurdne/modules/addressbook/trunk/setup/default_records.inc.php	2010-01-30 16:22:18 UTC (rev 20994)
@@ -0,0 +1,11 @@
+<?php
+	/**
+	* Setup
+	* @copyright Copyright (C) 2010 Free Software Foundation, Inc. http://www.fsf.org/
+	* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+	* @package phpgwapi
+	* @subpackage setup
+	* @version $Id: default_records.inc.php 4175 2009-11-22 14:00:45Z sigurd $
+	*/
+
+	$GLOBALS['phpgw']->locations->add('org_person', "Allow custom fields on relation org_person", 'addressbook', false, 'phpgw_contact_org_person');

Modified: people/sigurdne/modules/addressbook/trunk/setup/setup.inc.php
===================================================================
--- people/sigurdne/modules/addressbook/trunk/setup/setup.inc.php	2010-01-27 21:06:19 UTC (rev 20993)
+++ people/sigurdne/modules/addressbook/trunk/setup/setup.inc.php	2010-01-30 16:22:18 UTC (rev 20994)
@@ -13,7 +13,7 @@
 
 	/* Basic information about this app */
 	$setup_info['addressbook']['name']      = 'addressbook';
-	$setup_info['addressbook']['version']   = '0.9.17.500';
+	$setup_info['addressbook']['version']   = '0.9.17.501';
 	$setup_info['addressbook']['app_order'] = 4;
 	$setup_info['addressbook']['enable']    = 1;
 	$setup_info['addressbook']['app_group']	= 'office';

Modified: people/sigurdne/modules/addressbook/trunk/setup/tables_update.inc.php
===================================================================
--- people/sigurdne/modules/addressbook/trunk/setup/tables_update.inc.php	2010-01-27 21:06:19 UTC (rev 20993)
+++ people/sigurdne/modules/addressbook/trunk/setup/tables_update.inc.php	2010-01-30 16:22:18 UTC (rev 20994)
@@ -44,4 +44,22 @@
 		$GLOBALS['setup_info']['addressbook']['currentver'] = '0.9.17.500';
 		return $GLOBALS['setup_info']['addressbook']['currentver'];
 	}
-?>
+
+	$test[] = '0.9.17.500';
+	/**
+	* Allow custom fields on relation org_person.
+	*
+	* @return string the new version number
+	*/
+	function addressbook_upgrade0_9_17_500()
+	{
+		$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+		$GLOBALS['phpgw']->locations->add('org_person', "Allow custom fields on relation org_person", 'addressbook', false, 'phpgw_contact_org_person');
+
+		if ( $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit() )
+		{
+			$GLOBALS['setup_info']['addressbook']['currentver'] = '0.9.17.501';
+			return $GLOBALS['setup_info']['addressbook']['currentver'];
+		}
+	}