You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
(70) |
Nov
(164) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(52) |
Feb
(77) |
Mar
(70) |
Apr
(58) |
May
(81) |
Jun
(74) |
Jul
(87) |
Aug
(30) |
Sep
(45) |
Oct
(37) |
Nov
(51) |
Dec
(31) |
2013 |
Jan
(47) |
Feb
(29) |
Mar
(40) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gem...@li...> - 2011-11-04 09:59:37
|
Revision: 180 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=180&view=rev Author: matijsdejong Date: 2011-11-04 09:59:31 +0000 (Fri, 04 Nov 2011) Log Message: ----------- Implementation of #39: the user should return to the screen from which he or she started filling in the survey. Modified Paths: -------------- trunk/library/classes/Gems/Default/AskAction.php trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/Gems/Default/StaffAction.php trunk/library/classes/Gems/Default/TrackActionAbstract.php Modified: trunk/library/classes/Gems/Default/AskAction.php =================================================================== --- trunk/library/classes/Gems/Default/AskAction.php 2011-11-04 09:31:20 UTC (rev 179) +++ trunk/library/classes/Gems/Default/AskAction.php 2011-11-04 09:59:31 UTC (rev 180) @@ -186,6 +186,9 @@ public function indexAction() { + // Make sure to return to ask screen + $this->session->return_controller = $this->getRequest()->getControllerName(); + $tracker = $this->loader->getTracker(); $max_length = $tracker->getTokenLibrary()->getLength(); @@ -242,11 +245,40 @@ public function returnAction() { - if (isset($this->session->user_id)) { + if (isset($this->session->user_id) && $this->session->user_id) { $tracker = $this->loader->getTracker(); $token = $tracker->getToken($tracker->filterToken($this->_getParam(MUtil_Model::REQUEST_ID))); - $this->_reroute(array('controller' => 'respondent', 'action' => 'show', MUtil_Model::REQUEST_ID => $token->getPatientNumber()), true); + // Check for completed tokens + $this->loader->getTracker()->processCompletedTokens($token->getRespondentId(), $this->session->user_id); + + if (isset($this->session->return_controller) && $this->session->return_controller) { + $return = $this->session->return_controller; + } else { + $return = 'respondent'; + } + + $parameters['controller'] = $return; + $parameters['action'] = 'show'; + $parameters[MUtil_Model::REQUEST_ID] = $token->getPatientNumber(); + switch ($return) { + case 'track': + $parameters['action'] = 'show-track'; + $parameters[Gems_Model::RESPONDENT_TRACK] = $token->getRespondentTrackId(); + break; + + case 'survey': + $parameters[MUtil_Model::REQUEST_ID] = $token->getTokenId(); + break; + + case 'ask': + $this->_forward('forward'); + return; + + default: + $parameters['controller'] = 'respondent'; + } + $this->_reroute($parameters, true); } else { $this->_forward('forward'); } Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-04 09:31:20 UTC (rev 179) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-04 09:59:31 UTC (rev 180) @@ -360,6 +360,20 @@ return $this->_('Respondents'); } + /** + * Initialize translate and html objects + * + * Called from {@link __construct()} as final step of object instantiation. + * + * @return void + */ + public function init() + { + parent::init(); + + $this->session->return_controller = $this->getRequest()->getControllerName(); + } + protected function openedRespondent($patientId, $orgId = null, $userId = null) { if ($patientId) { @@ -387,12 +401,6 @@ // Log $this->openedRespondent($data['gr2o_patient_nr'], $data['gr2o_id_organization'], $data['grs_id_user']); - // Check for completed tokens - if ($this->loader->getTracker()->processCompletedTokens($data['grs_id_user'], $this->session->user_id)) { - //As data might have changed due to token events... reload - $data = $model->applyRequest($this->getRequest(), true)->loadFirst(); - } - if ($data['gr2o_consent'] == $model->get('gr2o_consent', 'default')) { $url = $this->view->url(array('controller' => 'respondent', 'action' => 'edit', 'id' => $data['gr2o_patient_nr'])) . '#tabContainer-frag-3'; $this->addMessage(MUtil_Html::create()->a($url, $this->_('Please settle the informed consent form for this respondent.'))); Modified: trunk/library/classes/Gems/Default/StaffAction.php =================================================================== --- trunk/library/classes/Gems/Default/StaffAction.php 2011-11-04 09:31:20 UTC (rev 179) +++ trunk/library/classes/Gems/Default/StaffAction.php 2011-11-04 09:59:31 UTC (rev 180) @@ -107,7 +107,7 @@ $bridge->addHidden( 'gsf_id_user'); // Needed for e-mail validation $bridge->addHidden( 'gsu_user_class'); $bridge->addText( 'gsu_login', 'size', 15, 'minlength', 4, - 'validator', $model->createUniqueValidator('gsu_login')); + 'validator', $model->createUniqueValidator('gsu_login', array('gsu_id_user'))); // Can the organization be changed? if ($this->escort->hasPrivilege('pr.staff.edit.all')) { Modified: trunk/library/classes/Gems/Default/TrackActionAbstract.php =================================================================== --- trunk/library/classes/Gems/Default/TrackActionAbstract.php 2011-11-04 09:31:20 UTC (rev 179) +++ trunk/library/classes/Gems/Default/TrackActionAbstract.php 2011-11-04 09:59:31 UTC (rev 180) @@ -352,6 +352,20 @@ parent::indexAction(); } + /** + * Initialize translate and html objects + * + * Called from {@link __construct()} as final step of object instantiation. + * + * @return void + */ + public function init() + { + parent::init(); + + $this->session->return_controller = $this->getRequest()->getControllerName(); + } + public function initFilter() { // FROM REQUEST This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-04 09:31:26
|
Revision: 179 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=179&view=rev Author: mennodekker Date: 2011-11-04 09:31:20 +0000 (Fri, 04 Nov 2011) Log Message: ----------- Optimised include path. Ideally the include path in index.php is set to only include zend and zendx Modified Paths: -------------- trunk/library/pre_bootstrap.php Modified: trunk/library/pre_bootstrap.php =================================================================== --- trunk/library/pre_bootstrap.php 2011-11-04 09:26:49 UTC (rev 178) +++ trunk/library/pre_bootstrap.php 2011-11-04 09:31:20 UTC (rev 179) @@ -1,34 +1,34 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - + /** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** * This files contains general project code that loads the * Zend_Application - and does whatever else has to be done. * @@ -66,10 +66,11 @@ * then to Gems application directory */ set_include_path( - GEMS_ROOT_DIR . '/library' . PATH_SEPARATOR . GEMS_LIBRARY_DIR . '/classes' . PATH_SEPARATOR . APPLICATION_PATH . '/classes' . PATH_SEPARATOR . - get_include_path()); + get_include_path() + //. PATH_SEPARATOR . GEMS_ROOT_DIR . '/library' //Shouldn't be needed, uncomment when neccessary + ); $GEMS_DIRS = array( GEMS_PROJECT_NAME_UC => APPLICATION_PATH . '/classes', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-04 09:26:56
|
Revision: 178 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=178&view=rev Author: matijsdejong Date: 2011-11-04 09:26:49 +0000 (Fri, 04 Nov 2011) Log Message: ----------- Fix once and for all, for the main screen hanging to the left of something on the header bar. Modified Paths: -------------- trunk/new_project/htdocs/gems/css/gems.css Modified: trunk/new_project/htdocs/gems/css/gems.css =================================================================== --- trunk/new_project/htdocs/gems/css/gems.css 2011-11-03 21:08:18 UTC (rev 177) +++ trunk/new_project/htdocs/gems/css/gems.css 2011-11-04 09:26:49 UTC (rev 178) @@ -182,6 +182,7 @@ /* *padding + *ovverflow to use only in IE */ #main { background: transparent; + clear: both; float: right; margin-bottom: 10px; width: 842px; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 21:08:24
|
Revision: 177 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=177&view=rev Author: michieltcs Date: 2011-11-03 21:08:18 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Fix field names Modified Paths: -------------- trunk/library/configs/db/tables/gems__user_logins.10.sql Modified: trunk/library/configs/db/tables/gems__user_logins.10.sql =================================================================== --- trunk/library/configs/db/tables/gems__user_logins.10.sql 2011-11-03 17:53:20 UTC (rev 176) +++ trunk/library/configs/db/tables/gems__user_logins.10.sql 2011-11-03 21:08:18 UTC (rev 177) @@ -14,8 +14,8 @@ gul_created timestamp not null, gul_created_by bigint unsigned not null, - PRIMARY KEY (gsl_id_user), - UNIQUE (gsl_login, gsl_id_organization) + PRIMARY KEY (gul_id_user), + UNIQUE (gul_login, gul_id_organization) ) ENGINE=InnoDB AUTO_INCREMENT = 10001 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 17:53:27
|
Revision: 176 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=176&view=rev Author: matijsdejong Date: 2011-11-03 17:53:20 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Add user changes for #31 Added Paths: ----------- branches/newUser2/classes/Gems/User/User.php trunk/library/configs/db/tables/gems__user_ids.10.sql trunk/library/configs/db/tables/gems__user_logins.10.sql trunk/library/configs/db/tables/gems__user_passwords.50.sql Added: branches/newUser2/classes/Gems/User/User.php =================================================================== --- branches/newUser2/classes/Gems/User/User.php (rev 0) +++ branches/newUser2/classes/Gems/User/User.php 2011-11-03 17:53:20 UTC (rev 176) @@ -0,0 +1,293 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage user + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * User object that mimicks the old $this->session behaviour + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_User_User extends MUtil_Registry_TargetAbstract +{ + /** + * + * @var ArrayObject or Zend_Session_Namespace + */ + private $_vars; + + /** + * + * @var Gems_User_UserLoader + */ + protected $userLoader; + + /** + * Creates the class for this user. + * + * @param mixed $settings Array, Zend_Session_Namespace or ArrayObject for this user. + */ + public function __construct($settings) + { + if (is_array($settings)) { + $this->_vars = new ArrayObject($settings); + $this->_vars->setFlags(ArrayObject::STD_PROP_LIST); + } else { + $this->_vars = $settings; + } + + // Checks if this is the current user + if (! $this->_vars instanceof Zend_Session_Namespace) { + $sessionStore = self::_getSessionStore(); + + if (($sessionStore->__get('user_name') == $this->_vars->offsetGet('user_name')) && + ($sessionStore->__get('user_organization_id') == $this->_vars->offsetGet('user_organization_id'))) { + + // When this is the case, use the Zend_Session_Namespace object with the current set values + // This way changes to this user object are reflected in the CurrentUser object and vice versa. + $this->setAsCurrentUser(); + } + } + } + + /** + * Get a variable + * + * @deprecated Since 1.5, left for backwards compatibility with $this->session + * @param string $name + * @return mixed + */ + public function __get($name) + { + return $this->_getVar($name); + } + + /** + * Check for existence of a variable + * + * @deprecated Since 1.5, left for backwards compatibility with $this->session + * @param string $name + * @return boolean + */ + public function __isset($name) + { + return $this->_hasVar($name); + } + + /** + * Sett a variable value + * + * @deprecated Since 1.5, left for backwards compatibility with $this->session + * @param string $name + * @param mixed $value + */ + public function __set($name, $value) + { + $this->_setVar($name, $value); + } + + /** + * unsets a variable + * + * @deprecated Since 1.5, left for backwards compatibility with $this->session + * @param string $name + * @return void + */ + public function __unset($name) + { + $this->_unsetVar($name); + } + + /** + * Returns the session namespace containing user data. + * + * @staticvar Zend_Session_Namespace $session + * @return Zend_Session_Namespace + */ + private static function _getSessionStore() + { + static $session; + + if (! $session) { + $session = new Zend_Session_Namespace('gems.' . GEMS_PROJECT_NAME . '.userdata', true); + } + + return $session; + } + + /** + * Get a value in whatever store is used by this object. + * + * @param string $name + * @return mixed + */ + protected function _getVar($name) + { + $store = $this->_getVariableStore(); + + if ($store instanceof Zend_Session_Namespace) { + if ($store->__isset($name)) { + return $store->__get($name); + } + } else { + if ($store->offsetExists($name)) { + return $store->offsetSet($name); + } + } + + return null; + } + + /** + * The store currently used. + * + * @return ArrayObject or Zend_Session_Namespace + */ + private function _getVariableStore() + { + return $this->_vars; + } + + /** + * Checks for existence of a value in whatever store is used by this object. + * + * @param string $name + * @return boolean + */ + protected function _hasVar($name) + { + $store = $this->_getVariableStore(); + + if ($store instanceof Zend_Session_Namespace) { + return $store->__isset($name); + } else { + return $store->offsetExists($name); + } + } + + /** + * Sets a value in whatever store is used by this object. + * + * @param string $name + * @param mixed $value + * @return void + */ + protected function _setVar($name, $value) + { + $store = $this->_getVariableStore(); + + if ($store instanceof Zend_Session_Namespace) { + $store->__set($name, $value); + } else { + $store->offsetSet($name, $value); + } + } + + /** + * Sets a value in whatever store is used by this object. + * + * @param string $name + * @return void + */ + protected function _unsetVar($name) + { + $store = $this->_getVariableStore(); + + if ($store instanceof Zend_Session_Namespace) { + $store->__unset($name); + } else { + $store->offsetUnset($name, $value); + } + } + + /** + * Returns the data for the current user from the session store. + * + * @return Zend_Session_Namespace + */ + public static function getCurrentUserData() + { + return self::_getSessionStore(); + } + + /** + * + * @return string + */ + protected function getLoginName() + { + return $this->getVar('user_login'); + } + + /** + * + * @return int + */ + protected function getOrganizationId() + { + return $this->_getVar('user_organization_id'); + } + + /** + * Set this user as the current user. + * + * This means that the data about this user will be stored in a session. + * + * @return Gems_User_UserAbstract + */ + public function setAsCurrentUser() + { + // Get the current variables + $oldStore = $this->_getVariableStore(); + + // When $oldStore is a Zend_Session_Namespace, then this user is already the current user. + if (! $oldStore instanceof Zend_Session_Namespace) { + $this->_vars = self::_getSessionStore(); + + // Clean up what is there now. + $this->_vars->unsetAll(); + + foreach ($oldStore as $name => $value) { + $this->_vars->__set($name, $value); + } + } + + return $this; + } +} Copied: trunk/library/configs/db/tables/gems__user_ids.10.sql (from rev 170, trunk/library/configs/db/tables/gems__users.10.sql) =================================================================== --- trunk/library/configs/db/tables/gems__user_ids.10.sql (rev 0) +++ trunk/library/configs/db/tables/gems__user_ids.10.sql 2011-11-03 17:53:20 UTC (rev 176) @@ -0,0 +1,12 @@ + +-- Table containing the users that are allowed to login +-- +CREATE TABLE if not exists gems__user_ids ( + gui_id_user bigint unsigned not null, + + gui_created timestamp not null, + + PRIMARY KEY (gui_id_user) + ) + ENGINE=InnoDB + CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; Copied: trunk/library/configs/db/tables/gems__user_logins.10.sql (from rev 170, trunk/library/configs/db/tables/gems__users.10.sql) =================================================================== --- trunk/library/configs/db/tables/gems__user_logins.10.sql (rev 0) +++ trunk/library/configs/db/tables/gems__user_logins.10.sql 2011-11-03 17:53:20 UTC (rev 176) @@ -0,0 +1,22 @@ + +-- Table containing the users that are allowed to login +-- +CREATE TABLE if not exists gems__user_logins ( + gul_id_user bigint unsigned not null auto_increment, + + gul_login varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + gul_id_organization bigint not null references gems__organizations (gor_id_organization), + + gul_user_class varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'NoLogin', + + gul_changed timestamp not null default current_timestamp on update current_timestamp, + gul_changed_by bigint unsigned not null, + gul_created timestamp not null, + gul_created_by bigint unsigned not null, + + PRIMARY KEY (gsl_id_user), + UNIQUE (gsl_login, gsl_id_organization) + ) + ENGINE=InnoDB + AUTO_INCREMENT = 10001 + CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; Copied: trunk/library/configs/db/tables/gems__user_passwords.50.sql (from rev 170, trunk/library/configs/db/tables/gems__users.10.sql) =================================================================== --- trunk/library/configs/db/tables/gems__user_passwords.50.sql (rev 0) +++ trunk/library/configs/db/tables/gems__user_passwords.50.sql 2011-11-03 17:53:20 UTC (rev 176) @@ -0,0 +1,22 @@ + +-- Table containing the users that are allowed to login +-- +CREATE TABLE if not exists gems__user_passwords ( + gup_id_user bigint unsigned not null references gems__user_logins (gul_id_user), + + gup_password varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gup_failed_logins int(11) unsigned not null default 0, + gup_last_failed timestamp null, + gup_reset_key varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gup_reset_requested timestamp null, + gup_reset_required boolean not null default 0, + + gup_changed timestamp not null default current_timestamp on update current_timestamp, + gup_changed_by bigint unsigned not null, + gup_created timestamp not null, + gup_created_by bigint unsigned not null, + + PRIMARY KEY (gup_id_user) + ) + ENGINE=InnoDB + CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 17:45:42
|
Revision: 175 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=175&view=rev Author: matijsdejong Date: 2011-11-03 17:45:34 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Modified Paths: -------------- branches/newUser2/classes/Gems/Auth.php branches/newUser2/classes/Gems/Default/CronAction.php branches/newUser2/classes/Gems/Default/IndexAction.php branches/newUser2/classes/Gems/Default/OptionAction.php branches/newUser2/classes/Gems/Default/RespondentAction.php branches/newUser2/classes/Gems/Default/StaffAction.php branches/newUser2/classes/Gems/Default/SurveyMaintenanceAction.php branches/newUser2/classes/Gems/Default/TokenPlanAction.php branches/newUser2/classes/Gems/Loader/LoaderAbstract.php branches/newUser2/classes/Gems/Loader.php branches/newUser2/classes/Gems/Menu/MenuAbstract.php branches/newUser2/classes/Gems/Model/UserModel.php branches/newUser2/classes/Gems/Model.php branches/newUser2/classes/Gems/Project/ProjectSettings.php branches/newUser2/classes/Gems/User/RespondentUser.php branches/newUser2/classes/Gems/User/StaffUser.php branches/newUser2/classes/Gems/User/UserLoader.php branches/newUser2/classes/Gems/Util/DbLookup.php branches/newUser2/classes/Gems/Validate/GemsPasswordUsername.php branches/newUser2/classes/GemsEscort.php branches/newUser2/classes/MUtil/Registry/Source.php branches/newUser2/configs/db/patches.sql branches/newUser2/configs/db/tables/gems__organizations.20.sql branches/newUser2/configs/db/tables/gems__staff.20.sql branches/newUser2/configs/db/tables/gems__users.10.sql Added Paths: ----------- branches/newUser2/ branches/newUser2/configs/db/tables/gems__user_ids.10.sql branches/newUser2/configs/db/tables/gems__user_logins.10.sql branches/newUser2/configs/db/tables/gems__user_passwords.50.sql Removed Paths: ------------- branches/newUser2/configs/db_multi_layout/ Property changes on: branches/newUser2 ___________________________________________________________________ Added: svn:mergeinfo + /branches/newUser:113-150 Modified: branches/newUser2/classes/Gems/Auth.php =================================================================== --- trunk/library/classes/Gems/Auth.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Auth.php 2011-11-03 17:45:34 UTC (rev 175) @@ -98,8 +98,8 @@ * Lookup last failed login and number of failed logins */ try { - $sql = "SELECT gsu_failed_logins, UNIX_TIMESTAMP(gsu_last_failed) - AS gsu_last_failed FROM gems__users WHERE gsu_login = ?"; + $sql = "SELECT gus_failed_logins, UNIX_TIMESTAMP(gus_last_failed) + AS gus_last_failed FROM gems__users WHERE gus_login = ?"; $results = $this->db->fetchRow($sql, array($username)); } catch (Zend_Db_Exception $zde) { //If we need to apply a db patch, just use a default value @@ -107,10 +107,10 @@ MUtil_Echo::r(GemsEscort::getInstance()->translate->_('Please update the database')); } - $delay = pow($results['gsu_failed_logins'], $this->_delayFactor); - $remaining = ($results['gsu_last_failed'] + $delay) - time(); + $delay = pow($results['gus_failed_logins'], $this->_delayFactor); + $remaining = ($results['gus_last_failed'] + $delay) - time(); - if ($results['gsu_failed_logins'] > 0 && $remaining > 0) { + if ($results['gus_failed_logins'] > 0 && $remaining > 0) { //$this->_obscureValue = false; $result = $this->_error(self::ERROR_PASSWORD_DELAY, ceil($remaining / 60)); } Modified: branches/newUser2/classes/Gems/Default/CronAction.php =================================================================== --- trunk/library/classes/Gems/Default/CronAction.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Default/CronAction.php 2011-11-03 17:45:34 UTC (rev 175) @@ -125,7 +125,7 @@ */ protected function getUserLogin($userId) { - return $this->db->fetchOne("SELECT gsu_login FROM gems__users WHERE gsu_id_user = ?", $userId); + return $this->db->fetchOne("SELECT gus_login FROM gems__users WHERE gus_id_user = ?", $userId); } public function indexAction() Modified: branches/newUser2/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Default/IndexAction.php 2011-11-03 17:45:34 UTC (rev 175) @@ -74,7 +74,7 @@ * @return Zend_Auth_Adapter_Interface */ protected function _getAuthAdapter($formValues) { - $adapter = new Zend_Auth_Adapter_DbTable($this->db, 'gems__users', 'gsu_login', 'gsu_password'); + $adapter = new Zend_Auth_Adapter_DbTable($this->db, 'gems__users', 'gus_login', 'gus_password'); $adapter->setIdentity($formValues['userlogin']); $adapter->setCredential($this->escort->passwordHash(null, $formValues['password'], false)); return $adapter; @@ -203,7 +203,7 @@ $result = $auth->authenticate($adapter, $_POST['userlogin']); // Allow login using old password. - if ((! $result->isValid()) && ($userid = $this->db->fetchOne("SELECT gsu_id_user FROM gems__users WHERE gsu_active = 1 AND gsu_password IS NULL AND gsu_login = ?", $_POST['userlogin']))) { + if ((! $result->isValid()) && ($userid = $this->db->fetchOne("SELECT gus_id_user FROM gems__users WHERE gus_active = 1 AND gus_password IS NULL AND gus_login = ?", $_POST['userlogin']))) { $adapter = new Zend_Auth_Adapter_DbTable($this->db, 'gems__staff', 'gsf_id_user', 'gsf_password'); $adapter->setIdentity($userid); @@ -309,19 +309,19 @@ } if ($this->_request->isPost() && $form->isValid($_POST)) { - $sql = $this->db->quoteInto("SELECT gsu_id_user, gsf_email, gsu_reset_key, DATEDIFF(NOW(), gsu_reset_requested) AS gsf_days FROM gems__users INNER JOIN gems__staff ON gsu_id_user = gsf_id_user WHERE gsu_login = ?", $_POST['userlogin']); + $sql = $this->db->quoteInto("SELECT gus_id_user, gsf_email, gus_reset_key, DATEDIFF(NOW(), gus_reset_requested) AS gsf_days FROM gems__users INNER JOIN gems__staff ON gus_id_user = gsf_id_user WHERE gus_login = ?", $_POST['userlogin']); $result = $this->db->fetchRow($sql); if (empty($result) || empty($result['gsf_email'])) { $this->addMessage($this->_('No such user found or no e-mail address known')); - } else if (!empty($result['gsu_reset_key']) && $result['gsf_days'] < 1) { + } else if (!empty($result['gus_reset_key']) && $result['gsf_days'] < 1) { $this->addMessage($this->_('Reset e-mail already sent, please try again after 24 hours')); } else { $email = $result['gsf_email']; $key = md5(time() . $email); $url = $this->util->getCurrentURI('index/resetpassword/key/' . $key); - $this->db->update('gems__users', array('gsu_reset_key' => $key, 'gsu_reset_requested' => new Zend_Db_Expr('NOW()')), 'gsu_id_user = ' . $result['gsu_id_user']); + $this->db->update('gems__users', array('gus_reset_key' => $key, 'gus_reset_requested' => new Zend_Db_Expr('NOW()')), 'gus_id_user = ' . $result['gus_id_user']); $mail->setSubject('Password reset requested'); $mail->setBodyText('To reset your password, please click this link: ' . $url); @@ -337,7 +337,7 @@ } } } else if ($key = $this->_request->getParam('key')) { - $sql = $this->db->quoteInto("SELECT gsu_id_user, gsf_email FROM gems__users INNER JOIN gems__staff ON gsu_id_user = gsf_id_user WHERE gsu_reset_key = ?", $key); + $sql = $this->db->quoteInto("SELECT gus_id_user, gsf_email FROM gems__users INNER JOIN gems__staff ON gus_id_user = gsf_id_user WHERE gus_reset_key = ?", $key); $result = $this->db->fetchRow($sql); if (!empty($result)) { @@ -353,7 +353,7 @@ try { $mail->send(); $this->addMessage($this->_('An e-mail was sent containing your new password')); - $this->db->update('gems__users', array('gsu_reset_key' => new Zend_Db_Expr('NULL'), 'gsu_reset_requested' => new Zend_Db_Expr('NULL'), 'gsu_password' => $passwordHash), 'gsu_id_user = ' . $result['gsu_id_user']); + $this->db->update('gems__users', array('gus_reset_key' => new Zend_Db_Expr('NULL'), 'gus_reset_requested' => new Zend_Db_Expr('NULL'), 'gus_password' => $passwordHash), 'gus_id_user = ' . $result['gus_id_user']); $this->_reroute(array('action' => 'index'), true); } catch (Exception $e) { $this->addMessage($this->_('Unable to send e-mail')); Modified: branches/newUser2/classes/Gems/Default/OptionAction.php =================================================================== --- trunk/library/classes/Gems/Default/OptionAction.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Default/OptionAction.php 2011-11-03 17:45:34 UTC (rev 175) @@ -61,10 +61,10 @@ */ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model, array $data, $new = false) { - $bridge->addHidden( 'gsu_id_user'); - $bridge->addHidden( 'gsu_id_organization'); + $bridge->addHidden( 'gus_id_user'); + $bridge->addHidden( 'gus_id_organization'); $bridge->addHidden( 'gsf_id_user'); - $bridge->addExhibitor('gsu_login', array('size' => 15, 'minlength' => 4)); + $bridge->addExhibitor('gus_login', array('size' => 15, 'minlength' => 4)); $bridge->addText( 'gsf_first_name'); $bridge->addText( 'gsf_surname_prefix'); $bridge->addText( 'gsf_last_name'); @@ -77,7 +77,7 @@ public function afterSave(array $data, $isNew) { - $this->escort->loadLoginInfo($data['gsu_login']); + $this->escort->loadLoginInfo($data['gus_login']); } public function changePasswordAction() @@ -87,7 +87,7 @@ *************/ $form = $this->createForm(); - $sql = "SELECT CASE WHEN gsu_password IS NULL THEN 0 ELSE 1 END FROM gems__users WHERE gsu_id_user = ? AND gsu_id_organization = ?"; + $sql = "SELECT CASE WHEN gus_password IS NULL THEN 0 ELSE 1 END FROM gems__users WHERE gus_id_user = ? AND gus_id_organization = ?"; if ($this->db->fetchOne($sql, array($this->session->user_id, $this->session->user_organization_id))) { // Veld current password $element = new Zend_Form_Element_Password('old_password'); @@ -131,9 +131,9 @@ ****************/ if ($this->_request->isPost() && $form->isValid($_POST)) { - $data['gsu_id_user'] = $this->session->user_id; - $data['gsu_id_organization'] = $this->session->user_organization_id; - $data['gsu_password'] = $this->escort->passwordHash(null, $_POST['new_password']); + $data['gus_id_user'] = $this->session->user_id; + $data['gus_id_organization'] = $this->session->user_organization_id; + $data['gus_password'] = $this->escort->passwordHash(null, $_POST['new_password']); $this->getModel()->save($data); @@ -185,10 +185,10 @@ */ public function createModel($detailed, $action) { - $model = new Gems_Model_UserModel('staff', 'gems__staff', array('gsu_id_user' => 'gsf_id_user'), 'gsf'); + $model = new Gems_Model_UserModel('staff', 'gems__staff', array('gus_id_user' => 'gsf_id_user'), 'gsf'); $model->copyKeys(); - $model->set('gsu_login', 'label', $this->_('Login Name')); + $model->set('gus_login', 'label', $this->_('Login Name')); $model->set('gsf_email', 'label', $this->_('E-Mail')); $model->set('gsf_first_name', 'label', $this->_('First name')); $model->set('gsf_surname_prefix', 'label', $this->_('Surname prefix'), 'description', 'de, van der, \'t, etc...'); @@ -201,7 +201,7 @@ public function editAction() { - $this->getModel()->setFilter(array('gsu_id_user' => $this->session->user_id)); + $this->getModel()->setFilter(array('gus_id_user' => $this->session->user_id)); if ($form = $this->processForm()) { $this->html->h3(sprintf($this->_('Options'), $this->getTopic())); Modified: branches/newUser2/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Default/RespondentAction.php 2011-11-03 17:45:34 UTC (rev 175) @@ -326,8 +326,8 @@ $values = $this->db->fetchPairs(" SELECT gsf_id_user, CONCAT(gsf_last_name, ', ', COALESCE(CONCAT(gsf_first_name, ' '), ''), COALESCE(gsf_surname_prefix, '')) AS name - FROM (gems__users INNER JOIN gems__staff ON gsu_id_user = gsf_id_user) INNER JOIN gems__groups ON gsf_id_primary_group = ggp_id_group - WHERE gsu_active=1 AND gsu_id_organization = ? AND ggp_role = 'physician' + FROM (gems__users INNER JOIN gems__staff ON gus_id_user = gsf_id_user) INNER JOIN gems__groups ON gsf_id_primary_group = ggp_id_group + WHERE gus_active=1 AND gus_id_organization = ? AND ggp_role = 'physician' ORDER BY 2", $organizationId); $session->physicians = $values; Modified: branches/newUser2/classes/Gems/Default/StaffAction.php =================================================================== --- trunk/library/classes/Gems/Default/StaffAction.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Default/StaffAction.php 2011-11-03 17:45:34 UTC (rev 175) @@ -44,7 +44,7 @@ */ class Gems_Default_StaffAction extends Gems_Controller_BrowseEditAction { - public $filterStandard = array('gsu_active' => 1); + public $filterStandard = array('gus_active' => 1); public $sortKey = array('name' => SORT_ASC); protected $_instanceId; @@ -96,28 +96,28 @@ if ($new) { $model->set('gsf_id_primary_group', 'default', $dbLookup->getDefaultGroup()); } else { - $model->set('gsu_password', 'description', $this->_('Enter only when changing')); - $model->setSaveWhenNotNull('gsu_password'); + $model->set('gus_password', 'description', $this->_('Enter only when changing')); + $model->setSaveWhenNotNull('gus_password'); } - $model->setOnSave('gsu_password', array($this->escort, 'passwordHash')); + $model->setOnSave('gus_password', array($this->escort, 'passwordHash')); $ucfirst = new Zend_Filter_Callback('ucfirst'); - $bridge->addHidden( 'gsu_id_user'); + $bridge->addHidden( 'gus_id_user'); $bridge->addHidden( 'gsf_id_user'); // Needed for e-mail validation - $bridge->addHidden( 'gsu_user_class'); - $bridge->addText( 'gsu_login', 'size', 15, 'minlength', 4, - 'validator', $model->createUniqueValidator('gsu_login')); + $bridge->addHidden( 'gus_user_class'); + $bridge->addText( 'gus_login', 'size', 15, 'minlength', 4, + 'validator', $model->createUniqueValidator('gus_login')); // Can the organization be changed? if ($this->escort->hasPrivilege('pr.staff.edit.all')) { - $bridge->addHiddenMulti($model->getKeyCopyName('gsu_id_organization')); - $bridge->addSelect('gsu_id_organization'); + $bridge->addHiddenMulti($model->getKeyCopyName('gus_id_organization')); + $bridge->addSelect('gus_id_organization'); } else { - $bridge->addExhibitor('gsu_id_organization'); + $bridge->addExhibitor('gus_id_organization'); } - $bridge->addPassword('gsu_password', + $bridge->addPassword('gus_password', 'label', $this->_('Password'), 'minlength', $this->project->passwords['MinimumLength'], // 'renderPassword', true, @@ -141,15 +141,15 @@ public function afterFormLoad(array &$data, $isNew) { - if (array_key_exists('gsu_login', $data)) { - $this->_instanceId = $data['gsu_login']; + if (array_key_exists('gus_login', $data)) { + $this->_instanceId = $data['gus_login']; } $sql = "SELECT ggp_id_group,ggp_role FROM gems__groups WHERE ggp_id_group = " . (int) $data['gsf_id_primary_group']; $groups = $this->db->fetchPairs($sql); if (! ($this->escort->hasPrivilege('pr.staff.edit.all') || - $data['gsu_id_organization'] == $this->escort->getCurrentOrganization())) { + $data['gus_id_organization'] == $this->escort->getCurrentOrganization())) { throw new Zend_Exception($this->_('You are not allowed to edit this staff member.')); } } @@ -169,21 +169,22 @@ { // MUtil_Model::$verbose = true; - $model = new Gems_Model_UserModel('staff', 'gems__staff', array('gsu_id_user' => 'gsf_id_user'), 'gsf'); + /* $model = new Gems_Model_UserModel('staff', 'gems__staff', array('gus_id_user' => 'gsf_id_user'), 'gsf'); if ($detailed) { $model->copyKeys(); } - //$model->resetOrder(); + //$model->resetOrder(); */ + $model = $this->loader->getModels()->getStaffModel(); - $model->set('gsu_login', 'label', $this->_('Login')); + $model->set('gus_login', 'label', $this->_('Login')); $model->set('name', 'label', $this->_('Name'), 'column_expression', "CONCAT(COALESCE(CONCAT(gsf_last_name, ', '), '-, '), COALESCE(CONCAT(gsf_first_name, ' '), ''), COALESCE(gsf_surname_prefix, ''))"); $model->set('gsf_email', 'label', $this->_('E-Mail'), 'itemDisplay', 'MUtil_Html_AElement::ifmail'); if ($detailed || $this->escort->hasPrivilege('pr.staff.see.all')) { - $this->menu->getParameterSource()->offsetSet('gsu_id_organization', $this->escort->getCurrentOrganization()); + $this->menu->getParameterSource()->offsetSet('gus_id_organization', $this->escort->getCurrentOrganization()); - $model->set('gsu_id_organization', 'label', $this->_('Organization'), + $model->set('gus_id_organization', 'label', $this->_('Organization'), 'multiOptions', $this->util->getDbLookup()->getOrganizations(), 'default', $this->escort->getCurrentOrganization()); } @@ -192,12 +193,12 @@ $model->set('gsf_gender', 'label', $this->_('Gender'), 'multiOptions', $this->util->getTranslated()->getGenders()); if ($detailed) { - $model->set('gsu_user_class', 'default', 'StaffUser'); + $model->set('gus_user_class', 'default', Gems_User_UserLoader::USER_STAFF); $model->set('gsf_iso_lang', 'label', $this->_('Language'), 'multiOptions', $this->util->getLocalized()->getLanguages()); $model->set('gsf_logout_on_survey', 'label', $this->_('Logout on survey'), 'multiOptions', $this->util->getTranslated()->getYesNo()); } - $model->setDeleteValues('gsu_active', 0); + $model->setDeleteValues('gus_active', 0); return $model; } @@ -208,8 +209,8 @@ if ($this->escort->hasPrivilege('pr.staff.see.all')) { // Select organization - $options = array('' => $this->_('(all organizations)')) + $this->getModel()->get('gsu_id_organization', 'multiOptions'); - $select = new Zend_Form_Element_Select('gsu_id_organization', array('multiOptions' => $options)); + $options = array('' => $this->_('(all organizations)')) + $this->getModel()->get('gus_id_organization', 'multiOptions'); + $select = new Zend_Form_Element_Select('gus_id_organization', array('multiOptions' => $options)); // Position as second element $search = array_shift($elements); @@ -234,7 +235,7 @@ $filter = parent::getDataFilter($data); if (! $this->escort->hasPrivilege('pr.staff.see.all')) { - $filter['gsu_id_organization'] = $this->escort->getCurrentOrganization(); + $filter['gus_id_organization'] = $this->escort->getCurrentOrganization(); } return $filter; } @@ -264,8 +265,8 @@ // Model filter has now been set. $data = $this->getModel()->loadFirst(); - $this->_setParam('gsu_id_organization', $data['gsu_id_organization']); - $this->menu->getParameterSource()->offsetSet('gsu_id_organization', $data['gsu_id_organization']); + $this->_setParam('gus_id_organization', $data['gus_id_organization']); + $this->menu->getParameterSource()->offsetSet('gus_id_organization', $data['gus_id_organization']); } return parent::getShowTable($columns, $filter, $sort); } Modified: branches/newUser2/classes/Gems/Default/SurveyMaintenanceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Default/SurveyMaintenanceAction.php 2011-11-03 17:45:34 UTC (rev 175) @@ -318,7 +318,7 @@ // Hence the unexpected order of the tables in the JoinModel. $model = new Gems_Model_JoinModel('surveys', 'gems__tracks'); $model->addTable('gems__rounds', array('gro_id_track' => 'gtr_id_track', 'gtr_track_type' => new Zend_Db_Expr("'S'"))); - $model->addRightTable('gems__surveys', array('gsu_id_survey' => 'gro_id_survey'), 'gsu'); + $model->addRightTable('gems__surveys', array('gsu_id_survey' => 'gro_id_survey'), 'gus'); $model->addTable('gems__sources', array('gsu_id_source'=>'gso_id_source')); $model->setKeysToTable('gems__surveys'); @@ -330,9 +330,8 @@ $model->addColumn(new Zend_Db_Expr('NULL'), 'create_stand_alone'); } } else { - $model = new Gems_Model_JoinModel('surveys', 'gems__surveys', 'gsu'); + $model = new Gems_Model_JoinModel('surveys', 'gems__surveys', 'gus'); $model->addTable('gems__sources', array('gsu_id_source'=>'gso_id_source')); - } $model->addColumn( Modified: branches/newUser2/classes/Gems/Default/TokenPlanAction.php =================================================================== --- trunk/library/classes/Gems/Default/TokenPlanAction.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Default/TokenPlanAction.php 2011-11-03 17:45:34 UTC (rev 175) @@ -351,7 +351,7 @@ COALESCE(gems__staff.gsf_first_name, ''), COALESCE(CONCAT(' ', gems__staff.gsf_surname_prefix), '') ) AS gsf_name - FROM (gems__users INNER JOIN gems__staff ON gsu_id_user = gsf_id_user) INNER JOIN gems__respondent2track ON gsu_id_user = gr2t_created_by + FROM (gems__users INNER JOIN gems__staff ON gus_id_user = gsf_id_user) INNER JOIN gems__respondent2track ON gus_id_user = gr2t_created_by WHERE gr2t_id_organization = $orgId AND gsu_active = 1 AND gr2t_active = 1"; Modified: branches/newUser2/classes/Gems/Loader/LoaderAbstract.php =================================================================== --- trunk/library/classes/Gems/Loader/LoaderAbstract.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Loader/LoaderAbstract.php 2011-11-03 17:45:34 UTC (rev 175) @@ -84,7 +84,7 @@ /** * - * @param type $container A container acting as source fro MUtil_Registry_Source + * @param mixed $container A container acting as source for MUtil_Registry_Source * @param array $dirs The directories where to look for requested classes */ public function __construct($container, array $dirs) Modified: branches/newUser2/classes/Gems/Loader.php =================================================================== --- trunk/library/classes/Gems/Loader.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Loader.php 2011-11-03 17:45:34 UTC (rev 175) @@ -119,6 +119,17 @@ /** * + * @return Gems_User_User + */ + public function getCurrentUser($login_name, $organization) + { + $loader = $this->getUserLoader(); + + return $loader->getCurrentUser(); + } + + /** + * * @return gems_Events */ public function getEvents() @@ -184,8 +195,8 @@ /** * * @param string $login_name - * @param int $organization Only used when more than one organization uses this $login_name - * @return Gems_User_UserAbstract + * @param int $organization + * @return Gems_User_User */ public function getUser($login_name, $organization) { Modified: branches/newUser2/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Menu/MenuAbstract.php 2011-11-03 17:45:34 UTC (rev 175) @@ -385,8 +385,8 @@ $editPage = $page->addEditAction()->setModelParameters(2); $delPage = $page->addDeleteAction()->setModelParameters(2); if (! $this->escort->hasPrivilege('pr.staff.edit.all')) { - $editPage->setParameterFilter('gsu_id_organization', $this->escort->getCurrentOrganization()); - $delPage->setParameterFilter('gsu_id_organization', $this->escort->getCurrentOrganization()); + $editPage->setParameterFilter('gus_id_organization', $this->escort->getCurrentOrganization()); + $delPage->setParameterFilter('gus_id_organization', $this->escort->getCurrentOrganization()); } return $page; Modified: branches/newUser2/classes/Gems/Model/UserModel.php =================================================================== --- trunk/library/classes/Gems/Model/UserModel.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Model/UserModel.php 2011-11-03 17:45:34 UTC (rev 175) @@ -67,7 +67,7 @@ parent::__construct($name, 'gems__users', (null === $saveable ? $fieldPrefix : $saveable)); if ($fieldPrefix) { - Gems_Model::setChangeFieldsByPrefix($this, 'gsu'); + Gems_Model::setChangeFieldsByPrefix($this, 'gus'); } if ($secondTable) { @@ -94,7 +94,7 @@ // Make it a number $out = intval($out); - } while ($db->fetchOne('SELECT gsu_id_user FROM gems__users WHERE gsu_id_user = ?', $out)); + } while ($db->fetchOne('SELECT gus_id_user FROM gems__users WHERE gus_id_user = ?', $out)); return $out; } @@ -109,9 +109,9 @@ */ public function save(array $newValues, array $filter = null, array $saveTables = null) { - if (! (isset($newValues['gsu_id_user']) && $newValues['gsu_id_user'])) { + if (! (isset($newValues['gus_id_user']) && $newValues['gus_id_user'])) { // Load a new user id if needed - $newValues['gsu_id_user'] = $this->_createUserId(); + $newValues['gus_id_user'] = $this->_createUserId(); } return parent::save($newValues, $filter, $saveTables); Modified: branches/newUser2/classes/Gems/Model.php =================================================================== --- trunk/library/classes/Gems/Model.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Model.php 2011-11-03 17:45:34 UTC (rev 175) @@ -61,28 +61,99 @@ /** * + * @var Zend_Db_Adapter_Abstract + */ + protected $db; + + /** + * * @var Gems_Loader */ protected $loader; /** + * Field name in respondent model containing the login id. + * + * @var string + */ + public $respondentLoginIdField = 'gr2o_patient_nr'; + + /** * @var Zend_Translate */ protected $translate; /** + * The length of a user id. + * + * @var int + */ + protected $userIdLen = 8; + + /** * @var Gems_Util */ protected $util; /** + * Function that automatically fills changed, changed_by, created and created_by fields with a certain prefix. + * + * @param Gems_Model_JoinModel $model + * @param string $loginField Field that links to login field. + * @param string $organizationField Field that links to the organization field. + */ + public function addAsUserLogin(Gems_Model_JoinModel $model, $loginField, $organizationField) + { + $model->addTable('gems__user_logins', array($loginField => 'gul_login', $organizationField => 'gul_id_organization'), 'gul'); + } + + /** + * Create a Gems project wide unique user id + * + * @param string $name + * @param mixed $value + * @param boolean $isNew + * @return int + */ + public function createGemsUserId($name, $value, $isNew) + { + if ($isNew || (null === $value)) { + $creationTime = new Zend_Db_Expr('CURRENT_TIMESTAMP'); + + do { + $out = mt_rand(1, 9); + for ($i = 1; $i < $this->userIdLen; $i++) { + $out .= mt_rand(0, 9); + } + // Make it a number + $out = intval($out); + + try { + if (0 === $this->db->insert('gems__user_logins', array('gui_id_user' => $out, 'gui_created' => $creationTime))) { + $out = null; + } + } catch (Zend_Db_Exception $e) { + $out = null; + } + } while (null === $out); + + return $out; + } + } + + /** * Load project specific model or general Gems model otherwise * * @return Gems_Model_RespondentModel */ public function createRespondentModel() { - return $this->_loadClass('RespondentModel', true); + $model = $this->_loadClass('RespondentModel', true); + + $this->addAsUserLogin($model, $this->respondentLoginIdField, 'gr2o_id_organization'); + $this->setAsGemsUserId($model, 'grs_id_user'); + + return $model; } /** @@ -133,7 +204,32 @@ return $model; } + public function getStaffModel() + { + $model = new Gems_Model_JoinModel('staff', 'gems__staff', 'gsf'); + + $this->addAsUserLogin($model, 'gsf_login', 'gsf_id_organization'); + $this->setAsGemsUserId($model, 'gsf_id_user'); + + return $model; + } + /** + * Set a field in this model as a gems unique user id + * + * @param MUtil_Model_DatabaseModelAbstract $model + * @param string $idField Field that uses global id. + */ + public function setAsGemsUserId(MUtil_Model_DatabaseModelAbstract $model, $idField) + { + // Make sure field is added to save when not there + $model->setAutoSave($idField); + + // Make sure the fields get a userid when empty + $model->setOnSave($idField, array($this, 'createGemsUserId')); + } + + /** * Function that automatically fills changed, changed_by, created and created_by fields with a certain prefix. * * @param MUtil_Model_DatabaseModelAbstract $model Modified: branches/newUser2/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Project/ProjectSettings.php 2011-11-03 17:45:34 UTC (rev 175) @@ -47,6 +47,14 @@ class Gems_Project_ProjectSettings extends ArrayObject { /** + * The minimum length for the password of a super admin + * on a production server. + * + * @var int + */ + protected $minimumSuperPasswordLength = 10; + + /** * Array of required keys. Give a string value for root keys * or name => array() values for required subs keys. * @@ -123,6 +131,14 @@ throw new Gems_Exception_Coding($error); } + $superPassword = $this->getSuperAdminPassword(); + if ((APPLICATION_ENV === 'production') && $this->getSuperAdminName() && $superPassword) { + if (strlen($superPassword) < $this->minimumSuperPasswordLength) { + $error = sprintf("Project setting 'admin.pwd' is shorter than %d characters. That is not allowed.", $this->minimumSuperPasswordLength); + throw new Gems_Exception_Coding($error); + } + } + if (! ($this->offsetExists('name') && $this->offsetGet('name'))) { $this->offsetSet('name', GEMS_PROJECT_NAME); } @@ -131,6 +147,30 @@ } /** + * Returns the super admin name, if any + * + * @return string + */ + public function getSuperAdminName() + { + if (isset($this->admin['user'])) { + return $this->admin['user']; + } + } + + /** + * Returns the super admin password, if any + * + * @return string + */ + public function getSuperAdminPassword() + { + if (isset($this->admin['pwd'])) { + return $this->admin['pwd']; + } + } + + /** * Returns a salted hash on the * * @param string $value The value to hash Modified: branches/newUser2/classes/Gems/User/RespondentUser.php =================================================================== --- trunk/library/classes/Gems/User/RespondentUser.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/User/RespondentUser.php 2011-11-03 17:45:34 UTC (rev 175) @@ -39,9 +39,9 @@ * * -- PATCH: New user login structure -INSERT INTO gems__users (gsu_id_user, gsu_login, gsu_id_organization, gsu_user_class, gsu_active, - gsu_password, gsu_failed_logins, gsu_last_failed, gsu_reset_key, gsu_reset_requested, gsu_reset_required, - gsu_changed, gsu_changed_by, gsu_created, gsu_created_by) +INSERT INTO gems__users (gus_id_user, gus_login, gus_id_organization, gus_user_class, gus_active, + gus_password, gus_failed_logins, gus_last_failed, gus_reset_key, gus_reset_requested, gus_reset_required, + gus_changed, gus_changed_by, gus_created, gus_created_by) SELECT grs_id_user, gr2o_patient_nr, gr2o_id_organization, 'RespondentUser', CASE WHEN gr2o_reception_code = 'OK' THEN 1 ELSE 0 END, NULL, 0, NULL, NULL, NULL, 0, gr2o_changed, gr2o_changed_by, gr2o_created, gr2o_created_by Modified: branches/newUser2/classes/Gems/User/StaffUser.php =================================================================== --- trunk/library/classes/Gems/User/StaffUser.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/User/StaffUser.php 2011-11-03 17:45:34 UTC (rev 175) @@ -55,13 +55,13 @@ { $select = new Zend_Db_Select($this->db); $select->from('gems__users') - ->join('gems__staff', 'gsu_login = gsf_id_user') + ->join('gems__staff', 'gus_login = gsf_id_user') ->join('gems__groups', 'gsf_id_primary_group = ggp_id_group') - ->join('gems__organizations', 'gsu_id_organization = gor_id_organization') + ->join('gems__organizations', 'gus_id_organization = gor_id_organization') ->where('ggp_group_active = 1') ->where('gor_active = 1') - ->where('gsu_active = 1') - ->where('gsu_login = ?', $this->getLoginName()) + ->where('gus_active = 1') + ->where('gus_login = ?', $this->getLoginName()) ->limit(1); return $select; Modified: branches/newUser2/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/User/UserLoader.php 2011-11-03 17:45:34 UTC (rev 175) @@ -47,6 +47,14 @@ class Gems_User_UserLoader extends Gems_Loader_TargetLoaderAbstract { /** + * User class constants + */ + const USER_NOLOGIN = 'NoLogin'; + const USER_OLD_STAFF = 'OldStaffUser'; + const USER_PROJECT = 'ProjectUser'; + const USER_STAFF = 'StaffUser'; + + /** * Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for. * * @var string $cascade An optional subdirectory where this subclass always loads from. @@ -55,51 +63,211 @@ /** * + * @var Zend_Db_Adapter_Abstract + */ + protected $db; + + /** + * * @var Gems_Project_ProjectSettings */ protected $project; + /** + * + * @param mixed $container A container acting as source for MUtil_Registry_Source + * @param array $dirs The directories where to look for requested classes + */ + public final function __construct($container, array $dirs) + { + parent::__construct($container, $dirs); + // Make sure Gems_User_User gets userLoader variable. + $this->addRegistryContainer(array('userLoader' => $this)); + } + /** + * Get the currently loggin in user * + * @return Gems_User_User */ - public function getCurrentUser() + public final function getCurrentUser() { static $currentUser; if (! $currentUser) { - $currentUser = Gems_User_UserAbstract::getCurrentUser(); + $currentUser = $this->_loadClass('User', true, array(Gems_User_User::getCurrentUserData())); + } - if (! $currentUser) { - $currentUser = $this->_loadClass('NoLoginUser', true, array(null, null)); + return $currentUser; + } - $currentUser->setAsCurrentUser(); - } + protected function getOldStaffUser($login_name, $organization) + { + /** + * Read the needed parameters from the different tables, lots of renames for backward + * compatibility + */ + $select = new Zend_Db_Select($this->db); + $select->from('gems__staff', array('user_id'=>'gsf_id_user', + 'user_login'=>'gsf_login', + //don't expose the password hash + //'user_password'=>'gsf_password', + 'user_email'=>'gsf_email', + 'user_group'=>'gsf_id_primary_group', + 'user_locale'=>'gsf_iso_lang', + 'user_logout'=>'gsf_logout_on_survey')) + ->columns(array('user_name'=>"(concat(coalesce(concat(`gems__staff`.`gsf_first_name`,_utf8' '),_utf8''),coalesce(concat(`gems__staff`.`gsf_surname_prefix`,_utf8' '),_utf8''),coalesce(`gems__staff`.`gsf_last_name`,_utf8'')))")) + ->join('gems__groups', 'gsf_id_primary_group = ggp_id_group', array('user_role'=>'ggp_role')) + ->join('gems__organizations', 'gsf_id_organization = gor_id_organization', + array( + 'user_organization_id'=>'gor_id_organization', + 'user_organization_name'=>'gor_name')) + ->where('ggp_group_active = 1') + ->where('gor_active = 1') + ->where('gsf_active = 1') + ->where('gsf_login = ?') + ->limit(1); + + //For a multi-layout project we need to select the appropriate style too + $select2 = clone $select; + $select2->columns(array('user_style' => 'gor_style'), 'gems__organizations'); + + try { + // Fails before patch has run... + return $this->db->fetchRow($select2, array($userName), Zend_Db::FETCH_ASSOC); + + } catch (Zend_Db_Exception $e) { + // So then we try the old method + return $this->db->fetchRow($select, array($userName), Zend_Db::FETCH_ASSOC); } + } - return $currentUser; + /** + * Overrule this function to handle your own - project + * specific = user classes. + * + * @param string $class Class name returned by getUserClass() + * @param string $login_name + * @param int $organization + * @return array + */ + protected function getProjectClassUser($class, $login_name, $organization) + { + throw new Gems_Exception_Coding(sprintf("Unknown user class '%s' found for user '%s'.", $class, $login_name)); } /** * * @param string $login_name - * @param int $organization Only used when more than one organization uses this $login_name - * @return Gems_User_UserAbstract + * @param int $organization + * @return array */ - public function getUser($login_name, $organization) + protected function getProjectUser($login_name, $organization) { - if ($this->isProjectUser($login_name)) { - return $this->loadProjectUser($login_name, $organization); - } + return array( + 'user_id' => 2000, + 'user_name' => $login_name, + 'user_group' => 800, + 'user_role' => 'master', + 'user_style' => 'gems', + 'user_organization_id' => $organization, + 'user_organization_name' => 'SUPER ADMIN', + 'allowedOrgs' => array($organization => 'SUPER ADMIN'), + ); } protected function isProjectUser($login_name) { - return isset($this->project->admin['user']) && ($this->project->admin['user'] == $login_name); + return $this->project->getSuperAdminName() == $login_name; } - protected function loadProjectUser($login_name, $organization) + protected function getStaffUser($login_name, $organization) { - return $this->_getClass('ProjectSuperUser', null, array($login_name, $organization)); + $select = new Zend_Db_Select($this->db); + $select->from('gems__users', array('user_id' => 'gus_id_user', + 'user_login' => 'gus_login', + //don't expose the password hash + //'user_password'=>'gus_password', + )) + ->join('gems__staff', 'gus_id_user = gsf_id_user', array( + 'user_email'=>'gsf_email', + 'user_group'=>'gsf_id_primary_group', + 'user_locale'=>'gsf_iso_lang', + 'user_logout'=>'gsf_logout_on_survey')) + ->columns(array('user_name'=>"(concat(coalesce(concat(`gems__staff`.`gsf_first_name`,_utf8' '),_utf8''),coalesce(concat(`gems__staff`.`gsf_surname_prefix`,_utf8' '),_utf8''),coalesce(`gems__staff`.`gsf_last_name`,_utf8'')))")) + ->join('gems__groups', 'gsf_id_primary_group = ggp_id_group', array('user_role'=>'ggp_role')) + ->join('gems__organizations', 'gus_id_organization = gor_id_organization', + array( + 'user_organization_id'=>'gor_id_organization', + 'user_organization_name'=>'gor_name', + 'user_style' => 'gor_style')) + ->where('ggp_group_active = 1') + ->where('gor_active = 1') + ->where('gus_active = 1') + ->where('gus_login = ?') + ->limit(1); + + return $this->db->fetchRow($select, array($userName), Zend_Db::FETCH_ASSOC); } + + /** + * Returns a user object, that may be empty if no user exist. + * + * @param string $login_name + * @param int $organization + * @return Gems_User_User or null when the user does not exist + */ + public final function getUser($login_name, $organization) + { + $class = $this->getUserClass($login_name, $organization); + switch ($class) { + case self::USER_PROJECT: + $values = $this->getProjectUser($login_name, $organization); + break; + + case self::USER_STAFF: + $values = $this->getStaffUser($login_name, $organization); + break; + + case self::USER_OLD_STAFF: + $values = $this->getOldStaffUser($login_name, $organization); + break; + + case self::USER_NOLOGIN: + case null; + case false; + return null; + + default: + $values = $this->getProjectClassUser($class, $login_name, $organization); + } + + $values['user_class'] = $class; + + return $this->_loadClass('User', true, array($values)); + } + + /** + * Returns the user class, can be overloaded by subclasses. + * + * @param string $login_name + * @param int $organization + * @return string + */ + protected function getUserClass($login_name, $organization) + { + if ($this->isProjectUser($login_name)) { + return self::USER_PROJECT; + } + + try { + $sql = "SELECT gus_user_class FROM gems__users WHERE gus_active = 1 AND gus_login = ? AND gus_id_organization = ?"; + return $this->db->fetchOne($sql, array($login_name, $organization)); + + } catch (Zend_Db_Exception $e) { + // Fail over for pre 1.5 projects + return self::USER_OLD_STAFF; + } + } } Modified: branches/newUser2/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Util/DbLookup.php 2011-11-03 17:45:34 UTC (rev 175) @@ -105,7 +105,7 @@ if (! $data) { $data = $this->db->fetchPairs("SELECT gsf_id_user, CONCAT(COALESCE(gsf_last_name, '-'), ', ', COALESCE(gsf_first_name, ''), COALESCE(CONCAT(' ', gsf_surname_prefix), '')) - FROM gems__users INNER JOIN gems__staff ON gsu_id_user = gsf_id_user WHERE gsu_active = 1 ORDER BY gsf_last_name, gsf_first_name, gsf_surname_prefix"); + FROM gems__users INNER JOIN gems__staff ON gus_id_user = gsf_id_user WHERE gus_active = 1 ORDER BY gsf_last_name, gsf_first_name, gsf_surname_prefix"); } return $data; Modified: branches/newUser2/classes/Gems/Validate/GemsPasswordUsername.php =================================================================== --- trunk/library/classes/Gems/Validate/GemsPasswordUsername.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/Gems/Validate/GemsPasswordUsername.php 2011-11-03 17:45:34 UTC (rev 175) @@ -86,7 +86,7 @@ */ public function __construct($usernameField, $passwordField, Zend_Db_Adapter_Abstract $adapter = null, $delayFactor = null) { - parent::__construct('gems__users', 'gsu_login', null, $adapter); + parent::__construct('gems__users', 'gus_login', null, $adapter); $this->_usernameField = $usernameField; $this->_passwordField = $passwordField; @@ -137,7 +137,7 @@ } } - $condition = $this->_adapter->quoteIdentifier('gsu_password') . ' = ?'; + $condition = $this->_adapter->quoteIdentifier('gus_password') . ' = ?'; $this->_exclude = $this->_adapter->quoteInto($condition, md5($password)); try { @@ -145,8 +145,8 @@ * Lookup last failed login and number of failed logins */ try { - $sql = "SELECT gsu_failed_logins, UNIX_TIMESTAMP(gsu_last_failed) - AS gsu_last_failed FROM {$this->_table} WHERE gsu_login = ?"; + $sql = "SELECT gus_failed_logins, UNIX_TIMESTAMP(gus_last_failed) + AS gus_last_failed FROM {$this->_table} WHERE gus_login = ?"; $results = $this->_adapter->fetchRow($sql, array($username)); } catch (Zend_Db_Exception $zde) { //If we need to apply a db patch, just use a default value @@ -154,10 +154,10 @@ MUtil_Echo::r(GemsEscort::getInstance()->translate->_('Please update the database')); } - $delay = pow($results['gsu_failed_logins'], $this->_delayFactor); - $remaining = ($results['gsu_last_failed'] + $delay) - time(); + $delay = pow($results['gus_failed_logins'], $this->_delayFactor); + $remaining = ($results['gus_last_failed'] + $delay) - time(); - if ($results['gsu_failed_logins'] > 0 && $remaining > 0) { + if ($results['gus_failed_logins'] > 0 && $remaining > 0) { $this->_obscureValue = false; $this->_error(self::ERROR_PASSWORD_DELAY, ceil($remaining / 60)); return false; Modified: branches/newUser2/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/GemsEscort.php 2011-11-03 17:45:34 UTC (rev 175) @@ -921,7 +921,7 @@ * Reset number of failed logins */ try { - $sql = "UPDATE gems__users SET gsu_failed_logins = 0, gsu_last_failed = NULL WHERE gsu_login = ?"; + $sql = "UPDATE gems__users SET gus_failed_logins = 0, gus_last_failed = NULL WHERE gus_login = ?"; $this->db->query($sql, array($userName)); } catch (Exception $e) { // swallow exception @@ -935,7 +935,7 @@ */ try { if (isset($_POST['userlogin'])) { - $sql = "UPDATE gems__users SET gsu_failed_logins = gsu_failed_logins + 1, gsu_last_failed = NOW() WHERE gsu_login = ?"; + $sql = "UPDATE gems__users SET gus_failed_logins = gus_failed_logins + 1, gus_last_failed = NOW() WHERE gus_login = ?"; $this->db->query($sql, array($_POST['userlogin'])); } } catch (Exception $e) { @@ -1268,24 +1268,24 @@ * compatibility */ $select = new Zend_Db_Select($this->db); - $select->from('gems__users', array('user_id' => 'gsu_id_user', - 'user_login' => 'gsu_login', + $select->from('gems__users', array('user_id' => 'gus_id_user', + 'user_login' => 'gus_login', //don't expose the password hash - //'user_password'=>'gsu_password', + //'user_password'=>'gus_password', )) - ->join('gems__staff', 'gsu_id_user = gsf_id_user', array( + ->join('gems__staff', 'gus_id_user = gsf_id_user', array( 'user_email'=>'gsf_email', 'user_group'=>'gsf_id_primary_group', 'user_locale'=>'gsf_iso_lang', 'user_logout'=>'gsf_logout_on_survey')) ->columns(array('user_name'=>"(concat(coalesce(concat(`gems__staff`.`gsf_first_name`,_utf8' '),_utf8''),coalesce(concat(`gems__staff`.`gsf_surname_prefix`,_utf8' '),_utf8''),coalesce(`gems__staff`.`gsf_last_name`,_utf8'')))")) ->join('gems__groups', 'gsf_id_primary_group = ggp_id_group', array('user_role'=>'ggp_role')) - ->join('gems__organizations', 'gsu_id_organization = gor_id_organization', + ->join('gems__organizations', 'gus_id_organization = gor_id_organization', array('user_organization_id'=>'gor_id_organization', 'user_organization_name'=>'gor_name')) ->where('ggp_group_active = ?', 1) ->where('gor_active = ?', 1) - ->where('gsu_active = ?', 1) - ->where('gsu_login = ?', $userName) + ->where('gus_active = ?', 1) + ->where('gus_login = ?', $userName) ->limit(1); //For a multi-layout project we need to select the appropriate style too Modified: branches/newUser2/classes/MUtil/Registry/Source.php =================================================================== --- trunk/library/classes/MUtil/Registry/Source.php 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/classes/MUtil/Registry/Source.php 2011-11-03 17:45:34 UTC (rev 175) @@ -3,7 +3,7 @@ /** * Copyright (c) 2011, Erasmus MC * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -14,7 +14,7 @@ * * Neither the name of Erasmus MC nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -97,14 +97,14 @@ } } } - + return false; } /** * Adds an extra source container to this object. - * - * @param mixed $container + * + * @param mixed $container Zend_Config, array or ArrayObject * @param string $name An optional name to identify the container * @return MUtil_Registry_Source */ @@ -156,7 +156,7 @@ public function removeRegistryContainer($name) { unset($this->_containers[$name]); - + return $this; } } Modified: branches/newUser2/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/configs/db/patches.sql 2011-11-03 17:45:34 UTC (rev 175) @@ -219,37 +219,37 @@ -- PATCH: New user login structure CREATE TABLE if not exists gems__users ( - gsu_id_user bigint unsigned not null, - gsu_id_organization bigint not null references gems__organizations (gor_id_organization), + gus_id_user bigint unsigned not null, + gus_id_organization bigint not null references gems__organizations (gor_id_organization), - gsu_login varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + gus_login varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, - gsu_user_class varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, - gsu_active boolean not null default 1, + gus_user_class varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + gus_active boolean not null default 1, -- Common fields for standard 'store password in Gems' logins - -- Not every gsu_user_class will use them - gsu_password varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gsu_failed_logins int(11) unsigned not null default 0, - gsu_last_failed timestamp null, - gsu_reset_key varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gsu_reset_requested timestamp null, - gsu_reset_required boolean not null default 0, + -- Not every gus_user_class will use them + gus_password varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gus_failed_logins int(11) unsigned not null default 0, + gus_last_failed timestamp null, + gus_reset_key varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gus_reset_requested timestamp null, + gus_reset_required boolean not null default 0, - gsu_changed timestamp not null default current_timestamp on update current_timestamp, - gsu_changed_by bigint unsigned not null, - gsu_created timestamp not null, - gsu_created_by bigint unsigned not null, + gus_changed timestamp not null default current_timestamp on update current_timestamp, + gus_changed_by bigint unsigned not null, + gus_created timestamp not null, + gus_created_by bigint unsigned not null, - PRIMARY KEY (gsu_id_user, gsu_id_organization), - UNIQUE (gsu_login, gsu_id_organization) + PRIMARY KEY (gus_id_user, gus_id_organization), + UNIQUE (gus_login, gus_id_organization) ) ENGINE=InnoDB CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; -INSERT INTO gems__users (gsu_id_user, gsu_login, gsu_id_organization, gsu_user_class, gsu_active, - gsu_password, gsu_failed_logins, gsu_last_failed, gsu_reset_key, gsu_reset_requested, gsu_reset_required, - gsu_changed, gsu_changed_by, gsu_created, gsu_created_by) +INSERT INTO gems__users (gus_id_user, gus_login, gus_id_organization, gus_user_class, gus_active, + gus_password, gus_failed_logins, gus_last_failed, gus_reset_key, gus_reset_requested, gus_reset_required, + gus_changed, gus_changed_by, gus_created, gus_created_by) SELECT gsf_id_user, gsf_login, gsf_id_organization, 'StaffUser', gsf_active, NULL, gsf_failed_logins, gsf_last_failed, gsf_reset_key, 0, 1, gsf_changed, gsf_changed_by, gsf_created, gsf_created_by @@ -263,6 +263,8 @@ CHANGE `gsf_password` `gsf_password` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `gsf_id_organization` `gsf_id_organization` BIGINT( 20 ) NULL DEFAULT NULL; +ALTER TABLE gems__organizations ADD gor_style varchar(15) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'gems' AFTER gor_signature; + -- PATCH: Extra information for track fields ALTER TABLE gems__track_fields ADD gtf_field_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER gtf_field_name, ADD gtf_field_description varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER gtf_field_code, Modified: branches/newUser2/configs/db/tables/gems__organizations.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__organizations.20.sql 2011-11-03 17:40:33 UTC (rev 174) +++ branches/newUser2/configs/db/tables/gems__organizations.20.sql 2011-11-03 17:45:34 UTC (rev 175) @@ -13,7 +13,7 @@ gor_welcome text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', gor_signature text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', - -- gor_style varchar(15) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'gems', + gor_style varchar(15) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'gems', gor_iso_lang char(2) CHARACTER S... [truncated message content] |
From: <gem...@li...> - 2011-11-03 17:40:39
|
Revision: 174 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=174&view=rev Author: matijsdejong Date: 2011-11-03 17:40:33 +0000 (Thu, 03 Nov 2011) Log Message: ----------- When searching on a hashed SSN for #37 the hash should be applied to the search value automatically. Modified Paths: -------------- trunk/library/classes/Gems/Model/RespondentModel.php Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2011-11-03 13:37:18 UTC (rev 173) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2011-11-03 17:40:33 UTC (rev 174) @@ -107,10 +107,30 @@ $filter['gr2o_id_organization'] = $this->getCurrentOrganization(); } + if (self::SSN_HASH === $this->hashSsn) { + // Make sure a search for a SSN is hashed when needed. + array_walk_recursive($filter, array($this, 'applyHash')); + } + return $filter; } /** + * Apply hash function for array_walk_recursive in _checkFilterUsed() + * + * @see _checkFilterUsed() + * + * @param string $filterValue + * @param string $filterKey + */ + public function applyHash(&$filterValue, $filterKey) + { + if ('grs_ssn' === $filterKey) { + $filterValue = $this->project->getValueHash($filterValue); + } + } + + /** * Return a hashed version of the input value. * * @param string $name Optional name, is here for ModelAbstract setOnSave compatibility This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 13:37:27
|
Revision: 173 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=173&view=rev Author: michieltcs Date: 2011-11-03 13:37:18 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Move getRandomPassword() to escort, make it public Modified Paths: -------------- trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-03 13:23:03 UTC (rev 172) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-11-03 13:37:18 UTC (rev 173) @@ -273,26 +273,6 @@ $this->_reroute(array('action' => 'index'), true); } - protected function _getRandomPassword() - { - $salt = "abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ0123456789"; - $pass = ""; - - srand((double)microtime()*1000000); - - $i = 0; - - while ($i <= 7) - { - $num = rand() % strlen($salt); - $tmp = substr($salt, $num, 1); - $pass = $pass . $tmp; - $i++; - } - - return $pass; - } - protected function _getResetForm() { $form = new Gems_Form(array('labelWidthFactor' => $this->labelWidthFactor)); @@ -362,7 +342,7 @@ if (!empty($result)) { // generate new password - $password = $this->_getRandomPassword(); + $password = $this->escort->getRandomPassword(); $passwordHash = $this->escort->passwordHash(null, $password, false); $mail->setSubject('New password'); Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-03 13:23:03 UTC (rev 172) +++ trunk/library/classes/GemsEscort.php 2011-11-03 13:37:18 UTC (rev 173) @@ -1319,7 +1319,31 @@ { return $this->project->getValueHash($value); } + + /** + * Generate random password + * @return string + */ + public function getRandomPassword() + { + $salt = "abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ0123456789"; + $pass = ""; + srand((double)microtime()*1000000); + + $i = 0; + + while ($i <= 7) + { + $num = rand() % strlen($salt); + $tmp = substr($salt, $num, 1); + $pass = $pass . $tmp; + $i++; + } + + return $pass; + } + /** * Hook 12: Called after an action is dispatched by Zend_Controller_Dispatcher. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 13:23:09
|
Revision: 172 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=172&view=rev Author: matijsdejong Date: 2011-11-03 13:23:03 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Whoops.. bug Modified Paths: -------------- trunk/library/classes/Gems/Project/ProjectSettings.php Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-03 13:10:10 UTC (rev 171) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-03 13:23:03 UTC (rev 172) @@ -141,9 +141,9 @@ $salt = $this->offsetExists('salt') ? $this->offsetGet('salt') : ''; if (false === strpos($salt, '%s')) { + return md5($salt . $value, false); + } else { return md5(sprintf($salt, $value), false); - } else { - return md5($salt . $value, false); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 13:10:21
|
Revision: 171 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=171&view=rev Author: matijsdejong Date: 2011-11-03 13:10:10 +0000 (Thu, 03 Nov 2011) Log Message: ----------- #31 continued: stored of has can now be set on project level (by overruling RespondentModel.php) Modified Paths: -------------- trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2011-11-03 13:08:54 UTC (rev 170) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2011-11-03 13:10:10 UTC (rev 171) @@ -50,8 +50,25 @@ */ class Gems_Model_RespondentModel extends Gems_Model_HiddenOrganizationModel { - protected $hashBsn = true; + const SSN_HASH = 0; + const SSN_HIDE = 1; + const SSN_OPEN = 2; + /** + * Determines how the social security number is stored. + * + * Can be changed is derived classes. + * + * @var int One of the SSN_ constants + */ + public $hashSsn = self::SSN_HASH; + + /** + * + * @var Gems_Project_ProjectSettings + */ + protected $project; + public function __construct() { // gems__respondents MUST be first table for INSERTS!! @@ -67,9 +84,9 @@ $this->setOnSave('gr2o_opened_by', GemsEscort::getInstance()->session->user_id); $this->setSaveOnChange('gr2o_opened_by'); - if ($this->hashBsn) { + if (self::SSN_HASH === $this->hashSsn) { $this->setSaveWhenNotNull('grs_ssn'); - $this->setOnSave('grs_ssn', array($this, 'formatBSN')); + $this->setOnSave('grs_ssn', array($this, 'formatSSN')); } } @@ -93,17 +110,21 @@ return $filter; } - public function formatBSN($name, $value, $new = false) + /** + * Return a hashed version of the input value. + * + * @param string $name Optional name, is here for ModelAbstract setOnSave compatibility + * @param string $value The value to hash. + * @param boolean $new Optional is new, is here for ModelAbstract setOnSave compatibility + * @return string The salted hash as a 32-character hexadecimal number. + */ + public function formatSSN($name, $value, $new = false) { - return md5($value); + if ($value) { + return $this->project->getValueHash($value); + } } - public function addPhysicians() - { - $this->addLeftTable('gems__staff', array('gr2o_id_physician' => 'gsf_id_user')); - return $this; - } - public function copyKeys($reset = false) { $keys = $this->_getKeysFor('gems__respondent2org'); Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-03 13:08:54 UTC (rev 170) +++ trunk/library/classes/GemsEscort.php 2011-11-03 13:10:10 UTC (rev 171) @@ -1308,7 +1308,7 @@ } /** - * Return a hashed of the string. + * Return a hashed version of the input value. * * @param string $name Optional name, is here for ModelAbstract setOnSave compatibility * @param string $value The value to hash. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 13:09:05
|
Revision: 170 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=170&view=rev Author: michieltcs Date: 2011-11-03 13:08:54 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Allow backwards-compatibility Modified Paths: -------------- trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-03 12:23:36 UTC (rev 169) +++ trunk/library/classes/GemsEscort.php 2011-11-03 13:08:54 UTC (rev 170) @@ -911,8 +911,12 @@ } } - public function afterLogin($userName) + public function afterLogin($userName = null) { + if (empty($userName)) { + $userName = $_POST['userlogin']; + } + /** * Reset number of failed logins */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 12:23:42
|
Revision: 169 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=169&view=rev Author: michieltcs Date: 2011-11-03 12:23:36 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Add parameter to afterLogin(), don't force it to read POST data Modified Paths: -------------- trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-03 12:05:46 UTC (rev 168) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-11-03 12:23:36 UTC (rev 169) @@ -231,7 +231,7 @@ /** * Perform any project specific post login activities */ - $this->escort->afterLogin(); + $this->escort->afterLogin($_POST['userlogin']); /** * Fix current locale Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-03 12:05:46 UTC (rev 168) +++ trunk/library/classes/GemsEscort.php 2011-11-03 12:23:36 UTC (rev 169) @@ -911,14 +911,14 @@ } } - public function afterLogin() + public function afterLogin($userName) { /** * Reset number of failed logins */ try { $sql = "UPDATE gems__users SET gsu_failed_logins = 0, gsu_last_failed = NULL WHERE gsu_login = ?"; - $this->db->query($sql, array($_POST['userlogin'])); + $this->db->query($sql, array($userName)); } catch (Exception $e) { // swallow exception } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 12:05:55
|
Revision: 168 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=168&view=rev Author: matijsdejong Date: 2011-11-03 12:05:46 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Fix for #33 Burger Service Number is now Social Security Number Made HiddenOrganizationModel.php instance of MUtil_Registry_TargetInterface Adapted translations Modified Paths: -------------- trunk/library/changelog.txt trunk/library/classes/Gems/Communication/RespondentModelWriter.php trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/Gems/Model/HiddenOrganizationModel.php trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__respondents.30.sql trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2011-11-03 10:59:34 UTC (rev 167) +++ trunk/library/changelog.txt 2011-11-03 12:05:46 UTC (rev 168) @@ -1,9 +1,10 @@ Important changes from 1.4.3 => 1.5 ============================================================ -The table gems__staff is split into gems__staff and gems__user with all login data in gems__users Passwords should be set with a project.ini->salt. Salt is now a required project setting! -MailController is now called MailTemplateController -EmailController is now called CronController (with stub for compatibility) +The table gems__staff is split into gems__staff and gems__user with all login data in gems__users. +The gems__respondent.grs_bsn has been renamed to grs_ssn, to make the code more international. +MailController is now called MailTemplateController. +EmailController is now called CronController (with stub for compatibility). Important changes from 1.4.2 => 1.4.3 ============================================================ Modified: trunk/library/classes/Gems/Communication/RespondentModelWriter.php =================================================================== --- trunk/library/classes/Gems/Communication/RespondentModelWriter.php 2011-11-03 10:59:34 UTC (rev 167) +++ trunk/library/classes/Gems/Communication/RespondentModelWriter.php 2011-11-03 12:05:46 UTC (rev 168) @@ -65,7 +65,7 @@ { $parameters = $this->_model->applyParameters( array( - 'grs_bsn' => $respondent->getBsn(), + 'grs_ssn' => $respondent->getBsn(), 'gr2o_reception_code' => GemsEscort::RECEPTION_OK, 'gr2o_patient_nr' => $respondent->getPatientId() ) @@ -85,7 +85,7 @@ $data['grs_first_name'] = $respondent->getFirstName(); $data['grs_last_name'] = $respondent->getLastName(); $data['grs_surname_prefix'] = $respondent->getSurnamePrefix(); - $data['grs_bsn'] = $respondent->getBsn(); + $data['grs_ssn'] = $respondent->getBsn(); $data['grs_gender'] = $respondent->getGender(); $data['grs_birthday'] = $respondent->getBirthday(); Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-03 10:59:34 UTC (rev 167) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-03 12:05:46 UTC (rev 168) @@ -116,10 +116,10 @@ $num++; } - $model->set('grs_bsn', 'description', 'Willekeurig voorbeeld BSN: ' . $num); + $model->set('grs_ssn', 'description', sprintf($this->_('Random Example BSN: %s'), $num)); } else { - $model->set('grs_bsn', 'description', $this->_('Enter a 9-digit BSN number.')); + $model->set('grs_ssn', 'description', $this->_('Enter a 9-digit SSN number.')); } $ucfirst = new Zend_Filter_Callback('ucfirst'); @@ -129,9 +129,9 @@ $bridge->addHidden( $model->getKeyCopyName('gr2o_patient_nr')); $bridge->addTab( 'caption1')->h4($this->_('Identification')); - $bridge->addText( 'grs_bsn', 'label', $this->_('BSN'), 'size', 10, 'maxlength', 12) + $bridge->addText( 'grs_ssn', 'label', $this->_('SSN'), 'size', 10, 'maxlength', 12) ->addValidator( new MUtil_Validate_Dutch_Burgerservicenummer()) - ->addValidator( $model->createUniqueValidator('grs_bsn')) + ->addValidator( $model->createUniqueValidator('grs_ssn')) ->addFilter( 'Digits'); $bridge->addText( 'gr2o_patient_nr', 'label', $this->_('Patient number'), 'size', 15, 'minlength', 4) ->addValidator( $model->createUniqueValidator(array('gr2o_patient_nr', 'gr2o_id_organization'), array('gr2o_id_user' => 'grs_id_user', 'gr2o_id_organization'))); Modified: trunk/library/classes/Gems/Model/HiddenOrganizationModel.php =================================================================== --- trunk/library/classes/Gems/Model/HiddenOrganizationModel.php 2011-11-03 10:59:34 UTC (rev 167) +++ trunk/library/classes/Gems/Model/HiddenOrganizationModel.php 2011-11-03 12:05:46 UTC (rev 168) @@ -45,9 +45,23 @@ * @license New BSD License * @since Class available since version 1.0 */ -class Gems_Model_HiddenOrganizationModel extends Gems_Model_JoinModel +class Gems_Model_HiddenOrganizationModel extends Gems_Model_JoinModel implements MUtil_Registry_TargetInterface { /** + * Allows the loader to set resources. + * + * @param string $name Name of resource to set + * @param mixed $resource The resource. + * @return boolean True if $resource was OK + */ + public function answerRegistryRequest($name, $resource) + { + $this->$name = $resource; + + return true; + } + + /** * Stores the fields that can be used for sorting or filtering in the * sort / filter objects attached to this model. * @@ -80,6 +94,30 @@ return array(); } + /** + * Should be called after answering the request to allow the Target + * to check if all required registry values have been set correctly. + * + * @return boolean False if required values are missing. + */ + public function checkRegistryRequestsAnswers() + { + return true; + } + + /** + * Filters the names that should not be requested. + * + * Can be overriden. + * + * @param string $name + * @return boolean + */ + protected function filterRequestNames($name) + { + return '_' !== $name[0]; + } + public function getCurrentOrganization() { return GemsEscort::getInstance()->getCurrentOrganization(); @@ -110,4 +148,18 @@ return $href; } + + /** + * Allows the loader to know the resources to set. + * + * Returns those object variables defined by the subclass but not at the level of this definition. + * + * Can be overruled. + * + * @return array of string names + */ + public function getRegistryRequests() + { + return array_filter(array_keys(get_object_vars($this)), array($this, 'filterRequestNames')); + } } Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2011-11-03 10:59:34 UTC (rev 167) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2011-11-03 12:05:46 UTC (rev 168) @@ -68,8 +68,8 @@ $this->setSaveOnChange('gr2o_opened_by'); if ($this->hashBsn) { - $this->setSaveWhenNotNull('grs_bsn'); - $this->setOnSave('grs_bsn', array($this, 'formatBSN')); + $this->setSaveWhenNotNull('grs_ssn'); + $this->setOnSave('grs_ssn', array($this, 'formatBSN')); } } Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-03 10:59:34 UTC (rev 167) +++ trunk/library/configs/db/patches.sql 2011-11-03 12:05:46 UTC (rev 168) @@ -266,4 +266,7 @@ -- PATCH: Extra information for track fields ALTER TABLE gems__track_fields ADD gtf_field_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER gtf_field_name, ADD gtf_field_description varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER gtf_field_code, - ADD gtf_readonly boolean not null default false AFTER gtf_required; \ No newline at end of file + ADD gtf_readonly boolean not null default false AFTER gtf_required; + +-- PATCH: Change Burger Service Nummer to Social Security Number +ALTER TABLE `gems__respondents` CHANGE `grs_bsn` `grs_ssn` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; Modified: trunk/library/configs/db/tables/gems__respondents.30.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondents.30.sql 2011-11-03 10:59:34 UTC (rev 167) +++ trunk/library/configs/db/tables/gems__respondents.30.sql 2011-11-03 12:05:46 UTC (rev 168) @@ -6,7 +6,7 @@ -- null unique key, -- grs_password varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, - grs_bsn varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' + grs_ssn varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null unique key, -- Naam Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2011-11-03 10:59:34 UTC (rev 167) +++ trunk/library/languages/default-en.po 2011-11-03 12:05:46 UTC (rev 168) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-25 13:52+0100\n" +"POT-Creation-Date: 2011-11-03 12:50+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -18,58 +18,58 @@ "X-Poedit-KeywordsList: plural:1,2\n" "X-Poedit-SearchPath-0: .\n" -#: classes/GemsEscort.php:155 +#: classes/GemsEscort.php:186 #, php-format msgid "Path %s not writable" msgstr "Path %s not writable" -#: classes/GemsEscort.php:840 +#: classes/GemsEscort.php:860 #, php-format msgid "User: %s" msgstr "User: %s" -#: classes/GemsEscort.php:864 +#: classes/GemsEscort.php:884 msgid "version" msgstr "version" -#: classes/GemsEscort.php:1419 +#: classes/GemsEscort.php:1405 msgid "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" msgstr "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" -#: classes/GemsEscort.php:1540 +#: classes/GemsEscort.php:1526 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1542 -#: classes/GemsEscort.php:1545 -#: classes/GemsEscort.php:1546 +#: classes/GemsEscort.php:1528 +#: classes/GemsEscort.php:1531 +#: classes/GemsEscort.php:1532 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1560 +#: classes/GemsEscort.php:1546 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1562 -#: classes/GemsEscort.php:1598 +#: classes/GemsEscort.php:1548 +#: classes/GemsEscort.php:1584 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1578 +#: classes/GemsEscort.php:1564 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1580 +#: classes/GemsEscort.php:1566 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "Access to this page is not allowed for current role: %s." -#: classes/GemsEscort.php:1585 -#: classes/GemsEscort.php:1596 +#: classes/GemsEscort.php:1571 +#: classes/GemsEscort.php:1582 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1586 +#: classes/GemsEscort.php:1572 msgid "You must login to access this page." msgstr "You must login to access this page." @@ -477,7 +477,7 @@ msgid "Cancel" msgstr "Cancel" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:175 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:181 msgid "No data found." msgstr "No data found." @@ -577,35 +577,35 @@ msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L." msgstr "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L." -#: classes/Gems/Default/ConsentAction.php:66 +#: classes/Gems/Default/ConsentAction.php:68 #: classes/Gems/Default/GroupAction.php:87 msgid "Description" msgstr "Description" -#: classes/Gems/Default/ConsentAction.php:68 +#: classes/Gems/Default/ConsentAction.php:70 #: classes/Gems/Default/DatabaseAction.php:167 msgid "Order" msgstr "Order" -#: classes/Gems/Default/ConsentAction.php:69 +#: classes/Gems/Default/ConsentAction.php:71 msgid "Determines order of presentation in interface." msgstr "Determines order of presentation in interface." -#: classes/Gems/Default/ConsentAction.php:71 +#: classes/Gems/Default/ConsentAction.php:73 msgid "Consent code" msgstr "Consent code" -#: classes/Gems/Default/ConsentAction.php:73 +#: classes/Gems/Default/ConsentAction.php:75 msgid "Internal code, not visible to users, copied with the token information to the source." msgstr "Internal code, not visible to users, copied with the token information to the source." -#: classes/Gems/Default/ConsentAction.php:90 +#: classes/Gems/Default/ConsentAction.php:92 msgid "respondent consent" msgid_plural "respondent consents" msgstr[0] "patient consent" msgstr[1] "patient consents" -#: classes/Gems/Default/ConsentAction.php:95 +#: classes/Gems/Default/ConsentAction.php:97 msgid "Respondent consents" msgstr "Patient consents" @@ -637,6 +637,14 @@ msgid "Links concerning this web application:" msgstr "Links concerning this web application:" +#: classes/Gems/Default/CronAction.php:136 +msgid "Cron jobs turned off." +msgstr "Cron jobs turned off." + +#: classes/Gems/Default/CronAction.php:200 +msgid "No mails sent" +msgstr "No mails sent" + #: classes/Gems/Default/DatabaseAction.php:64 #, php-format msgid "Executed %2$s creation script %1$s:" @@ -950,7 +958,7 @@ msgstr "Export data" #: classes/Gems/Default/ExportAction.php:155 -#: classes/Gems/Default/MailJobAction.php:122 +#: classes/Gems/Default/MailJobAction.php:121 msgid "Survey" msgstr "Survey" @@ -960,7 +968,8 @@ msgstr "%s records found." #: classes/Gems/Default/ExportAction.php:174 -#: classes/Gems/Default/MailJobAction.php:120 +#: classes/Gems/Default/IndexAction.php:105 +#: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organization" @@ -973,7 +982,7 @@ msgstr "Role" #: classes/Gems/Default/GroupAction.php:91 -#: classes/Gems/Default/MailJobAction.php:105 +#: classes/Gems/Default/MailJobAction.php:104 msgid "Active" msgstr "Active" @@ -992,65 +1001,65 @@ msgid "Login to %s application" msgstr "Login to %s application" -#: classes/Gems/Default/IndexAction.php:102 -#: classes/Gems/Default/IndexAction.php:270 +#: classes/Gems/Default/IndexAction.php:117 +#: classes/Gems/Default/IndexAction.php:304 msgid "Username" msgstr "Username" -#: classes/Gems/Default/IndexAction.php:110 +#: classes/Gems/Default/IndexAction.php:125 #: classes/Gems/Default/MailServerAction.php:88 msgid "Password" msgstr "Password" -#: classes/Gems/Default/IndexAction.php:119 +#: classes/Gems/Default/IndexAction.php:134 msgid "Login" msgstr "Login" -#: classes/Gems/Default/IndexAction.php:126 +#: classes/Gems/Default/IndexAction.php:141 msgid "Enter your token..." msgstr "Enter your token..." -#: classes/Gems/Default/IndexAction.php:175 -#: classes/Gems/Default/IndexAction.php:210 +#: classes/Gems/Default/IndexAction.php:196 +#: classes/Gems/Default/IndexAction.php:244 #, php-format msgid "Login successful, welcome %s." msgstr "Login successful, welcome %s." -#: classes/Gems/Default/IndexAction.php:236 +#: classes/Gems/Default/IndexAction.php:270 msgid "Good bye: " msgstr "Good bye: " -#: classes/Gems/Default/IndexAction.php:266 +#: classes/Gems/Default/IndexAction.php:300 #, php-format msgid "Reset password for %s application" msgstr "Reset password for %s application" -#: classes/Gems/Default/IndexAction.php:278 +#: classes/Gems/Default/IndexAction.php:312 msgid "Reset password" msgstr "Reset password" -#: classes/Gems/Default/IndexAction.php:302 +#: classes/Gems/Default/IndexAction.php:336 msgid "No such user found or no e-mail address known" msgstr "No such user found or no e-mail address known" -#: classes/Gems/Default/IndexAction.php:304 +#: classes/Gems/Default/IndexAction.php:338 msgid "Reset e-mail already sent, please try again after 24 hours" msgstr "Reset e-mail already sent, please try again after 24 hours" -#: classes/Gems/Default/IndexAction.php:319 +#: classes/Gems/Default/IndexAction.php:353 msgid "Follow the instructions in the e-mail" msgstr "Follow the instructions in the e-mail" -#: classes/Gems/Default/IndexAction.php:321 -#: classes/Gems/Default/IndexAction.php:345 +#: classes/Gems/Default/IndexAction.php:355 +#: classes/Gems/Default/IndexAction.php:379 msgid "Unable to send e-mail" msgstr "Unable to send e-mail" -#: classes/Gems/Default/IndexAction.php:341 +#: classes/Gems/Default/IndexAction.php:375 msgid "An e-mail was sent containing your new password" msgstr "An e-mail was sent containing your new password" -#: classes/Gems/Default/IndexAction.php:349 +#: classes/Gems/Default/IndexAction.php:383 msgid "Unknown request" msgstr "Unknown request" @@ -1153,98 +1162,107 @@ msgid "Log maintenance" msgstr "Log maintenance" -#: classes/Gems/Default/MailJobAction.php:63 +#: classes/Gems/Default/MailJobAction.php:62 msgid "No automatic mail jobs found..." msgstr "No automatic mail jobs found..." -#: classes/Gems/Default/MailJobAction.php:73 +#: classes/Gems/Default/MailJobAction.php:72 msgid "New automatic mail job..." msgstr "New automatic mail job..." -#: classes/Gems/Default/MailJobAction.php:101 +#: classes/Gems/Default/MailJobAction.php:100 #: classes/Gems/Default/MailLogAction.php:116 msgid "Template" msgstr "Template" -#: classes/Gems/Default/MailJobAction.php:102 +#: classes/Gems/Default/MailJobAction.php:101 msgid "By staff member" msgstr "By staff member" -#: classes/Gems/Default/MailJobAction.php:104 +#: classes/Gems/Default/MailJobAction.php:103 msgid "Used for logging and possibly from address." msgstr "Used for logging and possibly from address." -#: classes/Gems/Default/MailJobAction.php:107 +#: classes/Gems/Default/MailJobAction.php:106 msgid "Job is only run when active." msgstr "Job is only run when active." -#: classes/Gems/Default/MailJobAction.php:110 +#: classes/Gems/Default/MailJobAction.php:109 msgid "From address used" msgstr "From address used" -#: classes/Gems/Default/MailJobAction.php:112 +#: classes/Gems/Default/MailJobAction.php:111 msgid "From other" msgstr "From other" -#: classes/Gems/Default/MailJobAction.php:113 +#: classes/Gems/Default/MailJobAction.php:112 #, php-format msgid "Only when '%s' is '%s'." msgstr "Only when '%s' is '%s'." -#: classes/Gems/Default/MailJobAction.php:115 +#: classes/Gems/Default/MailJobAction.php:114 msgid "Processing Method" msgstr "Processing Method" -#: classes/Gems/Default/MailJobAction.php:116 +#: classes/Gems/Default/MailJobAction.php:115 msgid "Filter for" msgstr "Filter for" -#: classes/Gems/Default/MailJobAction.php:117 +#: classes/Gems/Default/MailJobAction.php:116 msgid "Days between reminders" msgstr "Days between reminders" -#: classes/Gems/Default/MailJobAction.php:133 +#: classes/Gems/Default/MailJobAction.php:132 msgid "Do you want to delete this mail job?" msgstr "Do you want to delete this mail job?" -#: classes/Gems/Default/MailJobAction.php:144 +#: classes/Gems/Default/MailJobAction.php:143 msgid "Edit automatic mail job" msgstr "Edit automatic mail job" -#: classes/Gems/Default/MailJobAction.php:157 +#: classes/Gems/Default/MailJobAction.php:156 msgid "First mail" msgstr "First mail" -#: classes/Gems/Default/MailJobAction.php:158 +#: classes/Gems/Default/MailJobAction.php:157 msgid "Reminder" msgstr "Reminder" -#: classes/Gems/Default/MailJobAction.php:169 +#: classes/Gems/Default/MailJobAction.php:168 msgid "Use organizational from address" msgstr "Use organizational from address" -#: classes/Gems/Default/MailJobAction.php:172 +#: classes/Gems/Default/MailJobAction.php:171 #, php-format msgid "Use site %s address" msgstr "Use site %s address" -#: classes/Gems/Default/MailJobAction.php:175 +#: classes/Gems/Default/MailJobAction.php:174 msgid "Use the 'By staff member' address" msgstr "Use the 'By staff member' address" -#: classes/Gems/Default/MailJobAction.php:176 +#: classes/Gems/Default/MailJobAction.php:175 msgid "Other" msgstr "Other" -#: classes/Gems/Default/MailJobAction.php:186 +#: classes/Gems/Default/MailJobAction.php:185 msgid "Automatic mail jobs" msgstr "Automatic mail jobs" -#: classes/Gems/Default/MailJobAction.php:190 +#: classes/Gems/Default/MailJobAction.php:189 +#, php-format +msgid "Automatic mails have been turned off since %s." +msgstr "Automatic mails have been turned off since %s." + +#: classes/Gems/Default/MailJobAction.php:193 +msgid "Turn Automatic Mail Jobs ON" +msgstr "Turn Automatic Mail Jobs ON" + +#: classes/Gems/Default/MailJobAction.php:199 msgid "With automatic mail jobs and a cron job on the server, mails can be sent without manual user action." msgstr "With automatic mail jobs and a cron job on the server, mails can be sent without manual user action." -#: classes/Gems/Default/MailJobAction.php:198 +#: classes/Gems/Default/MailJobAction.php:207 msgid "Automatic mail job details" msgstr "Automatic mail job details" @@ -1353,67 +1371,58 @@ msgid "Email templates" msgstr "Email templates" -#: classes/Gems/Default/OptionAction.php:73 +#: classes/Gems/Default/OptionAction.php:75 #: classes/Gems/Default/OrganizationAction.php:128 #: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:188 +#: classes/Gems/Default/StaffAction.php:196 msgid "Language" msgstr "Language" -#: classes/Gems/Default/OptionAction.php:74 -#: classes/Gems/Default/StaffAction.php:189 -msgid "Logout on survey" -msgstr "Logout on survey" - -#: classes/Gems/Default/OptionAction.php:74 -msgid "If checked you will logoff after answering a survey." -msgstr "If checked you will logoff after answering a survey." - -#: classes/Gems/Default/OptionAction.php:91 +#: classes/Gems/Default/OptionAction.php:94 msgid "Current password" msgstr "Current password" -#: classes/Gems/Default/OptionAction.php:101 -#: classes/Gems/Default/OptionAction.php:117 +#: classes/Gems/Default/OptionAction.php:105 +#: classes/Gems/Default/OptionAction.php:121 msgid "New password" msgstr "New password" -#: classes/Gems/Default/OptionAction.php:141 +#: classes/Gems/Default/OptionAction.php:146 msgid "New password is active." msgstr "New password is active." -#: classes/Gems/Default/OptionAction.php:147 +#: classes/Gems/Default/OptionAction.php:152 msgid "Caps Lock seems to be on!" msgstr "Caps Lock seems to be on!" -#: classes/Gems/Default/OptionAction.php:186 +#: classes/Gems/Default/OptionAction.php:191 msgid "Login Name" msgstr "Login Name" -#: classes/Gems/Default/OptionAction.php:204 +#: classes/Gems/Default/OptionAction.php:207 #, php-format msgid "Options" msgstr "Options" -#: classes/Gems/Default/OptionAction.php:213 +#: classes/Gems/Default/OptionAction.php:216 msgid "This overview provides information about the last login activity on your account." msgstr "This overview provides information about the last login activity on your account." -#: classes/Gems/Default/OptionAction.php:233 +#: classes/Gems/Default/OptionAction.php:236 msgid "IP address" msgstr "IP address" -#: classes/Gems/Default/OptionAction.php:233 +#: classes/Gems/Default/OptionAction.php:236 msgid "Date / time" msgstr "Date / time" -#: classes/Gems/Default/OptionAction.php:239 +#: classes/Gems/Default/OptionAction.php:242 msgid "item" msgid_plural "items" msgstr[0] "item" msgstr[1] "items" -#: classes/Gems/Default/OptionAction.php:244 +#: classes/Gems/Default/OptionAction.php:247 msgid "Item" msgstr "Item" @@ -1565,31 +1574,35 @@ msgid "Time on server" msgstr "Time on server" -#: classes/Gems/Default/ProjectInformationAction.php:148 +#: classes/Gems/Default/ProjectInformationAction.php:149 msgid "Turn Maintenance Mode OFF" msgstr "Turn Maintenance Mode OFF" -#: classes/Gems/Default/ProjectInformationAction.php:150 +#: classes/Gems/Default/ProjectInformationAction.php:151 msgid "Turn Maintenance Mode ON" msgstr "Turn Maintenance Mode ON" -#: classes/Gems/Default/ProjectInformationAction.php:159 +#: classes/Gems/Default/ProjectInformationAction.php:161 msgid "Version information" msgstr "Version information" -#: classes/Gems/Default/ProjectInformationAction.php:185 +#: classes/Gems/Default/ProjectInformationAction.php:187 +msgid "Cache cleaned" +msgstr "Cache cleaned" + +#: classes/Gems/Default/ProjectInformationAction.php:195 msgid "Server PHP Info" msgstr "Server PHP Info" -#: classes/Gems/Default/ProjectInformationAction.php:198 +#: classes/Gems/Default/ProjectInformationAction.php:208 msgid "Project settings" msgstr "Project settings" -#: classes/Gems/Default/ProjectInformationAction.php:205 +#: classes/Gems/Default/ProjectInformationAction.php:215 msgid "Session content" msgstr "Session content" -#: classes/Gems/Default/ProjectInformationAction.php:206 +#: classes/Gems/Default/ProjectInformationAction.php:216 msgid "Session" msgstr "Session" @@ -1652,78 +1665,83 @@ msgid "Track %s does not exist." msgstr "Track %s does not exist." -#: classes/Gems/Default/ReceptionAction.php:53 +#: classes/Gems/Default/ReceptionAction.php:55 msgid "Can be assigned to" msgstr "Can be assigned to" -#: classes/Gems/Default/ReceptionAction.php:54 +#: classes/Gems/Default/ReceptionAction.php:56 msgid "Additional action" msgstr "Additional action" -#: classes/Gems/Default/ReceptionAction.php:77 +#: classes/Gems/Default/ReceptionAction.php:79 msgid "Code" msgstr "Code" -#: classes/Gems/Default/ReceptionAction.php:80 +#: classes/Gems/Default/ReceptionAction.php:82 msgid "Is success code" msgstr "Is success code" -#: classes/Gems/Default/ReceptionAction.php:84 +#: classes/Gems/Default/ReceptionAction.php:86 msgid "This reception code is a success code." msgstr "This reception code is a success code." -#: classes/Gems/Default/ReceptionAction.php:88 +#: classes/Gems/Default/ReceptionAction.php:90 msgid "Only active codes can be selected." msgstr "Only active codes can be selected." -#: classes/Gems/Default/ReceptionAction.php:89 +#: classes/Gems/Default/ReceptionAction.php:91 msgid "For respondents" msgstr "For patients" -#: classes/Gems/Default/ReceptionAction.php:92 +#: classes/Gems/Default/ReceptionAction.php:94 msgid "This reception code can be assigned to a respondent." msgstr "This reception code can be assigned to a respondent." -#: classes/Gems/Default/ReceptionAction.php:93 +#: classes/Gems/Default/ReceptionAction.php:95 msgid "For tracks" msgstr "For tracks" -#: classes/Gems/Default/ReceptionAction.php:96 +#: classes/Gems/Default/ReceptionAction.php:98 msgid "This reception code can be assigned to a track." msgstr "This reception code can be assigned to a track." -#: classes/Gems/Default/ReceptionAction.php:97 +#: classes/Gems/Default/ReceptionAction.php:99 msgid "For surveys" msgstr "For surveys" -#: classes/Gems/Default/ReceptionAction.php:100 +#: classes/Gems/Default/ReceptionAction.php:102 msgid "This reception code can be assigned to a survey." msgstr "This reception code can be assigned to a survey." -#: classes/Gems/Default/ReceptionAction.php:101 +#: classes/Gems/Default/ReceptionAction.php:103 msgid "Redo survey" msgstr "Redo survey" -#: classes/Gems/Default/ReceptionAction.php:104 +#: classes/Gems/Default/ReceptionAction.php:106 msgid "Redo a survey on this reception code." msgstr "Redo a survey on this reception code." -#: classes/Gems/Default/ReceptionAction.php:105 +#: classes/Gems/Default/ReceptionAction.php:107 msgid "Overwrite ansers" msgstr "Overwrite ansers" -#: classes/Gems/Default/ReceptionAction.php:108 +#: classes/Gems/Default/ReceptionAction.php:110 msgid "Remove the consent from already answered surveys." msgstr "Remove the consent from already answered surveys." -#: classes/Gems/Default/ReceptionAction.php:126 +#: classes/Gems/Default/ReceptionAction.php:128 msgid "reception code" msgid_plural "reception codes" msgstr[0] "reception code" msgstr[1] "reception codes" +#: classes/Gems/Default/RespondentAction.php:119 +#, php-format +msgid "Random Example BSN: %s" +msgstr "Random Example BSN: %s" + #: classes/Gems/Default/RespondentAction.php:122 -msgid "Enter a 9-digit BSN number." +msgid "Enter a 9-digit SSN number." msgstr "Enter a 9-digit BSN number." #: classes/Gems/Default/RespondentAction.php:131 @@ -1731,7 +1749,7 @@ msgstr "Identification" #: classes/Gems/Default/RespondentAction.php:132 -msgid "BSN" +msgid "SSN" msgstr "BSN" #: classes/Gems/Default/RespondentAction.php:136 @@ -1837,44 +1855,48 @@ msgid "Respondent planning" msgstr "Respondent planning" -#: classes/Gems/Default/RoleAction.php:174 -#: classes/Gems/Default/RoleAction.php:233 +#: classes/Gems/Default/RoleAction.php:175 +msgid "Illegal name" +msgstr "Illegal name" + +#: classes/Gems/Default/RoleAction.php:199 +#: classes/Gems/Default/RoleAction.php:258 msgid "Parents" msgstr "Parents" -#: classes/Gems/Default/RoleAction.php:189 -msgid "Editing `super` is not allowed" -msgstr "Editing `super` is not allowed" +#: classes/Gems/Default/RoleAction.php:214 +msgid "Editing `master` is not allowed" +msgstr "Editing `master` is not allowed" -#: classes/Gems/Default/RoleAction.php:207 +#: classes/Gems/Default/RoleAction.php:232 msgid "role" msgid_plural "roles" msgstr[0] "role" msgstr[1] "roles" -#: classes/Gems/Default/RoleAction.php:212 +#: classes/Gems/Default/RoleAction.php:237 msgid "Administrative roles" msgstr "Administrative roles" -#: classes/Gems/Default/RoleAction.php:234 -#: classes/Gems/Default/RoleAction.php:250 +#: classes/Gems/Default/RoleAction.php:259 +#: classes/Gems/Default/RoleAction.php:275 msgid "Allowed" msgstr "Allowed" -#: classes/Gems/Default/RoleAction.php:235 -#: classes/Gems/Default/RoleAction.php:251 +#: classes/Gems/Default/RoleAction.php:260 +#: classes/Gems/Default/RoleAction.php:276 msgid "Denied" msgstr "Denied" -#: classes/Gems/Default/RoleAction.php:239 +#: classes/Gems/Default/RoleAction.php:264 msgid "Project role overview" msgstr "Project role overview" -#: classes/Gems/Default/RoleAction.php:249 +#: classes/Gems/Default/RoleAction.php:274 msgid "Privilege" msgstr "Privilege" -#: classes/Gems/Default/RoleAction.php:255 +#: classes/Gems/Default/RoleAction.php:280 msgid "Project privileges" msgstr "Project privileges" @@ -1975,19 +1997,23 @@ msgid "Are you sure you want to synchronize all survey sources?" msgstr "Are you sure you want to synchronize all survey sources?" -#: classes/Gems/Default/StaffAction.php:133 +#: classes/Gems/Default/StaffAction.php:137 msgid "If checked the user will logoff when answering a survey." msgstr "If checked the user will logoff when answering a survey." -#: classes/Gems/Default/StaffAction.php:149 +#: classes/Gems/Default/StaffAction.php:153 msgid "You are not allowed to edit this staff member." msgstr "You are not allowed to edit this staff member." -#: classes/Gems/Default/StaffAction.php:184 +#: classes/Gems/Default/StaffAction.php:191 msgid "Primary function" msgstr "Primary function" -#: classes/Gems/Default/StaffAction.php:269 +#: classes/Gems/Default/StaffAction.php:197 +msgid "Logout on survey" +msgstr "Logout on survey" + +#: classes/Gems/Default/StaffAction.php:275 msgid "staff member" msgid_plural "staff members" msgstr[0] "staff member" @@ -2350,38 +2376,58 @@ msgstr "This track is currently not assigned to this patient." #: classes/Gems/Default/TrackFieldsAction.php:70 +msgid "Optional extra name to link the field to program code." +msgstr "Optional extra name to link the field to program code." + +#: classes/Gems/Default/TrackFieldsAction.php:71 +msgid "Optional extra description to show the user." +msgstr "Optional extra description to show the user." + +#: classes/Gems/Default/TrackFieldsAction.php:72 msgid "Separate multiple values with a vertical bar (|)" msgstr "Separate multiple values with a vertical bar (|)" -#: classes/Gems/Default/TrackFieldsAction.php:107 +#: classes/Gems/Default/TrackFieldsAction.php:75 +msgid "Check this box if this field is always set by code instead of the user." +msgstr "Check this box if this field is always set by code instead of the user." + +#: classes/Gems/Default/TrackFieldsAction.php:110 msgid "Select one" msgstr "Select one" -#: classes/Gems/Default/TrackFieldsAction.php:107 +#: classes/Gems/Default/TrackFieldsAction.php:110 msgid "Select multiple" msgstr "Select multiple" -#: classes/Gems/Default/TrackFieldsAction.php:107 +#: classes/Gems/Default/TrackFieldsAction.php:110 msgid "Free text" msgstr "Free text" -#: classes/Gems/Default/TrackFieldsAction.php:114 +#: classes/Gems/Default/TrackFieldsAction.php:118 +msgid "Code Name" +msgstr "Code Name" + +#: classes/Gems/Default/TrackFieldsAction.php:121 #: classes/Gems/Default/TrackMaintenanceAction.php:211 msgid "Values" msgstr "Values" -#: classes/Gems/Default/TrackFieldsAction.php:116 +#: classes/Gems/Default/TrackFieldsAction.php:123 #: classes/Gems/Default/TrackMaintenanceAction.php:213 msgid "Required" msgstr "Required" -#: classes/Gems/Default/TrackFieldsAction.php:129 +#: classes/Gems/Default/TrackFieldsAction.php:125 +msgid "Readonly" +msgstr "Readonly" + +#: classes/Gems/Default/TrackFieldsAction.php:139 msgid "field" msgid_plural "fields" msgstr[0] "field" msgstr[1] "fields" -#: classes/Gems/Default/TrackFieldsAction.php:134 +#: classes/Gems/Default/TrackFieldsAction.php:144 msgid "Fields" msgstr "Fields" @@ -2586,81 +2632,89 @@ msgid "Some help for this export" msgstr "Some help for this export" -#: classes/Gems/Menu/MenuAbstract.php:233 +#: classes/Gems/Menu/MenuAbstract.php:243 msgid "Activity log" msgstr "Activity Log" -#: classes/Gems/Menu/MenuAbstract.php:239 +#: classes/Gems/Menu/MenuAbstract.php:249 msgid "Automatic mail" msgstr "Automatic mail" -#: classes/Gems/Menu/MenuAbstract.php:242 +#: classes/Gems/Menu/MenuAbstract.php:250 +msgid "Turn Automatic Mail Jobs OFF" +msgstr "Turn Automatic Mail Jobs OFF" + +#: classes/Gems/Menu/MenuAbstract.php:254 msgid "Servers" msgstr "Servers" -#: classes/Gems/Menu/MenuAbstract.php:246 +#: classes/Gems/Menu/MenuAbstract.php:258 msgid "Templates" msgstr "Templates" -#: classes/Gems/Menu/MenuAbstract.php:278 +#: classes/Gems/Menu/MenuAbstract.php:290 msgid "By period" msgstr "By period" -#: classes/Gems/Menu/MenuAbstract.php:279 +#: classes/Gems/Menu/MenuAbstract.php:291 msgid "By token" msgstr "By token" -#: classes/Gems/Menu/MenuAbstract.php:280 +#: classes/Gems/Menu/MenuAbstract.php:292 msgid "By respondent" msgstr "By respondent" -#: classes/Gems/Menu/MenuAbstract.php:284 +#: classes/Gems/Menu/MenuAbstract.php:296 msgid "Bulk mail" msgstr "Bulk mail" -#: classes/Gems/Menu/MenuAbstract.php:302 +#: classes/Gems/Menu/MenuAbstract.php:314 msgid "Errors" msgstr "Errors" -#: classes/Gems/Menu/MenuAbstract.php:303 +#: classes/Gems/Menu/MenuAbstract.php:315 msgid "PHP" msgstr "PHP" -#: classes/Gems/Menu/MenuAbstract.php:306 +#: classes/Gems/Menu/MenuAbstract.php:318 msgid "Maintenance mode" msgstr "Maintenance mode" -#: classes/Gems/Menu/MenuAbstract.php:398 +#: classes/Gems/Menu/MenuAbstract.php:319 +msgid "Clean cache" +msgstr "Clean cache" + +#: classes/Gems/Menu/MenuAbstract.php:410 msgid "Check status" msgstr "Check status" -#: classes/Gems/Menu/MenuAbstract.php:399 +#: classes/Gems/Menu/MenuAbstract.php:411 msgid "Synchronize surveys" msgstr "Synchronize surveys" -#: classes/Gems/Menu/MenuAbstract.php:400 -#: classes/Gems/Menu/MenuAbstract.php:411 +#: classes/Gems/Menu/MenuAbstract.php:412 +#: classes/Gems/Menu/MenuAbstract.php:423 msgid "Check answers" msgstr "Check answers" -#: classes/Gems/Menu/MenuAbstract.php:401 +#: classes/Gems/Menu/MenuAbstract.php:413 msgid "Synchronize all surveys" msgstr "Synchronize all surveys" -#: classes/Gems/Menu/MenuAbstract.php:402 -#: classes/Gems/Menu/MenuAbstract.php:412 +#: classes/Gems/Menu/MenuAbstract.php:414 +#: classes/Gems/Menu/MenuAbstract.php:424 msgid "Check all answers" msgstr "Check all answers" -#: classes/Gems/Menu/MenuAbstract.php:408 +#: classes/Gems/Menu/MenuAbstract.php:420 msgid "PDF" msgstr "PDF" -#: classes/Gems/Menu/MenuAbstract.php:442 +#: classes/Gems/Menu/MenuAbstract.php:454 msgid "Check assignments" msgstr "Check assignments" -#: classes/Gems/Menu/MenuAbstract.php:445 +#: classes/Gems/Menu/MenuAbstract.php:457 msgid "Check all assignments" msgstr "Check all assignments" @@ -2742,12 +2796,10 @@ msgstr "week %s" #: classes/Gems/Selector/TokenByGroupDateSelector.php:83 -#: classes/Gems/Selector/TokenDateSelector.php:82 msgid "for respondents" msgstr "for patients" #: classes/Gems/Selector/TokenByGroupDateSelector.php:84 -#: classes/Gems/Selector/TokenDateSelector.php:83 msgid "for staff" msgstr "for staff" @@ -2760,7 +2812,6 @@ msgstr "Todo" #: classes/Gems/Selector/TokenByGroupDateSelector.php:109 -#: classes/Gems/Selector/TokenDateSelector.php:94 msgid "Partially completed" msgstr "Partially completed" @@ -2881,96 +2932,96 @@ msgid "This track type does not allow the creation of new rounds." msgstr "This track type does not allow the creation of new rounds." -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:363 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:365 msgid "Track start" msgstr "Track start" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:364 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:366 msgid "Track end" msgstr "Track end" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:372 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:382 msgid "Start time" msgstr "Start time" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:373 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:383 msgid "Completion time" msgstr "Completion time" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:388 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:398 msgid "Minutes" msgstr "Minutes" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:389 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:399 msgid "Hours" msgstr "Hours" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:390 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:400 msgid "Days" msgstr "Days" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:391 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:401 msgid "Weeks" msgstr "Weeks" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:392 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:402 msgid "Months" msgstr "Months" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:393 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:403 msgid "Quarters" msgstr "Quarters" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:394 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:404 msgid "Years" msgstr "Years" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:428 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:438 msgid "Valid from calculation" msgstr "Valid from calculation" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:429 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:437 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:439 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:447 msgid "Date source" msgstr "Date source" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:430 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:438 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:440 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:448 msgid "Round used" msgstr "Round used" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:431 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:439 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:441 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:449 msgid "Date used" msgstr "Date used" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:432 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:440 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:442 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:450 msgid "Add to date" msgstr "Add to date" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:433 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:441 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:443 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:451 msgid "Add to date unit" msgstr "Add to date unit" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:436 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:446 msgid "Valid for calculation" msgstr "Valid for calculation" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:470 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:480 msgid "Does not expire" msgstr "Does not expire" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:473 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:483 msgid "Use an answer from a survey." msgstr "Use an answer from a survey." -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:474 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:484 msgid "Use a standard token date." msgstr "Use a standard token date." -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:476 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:486 msgid "Use a track level date." msgstr "Use a track level date." @@ -2979,23 +3030,23 @@ msgid "%s track engines cannot be converted to %s track engines." msgstr "%s track engines cannot be converted to %s track engines." -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:625 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:639 #, php-format msgid "%d: %s - %s" msgstr "%d: %s - %s" -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:628 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:631 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:642 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:645 #, php-format msgid "%d: %s" msgstr "%d: %s" -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:634 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:648 #, php-format msgid "%s - %s" msgstr "%s - %s" -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:676 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:690 msgid "After change" msgstr "After change" @@ -3027,21 +3078,43 @@ msgid "Use until" msgstr "Use until" -#: classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php:129 -msgid "Add new round" -msgstr "Add new round" +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:138 +msgid "Question" +msgstr "Question" +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:207 +#, php-format +msgid "%s answers for patient number %s" +msgstr "%s answers for patient number %s" + +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:210 +#, php-format +msgid "Answers for token %s, patient number %s: %s." +msgstr "Answers for token %s, patient number %s: %s." + +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:223 #: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:124 -#: classes/Gems/Tracker/Snippets/ShowTokenSnippetAbstract.php:164 #, php-format msgid "Token %s not found." msgstr "Token %s not found." +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:227 #: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:128 -#: classes/Gems/Tracker/Snippets/ShowTokenSnippetAbstract.php:168 msgid "No token specified." msgstr "No token specified." +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:232 +msgid "Close" +msgstr "Close" + +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:233 +msgid "Print" +msgstr "Print" + +#: classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php:129 +msgid "Add new round" +msgstr "Add new round" + #: classes/Gems/Tracker/Snippets/ShowRoundSnippetAbstract.php:132 #, php-format msgid "%s round" @@ -3110,77 +3183,82 @@ msgid "Imported the '%s' survey." msgstr "Imported the '%s' survey." -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:143 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:149 msgid "Uncertain" msgstr "Uncertain" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:146 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:152 msgid "Increase" msgstr "Increase" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:147 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:153 msgid "Same" msgstr "Same" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:148 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:154 msgid "Decrease" msgstr "Decrease" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:151 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:157 msgid "Female" msgstr "Female" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:152 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:158 msgid "Male" msgstr "Male" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:156 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:162 msgid "Checked" msgstr "Checked" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:157 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:163 msgid "Not checked" msgstr "Not checked" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:249 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:258 #, php-format msgid "Rank %d" msgstr "Rank %d" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:268 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:291 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:277 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:300 msgid "Comment" msgstr "Comment" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:268 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:291 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:277 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:300 msgid " (comment)" msgstr " (comment)" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:466 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:475 msgid "Free number" msgstr "Free number" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:472 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:481 msgid "Free text (long)" msgstr "Free text (long)" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:475 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:484 msgid "Free text (very long)" msgstr "Free text (very long)" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:614 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:671 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:726 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:623 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:680 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:735 #, php-format msgid "%s: %s" msgstr "%s: %s" -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:746 +#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:755 #, php-format msgid "- %s" msgstr "- %s" +#: classes/Gems/User/ProjectSuperUser.php:74 +#, php-format +msgid "The password for the super user should be at least %s characters long on production systems." +msgstr "The password for the super user should be at least %s characters long on production systems." + #: classes/Gems/Util/Translated.php:99 msgid "forever" msgstr "forever" @@ -3462,36 +3540,14 @@ msgid "by Staff" msgstr "by Staff" -#: snippets/AddTracksSnippet.php:172 +#: snippets/AddTracksSnippet.php:173 msgid "info" msgstr "info" -#: snippets/AddTracksSnippet.php:177 +#: snippets/AddTracksSnippet.php:178 msgid "None available" msgstr "None available" -#: snippets/AnswerModelSnippet.php:120 -msgid "Question" -msgstr "Question" - -#: snippets/AnswerModelSnippet.php:176 -#, php-format -msgid "%s answers for patient number %s" -msgstr "%s answers for patient number %s" - -#: snippets/AnswerModelSnippet.php:179 -#, php-format -msgid "Answers for token %s, patient number %s: %s." -msgstr "Answers for token %s, patient number %s: %s." - -#: snippets/AnswerModelSnippet.php:200 -msgid "Close" -msgstr "Close" - -#: snippets/AnswerModelSnippet.php:201 -msgid "Print" -msgstr "Print" - #: snippets/DeleteInSourceTrackSnippet.php:128 msgid "Edit track" msgstr "Edit track" @@ -3501,19 +3557,24 @@ msgstr "Track deleted." #: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:177 +#: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:143 +#: snippets/DeleteTrackTokenSnippet.php:187 msgid "Edit token" msgstr "Edit token" #: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:225 +#: snippets/DeleteTrackTokenSnippet.php:236 #, php-format msgid "Redo of token %s." msgstr "Redo of token %s." #: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:228 +#: snippets/DeleteTrackTokenSnippet.php:239 msgid "Old comment:" msgstr "Old comment:" #: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:249 +#: snippets/DeleteTrackTokenSnippet.php:260 #, php-format msgid "Created replacement token %2$s for token %1$s." msgstr "Created replacement token %2$s for token %1$s." @@ -3528,7 +3589,6 @@ msgstr "Deleted token %s for survey %s." #: snippets/DeleteTrackTokenSnippet.php:277 -#: snippets/EditTrackTokenSnippet.php:174 #, php-format msgid "%d token changed by recalculation." msgid_plural "%d tokens changed by recalculation." @@ -3596,6 +3656,7 @@ msgstr "Selected surveys" #: snippets/ShowSingleSurveyTokenSnippet.php:76 +#: snippets/ShowTrackTokenSnippet.php:77 msgid "Actions" msgstr "Actions" @@ -3646,6 +3707,12 @@ msgid "This track can be assigned since %s." msgstr "This track can be assigned since %s." +#~ msgid "If checked you will logoff after answering a survey." +#~ msgstr "If checked you will logoff after answering a survey." + +#~ msgid "BSN" +#~ msgstr "BSN" + #~ msgid "The Pulse software was made possible thanks to support from " #~ msgstr "The Pulse software was made possible thanks to support from " @@ -3703,9 +3770,6 @@ #~ msgid "Completion event" #~ msgstr "Completion event" -#~ msgid "Track created" -#~ msgstr "Track created" - #~ msgid "Do not calculate this date." #~ msgstr "Do not calculate this date." Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2011-11-03 10:59:34 UTC (rev 167) +++ trunk/library/languages/default-nl.po 2011-11-03 12:05:46 UTC (rev 168) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-10-25 13:52+0100\n" +"POT-Creation-Date: 2011-11-03 12:52+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -18,58 +18,58 @@ "X-Poedit-KeywordsList: plural:1,2\n" "X-Poedit-SearchPath-0: .\n" -#: classes/GemsEscort.php:155 +#: classes/GemsEscort.php:186 #, php-format msgid "Path %s not writable" msgstr "Path %s niet schrijfbaar" -#: classes/GemsEscort.php:840 +#: classes/GemsEscort.php:860 #, php-format msgid "User: %s" msgstr "Login: %s" -#: classes/GemsEscort.php:864 +#: classes/GemsEscort.php:884 msgid "version" msgstr "versie" -#: classes/GemsEscort.php:1419 +#: classes/GemsEscort.php:1405 msgid "Take note: your session has expired, your inputs where not saved. Please check the input data and try again" msgstr "Let op: uw sessie is verlopen, uw invoer is niet opgeslagen. Controleer de gegevens en probeer a.u.b. opnieuw." -#: classes/GemsEscort.php:1540 +#: classes/GemsEscort.php:1526 msgid "Please check back later." msgstr "Probeer het later opnieuw." -#: classes/GemsEscort.php:1542 -#: classes/GemsEscort.php:1545 -#: classes/GemsEscort.php:1546 +#: classes/GemsEscort.php:1528 +#: classes/GemsEscort.php:1531 +#: classes/GemsEscort.php:1532 msgid "System is in maintenance mode" msgstr "Systeem is in onderhoudsmodus" -#: classes/GemsEscort.php:1560 +#: classes/GemsEscort.php:1546 msgid "No access to site." msgstr "Geen toegang tot website." -#: classes/GemsEscort.php:1562 -#: classes/GemsEscort.php:1598 +#: classes/GemsEscort.php:1548 +#: classes/GemsEscort.php:1584 msgid "You have no access to this site." msgstr "U heeft geen toegang tot deze website." -#: classes/GemsEscort.php:1578 +#: classes/GemsEscort.php:1564 msgid "No access to page" msgstr "Geen toegang tot pagina" -#: classes/GemsEscort.php:1580 +#: classes/GemsEscort.php:1566 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "U heeft geen toegang tot deze pagina. Uw huidige rol is: %s." -#: classes/GemsEscort.php:1585 -#: classes/GemsEscort.php:1596 +#: classes/GemsEscort.php:1571 +#: classes/GemsEscort.php:1582 msgid "You are no longer logged in." msgstr "U bent niet meer ingelogd." -#: classes/GemsEscort.php:1586 +#: classes/GemsEscort.php:1572 msgid "You must login to access this page." msgstr "U moet ingelogd zijn voor toegang tot deze pagina." @@ -477,7 +477,7 @@ msgid "Cancel" msgstr "Annuleren" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:175 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:181 msgid "No data found." msgstr "Geen gegevens gevonden." @@ -577,35 +577,35 @@ msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L." msgstr "Er wordt geen verschil gemaakt tussen het getal nul en de letter O en ook niet tussen het getal één en de letter L." -#: classes/Gems/Default/ConsentAction.php:66 +#: classes/Gems/Default/ConsentAction.php:68 #: classes/Gems/Default/GroupAction.php:87 msgid "Description" msgstr "Omschrijving" -#: classes/Gems/Default/ConsentAction.php:68 +#: classes/Gems/Default/ConsentAction.php:70 #: classes/Gems/Default/DatabaseAction.php:167 msgid "Order" msgstr "Volgorde" -#: classes/Gems/Default/ConsentAction.php:69 +#: classes/Gems/Default/ConsentAction.php:71 msgid "Determines order of presentation in interface." msgstr "Bepaald de presentatie volgorde." -#: classes/Gems/Default/ConsentAction.php:71 +#: classes/Gems/Default/ConsentAction.php:73 msgid "Consent code" msgstr "Consent code" -#: classes/Gems/Default/ConsentAction.php:73 +#: classes/Gems/Default/ConsentAction.php:75 msgid "Internal code, not visible to users, copied with the token information to the source." msgstr "Interne code, niet zichtbaar voor gebruikers maar wordt met de token informatie aan de bron doorgegeven." -#: classes/Gems/Default/ConsentAction.php:90 +#: classes/Gems/Default/ConsentAction.php:92 msgid "respondent consent" msgid_plural "respondent consents" msgstr[0] "patiënt toestemming" msgstr[1] "patiënt toestemmingen" -#: classes/Gems/Default/ConsentAction.php:95 +#: classes/Gems/Default/ConsentAction.php:97 msgid "Respondent consents" msgstr "Patiënt toestemming" @@ -637,6 +637,14 @@ msgid "Links concerning this web application:" msgstr "Links met informatie over deze website:" +#: classes/Gems/Default/CronAction.php:136 +msgid "Cron jobs turned off." +msgstr "Cron opdrachten uitgezet." + +#: classes/Gems/Default/CronAction.php:200 +msgid "No mails sent" +msgstr "Geen mail verzonden" + #: classes/Gems/Default/DatabaseAction.php:64 #, php-format msgid "Executed %2$s creation script %1$s:" @@ -950,7 +958,7 @@ msgstr "Exporteer gegevens" #: classes/Gems/Default/ExportAction.php:155 -#: classes/Gems/Default/MailJobAction.php:122 +#: classes/Gems/Default/MailJobAction.php:121 msgid "Survey" msgstr "Vragenlijst" @@ -960,7 +968,8 @@ msgstr "%s records gevonden." #: classes/Gems/Default/ExportAction.php:174 -#: classes/Gems/Default/MailJobAction.php:120 +#: classes/Gems/Default/IndexAction.php:105 +#: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organisatie" @@ -973,7 +982,7 @@ msgstr "Rol" #: classes/Gems/Default/GroupAction.php:91 -#: classes/Gems/Default/MailJobAction.php:105 +#: classes/Gems/Default/MailJobAction.php:104 msgid "Active" msgstr "Actief" @@ -992,65 +1001,65 @@ msgid "Login to %s application" msgstr "%s login" -#: classes/Gems/Default/IndexAction.php:102 -#: classes/Gems/Default/IndexAction.php:270 +#: classes/Gems/Default/IndexAction.php:117 +#: classes/Gems/Default/IndexAction.php:304 msgid "Username" msgstr "Gebruikersnaam" -#: classes/Gems/Default/IndexAction.php:110 +#: classes/Gems/Default/IndexAction.php:125 #: classes/Gems/Default/MailServerAction.php:88 msgid "Password" msgstr "Wachtwoord" -#: classes/Gems/Default/IndexAction.php:119 +#: classes/Gems/Default/IndexAction.php:134 msgid "Login" msgstr "Login" -#: classes/Gems/Default/IndexAction.php:126 +#: classes/Gems/Default/IndexAction.php:141 msgid "Enter your token..." msgstr "Voer uw kenmerk in..." -#: classes/Gems/Default/IndexAction.php:175 -#: classes/Gems/Default/IndexAction.php:210 +#: classes/Gems/Default/IndexAction.php:196 +#: classes/Gems/Default/IndexAction.php:244 #, php-format msgid "Login successful, welcome %s." msgstr "Login in orde, welkom %s." -#: classes/Gems/Default/IndexAction.php:236 +#: classes/Gems/Default/IndexAction.php:270 msgid "Good bye: " msgstr "Tot ziens: " -#: classes/Gems/Default/IndexAction.php:266 +#: classes/Gems/Default/IndexAction.php:300 #, php-format msgid "Reset password for %s application" msgstr "Reset wachtwoord voor %s" -#: classes/Gems/Default/IndexAction.php:278 +#: classes/Gems/Default/IndexAction.php:312 msgid "Reset password" msgstr "Reset wachtwoord" -#: classes/Gems/Default/IndexAction.php:302 +#: classes/Gems/Default/IndexAction.php:336 msgid "No such user found or no e-mail address known" msgstr "Gebruiker niet gevonden of e-mail adres onbekend" -#: classes/Gems/Default/IndexAction.php:304 +#: classes/Gems/Default/IndexAction.php:338 msgid "Reset e-mail already sent, please try again after 24 hours" msgstr "E-mail al verzonden, probeer aub na 24 uur opnieuw" -#: classes/Gems/Default/IndexAction.php:319 +#: classes/Gems/Default/IndexAction.php:353 msgid "Follow the instructions in the e-mail" msgstr "Volg de instructies in de aan u verzonden e-mail" -#: classes/Gems/Default/IndexAction.php:321 -#: classes/Gems/Default/IndexAction.php:345 +#: classes/Gems/Default/IndexAction.php:355 +#: classes/Gems/Default/IndexAction.php:379 msgid "Unable to send e-mail" msgstr "Verzenden e-mail mislukt" -#: classes/Gems/Default/IndexAction.php:341 +#: classes/Gems/Default/IndexAction.php:375 msgid "An e-mail was sent containing your new password" msgstr "Er is een e-mail verstuurd met een nieuw wachtwoord" -#: classes/Gems/Default/IndexAction.php:349 +... [truncated message content] |
From: <gem...@li...> - 2011-11-03 10:59:45
|
Revision: 167 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=167&view=rev Author: matijsdejong Date: 2011-11-03 10:59:34 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Update project.ini for required salt setting Modified Paths: -------------- trunk/new_project/application/configs/project.ini Modified: trunk/new_project/application/configs/project.ini =================================================================== --- trunk/new_project/application/configs/project.ini 2011-11-03 10:55:39 UTC (rev 166) +++ trunk/new_project/application/configs/project.ini 2011-11-03 10:59:34 UTC (rev 167) @@ -2,6 +2,16 @@ name = "New" description = "New" +;--------------------------------------------------- +; Hash encryption salt. REQUIRED! +; +; Use e.g. http://www.random.org/strings/ to create. +; +; Put %s somewhere within the salt to mix the value +; in the salt. +;--------------------------------------------------- +salt = + css.gems = gems/css/gems-fixed.css css.print.url = gems/css/gems_print.css css.print.media = print This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-03 10:55:47
|
Revision: 166 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=166&view=rev Author: matijsdejong Date: 2011-11-03 10:55:39 +0000 (Thu, 03 Nov 2011) Log Message: ----------- Added creation of gems__users to patches.sql Concluded #36: _initProject now returns Gems_Project_ProjectSettings object, this can be overrule on a per project basis Redefined all project variables to Gems_Project_ProjectSettings Modified Paths: -------------- trunk/library/changelog.txt trunk/library/classes/Gems/Default/MailJobAction.php trunk/library/classes/Gems/Pdf.php trunk/library/classes/Gems/Tracker/Token/TokenLibrary.php trunk/library/classes/Gems/User/ProjectSuperUser.php trunk/library/classes/Gems/User/UserLoader.php trunk/library/classes/Gems/Util/Localized.php trunk/library/classes/Gems/Util.php trunk/library/classes/GemsEscort.php trunk/library/configs/db/patches.sql Added Paths: ----------- trunk/library/classes/Gems/Project/ProjectSettings.php Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/changelog.txt 2011-11-03 10:55:39 UTC (rev 166) @@ -1,7 +1,7 @@ Important changes from 1.4.3 => 1.5 ============================================================ The table gems__staff is split into gems__staff and gems__user with all login data in gems__users -Passwords should be set with a project.ini->salt +Passwords should be set with a project.ini->salt. Salt is now a required project setting! MailController is now called MailTemplateController EmailController is now called CronController (with stub for compatibility) Modified: trunk/library/classes/Gems/Default/MailJobAction.php =================================================================== --- trunk/library/classes/Gems/Default/MailJobAction.php 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/classes/Gems/Default/MailJobAction.php 2011-11-03 10:55:39 UTC (rev 166) @@ -48,11 +48,10 @@ { /** * - * @var ArrayObject + * @var Gems_Project_ProjectSettings */ public $project; - /** * The automatically filtered result * Modified: trunk/library/classes/Gems/Pdf.php =================================================================== --- trunk/library/classes/Gems/Pdf.php 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/classes/Gems/Pdf.php 2011-11-03 10:55:39 UTC (rev 166) @@ -4,7 +4,7 @@ /** * Copyright (c) 2011, Erasmus MC * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -15,7 +15,7 @@ * * Neither the name of Erasmus MC nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -62,7 +62,7 @@ /** * - * @var ArrayObject + * @var Gems_Project_ProjectSettings */ protected $project; Added: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php (rev 0) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-03 10:55:39 UTC (rev 166) @@ -0,0 +1,149 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Class that extends Array object to add Gems specific functions. + * + * @package Gems + * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Project_ProjectSettings extends ArrayObject +{ + /** + * Array of required keys. Give a string value for root keys + * or name => array() values for required subs keys. + * + * Deeper levels are not supported at the moment. + * + * @see checkRequiredValues() + * + * @var array + */ + protected $requiredKeys = array( + 'css' => array('gems'), + 'locale' => array('default'), + 'salt', + ); + + /** + * Creates the object and checks for required values. + * + * @param mixed $array + */ + public function __construct($array) + { + // Convert to array when needed + if ($array instanceof Zend_Config) { + $array = $array->toArray(); + } elseif ($array instanceof ArrayObject) { + $array = $array->getArrayCopy(); + } elseif (! is_array($array)) { + $array = (array) $array; + } + + parent::__construct($array, ArrayObject::ARRAY_AS_PROPS); + + $this->checkRequiredValues(); + } + + /** + * This function checks for the required project settings. + * + * Overrule this function or the $requiredParameters to add extra required settings. + * + * @see $requiredParameters + * + * @return void + */ + protected function checkRequiredValues() + { + $missing = array(); + foreach ($this->requiredKeys as $key => $names) { + if (is_array($names)) { + if (! ($this->offsetExists($key) && $this->offsetGet($key))) { + $subarray = array(); + } else { + $subarray = $this->offsetGet($key); + } + foreach ($names as $name) { + if (! isset($subarray[$name])) { + $missing[] = $key . '.' . $name; + } + } + } else { + if (! ($this->offsetExists($names) && $this->offsetGet($names))) { + $missing[] = $names; + } + } + } + + if ($missing) { + if (count($missing) == 1) { + $error = sprintf("Missing required project setting: '%s'.", reset($missing)); + } else { + $error = sprintf("Missing required project settings: '%s'.", implode("', '", $missing)); + } + throw new Gems_Exception_Coding($error); + } + + if (! ($this->offsetExists('name') && $this->offsetGet('name'))) { + $this->offsetSet('name', GEMS_PROJECT_NAME); + } + + $this->offsetSet('multiLocale', isset($project->locales) && (count($project->locales) > 1)); + } + + /** + * Returns a salted hash on the + * + * @param string $value The value to hash + * @return string The salted hash as a 32-character hexadecimal number. + */ + public function getValueHash($value) + { + $salt = $this->offsetExists('salt') ? $this->offsetGet('salt') : ''; + + if (false === strpos($salt, '%s')) { + return md5(sprintf($salt, $value), false); + } else { + return md5($salt . $value, false); + } + } +} Modified: trunk/library/classes/Gems/Tracker/Token/TokenLibrary.php =================================================================== --- trunk/library/classes/Gems/Tracker/Token/TokenLibrary.php 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/classes/Gems/Tracker/Token/TokenLibrary.php 2011-11-03 10:55:39 UTC (rev 166) @@ -53,7 +53,7 @@ /** * - * @var ArrayObject + * @var Gems_Project_ProjectSettings */ protected $project; Modified: trunk/library/classes/Gems/User/ProjectSuperUser.php =================================================================== --- trunk/library/classes/Gems/User/ProjectSuperUser.php 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/classes/Gems/User/ProjectSuperUser.php 2011-11-03 10:55:39 UTC (rev 166) @@ -50,7 +50,7 @@ /** * - * @var ArrayObject + * @var Gems_Project_ProjectSettings */ protected $project; Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/classes/Gems/User/UserLoader.php 2011-11-03 10:55:39 UTC (rev 166) @@ -55,7 +55,7 @@ /** * - * @var ArrayObject + * @var Gems_Project_ProjectSettings */ protected $project; Modified: trunk/library/classes/Gems/Util/Localized.php =================================================================== --- trunk/library/classes/Gems/Util/Localized.php 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/classes/Gems/Util/Localized.php 2011-11-03 10:55:39 UTC (rev 166) @@ -54,7 +54,7 @@ /** * - * @var ArrayObject + * @var Gems_Project_ProjectSettings */ protected $project; Modified: trunk/library/classes/Gems/Util.php =================================================================== --- trunk/library/classes/Gems/Util.php 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/classes/Gems/Util.php 2011-11-03 10:55:39 UTC (rev 166) @@ -73,7 +73,7 @@ /** * - * @var ArrayObject + * @var Gems_Project_ProjectSettings */ protected $project; Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/classes/GemsEscort.php 2011-11-03 10:55:39 UTC (rev 166) @@ -329,29 +329,18 @@ * * Use $this->project to access afterwards * - * @return ArrayObject + * @return Gems_Project_ProjectSettings */ protected function _initProject() { - $project = $this->includeProjectFile('project.ini'); + $projectArray = $this->includeFile(APPLICATION_PATH . '/configs/project'); - if (false === $project) { - $project['css']['gems'] = 'gems.css'; - $project['version'] = '0.0'; - $project['locale']['default'] = 'en'; - $project['locales']['en'] = 'en'; + if ($projectArray instanceof Gems_Project_ProjectSettings) { + $project = $projectArray; + } else { + $project = $this->createProjectClass('Project_ProjectSettings', $projectArray); } - if (! array_key_exists('name', $project)) { - $project['name'] = GEMS_PROJECT_NAME; - } - - if (is_array($project)) { - $project = new ArrayObject($project, ArrayObject::ARRAY_AS_PROPS); - } - - $project->multiLocale = isset($project->locales) && (count($project->locales) > 1); - return $project; } @@ -1228,7 +1217,7 @@ * @param string $fileName A filename in the include path * @return mixed false if nothing was returned */ - public function includeFile($fileName) + protected function includeFile($fileName) { $extension = pathinfo($fileName, PATHINFO_EXTENSION); @@ -1268,36 +1257,6 @@ return false; } - /** - * Searches and loads ini, xml, php or inc file in application/configs and project/configs. - * - * When no extension is specified the system looks for a file with the right extension. - * - * .php and .inc files run within the context of this object and thus can access all - * $this-> variables and functions. - * - * @param string $fileName_args One or more filenames, looks for the first to return a value - * @return mixed false if nothing was returned - */ - public function includeProjectFile($fileName_args) - { - foreach (func_get_args() as $fileName) { - // First check in the project configs directory - $result = $this->includeFile(APPLICATION_PATH . '/configs/' . $fileName); - - if (! $result) { - // Then check in the gems configs directory - $result = $this->includeFile(GEMS_LIBRARY_DIR . '/configs/' . $fileName); - } - - if ($result) { - return $result; - } - } - - return false; - } - public function loadLoginInfo($userName) { /** @@ -1344,13 +1303,17 @@ } } + /** + * Return a hashed of the string. + * + * @param string $name Optional name, is here for ModelAbstract setOnSave compatibility + * @param string $value The value to hash. + * @param boolean $new Optional is new, is here for ModelAbstract setOnSave compatibility + * @return string The salted hash as a 32-character hexadecimal number. + */ public function passwordHash($name, $value, $new) { - if (isset($this->project->salt)) { - return md5($this->project->salt . $value, false); - } else { - return md5($value, false); - } + return $this->project->getValueHash($value); } /** Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-02 12:34:57 UTC (rev 165) +++ trunk/library/configs/db/patches.sql 2011-11-03 10:55:39 UTC (rev 166) @@ -218,6 +218,35 @@ CHANGE `grp_valid_for_unit` `grp_valid_for_unit` CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'D'; -- PATCH: New user login structure +CREATE TABLE if not exists gems__users ( + gsu_id_user bigint unsigned not null, + gsu_id_organization bigint not null references gems__organizations (gor_id_organization), + + gsu_login varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + + gsu_user_class varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + gsu_active boolean not null default 1, + + -- Common fields for standard 'store password in Gems' logins + -- Not every gsu_user_class will use them + gsu_password varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gsu_failed_logins int(11) unsigned not null default 0, + gsu_last_failed timestamp null, + gsu_reset_key varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gsu_reset_requested timestamp null, + gsu_reset_required boolean not null default 0, + + gsu_changed timestamp not null default current_timestamp on update current_timestamp, + gsu_changed_by bigint unsigned not null, + gsu_created timestamp not null, + gsu_created_by bigint unsigned not null, + + PRIMARY KEY (gsu_id_user, gsu_id_organization), + UNIQUE (gsu_login, gsu_id_organization) + ) + ENGINE=InnoDB + CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; + INSERT INTO gems__users (gsu_id_user, gsu_login, gsu_id_organization, gsu_user_class, gsu_active, gsu_password, gsu_failed_logins, gsu_last_failed, gsu_reset_key, gsu_reset_requested, gsu_reset_required, gsu_changed, gsu_changed_by, gsu_created, gsu_created_by) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-02 12:35:03
|
Revision: 165 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=165&view=rev Author: mennodekker Date: 2011-11-02 12:34:57 +0000 (Wed, 02 Nov 2011) Log Message: ----------- Updated docs Modified Paths: -------------- trunk/library/classes/Gems/Form/TableForm.php trunk/library/classes/Gems/TabForm.php Modified: trunk/library/classes/Gems/Form/TableForm.php =================================================================== --- trunk/library/classes/Gems/Form/TableForm.php 2011-11-02 11:35:57 UTC (rev 164) +++ trunk/library/classes/Gems/Form/TableForm.php 2011-11-02 12:34:57 UTC (rev 165) @@ -159,8 +159,13 @@ /** * Add element to stack * - * @param Zend_Form_Element $element - * @return Zend_Form_Element + * Takes care of setting the right decorators for table display + * + * @param string|Zend_Form_Element $element + * @param string $name + * @param array|Zend_Config $options + * @throws Zend_Form_Exception on invalid element + * @return Gems_Form_TableForm */ public function addElement($element, $name = null, $options = null) { Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2011-11-02 11:35:57 UTC (rev 164) +++ trunk/library/classes/Gems/TabForm.php 2011-11-02 12:34:57 UTC (rev 165) @@ -1,5 +1,4 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -45,7 +44,17 @@ * @var Gems_Form_TabSubForm */ private $currentTab = null; - + + /** + * Add an element to the form, when a tab (subform) had been added, it will return + * the subform instead of the form, keep this in mind when chaining methods + * + * @param string|Zend_Form_Element $element + * @param string $name + * @param array|Zend_Config $options + * @throws Zend_Form_Exception on invalid element + * @return Gems_TabForm|Gems_Form_TabSubForm + */ public function addElement($element, $name = null, $options = null) { if ($this->currentTab) { @@ -54,7 +63,14 @@ return parent::addElement($element, $name, $options); } } - + + /** + * Add a tab to the form + * + * @param string $name + * @param string $title + * @return Gems_Form_TabSubForm + */ public function addTab($name, $title) { if ($title instanceof MUtil_Html_Sequence) $title = $title->render($form->getView()); @@ -64,6 +80,16 @@ return $tab; } + /** + * Add an element to the form, when a tab (subform) had been added, it will return + * the subform instead of the form, keep this in mind when chaining methods + * + * @param array $elements + * @param string $name + * @param array|Zend_Config $options + * @return Gems_TabForm|Gems_Form_TabSubForm + * @throws Zend_Form_Exception if no valid elements provided + */ public function addDisplayGroup(array $elements, $name, $options = null) { if ($this->currentTab) { return $this->currentTab->addDisplayGroup($elements, $name, $options); @@ -80,6 +106,13 @@ } } + /** + * Return a display group, use recursive search in subforms to provide a transparent experience + * with tabs + * + * @param string $name + * @return Zend_Form_DisplayGroup|null + */ public function getDisplayGroup($name) { if ($group = parent::getDisplayGroup($name)) { @@ -95,6 +128,13 @@ } } + /** + * Retrieve a single element, use recursive search in subforms to provide a transparent experience + * with tabs + * + * @param string $name + * @return Zend_Form_Element|null + */ public function getElement($name) { if ($element = parent::getElement($name)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-02 11:36:03
|
Revision: 164 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=164&view=rev Author: mennodekker Date: 2011-11-02 11:35:57 +0000 (Wed, 02 Nov 2011) Log Message: ----------- Hopefully transparent fix for huge tabform performance ->removes the duplicate steps in htmlElementsToTabs Modified Paths: -------------- trunk/library/classes/Gems/Form/TableForm.php trunk/library/classes/Gems/TabForm.php trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/Gems/Form/TableForm.php =================================================================== --- trunk/library/classes/Gems/Form/TableForm.php 2011-11-02 08:14:50 UTC (rev 163) +++ trunk/library/classes/Gems/Form/TableForm.php 2011-11-02 11:35:57 UTC (rev 164) @@ -120,7 +120,7 @@ $group->setDecorators( array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array(array('labelCellClose' => 'HtmlTag'), array('tag' => 'td', 'placement'=> Zend_Form_Decorator_Abstract::PREPEND, 'closeOnly'=>true)), - array('Tooltip'), + 'Tooltip', array('Description', array('tag'=>'label', 'class'=>'optional', 'placement'=> Zend_Form_Decorator_Abstract::PREPEND, 'escape'=>false)), array(array('labelCellOpen' => 'HtmlTag'), array('tag' => 'td', 'class'=>'label', 'placement'=> Zend_Form_Decorator_Abstract::PREPEND, 'openOnly'=>true)), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => $this->_alternate . ' ' . $group->getName(). ' ' . $group->getAttrib('class'))) @@ -133,7 +133,7 @@ $decorators = array( array('Description', array('class'=>'description')), 'Errors', - array('Tooltip'), + 'Tooltip', ); //If we want to see the individual fields labels, do so: @@ -179,7 +179,7 @@ $decorators = array( array('Description', array('class'=>'description')), 'Errors', - array('Tooltip'), + 'Tooltip', array('Label', array('escape'=>false)), array(array('labelCell' => 'HtmlTag'), array('tag' => 'td', 'class'=>'label', 'colspan'=>2)), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => $element->getName())) @@ -192,7 +192,7 @@ 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array(array('labelCellClose' => 'HtmlTag'), array('tag' => 'td', 'placement'=> Zend_Form_Decorator_Abstract::PREPEND, 'closeOnly'=>true)), - array('Tooltip'), + 'Tooltip', array(array('labelCellOpen' => 'HtmlTag'), array('tag' => 'td', 'class'=>'label', 'placement'=> Zend_Form_Decorator_Abstract::PREPEND, 'openOnly'=>true)), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => $element->getName())) ); @@ -202,7 +202,7 @@ 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array(array('labelCellClose' => 'HtmlTag'), array('tag' => 'td', 'placement'=> Zend_Form_Decorator_Abstract::PREPEND, 'closeOnly'=>true)), - array('Tooltip'), + 'Tooltip', array('Label', array('escape'=>false)), array(array('labelCellOpen' => 'HtmlTag'), array('tag' => 'td', 'class'=>'label', 'placement'=> Zend_Form_Decorator_Abstract::PREPEND, 'openOnly'=>true)), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => $element->getName())) @@ -222,7 +222,7 @@ $decorator->setOption('class', $this->_alternate . ' ' . $element->getName()); } - return parent::addElement($element); + return $this; } /** Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2011-11-02 08:14:50 UTC (rev 163) +++ trunk/library/classes/Gems/TabForm.php 2011-11-02 11:35:57 UTC (rev 164) @@ -42,6 +42,75 @@ class Gems_TabForm extends Gems_Form { /** + * @var Gems_Form_TabSubForm + */ + private $currentTab = null; + + public function addElement($element, $name = null, $options = null) + { + if ($this->currentTab) { + return $this->currentTab->addElement($element, $name, $options); + } else { + return parent::addElement($element, $name, $options); + } + } + + public function addTab($name, $title) + { + if ($title instanceof MUtil_Html_Sequence) $title = $title->render($form->getView()); + $tab = new Gems_Form_TabSubForm(array('name' => $name, 'title' => strip_tags($title))); + $this->currentTab = $tab; + $this->addSubForm($tab, $name); + return $tab; + } + + public function addDisplayGroup(array $elements, $name, $options = null) { + if ($this->currentTab) { + return $this->currentTab->addDisplayGroup($elements, $name, $options); + } else { + //Add the group as usual + parent::addDisplayGroup($elements, $name, $options); + + //Retrieve it and set decorators + $group = $this->getDisplayGroup($name); + $group->setDecorators( array('FormElements', + array('HtmlTag', array('tag' => 'div', 'class' => $group->getName(). ' ' . $group->getAttrib('class'))) + )); + return $this; + } + } + + public function getDisplayGroup($name) + { + if ($group = parent::getDisplayGroup($name)) { + return $group; + } else { + $subforms = $this->getSubForms(); + foreach($subforms as $subform) { + if ($group = $subform->getDisplayGroup($name)) { + return $group; + } + } + return; + } + } + + public function getElement($name) + { + if ($element = parent::getElement($name)) { + return $element; + } else { + $subforms = $this->getSubForms(); + foreach($subforms as $subform) { + if ($element = $subform->getElement($name)) { + return $element; + } + } + return; + } + } + + /** * Create tabs from MUtil_Form_Element_Tab elements * * All elements following an element of type MUtil_Form_Element_Tab will be in tabs @@ -51,12 +120,6 @@ */ public static function htmlElementsToTabs($form) { foreach ($form as $element) { - //Make sure error decorator is the last one! (not really needed inside the tabs, but just to make sure) - $error = $element->getDecorator('Errors'); - if ($error instanceof Zend_Form_Decorator_Errors) { - $element->removeDecorator('Errors'); - $element->addDecorator($error); - } switch (get_class($element)) { case 'MUtil_Form_Element_Tab': //Start a new tab @@ -75,6 +138,7 @@ //zorg dat er geen display is voor hidden fields $element->removeDecorator('htmlTag'); $element->removeDecorator('Label'); + case 'Gems_Form_TabSubForm': case 'Zend_Form_Element_Submit': //Just leave this one out of the tabs break; @@ -103,7 +167,12 @@ $remove[] = $element->getName(); } } else { - unset($tab); + //Make sure error decorator is the last one! (not really needed inside the tabs, but just to make sure) + $error = $element->getDecorator('Errors'); + if ($error instanceof Zend_Form_Decorator_Errors) { + $element->removeDecorator('Errors'); + $element->addDecorator($error); + } } break; } @@ -218,15 +287,4 @@ return $form; } - - public function addDisplayGroup(array $elements, $name, $options = null) { - //Add the group as usual - parent::addDisplayGroup($elements, $name, $options); - - //Retrieve it and set decorators - $group = $this->getDisplayGroup($name); - $group->setDecorators( array('FormElements', - array('HtmlTag', array('tag' => 'div', 'class' => $group->getName(). ' ' . $group->getAttrib('class'))) - )); - } } \ No newline at end of file Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2011-11-02 08:14:50 UTC (rev 163) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2011-11-02 11:35:57 UTC (rev 164) @@ -618,10 +618,13 @@ $options = $this->_mergeOptions($name, $options, self::DISPLAY_OPTIONS, self::TAB_OPTIONS); - $element = new MUtil_Form_Element_Tab($name, $options); + if (method_exists($this->form, 'addTab')) { + return $this->form->addTab($name, $options['value']); + } else { + $element = new MUtil_Form_Element_Tab($name, $options); + $this->form->addElement($element); + } - $this->form->addElement($element); - return $element; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-02 08:14:57
|
Revision: 163 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=163&view=rev Author: mennodekker Date: 2011-11-02 08:14:50 +0000 (Wed, 02 Nov 2011) Log Message: ----------- Performance improvement for huge tabforms Modified Paths: -------------- trunk/library/classes/Gems/Form/TableForm.php Modified: trunk/library/classes/Gems/Form/TableForm.php =================================================================== --- trunk/library/classes/Gems/Form/TableForm.php 2011-11-01 14:40:39 UTC (rev 162) +++ trunk/library/classes/Gems/Form/TableForm.php 2011-11-02 08:14:50 UTC (rev 163) @@ -61,25 +61,28 @@ /** * Get a ViewHelper or ZendX decorator to add in front of the decorator chain * - * @param array $decorators + * @param Zend_Form_Element $element * @return null|Zend_Form_Decorator_Abstract */ - private function _getImportantDecorator($decorators) { + private function _getImportantDecorator($element) { $dec1 = null; - if (isset($decorators['Zend_Form_Decorator_ViewHelper'])) { - $dec1 = $decorators['Zend_Form_Decorator_ViewHelper']; - } elseif (isset($decorators['Zend_Form_Decorator_File'])) { - $dec1 = $decorators['Zend_Form_Decorator_File']; + if ($dec1 = $element->getDecorator('ViewHelper')) { + return $dec1; + } elseif ($dec1 = $element->getDecorator('UiWidgetElement')) { + return $dec1; + } elseif ($dec1 = $element->getDecorator('File')) { + return $dec1; } else { + $decorators = $element->getDecorators(); foreach($decorators as $name=>$decorator) { if (substr($name, 0, 5) == 'ZendX') { $dec1 = $decorator; break; } } + return $dec1; } - return $dec1; } /** @@ -126,8 +129,7 @@ //Now add the right decorators to the elements $groupElements = $group->getElements(); foreach ($groupElements as $element) { - $decorators = $element->getDecorators(); - $dec1 = $this->_getImportantDecorator($decorators); + $dec1 = $this->_getImportantDecorator($element); $decorators = array( array('Description', array('class'=>'description')), 'Errors', @@ -170,8 +172,7 @@ $element = $this->getElement($name); } - $decorators = $element->getDecorators(); - $dec1 = $this->_getImportantDecorator($decorators); + $dec1 = $this->_getImportantDecorator($element); if ($element instanceof MUtil_Form_Element_Html) { //Colspan 2 @@ -244,4 +245,4 @@ } return $this; } -} +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-01 14:40:49
|
Revision: 162 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=162&view=rev Author: matijsdejong Date: 2011-11-01 14:40:39 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Sort just a little bit more intelligent Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php Modified: trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2011-11-01 14:16:18 UTC (rev 161) +++ trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2011-11-01 14:40:39 UTC (rev 162) @@ -53,7 +53,7 @@ * * @var array */ - protected $_fixedSort = array('gto_round_order' => SORT_ASC); + protected $_fixedSort = array('gto_valid_from' => SORT_ASC, 'gto_round_order' => SORT_ASC); /** * Shortfix to add class attribute This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-01 14:16:24
|
Revision: 161 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=161&view=rev Author: mennodekker Date: 2011-11-01 14:16:18 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Doc fix and minor optimization Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2011-11-01 14:03:23 UTC (rev 160) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2011-11-01 14:16:18 UTC (rev 161) @@ -191,7 +191,7 @@ */ protected function _getSid($surveyId) { - return $this->getSurveyData($surveyId, 'gsu_surveyor_id'); + return $this->tracker->getSurvey($surveyId)->getSourceSurveyId(); } /** Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-01 14:03:23 UTC (rev 160) +++ trunk/library/classes/GemsEscort.php 2011-11-01 14:16:18 UTC (rev 161) @@ -329,7 +329,7 @@ * * Use $this->project to access afterwards * - * @return Zend_View + * @return ArrayObject */ protected function _initProject() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-01 14:03:34
|
Revision: 160 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=160&view=rev Author: michieltcs Date: 2011-11-01 14:03:23 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Accept unknown CA's when verifying https urls Modified Paths: -------------- trunk/library/classes/MUtil/Validate/Url.php Modified: trunk/library/classes/MUtil/Validate/Url.php =================================================================== --- trunk/library/classes/MUtil/Validate/Url.php 2011-11-01 13:52:15 UTC (rev 159) +++ trunk/library/classes/MUtil/Validate/Url.php 2011-11-01 14:03:23 UTC (rev 160) @@ -114,6 +114,11 @@ // curl_setopt($ch, CURLOPT_FILETIME, true); curl_setopt($ch, CURLOPT_NOBODY, true); + + /** + * @todo Unknown CA's should probably be imported... + */ + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $valid = curl_exec($ch); if (! $valid) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-01 13:52:27
|
Revision: 159 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=159&view=rev Author: matijsdejong Date: 2011-11-01 13:52:15 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Ticket #33: date types for tracks fields, including use in track rounds. AnswerModelSnippetGeneric now shows a 'Fill in' button when possible and has extra usage options. Undo of change 157, but corrected the bug. Fixed bug in Lazy::first FormBridge::applyFixedOptions is now a static public function for use elsewhere. Modified Paths: -------------- trunk/library/classes/Gems/Default/TrackFieldsAction.php trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php trunk/library/classes/Gems/Tracker/RespondentTrack.php trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php trunk/library/classes/Gems/Tracker/SurveyModel.php trunk/library/classes/MUtil/Lazy.php trunk/library/classes/MUtil/Model/FormBridge.php trunk/library/classes/MUtil/Model/TableModel.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__track_fields.20.sql trunk/library/snippets/EditTrackSnippet.php Modified: trunk/library/classes/Gems/Default/TrackFieldsAction.php =================================================================== --- trunk/library/classes/Gems/Default/TrackFieldsAction.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/classes/Gems/Default/TrackFieldsAction.php 2011-11-01 13:52:15 UTC (rev 159) @@ -67,9 +67,12 @@ $bridge->addExhibitor('gtf_id_track'); $bridge->addText('gtf_id_order'); $bridge->addText('gtf_field_name', 'size', '30', 'minlength', 4, 'required', true, 'validator', $model->createUniqueValidator(array('gtf_field_name','gtf_id_track'))); + $bridge->addText('gtf_field_code', 'minlength', 4, 'description', $this->_('Optional extra name to link the field to program code.')); + $bridge->addText('gtf_field_description', 'size', 30, 'description', $this->_('Optional extra description to show the user.')); $bridge->addTextarea('gtf_field_values', 'minlength', 4, 'rows', 4, 'description', $this->_('Separate multiple values with a vertical bar (|)'), 'required', false); $bridge->addSelect('gtf_field_type'); $bridge->addCheckBox('gtf_required'); + $bridge->addCheckBox('gtf_readonly', 'description', $this->_('Check this box if this field is always set by code instead of the user.')); } /** @@ -104,16 +107,23 @@ public function createModel($detailed, $action) { $trackId = $this->_getIdParam(); - $types = array('select' => $this->_('Select one'), 'multiselect' => $this->_('Select multiple'), 'text' => $this->_('Free text')); + $types = array('select' => $this->_('Select one'), 'multiselect' => $this->_('Select multiple'), 'date' => $this->_('Date'), 'text' => $this->_('Free text')); $model = new MUtil_Model_TableModel('gems__track_fields'); $model->setKeys(array('fid' => 'gtf_id_field', MUtil_Model::REQUEST_ID => 'gtf_id_track')); $model->set('gtf_id_track', 'label', $this->_('Track'), 'multiOptions', $this->util->getTrackData()->getAllTracks()); $model->set('gtf_id_order', 'label', $this->_('Order')); $model->set('gtf_field_name', 'label', $this->_('Name')); + if ($detailed) { + $model->set('gtf_field_code', 'label', $this->_('Code Name')); + $model->set('gtf_field_description', 'label', $this->_('Description')); + } $model->set('gtf_field_values', 'label', $this->_('Values')); $model->set('gtf_field_type', 'label', $this->_('Type'), 'multiOptions', $types); $model->set('gtf_required', 'label', $this->_('Required'), 'multiOptions', $this->util->getTranslated()->getYesNo()); + if ($detailed) { + $model->set('gtf_readonly', 'label', $this->_('Readonly'), 'multiOptions', $this->util->getTranslated()->getYesNo()); + } Gems_Model::setChangeFieldsByPrefix($model, 'gtf'); Modified: trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2011-11-01 13:52:15 UTC (rev 159) @@ -359,12 +359,22 @@ return $survey->getDatesList($language); case self::RESPONDENT_TRACK_TABLE: - return array( + $this->_ensureTrackFields(); + + $results = array( 'gr2t_start_date' => $this->_('Track start'), 'gr2t_end_date' => $this->_('Track end'), // 'gr2t_created' => $this->_('Track created'), ); + foreach ($this->_trackFields as $field) { + if ('date' == $field['gtf_field_type']) { + $results[$field['gtf_id_field']] = $field['gtf_field_name']; + } + } + + return $results; + case self::TOKEN_TABLE: return array( 'gto_valid_from' => $this->_('Valid from'), Modified: trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2011-11-01 13:52:15 UTC (rev 159) @@ -173,7 +173,7 @@ protected function _ensureTrackFields() { if (! is_array($this->_trackFields)) { - $sql = "SELECT gtf_id_field, gtf_field_name, gtf_field_values, gtf_field_type, gtf_required + $sql = "SELECT * FROM gems__track_fields WHERE gtf_id_track = ? ORDER BY gtf_id_order"; @@ -493,24 +493,38 @@ $name = (string) $field['gtf_id_field']; - switch ($field['gtf_field_type']) { - case "multiselect": - $element = new Zend_Form_Element_MultiCheckbox($name); - $element->setMultiOptions($multi); - break; + if ($field['gtf_readonly']) { + $element = new MUtil_Form_Element_Exhibitor($name); - case "select": - $element = new Zend_Form_Element_Select($name); - $element->setMultiOptions($empty + $multi); - break; + } else { + switch ($field['gtf_field_type']) { + case "multiselect": + $element = new Zend_Form_Element_MultiCheckbox($name); + $element->setMultiOptions($multi); + break; - default: - $element = new Zend_Form_Element_Text($name); - $element->setAttrib('size', 40); - break; + case "select": + $element = new Zend_Form_Element_Select($name); + $element->setMultiOptions($empty + $multi); + break; + + case "date": + $options = array(); + MUtil_Model_FormBridge::applyFixedOptions('date', $options); + + $element = new MUtil_JQuery_Form_Element_DatePicker($name, $options); + $element->setStorageFormat('yyyy-MM-dd'); + break; + + default: + $element = new Zend_Form_Element_Text($name); + $element->setAttrib('size', 40); + break; + } } $element->setLabel($field['gtf_field_name']) - ->setRequired($field['gtf_required']); + ->setRequired($field['gtf_required']) + ->setDescription($field['gtf_field_description']); $elements[$name] = $element; } @@ -734,15 +748,33 @@ */ public function setFieldsData($respTrackId, array $data) { + $elements = null; $newValues = array(); // MUtil_Echo::track($data); + $this->_ensureTrackFields(); + foreach ($data as $id => $value) { if (is_array($value)) { $value = implode(self::FIELD_SEP, $value); } + // Do the hard work for storing dates + if (isset($this->_trackFields[$id]['gtf_field_type']) && ('date' == $this->_trackFields[$id]['gtf_field_type'])) { + if (! $elements) { + $elements = $this->getFieldsElements(); + } + if (isset($elements[$id])) { + $elem = $elements[$id]; + if ($elem instanceof MUtil_JQuery_Form_Element_DatePicker) { + // I do not like regenerating elements either, but this + // is the only place where we KNOW this information for sure. + $value = MUtil_Date::format($value, $elem->getStorageFormat(), $elem->getDateFormat()); + } + } + } + $newValues[]= array( 'gr2t2f_id_respondent_track' => $respTrackId, 'gr2t2f_id_field' => $id, @@ -765,7 +797,7 @@ /** * Updates the number of rounds in this track. - * + * * @param int $userId The current user * @return int 1 if data changed, 0 otherwise */ Modified: trunk/library/classes/Gems/Tracker/RespondentTrack.php =================================================================== --- trunk/library/classes/Gems/Tracker/RespondentTrack.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/classes/Gems/Tracker/RespondentTrack.php 2011-11-01 13:52:15 UTC (rev 159) @@ -58,6 +58,12 @@ /** * + * @var array Field data + */ + protected $_fieldData = null; + + /** + * * @var Gems_Tracker_Token */ protected $_firstToken; @@ -107,6 +113,18 @@ } /** + * Makes sure the fieldData is in $this->_fieldData + * + * @param boolean $reload Optional parameter to force reload. + */ + private function _ensureFieldData($reload = false) + { + if ((null === $this->_fieldData) || $reload) { + $this->_fieldData = $this->getTrackEngine()->getFieldsData($this->_respTrackId); + } + } + + /** * Makes sure the receptioncode data is part of the $this->_respTrackData * * @param boolean $reload Optional parameter to force reload. @@ -344,14 +362,26 @@ public function getDate($fieldName) { if (isset($this->_respTrackData[$fieldName])) { - if (Zend_Date::isDate($this->_respTrackData[$fieldName], Gems_Tracker::DB_DATETIME_FORMAT)) { - return new MUtil_Date($this->_respTrackData[$fieldName], Gems_Tracker::DB_DATETIME_FORMAT); + $date = $this->_respTrackData[$fieldName]; + } else { + $this->_ensureFieldData(); + + if (isset($this->_fieldData[$fieldName])) { + $date = $this->_fieldData[$fieldName]; + } else { + $date = false; } - if (Zend_Date::isDate($this->_respTrackData[$fieldName], Gems_Tracker::DB_DATE_FORMAT)) { - return new MUtil_Date($this->_respTrackData[$fieldName], Gems_Tracker::DB_DATE_FORMAT); + } + + if ($date) { + if (Zend_Date::isDate($date, Gems_Tracker::DB_DATETIME_FORMAT)) { + return new MUtil_Date($date, Gems_Tracker::DB_DATETIME_FORMAT); } + if (Zend_Date::isDate($date, Gems_Tracker::DB_DATE_FORMAT)) { + return new MUtil_Date($date, Gems_Tracker::DB_DATE_FORMAT); + } if (Gems_Tracker::$verbose) { - MUtil_Echo::r($this->_respTrackData[$fieldName], 'Missed track date value:'); + MUtil_Echo::r($date, 'Missed track date value:'); } } } @@ -375,6 +405,18 @@ } /** + * Returns the field data for this respondent track id. + * + * @return array of the existing field values for this respondent track + */ + public function getFieldData() + { + $this->_ensureFieldData(); + + return $this->_fieldData; + } + + /** * Returns the first token in this track * * @return Gems_Tracker_Token Modified: trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2011-11-01 13:52:15 UTC (rev 159) @@ -83,6 +83,13 @@ protected $locale; /** + * Switch to put the display of the cancel and pritn buttons. + * + * @var boolean + */ + protected $showButtons = true; + + /** * Switch to put the display of the current token as select to true or false. * * @var boolean @@ -149,7 +156,20 @@ } $bridge->th($this->_('Token')); - $td = $bridge->tdh($bridge->gto_id_token->strtoupper()); + + $tokenUpper = $bridge->gto_id_token->strtoupper(); + if ($menuItem = $this->menu->find(array('controller' => 'ask', 'action' => 'take', 'allowed' => true))) { + $source = new Gems_Menu_ParameterSource(); + $source->setTokenId($bridge->gto_id_token); + $source->offsetSet('can_be_taken', $bridge->can_be_taken); + + $link = $menuItem->toActionLink($source); + $link->title = array($this->_('Token'), $tokenUpper); + + $td = $bridge->tdh($bridge->can_be_taken->if($link, $tokenUpper)); + } else { + $td = $bridge->tdh($tokenUpper); + } $td->appendAttrib('class', $selectedClass); $td->appendAttrib('class', $bridge->row_class); } @@ -207,9 +227,11 @@ $htmlDiv->ul($this->_('No token specified.'), array('class' => 'errors')); } - $buttonDiv = $htmlDiv->buttonDiv(); - $buttonDiv->actionLink(array(), $this->_('Close'), array('onclick' => 'window.close();')); - $buttonDiv->actionLink(array(), $this->_('Print'), array('onclick' => 'window.print();')); + if ($this->showButtons) { + $buttonDiv = $htmlDiv->buttonDiv(); + $buttonDiv->actionLink(array(), $this->_('Close'), array('onclick' => 'window.close();')); + $buttonDiv->actionLink(array(), $this->_('Print'), array('onclick' => 'window.print();')); + } return $htmlDiv; } Modified: trunk/library/classes/Gems/Tracker/SurveyModel.php =================================================================== --- trunk/library/classes/Gems/Tracker/SurveyModel.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/classes/Gems/Tracker/SurveyModel.php 2011-11-01 13:52:15 UTC (rev 159) @@ -1,6 +1,5 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -26,22 +25,24 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @author Matijs de Jong - * @since 1.4 - * @version 1.4 - * @package Gems + * + * + * @package Gems * @subpackage Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** - * Description of SurveyModel + * More correctly a Survey ANSWERS Model as it adds answers to token information/ * - * @author Matijs de Jong - * @package Gems + * @package Gems * @subpackage Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4 */ class Gems_Tracker_SurveyModel extends Gems_Model_JoinModel { @@ -63,6 +64,9 @@ $this->addTable('gems__reception_codes', array('gto_reception_code' => 'grc_id_reception_code')); $this->addColumn( + 'CASE WHEN grc_success = 1 AND gto_valid_from <= CURRENT_TIMESTAMP AND gto_completion_time IS NULL AND (gto_valid_until IS NULL OR gto_valid_until >= CURRENT_TIMESTAMP) THEN 1 ELSE 0 END', + 'can_be_taken'); + $this->addColumn( "CASE WHEN grc_success = 1 THEN '' ELSE 'deleted' END", 'row_class'); Modified: trunk/library/classes/MUtil/Lazy.php =================================================================== --- trunk/library/classes/MUtil/Lazy.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/classes/MUtil/Lazy.php 2011-11-01 13:52:15 UTC (rev 159) @@ -1,39 +1,38 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - /** - * @author Matijs de Jong - * @since 1.0 - * @version 1.1 - * @package MUtil + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil * @subpackage Lazy + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** @@ -48,9 +47,11 @@ * 3 - an object propery * 4 - an array object * - * @author Matijs de Jong - * @package MUtil + * @package MUtil * @subpackage Lazy + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 */ class MUtil_Lazy { @@ -77,10 +78,10 @@ $args = func_get_args(); // Last value first - $result = array_pop($args); + $result = array_shift($args); - foreach (array_reverse($args) as $arg) { - $result = new MUtil_Lazy_Call(array($arg, 'if'), array($arg, $result)); + foreach ($args as $arg) { + $result = new MUtil_Lazy_Call(array($result, 'if'), array($result, $arg)); } return $result; } @@ -130,16 +131,16 @@ return new MUtil_Lazy_Property($object, $property); } - /** - * Raises a MUtil_Lazy_LazyInterface one level, but may still + /** + * Raises a MUtil_Lazy_LazyInterface one level, but may still * return a MUtil_Lazy_LazyInterface. - * - * This function is usually used to perform a e.g. filter function on object that may e.g. + * + * This function is usually used to perform a e.g. filter function on object that may e.g. * contain Repeater objects. - * + * * @param mixed $object Usually an object of type MUtil_Lazy_LazyInterface * @param mixed $stack Optional variable stack for evaluation - * @return mixed + * @return mixed */ public static function raise($object, $stack = null) { @@ -153,7 +154,7 @@ /** * * @param mixed $repeatable - * @return MUtil_Lazy_RepeatableInterface + * @return MUtil_Lazy_RepeatableInterface */ public static function repeat($repeatable) { @@ -164,18 +165,18 @@ return new MUtil_Lazy_Repeatable($repeatable); } - /** - * Raises a MUtil_Lazy_LazyInterface until the return object is not a + /** + * Raises a MUtil_Lazy_LazyInterface until the return object is not a * MUtil_Lazy_LazyInterface object. - * - * @param mixed $object Usually an object of type MUtil_Lazy_LazyInterface + * + * @param mixed $object Usually an object of type MUtil_Lazy_LazyInterface * @param mixed $stack Optional variable stack for evaluation * @return mixed Something not lazy */ public static function rise($object, $stack = null) { $stack = self::toStack($stack, __FUNCTION__); - + // Resolving when MUtil_Lazy_LazyInterface. while ($object instanceof MUtil_Lazy_LazyInterface) { $object = $object->__toValue($stack); @@ -192,11 +193,11 @@ return $object; } - /** + /** * Turns any input into a MUtil_Lazy_StackInterface object. - * - * @param mixed $stack Value to be turned into stack for evaluation - * @param string A string describing where the stack was created. + * + * @param mixed $stack Value to be turned into stack for evaluation + * @param string A string describing where the stack was created. * @return MUtil_Lazy_StackInterface A usable stack */ private static function toStack($stack, $source) Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2011-11-01 13:52:15 UTC (rev 159) @@ -112,7 +112,7 @@ return $element; } - protected function _applyFixedOptions($type, array &$options) + public static function applyFixedOptions($type, array &$options) { static $typeOptions; @@ -268,7 +268,7 @@ $options = $this->_mergeOptions($name, $options, self::DISPLAY_OPTIONS, self::CHECK_OPTIONS); - $this->_applyFixedOptions(__FUNCTION__, $options); + self::applyFixedOptions(__FUNCTION__, $options); $element = new Zend_Form_Element_Checkbox($name, $options); @@ -286,7 +286,7 @@ $elementName = $name; // Allow centrally set options - $this->_applyFixedOptions(__FUNCTION__, $options); + self::applyFixedOptions(__FUNCTION__, $options); if (isset($options['dateFormat'])) { // Make sure the model knows the dateFormat (can be important for storage). Modified: trunk/library/classes/MUtil/Model/TableModel.php =================================================================== --- trunk/library/classes/MUtil/Model/TableModel.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/classes/MUtil/Model/TableModel.php 2011-11-01 13:52:15 UTC (rev 159) @@ -77,7 +77,8 @@ { return $this->_deleteTableData( $this->_table, - $this->_checkFilterUsed($filter)); + $this->_checkFilterUsed($filter), + $this->_deleteValues); } /** Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/configs/db/patches.sql 2011-11-01 13:52:15 UTC (rev 159) @@ -233,3 +233,8 @@ ALTER TABLE `gems__staff` CHANGE `gsf_login` `gsf_login` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `gsf_password` `gsf_password` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `gsf_id_organization` `gsf_id_organization` BIGINT( 20 ) NULL DEFAULT NULL; + +-- PATCH: Extra information for track fields +ALTER TABLE gems__track_fields ADD gtf_field_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER gtf_field_name, + ADD gtf_field_description varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER gtf_field_code, + ADD gtf_readonly boolean not null default false AFTER gtf_required; \ No newline at end of file Modified: trunk/library/configs/db/tables/gems__track_fields.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__track_fields.20.sql 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/configs/db/tables/gems__track_fields.20.sql 2011-11-01 13:52:15 UTC (rev 159) @@ -6,12 +6,15 @@ gtf_id_order int not null default 10, gtf_field_name varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + gtf_field_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gtf_field_description varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, gtf_field_values text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, gtf_field_type varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, gtf_required boolean not null default false, + gtf_readonly boolean not null default false, gtf_changed timestamp not null default current_timestamp on update current_timestamp, gtf_changed_by bigint unsigned not null, Modified: trunk/library/snippets/EditTrackSnippet.php =================================================================== --- trunk/library/snippets/EditTrackSnippet.php 2011-11-01 13:30:39 UTC (rev 158) +++ trunk/library/snippets/EditTrackSnippet.php 2011-11-01 13:52:15 UTC (rev 159) @@ -130,6 +130,7 @@ $model = $this->getModel(); $this->formData = $model->save($this->formData); $changed = $model->getChanged(); + $refresh = false; // Retrieve the key if just created if ($this->createData) { @@ -140,18 +141,25 @@ $this->trackEngine->checkRoundsFor($this->respondentTrack, $this->userId); } elseif (! (isset($this->formData['gr2t_completed']) && $this->formData['gr2t_completed'])) { - // Check if sartdate has changed + // Check if startdate has changed if (! $this->respondentTrack->getStartDate()->equals(new MUtil_Date($this->formData['gr2t_start_date']))) { - // Perform a refresh from the database, to avoid date trouble - $this->respondentTrack->refresh(); - $this->respondentTrack->checkTrackTokens($this->userId); + $refresh = true; } } if ($this->trackEngine && isset($this->formData[self::TRACKFIELDS_ID])) { $changed = $this->trackEngine->setFieldsData($this->respondentTrackId, $this->formData[self::TRACKFIELDS_ID]) ? 1 : $changed; + $refresh = $refresh || $changed; } + if ($refresh) { + Gems_Tracker::$verbose; + // Perform a refresh from the database, to avoid date trouble + $this->respondentTrack->refresh(); + $this->respondentTrack->checkTrackTokens($this->userId); + } + + // Communicate with the user $this->afterSave($changed); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-01 13:30:48
|
Revision: 158 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=158&view=rev Author: michieltcs Date: 2011-11-01 13:30:39 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Initialize variable, suppress mkdir error message Modified Paths: -------------- trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-01 13:19:49 UTC (rev 157) +++ trunk/library/classes/GemsEscort.php 2011-11-01 13:30:39 UTC (rev 158) @@ -144,10 +144,11 @@ */ protected function _initCache() { + $cache = null; $exists = false; $cacheDir = GEMS_ROOT_DIR . "/var/cache/"; if (!file_exists($cacheDir)) { - if (mkdir($cacheDir, 0777, true)) { + if (@mkdir($cacheDir, 0777, true)) { $exists = true; } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-01 13:19:56
|
Revision: 157 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=157&view=rev Author: michieltcs Date: 2011-11-01 13:19:49 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Remove superfluous parameter from call Modified Paths: -------------- trunk/library/classes/MUtil/Model/TableModel.php Modified: trunk/library/classes/MUtil/Model/TableModel.php =================================================================== --- trunk/library/classes/MUtil/Model/TableModel.php 2011-11-01 11:23:34 UTC (rev 156) +++ trunk/library/classes/MUtil/Model/TableModel.php 2011-11-01 13:19:49 UTC (rev 157) @@ -77,8 +77,7 @@ { return $this->_deleteTableData( $this->_table, - $this->_checkFilterUsed($filter), - $this->getDeleteValues()); + $this->_checkFilterUsed($filter)); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-01 11:23:45
|
Revision: 156 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=156&view=rev Author: matijsdejong Date: 2011-11-01 11:23:34 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Extended Answer display with switch for showing current item. Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php Modified: trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2011-10-31 09:46:30 UTC (rev 155) +++ trunk/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2011-11-01 11:23:34 UTC (rev 156) @@ -83,6 +83,13 @@ protected $locale; /** + * Switch to put the display of the current token as select to true or false. + * + * @var boolean + */ + protected $showSelected = true; + + /** * Optional: $request or $tokenData must be set * * The display data of the token shown @@ -111,7 +118,11 @@ protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) { $br = MUtil_Html::create('br'); - $selectedClass = MUtil_Lazy::iff(MUtil_Lazy::comp($bridge->gto_id_token, '==', $this->tokenId), 'selectedColumn', null); + if ($this->showSelected) { + $selectedClass = MUtil_Lazy::iff(MUtil_Lazy::comp($bridge->gto_id_token, '==', $this->tokenId), 'selectedColumn', null); + } else { + $selectedClass = null; + } $bridge->th($this->_('Status')); $td = $bridge->tdh(MUtil_Lazy::first($bridge->grc_description, $this->_('OK'))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |