[ghelda-devel] [32] Update to the Groups plugin.

[ Thread Index | Date Index | More lists.tuxfamily.org/ghelda-devel Archives ]


Revision: 32
Author:   odyx
Date:     2009-04-29 14:30:15 +0200 (Wed, 29 Apr 2009)

Log Message:
-----------
Update to the Groups plugin.

Modified Paths:
--------------
    trunk/plugins/Groups/config.php
    trunk/plugins/Groups/config_core.php
    trunk/plugins/Groups.php


Modified: trunk/plugins/Groups/config.php
===================================================================
--- trunk/plugins/Groups/config.php	2009-04-29 12:27:47 UTC (rev 31)
+++ trunk/plugins/Groups/config.php	2009-04-29 12:30:15 UTC (rev 32)
@@ -20,13 +20,15 @@
  */
 
 // Values must be lowercase (see config_core.php)
-$conf['fields']['type']['values'][1]['name'] = T_('Patrol');
-$conf['fields']['type']['values'][1]['roles'][1] = T_('Patrol Chief');
-$conf['fields']['type']['values'][1]['roles'][2] = T_('Patrol Sub-Chief');
+$conf['fields']['type']['values'][1] = T_('Patrol');
+$conf['fields_link']['role']['values'][1]['name'] = T_('Patrol');
+$conf['fields_link']['role']['values'][1]['values'][9] = T_('Patrol Chief');
+$conf['fields_link']['role']['values'][1]['values'][8] = T_('Patrol Sub-Chief');
 
-$conf['fields']['type']['values'][2]['name'] = T_('Troup');
-$conf['fields']['type']['values'][2]['roles'][1] = T_('Troup Chief');
-$conf['fields']['type']['values'][2]['roles'][2] = T_('Troup Chief Adjunct');
+$conf['fields']['type']['values'][2] = T_('Troup');
+$conf['fields_link']['role']['values'][2]['name'] = T_('Troup');
+$conf['fields_link']['role']['values'][2]['values'][19] = T_('Troup Chief');
+$conf['fields_link']['role']['values'][2]['values'][18] = T_('Troup Chief Adjunct');
 
 $conf['orderby'][] = 'type';
 $conf['orderby'][] = 'name';

Modified: trunk/plugins/Groups/config_core.php
===================================================================
--- trunk/plugins/Groups/config_core.php	2009-04-29 12:27:47 UTC (rev 31)
+++ trunk/plugins/Groups/config_core.php	2009-04-29 12:30:15 UTC (rev 32)
@@ -22,10 +22,10 @@
 // All fields values _must_ be lowercase due to MSDB2 weird handling of field names.
 
 // Required
-$conf['fields']['group_id']['type'] = 'INT( 10 )';
-$conf['fields']['group_id']['name'] = T_('Identifier');
-$conf['fields']['group_id']['restricted'] = 'key';
-$conf['fields']['group_id']['order'] = 1000;	// Has to be the highest
+$conf['fields'][G_GROUPS_ID]['type'] = 'INT( 10 )';
+$conf['fields'][G_GROUPS_ID]['name'] = T_('Identifier');
+$conf['fields'][G_GROUPS_ID]['restricted'] = 'key';
+$conf['fields'][G_GROUPS_ID]['order'] = 1000;	// Has to be the highest
 
 $conf['fields']['type']['type'] = 'SELECT';
 $conf['fields']['type']['name'] = T_('Type');
@@ -36,6 +36,7 @@
 $conf['fields']['name']['order'] = 800;
 
 // Required
+
 $conf['fields_link']['people_group_id']['type'] = 'INT( 10 )';
 $conf['fields_link']['people_group_id']['name'] = T_('Identifier');
 $conf['fields_link']['people_group_id']['restricted'] = 'key';
@@ -48,6 +49,9 @@
 
 $conf['fields_link']['role']['type'] = 'SELECT';
 $conf['fields_link']['role']['name'] = T_('Role');
+$conf['fields_link']['role']['optgroups'] = true;
+$conf['fields_link']['role']['values'][0]['name'] = '';
+$conf['fields_link']['role']['values'][0]['values'][0] = '';
 
 // Optional
 

Modified: trunk/plugins/Groups.php
===================================================================
--- trunk/plugins/Groups.php	2009-04-29 12:27:47 UTC (rev 31)
+++ trunk/plugins/Groups.php	2009-04-29 12:30:15 UTC (rev 32)
@@ -278,11 +278,11 @@
 
 		// Modification asked
 		if($_POST[$this->configH['URL']['action']] == 'change') {
-			gol('POST =',$_POST);
+			
 		}
 
+		// Groups table
 		$tableFields = $this->configH[$this->name]['fields'];
-		// Groups table
 		$tableFieldsNames = array_keys($tableFields);
 		array_walk($tableFieldsNames,'concat_to_each',array('`'.$this->tableName.'`.`','`'));
 
@@ -306,12 +306,12 @@
 		while (($groups_row = $queryR->fetchRow())) {
 			$type = $groups_row['type'];
 			$id = $groups_row[G_GROUPS_ID];
-			$groups[$type]['name'] = $this->configH[$this->name]['fields']['type']['values'][$type]['name'];
+			$groups[$type]['name'] = $this->configH[$this->name]['fields']['type']['values'][$id];
 			$groups[$type]['values'][$id] = $groups_row['name'];
 		}
 
+		// Groups-to-people table
 		$linkTableFields = $this->configH[$this->name]['fields_link'];
-		// Groups-to-people table
 		$linkTableFieldsNames = array_keys($linkTableFields);
 		array_walk($linkTableFieldsNames,'concat_to_each',array('`'.$this->linkPeopleTableName.'`.`','`'));
 		$variablesChain = array_merge($tableFieldsNames,$linkTableFieldsNames);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/