|
From: <gem...@li...> - 2011-12-15 15:56:59
|
Revision: 361
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=361&view=rev
Author: mennodekker
Date: 2011-12-15 15:56:53 +0000 (Thu, 15 Dec 2011)
Log Message:
-----------
Organization can now have a default userclass, can not be changed (yet) as it needs logic to update the users
Next step is to use this class in the staffAction
Modified Paths:
--------------
trunk/library/classes/Gems/Default/OrganizationAction.php
trunk/library/configs/db/patches.sql
Modified: trunk/library/classes/Gems/Default/OrganizationAction.php
===================================================================
--- trunk/library/classes/Gems/Default/OrganizationAction.php 2011-12-15 15:54:19 UTC (rev 360)
+++ trunk/library/classes/Gems/Default/OrganizationAction.php 2011-12-15 15:56:53 UTC (rev 361)
@@ -163,6 +163,21 @@
}
$model->setIfExists('gor_code', 'label', $this->_('Code name'), 'size', 10, 'description', $this->_('Only for programmers.'));
+ if($model->has('gor_user_class')) {
+ $definitions = $this->loader->getUserLoader()->getAvailableStaffDefinitions();
+ //Use first element as default
+ $default = array_shift(array_keys($definitions));
+ $model->set('gor_user_class', 'default', $default);
+ if (count($definitions)>1) {
+ if ($action !== 'create') {
+ $model->set('gor_user_class', 'elementClass', 'Exhibitor', 'description', $this->_('This can not be changed yet'));
+ }
+ $model->set('gor_user_class', 'label', $this->_('User Definition'), 'multiOptions', $definitions);
+ } else {
+ $model->set('elementClass', 'hidden');
+ }
+ }
+
$model->addColumn("CASE WHEN gor_active = 1 THEN '' ELSE 'deleted' END", 'row_class');
Gems_Model::setChangeFieldsByPrefix($model, 'gor');
Modified: trunk/library/configs/db/patches.sql
===================================================================
--- trunk/library/configs/db/patches.sql 2011-12-15 15:54:19 UTC (rev 360)
+++ trunk/library/configs/db/patches.sql 2011-12-15 15:56:53 UTC (rev 361)
@@ -361,3 +361,6 @@
-- GEMS VERSION: 43
-- PATCH: Add comment field to respondent tracks
ALTER TABLE `gems__respondent2track` ADD gr2t_comment varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null AFTER `gr2t_reception_code`;
+
+-- PATCH: Default userdefinition per organization
+ALTER TABLE gems__organizations ADD `gor_user_class` VARCHAR( 30 ) NOT NULL DEFAULT 'StaffUser' AFTER `gor_code`;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|