[21019] New feature: Custom fields on person and org 4686:4746

Sigurd Nes <[email protected]> Sun, 07 Feb 2010 10:40:48 +0000
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 21019
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=21019
Author:   sigurdne
Date:     2010-02-07 10:40:47 +0000 (Sun, 07 Feb 2010)
Log Message:
-----------
New feature: Custom fields on person and org 4686:4746

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

Modified: people/sigurdne/modules/addressbook/trunk/setup/setup.inc.php
===================================================================
--- people/sigurdne/modules/addressbook/trunk/setup/setup.inc.php	2010-02-07 10:22:08 UTC (rev 21018)
+++ people/sigurdne/modules/addressbook/trunk/setup/setup.inc.php	2010-02-07 10:40:47 UTC (rev 21019)
@@ -13,7 +13,7 @@
 
 	/* Basic information about this app */
 	$setup_info['addressbook']['name']      = 'addressbook';
-	$setup_info['addressbook']['version']   = '0.9.17.501';
+	$setup_info['addressbook']['version']   = '0.9.17.502';
 	$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-02-07 10:22:08 UTC (rev 21018)
+++ people/sigurdne/modules/addressbook/trunk/setup/tables_update.inc.php	2010-02-07 10:40:47 UTC (rev 21019)
@@ -63,3 +63,23 @@
 			return $GLOBALS['setup_info']['addressbook']['currentver'];
 		}
 	}
+
+	$test[] = '0.9.17.501';
+	/**
+	* Allow custom fields on relation org_person.
+	*
+	* @return string the new version number
+	*/
+	function addressbook_upgrade0_9_17_501()
+	{
+		$GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+		$GLOBALS['phpgw']->locations->add('person', "Allow custom fields on table person", 'addressbook', false, 'phpgw_contact_person');
+		$GLOBALS['phpgw']->locations->add('organisation', "Allow custom fields on table org", 'addressbook', false, 'phpgw_contact_org');
+
+		if ( $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit() )
+		{
+			$GLOBALS['setup_info']['addressbook']['currentver'] = '0.9.17.502';
+			return $GLOBALS['setup_info']['addressbook']['currentver'];
+		}
+	}