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-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-08 09:42:21
|
Revision: 189 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=189&view=rev Author: mennodekker Date: 2011-11-08 09:42:10 +0000 (Tue, 08 Nov 2011) Log Message: ----------- Added controller for #34, privileges not set by default at this time Modified Paths: -------------- trunk/library/classes/Gems/Menu.php trunk/library/classes/Gems/UpgradesAbstract.php Added Paths: ----------- trunk/library/classes/Gems/Default/UpgradeAction.php trunk/library/controllers/UpgradeController.php Added: trunk/library/classes/Gems/Default/UpgradeAction.php =================================================================== --- trunk/library/classes/Gems/Default/UpgradeAction.php (rev 0) +++ trunk/library/classes/Gems/Default/UpgradeAction.php 2011-11-08 09:42:10 UTC (rev 189) @@ -0,0 +1,193 @@ +<?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. + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + */ + +/** + * This controller handles applying upgrades to the project + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Default_UpgradeAction extends Gems_Controller_Action +{ + public $useHtmlView = true; + + /** + * @var Gems_Menu + */ + public $menu; + + /** + * @var Gems_Upgrades + */ + protected $_upgrades; + + public function init() + { + parent::init(); + + $this->_upgrades = $this->loader->getUpgrades(); + + } + + /** + * + * @var Gems_Loader + */ + public $loader; + + /** + * Executes the upgrades for a certain context + * + * optional: give from and to levels + * + * usage: execute/context/<context>{/from/int/to/int} + */ + protected function executeAction() + { + $context = $this->getRequest()->getParam('id', 'gems'); + $from = $this->getRequest()->getParam('from'); + $to = $this->getRequest()->getParam('to'); + + $this->html->h3(sprintf($this->_('Upgrading %s'), $context)); + + $this->_upgrades->execute($context, $to, $from); + $messages = $this->_upgrades->getMessages(); + foreach($messages as $message) { + $this->html->p($message); + } + + if ($menuItem = $this->menu->find(array('controller' => $this->_getParam('controller'), 'action' => 'show', 'allowed' => true))) { + $this->html->br(); + $this->html[] = $menuItem->toActionLinkLower($this->getRequest(), array('id'=>$context)); + } + } + + /** + * Proxy for the menu + */ + public function executeAllAction() { + $this->executeAction(); + } + + public function executeFromAction() { + $this->executeAction(); + } + + public function executeOneAction() { + $this->executeAction(); + } + + public function executeToAction() { + $this->executeAction(); + } + + /** + * Overview of available contexts, max upgrade level and achieved upgrade level + */ + public function indexAction() + { + $this->html->h3($this->getTopicTitle()); + + $displayColumns = array('link' => '', + 'context' => $this->_('Context'), + 'maxLevel' => $this->_('Max level'), + 'level' => $this->_('Level')); + + foreach($this->_upgrades->getUpgradesInfo() as $row) { + if ($menuItem = $this->menu->find(array('controller' => $this->_getParam('controller'), 'action' => 'show', 'allowed' => true))) { + $row['link'] = $menuItem->toActionLinkLower($this->getRequest(), $row); + } + $data[] = $row; + + } + $this->addSnippet('SelectiveTableSnippet', 'data', $data, 'class', 'browser', 'columns', $displayColumns); + } + + /** + * Show the upgrades and level for a certain context + * + * Usage: show/context/<context> + */ + public function showAction() + { + $this->html->h3($this->getTopicTitle()); + + $context = $this->_getParam('id', 'gems'); + $this->_upgrades->setContext($context); + if ($info = $this->_upgrades->getUpgradesInfo($context)) { + $this->html->table(array('class'=>'browser'))->tr() + ->th($this->_('Context'))->td($info['context']) + ->tr() + ->th($this->_('Level'))->td($info['level']); + $data = $this->_upgrades->getUpgrades(); + foreach($data as $level => $row) { + foreach($this->menu->getCurrent()->getChildren() as $menuItem) { + if ($menuItem->is('allowed', true)) { + $show = true; + if ($level <= $info['level'] && $menuItem->is('action','execute-to')) { + //When this level is < current level don't allow to execute from current level to this one + $show = false; + } + if ($level <= $info['level'] && $menuItem->is('action','execute-from')) { + //When this level is < current level don't allow to execute from current level to this one + $show = false; + } + if ($show) { + $row['action'][] = $menuItem->toActionLinkLower($this->getRequest(), $row, array('from'=>$level, 'to'=>$level)); + } + } + } + $row['level'] = $level; + $data[$level] = $row; + } + $displayColumns = array('level' => $this->_('Level'), + 'info' => $this->_('Description'), + 'action' => $this->_('Action')); + $this->addSnippet('SelectiveTableSnippet', 'data', $data, 'class', 'browser', 'columns', $displayColumns); + } else { + $this->html[] = sprintf($this->_('Context %s not found!'), $context); + } + } + + public function getTopicTitle() { + return $this->_('Upgrades'); + } + + public function getTopic($n = 1) { + return $this->_('Upgrades'); + } +} \ No newline at end of file Modified: trunk/library/classes/Gems/Menu.php =================================================================== --- trunk/library/classes/Gems/Menu.php 2011-11-07 15:30:23 UTC (rev 188) +++ trunk/library/classes/Gems/Menu.php 2011-11-08 09:42:10 UTC (rev 189) @@ -213,6 +213,14 @@ $logMaint = $page->addPage($this->_('Maintenance'), 'pr.log.maintenance', 'log-maintenance'); $logMaint->addAutofilterAction(); $logMaint->addEditAction('pr.log.maintenance'); + + //UPGRADES CONTROLLER + $page = $setup->addPage($this->_('Upgrade'), 'pr.upgrade', 'upgrade', 'index'); + $show = $page->addAction($this->_('Show'), null, 'show')->setNamedParameters('id','context'); + $page->addAction($this->_('Execute all'), 'pr.upgrade.all', 'execute-all')->setModelParameters(1); + $show->addActionButton($this->_('Execute this'), 'pr.upgrade.one', 'execute-one')->setModelParameters(1)->addNamedParameters('from','from','to','to'); + $show->addActionButton($this->_('Execute from here'), 'pr.upgrade.from', 'execute-from')->setModelParameters(1)->addNamedParameters('from','from'); + $show->addActionButton($this->_('Execute to here'), 'pr.upgrade.to', 'execute-to')->setModelParameters(1)->addNamedParameters('to','to'); return $setup; } Modified: trunk/library/classes/Gems/UpgradesAbstract.php =================================================================== --- trunk/library/classes/Gems/UpgradesAbstract.php 2011-11-07 15:30:23 UTC (rev 188) +++ trunk/library/classes/Gems/UpgradesAbstract.php 2011-11-08 09:42:10 UTC (rev 189) @@ -148,7 +148,7 @@ $to = $this->getMaxLevel($context); } if(is_null($from)) { - $from = $this->getNextLevel(); + $from = $this->getNextLevel($context); if ($from > $to) { $this->addMessage($this->_('Already at max. level.')); @@ -165,7 +165,7 @@ ksort($upgrades); $this->_upgradeStack[$context] = $upgrades; foreach($this->_upgradeStack[$context] as $level => $upgrade) { - if (($level > $from && $level <= $to)) { + if (($level >= $from && $level <= $to)) { $this->addMessage(sprintf($this->_('Trying upgrade for %s to level %s: %s'), $context, $level, $this->_upgradeStack[$context][$level]['info'])); if (call_user_func($upgrade['upgrade'])) { $success = $level; @@ -244,10 +244,11 @@ $current = array_search($level, $levels); //And if it is present, return the next level - if (isset($levels[$current++])) return $levels[$current++]; + $current++; + if (isset($levels[$current])) return $levels[$current]; //Else return current level +1 (doesn't exist anyway) - return $level++; + return ++$level; } public function getMessages() Added: trunk/library/controllers/UpgradeController.php =================================================================== --- trunk/library/controllers/UpgradeController.php (rev 0) +++ trunk/library/controllers/UpgradeController.php 2011-11-08 09:42:10 UTC (rev 189) @@ -0,0 +1,30 @@ +<?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. + */ +class UpgradeController extends Gems_Default_UpgradeAction +{ +} \ 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-14 12:53:59
|
Revision: 208 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=208&view=rev Author: matijsdejong Date: 2011-11-14 12:53:50 +0000 (Mon, 14 Nov 2011) Log Message: ----------- Reintegration of newUser2 branch for #31 - note: gems__users is no longer used. Modified Paths: -------------- trunk/library/changelog.txt trunk/library/classes/Gems/Auth.php trunk/library/classes/Gems/Cookies.php trunk/library/classes/Gems/Default/AskAction.php trunk/library/classes/Gems/Default/CronAction.php trunk/library/classes/Gems/Default/ExportAction.php trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Default/OptionAction.php trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/Gems/Default/StaffAction.php trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php trunk/library/classes/Gems/Default/TokenPlanAction.php trunk/library/classes/Gems/Email/TemplateMailer.php trunk/library/classes/Gems/Loader/LoaderAbstract.php trunk/library/classes/Gems/Loader.php trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/Gems/Model/DbaModel.php trunk/library/classes/Gems/Model.php trunk/library/classes/Gems/Project/Organization/MultiOrganizationInterface.php trunk/library/classes/Gems/Project/ProjectSettings.php trunk/library/classes/Gems/Tracker/Token.php trunk/library/classes/Gems/User/UserLoader.php trunk/library/classes/Gems/Util/DbLookup.php trunk/library/classes/GemsEscort.php trunk/library/classes/MUtil/Date.php trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php trunk/library/classes/MUtil/Model/FormBridge.php trunk/library/classes/MUtil/Model/JoinModel.php trunk/library/classes/MUtil/Registry/Source.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__organizations.20.sql trunk/library/configs/db/tables/gems__staff.20.sql 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 Paths: ----------- trunk/library/classes/Gems/User/LoginPasswordValidator.php trunk/library/classes/Gems/User/NoLoginDefinition.php trunk/library/classes/Gems/User/OldStaffUserDefinition.php trunk/library/classes/Gems/User/ProjectUserDefinition.php trunk/library/classes/Gems/User/StaffUserDefinition.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/User/UserDefinitionAbstract.php trunk/library/classes/Gems/User/UserDefinitionInterface.php trunk/library/classes/Gems/User/UserPasswordValidator.php trunk/library/configs/db/tables/gems__user_login_attempts.10.sql Removed Paths: ------------- trunk/library/classes/Gems/Model/UserModel.php trunk/library/classes/Gems/User/DatabaseUserAbstract.php trunk/library/classes/Gems/User/NoLoginUser.php trunk/library/classes/Gems/User/ProjectSuperUser.php trunk/library/classes/Gems/User/RespondentUser.php trunk/library/classes/Gems/User/StaffUser.php trunk/library/classes/Gems/User/UserAbstract.php trunk/library/classes/Gems/User/UserInterface.php trunk/library/classes/Gems/Validate/GemsPasswordUsername.php trunk/library/configs/db/tables/gems__users.10.sql trunk/library/configs/db_multi_layout/ Property Changed: ---------------- trunk/library/ Property changes on: trunk/library ___________________________________________________________________ Modified: svn:mergeinfo - /branches/newUser:113-150 + /branches/newUser:113-150 /branches/newUser2:175-207 Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/changelog.txt 2011-11-14 12:53:50 UTC (rev 208) @@ -1,7 +1,8 @@ Important changes from 1.4.3 => 1.5 ============================================================ Passwords should be set with a project.ini->salt. Salt is now a required project setting! -The table gems__staff is split into gems__staff and gems__user with all login data in gems__users. +The table gems__staff is split into gems__staff, gems__user_logins with generic login data and gems__users_passwords containing db stored password information. +The table gems__user_ids provides unique and non-sequential user ids accross gems__staff and gems__respondents. 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). Modified: trunk/library/classes/Gems/Auth.php =================================================================== --- trunk/library/classes/Gems/Auth.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Auth.php 2011-11-14 12:53:50 UTC (rev 208) @@ -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 gul_failed_logins, UNIX_TIMESTAMP(gul_last_failed) AS gul_last_failed + FROM gems__user_logins WHERE gul_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['gul_failed_logins'], $this->_delayFactor); + $remaining = ($results['gul_last_failed'] + $delay) - time(); - if ($results['gsu_failed_logins'] > 0 && $remaining > 0) { + if ($results['gul_failed_logins'] > 0 && $remaining > 0) { //$this->_obscureValue = false; $result = $this->_error(self::ERROR_PASSWORD_DELAY, ceil($remaining / 60)); } Modified: trunk/library/classes/Gems/Cookies.php =================================================================== --- trunk/library/classes/Gems/Cookies.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Cookies.php 2011-11-14 12:53:50 UTC (rev 208) @@ -26,6 +26,7 @@ * (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 Cookies * @author Matijs de Jong <mj...@ma...> @@ -73,14 +74,14 @@ } /** - * Get the organization from the cookie. + * Get the current organization from the cookie. * * @param Zend_Controller_Request_Abstract $request - * @return int The organization + * @return int The current organization */ public static function getOrganization(Zend_Controller_Request_Abstract $request) { - return self::get($request, self::ORGANIZATION_COOKIE); + return intval(self::get($request, self::ORGANIZATION_COOKIE)); } /** @@ -120,13 +121,15 @@ /** * Store the organization in a cookie. * - * @param int $locale Organization to store + * @param int $organization Organization to store * @param string $basepath The folder of the domain, if any. * @return boolean True if the cookie was stored. */ - public static function setOrganization($locale, $basepath = '/') + public static function setOrganization($organization, $basepath = '/') { - // Set the cookie for 30 days - return self::set(self::ORGANIZATION_COOKIE, $locale, 30, $basepath); + if ($organization) { + // Set the cookie for 30 days + return self::set(self::ORGANIZATION_COOKIE, $organization, 30, $basepath); + } } } Modified: trunk/library/classes/Gems/Default/AskAction.php =================================================================== --- trunk/library/classes/Gems/Default/AskAction.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Default/AskAction.php 2011-11-14 12:53:50 UTC (rev 208) @@ -82,13 +82,14 @@ /*************** * Get the url * ***************/ - $url = $token->getUrl($language, $this->session->user_id ? $this->session->user_id : $respId); + $user = $this->loader->getCurrentUser(); + $url = $token->getUrl($language, $user->getUserId() ? $user->getUserId() : $respId); /************************ * Optional user logout * ************************/ - if (isset($this->session->user_logout) && $this->session->user_logout) { - $this->escort->afterLogout(); + if ($user->isLogoutOnSurvey()) { + $user->unsetAsCurrentUser(); } /*********************************** Modified: trunk/library/classes/Gems/Default/CronAction.php =================================================================== --- trunk/library/classes/Gems/Default/CronAction.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Default/CronAction.php 2011-11-14 12:53:50 UTC (rev 208) @@ -26,17 +26,23 @@ * (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 Michiel Rook <mi...@to...> - * @package Gems + * + * @author Michiel Rook <mi...@to...> + * @package Gems * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** * Performs bulk-mail action, can be called from a cronjob * - * @author Michiel Rook <mi...@to...> - * @package Gems + * @package Gems * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4 */ class Gems_Default_CronAction extends MUtil_Controller_Action { @@ -69,6 +75,12 @@ /** * + * @var Gems_Loader + */ + public $loader; + + /** + * * @var Gems_Menu */ public $menu; @@ -125,7 +137,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 gsf_login FROM gems__staff WHERE gsf_id_user = ?", $userId); } public function indexAction() @@ -141,112 +153,78 @@ public function mailJob() { - // Test: update `gems__tokens` set `gto_mail_sent_date` = null where `gto_mail_sent_date` > '2011-10-23' + $userLoader = $this->loader->getUserLoader(); + $startUser = $userLoader->getCurrentUser(); + $user = $startUser; - $currentUser = isset($this->session->user_login) ? $this->session->user_login : null; - $model = $this->loader->getTracker()->getTokenModel(); $mailer = new Gems_Email_TemplateMailer($this->escort); + // $mailer->setDefaultTransport(new MUtil_Mail_Transport_EchoLog()); $jobs = $this->db->fetchAll("SELECT * FROM gems__mail_jobs WHERE gmj_active = 1"); if ($jobs) { foreach ($jobs as $job) { - $this->escort->loadLoginInfo($this->getUserLogin($job['gmj_id_user_as'])); - - // Set up filter - $filter = $this->defaultFilter; - if ($job['gmj_filter_mode'] == 'R') { - $filter[] = 'gto_mail_sent_date <= DATE_SUB(CURRENT_DATE, INTERVAL ' . $job['gmj_filter_days_between'] . ' DAY)'; - } else { - $filter['gto_mail_sent_date'] = NULL; + if ($user->getUserId() != $job['gmj_id_user_as']) { + $user = $userLoader->getUserByStaffId($job['gmj_id_user_as']); } - if ($job['gmj_id_organization']) { - $filter['gto_id_organization'] = $job['gmj_id_organization']; - } - if ($job['gmj_id_track']) { - $filter['gto_id_track'] = $job['gmj_id_track']; - } - if ($job['gmj_id_survey']) { - $filter['gto_id_survey'] = $job['gmj_id_survey']; - } - $tokensData = $model->load($filter); + if ($user->isActive()) { + if (! $user->isCurrentUser()) { + $user->setAsCurrentUser(); + } - if (count($tokensData)) { - $mailer->setMethod($job['gmj_process_method']); - if ($job['gmj_from_method'] == 'F') { - $mailer->setFrom($job['gmj_from_fixed']); + // Set up filter + $filter = $this->defaultFilter; + if ($job['gmj_filter_mode'] == 'R') { + $filter[] = 'gto_mail_sent_date <= DATE_SUB(CURRENT_DATE, INTERVAL ' . $job['gmj_filter_days_between'] . ' DAY)'; } else { - $mailer->setFrom($job['gmj_from_method']); + $filter['gto_mail_sent_date'] = NULL; } + if ($job['gmj_id_organization']) { + $filter['gto_id_organization'] = $job['gmj_id_organization']; + } + if ($job['gmj_id_track']) { + $filter['gto_id_track'] = $job['gmj_id_track']; + } + if ($job['gmj_id_survey']) { + $filter['gto_id_survey'] = $job['gmj_id_survey']; + } - $templateData = $this->getTemplate($job['gmj_id_message']); - $mailer->setSubject($templateData['gmt_subject']); - $mailer->setBody($templateData['gmt_body']); + $tokensData = $model->load($filter); - $mailer->setTokens(MUtil_Ra::column('gto_id_token', $tokensData)); - $mailer->process($tokensData); - } + if (count($tokensData)) { + $mailer->setMethod($job['gmj_process_method']); + if ($job['gmj_from_method'] == 'F') { + $mailer->setFrom($job['gmj_from_fixed']); + } else { + $mailer->setFrom($job['gmj_from_method']); + } - Gems_Auth::getInstance()->clearIdentity(); - $this->escort->session->unsetAll(); + $templateData = $this->getTemplate($job['gmj_id_message']); + $mailer->setSubject($templateData['gmt_subject']); + $mailer->setBody($templateData['gmt_body']); + + $mailer->setTokens(MUtil_Ra::column('gto_id_token', $tokensData)); + $mailer->process($tokensData); + } + } } } $msg = $mailer->getMessages(); if (! $msg) { - $msg[] = $this->_('No mails sent'); + $msg[] = $this->_('No mails sent.'); } - - $this->html->append($msg); - - if ($currentUser) { - $this->escort->loadLoginInfo($currentUser); - } else { - $this->escort->afterLogout(); + if ($mailer->bounceCheck()) { + array_unshift($msg, $this->_('On this test system all mail will be delivered to the from address.')); } - /* - if (isset($this->project->email['automatic'])) { - $batches = $this->project->email['automatic']; - $numBatches = count($batches['mode']); + $this->addMessage($msg); - for ($i = 0; $i < $numBatches; $i++) { - $this->_organizationId = $batches['organization'][$i]; - - if (isset($batches['days'][$i])) { - $this->_intervalDays = $batches['days'][$i]; - } - - $this->escort->loadLoginInfo($batches['user'][$i]); - - $model->setFilter($this->getFilter($batches['mode'][$i])); - - $tokensData = $model->load(); - - if (count($tokensData)) { - $tokens = array(); - - foreach ($tokensData as $tokenData) { - $tokens[] = $tokenData['gto_id_token']; - } - - $templateData = $this->getTemplate($batches['template'][$i]); - $mailer->setSubject($templateData['gmt_subject']); - $mailer->setBody($templateData['gmt_body']); - $mailer->setMethod($batches['method'][$i]); - $mailer->setFrom($batches['from'][$i]); - $mailer->setTokens($tokens); - - $mailer->process($tokensData); - } - - Gems_Auth::getInstance()->clearIdentity(); - $this->escort->session->unsetAll(); - } + if (! $startUser->isCurrentUser()) { + $startUser->setAsCurrentUser(); } - // */ } } \ No newline at end of file Modified: trunk/library/classes/Gems/Default/ExportAction.php =================================================================== --- trunk/library/classes/Gems/Default/ExportAction.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Default/ExportAction.php 2011-11-14 12:53:50 UTC (rev 208) @@ -144,7 +144,7 @@ { //Read some data from tables, initialize defaults... $surveys = $this->db->fetchPairs('SELECT gsu_id_survey, gsu_survey_name FROM gems__surveys WHERE gsu_active = 1 ORDER BY gsu_survey_name'); - $organizations = $this->escort->getAllowedOrganizations(); + $organizations = $this->loader->getCurrentUser()->getAllowedOrganizations(); $types = $this->export->getExportClasses(); //Create the basic form @@ -230,7 +230,7 @@ $answerModel = $survey->getAnswerModel($language); //Now add the organization id => name mapping - $answerModel->set('organizationid', 'multiOptions', $this->escort->getAllowedOrganizations()); + $answerModel->set('organizationid', 'multiOptions', $this->loader->getCurrentUser()->getAllowedOrganizations()); if (count($answers) === 0) { $answers[0] = array('' => sprintf($this->_('No %s found.'), $this->getTopic(0))); Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-11-14 12:53:50 UTC (rev 208) @@ -66,37 +66,94 @@ public $menu; /** - * Extension point, use different auth adapter if needed depending on the provided formValues + * @var Gems_Project_ProjectSettings + */ + public $project; + + /** + * Returns a link for the token input page. * - * This could be an organization passed in the login-form or something else. + * @return MUtil_Form_Element_Html + */ + protected function _getAskTokenLinkElement() + { + // Veld token + $element = new MUtil_Form_Element_Html('askToken'); + $element->br(); + $element->actionLink(array('controller' => 'ask', 'action' => 'token'), $this->_('Enter your token...')); + + return $element; + } + + /** + * Returns a basic form for this action. * - * @param array $formValues - * @return Zend_Auth_Adapter_Interface + * @param $description Optional description, %s is filled with project name. + * @return Gems_Form */ - protected function _getAuthAdapter($formValues) { - $adapter = new Zend_Auth_Adapter_DbTable($this->db, 'gems__users', 'gsu_login', 'gsu_password'); - $adapter->setIdentity($formValues['userlogin']); - $adapter->setCredential($this->escort->passwordHash(null, $formValues['password'], false)); - return $adapter; + protected function _getBasicForm($description = null) + { + Gems_Html::init(); + + $form = new Gems_Form(array('labelWidthFactor' => $this->labelWidthFactor)); + $form->setMethod('post'); + if ($description) { + $form->setDescription(sprintf($description, $this->project->getName())); + } + + return $form; } /** - * New version of login form + * Returns an element for keeping a reset key. * + * @return Zend_Form_Element_Hidden + */ + protected function _getKeyElement() + { + return new Zend_Form_Element_Hidden('key'); + } + + /** + * Returns a login form + * * @return Gems_Form */ protected function _getLoginForm() { - Gems_Html::init(); + $form = $this->_getBasicForm($this->_('Login to %s application')); + $form->addElement($this->_getOrganizationElement()); + $form->addElement($this->_getUserLoginElement()); + $form->addElement($this->_getPasswordElement()); + $form->addElement($this->_getSubmitButton($this->_('Login'))); + $form->addElement($this->_getAskTokenLinkElement()); + $form->addElement($this->_getResetLinkElement()); - $this->track[] = 'Get login form.'; + return $form; + } - $delayFactor = (isset($this->project->account) && isset($this->project->account['delayFactor']) ? $this->project->account['delayFactor'] : null); + /** + * Returns a link to the login page + * + * @return MUtil_Form_Element_Html + */ + protected function _getLoginLinkElement() + { + // Reset password + $element = new MUtil_Form_Element_Html('resetPassword'); + $element->br(); + $element->actionLink(array('controller' => 'index', 'action' => 'login'), $this->_('Back to login')); - $form = new Gems_Form(array('labelWidthFactor' => $this->labelWidthFactor)); - $form->setMethod('post'); - $form->setDescription(sprintf($this->_('Login to %s application'), $this->project->name)); + return $element; + } + /** + * Returns an element for determining / selecting the organization. + * + * @return Zend_Form_Element_Xhtml + */ + protected function _getOrganizationElement() + { if ($this->escort instanceof Gems_Project_Organization_SingleOrganizationInterface) { $element = new Zend_Form_Element_Hidden('organization'); $element->setValue($this->escort->getRespondentOrganization()); @@ -110,56 +167,106 @@ $element->setValue($this->escort->getCurrentOrganization()); } } - $form->addElement($element); - // Veld inlognaam - $element = new Zend_Form_Element_Text('userlogin'); - $element->setLabel($this->_('Username')); - $element->setAttrib('size', 10); - $element->setAttrib('maxlength', 20); - $element->setRequired(true); - $form->addElement($element); + return $element; + } + /** + * Returns a password element. + * + * @return Zend_Form_Element_Password + */ + protected function _getPasswordElement() + { // Veld password $element = new Zend_Form_Element_Password('password'); $element->setLabel($this->_('Password')); $element->setAttrib('size', 10); $element->setAttrib('maxlength', 20); $element->setRequired(true); - //$element->addValidator(new Gems_Validate_GemsPasswordUsername('userlogin', 'password', $this->db, $delayFactor)); - $form->addElement($element); + $element->addValidator(new Gems_User_LoginPasswordValidator($this->loader->getUserLoader(), 'userlogin', 'organization', $this->translate)); - // Submit knop - $element = new Zend_Form_Element_Submit('button'); - $element->setLabel($this->_('Login')); - $element->setAttrib('class', 'button'); - $form->addElement($element); + return $element; + } - // Veld token - $element = new MUtil_Form_Element_Html('askToken'); - $element->br(); - $element->actionLink(array('controller' => 'ask', 'action' => 'token'), $this->_('Enter your token...')); - $form->addElement($element); + /** + * Gets a reset password form. + * + * @return Gems_Form + */ + protected function _getResetForm() + { + $form = $this->_getBasicForm($this->_('Reset password for %s application')); + $form->addElement($this->_getKeyElement()); + $form->addElement($this->_getOrganizationElement()); + $form->addElement($this->_getUserLoginElement()); + $form->addElement($this->_getSubmitButton($this->_('Reset password'))); + $form->addElement($this->_getLoginLinkElement()); + return $form; + } + + /** + * Returns a link to the reset password page + * + * @return MUtil_Form_Element_Html + */ + protected function _getResetLinkElement() + { // Reset password $element = new MUtil_Form_Element_Html('resetPassword'); $element->br(); $element->actionLink(array('controller' => 'index', 'action' => 'resetpassword'), $this->_('Lost password')); - $form->addElement($element); - return $form; + return $element; } - // Dummy: always rerouted by GemsEscort + /** + * Returns a submit button. + * + * @param string $label + * @return Zend_Form_Element_Submit + */ + protected function _getSubmitButton($label) + { + // Submit knop + $element = new Zend_Form_Element_Submit('button'); + $element->setLabel($label); + $element->setAttrib('class', 'button'); + + return $element; + } + + /** + * Returns a login name element. + * + * @return Zend_Form_Element_Text + */ + protected function _getUserLoginElement() + { + // Veld inlognaam + $element = new Zend_Form_Element_Text('userlogin'); + $element->setLabel($this->_('Username')); + $element->setAttrib('size', 10); + $element->setAttrib('maxlength', 20); + $element->setRequired(true); + + return $element; + } + + /** + * Dummy: always rerouted by GemsEscort + */ public function indexAction() { } + /** + * Default login page + */ public function loginAction() { - /** - * If already logged in, try to redirect to the first allowed and visible menu item - * if that fails, try to reroute to respondent/index - */ - if (isset($this->session->user_id)) { + // If already logged in, try to redirect to the first allowed and visible menu item + // if that fails, try to reroute to respondent/index + if ($this->loader->getCurrentUser()->isActive()) { if ($menuItem = $this->menu->findFirst(array('allowed' => true, 'visible' => true))) { $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector'); $redirector->gotoRoute($menuItem->toRouteUrl($this->getRequest())); @@ -167,87 +274,33 @@ $this->_reroute(array('controller' => 'respondent', 'action'=>'index')); } } - // MUtil_Echo::track(get_class($this->loader->getUser('super', null))); $form = $this->_getLoginForm(); - if ($this->_request->isPost()) { - if ($form->isValid($_POST, false)) { - /* - if ($user = $this->loader->getUser($_POST['userlogin'], $_POST['organization'])) { + $request = $this->getRequest(); + if ($request->isPost()) { + if ($form->isValid($request->getPost(), false)) { - } // */ + $user = $this->loader->getUser($request->getParam('userlogin'), $request->getParam('organization')); - if (isset($this->project->admin) && $this->project->admin['user'] == $_POST['userlogin'] && $this->project->admin['pwd'] == $_POST['password']) { - $this->session->user_id = 2000; - $this->session->user_name = $_POST['userlogin']; - $this->session->user_group = 800; - $this->session->user_role = 'master'; - $this->session->user_organization_id = 70; - $this->session->user_organization_name = 'SUPER ADMIN'; - $this->session->user_style = 'gems'; - //Als er nog geen tabellen zijn, moet dit ingesteld worden - //@@TODO Nog kijken hoe beter op te lossen (met try op tabel ofzo) - $this->session->allowedOrgs = array($this->session->user_organization_id=>$this->session->user_organization_name); + if ($user->isActive()) { + $user->setAsCurrentUser(); /** - * Ready + * Fix current locale / organization in cookies */ - $this->addMessage(sprintf($this->_('Login successful, welcome %s.'), $this->session->user_name)); - $this->_reroute(array('controller' => 'database', 'action' => 'index'), true); - return; - } - //Now check authentication - $adapter = $this->_getAuthAdapter($form->getValues()); - $auth = Gems_Auth::getInstance(); - $result = $auth->authenticate($adapter, $_POST['userlogin']); + Gems_Cookies::setLocale($user->getLocale(), $this->basepath->getBasePath()); + Gems_Cookies::setOrganization($user->getOrganizationId(), $this->basepath->getBasePath()); - // 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']))) { - - $adapter = new Zend_Auth_Adapter_DbTable($this->db, 'gems__staff', 'gsf_id_user', 'gsf_password'); - $adapter->setIdentity($userid); - $adapter->setCredential(md5($_POST['password'], false)); - $result = $auth->authenticate($adapter, $_POST['userlogin']); - // MUtil_Echo::track('old autho'); - } else { - // MUtil_Echo::track('new autho'); - } - - if (!$result->isValid()) { - // Invalid credentials - $errors = $result->getMessages(); - $this->addMessage($errors); - $code = $result->getCode(); - if ($code != Gems_Auth::ERROR_PASSWORD_DELAY) { - $this->escort->afterFailedLogin(); - } - - $this->view->form = $form; - } else { - // Load login data - $this->escort->loadLoginInfo($_POST['userlogin']); - /** - * Perform any project specific post login activities - */ - $this->escort->afterLogin($_POST['userlogin']); - - /** - * Fix current locale & organization - */ - Gems_Cookies::setLocale($this->session->user_locale, $this->basepath->getBasePath()); - Gems_Cookies::setOrganization($this->session->user_organization_id, $this->basepath->getBasePath()); - - /** * Ready */ - $this->addMessage(sprintf($this->_('Login successful, welcome %s.'), $this->session->user_name)); + $this->addMessage(sprintf($this->_('Login successful, welcome %s.'), $user->getFullName())); /** * Log the login */ - Gems_AccessLog::getLog($this->db)->log("index.login", $this->getRequest(), null, $this->session->user_id, true); + Gems_AccessLog::getLog($this->db)->log("index.login", $this->getRequest(), null, $user->getUserId(), true); if ($previousRequestParameters = $this->session->previousRequestParameters) { $this->_reroute(array('controller' => $previousRequestParameters['controller'], 'action' => $previousRequestParameters['action']), false); @@ -255,116 +308,87 @@ // This reroutes to the first available menu page after login $this->_reroute(array('controller' => null, 'action' => null), true); } + return; } } else { $errors = $form->getErrors(); - - $this->view->form = $form; } - } else { - $this->view->form = $form; } + $this->view->form = $form; } + /** + * Default logoff action + */ public function logoffAction() { - $this->addMessage($this->_('Good bye: ') . $this->session->user_name); - Gems_Auth::getInstance()->clearIdentity(); - $this->escort->afterLogout(); + $user = $this->loader->getCurrentUser(); + + $this->addMessage(sprintf($this->_('Good bye: %s.'), $user->getFullName())); + $user->unsetAsCurrentUser(); $this->_reroute(array('action' => 'index'), true); } - protected function _getResetForm() - { - $form = new Gems_Form(array('labelWidthFactor' => $this->labelWidthFactor)); - $form->setMethod('post'); - $form->setDescription(sprintf($this->_('Reset password for %s application'), $this->project->name)); - - // Veld inlognaam - $element = new Zend_Form_Element_Text('userlogin'); - $element->setLabel($this->_('Username')); - $element->setAttrib('size', 10); - $element->setAttrib('maxlength', 20); - $element->setRequired(true); - $form->addElement($element); - - // Submit knop - $element = new Zend_Form_Element_Submit('button'); - $element->setLabel($this->_('Reset password')); - $element->setAttrib('class', 'button'); - $form->addElement($element); - - return $form; - } - + /** + * Reset password page. + */ public function resetpasswordAction() { $this->view->setScriptPath(GEMS_LIBRARY_DIR . '/views/scripts' ); + $request = $this->getRequest(); $form = $this->_getResetForm(); - $mail = new MUtil_Mail(); - $mail->setFrom('no...@er...'); + if ($request->isPost() && $form->isValid($request->getPost())) { - if (isset($this->escort->project->email) && isset($this->escort->project->email['bcc'])) { - $mail->addBcc($this->escort->project->email['bcc']); - } + $user = $this->loader->getUser($request->getParam('userlogin'), $request->getParam('organization')); - 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']); - $result = $this->db->fetchRow($sql); + If ($user->canResetPassword()) { + if ($key = $request->getParam('key')) { + // Key has been passed by mail + if ($user->checkPasswordResetKey($key)) { + $user->setPasswordResetRequired(true); + $user->setAsCurrentUser(); + $this->addMessage($this->_('Reset accepted, enter your new password.')); + $user->gotoStartPage($this->menu, $request); + return; + } else { + $this->addMessage($this->_('This key timed out or does not belong to this user.')); + } + } else { + // P{ass mail by key + $mail = new MUtil_Mail(); + $mail->setFrom('mj...@ma...'); + $mail->addTo($user->getEmailAddress(), $user->getFullName()); - 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) { - $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); + if (isset($this->escort->project->email) && isset($this->escort->project->email['bcc'])) { + $mail->addBcc($this->escort->project->email['bcc']); + } - $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']); - $mail->setSubject('Password reset requested'); - $mail->setBodyText('To reset your password, please click this link: ' . $url); + $key = $user->getPasswordResetKey(); - $mail->addTo($email); + $url = $this->util->getCurrentURI('index/resetpassword/key/' . $key); - try { - $mail->send(); - $this->addMessage($this->_('Follow the instructions in the e-mail')); - } catch (Exception $e) { - $this->addMessage($this->_('Unable to send e-mail')); - throw $e; - } - } - } 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); - $result = $this->db->fetchRow($sql); + $mail->setSubject($this->_('Password reset requested')); + $mail->setBodyText(sprintf($this->_('To reset your password for %s, please click this link: %s'), GEMS_PROJECT_NAME_UC, $url)); - if (!empty($result)) { - // generate new password - $password = $this->escort->getRandomPassword(); - $passwordHash = $this->escort->passwordHash(null, $password, false); - $mail->setSubject('New password'); - $mail->setBodyText('Your new password has been generated. Your new password is: ' . $password); - - $mail->addTo($result['gsf_email']); - - 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->_reroute(array('action' => 'index'), true); - } catch (Exception $e) { - $this->addMessage($this->_('Unable to send e-mail')); - throw $e; + try { + $mail->send(); + $this->addMessage($this->_('We sent you an e-mail with a reset link. Click on the link in the e-mail.')); + } catch (Exception $e) { + $this->addMessage($this->_('Unable to send e-mail.')); + throw $e; + } } } else { - $this->addMessage($this->_('Unknown request')); + $this->addMessage($this->_('No such user found or no e-mail address known or user cannot be reset.')); } } - + if ($request->getParam('key')) { + $this->addMessage($this->_('We received your password reset key.')); + $this->addMessage($this->_('Please enter the organization and username belonging to this key.')); + } $this->view->form = $form; } } Modified: trunk/library/classes/Gems/Default/OptionAction.php =================================================================== --- trunk/library/classes/Gems/Default/OptionAction.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Default/OptionAction.php 2011-11-14 12:53:50 UTC (rev 208) @@ -1,6 +1,5 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -26,60 +25,52 @@ * 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 Gems + * + * @package Gems * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** * - * @author Matijs de Jong - * @package Gems + * @package Gems * @subpackage Default + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ class Gems_Default_OptionAction extends Gems_Controller_BrowseEditAction { public $autoFilter = false; /** - * Adds elements from the model to the bridge that creates the form. * - * Overrule this function to add different elements to the browse table, without - * having to recode the core table building code. - * - * @param MUtil_Model_FormBridge $bridge - * @param MUtil_Model_ModelAbstract $model - * @param array $data The data that will later be loaded into the form - * @param optional boolean $new Form should be for a new element - * @return void|array When an array of new values is return, these are used to update the $data array in the calling function + * @var Gems_Project_ProjectSettings */ - 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( 'gsf_id_user'); - $bridge->addExhibitor('gsu_login', array('size' => 15, 'minlength' => 4)); - $bridge->addText( 'gsf_first_name'); - $bridge->addText( 'gsf_surname_prefix'); - $bridge->addText( 'gsf_last_name'); - $bridge->addText( 'gsf_email', array('size' => 30)); + public $project; - $bridge->addRadio( 'gsf_gender', 'separator', ''); - - $bridge->addSelect( 'gsf_iso_lang', array('label' => $this->_('Language'), 'multiOptions' => $this->util->getLocalized()->getLanguages())); - } - + /** + * Hook to perform action after a record (with changes) was saved + * + * As the data was already saved, it can NOT be changed anymore + * + * @param array $data + * @param boolean $isNew + * @return boolean True when you want to display the default 'saved' messages + */ public function afterSave(array $data, $isNew) { - $this->escort->loadLoginInfo($data['gsu_login']); + // Reload the current user data + $this->loader->getUser($data['gsf_login'], $data['gsf_id_organization']); } + /** + * Allow a user to change his / her password. + */ public function changePasswordAction() { /************* @@ -87,20 +78,31 @@ *************/ $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 = ?"; - if ($this->db->fetchOne($sql, array($this->session->user_id, $this->session->user_organization_id))) { - // Veld current password + $user = $this->loader->getCurrentUser(); + + if (! $user->canSetPassword()) { + $this->addMessage($this->_('You are not allowed to change your password.')); + return; + } + + if ($user->isPasswordResetRequired()) { + $this->menu->setVisible(false); + } elseif ($user->hasPassword()) { + // Field current password + // + // This is only used when the password is already set, which may not always be the case + // e.g. when using embedded login in Pulse. $element = new Zend_Form_Element_Password('old_password'); $element->setLabel($this->_('Current password')); $element->setAttrib('size', 10); $element->setAttrib('maxlength', 20); $element->setRenderPassword(true); $element->setRequired(true); - $element->addValidator(new Gems_Validate_GemsPasswordUsername($this->session->user_login, 'old_password', $this->db)); + $element->addValidator(new Gems_User_UserPasswordValidator($user, $this->translate)); $form->addElement($element); } - // Veld new password + // Field new password $element = new Zend_Form_Element_Password('new_password'); $element->setLabel($this->_('New password')); $element->setAttrib('size', 10); @@ -111,7 +113,7 @@ $element->addValidator(new MUtil_Validate_IsConfirmed('repeat_password', $this->_('Repeat password'))); $form->addElement($element); - // Veld repeat password + // Field repeat password $element = new Zend_Form_Element_Password('repeat_password'); $element->setLabel($this->_('Repeat password')); $element->setAttrib('size', 10); @@ -130,21 +132,10 @@ * Process form * ****************/ if ($this->_request->isPost() && $form->isValid($_POST)) { + $user->setPassword($_POST['new_password']); - $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']); - - $this->getModel()->save($data); - - // $data = $_POST; - // $data['name'] = ''; - // $data['type'] = $this->_('raw'); - - // $results = array(); - // $this->_runScript($data, $results); $this->addMessage($this->_('New password is active.')); - $this->afterSaveRoute($this->getRequest()); + $this->_reroute(array($this->getRequest()->getActionKey() => 'edit')); } else { if (isset($_POST['old_password'])) { @@ -162,7 +153,7 @@ $table->setAsFormLayout($form, true, true); $table['tbody'][0][0]->class = 'label'; // Is only one row with formLayout, so all in output fields get class. - if ($links = $this->createMenuLinks()) { + if (! $user->isPasswordResetRequired() && ($links = $this->createMenuLinks())) { $table->tf(); // Add empty cell, no label $linksCell = $table->tf($links); } @@ -185,23 +176,23 @@ */ public function createModel($detailed, $action) { - $model = new Gems_Model_UserModel('staff', 'gems__staff', array('gsu_id_user' => 'gsf_id_user'), 'gsf'); - $model->copyKeys(); + $model = $this->loader->getModels()->getStaffModel(); - $model->set('gsu_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...'); - $model->set('gsf_last_name', 'label', $this->_('Last name'), 'required', true); + $model->set('gsf_login', 'label', $this->_('Login Name'), 'elementClass', 'Exhibitor'); + $model->set('gsf_email', 'label', $this->_('E-Mail'), 'size', 30); + $model->set('gsf_first_name', 'label', $this->_('First name')); + $model->set('gsf_surname_prefix', 'label', $this->_('Surname prefix'), 'description', 'de, van der, \'t, etc...'); + $model->set('gsf_last_name', 'label', $this->_('Last name'), 'required', true); + $model->set('gsf_gender', 'label', $this->_('Gender'), 'multiOptions', $this->util->getTranslated()->getGenders(), + 'elementClass', 'Radio', 'separator', ''); + $model->set('gsf_iso_lang', 'label', $this->_('Language'), 'multiOptions', $this->util->getLocalized()->getLanguages()); - $model->set('gsf_gender', 'label', $this->_('Gender'), 'multiOptions', $this->util->getTranslated()->getGenders()); - return $model; } public function editAction() { - $this->getModel()->setFilter(array('gsu_id_user' => $this->session->user_id)); + $this->getModel()->setFilter(array('gsf_id_user' => $this->loader->getCurrentUser()->getUserId())); if ($form = $this->processForm()) { $this->html->h3(sprintf($this->_('Options'), $this->getTopic())); @@ -222,7 +213,7 @@ WHERE glac.glac_name = 'index.login' ORDER BY glua.glua_created DESC LIMIT 10"; - $activity = $this->db->fetchAll($sql, $this->session->user_id); + $activity = $this->db->fetchAll($sql, $this->loader->getCurrentUser()->getUserId()); foreach (array_keys($activity) as $key) { $date = new MUtil_Date($activity[$key]['glua_created']); Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-14 12:53:50 UTC (rev 208) @@ -50,7 +50,7 @@ $url = base64_decode($request->getParam('current_uri')); $oldOrgId = $this->session->user_organization_id; - $allowedOrganizations = $this->escort->getAllowedOrganizations(); + $allowedOrganizations = $this->loader->getCurrentUser()->getAllowedOrganizations(); if ($orgId = array_search($org, $allowedOrganizations)) { $this->session->user_organization_id = $orgId; $this->session->user_organization_name = $allowedOrganizations[$orgId]; Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-14 12:53:50 UTC (rev 208) @@ -316,26 +316,6 @@ $this->html[] = $form; } - public function getPhysicians() - { - $session = new Zend_Session_Namespace('Pulse_' . __FILE__); - - if (! isset($session->physicians)) { - $organizationId = $this->escort->getCurrentOrganization(); - - $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' - ORDER BY 2", $organizationId); - - $session->physicians = $values; - } - - return $this->util->getTranslated()->getEmptyDropdownArray() + $session->physicians; - } - public function getMenuParameter($name, $default) { switch ($name) { Modified: trunk/library/classes/Gems/Default/StaffAction.php =================================================================== --- trunk/library/classes/Gems/Default/StaffAction.php 2011-11-14 12:43:05 UTC (rev 207) +++ trunk/library/classes/Gems/Default/StaffAction.php 2011-11-14 12:53:50 UTC (rev 208) @@ -44,7 +44,9 @@ */ class Gems_Default_StaffAction extends Gems_Controller_BrowseEditAction { - public $filterStandard = array('gsu_active' => 1); + public $defaultStaffDefinition = Gems_User_UserLoader::USER_STAFF; + + public $filterStandard = array('gsf_active' => 1); public $sortKey = array('name' => SORT_ASC); protected $_instanceId; @@ -92,39 +94,58 @@ { $dbLookup = $this->util->getDbLookup(); + switch ($data['gul_user_class']) { + case Gems_User_UserLoader::USER_STAFF: + Gems_Model::addUserPassword($model); + $passwordField = 'gup_password'; + $model->setOnSave($passwordField, array($this->project, 'getValueHashForModel')); + break; + + case Gems_User_UserLoader::USER_OLD_STAFF: + $passwordField = 'gsf_password'; + $model->setOnSave($passwordField, array($this, 'getOldPasswordHash')); + break; + + default: + $passwordField = false; + break; + } + $model->set('gsf_id_primary_group', 'multiOptions', MUtil_Lazy::call($dbLookup->getAllowedStaffGroups)); 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'); + } elseif ($passwordField) { + $model->set($passwordField, 'description', $this->_('Enter only when changing')); + $model->setSaveWhenNotNull($passwordField); } - $model->setOnSave('gsu_password', array($this->escort, 'passwordHash')); $ucfirst = new Zend_Filter_Callback('ucfirst'); - $bridge->addHidden( 'gsu_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', array('gsu_id_user'))); + $bridge->addHidden( 'gsf_id_user'); + $bridge->addHidden( 'gul_id_user'); + $bridge->addHidden( 'gup_id_user'); + $bridge->addHidden( 'gul_user_class'); + $bridge->addText( 'gsf_login', 'size', 15, 'minlength', 4, + 'validator', $model->createUniqueValidator('gsf_login', array('gsf_id_user'))); // 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('gsf_id_organization')); + $bridge->addSelect('gsf_id_organization'); } else { - $bridge->addExhibitor('gsu_id_organization'); + $bridge->addExhibitor('gsf_id_organization'); } - $bridge->addPassword('gsu_password', - 'label', $this->_('Password'), - 'minlength', $this->project->passwords['MinimumLength'], - // 'renderPassword', true, - 'repeatLabel', $this->_('Repeat password'), - 'required', $new, - 'size', 15 - ); + if ($passwordField) { + $bridge->addPassword($passwordField, + 'label', $this->_('Password'), + 'minlength', $this->project->passwords['MinimumLength'], + // 'renderPassword', true, + 'repeatLabel', $this->_('Repeat password'), + 'required', $new, + 'size', 15 + ); + } $bridge->addRadio( 'gsf_gender', 'separator', ''); $bridge->addText( 'gsf_first_name', 'label', $this->_('First name')); $bridge->addFilter( 'gsf_first_name', $ucfirst); @@ -141,15 +162,15 @@ public function afterFormLoad(array &$data, $isNew) { - if (array_key_exists('gsu_login', $data)) { - $this->_instanceId = $data['gsu_login']; + if (array_key_exists('glf_login', $data)) { + $this->_instanceId = $data['gsf_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['gsf_id_organization'] == $this->escort->getCurrentOrganization())) { throw new Zend_Exception($this->_('You are not allowed to edit this staff member.')); } } @@ -169,21 +190,17 @@ { // MUtil_Model::$verbose = true; - $model = new Gems_Model_UserModel('staff', 'gems__staff', array('gsu_id_user' => 'gsf_id_user'), 'gsf'); - if ($detailed) { - $model->copyKeys(); - } - //$model->resetOrder(); + $model = $this->loader->getModels()->getStaffModel(); - $model->set('gsu_login', 'label', $this->_('Login')); + $model->set('gsf_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('gsf_id_organization', $this->escort->getCurrentOrganization()); - $model->set('gsu_id_organization', 'label', $this->_('Organization'), + $model->set('gsf_id_organization', 'label', $this->_('Organization'), 'multiOptions', $this->util->getDbLookup()->getOrganizations(), 'default', $this->escort->getCurrentOrganization()); } @@ -192,12 +209,12 @@ $model->set('gsf_gender', 'label', $this->_('Gender'), 'multiOptions', $this->util->getTranslated()->getGenders()); if ($detailed) { - $model->set('gsu_user_class', 'default', 'StaffUser'); + $model->set('gul_user_class', 'default', $this->defaultStaffDefinition); ... [truncated message content] |
From: <gem...@li...> - 2011-11-14 17:51:14
|
Revision: 213 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=213&view=rev Author: matijsdejong Date: 2011-11-14 17:51:04 +0000 (Mon, 14 Nov 2011) Log Message: ----------- Started on independent Organization object for #31 respondent login. User switch is performed on organization cookie instead of style cookie. Added a lot of documentation. Modified Paths: -------------- trunk/library/changelog.txt trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Loader.php trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php trunk/library/classes/Gems/Project/Layout/SingleLayoutInterface.php trunk/library/classes/Gems/Project/Log/LogRespondentAccessInterface.php trunk/library/classes/Gems/Project/Organization/MultiOrganizationInterface.php trunk/library/classes/Gems/Project/Organization/SingleOrganizationInterface.php trunk/library/classes/Gems/Project/Tracks/FixedTracksInterface.php trunk/library/classes/Gems/Project/Tracks/MultiTracksInterface.php trunk/library/classes/Gems/Project/Tracks/SingleTrackInterface.php trunk/library/classes/Gems/Project/Tracks/StandAloneSurveysInterface.php trunk/library/classes/Gems/Project/Tracks/TracksOnlyInterface.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/User/UserLoader.php trunk/library/classes/GemsEscort.php Added Paths: ----------- trunk/library/classes/Gems/User/Organization.php Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/changelog.txt 2011-11-14 17:51:04 UTC (rev 213) @@ -2,6 +2,7 @@ ============================================================ Passwords should be set with a project.ini->salt. Salt is now a required project setting! The table gems__staff is split into gems__staff, gems__user_logins with generic login data and gems__users_passwords containing db stored password information. +GemsEscort->afterLogin(), ->afterLogout() and ->loadLoginInfo(0 are now all handled by Gems_User_UserDefinitionInterface objects. The table gems__user_ids provides unique and non-sequential user ids accross gems__staff and gems__respondents. The gems__respondent.grs_bsn has been renamed to grs_ssn, to make the code more international. MailController is now called MailTemplateController. Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-11-14 17:51:04 UTC (rev 213) @@ -164,7 +164,7 @@ $element->setRequired(true); if (! $this->_request->isPost()) { - $element->setValue($this->escort->getCurrentOrganization()); + $element->setValue($this->loader->getCurrentUser()->getOrganizationId()); } } Modified: trunk/library/classes/Gems/Loader.php =================================================================== --- trunk/library/classes/Gems/Loader.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Loader.php 2011-11-14 17:51:04 UTC (rev 213) @@ -160,7 +160,20 @@ } /** + * Returns an organization object, initiated from the database. * + * @param int $organizationId Optional, uses current user when empty + * @return Gems_User_Organization + */ + public function getOrganization($organizationId = null) + { + $loader = $this->getUserLoader(); + + return $loader->getOrganization($organizationId); + } + + /** + * * @return Gems_Pdf */ public function getPdf() Modified: trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,34 +1,41 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects using only multi layout * * But Gems_Project_Layout_MultiLayoutAbstract implements the functionality to use these functions. @@ -37,14 +44,25 @@ * * @see Gems_Project_Layout_SingleLayoutInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Layout_MultiLayoutInterface { + /** + * Returns an array with descriptions of the styles that can be used in this project. + * + * @return array styleKey => styleDescription + */ public function getStyles(); - public function layoutSwitch(Zend_Controller_Request_Abstract $request, $settings); + + /** + * Performs the actual switch of the layout + * + * @param Zend_Controller_Request_Abstract $request + */ + public function layoutSwitch(Zend_Controller_Request_Abstract $request); } \ No newline at end of file Modified: trunk/library/classes/Gems/Project/Layout/SingleLayoutInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Layout/SingleLayoutInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Layout/SingleLayoutInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,43 +1,50 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects using only a single layout * * @see Gems_Project_Layout_MultiLayoutInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Layout_SingleLayoutInterface { Modified: trunk/library/classes/Gems/Project/Log/LogRespondentAccessInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Log/LogRespondentAccessInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Log/LogRespondentAccessInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,41 +1,48 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects logging access to respondent data and their tokens * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Log_LogRespondentAccessInterface {} \ No newline at end of file Modified: trunk/library/classes/Gems/Project/Organization/MultiOrganizationInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Organization/MultiOrganizationInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Organization/MultiOrganizationInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,6 +1,5 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -26,6 +25,14 @@ * 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$ */ /** @@ -40,13 +47,12 @@ * * @see Gems_Project_Organization_SingleOrganizationInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Organization_MultiOrganizationInterface { - public function getUserOrganization(); } Modified: trunk/library/classes/Gems/Project/Organization/SingleOrganizationInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Organization/SingleOrganizationInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Organization/SingleOrganizationInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,34 +1,41 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects having respondents * in only one organization. * @@ -37,11 +44,11 @@ * * @see Gems_Project_Organization_MultiOrganizationInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Organization_SingleOrganizationInterface { Modified: trunk/library/classes/Gems/Project/Tracks/FixedTracksInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/FixedTracksInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/FixedTracksInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,45 +1,52 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects that use tracks that cannot be assigned by the user * (but are assigned by the system instead). * * @see Gems_Project_Tracks_MultiTracksInterface * @see Gems_Project_Tracks_SingleTrackInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_FixedTracksInterface { Modified: trunk/library/classes/Gems/Project/Tracks/MultiTracksInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/MultiTracksInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/MultiTracksInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,45 +1,52 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects that use tracks that be assigned at will by the user * to respondents. * * @see Gems_Project_Tracks_FixedTracksInterface * @see Gems_Project_Tracks_SingleTrackInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_MultiTracksInterface { Modified: trunk/library/classes/Gems/Project/Tracks/SingleTrackInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/SingleTrackInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/SingleTrackInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,33 +1,40 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + include_once('Gems/Project/Tracks/TracksOnlyInterface.php'); /** @@ -41,11 +48,11 @@ * @see Gems_Project_Tracks_FixedTracksInterface * @see Gems_Project_Tracks_MultiTracksInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_SingleTrackInterface extends Gems_Project_Tracks_TracksOnlyInterface { Modified: trunk/library/classes/Gems/Project/Tracks/StandAloneSurveysInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/StandAloneSurveysInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/StandAloneSurveysInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,44 +1,51 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects allowing single survey tracks * that are just shells for assinging a single survey. * * @see Gems_Project_Tracks_TracksOnlyInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_StandAloneSurveysInterface {} \ No newline at end of file Modified: trunk/library/classes/Gems/Project/Tracks/TracksOnlyInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/TracksOnlyInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/TracksOnlyInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,45 +1,52 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects NOT allowing the single survey tracks * allowed by Gems_Project_Tracks_StandAloneSurveysInterface (a nd that are just * shells for assinging a single survey). * * @see Gems_Project_Tracks_StandAloneSurveysInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_TracksOnlyInterface {} \ No newline at end of file Added: trunk/library/classes/Gems/User/Organization.php =================================================================== --- trunk/library/classes/Gems/User/Organization.php (rev 0) +++ trunk/library/classes/Gems/User/Organization.php 2011-11-14 17:51:04 UTC (rev 213) @@ -0,0 +1,76 @@ +<?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. + * + * + * @package Gems + * @subpackage User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * Contains information on the organization of the current User + * + * @see Gems_Useer_User + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_User_Organization +{ + /** + * + * @var array + */ + protected $_organizationData; + + /** + * Creates the organization object. + * + * @param array $organizationData + */ + public function __construct(array $organizationData) + { + $this->_organizationData = $organizationData; + } + + /** + * Get the style attribute. + * + * @return string + */ + public function getStyle() + { + return $this->_organizationData['gor_style']; + } +} Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/User/User.php 2011-11-14 17:51:04 UTC (rev 213) @@ -32,7 +32,7 @@ * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id$ + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ */ /** @@ -173,6 +173,22 @@ } /** + * Applies any setttings coming from the request object, e.g. processing cookies. + * + * @param Zend_Controller_Request_Abstract $request + * @return Gems_User_User (continuation pattern) + */ + public function applyRequest(Zend_Controller_Request_Abstract $request) + { + // MUtil_Echo::track($this->getOrganizationId(), Gems_Cookies::getOrganization($request)); + if (! $this->getOrganizationId()) { + $this->_setVar('user_organization_id', Gems_Cookies::getOrganization($request)); + } + + return $this; + } + + /** * Return true if a password reset key can be created. * * @return boolean Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/User/UserLoader.php 2011-11-14 17:51:04 UTC (rev 213) @@ -55,6 +55,20 @@ const USER_STAFF = 'StaffUser'; /** + * The default organization data for 'no organization'. + * + * @var array + */ + protected static $_noOrganization = array( + 'gor_id_organization' => 1, + 'gor_name' => 'NO ORGANIZATION', + 'gor_code' => null, + 'gor_style' => null, + 'gor_iso_lang' => 'en', + 'gor_active' => 0, + ); + + /** * 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. @@ -75,6 +89,12 @@ /** * + * @var Zend_Controller_Request_Abstract + */ + protected $request; + + /** + * * @var Zend_Session_Namespace */ protected $session; @@ -87,6 +107,13 @@ protected static $currentUser; /** + * Session storage of loaded organizations. + * + * @var Zend_Session_Namespace + */ + protected static $organizationStore; + + /** * Checks the password for the specified $login_name and $organization and * handles the login security. * @@ -209,6 +236,49 @@ } /** + * Returns an organization object, initiated from the database or from + * self::$_noOrganization when the database does not yet exist. + * + * @param int $organizationId Optional, uses current user when empty + * @return Gems_User_Organization + */ + public function getOrganization($organizationId = null) + { + if (! self::$organizationStore) { + self::$organizationStore = new Zend_Session_Namespace('gems.' . GEMS_PROJECT_NAME . '.organizations'); + } + + if (null === $organizationId) { + $organizationId = intval(self::$currentUser->getOrganizationId()); + } + + if (! self::$organizationStore->__isset($organizationId)) { + + // We are not sure the is a database at this moment + try { + $data = $this->db->fetchRow('SELECT * FROM gems__organizations WHERE gor_id_organization = ? LIMIT 1', $organizationId); + } catch (Zend_Db_Exception $e) { + $data = false; + } + if (! $data) { + // Use default + $data = self::$_noOrganization; + + // But do attempt to get the last added organization. + foreach (self::$organizationStore->getIterator() as $key => $value) { + if ($key !== 0) { + $organizationId = $key; + $data = self::$organizationStore->__get($key); + } + } + } + self::$organizationStore->__set($organizationId, $data); + } + + return new Gems_User_Organization(self::$organizationStore->__get($organizationId)); + } + + /** * Returns a user object, that may be empty if no user exist. * * @param string $login_name @@ -262,7 +332,9 @@ */ protected function getUserClassName($login_name, $organization) { - if (is_null($login_name) && is_null($organization)) return 'NoLoginDefinition'; + if ((null == $login_name) || (null == $organization)) { + return 'NoLoginDefinition'; + } if ($this->isProjectUser($login_name)) { return 'ProjectUserDefinition'; } Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/GemsEscort.php 2011-11-14 17:51:04 UTC (rev 213) @@ -89,7 +89,7 @@ $firebug = $application->getOption('firebug'); $this->_startFirebird = $firebug['log']; - + Zend_Session::start( array( 'name' => GEMS_PROJECT_NAME_UC . 'SESSID', @@ -1064,21 +1064,7 @@ */ public function getCurrentOrganization() { - /* - if ($this instanceof Gems_Project_Organization_MultiOrganizationInterface) { - return $this->getUserOrganization(); - } - - if ($this instanceof Gems_Project_Organization_SingleOrganizationInterface) { - return $this->getRespondentOrganization(); - } - */ - - if (isset($this->session->user_organization_id)) { - return $this->session->user_organization_id; - } else { - return Gems_Cookies::getOrganization(Zend_Controller_Front::getInstance()->getRequest()); - } + return $this->getLoader()->getCurrentUser()->getOrganizationId(); } /** @@ -1357,7 +1343,7 @@ public function prepareController() { if ($this instanceof Gems_Project_Layout_MultiLayoutInterface) { - $this->layoutSwitch($this->request, $this->session); + $this->layoutSwitch($this->request); } } @@ -1448,7 +1434,8 @@ public function routeShutdown(Zend_Controller_Request_Abstract $request) { $loader = $this->getLoader(); - $user = $loader->getCurrentUser(); + $user = $loader->getCurrentUser() + ->applyRequest($request); // MUtil_Echo::r($request->getParams(), 'params'); // MUtil_Echo::r($request->getUserParams(), 'userparams'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-18 09:11:19
|
Revision: 232 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=232&view=rev Author: mennodekker Date: 2011-11-18 09:11:12 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Fixed #42 - Failed logins should be logged Added extra info to the LogViewer in the detailed (show) action Modified Paths: -------------- trunk/library/classes/Gems/AccessLog.php trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Default/LogAction.php trunk/library/configs/db/patches.sql Modified: trunk/library/classes/Gems/AccessLog.php =================================================================== --- trunk/library/classes/Gems/AccessLog.php 2011-11-17 17:19:37 UTC (rev 231) +++ trunk/library/classes/Gems/AccessLog.php 2011-11-18 09:11:12 UTC (rev 232) @@ -1,39 +1,39 @@ <?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. + * * @version $Id$ * @package Gems * @subpackage AccessLog * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License */ - + /** * Logging class to log access to certaint controller/actions * @@ -177,7 +177,7 @@ try { //When project escort doesn't implement the log interface, we disable logging if (!(GemsEscort::getInstance() instanceof Gems_Project_Log_LogRespondentAccessInterface) - || ! isset($this->_userInfo->user_id)) { + || (!isset($this->_userInfo->user_id) && $force === false ) ) { return $this; } @@ -191,12 +191,12 @@ $values['glua_to'] = $respondentId; $values['glua_message'] = $message; - $values['glua_by'] = $this->_userInfo->user_id; - $values['glua_organization'] = $this->_userInfo->user_organization_id; + $values['glua_by'] = $this->_userInfo->user_id ? $this->_userInfo->user_id : 0; + $values['glua_organization'] = $this->_userInfo->user_organization_id ? $this->_userInfo->user_organization_id : 0; $values['glua_action'] = $this->getActionId($action); $values['glua_role'] = $this->_userInfo->user_role; $values['glua_created'] = new Zend_Db_Expr('CURRENT_TIMESTAMP'); - + if ($request instanceof Zend_Controller_Request_Http) { $values['glua_remote_ip'] = $request->getClientIp(); } else { Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-17 17:19:37 UTC (rev 231) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-11-18 09:11:12 UTC (rev 232) @@ -317,8 +317,15 @@ } return; } else { + //Now present the user with an error message $errors = $authResult->getMessages(); - $this->addMessage($errors); + $this->addMessage($errors); + + //Also log the error to the log table + //when the project has logging enabled + $logErrors = join(' - ', $errors); + $log = Gems_AccessLog::getLog(); + $log->log('loginFail', $this->getRequest(), sprintf('Failed login for : %s (%s) - %s', $formValues['userlogin'], $formValues['organization'], $logErrors), null, true); } } } Modified: trunk/library/classes/Gems/Default/LogAction.php =================================================================== --- trunk/library/classes/Gems/Default/LogAction.php 2011-11-17 17:19:37 UTC (rev 231) +++ trunk/library/classes/Gems/Default/LogAction.php 2011-11-18 09:11:12 UTC (rev 232) @@ -166,6 +166,11 @@ $model->set('staff_name', 'label', $this->_('Staff')); $model->set('respondent_name', 'label', $this->_('Respondent')); + if ($detailed) { + $model->set('glua_role', 'label', $this->_('Role')); + $model->set('glua_remote_ip', 'label', $this->_('IP address')); + } + return $model; } Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-17 17:19:37 UTC (rev 231) +++ trunk/library/configs/db/patches.sql 2011-11-18 09:11:12 UTC (rev 232) @@ -319,3 +319,7 @@ ALTER TABLE `gems__organizations` ADD gor_accessible_by text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER gor_task, ADD gor_has_patients boolean not null default 1 AFTER gor_iso_lang, ADD gor_add_patients boolean not null default 1 AFTER gor_has_patients; + +-- PATCH: Log failed logins +INSERT INTO `zsd`.`gems__log_actions` (`glac_id_action`, `glac_name`, `glac_change`, `glac_log`, `glac_created`) + VALUES (NULL , 'loginFail', '0', '1', CURRENT_TIMESTAMP); \ 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-21 16:33:22
|
Revision: 256 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=256&view=rev Author: matijsdejong Date: 2011-11-21 16:33:16 +0000 (Mon, 21 Nov 2011) Log Message: ----------- Small changes useful for project specific User extensions Modified Paths: -------------- trunk/library/classes/Gems/User/OldStaffUserDefinition.php trunk/library/classes/Gems/User/StaffUserDefinition.php trunk/library/classes/Gems/User/User.php trunk/library/configs/db/patches.sql Modified: trunk/library/classes/Gems/User/OldStaffUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2011-11-21 15:51:49 UTC (rev 255) +++ trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2011-11-21 16:33:16 UTC (rev 256) @@ -58,14 +58,14 @@ * @var Gems_Project_ProjectSettings */ protected $project; - + /** * Perform UserDefinition specific post-login logic * * @param Zend_Auth_Result $authResult * @return void */ - public function afterLogin($authResult, $formValues) + public function afterLogin(Zend_Auth_Result $authResult, $formValues) { if ($authResult->isValid()) { $login_name = $formValues['userlogin']; @@ -142,6 +142,32 @@ */ public function getUserData($login_name, $organization) { + $select = $this->getUserSelect($login_name, $organization); + + // For a multi-layout project we need to select the appropriate style too, + // but as PATCHES may not be in effect we have to try two selects + $select2 = clone $select; + $select2->columns(array('user_style' => 'gor_style'), 'gems__organizations'); + + try { + // Fails before patch has run... + return $this->db->fetchRow($select2, array($login_name), Zend_Db::FETCH_ASSOC); + + } catch (Zend_Db_Exception $e) { + // So then we try the old method + return $this->db->fetchRow($select, array($login_name), Zend_Db::FETCH_ASSOC); + } + } + + /** + * Stub to allow subclasses to add fields to the select. + * + * @param string $login_name + * @param int $organization + * @return Zend_Db_Select + */ + protected function getUserSelect($login_name, $organization) + { /** * Read the needed parameters from the different tables, lots of renames for backward * compatibility @@ -165,19 +191,7 @@ ->where('gsf_login = ?') ->limit(1); - // For a multi-layout project we need to select the appropriate style too, - // but as PATCHES may not be in effect we have to try two selects - $select2 = clone $select; - $select2->columns(array('user_style' => 'gor_style'), 'gems__organizations'); - - try { - // Fails before patch has run... - return $this->db->fetchRow($select2, array($login_name), Zend_Db::FETCH_ASSOC); - - } catch (Zend_Db_Exception $e) { - // So then we try the old method - return $this->db->fetchRow($select, array($login_name), Zend_Db::FETCH_ASSOC); - } + return $select; } /** Modified: trunk/library/classes/Gems/User/StaffUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/StaffUserDefinition.php 2011-11-21 15:51:49 UTC (rev 255) +++ trunk/library/classes/Gems/User/StaffUserDefinition.php 2011-11-21 16:33:16 UTC (rev 256) @@ -166,6 +166,20 @@ */ public function getUserData($login_name, $organization) { + $select = $this->getUserSelect($login_name, $organization); + + return $this->db->fetchRow($select, array($login_name, $organization), Zend_Db::FETCH_ASSOC); + } + + /** + * Stub to allow subclasses to add fields to the select. + * + * @param string $login_name + * @param int $organization + * @return Zend_Db_Select + */ + protected function getUserSelect($login_name, $organization) + { $select = new Zend_Db_Select($this->db); $select->from('gems__user_logins', array('user_login_id' => 'gul_id_user')) ->join('gems__staff', 'gul_login = gsf_login AND gul_id_organization = gsf_id_organization', array( @@ -192,7 +206,7 @@ ->where('gul_id_organization = ?') ->limit(1); - return $this->db->fetchRow($select, array($login_name, $organization), Zend_Db::FETCH_ASSOC); + return $select; } /** Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2011-11-21 15:51:49 UTC (rev 255) +++ trunk/library/classes/Gems/User/User.php 2011-11-21 16:33:16 UTC (rev 256) @@ -50,7 +50,7 @@ * * @var Zend_Auth_Result */ - private $_authResult; + protected $_authResult; /** * Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-21 15:51:49 UTC (rev 255) +++ trunk/library/configs/db/patches.sql 2011-11-21 16:33:16 UTC (rev 256) @@ -320,6 +320,8 @@ ADD gor_has_patients boolean not null default 1 AFTER gor_iso_lang, ADD gor_add_patients boolean not null default 1 AFTER gor_has_patients; +UPDATE `gems__organizations` SET gor_has_patients = COALESCE((SELECT 1 FROM gems__respondent2org WHERE gr2o_id_organization = gor_id_organization GROUP BY gr2o_id_organization), 0); + -- PATCH: Log failed logins INSERT INTO `zsd`.`gems__log_actions` (`glac_id_action`, `glac_name`, `glac_change`, `glac_log`, `glac_created`) VALUES (NULL , 'loginFail', '0', '1', CURRENT_TIMESTAMP); \ 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-22 15:18:36
|
Revision: 270 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=270&view=rev Author: matijsdejong Date: 2011-11-22 15:18:23 +0000 (Tue, 22 Nov 2011) Log Message: ----------- Ticket #43: Flexible user password constraints: - IndexAction checks if the user password is according to the password constraints - StaffAction checks the password, but only for new users - OptionAction uses validators (with Gems_Auth) as otherwise the checks became to complex for me Updated translations Modified Paths: -------------- trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Default/OptionAction.php trunk/library/classes/Gems/Default/ProjectTracksAction.php trunk/library/classes/Gems/Default/StaffAction.php trunk/library/classes/Gems/Project/ProjectSettings.php trunk/library/classes/Gems/User/OldStaffUserDefinition.php trunk/library/classes/Gems/User/PasswordChecker.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/User/UserLoader.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Added Paths: ----------- trunk/library/classes/Gems/User/UserNewPasswordValidator.php trunk/library/classes/Gems/User/UserPasswordValidator.php Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-22 15:09:32 UTC (rev 269) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-11-22 15:18:23 UTC (rev 270) @@ -282,6 +282,13 @@ $user->afterLogin($form->getValues()); + //* + if ($messages = $user->reportPasswordWeakness($request->getParam('password'))) { + $user->setPasswordResetRequired(true); + $this->addMessage($this->_('Your password must be changed.')); + $this->addMessage($messages); + } // */ + /** * Fix current locale / organization in cookies */ @@ -301,7 +308,10 @@ if ($previousRequestParameters = $this->session->previousRequestParameters) { $this->_reroute(array('controller' => $previousRequestParameters['controller'], 'action' => $previousRequestParameters['action']), false); } else { - // This reroutes to the first available menu page after login + // This reroutes to the first available menu page after login. + // + // Do not user $user->gotoStartPage() as the menu is still set + // for no login. $this->_reroute(array('controller' => null, 'action' => null), true); } return; Modified: trunk/library/classes/Gems/Default/OptionAction.php =================================================================== --- trunk/library/classes/Gems/Default/OptionAction.php 2011-11-22 15:09:32 UTC (rev 269) +++ trunk/library/classes/Gems/Default/OptionAction.php 2011-11-22 15:18:23 UTC (rev 270) @@ -98,6 +98,7 @@ $element->setAttrib('maxlength', 20); $element->setRenderPassword(true); $element->setRequired(true); + $element->addValidator(new Gems_User_UserPasswordValidator($user, $this->translate)); $form->addElement($element); } @@ -108,7 +109,7 @@ $element->setAttrib('maxlength', 20); $element->setRequired(true); $element->setRenderPassword(true); - $element->addValidator('StringLength', true, array('min' => $this->project->passwords['MinimumLength'], 'max' => 20)); + $element->addValidator(new Gems_User_UserNewPasswordValidator($user)); $element->addValidator(new MUtil_Validate_IsConfirmed('repeat_password', $this->_('Repeat password'))); $form->addElement($element); @@ -130,26 +131,16 @@ /**************** * Process form * ****************/ - if ($this->_request->isPost()) { - if ($form->isValid($_POST)) { - $authResult = $user->authenticate(array('userlogin' => $user->getLoginName(), - 'password' => $_POST['old_password'], - 'organization' =>$user->getOrganizationId())); - if ($authResult->isValid()) { - $user->setPassword($_POST['new_password']); + if ($this->_request->isPost() && $form->isValid($_POST)) { + $user->setPassword($_POST['new_password']); - $this->addMessage($this->_('New password is active.')); - $this->_reroute(array($this->getRequest()->getActionKey() => 'edit')); - } else { - if (isset($_POST['old_password'])) { - if ($_POST['old_password'] === strtoupper($_POST['old_password'])) { - $this->addMessage($this->_('Caps Lock seems to be on!')); - } else { - $errors = $authResult->getMessages(); - $this->addMessage($errors); + $this->addMessage($this->_('New password is active.')); + $this->_reroute(array($this->getRequest()->getActionKey() => 'edit')); - } - } + } else { + if (isset($_POST['old_password'])) { + if ($_POST['old_password'] === strtoupper($_POST['old_password'])) { + $this->addMessage($this->_('Caps Lock seems to be on!')); } } $form->populate($_POST); Modified: trunk/library/classes/Gems/Default/ProjectTracksAction.php =================================================================== --- trunk/library/classes/Gems/Default/ProjectTracksAction.php 2011-11-22 15:09:32 UTC (rev 269) +++ trunk/library/classes/Gems/Default/ProjectTracksAction.php 2011-11-22 15:18:23 UTC (rev 270) @@ -90,6 +90,18 @@ return $this->_('Active tracks'); } + /* + public function indexAction() + { + parent::indexAction(); + + $user = $this->loader->getCurrentUser(); + foreach (array('X1X', 'adminijadIran', 'xx!2yy2z', 'admin2') as $password) { + $this->addMessage($password); + $this->addMessage($user->reportPasswordWeakness($password)); + } + } // */ + public function questionsAction() { if ($sid = $this->_getParam(Gems_Model::SURVEY_ID)) { Modified: trunk/library/classes/Gems/Default/StaffAction.php =================================================================== --- trunk/library/classes/Gems/Default/StaffAction.php 2011-11-22 15:09:32 UTC (rev 269) +++ trunk/library/classes/Gems/Default/StaffAction.php 2011-11-22 15:18:23 UTC (rev 270) @@ -92,6 +92,14 @@ */ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model, array $data, $new = false) { + // Sorry, for the time being no password complexity checking on new + // users. Can be done, but is to complex for the moment. + if ($new) { + $user = false; + } else { + $user = $this->loader->getUserLoader()->getUserByStaffId($data['gsf_id_user']); + // MUtil_Echo::track($data['gsf_id_user'], $user->getLoginName()); + } $dbLookup = $this->util->getDbLookup(); switch ($data['gul_user_class']) { @@ -137,14 +145,17 @@ } if ($passwordField) { - $bridge->addPassword($passwordField, + $pwdElem = $bridge->addPassword($passwordField, 'label', $this->_('Password'), - 'minlength', $this->project->passwords['MinimumLength'], // 'renderPassword', true, 'repeatLabel', $this->_('Repeat password'), 'required', $new, 'size', 15 ); + + if ($user instanceof Gems_User_User) { + $pwdElem->addValidator(new Gems_User_UserNewPasswordValidator($user)); + } } $bridge->addRadio( 'gsf_gender', 'separator', ''); $bridge->addText( 'gsf_first_name', 'label', $this->_('First name')); Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-22 15:09:32 UTC (rev 269) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-22 15:18:23 UTC (rev 270) @@ -213,7 +213,7 @@ { $args = MUtil_Ra::flatten(func_get_args()); $args = array_change_key_case(array_flip(array_filter($args))); - //MUtil_Echo::track($args); + // MUtil_Echo::track($args); $rules = array(); if (isset($this->passwords) && is_array($this->passwords)) { @@ -225,7 +225,7 @@ /** * Timeout for sessions in seconds. - * + * * @return int */ public function getSessionTimeOut() @@ -236,16 +236,16 @@ return $this->defaultSessionTimeout; } } - + /** * Returns an array with throttling settings for the ask * controller - * + * * @return array */ public function getAskThrottleSettings() { - // Check for the 'askThrottle' config section + // Check for the 'askThrottle' config section if (!empty($this->askThrottle)) { return $this->askThrottle; } else { Modified: trunk/library/classes/Gems/User/OldStaffUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2011-11-22 15:09:32 UTC (rev 269) +++ trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2011-11-22 15:18:23 UTC (rev 270) @@ -67,6 +67,7 @@ */ public function afterLogin(Zend_Auth_Result $authResult, $formValues) { + // MUtil_Echo::track($authResult->isValid(), $formValues); if ($authResult->isValid()) { $login_name = $formValues['userlogin']; $organization = $formValues['organization']; Modified: trunk/library/classes/Gems/User/PasswordChecker.php =================================================================== --- trunk/library/classes/Gems/User/PasswordChecker.php 2011-11-22 15:09:32 UTC (rev 269) +++ trunk/library/classes/Gems/User/PasswordChecker.php 2011-11-22 15:18:23 UTC (rev 270) @@ -90,7 +90,7 @@ { $len = intval($parameter); $results = array(); - if (preg_match_all('/[A-Z]/', $password, $results) < $len) { + if ($len && (preg_match_all('/[A-Z]/', $password, $results) < $len)) { $this->_addError(sprintf( $this->translate->plural('A password should contain at least one uppercase character.', 'A password should contain at least %d uppercase characters.', $len), $len)); @@ -107,7 +107,7 @@ { $len = intval($parameter); $results = array(); - if (preg_match_all('/[a-z]/', $password, $results) < $len) { + if ($len && (preg_match_all('/[a-z]/', $password, $results) < $len)) { $this->_addError(sprintf( $this->translate->plural('A password should contain at least one lowercase character.', 'A password should contain at least %d lowercase characters.', $len), $len)); @@ -123,7 +123,7 @@ protected function minLength($parameter, $password) { $len = intval($parameter); - if (strlen($password) < $len) { + if ($len && (strlen($password) < $len)) { $this->_addError(sprintf($this->translate->_('A password should be at least %d characters long.'), $len)); } } @@ -137,12 +137,14 @@ protected function notAlphaCount($parameter, $password) { $len = intval($parameter); - $results = array(); - $count = preg_match_all('/[A-Za-z]/', $password, $results); - if (strlen($password) - $count < $len) { - $this->_addError(sprintf( - $this->translate->plural('A password should contain at least one not alphabetic character.', 'A password should contain at least %d not alphabetic characters.', $len), - $len)); + if ($len) { + $results = array(); + $count = preg_match_all('/[A-Za-z]/', $password, $results); + if (strlen($password) - $count < $len) { + $this->_addError(sprintf( + $this->translate->plural('A password should contain at least one not alphabetic character.', 'A password should contain at least %d not alphabetic characters.', $len), + $len)); + } } } @@ -155,12 +157,14 @@ protected function notAlphaNumCount($parameter, $password) { $len = intval($parameter); - $results = array(); - $count = preg_match_all('/[A-Za-z]/', $password, $results); - if (strlen($password) - $count < $len) { - $this->_addError(sprintf( - $this->translate->plural('A password should contain at least one not alphanumeric character.', 'A password should contain at least %d not alphanumeric characters.', $len), - $len)); + if ($len) { + $results = array(); + $count = preg_match_all('/[A-Za-z]/', $password, $results); + if (strlen($password) - $count < $len) { + $this->_addError(sprintf( + $this->translate->plural('A password should contain at least one not alphanumeric character.', 'A password should contain at least %d not alphanumeric characters.', $len), + $len)); + } } } @@ -192,7 +196,7 @@ { $len = intval($parameter); $results = array(); - if (preg_match_all('/[0-9]/', $password, $results) < $len) { + if ($len && (preg_match_all('/[0-9]/', $password, $results) < $len)) { $this->_addError(sprintf( $this->translate->plural('A password should contain at least one number.', 'A password should contain at least %d numbers.', $len), $len)); @@ -211,7 +215,7 @@ $this->_errors = array(); $this->user = $user; - $rules = $this->project->getPasswordRules($user->getOrganizationCode(), $user->getRoles()); + $rules = $this->project->getPasswordRules($user->getOrganizationCode(), $user->getRoles(), $user->getDefinitionName()); // MUtil_Echo::track($rules); foreach ($rules as $rule => $parameter) { @@ -219,6 +223,7 @@ $this->$rule($parameter, $password); } } + // MUtil_Echo::track($this->_errors); return $this->_errors; } Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2011-11-22 15:09:32 UTC (rev 269) +++ trunk/library/classes/Gems/User/User.php 2011-11-22 15:18:23 UTC (rev 270) @@ -294,6 +294,16 @@ } /** + * Returns the name of the user definition. + * + * @return string + */ + public function getDefinitionName() + { + return $this->_getVar('__user_definition'); + } + + /** * Return true if this user has a password. * * @return boolean @@ -304,6 +314,20 @@ } /** + * Get the array to use for authenticate() + * + * @param string $password + * @return array + */ + public function getFormValuesForPassword($password) + { + return array( + 'userlogin' => $this->getLoginName(), + 'password' => $password, + 'organization' => $this->getOrganizationId()); + } + + /** * Returns the full user name (first, prefix, last). * * @return string @@ -534,6 +558,21 @@ } /** + * Check for password weakness. + * + * @param string $password + * @return mixed String or array of strings containing warning messages or nothing + */ + public function reportPasswordWeakness($password) + { + if ($this->canSetPassword()) { + $checker = $this->userLoader->getPasswordChecker(); + + return $checker->reportPasswordWeakness($this, $password); + } + } + + /** * Set this user as the current user. * * This means that the data about this user will be stored in a session. Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-11-22 15:09:32 UTC (rev 269) +++ trunk/library/classes/Gems/User/UserLoader.php 2011-11-22 15:18:23 UTC (rev 270) @@ -114,9 +114,9 @@ // is removed from GemsEscort if (! $this->session instanceof Zend_Session_Namespace) { $this->session = new Zend_Session_Namespace('gems.' . GEMS_PROJECT_NAME . '.session'); - + $idleTimeout = $this->project->getSessionTimeout(); - + $this->session->setExpirationSeconds($idleTimeout); $extras['session'] = $this->session; @@ -178,6 +178,16 @@ } /** + * Get password weakness checker. + * + * @return Gems_User_PasswordChecker + */ + public function getPasswordChecker() + { + return $this->_getClass('passwordChecker'); + } + + /** * Returns a user object, that may be empty if no user exist. * * @param string $login_name @@ -191,6 +201,7 @@ $definition = $this->_getClass($defName); $values = $definition->getUserData($login_name, $organization); + // MUtil_Echo::track($defName, $login_name, $organization, $values); if (! isset($values['user_active'])) { $values['user_active'] = true; @@ -215,6 +226,7 @@ { $data = $this->db->fetchRow("SELECT gsf_login, gsf_id_organization FROM gems__staff WHERE gsf_id_user = ?", $staff_id); + // MUtil_Echo::track($data); if (false == $data) { $data = array('gsf_login' => null, 'gsf_id_organization' => null); } Added: trunk/library/classes/Gems/User/UserNewPasswordValidator.php =================================================================== --- trunk/library/classes/Gems/User/UserNewPasswordValidator.php (rev 0) +++ trunk/library/classes/Gems/User/UserNewPasswordValidator.php 2011-11-22 15:18:23 UTC (rev 270) @@ -0,0 +1,113 @@ +<?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. + * + * + * @package Gems + * @subpackage User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_User_UserNewPasswordValidator implements Zend_Validate_Interface +{ + /** + * The reported problems with the password. + * + * @var array or null + */ + private $_report; + + /** + * + * @var Gems_User_User + */ + private $_user; + + /** + * + * @param Gems_User_User $user The user to check + */ + public function __construct(Gems_User_User $user) + { + $this->_user = $user; + } + + /** + * Returns true if and only if $value meets the validation requirements + * + * If $value fails validation, then this method returns false, and + * getMessages() will return an array of messages that explain why the + * validation failed. + * + * @param mixed $value + * @param mixed $content + * @return boolean + * @throws Zend_Validate_Exception If validation of $value is impossible + */ + public function isValid($value, $context = array()) + { + $this->_report = $this->_user->reportPasswordWeakness($value); + + // MUtil_Echo::track($value, $this->_report); + + return ! (boolean) $this->_report; + } + + /** + * Returns an array of messages that explain why the most recent isValid() + * call returned false. The array keys are validation failure message identifiers, + * and the array values are the corresponding human-readable message strings. + * + * If isValid() was never called or if the most recent isValid() call + * returned true, then this method returns an empty array. + * + * @return array + */ + public function getMessages() + { + if ($this->_report) { + return $this->_report; + + } else { + return array(); + } + + + } +} Copied: trunk/library/classes/Gems/User/UserPasswordValidator.php (from rev 216, trunk/library/classes/Gems/User/UserPasswordValidator.php) =================================================================== --- trunk/library/classes/Gems/User/UserPasswordValidator.php (rev 0) +++ trunk/library/classes/Gems/User/UserPasswordValidator.php 2011-11-22 15:18:23 UTC (rev 270) @@ -0,0 +1,120 @@ +<?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. + * + * + * @package Gems + * @subpackage User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_User_UserPasswordValidator implements Zend_Validate_Interface +{ + /** + * + * @var Gems_User_User + */ + private $_user; + + /** + * + * @var Zend_Translate + */ + private $_translate; + + /** + * + * @var boolean + */ + private $_valid = false; + + /** + * + * @param Gems_User_User $user The user to check + * @param Zend_Translate $translate Optional translator + */ + public function __construct(Gems_User_User $user, Zend_Translate $translate = null) + { + $this->_user = $user; + $this->_translate = $translate ? $translate : new MUtil_Translate_Adapter_Potemkin(); + } + + /** + * Returns true if and only if $value meets the validation requirements + * + * If $value fails validation, then this method returns false, and + * getMessages() will return an array of messages that explain why the + * validation failed. + * + * @param mixed $value + * @param mixed $content + * @return boolean + * @throws Zend_Validate_Exception If validation of $value is impossible + */ + public function isValid($value, $context = array()) + { + $authResult = $this->_user->authenticate($this->_user->getFormValuesForPassword($value)); + + $this->_valid = $authResult->isValid(); + + return $this->_valid; + } + + /** + * Returns an array of messages that explain why the most recent isValid() + * call returned false. The array keys are validation failure message identifiers, + * and the array values are the corresponding human-readable message strings. + * + * If isValid() was never called or if the most recent isValid() call + * returned true, then this method returns an empty array. + * + * @return array + */ + public function getMessages() + { + if ($this->_valid) { + return array(); + + } else { + return array($this->_translate->_('Wrong password.')); + } + + + } +} Property changes on: trunk/library/classes/Gems/User/UserPasswordValidator.php ___________________________________________________________________ Added: svn:mergeinfo + /branches/newUser/classes/Gems/User/UserPasswordValidator.php:113-150 /branches/newUser2/classes/Gems/User/UserPasswordValidator.php:175-207 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-22 15:09:32 UTC (rev 269) +++ trunk/library/languages/default-en.po 2011-11-22 15:18:23 UTC (rev 270) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-16 19:09+0100\n" +"POT-Creation-Date: 2011-11-22 16:14+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:201 +#: classes/GemsEscort.php:207 #, php-format msgid "Path %s not writable" msgstr "Path %s not writable" -#: classes/GemsEscort.php:876 +#: classes/GemsEscort.php:887 #, php-format msgid "User: %s" msgstr "User: %s" -#: classes/GemsEscort.php:900 +#: classes/GemsEscort.php:911 msgid "version" msgstr "version" -#: classes/GemsEscort.php:1330 -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:1342 +msgid "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" +msgstr "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" -#: classes/GemsEscort.php:1454 +#: classes/GemsEscort.php:1466 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1456 -#: classes/GemsEscort.php:1460 -#: classes/GemsEscort.php:1461 +#: classes/GemsEscort.php:1468 +#: classes/GemsEscort.php:1472 +#: classes/GemsEscort.php:1473 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1470 +#: classes/GemsEscort.php:1483 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1472 -#: classes/GemsEscort.php:1508 +#: classes/GemsEscort.php:1485 +#: classes/GemsEscort.php:1521 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1488 +#: classes/GemsEscort.php:1501 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1490 +#: classes/GemsEscort.php:1503 #, 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:1495 -#: classes/GemsEscort.php:1506 +#: classes/GemsEscort.php:1508 +#: classes/GemsEscort.php:1519 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1496 +#: classes/GemsEscort.php:1509 msgid "You must login to access this page." msgstr "You must login to access this page." @@ -77,7 +77,7 @@ msgid "Database needs to be updated!" msgstr "Database needs to be updated!" -#: classes/Gems/Auth.php:228 +#: classes/Gems/Auth.php:241 msgid "Combination of organization, username and password not found." msgstr "Combination of organization, username and password not found." @@ -338,62 +338,77 @@ msgid "Changelog" msgstr "Changelog" -#: classes/Gems/Model.php:190 +#: classes/Gems/Model.php:193 msgid "Respondent nr" msgstr "Patient nr" -#: classes/Gems/Model.php:191 +#: classes/Gems/Model.php:194 msgid "Opened" msgstr "Opened" -#: classes/Gems/Model.php:192 +#: classes/Gems/Model.php:195 msgid "Consent" msgstr "Consent" -#: classes/Gems/Model.php:194 +#: classes/Gems/Model.php:197 msgid "E-Mail" msgstr "E-Mail" -#: classes/Gems/Model.php:199 +#: classes/Gems/Model.php:202 msgid "Gender" msgstr "Gender" -#: classes/Gems/Model.php:200 +#: classes/Gems/Model.php:203 msgid "First name" msgstr "First name" -#: classes/Gems/Model.php:201 +#: classes/Gems/Model.php:204 msgid "Surname prefix" msgstr "Surname prefix" -#: classes/Gems/Model.php:202 +#: classes/Gems/Model.php:205 msgid "Last name" msgstr "Last name" -#: classes/Gems/Model.php:204 +#: classes/Gems/Model.php:207 msgid "Name" msgstr "Name" -#: classes/Gems/Model.php:207 +#: classes/Gems/Model.php:210 msgid "Street" msgstr "Street" -#: classes/Gems/Model.php:208 +#: classes/Gems/Model.php:211 msgid "Zipcode" msgstr "Zipcode" -#: classes/Gems/Model.php:209 +#: classes/Gems/Model.php:212 msgid "City" msgstr "City" -#: classes/Gems/Model.php:211 +#: classes/Gems/Model.php:214 msgid "Phone" msgstr "Phone" -#: classes/Gems/Model.php:213 +#: classes/Gems/Model.php:216 msgid "Birthday" msgstr "Birthday" +#: classes/Gems/Pdf.php:195 +#, php-format +msgid "PDF Source File '%s' not found!" +msgstr "PDF Source File '%s' not found!" + +#: classes/Gems/Pdf.php:237 +#, php-format +msgid "Could not create '%s' directory." +msgstr "Could not create '%s' directory." + +#: classes/Gems/Pdf.php:280 +#, php-format +msgid " The error message is: %s" +msgstr " The error message is: %s" + #: classes/Gems/Tracker.php:732 msgid "Checks performed" msgstr "Checks performed" @@ -412,96 +427,100 @@ msgid "Trying upgrade for %s to level %s: %s" msgstr "Trying upgrade for %s to level %s: %s" -#: classes/Gems/Controller/BrowseEditAction.php:344 +#: classes/Gems/UpgradesAbstract.php:337 +msgid "Cache cleaned" +msgstr "Cache cleaned" + +#: classes/Gems/Controller/BrowseEditAction.php:346 #, php-format msgid "New %s..." msgstr "New %s..." -#: classes/Gems/Controller/BrowseEditAction.php:376 +#: classes/Gems/Controller/BrowseEditAction.php:378 #, php-format msgid "Delete %s" msgstr "Delete %s" -#: classes/Gems/Controller/BrowseEditAction.php:380 +#: classes/Gems/Controller/BrowseEditAction.php:382 #, php-format msgid "%2$u %1$s deleted" msgstr "%2$u %1$s deleted" -#: classes/Gems/Controller/BrowseEditAction.php:394 +#: classes/Gems/Controller/BrowseEditAction.php:396 #, php-format msgid "Edit %s" msgstr "Edit %s" -#: classes/Gems/Controller/BrowseEditAction.php:491 +#: classes/Gems/Controller/BrowseEditAction.php:493 msgid "Free search text" msgstr "Free search text" -#: classes/Gems/Controller/BrowseEditAction.php:562 +#: classes/Gems/Controller/BrowseEditAction.php:564 msgid "Search" msgstr "Search" -#: classes/Gems/Controller/BrowseEditAction.php:578 +#: classes/Gems/Controller/BrowseEditAction.php:580 #, php-format msgid "No %s found" msgstr "No %s found" -#: classes/Gems/Controller/BrowseEditAction.php:651 +#: classes/Gems/Controller/BrowseEditAction.php:653 #, php-format msgid "No %s found." msgstr "No %s found." -#: classes/Gems/Controller/BrowseEditAction.php:766 +#: classes/Gems/Controller/BrowseEditAction.php:768 msgid "Are you sure?" msgstr "Are you sure?" -#: classes/Gems/Controller/BrowseEditAction.php:782 +#: classes/Gems/Controller/BrowseEditAction.php:784 msgid "Yes" msgstr "Yes" -#: classes/Gems/Controller/BrowseEditAction.php:783 +#: classes/Gems/Controller/BrowseEditAction.php:785 msgid "No" msgstr "No" -#: classes/Gems/Controller/BrowseEditAction.php:836 +#: classes/Gems/Controller/BrowseEditAction.php:838 #, php-format msgid "Unknown %s requested" msgstr "Unknown %s requested" -#: classes/Gems/Controller/BrowseEditAction.php:859 +#: classes/Gems/Controller/BrowseEditAction.php:861 #, php-format msgid "New %1$s..." msgstr "New %1$s..." -#: classes/Gems/Controller/BrowseEditAction.php:867 +#: classes/Gems/Controller/BrowseEditAction.php:869 msgid "Save" msgstr "Save" -#: classes/Gems/Controller/BrowseEditAction.php:903 +#: classes/Gems/Controller/BrowseEditAction.php:905 #, php-format msgid "%2$u %1$s saved" msgstr "%2$u %1$s saved" -#: classes/Gems/Controller/BrowseEditAction.php:906 +#: classes/Gems/Controller/BrowseEditAction.php:908 msgid "No changes to save." msgstr "No changes to save." -#: classes/Gems/Controller/BrowseEditAction.php:915 +#: classes/Gems/Controller/BrowseEditAction.php:917 msgid "Input error! No changes saved!" msgstr "Input error! No changes saved!" -#: classes/Gems/Controller/BrowseEditAction.php:943 +#: classes/Gems/Controller/BrowseEditAction.php:945 #, php-format msgid "Show %s" msgstr "Show %s" -#: classes/Gems/Controller/BrowseEditAction.php:950 +#: classes/Gems/Controller/BrowseEditAction.php:952 #, php-format msgid "Unknown %s." msgstr "Unknown %s." #: classes/Gems/Controller/ModelActionAbstract.php:97 #: classes/Gems/Default/AskAction.php:150 -#: classes/Gems/Default/DatabaseAction.php:524 +#: classes/Gems/Default/DatabaseAction.php:532 msgid "Cancel" msgstr "Cancel" @@ -581,32 +600,36 @@ msgid "OK" msgstr "OK" -#: classes/Gems/Default/AskAction.php:229 +#: classes/Gems/Default/AskAction.php:233 +msgid "The server is currently busy, please wait a while and try again." +msgstr "The server is currently busy, please wait a while and try again." + +#: classes/Gems/Default/AskAction.php:255 msgid "Tokens identify a survey that was assigned to you personally." msgstr "Tokens identify a survey that was assigned to you personally." -#: classes/Gems/Default/AskAction.php:229 +#: classes/Gems/Default/AskAction.php:255 msgid "Entering the token and pressing OK will open that survey." msgstr "Entering the token and pressing OK will open that survey." -#: classes/Gems/Default/AskAction.php:233 +#: classes/Gems/Default/AskAction.php:259 msgid "After answering the survey you will be logged off automatically." msgstr "After answering the survey you will be logged off automatically." -#: classes/Gems/Default/AskAction.php:235 +#: classes/Gems/Default/AskAction.php:261 msgid "After answering the survey you will return to the respondent overview screen." msgstr "After answering the survey you will return to the paitent overview screen." -#: classes/Gems/Default/AskAction.php:242 +#: classes/Gems/Default/AskAction.php:268 msgid "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive." msgstr "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive." -#: classes/Gems/Default/AskAction.php:243 +#: classes/Gems/Default/AskAction.php:269 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:68 -#: classes/Gems/Default/GroupAction.php:87 +#: classes/Gems/Default/GroupAction.php:88 msgid "Description" msgstr "Description" @@ -813,12 +836,12 @@ msgstr "Database object overview" #: classes/Gems/Default/DatabaseAction.php:316 -#: classes/Gems/Default/DatabaseAction.php:360 +#: classes/Gems/Default/DatabaseAction.php:368 msgid "Level" msgstr "Level" #: classes/Gems/Default/DatabaseAction.php:317 -#: classes/Gems/Default/DatabaseAction.php:361 +#: classes/Gems/Default/DatabaseAction.php:369 msgid "Subtype" msgstr "Subtype" @@ -827,12 +850,12 @@ msgstr "To be executed" #: classes/Gems/Default/DatabaseAction.php:320 -#: classes/Gems/Default/DatabaseAction.php:364 +#: classes/Gems/Default/DatabaseAction.php:372 msgid "Executed" msgstr "Executed" #: classes/Gems/Default/DatabaseAction.php:321 -#: classes/Gems/Default/DatabaseAction.php:365 +#: classes/Gems/Default/DatabaseAction.php:373 msgid "Finished" msgstr "Finished" @@ -874,109 +897,109 @@ msgid "%d patch(es) executed." msgstr "%d patch(es) executed." -#: classes/Gems/Default/DatabaseAction.php:359 +#: classes/Gems/Default/DatabaseAction.php:367 msgid "Patch" msgstr "Patch" -#: classes/Gems/Default/DatabaseAction.php:363 +#: classes/Gems/Default/DatabaseAction.php:371 msgid "Query" msgstr "Query" -#: classes/Gems/Default/DatabaseAction.php:366 +#: classes/Gems/Default/DatabaseAction.php:374 msgid "Result" msgstr "Result" -#: classes/Gems/Default/DatabaseAction.php:390 +#: classes/Gems/Default/DatabaseAction.php:398 msgid "Patch maintenance" msgstr "Patch maintenance" -#: classes/Gems/Default/DatabaseAction.php:394 +#: classes/Gems/Default/DatabaseAction.php:402 msgid "Patch overview" msgstr "Patch overview" -#: classes/Gems/Default/DatabaseAction.php:456 +#: classes/Gems/Default/DatabaseAction.php:464 msgid "This database object does not exist. You cannot create it." msgstr "This database object does not exist. You cannot create it." -#: classes/Gems/Default/DatabaseAction.php:462 +#: classes/Gems/Default/DatabaseAction.php:470 msgid "This database object has no script. You cannot execute it." msgstr "This database object has no script. You cannot execute it." -#: classes/Gems/Default/DatabaseAction.php:473 +#: classes/Gems/Default/DatabaseAction.php:481 #, php-format msgid "Run %s" msgstr "Run %s" -#: classes/Gems/Default/DatabaseAction.php:492 +#: classes/Gems/Default/DatabaseAction.php:500 #, php-format msgid "Starting %d object creation scripts." msgstr "Starting %d object creation scripts." -#: classes/Gems/Default/DatabaseAction.php:497 +#: classes/Gems/Default/DatabaseAction.php:505 #, php-format msgid "Finished %s creation script for object %d of %d" msgstr "Finished %s creation script for object %d of %d" -#: classes/Gems/Default/DatabaseAction.php:501 +#: classes/Gems/Default/DatabaseAction.php:509 msgid "All objects exist. Nothing was executed." msgstr "All objects exist. Nothing was executed." -#: classes/Gems/Default/DatabaseAction.php:507 +#: classes/Gems/Default/DatabaseAction.php:515 msgid "Create not-existing database objects" msgstr "Create not-existing database objects" -#: classes/Gems/Default/DatabaseAction.php:509 +#: classes/Gems/Default/DatabaseAction.php:517 #, php-format msgid "One database object does not exist." msgid_plural "These %d database objects do not exist." msgstr[0] "One database object does not exist." msgstr[1] "These %d database objects do not exist." -#: classes/Gems/Default/DatabaseAction.php:510 +#: classes/Gems/Default/DatabaseAction.php:518 msgid "Are you sure you want to create it?" msgid_plural "Are you sure you want to create them all?" msgstr[0] "Are you sure you want to create it?" msgstr[1] "Are you sure you want to create them all?" -#: classes/Gems/Default/DatabaseAction.php:523 +#: classes/Gems/Default/DatabaseAction.php:531 msgid "All database objects exist. There is nothing to create." msgstr "All database objects exist. There is nothing to create." -#: classes/Gems/Default/DatabaseAction.php:536 +#: classes/Gems/Default/DatabaseAction.php:544 msgid "Separate multiple commands with semicolons (;)." msgstr "Separate multiple commands with semicolons (;)." -#: classes/Gems/Default/DatabaseAction.php:543 +#: classes/Gems/Default/DatabaseAction.php:551 msgid "Run" msgstr "Run" -#: classes/Gems/Default/DatabaseAction.php:552 +#: classes/Gems/Default/DatabaseAction.php:560 msgid "raw" msgstr "raw" -#: classes/Gems/Default/DatabaseAction.php:561 +#: classes/Gems/Default/DatabaseAction.php:569 #, php-format msgid "Result set %s." msgstr "Result set %s." -#: classes/Gems/Default/DatabaseAction.php:584 +#: classes/Gems/Default/DatabaseAction.php:592 msgid "Execute raw SQL" msgstr "Execute raw SQL" -#: classes/Gems/Default/DatabaseAction.php:587 +#: classes/Gems/Default/DatabaseAction.php:595 msgid "Result sets" msgstr "Result sets" -#: classes/Gems/Default/DatabaseAction.php:612 +#: classes/Gems/Default/DatabaseAction.php:620 msgid "This database object does not exist. You cannot view it." msgstr "This database object does not exist. You cannot view it." -#: classes/Gems/Default/DatabaseAction.php:617 +#: classes/Gems/Default/DatabaseAction.php:625 #, php-format msgid "The data in table %s" msgstr "The data in table %s" -#: classes/Gems/Default/DatabaseAction.php:618 +#: classes/Gems/Default/DatabaseAction.php:626 #, php-format msgid "Contents of %s %s" msgstr "Contents of %s %s" @@ -989,42 +1012,47 @@ msgid "Export data" msgstr "Export data" -#: classes/Gems/Default/ExportAction.php:155 +#: classes/Gems/Default/ExportAction.php:153 #: classes/Gems/Default/MailJobAction.php:121 msgid "Survey" msgstr "Survey" -#: classes/Gems/Default/ExportAction.php:170 +#: classes/Gems/Default/ExportAction.php:168 #, php-format msgid "%s records found." msgstr "%s records found." -#: classes/Gems/Default/ExportAction.php:174 +#: classes/Gems/Default/ExportAction.php:172 #: classes/Gems/Default/IndexAction.php:162 #: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organization" -#: classes/Gems/Default/ExportAction.php:183 +#: classes/Gems/Default/ExportAction.php:181 msgid "Export to" msgstr "Export to" -#: classes/Gems/Default/GroupAction.php:88 +#: classes/Gems/Default/GroupAction.php:89 +#: classes/Gems/Default/LogAction.php:170 msgid "Role" msgstr "Role" -#: classes/Gems/Default/GroupAction.php:91 +#: classes/Gems/Default/GroupAction.php:92 #: classes/Gems/Default/MailJobAction.php:104 msgid "Active" msgstr "Active" -#: classes/Gems/Default/GroupAction.php:102 +#: classes/Gems/Default/GroupAction.php:96 +msgid "Allowed IP Ranges" +msgstr "Allowed IP Ranges" + +#: classes/Gems/Default/GroupAction.php:105 msgid "group" msgid_plural "groups" msgstr[0] "group" msgstr[1] "groups" -#: classes/Gems/Default/GroupAction.php:107 +#: classes/Gems/Default/GroupAction.php:110 msgid "Administrative groups" msgstr "Administrative groups" @@ -1062,50 +1090,54 @@ msgid "Username" msgstr "Username" -#: classes/Gems/Default/IndexAction.php:305 +#: classes/Gems/Default/IndexAction.php:288 +msgid "Your password must be changed." +msgstr "Your password must be changed." + +#: classes/Gems/Default/IndexAction.php:301 #, php-format msgid "Login successful, welcome %s." msgstr "Login successful, welcome %s." -#: classes/Gems/Default/IndexAction.php:335 +#: classes/Gems/Default/IndexAction.php:341 #, php-format msgid "Good bye: %s." msgstr "Good bye: %s." -#: classes/Gems/Default/IndexAction.php:360 +#: classes/Gems/Default/IndexAction.php:366 msgid "Reset accepted, enter your new password." msgstr "Reset accepted, enter your new password." -#: classes/Gems/Default/IndexAction.php:364 +#: classes/Gems/Default/IndexAction.php:370 msgid "This key timed out or does not belong to this user." msgstr "This key timed out or does not belong to this user." -#: classes/Gems/Default/IndexAction.php:381 +#: classes/Gems/Default/IndexAction.php:387 msgid "Password reset requested" msgstr "Password reset requested" -#: classes/Gems/Default/IndexAction.php:382 +#: classes/Gems/Default/IndexAction.php:388 #, php-format msgid "To reset your password for %s, please click this link: %s" msgstr "To reset your password for %s, please click this link: %s" -#: classes/Gems/Default/IndexAction.php:387 +#: classes/Gems/Default/IndexAction.php:393 msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail." msgstr "We sent you an e-mail with a reset link. Click on the link in the e-mail." -#: classes/Gems/Default/IndexAction.php:389 +#: classes/Gems/Default/IndexAction.php:395 msgid "Unable to send e-mail." msgstr "Unable to send e-mail." -#: classes/Gems/Default/IndexAction.php:394 +#: classes/Gems/Default/IndexAction.php:400 msgid "No such user found or no e-mail address known or user cannot be reset." msgstr "No such user found or no e-mail address known or user cannot be reset." -#: classes/Gems/Default/IndexAction.php:398 +#: classes/Gems/Default/IndexAction.php:404 msgid "We received your password reset key." msgstr "We received your password reset key." -#: classes/Gems/Default/IndexAction.php:399 +#: classes/Gems/Default/IndexAction.php:405 msgid "Please enter the organization and username belonging to this key." msgstr "Please enter the organization and username belonging to this key." @@ -1186,7 +1218,11 @@ msgid "Respondent" msgstr "Patient" -#: classes/Gems/Default/LogAction.php:173 +#: classes/Gems/Default/LogAction.php:171 +msgid "IP address" +msgstr "IP address" + +#: classes/Gems/Default/LogAction.php:178 #: classes/Gems/Default/LogMaintenanceAction.php:53 msgid "Log" msgstr "Log" @@ -1384,16 +1420,16 @@ msgstr "User ID" #: classes/Gems/Default/MailServerAction.php:90 -#: classes/Gems/Default/OptionAction.php:112 -#: classes/Gems/Default/OptionAction.php:117 +#: classes/Gems/Default/OptionAction.php:113 +#: classes/Gems/Default/OptionAction.php:118 #: classes/Gems/Default/SourceAction.php:95 -#: classes/Gems/Default/StaffAction.php:144 +#: classes/Gems/Default/StaffAction.php:151 msgid "Repeat password" msgstr "Repeat password" #: classes/Gems/Default/MailServerAction.php:91 #: classes/Gems/Default/SourceAction.php:74 -#: classes/Gems/Default/StaffAction.php:118 +#: classes/Gems/Default/StaffAction.php:126 msgid "Enter only when changing" msgstr "Enter only when changing the password" @@ -1408,7 +1444,7 @@ msgstr "Email servers" #: classes/Gems/Default/MailTemplateAction.php:75 -#: classes/Gems/Default/StaffAction.php:228 +#: classes/Gems/Default/StaffAction.php:239 msgid "(all organizations)" msgstr "(all organizations)" @@ -1430,54 +1466,50 @@ msgid "Current password" msgstr "Current password" -#: classes/Gems/Default/OptionAction.php:106 -#: classes/Gems/Default/OptionAction.php:122 +#: classes/Gems/Default/OptionAction.php:107 +#: classes/Gems/Default/OptionAction.php:123 msgid "New password" msgstr "New password" -#: classes/Gems/Default/OptionAction.php:141 +#: classes/Gems/Default/OptionAction.php:137 msgid "New password is active." msgstr "New password is active." -#: classes/Gems/Default/OptionAction.php:146 +#: classes/Gems/Default/OptionAction.php:143 msgid "Caps Lock seems to be on!" msgstr "Caps Lock seems to be on!" -#: classes/Gems/Default/OptionAction.php:190 +#: classes/Gems/Default/OptionAction.php:181 msgid "Login Name" msgstr "Login Name" -#: classes/Gems/Default/OptionAction.php:197 +#: classes/Gems/Default/OptionAction.php:188 #: classes/Gems/Default/OrganizationAction.php:140 #: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:213 +#: classes/Gems/Default/StaffAction.php:224 msgid "Language" msgstr "Language" -#: classes/Gems/Default/OptionAction.php:207 +#: classes/Gems/Default/OptionAction.php:198 #, php-format msgid "Options" msgstr "Options" -#: classes/Gems/Default/OptionAction.php:216 +#: classes/Gems/Default/OptionAction.php:207 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:236 -msgid "IP address" -msgstr "IP address" - -#: classes/Gems/Default/OptionAction.php:236 +#: classes/Gems/Default/OptionAction.php:227 msgid "Date / time" msgstr "Date / time" -#: classes/Gems/Default/OptionAction.php:242 +#: classes/Gems/Default/OptionAction.php:233 msgid "item" msgid_plural "items" msgstr[0] "item" msgstr[1] "items" -#: classes/Gems/Default/OptionAction.php:247 +#: classes/Gems/Default/OptionAction.php:238 msgid "Item" msgstr "Item" @@ -1534,6 +1566,14 @@ msgid "Checked organizations see this organizations respondents." msgstr "Checked organizations see this organizations patients." +#: classes/Gems/Default/OrganizationAction.php:162 +msgid "Code name" +msgstr "Code name" + +#: classes/Gems/Default/OrganizationAction.php:162 +msgid "Only for programmers." +msgstr "Only for programmers." + #: classes/Gems/Default/OrganizationAction.php:172 msgid "organization" msgid_plural "organizations" @@ -1652,10 +1692,6 @@ msgid "Version information" msgstr "Version information" -#: 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" @@ -1707,22 +1743,22 @@ msgid "Active tracks" msgstr "Active tracks" -#: classes/Gems/Default/ProjectTracksAction.php:98 +#: classes/Gems/Default/ProjectTracksAction.php:110 #, php-format msgid "Questions in survey %s" msgstr "Questions in survey %s" -#: classes/Gems/Default/ProjectTracksAction.php:106 +#: classes/Gems/Default/ProjectTracksAction.php:118 #: classes/Gems/Default/SurveyAction.php:85 #, php-format msgid "Survey %s does not exist." msgstr "Survey %s does not exist." -#: classes/Gems/Default/ProjectTracksAction.php:109 +#: classes/Gems/Default/ProjectTracksAction.php:121 msgid "Survey not specified." msgstr "Survey not specified." -#: classes/Gems/Default/ProjectTracksAction.php:120 +#: classes/Gems/Default/ProjectTracksAction.php:132 #, php-format msgid "Track %s does not exist." msgstr "Track %s does not exist." @@ -2051,23 +2087,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:158 +#: classes/Gems/Default/StaffAction.php:169 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:174 +#: classes/Gems/Default/StaffAction.php:185 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:208 +#: classes/Gems/Default/StaffAction.php:219 msgid "Primary function" msgstr "Primary function" -#: classes/Gems/Default/StaffAction.php:214 +#: classes/Gems/Default/StaffAction.php:225 msgid "Logout on survey" msgstr "Logout on survey" -#: classes/Gems/Default/StaffAction.php:283 +#: classes/Gems/Default/StaffAction.php:295 msgid "staff member" msgid_plural "staff members" msgstr[0] "staff member" @@ -3110,23 +3146,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:639 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:657 #, php-format msgid "%d: %s - %s" msgstr "%d: %s - %s" -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:642 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:645 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:660 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:663 #, php-format msgid "%d: %s" msgstr "%d: %s" -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:648 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:666 #, php-format msgid "%s - %s" msgstr "%s - %s" -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:690 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:708 msgid "After change" msgstr "After change" @@ -3332,6 +3368,54 @@ msgid "- %s" msgstr "- %s" +#: classes/Gems/User/PasswordChecker.php:95 +#, php-format +msgid "A password should contain at least one uppercase character." +msgid_plural "A password should contain at least %d uppercase characters." +msgstr[0] "A password should contain at least one uppercase character." +msgstr[1] "A password should contain at least %d uppercase characters." + +#: classes/Gems/User/PasswordChecker.php:112 +#, php-format +msgid "A password should contain at least one lowercase character." +msgid_plural "A password should contain at least %d lowercase characters." +msgstr[0] "A password should contain at least one lowercase character." +msgstr[1] "A password should contain at least %d lowercase characters." + +#: classes/Gems/User/PasswordChecker.php:127 +#, php-format +msgid "A password should be at least %d characters long." +msgstr "A password should be at least %d characters long." + +#: classes/Gems/User/PasswordChecker.php:145 +#, php-format +msgid "A password should contain at least one not alphabetic character." +msgid_plural "A password should contain at least %d not alphabetic characters." +msgstr[0] "A password should contain at least one not alphabetic character." +msgstr[1] "A password should contain at least %d not alphabetic characters." + +#: classes/Gems/User/PasswordChecker.php:165 +#, php-format +msgid "A password should contain at least one not alphanumeric character." +msgid_plural "A password should contain at least %d not alphanumeric characters." +msgstr[0] "A password should contain at least one not alphanumeric character." +msgstr[1] "A password should contain at least %d not alphanumeric characters." + +#: classes/Gems/User/PasswordChecker.php:184 +msgid "A password should not contain the login name." +msgstr "A password should not contain the login name." + +#: classes/Gems/User/PasswordChecker.php:201 +#, php-format +msgid "A password should contain at least one number." +msgid_plural "A password should contain at least %d numbers." +msgstr[0] "A password should contain at least one number." +msgstr[1] "A password should contain at least %d numbers." + +#: classes/Gems/User/UserPasswordValidator.php:115 +msgid "Wrong password." +msgstr "Wrong password." + #: classes/Gems/Util/Translated.php:99 msgid "forever" msgstr "forever" @@ -3502,7 +3586,7 @@ msgstr "Value is required and can't be empty" #: languages/FakeTranslations.php:41 -#: languages/FakeTranslations.php:84 +#: languages/FakeTranslations.php:85 msgid "Invalid type given, value should be string, integer or float" msgstr "Invalid type given, value should be string, integer or float" @@ -3515,93 +3599,97 @@ msgid "Your account is temporarily blocked, please wait %s minutes" msgstr "Your account is temporarily blocked, please wait %s minutes" -#: languages/FakeTranslations.php:49 +#: languages/FakeTranslations.php:47 +msgid "You are not allowed to login from this location." +msgstr "You are not allowed to login from this location." + +#: languages/FakeTranslations.php:50 msgid "Not a valid token. The format for valid tokens is: %tokenFormat%." msgstr "Not a valid token. The format for valid tokens is: %tokenFormat%." -#: languages/FakeTranslations.php:50 +#: languages/FakeTranslations.php:51 msgid "Unknown token." msgstr "Unknown token." -#: languages/FakeTranslations.php:51 +#: languages/FakeTranslations.php:52 msgid "This token is no longer valid." msgstr "This token is no longer valid." -#: languages/FakeTranslations.php:52 +#: languages/FakeTranslations.php:53 msgid "This token cannot be used (any more)." msgstr "This token cannot be used (any more)." -#: languages/FakeTranslations.php:53 +#: languages/FakeTranslations.php:54 msgid "This token cannot be used (yet)." msgstr "This token cannot be used (yet)." -#: languages/FakeTranslations.php:56 +#: languages/FakeTranslations.php:57 #, php-format msgid "Date should be '%dateAfter%' or later." msgstr "Date should be '%dateAfter%' or later." -#: languages/FakeTranslations.php:59 +#: languages/FakeTranslations.php:60 #, php-format msgid "Date should be '%dateBefore%' or earlier." msgstr "Date should be '%dateBefore%' or earlier." -#: languages/FakeTranslations.php:62 +#: languages/FakeTranslations.php:63 msgid "%value% is not a valid date." msgstr "%value% is not a valid date." -#: languages/FakeTranslations.php:65 +#: languages/FakeTranslations.php:66 msgid "No record matching %value% was found." msgstr "No record matching %value% was found." -#: languages/FakeTranslations.php:66 +#: languages/FakeTranslations.php:67 msgid "A duplicate record matching '%value%' was found." msgstr "A duplicate record matching '%value%' was found." -#: languages/FakeTranslations.php:69 +#: languages/FakeTranslations.php:70 msgid "This is not a valid %testDescription%." msgstr "This is not a valid %testDescription%." -#: languages/FakeTranslations.php:70 +#: languages/FakeTranslations.php:71 msgid "A %testDescription% cannot contain letters." msgstr "A %testDescription% cannot contain letters." -#: languages/FakeTranslations.php:71 +#: languages/FakeTranslations.php:72 msgid "%value% is too long for a %testDescription%. Should be %length% digits." msgstr "%value% is too long for a %testDescription%. Should be %length% digits." -#: languages/FakeTranslations.php:72 +#: languages/FakeTranslations.php:73 msgid "%value% is too short for a %testDescription%. Should be %length% digits." msgstr "%value% is too short for a %testDescription%. Should be %length% digits." -#: languages/Fake... [truncated message content] |
From: <gem...@li...> - 2011-11-22 15:59:31
|
Revision: 273 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=273&view=rev Author: michieltcs Date: 2011-11-22 15:59:21 +0000 (Tue, 22 Nov 2011) Log Message: ----------- Refs #307 - add Gems_Validate_IPRanges class, use in GroupAction Modified Paths: -------------- trunk/library/classes/Gems/Default/GroupAction.php trunk/library/languages/FakeTranslations.php trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Added Paths: ----------- trunk/library/classes/Gems/Validate/IPRanges.php Modified: trunk/library/classes/Gems/Default/GroupAction.php =================================================================== --- trunk/library/classes/Gems/Default/GroupAction.php 2011-11-22 15:43:20 UTC (rev 272) +++ trunk/library/classes/Gems/Default/GroupAction.php 2011-11-22 15:59:21 UTC (rev 273) @@ -66,7 +66,7 @@ $bridge->addCheckbox('ggp_group_active'); $bridge->addCheckbox('ggp_staff_members'); $bridge->addCheckbox('ggp_respondent_members'); - $bridge->addText('ggp_allowed_ip_ranges'); + $bridge->addText('ggp_allowed_ip_ranges', 'size', 50, 'validator', new Gems_Validate_IPRanges()); } /** Added: trunk/library/classes/Gems/Validate/IPRanges.php =================================================================== --- trunk/library/classes/Gems/Validate/IPRanges.php (rev 0) +++ trunk/library/classes/Gems/Validate/IPRanges.php 2011-11-22 15:59:21 UTC (rev 273) @@ -0,0 +1,97 @@ +<?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. + * + * @package Gems + * @subpackage Validate + * @author Michiel Rook <mi...@to...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Not used anymore, checked if we could use soap connection. As soap is no longer a reliable + * interface in LimeSurvey it is deprecated for now. + * + * @package Gems + * @subpackage Validate + * @author Michiel Rook <mi...@to...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + */ +class Gems_Validate_IPRanges extends Zend_Validate_Abstract +{ + /** + * Error constants + */ + const ERROR_INVALID_IP = 'invalidIPInRange'; + + /** + * Error messages + * @var array + */ + protected $_messageTemplates = array( + self::ERROR_INVALID_IP => 'One or more IPs are illegal.' + ); + + /** + * Returns true if and only if $value meets the validation requirements + * + * If $value fails validation, then this method returns false, and + * getMessages() will return an array of messages that explain why the + * validation failed. + * + * @param mixed $value + * @return boolean + * @throws Zend_Valid_Exception If validation of $value is impossible + */ + public function isValid($value, $context = array()) + { + $result = true; + + $ranges = explode('|', $value); + + foreach ($ranges as $range) { + if (($sep = strpos($range, '-')) !== false) { + $min = ip2long(substr($range, 0, $sep)); + $max = ip2long(substr($range, $sep + 1)); + + if ($min === false || $max === false) { + $result = false; + } + } else if (ip2long($range) === false) { + $result = false; + } + } + + if (!$result) { + $this->_error(self::ERROR_INVALID_IP); + } + + return $result; + } +} Property changes on: trunk/library/classes/Gems/Validate/IPRanges.php ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Date Author Added: svn:eol-style + native Modified: trunk/library/languages/FakeTranslations.php =================================================================== --- trunk/library/languages/FakeTranslations.php 2011-11-22 15:43:20 UTC (rev 272) +++ trunk/library/languages/FakeTranslations.php 2011-11-22 15:59:21 UTC (rev 273) @@ -93,6 +93,9 @@ _("'%value%' is an empty string"); _("Invalid type given. String, integer or float expected"); +// Gems_Validate_IPRanges +_("One or more IPs are illegal."); + // Zend_Validate_EmailAddress replaced by MUtil_Validate_SimpleEmail /* _("Invalid type given, value should be a string"); 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-22 15:43:20 UTC (rev 272) +++ trunk/library/languages/default-nl.po 2011-11-22 15:59:21 UTC (rev 273) @@ -1,4463 +1,4446 @@ -msgid "" -msgstr "" -"Project-Id-Version: Pulse NL\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-22 16:14+0100\n" -"PO-Revision-Date: \n" -"Last-Translator: Matijs de Jong <mj...@ma...>\n" -"Language-Team: Erasmus MGZ <mat...@ma...>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: \n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Poedit-Language: Dutch\n" -"X-Poedit-Country: NETHERLANDS\n" -"X-Poedit-SourceCharset: iso-8859-1\n" -"X-Poedit-Basepath: ../\n" -"X-Poedit-KeywordsList: plural:1,2\n" -"X-Poedit-SearchPath-0: .\n" - -#: classes/GemsEscort.php:207 -#, php-format -msgid "Path %s not writable" -msgstr "Path %s niet schrijfbaar" - -#: classes/GemsEscort.php:887 -#, php-format -msgid "User: %s" -msgstr "Login: %s" - -#: classes/GemsEscort.php:911 -msgid "version" -msgstr "versie" - -#: classes/GemsEscort.php:1342 -msgid "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" -msgstr "Let op: uw sessie is verlopen, uw invoer is niet opgeslagen. Controleer uw gegevens en probeer a.u.b. opnieuw." - -#: classes/GemsEscort.php:1466 -msgid "Please check back later." -msgstr "Probeer het later opnieuw." - -#: classes/GemsEscort.php:1468 -#: classes/GemsEscort.php:1472 -#: classes/GemsEscort.php:1473 -msgid "System is in maintenance mode" -msgstr "Systeem is in onderhoudsmodus" - -#: classes/GemsEscort.php:1483 -msgid "No access to site." -msgstr "Geen toegang tot website." - -#: classes/GemsEscort.php:1485 -#: classes/GemsEscort.php:1521 -msgid "You have no access to this site." -msgstr "U heeft geen toegang tot deze website." - -#: classes/GemsEscort.php:1501 -msgid "No access to page" -msgstr "Geen toegang tot pagina" - -#: classes/GemsEscort.php:1503 -#, 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:1508 -#: classes/GemsEscort.php:1519 -msgid "You are no longer logged in." -msgstr "U bent niet meer ingelogd." - -#: classes/GemsEscort.php:1509 -msgid "You must login to access this page." -msgstr "U moet ingelogd zijn voor toegang tot deze pagina." - -#: classes/Gems/AccessLog.php:239 -msgid "Database needs to be updated!" -msgstr "Database dient ververst te worden!" - -#: classes/Gems/Auth.php:241 -msgid "Combination of organization, username and password not found." -msgstr "Combinatie van organisatie, gebruikersnaam en wachtwoord niet gevonden." - -#: classes/Gems/Html.php:154 -msgid "<< First" -msgstr "<< Eerste" - -#: classes/Gems/Html.php:155 -msgid "< Previous" -msgstr "< Terug" - -#: classes/Gems/Html.php:156 -msgid "Next >" -msgstr "Verder >" - -#: classes/Gems/Html.php:157 -msgid "Last >>" -msgstr "Laatste >>" - -#: classes/Gems/Html.php:158 -msgid " | " -msgstr " | " - -#: classes/Gems/Html.php:162 -msgid "to" -msgstr "tot" - -#: classes/Gems/Html.php:163 -msgid "of" -msgstr "van" - -#: classes/Gems/Menu.php:139 -#, php-format -msgid "About %s" -msgstr "Over %s" - -#: classes/Gems/Menu.php:143 -msgid "Reporting bugs" -msgstr "Meld een bug" - -#: classes/Gems/Menu.php:146 -msgid "Support" -msgstr "Ondersteuning" - -#: classes/Gems/Menu.php:166 -msgid "Project setup" -msgstr "Projectinfo" - -#: classes/Gems/Menu.php:169 -msgid "Database" -msgstr "Database" - -#: classes/Gems/Menu.php:173 -msgid "Content" -msgstr "Inhoud" - -#: classes/Gems/Menu.php:176 -msgid "Execute" -msgstr "Uitvoeren" - -#: classes/Gems/Menu.php:181 -msgid "Patches" -msgstr "Patches" - -#: classes/Gems/Menu.php:182 -msgid "Execute new" -msgstr "Nieuwe aanmaken" - -#: classes/Gems/Menu.php:184 -msgid "Refresh translateables" -msgstr "Ververs vertaalbaren" - -#: classes/Gems/Menu.php:186 -msgid "Run SQL" -msgstr "SQL uitvoeren" - -#: classes/Gems/Menu.php:189 -msgid "Reception codes" -msgstr "Ontvangst codes" - -#: classes/Gems/Menu.php:192 -msgid "Consents" -msgstr "Toestemmingen" - -#: classes/Gems/Menu.php:195 -msgid "Roles" -msgstr "Rollen" - -#: classes/Gems/Menu.php:196 -#: classes/Gems/Menu.php:345 -msgid "Assigned" -msgstr "Toegewezen" - -#: classes/Gems/Menu.php:197 -msgid "Privileges" -msgstr "Priviléges" - -#: classes/Gems/Menu.php:200 -msgid "Groups" -msgstr "Groepen" - -#: classes/Gems/Menu.php:203 -msgid "Organizations" -msgstr "Organisaties" - -#: classes/Gems/Menu.php:206 -msgid "Staff" -msgstr "Medewerkers" - -#: classes/Gems/Menu.php:209 -msgid "Logging" -msgstr "Logboek" - -#: classes/Gems/Menu.php:213 -msgid "Maintenance" -msgstr "Onderhoud" - -#: classes/Gems/Menu.php:218 -msgid "Upgrade" -msgstr "Upgrade" - -#: classes/Gems/Menu.php:219 -#: classes/Gems/Menu.php:318 -msgid "Show" -msgstr "Toon" - -#: classes/Gems/Menu.php:220 -msgid "Execute all" -msgstr "Alles uitvoeren" - -#: classes/Gems/Menu.php:221 -msgid "Execute this" -msgstr "Dit uitvoeren" - -#: classes/Gems/Menu.php:222 -msgid "Execute from here" -msgstr "Uitvoeren vanaf hier" - -#: classes/Gems/Menu.php:223 -msgid "Execute to here" -msgstr "Uitvoeren tot hier" - -#: classes/Gems/Menu.php:235 -#, php-format -msgid "Stand-alone privilige: %s" -msgstr "Zelfstandig privilege: %s" - -#: classes/Gems/Menu.php:242 -msgid "Logon" -msgstr "Login" - -#: classes/Gems/Menu.php:243 -msgid "Lost password" -msgstr "Wachtwoord zoek" - -#: classes/Gems/Menu.php:244 -msgid "Your account" -msgstr "Uw account" - -#: classes/Gems/Menu.php:245 -msgid "Activity overview" -msgstr "Activiteiten overzicht" - -#: classes/Gems/Menu.php:246 -msgid "Change password" -msgstr "Uw wachtwoord" - -#: classes/Gems/Menu.php:247 -#: classes/Gems/Menu.php:287 -#: classes/Gems/Menu.php:322 -msgid "Token" -msgstr "Kenmerk" - -#: classes/Gems/Menu.php:248 -msgid "Logoff" -msgstr "Uitloggen" - -#: classes/Gems/Menu.php:283 -msgid "Track" -msgstr "Traject" - -#: classes/Gems/Menu.php:290 -#: classes/Gems/Menu.php:310 -#: classes/Gems/Menu.php:341 -msgid "Add" -msgstr "Voeg toe" - -#: classes/Gems/Menu.php:294 -#: classes/Gems/Menu.php:377 -msgid "Preview" -msgstr "Preview" - -#: classes/Gems/Menu.php:301 -msgid "Tracks" -msgstr "Trajecten" - -#: classes/Gems/Menu.php:314 -msgid "Assignments" -msgstr "Toewijzingen" - -#: classes/Gems/Menu.php:326 -msgid "Edit" -msgstr "Wijzig" - -#: classes/Gems/Menu.php:330 -msgid "Delete" -msgstr "Verwijder" - -#: classes/Gems/Menu.php:335 -msgid "Surveys" -msgstr "Vragenlijsten" - -#: classes/Gems/Menu.php:367 -msgid "Fill in" -msgstr "Vul in" - -#: classes/Gems/Menu.php:371 -msgid "Print PDF" -msgstr "Print PDF" - -#: classes/Gems/Menu.php:374 -msgid "E-Mail now!" -msgstr "Email nu!" - -#: classes/Gems/Menu.php:380 -msgid "Answers" -msgstr "Antwoorden" - -#: classes/Gems/Menu.php:518 -msgid "Respondents" -msgstr "Patiënten" - -#: classes/Gems/Menu.php:521 -msgid "Overview" -msgstr "Overzicht" - -#: classes/Gems/Menu.php:528 -msgid "Project" -msgstr "Project" - -#: classes/Gems/Menu.php:531 -msgid "Setup" -msgstr "Beheer" - -#: classes/Gems/Menu.php:534 -msgid "Mail" -msgstr "Email" - -#: classes/Gems/Menu.php:537 -msgid "Track Builder" -msgstr "Traject bouwer" - -#: classes/Gems/Menu.php:546 -msgid "Contact" -msgstr "Contact" - -#: classes/Gems/Menu.php:559 -msgid "Changelog" -msgstr "Changelog" - -#: classes/Gems/Model.php:193 -msgid "Respondent nr" -msgstr "Patiënt nr" - -#: classes/Gems/Model.php:194 -msgid "Opened" -msgstr "Bekeken" - -#: classes/Gems/Model.php:195 -msgid "Consent" -msgstr "Toestemming" - -#: classes/Gems/Model.php:197 -msgid "E-Mail" -msgstr "Email" - -#: classes/Gems/Model.php:202 -msgid "Gender" -msgstr "Geslacht" - -#: classes/Gems/Model.php:203 -msgid "First name" -msgstr "Voornaam" - -#: classes/Gems/Model.php:204 -msgid "Surname prefix" -msgstr "Tussenvoegsel" - -#: classes/Gems/Model.php:205 -msgid "Last name" -msgstr "Achternaam" - -#: classes/Gems/Model.php:207 -msgid "Name" -msgstr "Naam" - -#: classes/Gems/Model.php:210 -msgid "Street" -msgstr "Straat" - -#: classes/Gems/Model.php:211 -msgid "Zipcode" -msgstr "Postcode" - -#: classes/Gems/Model.php:212 -msgid "City" -msgstr "Stad" - -#: classes/Gems/Model.php:214 -msgid "Phone" -msgstr "Telefoon" - -#: classes/Gems/Model.php:216 -msgid "Birthday" -msgstr "Geboren op" - -#: classes/Gems/Pdf.php:195 -#, php-format -msgid "PDF Source File '%s' not found!" -msgstr "PDF bron bestand %s niet gevonden!" - -#: classes/Gems/Pdf.php:237 -#, php-format -msgid "Could not create '%s' directory." -msgstr "Kon de directory '%s' niet aanmaken." - -#: classes/Gems/Pdf.php:280 -#, php-format -msgid " The error message is: %s" -msgstr "De foutmelding is: %s" - -#: classes/Gems/Tracker.php:732 -msgid "Checks performed" -msgstr "Controle uitgevoerd" - -#: classes/Gems/UpgradesAbstract.php:164 -msgid "Already at max. level." -msgstr "Al op het hoogste niveau." - -#: classes/Gems/UpgradesAbstract.php:171 -#, php-format -msgid "Trying upgrade for %s from level %s to level %s" -msgstr "Probeert upgrade voor %s van niveau %s naar niveau %s uit te voeren" - -#: classes/Gems/UpgradesAbstract.php:179 -#, php-format -msgid "Trying upgrade for %s to level %s: %s" -msgstr "Probeert upgrade voor %s naar niveau %s: %s" - -#: classes/Gems/UpgradesAbstract.php:337 -msgid "Cache cleaned" -msgstr "Cache opgeschoond" - -#: classes/Gems/Controller/BrowseEditAction.php:346 -#, php-format -msgid "New %s..." -msgstr "Nieuw %s..." - -#: classes/Gems/Controller/BrowseEditAction.php:378 -#, php-format -msgid "Delete %s" -msgstr "Verwijder %s" - -#: classes/Gems/Controller/BrowseEditAction.php:382 -#, php-format -msgid "%2$u %1$s deleted" -msgstr "%2$u %1$s verwijderd" - -#: classes/Gems/Controller/BrowseEditAction.php:396 -#, php-format -msgid "Edit %s" -msgstr "Bewerk %s" - -#: classes/Gems/Controller/BrowseEditAction.php:493 -msgid "Free search text" -msgstr "Vrije zoek tekst" - -#: classes/Gems/Controller/BrowseEditAction.php:564 -msgid "Search" -msgstr "Zoeken" - -#: classes/Gems/Controller/BrowseEditAction.php:580 -#, php-format -msgid "No %s found" -msgstr "Geen %s gevonden" - -#: classes/Gems/Controller/BrowseEditAction.php:653 -#, php-format -msgid "No %s found." -msgstr "Geen %s gevonden." - -#: classes/Gems/Controller/BrowseEditAction.php:768 -msgid "Are you sure?" -msgstr "Weet u het zeker?" - -#: classes/Gems/Controller/BrowseEditAction.php:784 -msgid "Yes" -msgstr "Ja" - -#: classes/Gems/Controller/BrowseEditAction.php:785 -msgid "No" -msgstr "Nee" - -#: classes/Gems/Controller/BrowseEditAction.php:838 -#, php-format -msgid "Unknown %s requested" -msgstr "Onjuist %s verzoek" - -#: classes/Gems/Controller/BrowseEditAction.php:861 -#, php-format -msgid "New %1$s..." -msgstr "Nieuwe %1$s..." - -#: classes/Gems/Controller/BrowseEditAction.php:869 -msgid "Save" -msgstr "Opslaan" - -#: classes/Gems/Controller/BrowseEditAction.php:905 -#, php-format -msgid "%2$u %1$s saved" -msgstr "%2$u %1$s opgeslagen" - -#: classes/Gems/Controller/BrowseEditAction.php:908 -msgid "No changes to save." -msgstr "Geen verandering om op te slaan." - -#: classes/Gems/Controller/BrowseEditAction.php:917 -msgid "Input error! No changes saved!" -msgstr "Invoer fout! Veranderingen niet opgeslagen!" - -#: classes/Gems/Controller/BrowseEditAction.php:945 -#, php-format -msgid "Show %s" -msgstr "Toon %s" - -#: classes/Gems/Controller/BrowseEditAction.php:952 -#, php-format -msgid "Unknown %s." -msgstr "%s is onbekend." - -#: classes/Gems/Controller/ModelActionAbstract.php:97 -#: classes/Gems/Default/AskAction.php:150 -#: classes/Gems/Default/DatabaseAction.php:532 -msgid "Cancel" -msgstr "Annuleren" - -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:181 -msgid "No data found." -msgstr "Geen gegevens gevonden." - -#: classes/Gems/Default/AskAction.php:128 -#, php-format -msgid "Welcome %s," -msgstr "Welkom %s," - -#: classes/Gems/Default/AskAction.php:131 -#, php-format -msgid "Thank you for answering the survey for token %s." -msgstr "Dank u voor het invullen van de vragenlijst voor kenmerk %s." - -#: classes/Gems/Default/AskAction.php:132 -msgid "Please click the button below to answer the next survey." -msgstr "Klik op de onderstaande knop om de volgende vragenlijst in te vullen." - -#: classes/Gems/Default/AskAction.php:137 -#, php-format -msgid "Please click the button below to answer the survey for token %s." -msgstr "Klik op de onderstaande knop om de vragenlijst behorende bij kenmerk %s in te vullen." - -#: classes/Gems/Default/AskAction.php:141 -#, php-format -msgid "Wait one second to open the survey automatically or click on Cancel to stop." -msgid_plural "Wait %d seconds to open the survey automatically or click on Cancel to stop." -msgstr[0] "Over één seconde start de vragenlijst automatisch. Klik op annuleren om dit te onderbreken." -msgstr[1] "Over %d seconden start de vragenlijst automatisch. Klik op annuleren om dit te onderbreken." - -#: classes/Gems/Default/AskAction.php:156 -#, php-format -msgid "After this survey there is one other survey we would like you to answer." -msgid_plural "After this survey there are another %d surveys we would like you to answer." -msgstr[0] "Na deze vragenlijst hebben we nog één andere vragenlijst voor u." -msgstr[1] "Na deze vragenlijst hebben we nog %d andere vragenlijsten voor u." - -#: classes/Gems/Default/AskAction.php:166 -#, php-format -msgid "The survey for token %s is no longer active." -msgstr "De vragenlijst voor kenmerk %s is niet meer in gebruik." - -#: classes/Gems/Default/AskAction.php:170 -#, php-format -msgid "The token %s does not exist." -msgstr "Het kenmerk %s bestaat niet." - -#: classes/Gems/Default/AskAction.php:172 -#, php-format -msgid "Thank you for answering. At the moment we have no further surveys for you to take." -msgstr "Dank u voor uw antwoorden. Op dit moment hebben we geen vragenlijsten meer voor u." - -#: classes/Gems/Default/AskAction.php:174 -#, php-format -msgid "The survey for token %s has been answered and no further surveys are open." -msgstr "De vragenlijst met het kenmerk %s is beantwoord en er staan verder geen vragenlijsten open." - -#: classes/Gems/Default/AskAction.php:181 -#, php-format -msgid "The token %s does not exist (any more)." -msgstr "Het kenmerk %s bestaat niet (meer)." - -#: classes/Gems/Default/AskAction.php:198 -#, php-format -msgid "Enter your %s token" -msgstr "Voer uw %s kenmerk in" - -#: classes/Gems/Default/AskAction.php:203 -#, php-format -msgid "Enter tokens as %s." -msgstr "Kenmerk invoeren als %s." - -#: classes/Gems/Default/AskAction.php:213 -msgid "OK" -msgstr "OK" - -#: classes/Gems/Default/AskAction.php:233 -msgid "The server is currently busy, please wait a while and try again." -msgstr "De server is bezet, wacht u alstublieft een moment en probeer het dan nogmaals." - -#: classes/Gems/Default/AskAction.php:255 -msgid "Tokens identify a survey that was assigned to you personally." -msgstr "Elk kenmerk verwijst naar een specifiek aan u toegekende vragenlijst." - -#: classes/Gems/Default/AskAction.php:255 -msgid "Entering the token and pressing OK will open that survey." -msgstr "Vul uw kenmerk in en druk op OK om die vragenlijst te openen." - -#: classes/Gems/Default/AskAction.php:259 -msgid "After answering the survey you will be logged off automatically." -msgstr "Na het invullen wordt u automatisch uitgelogd." - -#: classes/Gems/Default/AskAction.php:261 -msgid "After answering the survey you will return to the respondent overview screen." -msgstr "Na het invullen van de vragenlijst komt u terug in het patient scherm." - -#: classes/Gems/Default/AskAction.php:268 -msgid "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive." -msgstr "Een kenmerk bestaat uit twee groepen van vier cijfers en letters met een (niet verplicht) streepje ertussen. Hoofdletters of gewone letters maakt niets uit." - -#: classes/Gems/Default/AskAction.php:269 -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:68 -#: classes/Gems/Default/GroupAction.php:88 -msgid "Description" -msgstr "Omschrijving" - -#: classes/Gems/Default/ConsentAction.php:70 -#: classes/Gems/Default/DatabaseAction.php:167 -msgid "Order" -msgstr "Volgorde" - -#: classes/Gems/Default/ConsentAction.php:71 -msgid "Determines order of presentation in interface." -msgstr "Bepaald de presentatie volgorde." - -#: classes/Gems/Default/ConsentAction.php:73 -msgid "Consent code" -msgstr "Consent code" - -#: 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:92 -msgid "respondent consent" -msgid_plural "respondent consents" -msgstr[0] "patiënt toestemming" -msgstr[1] "patiënt toestemmingen" - -#: classes/Gems/Default/ConsentAction.php:97 -msgid "Respondent consents" -msgstr "Patiënt toestemming" - -#: classes/Gems/Default/ContactAction.php:71 -#, php-format -msgid "%s is a web application." -msgstr "%s is een web applicatie." - -#: classes/Gems/Default/ContactAction.php:76 -#, php-format -msgid "The %s project is run by: " -msgstr "%s is een project van: " - -#: classes/Gems/Default/ContactAction.php:82 -#, php-format -msgid "%s is a collaboration of these organizations:" -msgstr "Deze organisaties werken samen voor het %s project:" - -#: classes/Gems/Default/ContactAction.php:103 -#, php-format -msgid "The %s project" -msgstr "Het %s project" - -#: classes/Gems/Default/ContactAction.php:106 -msgid "Information on this application" -msgstr "Information over deze website" - -#: classes/Gems/Default/ContactAction.php:107 -msgid "Links concerning this web application:" -msgstr "Links met informatie over deze website:" - -#: classes/Gems/Default/CronAction.php:148 -msgid "Cron jobs turned off." -msgstr "Cron opdrachten uitgezet." - -#: classes/Gems/Default/CronAction.php:218 -msgid "No mails sent." -msgstr "Geen mail verzonden." - -#: classes/Gems/Default/CronAction.php:221 -msgid "On this test system all mail will be delivered to the from address." -msgstr "Op dit test systeem worden alle emails gestuurd naar het \"van\" adres." - -#: classes/Gems/Default/DatabaseAction.php:64 -#, php-format -msgid "Executed %2$s creation script %1$s:" -msgstr "Uitvoerresultaat %2$s script %1$s:" - -#: classes/Gems/Default/DatabaseAction.php:74 -#, php-format -msgid "%d record(s) returned as result set %d in step %d of %d." -msgstr "%d rij(en) in resultaat %d in stap %d van %d." - -#: classes/Gems/Default/DatabaseAction.php:78 -#, php-format -msgid "%d record(s) updated in step %d of %d." -msgstr "In stap %2$d van %3$d zijn %1$d rij(en) aangepast." - -#: classes/Gems/Default/DatabaseAction.php:81 -#, php-format -msgid "Script ran step %d of %d succesfully." -msgstr "Stap %d van %d in het script met succes uitgevoerd." - -#: classes/Gems/Default/DatabaseAction.php:84 -msgid " in step " -msgstr " in stap " - -#: classes/Gems/Default/DatabaseAction.php:89 -#, php-format -msgid "No script for %1$s." -msgstr "Geen script voor %1$s:" - -#: classes/Gems/Default/DatabaseAction.php:133 -#, php-format -msgid "No rows in %s." -msgstr "Geen gegevens in %s." - -#: classes/Gems/Default/DatabaseAction.php:162 -msgid "Type" -msgstr "Type" - -#: classes/Gems/Default/DatabaseAction.php:166 -msgid "Group" -msgstr "Groep" - -#: classes/Gems/Default/DatabaseAction.php:168 -msgid "Location" -msgstr "Locatie" - -#: classes/Gems/Default/DatabaseAction.php:171 -msgid "Status" -msgstr "Status" - -#: classes/Gems/Default/DatabaseAction.php:172 -msgid "created" -msgstr "bestaat" - -#: classes/Gems/Default/DatabaseAction.php:173 -msgid "not created" -msgstr "niet aanwezig" - -#: classes/Gems/Default/DatabaseAction.php:174 -msgid "unknown" -msgstr "onbekend" - -#: classes/Gems/Default/DatabaseAction.php:177 -msgid "Script" -msgstr "Script" - -#: classes/Gems/Default/DatabaseAction.php:179 -msgid "Changed on" -msgstr "Veranderd op" - -#: classes/Gems/Default/DatabaseAction.php:198 -msgid "This database object does not exist. You cannot delete it." -msgstr "Dit database object bestaat. Het kan dus ook niet verwijderd worden." - -#: classes/Gems/Default/DatabaseAction.php:203 -#, php-format -msgid "Drop %s" -msgstr "Verwijder %s" - -#: classes/Gems/Default/DatabaseAction.php:211 -#, php-format -msgid "There are %d rows in the table." -msgstr "Er zijn %d rijen in deze tabel." - -#: classes/Gems/Default/DatabaseAction.php:213 -#, php-format -msgid "Drop table with %d rows" -msgstr "Tabel met %d rijen aan data verwijderen" - -#: classes/Gems/Default/DatabaseAction.php:214 -msgid "Are you really sure?" -msgstr "Weet u het heel erg zeker?" - -#: classes/Gems/Default/DatabaseAction.php:230 -#, php-format -msgid "%1$s %2$s dropped" -msgstr "%1$s %2$s verwijderd" - -#: classes/Gems/Default/DatabaseAction.php:235 -msgid " during statement " -msgstr " tijdens het commando " - -#: classes/Gems/Default/DatabaseAction.php:246 -#, php-format -msgid "%s no longer exists in the database." -msgstr "%s bestaat niet meer in de database." - -#: classes/Gems/Default/DatabaseAction.php:249 -#, php-format -msgid "%s does not yet exist in the database." -msgstr "%s bestaat nog niet in de database." - -#: classes/Gems/Default/DatabaseAction.php:252 -#, php-format -msgid "%s object does exist." -msgstr "%s object bestaat." - -#: classes/Gems/Default/DatabaseAction.php:270 -msgid "Object is not a table." -msgstr "Niet een tabel object." - -#: classes/Gems/Default/DatabaseAction.php:293 -msgid "Structure" -msgstr "Structuur" - -#: classes/Gems/Default/DatabaseAction.php:302 -msgid "database object" -msgid_plural "database objects" -msgstr[0] "database object" -msgstr[1] "database objects" - -#: classes/Gems/Default/DatabaseAction.php:307 -msgid "Database object overview" -msgstr "Database object overzicht" - -#: classes/Gems/Default/DatabaseAction.php:316 -#: classes/Gems/Default/DatabaseAction.php:368 -msgid "Level" -msgstr "Niveau" - -#: classes/Gems/Default/DatabaseAction.php:317 -#: classes/Gems/Default/DatabaseAction.php:369 -msgid "Subtype" -msgstr "Subtype" - -#: classes/Gems/Default/DatabaseAction.php:319 -msgid "To be executed" -msgstr "Uit te voeren" - -#: classes/Gems/Default/DatabaseAction.php:320 -#: classes/Gems/Default/DatabaseAction.php:372 -msgid "Executed" -msgstr "Uitgevoerd" - -#: classes/Gems/Default/DatabaseAction.php:321 -#: classes/Gems/Default/DatabaseAction.php:373 -msgid "Finished" -msgstr "Afgerond" - -#: classes/Gems/Default/DatabaseAction.php:324 -msgid "Create the patch table!" -msgstr "De patch tabel bestaat nog niet!" - -#: classes/Gems/Default/DatabaseAction.php:326 -#, php-format -msgid "%d new or changed patch(es)." -msgstr "%d nieuwe of veranderde patch(es)." - -#: classes/Gems/Default/DatabaseAction.php:331 -msgid "Gems build" -msgstr "Gems bouwnummer" - -#: classes/Gems/Default/DatabaseAction.php:332 -msgid "Database build" -msgstr "Database versie" - -#: classes/Gems/Default/DatabaseAction.php:334 -msgid "Execute level" -msgstr "Uit te voeren versie" - -#: classes/Gems/Default/DatabaseAction.php:338 -msgid "Ignore finished" -msgstr "Afgeronde patches overslaan" - -#: classes/Gems/Default/DatabaseAction.php:339 -msgid "Ignore executed" -msgstr "Uitgevoerde patches overslaan" - -#: classes/Gems/Default/DatabaseAction.php:340 -msgid "Show patches" -msgstr "Toon patches" - -#: classes/Gems/Default/DatabaseAction.php:354 -#, php-format -msgid "%d patch(es) executed." -msgstr "%d patch(es) uitgevoerd." - -#: classes/Gems/Default/DatabaseAction.php:367 -msgid "Patch" -msgstr "Patch" - -#: classes/Gems/Default/DatabaseAction.php:371 -msgid "Query" -msgstr "Query" - -#: classes/Gems/Default/DatabaseAction.php:374 -msgid "Result" -msgstr "Resultaat" - -#: classes/Gems/Default/DatabaseAction.php:398 -msgid "Patch maintenance" -msgstr "Patch onderhoud" - -#: classes/Gems/Default/DatabaseAction.php:402 -msgid "Patch overview" -msgstr "Patch overzicht" - -#: classes/Gems/Default/DatabaseAction.php:464 -msgid "This database object does not exist. You cannot create it." -msgstr "Dit database object bestaat niet en kan ook niet aangemaakt worden." - -#: classes/Gems/Default/DatabaseAction.php:470 -msgid "This database object has no script. You cannot execute it." -msgstr "Dit database object heeft geen script. Het kan dus ook niet uitgevoerd worden." - -#: classes/Gems/Default/DatabaseAction.php:481 -#, php-format -msgid "Run %s" -msgstr "Voer %s script uit" - -#: classes/Gems/Default/DatabaseAction.php:500 -#, php-format -msgid "Starting %d object creation scripts." -msgstr "Aanvang %d object aanmaak scripts." - -#: classes/Gems/Default/DatabaseAction.php:505 -#, php-format -msgid "Finished %s creation script for object %d of %d" -msgstr "Klaar %s met aanmaak script voor object %d van %d" - -#: classes/Gems/Default/DatabaseAction.php:509 -msgid "All objects exist. Nothing was executed." -msgstr "Alle objects bestaan. Niets was uitgevoerd." - -#: classes/Gems/Default/DatabaseAction.php:515 -msgid "Create not-existing database objects" -msgstr "Aanmaak van database objecten die nog niet bestaan" - -#: classes/Gems/Default/DatabaseAction.php:517 -#, php-format -msgid "One database object does not exist." -msgid_plural "These %d database objects do not exist." -msgstr[0] "Één object bestaat nog niet in de database." -msgstr[1] "%d objecten bestaan nog niet in de database." - -#: classes/Gems/Default/DatabaseAction.php:518 -msgid "Are you sure you want to create it?" -msgid_plural "Are you sure you want to create them all?" -msgstr[0] "Weet je zeker dat je dat object wil aanmaken?" -msgstr[1] "Weet je zeker dat je ze allemaal wil aanmaken?" - -#: classes/Gems/Default/DatabaseAction.php:531 -msgid "All database objects exist. There is nothing to create." -msgstr "Alle database objecten bestaan. Er valt niets te maken." - -#: classes/Gems/Default/DatabaseAction.php:544 -msgid "Separate multiple commands with semicolons (;)." -msgstr "Scheidt meerdere commando's met punt-comma's (;)." - -#: classes/Gems/Default/DatabaseAction.php:551 -msgid "Run" -msgstr "Uitvoeren" - -#: classes/Gems/Default/DatabaseAction.php:560 -msgid "raw" -msgstr "rauw" - -#: classes/Gems/Default/DatabaseAction.php:569 -#, php-format -msgid "Result set %s." -msgstr "Resultaat %s." - -#: classes/Gems/Default/DatabaseAction.php:592 -msgid "Execute raw SQL" -msgstr "SQL direct uitvoeren" - -#: classes/Gems/Default/DatabaseAction.php:595 -msgid "Result sets" -msgstr "Resultaten" - -#: classes/Gems/Default/DatabaseAction.php:620 -msgid "This database object does not exist. You cannot view it." -msgstr "Dit database object bestaat. Het kan dus ook niet bekeken worden." - -#: classes/Gems/Default/DatabaseAction.php:625 -#, php-format -msgid "The data in table %s" -msgstr "De gegevens in tabel %s" - -#: classes/Gems/Default/DatabaseAction.php:626 -#, php-format -msgid "Contents of %s %s" -msgstr "De inhoud van %s %s" - -#: classes/Gems/Default/ExportAction.php:69 -msgid "Data" -msgstr "Data" - -#: classes/Gems/Default/ExportAction.php:74 -msgid "Export data" -msgstr "Exporteer gegevens" - -#: classes/Gems/Default/ExportAction.php:153 -#: classes/Gems/Default/MailJobAction.php:121 -msgid "Survey" -msgstr "Vragenlijst" - -#: classes/Gems/Default/ExportAction.php:168 -#, php-format -msgid "%s records found." -msgstr "%s records gevonden." - -#: classes/Gems/Default/ExportAction.php:172 -#: classes/Gems/Default/IndexAction.php:162 -#: classes/Gems/Default/MailJobAction.php:119 -msgid "Organization" -msgstr "Organisatie" - -#: classes/Gems/Default/ExportAction.php:181 -msgid "Export to" -msgstr "Exporteer naar" - -#: classes/Gems/Default/GroupAction.php:89 -#: classes/Gems/Default/LogAction.php:170 -msgid "Role" -msgstr "Rol" - -#: classes/Gems/Default/GroupAction.php:92 -#: classes/Gems/Default/MailJobAction.php:104 -msgid "Active" -msgstr "Actief" - -#: classes/Gems/Default/GroupAction.php:96 -msgid "Allowed IP Ranges" -msgstr "Toegestane IP adres reeksen" - -#: classes/Gems/Default/GroupAction.php:105 -msgid "group" -msgid_plural "groups" -msgstr[0] "groep" -msgstr[1] "groepen" - -#: classes/Gems/Default/GroupAction.php:110 -msgid "Administrative groups" -msgstr "Beheer groepen" - -#: classes/Gems/Default/IndexAction.php:83 -msgid "Enter your token..." -msgstr "Voer uw kenmerk in..." - -#: classes/Gems/Default/IndexAction.php:124 -#, php-format -msgid "Login to %s application" -msgstr "%s login" - -#: classes/Gems/Default/IndexAction.php:128 -msgid "Login" -msgstr "Login" - -#: classes/Gems/Default/IndexAction.php:145 -msgid "Back to login" -msgstr "Terug naar de login" - -#: classes/Gems/Default/IndexAction.php:183 -msgid "Password" -msgstr "Wachtwoord" - -#: classes/Gems/Default/IndexAction.php:198 -#, php-format -msgid "Reset password for %s application" -msgstr "Reset wachtwoord voor %s" - -#: classes/Gems/Default/IndexAction.php:202 -msgid "Reset password" -msgstr "Reset wachtwoord" - -#: classes/Gems/Default/IndexAction.php:248 -msgid "Username" -msgstr "Gebruikersnaam" - -#: classes/Gems/Default/IndexAction.php:288 -msgid "Your password must be changed." -msgstr "Uw wachtwoord moet veranderd worden." - -#: classes/Gems/Default/IndexAction.php:301 -#, php-format -msgid "Login successful, welcome %s." -msgstr "Login in orde, welkom %s." - -#: classes/Gems/Default/IndexAction.php:341 -#, php-format -msgid "Good bye: %s." -msgstr "Tot ziens: %s." - -#: classes/Gems/Default/IndexAction.php:366 -msgid "Reset accepted, enter your new password." -msgstr "Reset geaccepteerd, voer uw nieuwe wachtwoord in." - -#: classes/Gems/Default/IndexAction.php:370 -msgid "This key timed out or does not belong to this user." -msgstr "Te oude sleutel of sleutel hoort niet bij gebruiker." - -#: classes/Gems/Default/IndexAction.php:387 -msgid "Password reset requested" -msgstr "Wachtwoord reset aangevraagd" - -#: classes/Gems/Default/IndexAction.php:388 -#, php-format -msgid "To reset your password for %s, please click this link: %s" -msgstr "Om uw wachtwoord voor %s te resetten, klik op deze link: %s" - -#: classes/Gems/Default/IndexAction.php:393 -msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail." -msgstr "We hebben u een email met reset link gestuurd. Klik op de link in de email." - -#: classes/Gems/Default/IndexAction.php:395 -msgid "Unable to send e-mail." -msgstr "Verzenden e-mail mislukt." - -#: classes/Gems/Default/IndexAction.php:400 -msgid "No such user found or no e-mail address known or user cannot be reset." -msgstr "Gebruiker niet gevonden of e-mail adres onbekend of gebruiker kan niet gereset worden." - -#: classes/Gems/Default/IndexAction.php:404 -msgid "We received your password reset key." -msgstr "Wachtwoord resetsleutel ontvangen." - -#: classes/Gems/Default/IndexAction.php:405 -msgid "Please enter the organization and username belonging to this key." -msgstr "Geef de organisatie en gebruikersnaam die bij deze sleutel horen op." - -#: classes/Gems/Default/InvitationAction.php:52 -msgid "Invite" -msgstr "Uitnodigen" - -#: classes/Gems/Default/LanguageAction.php:63 -msgid "Cookies must be enabled for setting the language." -msgstr "Zonder cookies kan de taal niet ingesteld worden." - -#: classes/Gems/Default/LanguageAction.php:66 -msgid "Invalid language setting." -msgstr "Ongeldige taal instelling." - -#: classes/Gems/Default/LogAction.php:61 -msgid "from" -msgstr "vanaf" - -#: classes/Gems/Default/LogAction.php:66 -msgid "until" -msgstr "tot" - -#: classes/Gems/Default/LogAction.php:72 -msgid "days" -msgstr "dagen" - -#: classes/Gems/Default/LogAction.php:73 -msgid "weeks" -msgstr "weken" - -#: classes/Gems/Default/LogAction.php:74 -msgid "months" -msgstr "maanden" - -#: classes/Gems/Default/LogAction.php:75 -msgid "years" -msgstr "jaren" - -#: classes/Gems/Default/LogAction.php:96 -msgid "Staff:" -msgstr "Medewerkers:" - -#: classes/Gems/Default/LogAction.php:100 -msgid "All staff" -msgstr "Alle medewerkers" - -#: classes/Gems/Default/LogAction.php:102 -msgid "Patient:" -msgstr "Patiënt:" - -#: classes/Gems/Default/LogAction.php:106 -msgid "All patients" -msgstr "Alle patiënten" - -#: classes/Gems/Default/LogAction.php:109 -msgid "Action:" -msgstr "Actie:" - -#: classes/Gems/Default/LogAction.php:112 -msgid "All actions" -msgstr "Alle acties" - -#: classes/Gems/Default/LogAction.php:163 -msgid "Date" -msgstr "Datum" - -#: classes/Gems/Default/LogAction.php:164 -#: classes/Gems/Default/LogMaintenanceAction.php:52 -msgid "Action" -msgstr "Actie" - -#: classes/Gems/Default/LogAction.php:165 -msgid "Message" -msgstr "Bericht" - -#: classes/Gems/Default/LogAction.php:167 -msgid "Respondent" -msgstr "Patiënt" - -#: classes/Gems/Default/LogAction.php:171 -msgid "IP address" -msgstr "IP adres" - -#: classes/Gems/Default/LogAction.php:178 -#: classes/Gems/Default/LogMaintenanceAction.php:53 -msgid "Log" -msgstr "Logboek" - -#: classes/Gems/Default/LogMaintenanceAction.php:70 -msgid "Log:" -msgstr "Logboek:" - -#: classes/Gems/Default/LogMaintenanceAction.php:71 -msgid "All" -msgstr "Alles" - -#: classes/Gems/Default/LogMaintenanceAction.php:77 -msgid "Log action" -msgstr "Logboek actie" - -#: classes/Gems/Default/LogMaintenanceAction.php:81 -msgid "Log maintenance" -msgstr "Logboek onderhoud" - -#: classes/Gems/Default/MailJobAction.php:62 -msgid "No automatic mail jobs found..." -msgstr "Geen automatische mail opdrachten gevonden.." - -#: classes/Gems/Default/MailJobAction.php:72 -msgid "New automatic mail job..." -msgstr "Nieuwe automatische mail opdracht..." - -#: classes/Gems/Default/MailJobAction.php:100 -msgid "Template" -msgstr "Sjabloon" - -#: classes/Gems/Default/MailJobAction.php:101 -msgid "By staff member" -msgstr "Door medewerke" - -#: classes/Gems/Default/MailJobAction.php:103 -msgid "Used for logging and possibly from address." -msgstr "Gebruikt voor activiteiten log en eventueel voor vanaf adres." - -#: classes/Gems/Default/MailJobAction.php:106 -msgid "Job is only run when active." -msgstr "Een opdracht wordt alleen uitgevoerd als deze actief is." - -#: classes/Gems/Default/MailJobAction.php:109 -msgid "From address used" -msgstr "Gebruikte vanaf adres" - -#: classes/Gems/Default/MailJobAction.php:111 -msgid "From other" -msgstr "Vanaf overig" - -#: classes/Gems/Default/MailJobAction.php:112 -#, php-format -msgid "Only when '%s' is '%s'." -msgstr "Aleen als '%s' is '%s'." - -#: classes/Gems/Default/MailJobAction.php:114 -msgid "Processing Method" -msgstr "Verwerkings methode" - -#: classes/Gems/Default/MailJobAction.php:115 -msgid "Filter for" -msgstr "Selecteer op" - -#: classes/Gems/Default/MailJobAction.php:116 -msgid "Days between reminders" -msgstr "Aantal dagen tussen herinneringen" - -#: classes/Gems/Default/MailJobAction.php:132 -msgid "Do you want to delete this mail job?" -msgstr "Weet je zeker dat deze automatische mail opdracht verwijderd moet worden?" - -#: classes/Gems/Default/MailJobAction.php:143 -msgid "Edit automatic mail job" -msgstr "Automatische mail opdracht bewerken" - -#: classes/Gems/Default/MailJobAction.php:156 -msgid "First mail" -msgstr "Eerste mail" - -#: classes/Gems/Default/MailJobAction.php:157 -msgid "Reminder" -msgstr "Herinnering" - -#: classes/Gems/Default/MailJobAction.php:168 -msgid "Use organizational from address" -msgstr "Gebruik vanaf adres van organisatie" - -#: classes/Gems/Default/MailJobAction.php:171 -#, php-format -msgid "Use site %s address" -msgstr "Gebruik %s adres van de site" - -#: classes/Gems/Default/MailJobAction.php:174 -msgid "Use the 'By staff member' address" -msgstr "Gebruik 'Door medewerker' adres" - -#: classes/Gems/Default/MailJobAction.php:175 -msgid "Other" -msgstr "Overige" - -#: classes/Gems/Default/MailJobAction.php:185 -msgid "Automatic mail jobs" -msgstr "Automatische mail opdrachten " - -#: classes/Gems/Default/MailJobAction.php:189 -#, php-format -msgid "Automatic mails have been turned off since %s." -msgstr "Automatische mail opdrachten staan sinds %s uit." - -#: classes/Gems/Default/MailJobAction.php:193 -msgid "Turn Automatic Mail Jobs ON" -msgstr "Automatische mail opdrachten AANzetten" - -#: 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 "Met automatische mail opdrachten en een cron opdracht op de server, kunnen mails verstuurd worden zonder dat een gebruiker actie hoeft te ondernemen." - -#: classes/Gems/Default/MailJobAction.php:207 -msgid "Automatic mail job details" -msgstr "Automatische mail opdracht details" - -#: classes/Gems/Default/MailLogAction.php:107 -msgid "Date sent" -msgstr "Verzend datum" - -#: classes/Gems/Default/MailLogAction.php:108 -msgid "Receiver" -msgstr "Ontvanger" - -#: classes/Gems/Default/MailLogAction.php:109 -msgid "To address" -msgstr "Adres aan" - -#: classes/Gems/Default/MailLogAction.php:110 -msgid "Sender" -msgstr "Verzender" - -#: classes/Gems/Default/MailLogAction.php:111 -msgid "From address" -msgstr "Adres van" - -#: classes/Gems/Default/MailLogAction.php:113 -#: classes/Gems/Default/MailTemplateAction.php:61 -msgid "Subject" -msgstr "Onderwerp" - -#: classes/Gems/Default/MailLogAction.php:129 -msgid "Mail Activity Log" -msgstr "Logboek Mail Activiteit" - -#: classes/Gems/Default/MailLogAction.php:140 -msgid "Show Mail Activity Log item" -msgstr "Toon Logboek Mail item" - -#: classes/Gems/Default/MailServerAction.php:68 -msgid "From address [part]" -msgstr "Vanaf adres [gedeelte]" - -#: classes/Gems/Default/MailServerAction.php:70 -msgid "E.g.: '%', '%.org' or '%@gemstracker.org' or 'ro...@ge...'." -msgstr "Bijvoorbeeld: '%', '%.nl' of '%@gemstracker.nl' of 'ro...@ge...'." - -#: classes/Gems/Default/MailServerAction.php:71 -msgid "Server" -msgstr "Server" - -#: classes/Gems/Default/MailServerAction.php:73 -msgid "Encryption" -msgstr "Encryptie" - -#: classes/Gems/Default/MailServerAction.php:76 -msgid "None" -msgstr "Geen" - -#: classes/Gems/Default/MailServerAction.php:77 -msgid "SSL" -msgstr "SSL" - -#: classes/Gems/Default/MailServerAction.php:78 -msgid "TLS" -msgstr "TLS" - -#: classes/Gems/Default/MailServerAction.php:80 -msgid "Port" -msgstr "Poort" - -#: classes/Gems/Default/MailServerAction.php:82 -msgid "Normal values: 25 for TLS and no encryption, 465 for SSL" -msgstr "Standaard waardes: 25 voor TLS en voor geen encryptie, 465 voor SSL" - -#: classes/Gems/Default/MailServerAction.php:84 -msgid "User ID" -msgstr "Gebruikers ID" - -#: classes/Gems/Default/MailServerAction.php:90 -#: classes/Gems/Default/OptionAction.php:113 -#: classes/Gems/Default/OptionAction.php:118 -#: classes/Gems/Default/SourceAction.php:95 -#: classes/Gems/Default/StaffAction.php:151 -msgid "Repeat password" -msgstr "Herhaal wachtwoord" - -#: classes/Gems/Default/MailServerAction.php:91 -#: classes/Gems/Default/SourceAction.php:74 -#: classes/Gems/Default/StaffAction.php:126 -msgid "Enter only when changing" -msgstr "Alleen invoeren om het wachtwoord te wijzigen" - -#: classes/Gems/Default/MailServerAction.php:100 -msgid "email server" -msgid_plural "email servers" -msgstr[0] "email server" -msgstr[1] "email servers" - -#: classes/Gems/Default/MailServerAction.php:105 -msgid "Email servers" -msgstr "Email servers" - -#: classes/Gems/Default/MailTemplateAction.php:75 -#: classes/Gems/Default/StaffAction.php:239 -msgid "(all organizations)" -msgstr "(alle organisaties)" - -#: classes/Gems/Default/MailTemplateAction.php:94 -msgid "email template" -msgid_plural "email templates" -msgstr[0] "email sjabloon" -msgstr[1] "email sjablonen" - -#: classes/Gems/Default/MailTemplateAction.php:99 -msgid "Email templates" -msgstr "Email sjabloon" - -#: classes/Gems/Default/OptionAction.php:84 -msgid "You are not allowed to change your password." -msgstr "U mag uw wachtwoord niet wijzigen." - -#: classes/Gems/Default/OptionAction.php:96 -msgid "Current password" -msgstr "Huidig wachtwoord" - -#: classes/Gems/Default/OptionAction.php:107 -#: classes/Gems/Default/OptionAction.php:123 -msgid "New password" -msgstr "Nieuw wachtwoord" - -#: classes/Gems/Default/OptionAction.php:137 -msgid "New password is active." -msgstr "Nieuwe wachtwoord geactiveerd." - -#: classes/Gems/Default/OptionAction.php:143 -msgid "Caps Lock seems to be on!" -msgstr "De Caps Lock toets lijkt aan te staan!" - -#: classes/Gems/Default/OptionAction.php:181 -msgid "Login Name" -msgstr "Login Naam" - -#: classes/Gems/Default/OptionAction.php:188 -#: classes/Gems/Default/OrganizationAction.php:140 -#: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:224 -msgid "Language" -msgstr "Taal" - -#: classes/Gems/Default/OptionAction.php:198 -#, php-format -msgid "Options" -msgstr "Instellingen" - -#: classes/Gems/Default/OptionAction.php:207 -msgid "This overview provides information about the last login activity on your account." -msgstr "Dit overzicht geeft informatie over de recente inlog activiteit op uw account." - -#: classes/Gems/Default/OptionAction.php:227 -msgid "Date / time" -msgstr "Datum / tijd" - -#: classes/Gems/Default/OptionAction.php:233 -msgid "item" -msgid_plural "items" -msgstr[0] "item" -msgstr[1] "items" - -#: classes/Gems/Default/OptionAction.php:238 -msgid "Item" -msgstr "Item" - -#: classes/Gems/Default/OrganizationAction.php:105 -msgid "Cookies must be enabled." -msgstr "Zonder cookies kan de taal niet ingesteld worden." - -#: classes/Gems/Default/OrganizationAction.php:108 -msgid "Invalid organization." -msgstr "Ongeldige organisatie." - -#: classes/Gems/Default/OrganizationAction.php:129 -msgid "Url" -msgstr "Url" - -#: classes/Gems/Default/OrganizationAction.php:130 -msgid "Task" -msgstr "Taak" - -#: classes/Gems/Default/OrganizationAction.php:131 -msgid "Contact name" -msgstr "Contact naam" - -#: classes/Gems/Default/OrganizationAction.php:132 -msgid "Contact email" -msgstr "Contact email" - -#: classes/Gems/Default/OrganizationAction.php:135 -msgid "Style" -msgstr "Stijl" - -#: classes/Gems/Default/OrganizationAction.php:145 -msgid "Allow new respondents" -msgstr "Nieuwe patiënten toestaan" - -#: classes/Gems/Default/OrganizationAction.php:150 -msgid "Greeting" -msgstr "Begroeting" - -#: classes/Gems/Default/OrganizationAction.php:150 -#: classes/Gems/Default/OrganizationAction.php:151 -msgid "For emails and token forward screen." -msgstr "Voor emails en kenmerk scherm." - -#: classes/Gems/Default/OrganizationAction.php:151 -msgid "Signature" -msgstr "Handtekening" - -#: classes/Gems/Default/OrganizationAction.php:153 -msgid "Accessible by" -msgstr "Toegankelijk voor" - -#: classes/Gems/Default/OrganizationAction.php:153 -msgid "Checked organizations see this organizations respondents." -msgstr "Geselecteerde organizaties kunnen de patiënten van deze organisatie bekijken." - -#: classes/Gems/Default/OrganizationAction.php:162 -msgid "Code name" -msgstr "Code naam" - -#: classes/Gems/Default/OrganizationAction.php:162 -msgid "Only for programmers." -msgstr "Uitsluitend voor programmeurs." - -#: classes/Gems/Default/OrganizationAction.php:172 -msgid "organization" -msgid_plural "organizations" -msgstr[0] "organisatie" -msgstr[1] "organisaties" - -#: classes/Gems/Default/OrganizationAction.php:177 -msgid "Participating organizations" -msgstr "Deelnemende organisaties" - -#: classes/Gems/Default/OverviewPlanAction.php:115 -#: classes/Gems/Default/ProjectSurveysAction.php:88 -#: classes/Gems/Default/SurveyAction.php:203 -msgid "survey" -msgid_plural "surveys" -msgstr[0] "vragenlijst" -msgstr[1] "vragenlijsten" - -#: classes/Gems/Default/OverviewPlanAction.php:120 -msgid "Planning overview" -msgstr "Planning overzicht" - -#: classes/Gems/Default/ProjectInformationAction.php:83 -msgid "empty file" -msgstr "leeg bestand" - -#: classes/Gems/Default/ProjectInformationAction.php:87 -msgid "file not found" -msgstr "bestand niet gevonden" - -#: classes/Gems/Default/ProjectInformationAction.php:120 -msgid "Logged errors" -msgstr "Opgeslagen foutmeldingen" - -#: classes/Gems/Default/ProjectInformationAction.php:120 -msgid "Empty logfile" -msgstr "Verwijder alle foutmeldingen" - -#: classes/Gems/Default/ProjectInformationAction.php:125 -msgid "Project information" -msgstr "Project informatie" - -#: classes/Gems/Default/ProjectInformationAction.php:129 -msgid "Project name" -msgstr "Project naam" - -#: classes/Gems/Default/ProjectInformationAction.php:130 -msgid "Project version" -msgstr "Project versie" - -#: classes/Gems/Default/ProjectInformationAction.php:131 -msgid "Gems version" -msgstr "Gems versie" - -#: classes/Gems/Default/ProjectInformationAction.php:133 -msgid "Gems project" -msgstr "Gems project" - -#: classes/Gems/Default/ProjectInformationAction.php:134 -msgid "Gems web directory" -msgstr "Gems web folder" - -#: classes/Gems/Default/ProjectInformationAction.php:135 -msgid "Gems code directory" -msgstr "Gems code folder" - -#: classes/Gems/Default/ProjectInformationAction.php:136 -msgid "Gems project path" -msgstr "Gems project folder" - -#: classes/Gems/Default/ProjectInformationAction.php:137 -msgid "MUtil version" -msgstr "MUtil versie" - -#: classes/Gems/Default/ProjectInformationAction.php:138 -msgid "Zend version" -msgstr "Zend versie" - -#: classes/Gems/Default/ProjectInformationAction.php:139 -msgid "Application environment" -msgstr "Applicatie omgeving" - -#: classes/Gems/Default/ProjectInformationAction.php:140 -msgid "Application baseuri" -msgstr "Applicatie baseuri" - -#: classes/Gems/Default/ProjectInformationAction.php:141 -msgid "Application directory" -msgstr "Applicatie folder" - -#: classes/Gems/Default/ProjectInformationAction.php:142 -msgid "PHP version" -msgstr "PHP versie" - -#: classes/Gems/Default/ProjectInformationAction.php:143 -msgid "Server Hostname" -msgstr "Webserver naam" - -#: classes/Gems/Default/ProjectInformationAction.php:144 -msgid "Server OS" -msgstr "Server besturingssysteem" - -#: classes/Gems/Default/ProjectInformationAction.php:145 -msgid "Time on server" -msgstr "De tijd op de server" - -#: classes/Gems/Default/ProjectInformationAction.php:149 -msgid "Turn Maintenance Mode OFF" -msgstr "Onderhoudsmodus UITzetten" - -#: classes/Gems/Default/ProjectInformationAction.php:151 -msgid "Turn Maintenance Mode ON" -msgstr "Onderhoudsmodus AANzetten" - -#: classes/Gems/Default/ProjectInformationAction.php:161 -msgid "Version information" -msgstr "Versie informatie" - -#: classes/Gems/Default/ProjectInformationAction.php:195 -msgid "Server PHP Info" -msgstr "Server PHP Info" - -#: classes/Gems/Default/ProjectInformationAction.php:208 -msgid "Project settings" -msgstr "Project instellingen" - -#: classes/Gems/Default/ProjectInformationAction.php:215 -msgid "Session content" -msgstr "Sessie inhoud" - -#: classes/Gems/Default/ProjectInformationAction.php:216 -msgid "Session" -msgstr "Sessie" - -#: classes/Gems/Default/ProjectSurveysAction.php:68 -#: classes/Gems/Default/SurveyAction.php:192 -msgid "By" -msgstr "Door" - -#: classes/Gems/Default/ProjectSurveysAction.php:69 -#: classes/Gems/Default/ProjectTracksAction.php:67 -#: classes/Gems/Default/SurveyAction.php:193 -msgid "From" -msgstr "Van" - -#: classes/Gems/Default/ProjectSurveysAction.php:70 -#: classes/Gems/Default/ProjectTracksAction.php:68 -#: classes/Gems/Default/SurveyAction.php:195 -msgid "Until" -msgstr "Tot" - -#: classes/Gems/Default/ProjectSurveysAction.php:93 -msgid "Active surveys" -msgstr "Beschikbare vragenlijsten" - -#: classes/Gems/Default/ProjectTracksAction.php:65 -msgid "Survey #" -msgstr "Vragenlijsten" - -#: classes/Gems/Default/ProjectTracksAction.php:85 -msgid "track" -msgid_plural "tracks" -msgstr[0] "traject" -msgstr[1] "trajecten" - -#: classes/Gems/Default/ProjectTracksAction.php:90 -msgid "Active tracks" -msgstr "Beschikbare trajecten" - -#: classes/Gems/Default/ProjectTracksAction.php:110 -#, php-format -msgid "Questions in survey %s" -msgstr "Vragen in vragenlijsten %s" - -#: classes/Gems/Default/ProjectTracksAction.php:118 -#: classes/Gems/Default/SurveyAction.php:85 -#, php-format -msgid "Survey %s does not exist." -msgstr "Vragenlijst %s bestaat niet." - -#: classes/Gems/Default/ProjectTracksAction.php:121 -msgid "Survey not specified." -msgstr "Vragenlijst niet opgegeven." - -#: classes/Gems/Default/ProjectTracksAction.php:132 -#, php-format -msgid "Track %s does not exist." -msgstr "Trajectnummer %s bestaat niet." - -#: classes/Gems/Default/ReceptionAction.php:55 -msgid "Can be assigned to" -msgstr "Kan toegewezen worden aan" - -#: classes/Gems/Default/ReceptionAction.php:56 -msgid "Additional action" -msgstr "Aanvullende actie" - -#: classes/Gems/Default/ReceptionAction.php:79 -msgid "Code" -msgstr "Code" - -#: classes/Gems/Default/ReceptionAction.php:82 -msgid "Is success code" -msgstr "Is succes code" - -#: classes/Gems/Default/ReceptionAction.php:86 -msgid "This reception code is a success code." -msgstr "Aanzetten als deze ontvangst code positief is." - -#: classes/Gems/Default/ReceptionAction.php:90 -msgid "Only active codes can be selected." -msgstr "Alleen actieve codes kunnen geselecteerd worden." - -#: classes/Gems/Default/ReceptionAction.php:91 -msgid "For respondents" -msgstr "Voor patiënten" - -#: classes/Gems/Default/ReceptionAction.php:94 -msgid "This reception code can be assigned to a respondent." -msgstr "Deze ontvangstcode kan aan een patiënt toegewezen worden." - -#: classes/Gems/Default/ReceptionAction.php:95 -msgid "For tracks" -msgstr "Voor trajecten" - -#: classes/Gems/Default/ReceptionAction.php:98 -msgid "This reception code can be assigned to a track." -msgstr "Deze ontvangstcode kan aan een traject toegewezen worden." - -#: classes/Gems/Default/ReceptionAction.php:99 -msgid "For surveys" -msgstr "Voor vragenlijsten" - -#: classes/Gems/Default/ReceptionAction.php:102 -msgid "This reception code can be assigned to a survey." -msgstr "Deze ontvangstcode kan aan een vragenlijst toegewezen worden." - -#: classes/Gems/Default/ReceptionAction.php:103 -msgid "Redo survey" -msgstr "Vragenlijsten herhalen" - -#: classes/Gems/Default/ReceptionAction.php:106 -msgid "Redo a survey on this reception code." -msgstr "Herhaal vragenlijst bij deze ontvangstcode." - -#: classes/Gems/Default/ReceptionAction.php:107 -msgid "Overwrite ansers" -msgstr "Overschrijf bestaande antwoorden" - -#: classes/Gems/Default/ReceptionAction.php:110 -msgid "Remove the consent from already answered surveys." -msgstr "Verwijder \"informed consent\" van beantwoorde vragenlijsten" - -#: classes/Gems/Default/ReceptionAction.php:128 -msgid "reception code" -msgid_plural "reception codes" -msgstr[0] "Ontvangst code" -msgstr[1] "Ontvangst code" - -#: classes/Gems/Default/RespondentAction.php:119 -#, php-format -msgid "Random Example BSN: %s" -msgstr "Willekeurig voorbeeld BSN: %s" - -#: classes/Gems/Default/RespondentAction.php:122 -msgid "Enter a 9-digit SSN number." -msgstr "Voer een BSN nummer van 9 cijfers in." - -#: classes/Gems/Default/RespondentAction.php:131 -msgid "Identification" -msgstr "Identificatie" - -#: classes/Gems/Default/RespondentAction.php:132 -msgid "SSN" -msgstr "SSN" - -#: classes/Gems/Default/RespondentAction.php:136 -msgid "Patient number" -msgstr "Patiënt nummer" - -#: classes/Gems/Default/RespondentAction.php:145 -msgid "Medical data" -msgstr "Medische gegevens" - -#: classes/Gems/Default/RespondentAction.php:152 -msgid "DBC's, etc..." -msgstr "DBC's, etc..." - -#: classes/Gems/Default/RespondentAction.php:155 -msgid "Contact information" -msgstr "Contact informatie" - -#: classes/Gems/Default/RespondentAction.php:160 -msgid "Respondent has no e-mail" -msgstr "Patiënt zonder e-mail" - -#: classes/Gems/Default/RespondentAction.php:161 -msgid "With housenumber" -msgstr "Met huisnummer" - -#: classes/Gems/Default/RespondentAction.php:168 -msgid "Country" -msgstr "Land" - -#: classes/Gems/Default/RespondentAction.php:172 -msgid "Settings" -msgstr "Instellingen" - -#: classes/Gems/Default/RespondentAction.php:174 -msgid "Has the respondent signed the informed consent letter?" -msgstr "Heeft de patiënt het \"informed consent\" formulier ondertekend?" - -#: classes/Gems/Default/RespondentAction.php:199 -msgid "Comments" -msgstr "Opmerkingen" - -#: classes/Gems/Default/RespondentAction.php:200 -msgid "Physician" -msgstr "Dokter" - -#: classes/Gems/Default/RespondentAction.php:201 -msgid "Treatment" -msgstr "Behandeling" - -#: classes/Gems/Default/RespondentAction.php:230 -msgid "Rejection code" -msgstr "Afkeuringscode" - -#: classes/Gems/Default/RespondentAction.php:237 -msgid "Delete respondent" -msgstr "Verwijder patiënt" - -#: classes/Gems/Default/RespondentAction.php:288 -msgid "Respondent deleted." -msgstr "Patiënt verwijderd" - -#: classes/Gems/Default/RespondentAction.php:291 -msgid "Choose a reception code to delete." -msgstr "Kies een ontvangst code om te verwijderen." - -#: classes/Gems/Default/RespondentAction.php:335 -msgid "respondent" -msgid_plural "respondents" -msgstr[0] "patiënt" -msgstr[1] "patiënten" - -#: classes/Gems/Default/RespondentAction.php:392 -msgid "Please settle the informed consent form for this respondent." -msgstr "A.u.b. het informed consent formulier doornemen met deze patiënt" - -#: classes/Gems/Default/RespondentPlanAction.php:67 -#: classes/Gems/Default/SurveyAction.php:171 -msgid "Show respondent" -msgstr "Toon patiënt" - -#: classes/Gems/Default/RespondentPlanAction.php:73 -msgid "Show track" -msgstr "Toon traject" - -#: classes/Gems/Default/RespondentPlanAction.php:136 -msgid " of " -msgstr " van " - -#: classes/Gems/Default/RespondentPlanAction.php:137 -msgid "Progress" -msgstr "Voortgang" - -#: classes/Gems/Default/RespondentPlanAction.php:144 -msgid "Respondent planning" -msgstr "Per patiënt plannen" - -#: classes/Gems/Default/RoleAction.php:175 -msgid "Illegal name" -msgstr "Naam niet toegestaan" - -#: classes/Gems/Default/RoleAction.php:199 -#: classes/Gems/Default/RoleAction.php:258 -msgid "Parents" -msgstr "Afgeleid van" - -#: classes/Gems/Default/RoleAction.php:214 -msgid "Editing... [truncated message content] |
From: <gem...@li...> - 2011-11-23 18:52:44
|
Revision: 278 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=278&view=rev Author: matijsdejong Date: 2011-11-23 18:52:36 +0000 (Wed, 23 Nov 2011) Log Message: ----------- MENU: Rebuilt menu to simpler parameter processing form using a single ParameterCollector instead of looping through sources (and treating each differently). You should not notice anything, but keep an eye out for missing or not working links. Specifying extra parameters should have become simpler. HTML: $html->input() could not create a simple element, now it can. ORGANIZATIONS: You can now specify the organizations that can have respondents. 90% ready, works except for adding new respondents. Logging in with an organization that cannot have a respondent will show either a message or a selection of allowed organization that do have patients. Modified Paths: -------------- trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/Gems/Menu/ParameterSourceInterface.php trunk/library/classes/Gems/Menu/SubMenuItem.php trunk/library/classes/Gems/Menu.php trunk/library/classes/Gems/Pdf.php trunk/library/classes/Gems/User/Organization.php trunk/library/classes/GemsEscort.php trunk/library/classes/MUtil/Html/InputRenderer.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__organizations.20.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 trunk/library/snippets/Organization/OrganizationTableSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Menu/ParameterCollector.php trunk/library/snippets/Organization/ChooseOrganizationSnippet.php Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-23 18:52:36 UTC (rev 278) @@ -61,17 +61,24 @@ protected $createEditSnippets = 'Organization_OrganizationEditSnippet'; /** + * + * @var Gems_Loader + */ + public $loader; + + /** * Switch the active organization */ public function changeUiAction() { - $request = $this->getRequest(); - $org = urldecode($request->getParam('org')); - $url = base64_decode($request->getParam('current_uri')); - $oldOrgId = $this->session->user_organization_id; + $user = $this->loader->getCurrentUser(); + $request = $this->getRequest(); + $orgId = urldecode($request->getParam('org')); + $url = base64_decode($request->getParam('current_uri')); + $oldOrgId = $user->getOrganizationId(); - $allowedOrganizations = $this->loader->getCurrentUser()->getAllowedOrganizations(); - if ($orgId = array_search($org, $allowedOrganizations)) { + $allowedOrganizations = $user->getAllowedOrganizations(); + if (isset($allowedOrganizations[$orgId])) { $this->session->user_organization_id = $orgId; $this->session->user_organization_name = $allowedOrganizations[$orgId]; @@ -83,8 +90,8 @@ ); } - //Now update the requestcache to change the oldOrgId to the new orgId - //Don't do it when the oldOrgId doesn't match + // Now update the requestcache to change the oldOrgId to the new orgId + // Don't do it when the oldOrgId doesn't match $requestCache = $this->session->requestCache; //Create the list of request cache keys that match an organization ID (to be extended) @@ -106,7 +113,11 @@ $this->session->requestCache = $requestCache; if (Gems_Cookies::setOrganization($orgId, $this->basepath->getBasePath())) { - $this->getResponse()->setRedirect($url); + if ($url) { + $this->getResponse()->setRedirect($url); + } else { + $user->gotoStartPage($this->menu, $request); + } return; } @@ -126,6 +137,27 @@ parent::createAction(); } + + public function chooseAction() + { + $this->addSnippet('Organization_ChooseOrganizationSnippet'); + $this->html->h3($this->_('Choose an organization')); + + $user = $this->loader->getCurrentUser(); + $request = $this->getRequest(); + + foreach ($user->getAllowedOrganizations() as $orgId => $name) { + $org = $this->loader->getOrganization($orgId); + + if ($org->canHaveRespondents()) { + $url = array($request->getActionKey() => 'change-ui'); + $url['org'] = $orgId; + + $this->html->pInfo()->actionLink($url, $name, array('style' => 'font-size: 120%;')); + } + } + } + /** * Creates a model for getModel(). Called only for each new $action. * @@ -141,7 +173,7 @@ { $model = new MUtil_Model_TableModel('gems__organizations'); - $model->setDeleteValues('gor_active', 0, 'gor_add_patients', 0); + $model->setDeleteValues('gor_active', 0, 'gor_add_respondents', 0); $model->set('gor_name', 'label', $this->_('Name'), 'size', 25); $model->set('gor_location', 'label', $this->_('Location'), 'size', 25); @@ -161,8 +193,8 @@ ); $yesNo = $this->util->getTranslated()->getYesNo(); $model->set('gor_active', 'label', $this->_('Active'), 'description', $this->_('Can the organization be used?'), 'elementClass', 'Checkbox', 'multiOptions', $yesNo); - $model->set('gor_add_patients', 'label', $this->_('Accepting'), 'description', $this->_('Can new respondents be added to the organization?'), 'elementClass', 'CheckBox', 'multiOptions', $yesNo); - $model->set('gor_has_patients', 'label', $this->_('Respondents'), 'description', $this->_('Does the organization have respondents?'), 'elementClass', 'Exhibitor', 'multiOptions', $yesNo); + $model->set('gor_add_respondents', 'label', $this->_('Accepting'), 'description', $this->_('Can new respondents be added to the organization?'), 'elementClass', 'CheckBox', 'multiOptions', $yesNo); + $model->set('gor_has_respondents', 'label', $this->_('Respondents'), 'description', $this->_('Does the organization have respondents?'), 'elementClass', 'Exhibitor', 'multiOptions', $yesNo); if ($detailed) { $model->set('gor_name', 'validator', $model->createUniqueValidator('gor_name')); Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-23 18:52:36 UTC (rev 278) @@ -341,6 +341,19 @@ } /** + * Overrule default index for the case that the current + * organization cannot have users. + */ + public function indexAction() + { + if ($this->loader->getOrganization()->canHaveRespondents()) { + parent::indexAction(); + } else { + $this->addSnippet('Organization_ChooseOrganizationSnippet'); + } + } + + /** * Initialize translate and html objects * * Called from {@link __construct()} as final step of object instantiation. Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-11-23 18:52:36 UTC (rev 278) @@ -85,7 +85,7 @@ } } - protected function _toNavigationArray(array $parameterSources) + protected function _toNavigationArray(Gems_Menu_ParameterCollector $source) { if ($this->_subItems) { $lastParams = null; @@ -93,7 +93,7 @@ $pages = array(); foreach ($this->_subItems as $item) { if (! $item->get('button_only')) { - $page = $item->_toNavigationArray($parameterSources); + $page = $item->_toNavigationArray($source); if (($this instanceof Gems_Menu_SubMenuItem) && (! $this->notSet('controller', 'action')) && Added: trunk/library/classes/Gems/Menu/ParameterCollector.php =================================================================== --- trunk/library/classes/Gems/Menu/ParameterCollector.php (rev 0) +++ trunk/library/classes/Gems/Menu/ParameterCollector.php 2011-11-23 18:52:36 UTC (rev 278) @@ -0,0 +1,105 @@ +<?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. + * + * + * @package Gems + * @subpackage Menu + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage Menu + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Menu_ParameterCollector +{ + protected $sources = array(); + protected $values = array(); + + public function __construct() + { + $sources = MUtil_Ra::flatten(func_get_args()); + foreach ($sources as $source) { + $this->addSource($source); + } + } + + public function addSource($source) + { + array_unshift($this->sources, $source); + } + + /** + * Returns a value to use as parameter for $name or + * $default if this object does not contain the value. + * + * @param string $name + * @param mixed $default + * @return mixed + */ + public function getMenuParameter($name, $altname = null) + { + if (array_key_exists($name, $this->values)) { + return $this->values[$name]; + } + + $this->values[$name] = null; + foreach ($this->sources as $source) { + if ($source instanceof Zend_Controller_Request_Abstract) { + $value = $source->getParam($name, null); + if (null === $value) { + $value = $source->getParam($altname, $this->values[$name]); + } + $this->values[$name] = $value; + + } elseif ($source instanceof Gems_Menu_ParameterSourceInterface) { + $this->values[$name] = $source->getMenuParameter($name, $this->values[$name]); + + } elseif ($source instanceof MUtil_Lazy_RepeatableInterface) { + $this->values[$name] = $source->__get($name); + + } elseif (is_array($source)) { + if (isset($source[$name])) { + $this->values[$name] = $source[$name]; + } + } + if (null !== $this->values[$name]) { + break; + } + } + return $this->values[$name]; + } +} Modified: trunk/library/classes/Gems/Menu/ParameterSourceInterface.php =================================================================== --- trunk/library/classes/Gems/Menu/ParameterSourceInterface.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/Gems/Menu/ParameterSourceInterface.php 2011-11-23 18:52:36 UTC (rev 278) @@ -1,6 +1,5 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -51,7 +50,7 @@ */ interface Gems_Menu_ParameterSourceInterface { - /** + /** * Returns a value to use as parameter for $name or * $default if this object does not contain the value. * Modified: trunk/library/classes/Gems/Menu/SubMenuItem.php =================================================================== --- trunk/library/classes/Gems/Menu/SubMenuItem.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/Gems/Menu/SubMenuItem.php 2011-11-23 18:52:36 UTC (rev 278) @@ -92,11 +92,11 @@ return print_r($this->_itemOptions, true); } - private function _applyParameterFilter($source, $paramFunction, $raiseConditions, &$condition) + private function _applyParameterFilter(Gems_Menu_ParameterCollector $source, $raiseConditions, &$condition) { if ($this->_parameterFilter) { foreach ($this->_parameterFilter as $name => $testValue) { - $paramValue = call_user_func($paramFunction, $source, $name, null); + $paramValue = $source->getMenuParameter($name); if ($paramValue instanceof MUtil_Lazy_LazyInterface) { if ($raiseConditions) { @@ -124,20 +124,12 @@ } } - private function _applyParameterSource($source, $paramFunction, array &$parameters) + private function _applyParameterSource(Gems_Menu_ParameterCollector $source, array &$parameters) { // Fill in required parameters if ($this->_parameters && is_array($this->_parameters)) { foreach ($this->_parameters as $param => $name) { - - $default = isset($parameters[$param]) ? $parameters[$param] : null; - - $check = $name; - if ($source instanceof Zend_Controller_Request_Abstract) $check = $param; - - if ($value = call_user_func($paramFunction, $source, $check, $default)) { - $parameters[$param] = $value; - } + $parameters[$param] = $source->getMenuParameter($name, $param); // MUtil_Echo::r($param . '/' . $name . ' => ' . $value, $this->get('label')); } } @@ -145,31 +137,16 @@ return false; } - private function _applyParameterSources(array $parameterSources, array &$parameters, $raiseConditions) + private function _applyParameterSources(Gems_Menu_ParameterCollector $source, array &$parameters, $raiseConditions) { + // Gems_Menu::$verbose = true; // MUtil_Echo::r($this->get('label')); $condition = true; - foreach ($parameterSources as $source) { - if ($source instanceof Zend_Controller_Request_Abstract) { - $this->_applyParameterSource($source, array(__CLASS__, '_getRequestValue'), $parameters); - - } elseif ($source instanceof Gems_Menu_ParameterSourceInterface) { - if ($this->_applyParameterFilter($source, array(__CLASS__, '_getSourceValue'), $raiseConditions, $condition)) { - return false; - } - $this->_applyParameterSource($source, array(__CLASS__, '_getSourceValue'), $parameters); - - } elseif ($source instanceof MUtil_Lazy_RepeatableInterface) { - if ($this->_applyParameterFilter($source, array(__CLASS__, '_getRepeatableValue'), $raiseConditions, $condition)) { - return false; - } - $this->_applyParameterSource($source, array(__CLASS__, '_getRepeatableValue'), $parameters); - - } elseif (is_array($source)) { - $this->_applyParameterSource($source, array(__CLASS__, '_getArrayValue'), $parameters); - } + if ($this->_applyParameterFilter($source, $raiseConditions, $condition)) { + return false; } + $this->_applyParameterSource($source, $parameters); // Test required parameters if ($this->_requiredParameters) { @@ -186,39 +163,14 @@ return $condition; } - private static function _getArrayValue($source, $name, $default) + private function _toHRef(Gems_Menu_ParameterCollector $source, &$condition) { - if (isset($source[$name])) { - return $source[$name]; - } else { - return $default; - } - } - - private static function _getRepeatableValue($source, $name, $default) - { - return $source->$name; - } - - private static function _getRequestValue($source, $name, $default) - { - return $source->getParam($name, $default); - } - - private static function _getSourceValue($source, $name, $default) - { - return $source->getMenuParameter($name, $default); - } - - private function _toHRef(array $parameterSources, &$condition) - { if ($this->get('allowed')) { $parameters = array(); - if ($condition = $this->_applyParameterSources($parameterSources, $parameters, ! $condition)) { + if ($condition = $this->_applyParameterSources($source, $parameters, ! $condition)) { $url = new MUtil_Html_HrefArrayAttribute($parameters); - // $url->setRequest($request); // TODO: Filter from $parameterSources? $url->setRouteReset($this->get('reset_param', true)); foreach (array('module', 'controller', 'action', 'route') as $name) { @@ -234,10 +186,10 @@ } } - private function _toLi(array $parameterSources) + private function _toLi(Gems_Menu_ParameterCollector $source) { $condition = false; - if ($href = $this->_toHRef($parameterSources, $condition)) { + if ($href = $this->_toHRef($source, $condition)) { $li = MUtil_Html::create()->li(); $li->a($href, $this->get('label')); @@ -246,13 +198,13 @@ } } - protected function _toNavigationArray(array $parameterSources) + protected function _toNavigationArray(Gems_Menu_ParameterCollector $source) { $result = $this->_itemOptions; if ($result['visible']) { $parameters = array(); - if ($this->_applyParameterSources($parameterSources, $parameters, true)) { + if ($this->_applyParameterSources($source, $parameters, true)) { $result['params'] = $parameters; } else { $result['visible'] = false; @@ -260,7 +212,7 @@ } if ($this->hasChildren()) { - $result['pages'] = parent::_toNavigationArray($parameterSources); + $result['pages'] = parent::_toNavigationArray($source); } // Get any missing MVC keys from children, even when invisible @@ -301,11 +253,11 @@ return $result; } - protected function _toRouteArray(array $parameterSources) + protected function _toRouteArray(Gems_Menu_ParameterCollector $source) { if ($this->get('allowed')) { $result = array(); - if ($this->_applyParameterSources($parameterSources, $result, true)) { + if ($this->_applyParameterSources($source, $result, true)) { if (isset($this->_itemOptions['controller'])) { $result['controller'] = $this->_itemOptions['controller']; } @@ -323,7 +275,7 @@ if ($this->hasChildren()) { foreach ($this->getChildren() as $child) { if ($child->check(array('allowed', true))) { - $firstChild = $firstChild->toRouteArray($parameterSources); + $firstChild = $firstChild->toRouteArray($source); break; } } @@ -387,6 +339,13 @@ return $this->addAction(null, $this->get('privilege'), 'autofilter'); } + /** + * Add an "Create new" action to the current subMenuItem + * + * @param string $privilege The privilege for the item + * @param array $other Array of extra options for this item, e.g. 'visible', 'allowed', 'class', 'icon', 'target', 'type', 'button_only' + * @return Gems_Menu_SubMenuItem + */ public function addCreateAction($privilege = null, array $other = array()) { if (isset($other['label'])) { @@ -725,6 +684,7 @@ public function is($key, $value) { + // MUtil_Echo::track($key, $value); $target = $this->get($key); if (is_array($value)) { @@ -856,7 +816,7 @@ } $condition = true; - if ($href = $this->_toHRef($parameterSources, $condition)) { + if ($href = $this->_toHRef(new Gems_Menu_ParameterCollector($parameterSources), $condition)) { if ($condition instanceof MUtil_Lazy_LazyInterface) { if ($showDisabled) { @@ -937,14 +897,14 @@ $parameterSources = func_get_args(); $condition = true; - return $this->_toHRef($parameterSources, $condition); + return $this->_toHRef(new Gems_Menu_ParameterCollector($parameterSources), $condition); } public function toRouteUrl($parameterSources_args = null) { $parameterSources = func_get_args(); - return $this->_toRouteArray($parameterSources); + return $this->_toRouteArray(new Gems_Menu_ParameterCollector($parameterSources)); } public function toUl($actionController = null) @@ -955,7 +915,7 @@ $ul = MUtil_Html_ListElement::ul(); foreach ($this->getChildren() as $menuItem) { - if ($li = $menuItem->_toLi($parameterSources)) { + if ($li = $menuItem->_toLi(new Gems_Menu_ParameterCollector($parameterSources))) { $ul->append($li); } } Modified: trunk/library/classes/Gems/Menu.php =================================================================== --- trunk/library/classes/Gems/Menu.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/Gems/Menu.php 2011-11-23 18:52:36 UTC (rev 278) @@ -264,7 +264,7 @@ // MAIN RESPONDENTS ITEM $page = $this->addPage($label, 'pr.respondent', 'respondent'); $page->addAutofilterAction(); - $page->addCreateAction('pr.respondent.create'); + $page->addCreateAction('pr.respondent.create')->setParameterFilter('can_add_respondents', true);; $page->addShowAction()->addNamedParameters(MUtil_Model::REQUEST_ID, 'gr2o_patient_nr'); /* @@ -517,6 +517,11 @@ // MAIN RESPONDENTS ITEM $this->addRespondentPage($this->_('Respondents')); + /* + if ($this->escort instanceof Gems_Project_Organization_MultiOrganizationInterface) { + $this->addPage($this->_('Switch'), 'pr.respondent', 'organization', 'choose'); + } // */ + // MAIN PLANNING ITEM $this->addPlanPage($this->_('Overview')); @@ -625,14 +630,13 @@ $parameterSources = func_get_args(); if ($this->_menuParameters) { - // array_unshift($parameterSources, $this->_menuParameters); - // MUtil_echo::track($this->_menuParameters); $parameterSources[] = $this->_menuParameters; } + $source = new Gems_Menu_ParameterCollector($parameterSources); // self::$verbose = true; - $nav = new Zend_Navigation($this->_toNavigationArray($parameterSources)); + $nav = new Zend_Navigation($this->_toNavigationArray($source)); // MUtil_Echo::r($this->_toNavigationArray($parameterSources)); Modified: trunk/library/classes/Gems/Pdf.php =================================================================== --- trunk/library/classes/Gems/Pdf.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/Gems/Pdf.php 2011-11-23 18:52:36 UTC (rev 278) @@ -126,7 +126,7 @@ $content = $pdf->render(); - MUtil_Echo::track($filename); + // MUtil_Echo::track($filename); if ($download) { // Download & save header('Content-Type: application/x-download'); Modified: trunk/library/classes/Gems/User/Organization.php =================================================================== --- trunk/library/classes/Gems/User/Organization.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/Gems/User/Organization.php 2011-11-23 18:52:36 UTC (rev 278) @@ -125,6 +125,37 @@ } /** + * Set menu parameters from the organization + * + * @param Gems_Menu_ParameterSource $source + * @return Gems_Tracker_Token (continuation pattern) + */ + public function applyToMenuSource(Gems_Menu_ParameterSource $source) + { + $source->offsetSet('can_add_respondents', $this->canCreateRespondents()); + } + + /** + * Returns true when this organization has or can have respondents + * + * @return boolean + */ + public function canCreateRespondents() + { + return (boolean) $this->_organizationData['gor_add_respondents']; + } + + /** + * Returns true when this organization has or can have respondents + * + * @return boolean + */ + public function canHaveRespondents() + { + return (boolean) $this->_organizationData['gor_has_respondents'] || $this->_organizationData['gor_add_respondents']; + } + + /** * Should be called after answering the request to allow the Target * to check if all required registry values have been set correctly. * Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/GemsEscort.php 2011-11-23 18:52:36 UTC (rev 278) @@ -801,21 +801,20 @@ $orgSwitch = MUtil_Html::create('div', array('id' => 'organizations')); $currentUri = base64_encode($this->view->url()); + $url = $this->view->getHelper('url')->url(array('controller' => 'organization', 'action' => 'change-ui'), null, true); - $url = $this->view->getHelper('url')->url(array( - 'controller' => 'organization', - 'action' => 'change-ui'), null, true); - $orgSwitch->raw('<form method="get" action="' . $url . '"><div><input type="hidden" name="current_uri" value="' . $currentUri . '" /><select name="org" onchange="javascript:this.form.submit();">'); + $formDiv = $orgSwitch->form(array('method' => 'get', 'action' => $url))->div(); + $formDiv->input(array('type' => "hidden", 'name' => "current_uri", 'value' => $currentUri)); + + $select = $formDiv->select(array('name' => "org", 'onchange' => "javascript:this.form.submit();")); foreach ($orgs as $id => $org) { $selected = ''; if ($id == $user->getOrganizationId()) { - $selected = ' selected="selected"'; - - } else { + $selected = array('selected' => "selected"); } - $orgSwitch->raw('<option value="' . urlencode($org) . '"' . $selected . '>' . $org . '</option>'); + $select->option(array('value' => $id), $org, $selected); } - $orgSwitch->raw('</select></div></form>'); + return $orgSwitch; } else { return; @@ -1455,6 +1454,9 @@ $this->menu = $loader->createMenu($this); $this->_updateVariable('menu'); + $source = $this->menu->getParameterSource(); + $this->getLoader()->getOrganization()->applyToMenuSource($source); + /** * Check if we are in maintenance mode or not. This is triggeren by a file in the var/settings * directory with the name lock.txt @@ -1531,7 +1533,7 @@ } if (isset($menuItem)) { - $menuItem->applyHiddenParameters($request, $this->menu->getParameterSource()); + $menuItem->applyHiddenParameters($request, $source); $this->menu->setCurrent($menuItem); } } Modified: trunk/library/classes/MUtil/Html/InputRenderer.php =================================================================== --- trunk/library/classes/MUtil/Html/InputRenderer.php 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/classes/MUtil/Html/InputRenderer.php 2011-11-23 18:52:36 UTC (rev 278) @@ -1,45 +1,52 @@ <?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 Html + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** - * @author Matijs de Jong - * @package MUtil + * This class handles the rendering of input elements. + * + * If a Zend_Form object is passed as first parameter, then it is rendered appropriately. + * Otherwise the constructor tries to handle it as an attempt to create a raw HtmlElement + * input element. + * + * @package MUtil * @subpackage Html + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 */ class MUtil_Html_InputRenderer implements MUtil_Html_HtmlInterface { @@ -48,6 +55,7 @@ const MODE_ELEMENT = 'except'; const MODE_EXCEPT = 'except'; const MODE_FORM = 'form'; + const MODE_HTML = 'html'; const MODE_ONLY = 'only'; const MODE_UNTIL = 'until'; const MODE_UPTO = 'upto'; @@ -97,8 +105,23 @@ $this->_mode = $mode; } else { - throw new MUtil_Html_HtmlException(sprintf(self::ARGUMENT_ERROR, get_class($element), __CLASS__ . ' constructor')); + if (self::MODE_ELEMENT === $mode) { + // Was the second argument not specified? + // Then the arguments should be passed in $element. + $args = $element; + } else { + // Use all args + $args = func_get_args(); + } + if (is_array($args)) { + // Treat this as a standard Html Element + $this->_element = new MUtil_Html_HtmlElement('input', $args); + $this->_mode = self::MODE_HTML; + // MUtil_Echo::track($args); + } else { + throw new MUtil_Html_HtmlException(sprintf(self::ARGUMENT_ERROR, (is_object($element) ? get_class($element) : gettype($element)), __CLASS__ . ' constructor')); + } } } @@ -272,6 +295,9 @@ case self::MODE_FORM: return self::renderForm($view, $this->_element); + case self::MODE_HTML: + return $this->_element->render($view); + case self::MODE_ONLY: return self::renderOnly($view, $this->_element, $this->_decorators); Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/configs/db/patches.sql 2011-11-23 18:52:36 UTC (rev 278) @@ -316,12 +316,15 @@ ALTER TABLE `gems__organizations` ADD UNIQUE INDEX (`gor_code`); -ALTER TABLE `gems__organizations` ADD gor_accessible_by text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER gor_task, - ADD gor_has_patients boolean not null default 1 AFTER gor_iso_lang, - ADD gor_add_patients boolean not null default 1 AFTER gor_has_patients; +ALTER TABLE `gems__organizations` ADD gor_accessible_by text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER gor_task; -UPDATE `gems__organizations` SET gor_has_patients = COALESCE((SELECT 1 FROM gems__respondent2org WHERE gr2o_id_organization = gor_id_organization GROUP BY gr2o_id_organization), 0); +ALTER TABLE `gems__organizations` + ADD gor_has_respondents boolean not null default 1 AFTER gor_iso_lang, + ADD gor_add_respondents boolean not null default 1 AFTER gor_has_respondents; +UPDATE `gems__organizations` SET gor_has_respondents = COALESCE((SELECT 1 FROM gems__respondent2org WHERE gr2o_id_organization = gor_id_organization GROUP BY gr2o_id_organization), 0); +UPDATE `gems__organizations` SET gor_add_respondents = CASE WHEN gor_has_respondents = 1 AND gor_active = 1 THEN 1 ELSE 0 END; + -- PATCH: Log failed logins INSERT INTO `gems__log_actions` (`glac_id_action`, `glac_name`, `glac_change`, `glac_log`, `glac_created`) VALUES (NULL , 'loginFail', '0', '1', CURRENT_TIMESTAMP); Modified: trunk/library/configs/db/tables/gems__organizations.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__organizations.20.sql 2011-11-23 14:20:20 UTC (rev 277) +++ trunk/library/configs/db/tables/gems__organizations.20.sql 2011-11-23 18:52:36 UTC (rev 278) @@ -20,8 +20,8 @@ gor_iso_lang char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'en' references gems__languages (gml_iso_lang), - gor_has_patients boolean not null default 1, - gor_add_patients boolean not null default 1, + gor_has_respondents boolean not null default 1, + gor_add_respondents boolean not null default 1, gor_active boolean not null default 1, gor_changed timestamp not null default current_timestamp on update current_timestamp, 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-23 14:20:20 UTC (rev 277) +++ trunk/library/languages/default-en.po 2011-11-23 18:52:36 UTC (rev 278) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-23 14:53+0100\n" +"POT-Creation-Date: 2011-11-23 19:43+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -23,53 +23,53 @@ msgid "Path %s not writable" msgstr "Path %s not writable" -#: classes/GemsEscort.php:888 +#: classes/GemsEscort.php:887 #, php-format msgid "User: %s" msgstr "User: %s" -#: classes/GemsEscort.php:912 +#: classes/GemsEscort.php:911 msgid "version" msgstr "version" -#: classes/GemsEscort.php:1343 +#: classes/GemsEscort.php:1342 msgid "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" msgstr "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" -#: classes/GemsEscort.php:1467 +#: classes/GemsEscort.php:1469 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1469 -#: classes/GemsEscort.php:1473 -#: classes/GemsEscort.php:1474 +#: classes/GemsEscort.php:1471 +#: classes/GemsEscort.php:1475 +#: classes/GemsEscort.php:1476 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1484 +#: classes/GemsEscort.php:1486 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1486 -#: classes/GemsEscort.php:1522 +#: classes/GemsEscort.php:1488 +#: classes/GemsEscort.php:1524 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1502 +#: classes/GemsEscort.php:1504 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1504 +#: classes/GemsEscort.php:1506 #, 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:1509 -#: classes/GemsEscort.php:1520 +#: classes/GemsEscort.php:1511 +#: classes/GemsEscort.php:1522 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1510 +#: classes/GemsEscort.php:1512 msgid "You must login to access this page." msgstr "You must login to access this page." @@ -310,31 +310,31 @@ msgid "Respondents" msgstr "Patients" -#: classes/Gems/Menu.php:521 +#: classes/Gems/Menu.php:526 msgid "Overview" msgstr "Overview" -#: classes/Gems/Menu.php:528 +#: classes/Gems/Menu.php:533 msgid "Project" msgstr "Project" -#: classes/Gems/Menu.php:531 +#: classes/Gems/Menu.php:536 msgid "Setup" msgstr "Setup" -#: classes/Gems/Menu.php:534 +#: classes/Gems/Menu.php:539 msgid "Mail" msgstr "Mail" -#: classes/Gems/Menu.php:537 +#: classes/Gems/Menu.php:542 msgid "Track Builder" msgstr "Track Builder" -#: classes/Gems/Menu.php:546 +#: classes/Gems/Menu.php:551 msgid "Contact" msgstr "Contact" -#: classes/Gems/Menu.php:559 +#: classes/Gems/Menu.php:564 msgid "Changelog" msgstr "Changelog" @@ -1484,7 +1484,7 @@ msgstr "Login Name" #: classes/Gems/Default/OptionAction.php:188 -#: classes/Gems/Default/OrganizationAction.php:158 +#: classes/Gems/Default/OrganizationAction.php:191 #: classes/Gems/Default/RespondentAction.php:173 #: classes/Gems/Default/StaffAction.php:224 msgid "Language" @@ -1513,96 +1513,100 @@ msgid "Item" msgstr "Item" -#: classes/Gems/Default/OrganizationAction.php:114 +#: classes/Gems/Default/OrganizationAction.php:124 msgid "Cookies must be enabled." msgstr "Cookies must be enabled." -#: classes/Gems/Default/OrganizationAction.php:117 +#: classes/Gems/Default/OrganizationAction.php:127 msgid "Invalid organization." msgstr "Invalid organization." -#: classes/Gems/Default/OrganizationAction.php:125 +#: classes/Gems/Default/OrganizationAction.php:135 msgid "New organization..." msgstr "New organization..." -#: classes/Gems/Default/OrganizationAction.php:147 +#: classes/Gems/Default/OrganizationAction.php:144 +msgid "Choose an organization" +msgstr "Choose an organization" + +#: classes/Gems/Default/OrganizationAction.php:180 msgid "Url" msgstr "Url" -#: classes/Gems/Default/OrganizationAction.php:148 +#: classes/Gems/Default/OrganizationAction.php:181 msgid "Task" msgstr "Task" -#: classes/Gems/Default/OrganizationAction.php:149 +#: classes/Gems/Default/OrganizationAction.php:182 msgid "Contact name" msgstr "Contact name" -#: classes/Gems/Default/OrganizationAction.php:150 +#: classes/Gems/Default/OrganizationAction.php:183 msgid "Contact email" msgstr "Contact email" -#: classes/Gems/Default/OrganizationAction.php:153 +#: classes/Gems/Default/OrganizationAction.php:186 msgid "Style" msgstr "Style" -#: classes/Gems/Default/OrganizationAction.php:162 +#: classes/Gems/Default/OrganizationAction.php:195 msgid "Can the organization be used?" msgstr "Can the organization be used?" -#: classes/Gems/Default/OrganizationAction.php:163 +#: classes/Gems/Default/OrganizationAction.php:196 msgid "Accepting" msgstr "Accepting" -#: classes/Gems/Default/OrganizationAction.php:163 +#: classes/Gems/Default/OrganizationAction.php:196 msgid "Can new respondents be added to the organization?" msgstr "Can new patients be added to the organization?" -#: classes/Gems/Default/OrganizationAction.php:164 +#: classes/Gems/Default/OrganizationAction.php:197 msgid "Does the organization have respondents?" msgstr "Does the organization have patients?" -#: classes/Gems/Default/OrganizationAction.php:168 +#: classes/Gems/Default/OrganizationAction.php:201 msgid "Greeting" msgstr "Greeting" -#: classes/Gems/Default/OrganizationAction.php:168 -#: classes/Gems/Default/OrganizationAction.php:169 +#: classes/Gems/Default/OrganizationAction.php:201 +#: classes/Gems/Default/OrganizationAction.php:202 msgid "For emails and token forward screen." msgstr "For emails and token forward screen." -#: classes/Gems/Default/OrganizationAction.php:169 +#: classes/Gems/Default/OrganizationAction.php:202 msgid "Signature" msgstr "Signature" -#: classes/Gems/Default/OrganizationAction.php:171 +#: classes/Gems/Default/OrganizationAction.php:204 msgid "Accessible by" msgstr "Accessible by" -#: classes/Gems/Default/OrganizationAction.php:171 +#: classes/Gems/Default/OrganizationAction.php:204 msgid "Checked organizations see this organizations respondents." msgstr "Checked organizations see this organizations patients." -#: classes/Gems/Default/OrganizationAction.php:180 +#: classes/Gems/Default/OrganizationAction.php:214 msgid "Code name" msgstr "Code name" -#: classes/Gems/Default/OrganizationAction.php:180 +#: classes/Gems/Default/OrganizationAction.php:214 msgid "Only for programmers." msgstr "Only for programmers." -#: classes/Gems/Default/OrganizationAction.php:193 +#: classes/Gems/Default/OrganizationAction.php:228 msgid "Delete organization" msgstr "Delete organization" -#: classes/Gems/Default/OrganizationAction.php:203 +#: classes/Gems/Default/OrganizationAction.php:238 msgid "Edit organization" msgstr "Edit organization" -#: classes/Gems/Default/OrganizationAction.php:213 +#: classes/Gems/Default/OrganizationAction.php:248 msgid "Participating organizations" msgstr "Participating organizations" -#: classes/Gems/Default/OrganizationAction.php:223 +#: classes/Gems/Default/OrganizationAction.php:258 msgid "Show organization" msgstr "Show organization" @@ -1942,7 +1946,7 @@ msgstr[0] "patient" msgstr[1] "patients" -#: classes/Gems/Default/RespondentAction.php:392 +#: classes/Gems/Default/RespondentAction.php:405 msgid "Please settle the informed consent form for this respondent." msgstr "Please settle the informed consent form for this patient." @@ -2853,15 +2857,15 @@ msgid "Check all assignments" msgstr "Check all assignments" -#: classes/Gems/Menu/SubMenuItem.php:396 +#: classes/Gems/Menu/SubMenuItem.php:355 msgid "New" msgstr "New" -#: classes/Gems/Menu/SubMenuItem.php:450 +#: classes/Gems/Menu/SubMenuItem.php:409 msgid "Export the current data set to Excel" msgstr "Export the current data set to Excel" -#: classes/Gems/Menu/SubMenuItem.php:454 +#: classes/Gems/Menu/SubMenuItem.php:413 msgid "Excel export" msgstr "Excel export" @@ -3231,11 +3235,15 @@ 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." @@ -3801,12 +3809,10 @@ msgstr "Recalculate track" #: snippets/RespondentDetailsSnippet.php:59 -#: snippets/RespondentDetailsWithAssignmentsSnippet.php:74 msgid "Respondent information" msgstr "Patient information" #: snippets/RespondentDetailsSnippet.php:71 -#: snippets/RespondentDetailsWithAssignmentsSnippet.php:97 msgid "Respondent nr: " msgstr "Patient nr:" @@ -3894,6 +3900,14 @@ msgid "This track can be assigned since %s." msgstr "This track can be assigned since %s." +#: snippets/Organization/ChooseOrganizationSnippet.php:93 +msgid "This organization cannot have any respondents, please choose one that does:" +msgstr "This organization cannot have any patients, please choose one that does:" + +#: snippets/Organization/ChooseOrganizationSnippet.php:105 +msgid "This organization cannot have any respondents." +msgstr "This organization cannot have any patients." + #~ msgid "Allow new respondents" #~ msgstr "Allow new patients" 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-23 14:20:20 UTC (rev 277) +++ trunk/library/languages/default-nl.po 2011-11-23 18:52:36 UTC (rev 278) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-23 14:50+0100\n" +"POT-Creation-Date: 2011-11-23 19:43+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -23,53 +23,53 @@ msgid "Path %s not writable" msgstr "Path %s niet schrijfbaar" -#: classes/GemsEscort.php:888 +#: classes/GemsEscort.php:887 #, php-format msgid "User: %s" msgstr "Login: %s" -#: classes/GemsEscort.php:912 +#: classes/GemsEscort.php:911 msgid "version" msgstr "versie" -#: classes/GemsEscort.php:1343 +#: classes/GemsEscort.php:1342 msgid "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" msgstr "Let op: uw sessie is verlopen, uw invoer is niet opgeslagen. Controleer uw gegevens en probeer a.u.b. opnieuw." -#: classes/GemsEscort.php:1467 +#: classes/GemsEscort.php:1469 msgid "Please check back later." msgstr "Probeer het later opnieuw." -#: classes/GemsEscort.php:1469 -#: classes/GemsEscort.php:1473 -#: classes/GemsEscort.php:1474 +#: classes/GemsEscort.php:1471 +#: classes/GemsEscort.php:1475 +#: classes/GemsEscort.php:1476 msgid "System is in maintenance mode" msgstr "Systeem is in onderhoudsmodus" -#: classes/GemsEscort.php:1484 +#: classes/GemsEscort.php:1486 msgid "No access to site." msgstr "Geen toegang tot website." -#: classes/GemsEscort.php:1486 -#: classes/GemsEscort.php:1522 +#: classes/GemsEscort.php:1488 +#: classes/GemsEscort.php:1524 msgid "You have no access to this site." msgstr "U heeft geen toegang tot deze website." -#: classes/GemsEscort.php:1502 +#: classes/GemsEscort.php:1504 msgid "No access to page" msgstr "Geen toegang tot pagina" -#: classes/GemsEscort.php:1504 +#: classes/GemsEscort.php:1506 #, 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:1509 -#: classes/GemsEscort.php:1520 +#: classes/GemsEscort.php:1511 +#: classes/GemsEscort.php:1522 msgid "You are no longer logged in." msgstr "U bent niet meer ingelogd." -#: classes/GemsEscort.php:1510 +#: classes/GemsEscort.php:1512 msgid "You must login to access this page." msgstr "U moet ingelogd zijn voor toegang tot deze pagina." @@ -310,31 +310,31 @@ msgid "Respondents" msgstr "Patiënten" -#: classes/Gems/Menu.php:521 +#: classes/Gems/Menu.php:526 msgid "Overview" msgstr "Overzicht" -#: classes/Gems/Menu.php:528 +#: classes/Gems/Menu.php:533 msgid "Project" msgstr "Project" -#: classes/Gems/Menu.php:531 +#: classes/Gems/Menu.php:536 msgid "Setup" msgstr "Beheer" -#: classes/Gems/Menu.php:534 +#: classes/Gems/Menu.php:539 msgid "Mail" msgstr "Email" -#: classes/Gems/Menu.php:537 +#: classes/Gems/Menu.php:542 msgid "Track Builder" msgstr "Traject bouwer" -#: classes/Gems/Menu.php:546 +#: classes/Gems/Menu.php:551 msgid "Contact" msgstr "Contact" -#: classes/Gems/Menu.php:559 +#: classes/Gems/Menu.php:564 msgid "Changelog" msgstr "Changelog" @@ -1484,7 +1484,7 @@ msgstr "Login Naam" #: classes/Gems/Default/OptionAction.php:188 -#: classes/Gems/Default/OrganizationAction.php:158 +#: classes/Gems/Default/OrganizationAction.php:191 #: classes/Gems/Default/RespondentAction.php:173 #: classes/Gems/Default/StaffAction.php:224 msgid "Language" @@ -1513,96 +1513,100 @@ msgid "Item" msgstr "Item" -#: classes/Gems/Default/OrganizationAction.php:114 +#: classes/Gems/Default/OrganizationAction.php:124 msgid "Cookies must be enabled." msgstr "Zonder cookies kan de taal niet ingesteld worden." -#: classes/Gems/Default/OrganizationAction.php:117 +#: classes/Gems/Default/OrganizationAction.php:127 msgid "Invalid organization." msgstr "Ongeldige organisatie." -#: classes/Gems/Default/OrganizationAction.php:125 +#: classes/Gems/Default/OrganizationAction.php:135 msgid "New organization..." msgstr "Nieuwe organisatie..." -#: classes/Gems/Default/OrganizationAction.php:147 +#: classes/Gems/Default/OrganizationAction.php:144 +msgid "Choose an organization" +msgstr "Kies een organisatie" + +#: classes/Gems/Default/OrganizationAction.php:180 msgid "Url" msgstr "Url" -#: classes/Gems/Default/OrganizationAction.php:148 +#: classes/Gems/Default/OrganizationAction.php:181 msgid "Task" msgstr "Taak" -#: classes/Gems/Default/OrganizationAction.php:149 +#: classes/Gems/Default/OrganizationAction.php:182 msgid "Contact name" msgstr "Contact naam" -#: classes/Gems/Default/OrganizationAction.php:150 +#: classes/Gems/Default/OrganizationAction.php:183 msgid "Contact email" msgstr "Contact email" -#: classes/Gems/Default/OrganizationAction.php:153 +#: classes/Gems/Default/OrganizationAction.php:186 msgid "Style" msgstr "Stijl" -#: classes/Gems/Default/OrganizationAction.php:162 +#: classes/Gems/Default/OrganizationAction.php:195 msgid "Can the organization be used?" msgstr "Is de organisatie in gebruik?" -#: classes/Gems/Default/OrganizationAction.php:163 +#: classes/Gems/Default/OrganizationAction.php:196 msgid "Accepting" msgstr "Accepteerd" -#: classes/Gems/Default/OrganizationAction.php:163 +#: classes/Gems/Default/OrganizationAction.php:196 msgid "Can new respondents be added to the organization?" msgstr "Accepteert de organisatie nieuwe patiënten?" -#: classes/Gems/Default/OrganizationAction.php:164 +#: classes/Gems/Default/OrganizationAction.php:197 msgid "Does the organization have respondents?" msgstr "Heeft de organisatie patiënten?" -#: classes/Gems/Default/OrganizationAction.php:168 +#: classes/Gems/Default/OrganizationAction.php:201 msgid "Greeting" msgstr "Begroeting" -#: classes/Gems/Default/OrganizationAction.php:168 -#: classes/Gems/Default/OrganizationAction.php:169 +#: classes/Gems/Default/OrganizationAction.php:201 +#: classes/Gems/Default/OrganizationAction.php:202 msgid "For emails and token forward screen." msgstr "Voor emails en kenmerk scherm." -#: classes/Gems/Default/OrganizationAction.php:169 +#: classes/Gems/Default/OrganizationAction.php:202 msgid "Signature" msgstr "Handtekening" -#: classes/Gems/Default/OrganizationAction.php:171 +#: classes/Gems/Default/OrganizationAction.php:204 msgid "Accessible by" msgstr "Toegankelijk voor" -#: classes/Gems/Default/OrganizationAction.php:171 +#: classes/Gems/Default/OrganizationAction.php:204 msgid "Checked organizations see this organizations respondents." msgstr "Geselecteerde organizaties kunnen de patiënten van deze organisatie bekijken." -#: classes/Gems/Default/OrganizationAction.php:180 +#: classes/Gems/Default/OrganizationAction.php:214 msgid "Code name" msgstr "Code naam" -#: classes/Gems/Default/OrganizationAction.php:180 +#: classes/Gems/Default/OrganizationAction.php:214 msgid "Only for programmers." msgstr "Uitsluitend voor programmeurs." -#: classes/Gems/Default/OrganizationAction.php:193 +#: classes/Gems/Default/OrganizationAction.php:228 msgid "Delete organization" msgstr "Verwijder organisatie" -#: classes/Gems/Default/OrganizationAction.php:203 +#: classes/Gems/Default/OrganizationAction.php:238 msgid "Edit organization" msgstr "Bewerk organisatie" -#: classes/Gems/Default/OrganizationAction.php:213 +#: classes/Gems/Default/OrganizationAction.php:248 msgid "Participating organizations" msgstr "Deelnemende organisaties" -#: classes/Gems/Default/OrganizationAction.php:223 +#: classes/Gems/Default/OrganizationAction.php:258 msgid "Show organization" msgstr "Toon organisatie" @@ -1942,7 +1946,7 @@ msgstr[0] "patiënt" msgstr[1] "patiënten" -#: classes/Gems/Default/RespondentAction.php:392 +#: classes/Gems/Default/RespondentAction.php:405 msgid "Please settle the informed consent form for this respondent." msgstr "A.u.b. het informed consent formulier doornemen met deze patiënt" @@ -2853,15 +2857,15 @@ msgid "Check all assignments" msgstr "Controleer alle toewijzingen" -#: classes/Gems/Menu/SubMenuItem.php:396 +#: classes/Gems/Menu/SubMenuItem.php:355 msgid "New" msgstr "Nieuw" -#: classes/Gems/Menu/SubMenuItem.php:450 +#: classes/Gems/Menu/SubMenuItem.php:409 msgid "Export the current data set to Excel" msgstr "Exporteer de huidige gegevens naar Excel" -#: classes/Gems/Menu/SubMenuItem.php:454 +#: classes/Gems/Menu/SubMenuItem.php:413 msgid "Excel export" msgstr "Excel export" @@ -3231,11 +3235,15 @@ msgstr "Antwoorden voor kenmerk %s, patientnummer %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 "Kenmerk %s niet gevonden" #: 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 "Geen kenmerk opgegeven." @@ -3801,12 +3809,10 @@ msgstr "Berekening traject opnieuw" #: snippets/RespondentDetailsSnippet.php:59 -#: snippets/RespondentDetailsWithAssignmentsSnippet.php:74 msgid "Respondent information" msgstr "Patiënt informatie" #: snippets/RespondentDetailsSnippet.php:71 -#: snippets/RespondentDetailsWithAssignmentsSnippet.php:97 msgid "Respondent nr: " msgstr "Patiënt nr:" @@ -3894,6 +3900,14 @@ msgid "This track can be assigned since %s." msgstr "Dit traject kan sinds %s aan een patiënt toegewezen worden." +#: snippets/Organization/ChooseOrganizationSnippet.php:93 +msgid "This organization cannot have any respondents, please choose one that does:" +msgstr "Deze organisatie heeft geen patiënten. Kies een organisatie met patiënten." + +#: snippets/Organization/ChooseOrganizationSnippet.php:105 +msgid "This organization cannot have any respondents." +msgstr "Deze organisatie heeft geen patiënten." + #~ msgid "Allow new respondents" #~ msgstr "Nieuwe patiënten toestaan" Added: trunk/library/snippets/Organization/ChooseOrganizationSnippet.php =================================================================== --- trunk/library/snippets/Organization/ChooseOrganizationSnippet.php (rev 0) +++ trunk/library/snippets/Organization/ChooseOrganizationSnippet.php 2011-11-23 18:52:36 UTC (rev 278) @@ -0,0 +1,110 @@ +<?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... [truncated message content] |
From: <gem...@li...> - 2011-11-24 11:11:20
|
Revision: 279 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=279&view=rev Author: matijsdejong Date: 2011-11-24 11:11:14 +0000 (Thu, 24 Nov 2011) Log Message: ----------- Moved functionality from OrganizationAction.php to User->setCurrentOrganization() Moved determination of password rule codes from PasswordChecker.php to User.php (seemed more logical and better extensible) Modified Paths: -------------- trunk/library/changelog.txt trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/classes/Gems/Project/ProjectSettings.php trunk/library/classes/Gems/User/Organization.php trunk/library/classes/Gems/User/PasswordChecker.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2011-11-23 18:52:36 UTC (rev 278) +++ trunk/library/changelog.txt 2011-11-24 11:11:14 UTC (rev 279) @@ -4,6 +4,7 @@ Setting rules for user passwords has changed and has become more powerfull, unless you do not set them. The table gems__staff is split into gems__staff, gems__user_logins with generic login data and gems__users_passwords containing db stored password information. GemsEscort->afterLogin(), ->afterLogout() and ->loadLoginInfo(0 are now all handled by Gems_User_UserDefinitionInterface objects. +GemsEscort->session kept for compatibility reasons, but use should be stopped. The table gems__user_ids provides unique and non-sequential user ids accross gems__staff and gems__respondents. The gems__respondent.grs_bsn has been renamed to grs_ssn, to make the code more international. MailController is now called MailTemplateController. Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-23 18:52:36 UTC (rev 278) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-24 11:11:14 UTC (rev 279) @@ -79,49 +79,14 @@ $allowedOrganizations = $user->getAllowedOrganizations(); if (isset($allowedOrganizations[$orgId])) { - $this->session->user_organization_id = $orgId; - $this->session->user_organization_name = $allowedOrganizations[$orgId]; + $user->setCurrentOrganization($orgId); - if ($this->escort instanceof Gems_Project_Layout_MultiLayoutInterface) { - $this->session->user_style = $this->db->fetchOne( - "SELECT gor_style - FROM gems__organizations - WHERE gor_id_organization = ?", $orgId - ); + if ($url) { + $this->getResponse()->setRedirect($url); + } else { + $user->gotoStartPage($this->menu, $request); } - - // Now update the requestcache to change the oldOrgId to the new orgId - // Don't do it when the oldOrgId doesn't match - $requestCache = $this->session->requestCache; - - //Create the list of request cache keys that match an organization ID (to be extended) - $possibleOrgIds = array( - 'gr2o_id_organization', - 'gto_id_organization'); - - foreach ($requestCache as $key => $value) { - if (is_array($value)) { - foreach ($value as $paramKey => $paramValue) { - if (in_array($paramKey, $possibleOrgIds)) { - if ($paramValue == $oldOrgId) { - $requestCache[$key][$paramKey] = $orgId; - } - } - } - } - } - $this->session->requestCache = $requestCache; - - if (Gems_Cookies::setOrganization($orgId, $this->basepath->getBasePath())) { - if ($url) { - $this->getResponse()->setRedirect($url); - } else { - $user->gotoStartPage($this->menu, $request); - } - return; - } - - throw new Exception($this->_('Cookies must be enabled.')); + return; } throw new Exception($this->_('Invalid organization.')); @@ -137,27 +102,6 @@ parent::createAction(); } - - public function chooseAction() - { - $this->addSnippet('Organization_ChooseOrganizationSnippet'); - $this->html->h3($this->_('Choose an organization')); - - $user = $this->loader->getCurrentUser(); - $request = $this->getRequest(); - - foreach ($user->getAllowedOrganizations() as $orgId => $name) { - $org = $this->loader->getOrganization($orgId); - - if ($org->canHaveRespondents()) { - $url = array($request->getActionKey() => 'change-ui'); - $url['org'] = $orgId; - - $this->html->pInfo()->actionLink($url, $name, array('style' => 'font-size: 120%;')); - } - } - } - /** * Creates a model for getModel(). Called only for each new $action. * Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-23 18:52:36 UTC (rev 278) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2011-11-24 11:11:14 UTC (rev 279) @@ -100,13 +100,21 @@ $this->checkRequiredValues(); } - protected function _getPasswordRules(array $current, array $keys, array &$rules) + /** + * Add recursively the rules active for this specific set of codes. + * + * @param array $current The current (part)sub) array of $this->passwords to check + * @param array $codes An array of code names that identify rules that should be used only for those codes. + * @param array $rules The array that stores the activated rules. + * @return void + */ + protected function _getPasswordRules(array $current, array $codes, array &$rules) { foreach ($current as $key => $value) { if (is_array($value)) { // Only act when this is in the set of key values - if (isset($keys[strtolower($key)])) { - $this->_getPasswordRules($value, $keys, $rules); + if (isset($codes[strtolower($key)])) { + $this->_getPasswordRules($value, $codes, $rules); } } else { $rules[$key] = $value; @@ -195,6 +203,30 @@ } /** + * Returns an array with throttling settings for the ask + * controller + * + * @return array + */ + public function getAskThrottleSettings() + { + // Check for the 'askThrottle' config section + if (!empty($this->askThrottle)) { + return $this->askThrottle; + } else { + // Set some sensible defaults + // Detection window: 15 minutes + // Threshold: 20 requests per minute + // Delay: 10 seconds + $throttleSettings = array( + 'period' => 15 * 60, + 'threshold' => 15 * 20, + 'delay' => 10 + ); + } + } + + /** * Returns the public name of this project. * @return string */ @@ -204,20 +236,20 @@ } /** + * Get the rules active for this specific set of codes. * - * @param string $userDefinition - * @param string $role + * @param array $codes An array of code names that identify rules that should be used only for those codes. * @return array */ - public function getPasswordRules($userDefinition, $role) + public function getPasswordRules(array $codes) { - $args = MUtil_Ra::flatten(func_get_args()); - $args = array_change_key_case(array_flip(array_filter($args))); - // MUtil_Echo::track($args); + // Process the codes array to a format better used for filtering + $codes = array_change_key_case(array_flip(array_filter($codes))); + // MUtil_Echo::track($codes); $rules = array(); if (isset($this->passwords) && is_array($this->passwords)) { - $this->_getPasswordRules($this->passwords, $args, $rules); + $this->_getPasswordRules($this->passwords, $codes, $rules); } return $rules; @@ -238,30 +270,6 @@ } /** - * Returns an array with throttling settings for the ask - * controller - * - * @return array - */ - public function getAskThrottleSettings() - { - // Check for the 'askThrottle' config section - if (!empty($this->askThrottle)) { - return $this->askThrottle; - } else { - // Set some sensible defaults - // Detection window: 15 minutes - // Threshold: 20 requests per minute - // Delay: 10 seconds - $throttleSettings = array( - 'period' => 15 * 60, - 'threshold' => 15 * 20, - 'delay' => 10 - ); - } - } - - /** * Returns the super admin name, if any * * @return string @@ -296,7 +304,7 @@ return $this->admin['ipRanges']; } } - + /** * Returns a salted hash on the * Modified: trunk/library/classes/Gems/User/Organization.php =================================================================== --- trunk/library/classes/Gems/User/Organization.php 2011-11-23 18:52:36 UTC (rev 278) +++ trunk/library/classes/Gems/User/Organization.php 2011-11-24 11:11:14 UTC (rev 279) @@ -186,7 +186,7 @@ } /** - * Get the style attribute. + * Get the code attribute. * * @return string */ @@ -196,6 +196,26 @@ } /** + * Get the organization id. + * + * @return int + */ + public function getId() + { + return $this->_organizationData['gor_id_organization']; + } + + /** + * Get the name of the organization. + * + * @return string + */ + public function getName() + { + return $this->_organizationData['gor_name']; + } + + /** * Get the style attribute. * * @return string Modified: trunk/library/classes/Gems/User/PasswordChecker.php =================================================================== --- trunk/library/classes/Gems/User/PasswordChecker.php 2011-11-23 18:52:36 UTC (rev 278) +++ trunk/library/classes/Gems/User/PasswordChecker.php 2011-11-24 11:11:14 UTC (rev 279) @@ -206,16 +206,16 @@ /** * Check for password weakness. * - * @param Gems_User_User $user The user for e.g. name checks * @param string $password + * @param array $codes An array of code names that identify rules that should be used only for those codes. * @return mixed String or array of strings containing warning messages */ - public function reportPasswordWeakness(Gems_User_User $user, $password) + public function reportPasswordWeakness(Gems_User_User $user, $password, array $codes) { + $this->user = $user; $this->_errors = array(); - $this->user = $user; - $rules = $this->project->getPasswordRules($user->getOrganizationCode(), $user->getRoles(), $user->getDefinitionName()); + $rules = $this->project->getPasswordRules($codes); // MUtil_Echo::track($rules); foreach ($rules as $rule => $parameter) { Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2011-11-23 18:52:36 UTC (rev 278) +++ trunk/library/classes/Gems/User/User.php 2011-11-24 11:11:14 UTC (rev 279) @@ -59,30 +59,42 @@ private $_vars; /** + * Required * * @var MUtil_Acl */ protected $acl; /** + * Required * + * @var Gems_Util_BasePath + */ + protected $basepath; + + /** + * Required + * * @var Zend_Db_Adapter_Abstract */ protected $db; /** + * Required, set in constructor * * @var Gems_User_UserDefinitionInterface */ protected $definition; /** + * Required * * @var Zend_Session_Namespace */ protected $session; /** + * Required * * @var Gems_User_UserLoader */ @@ -260,7 +272,7 @@ */ public function checkRegistryRequestsAnswers() { - if (! $this->session instanceof Zend_Session_Namespace) { + if (! (($this->db instanceof Zend_Db_Adapter_Abstract) && ($this->session instanceof Zend_Session_Namespace))) { return false; } @@ -292,7 +304,7 @@ $this->refreshAllowedOrganizations(); } - return true; + return (boolean) $this->acl && $this->basepath && $this->userLoader; } /** @@ -319,11 +331,11 @@ * Returns the name of the user definition. * * @return string - */ + * NOT NEEDED FOR THE MOMENT / public function getDefinitionName() { return $this->_getVar('__user_definition'); - } + } // */ /** * Return true if this user has a password. @@ -390,6 +402,15 @@ /** * + * @return Gems_User_Organization + */ + public function getOrganization() + { + return $this->userLoader->getOrganization($this->getOrganizationId()); + } + + /** + * * @return int */ public function getOrganizationId() @@ -407,13 +428,13 @@ * Gets the (optional) organization code. * * @return string - */ + * NOT NEEDED FOR THE MOMENT / public function getOrganizationCode() { $organizationId = $this->getOrganizationId(); return $this->userLoader->getOrganization($organizationId)->getCode(); - } + } // */ /** * Return a password reset key @@ -632,7 +653,11 @@ if ($this->canSetPassword()) { $checker = $this->userLoader->getPasswordChecker(); - return $checker->reportPasswordWeakness($this, $password); + $codes[] = $this->getOrganization()->getCode(); + $codes[] = $this->getRoles(); + $codes[] = $this->_getVar('__user_definition'); + + return $checker->reportPasswordWeakness($this, $password, MUtil_Ra::flatten($codes)); } } @@ -667,7 +692,64 @@ return $this; } + /** + * Set the currently selected organization for this user + * + * @param mixed $organization Gems_User_Organization or an organization id. + * @return Gems_User_User (continuation pattern) + */ + public function setCurrentOrganization($organization) + { + if ($organization instanceof Gems_User_Organization) { + $organizationId = $organization->getId(); + } else { + $organizationId = $organization; + $organization = $this->userLoader->getOrganization($organizationId); + } + $oldOrganizationId = $this->getOrganizationId(); + + if ($organizationId != $oldOrganizationId) { + $this->_setVar('user_organization_id', $organizationId); + + // Depreciation warning: the settings will be removed in + // version 1.6 at the latest. + $this->_setVar('user_organization_name', $organization->getName()); + $this->_setVar('user_style', $organization->getStyle()); + // End depreciation warning + + if ($this->isCurrentUser()) { + // Now update the requestcache to change the oldOrgId to the new orgId + // Don't do it when the oldOrgId doesn't match + $requestCache = $this->session->requestCache; + + //Create the list of request cache keys that match an organization ID (to be extended) + $possibleOrgIds = array( + 'gr2o_id_organization', + 'gto_id_organization'); + + foreach ($requestCache as $key => $value) { + if (is_array($value)) { + foreach ($value as $paramKey => $paramValue) { + if (in_array($paramKey, $possibleOrgIds)) { + if ($paramValue == $oldOrganizationId) { + $requestCache[$key][$paramKey] = $organizationId; + } + } + } + } + } + $this->session->requestCache = $requestCache; + } + } + + if (! Gems_Cookies::setOrganization($organizationId, $this->basepath->getBasePath())) { + throw new Exception($this->_('Cookies must be enabled for this site.')); + } + + return $this; + } + /** * Set the password, if allowed for this user type. * Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-11-23 18:52:36 UTC (rev 278) +++ trunk/library/classes/Gems/User/UserLoader.php 2011-11-24 11:11:14 UTC (rev 279) @@ -299,7 +299,7 @@ { $checker = $this->_getClass('passwordChecker'); - return $checker->reportPasswordWeakness($user, $password); + return $user->reportPasswordWeakness($password); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-24 17:17:45
|
Revision: 284 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=284&view=rev Author: matijsdejong Date: 2011-11-24 17:17:39 +0000 (Thu, 24 Nov 2011) Log Message: ----------- Users can now login as any organization they are allowed to access. Oodles of small bugs, e.g. gor_accessible_by implemented in wrong way Modified Paths: -------------- trunk/library/classes/Gems/User/OldStaffUserDefinition.php trunk/library/classes/Gems/User/Organization.php trunk/library/classes/Gems/User/StaffUserDefinition.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/User/UserLoader.php trunk/library/snippets/Organization/OrganizationTableSnippet.php Modified: trunk/library/classes/Gems/User/OldStaffUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2011-11-24 15:35:11 UTC (rev 283) +++ trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2011-11-24 17:17:39 UTC (rev 284) @@ -148,7 +148,7 @@ // For a multi-layout project we need to select the appropriate style too, // but as PATCHES may not be in effect we have to try two selects $select2 = clone $select; - $select2->columns(array('user_style' => 'gor_style', 'user_allowed_ip_ranges' => 'ggp_allowed_ip_ranges', 'accessible_by' => 'gor_accessible_by'), 'gems__organizations'); + $select2->columns(array('user_allowed_ip_ranges' => 'ggp_allowed_ip_ranges'), 'gems__groups'); try { // Fails before patch has run... @@ -184,7 +184,6 @@ ->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')) ->where('ggp_group_active = 1') - ->where('gor_active = 1') ->where('gsf_active = 1') ->where('gsf_login = ?') ->limit(1); Modified: trunk/library/classes/Gems/User/Organization.php =================================================================== --- trunk/library/classes/Gems/User/Organization.php 2011-11-24 15:35:11 UTC (rev 283) +++ trunk/library/classes/Gems/User/Organization.php 2011-11-24 17:17:39 UTC (rev 284) @@ -32,7 +32,7 @@ * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + * @version $id: Organization.php 203 2011-07-07 12:51:32Z matijs $ */ /** @@ -57,12 +57,21 @@ 'gor_id_organization' => 1, 'gor_name' => 'NO ORGANIZATION', 'gor_code' => null, + 'gor_location' => null, + 'gor_url' => null, + 'gor_task' => null, + 'gor_accessible_by' => null, + 'gor_contact_name' => null, + 'gor_contact_email' => null, + 'gor_welcome' => null, + 'gor_signature' => null, 'gor_style' => null, 'gor_iso_lang' => 'en', + 'gor_has_respondents' => 0, + 'gor_add_respondents' => 0, 'gor_active' => 0, - 'gor_has_respondents' => false, - 'gor_add_respondents' => false - ); + 'can_access' => array(), + ); /** * @@ -173,21 +182,46 @@ } if (! $this->_organizationData) { - $this->_organizationData = $this->db->fetchRow('SELECT * FROM gems__organizations WHERE gor_id_organization = ? LIMIT 1', $this->_organizationId); + $sql = "SELECT * FROM gems__organizations WHERE gor_id_organization = ? LIMIT 1"; + $this->_organizationData = $this->db->fetchRow($sql, $this->_organizationId); if (! $this->_organizationData) { $this->_organizationData = $this->_noOrganization; + } else { + $dbOrgId = $this->db->quote($this->_organizationId, Zend_Db::INT_TYPE); + $sql = "SELECT gor_id_organization, gor_name + FROM gems__organizations + WHERE gor_active = 1 AND + ( + gor_id_organization = $dbOrgId OR + gor_accessible_by LIKE '%:$dbOrgId:%' + ) + ORDER BY gor_name"; + $this->_organizationData['can_access'] = $this->db->fetchPairs($sql); + + // MUtil_Echo::track($sql, $this->_organizationData['can_access']); } if ($cacheId) { $this->cache->save($this->_organizationData, $cacheId); } } + // MUtil_Echo::track($this->_organizationData); return is_array($this->_organizationData) && parent::checkRegistryRequestsAnswers(); } /** + * Get the organizations this organizations can access. + * + * @return array Of type orgId => orgName + */ + public function getAllowedOrganizations() + { + return $this->_organizationData['can_access']; + } + + /** * Get the code attribute. * * @return string Modified: trunk/library/classes/Gems/User/StaffUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/StaffUserDefinition.php 2011-11-24 15:35:11 UTC (rev 283) +++ trunk/library/classes/Gems/User/StaffUserDefinition.php 2011-11-24 17:17:39 UTC (rev 284) @@ -192,16 +192,9 @@ 'user_base_org_id' => 'gsf_id_organization')) ->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', 'user_allowed_ip_ranges' => 'ggp_allowed_ip_ranges')) - ->join('gems__organizations', 'gul_id_organization = gor_id_organization', - array( - 'user_organization_id' => 'gor_id_organization', - 'user_organization_name' => 'gor_name', - 'user_style' => 'gor_style', - 'accessible_by' => 'gor_accessible_by')) ->joinLeft('gems__user_passwords', 'gul_id_user = gup_id_user', array('user_password_reset' => 'gup_reset_required')) ->where('ggp_group_active = 1') - ->where('gor_active = 1') ->where('gsf_active = 1') ->where('gul_can_login = 1') ->where('gul_login = ?') Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2011-11-24 15:35:11 UTC (rev 283) +++ trunk/library/classes/Gems/User/User.php 2011-11-24 17:17:39 UTC (rev 284) @@ -230,6 +230,7 @@ $auth = Gems_Auth::getInstance(); $formValues['allowed_ip_ranges'] = $this->getAllowedIPRanges(); + $formValues['organization'] = $this->getBaseOrganizationId(); $adapter = $this->definition->getAuthAdapter($formValues); $authResult = $auth->authenticate($adapter, $formValues); @@ -305,11 +306,6 @@ } } - if (! $this->_hasVar('__allowedOrgs')) { - // Is always requested so no win in waiting. - $this->refreshAllowedOrganizations(); - } - return (boolean) $this->acl && $this->basepath && $this->userLoader; } @@ -330,10 +326,25 @@ */ public function getAllowedOrganizations() { + + if (! $this->_hasVar('__allowedOrgs')) { + $this->refreshAllowedOrganizations(); + } + return $this->_getVar('__allowedOrgs'); } /** + * Returns the original (not the current) organization used by this user. + * + * @return Gems_User_Organization + */ + public function getBaseOrganization() + { + return $this->userLoader->getOrganization($this->getBaseOrganizationId()); + } + + /** * Returns the original (not the current) organization id of this user. * * @return int @@ -605,33 +616,14 @@ */ public function refreshAllowedOrganizations() { - $sql = "SELECT gor_id_organization, gor_name FROM gems__organizations WHERE "; - // Privilege overrules organizational settings - if (! $this->hasPrivilege('pr.organization-switch')) { - if ($by = $this->_getVar('accessible_by')) { - $orgs = explode(':', trim($by, ':')); - - if ($orgs) { - // Not to forget: the users own organization - $orgs[] = $this->getBaseOrganizationId(); - - $sql .= "gor_id_organization IN ("; - $sql .= implode(', ', $orgs); - $sql .= ") AND "; - } else { - $sql = false; - } - } else { - $sql = false; - } - } - if ($sql) { - $sql .= " gor_active = 1 ORDER BY gor_name"; - $orgs = $this->db->fetchPairs($sql); + if ($this->hasPrivilege('pr.organization-switch')) { + $orgs = $this->db->fetchPairs("SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active = 1 ORDER BY gor_name"); } else { - $orgs = array(); + $orgs = $this->getBaseOrganization()->getAllowedOrganizations(); } + natsort($orgs); + // MUtil_Echo::track($orgs); $this->_setVar('__allowedOrgs', $orgs); Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-11-24 15:35:11 UTC (rev 283) +++ trunk/library/classes/Gems/User/UserLoader.php 2011-11-24 17:17:39 UTC (rev 284) @@ -126,16 +126,6 @@ } /** - * Get an array of OrgId => Org Name for all allowed organizations for the current loggedin user - * - * @return array - */ - public function getAllowedOrganizations() - { - return $this->db->fetchPairs("SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active = 1 ORDER BY gor_name"); - } - - /** * Get the currently loggin in user * * @return Gems_User_User @@ -194,14 +184,15 @@ * @param int $organization * @return Gems_User_User But ! ->isActive when the user does not exist */ - public function getUser($login_name, $organization) + public function getUser($login_name, $currentOrganization) { - $defName = $this->getUserClassName($login_name, $organization); + list($defName, $userOrganization) = $this->getUserClassInfo($login_name, $currentOrganization); + // MUtil_Echo::track($defName, $userOrganization); $definition = $this->_getClass($defName); - $values = $definition->getUserData($login_name, $organization); - // MUtil_Echo::track($defName, $login_name, $organization, $values); + $values = $definition->getUserData($login_name, $userOrganization); + // MUtil_Echo::track($defName, $login_name, $userOrganization, $values); if (! isset($values['user_active'])) { $values['user_active'] = true; @@ -211,7 +202,7 @@ $user = $this->_loadClass('User', true, array($values, $definition)); - $user->setCurrentOrganization($organization); + $user->setCurrentOrganization($currentOrganization); return $user; } @@ -239,29 +230,64 @@ * * @param string $login_name * @param int $organization - * @return string + * @return array Containing definitionName, organizationId */ - protected function getUserClassName($login_name, $organization) + protected function getUserClassInfo($login_name, $organization) { if ((null == $login_name) || (null == $organization)) { - return 'NoLoginDefinition'; + return array('NoLoginDefinition', $organization); } if ($this->isProjectUser($login_name)) { - return 'ProjectUserDefinition'; + return array('ProjectUserDefinition', $organization); } try { - $sql = "SELECT gul_user_class FROM gems__user_logins WHERE gul_can_login = 1 AND gul_login = ? AND gul_id_organization = ?"; - if ($class = $this->db->fetchOne($sql, array($login_name, $organization))) { - return $class . 'Definition'; + $sql = "SELECT CONCAT(gul_user_class, 'Definition'), gul_id_organization + FROM gems__user_logins INNER JOIN gems__organizations ON gor_id_organization = gul_id_organization + WHERE gor_active = 1 AND + gul_can_login = 1 AND + gul_login = ? AND + gul_id_organization = ? + LIMIT 1"; + + $params[] = $login_name; + $params[] = $organization; + // MUtil_Echo::track($sql, $params); + + $row = $this->db->fetchRow($sql, $params, Zend_Db::FETCH_NUM); + + if (! $row) { + // Try to get see if this is another allowed organization for this user + $sql = "SELECT CONCAT(gul_user_class, 'Definition'), gul_id_organization + FROM gems__user_logins INNER JOIN gems__organizations ON gor_id_organization != gul_id_organization + WHERE gor_active = 1 AND + gul_can_login = 1 AND + gul_login = ? AND + gor_id_organization = ? AND + gor_accessible_by LIKE CONCAT('%:', gul_id_organization, ':%') + LIMIT 1"; + + // MUtil_Echo::track($sql, $params); + + $row = $this->db->fetchRow($sql, $params, Zend_Db::FETCH_NUM); } + if ($row) { + // MUtil_Echo::track($row); + return $row; + } + } catch (Zend_Db_Exception $e) { // Intentional fall through } // Fail over for pre 1.5 projects - $sql = "SELECT gsf_id_user FROM gems__staff WHERE gsf_active = 1 AND gsf_login = ? AND gsf_id_organization = ?"; + // + // No login as other organization for first login + $sql = "SELECT gsf_id_user + FROM gems__staff INNER JOIN + gems__organizations ON gsf_id_organization = gor_id_organization + WHERE gor_active = 1 AND gsf_active = 1 AND gsf_login = ? AND gsf_id_organization = ?"; if ($user_id = $this->db->fetchOne($sql, array($login_name, $organization))) { // Move user to new staff. @@ -281,10 +307,10 @@ // MUtil_Echo::r($e); } - return self::USER_OLD_STAFF . 'Definition'; + return array(self::USER_OLD_STAFF . 'Definition', $organization); } - return 'NoLoginDefinition'; + return array('NoLoginDefinition', $organization); } protected function isProjectUser($login_name) Modified: trunk/library/snippets/Organization/OrganizationTableSnippet.php =================================================================== --- trunk/library/snippets/Organization/OrganizationTableSnippet.php 2011-11-24 15:35:11 UTC (rev 283) +++ trunk/library/snippets/Organization/OrganizationTableSnippet.php 2011-11-24 17:17:39 UTC (rev 284) @@ -92,7 +92,7 @@ $bridge->addMultiSort($orgName, $BR, 'gor_task', $BR, 'gor_location'); $bridge->addMultiSort($mailName, $BR, 'gor_style', $BR, 'gor_iso_lang'); $bridge->addMultiSort('gor_active', $BR, 'gor_add_respondents', $BR, 'gor_has_respondents'); - // $bridge->add('gor_accessible_by'); + $bridge->add('gor_accessible_by'); if ($editMenuItem = $this->getEditMenuItem()) { $bridge->addItemLink($editMenuItem->toActionLinkLower($this->request, $bridge)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-11-28 11:37:32
|
Revision: 295 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=295&view=rev Author: matijsdejong Date: 2011-11-28 11:37:20 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Separate organization login option added Use of 'Ask token' and 'Lost password' buttons in IndexAction.php now optional. Modified Paths: -------------- trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/classes/Gems/Default/TokenPlanAction.php trunk/library/classes/Gems/Util/DbLookup.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__organizations.20.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 trunk/library/snippets/Organization/OrganizationTableSnippet.php Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-28 10:49:52 UTC (rev 294) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-11-28 11:37:20 UTC (rev 295) @@ -71,6 +71,20 @@ public $project; /** + * The default behaviour for showing a lost password button + * + * @var boolean + */ + protected $showPasswordLostButton = true; + + /** + * The default behaviour for showing an 'ask token' button + * + * @var boolean + */ + protected $showTokenButton = true; + + /** * Returns a link for the token input page. * * @return MUtil_Form_Element_Html @@ -117,18 +131,25 @@ /** * Returns a login form * + * @param boolean $showTokenButton Optional, show 'Ask token' button, $this->showTokenButton is used when not specified + * @param boolean $showPasswordLostButton Optional, show 'Lost password' button, $this->showPasswordLostButton is used when not specified * @return Gems_Form */ - protected function _getLoginForm() + protected function _getLoginForm($showTokenButton = null, $showPasswordLostButton = null) { $form = $this->_getBasicForm($this->_('Login to %s application')); $form->addElement($this->_getOrganizationElement()); $form->addElement($this->_getUserLoginElement()); $form->addElement($this->_getPasswordElement()); $form->addElement($this->_getSubmitButton($this->_('Login'))); - $form->addElement($this->_getAskTokenLinkElement()); - $form->addElement($this->_getResetLinkElement()); + if (null === $showTokenButton ? $this->showTokenButton : $showTokenButton) { + $form->addElement($this->_getAskTokenLinkElement()); + } + if (null === $showPasswordLostButton ? $this->showPasswordLostButton : $showPasswordLostButton) { + $form->addElement($this->_getResetLinkElement()); + } + return $form; } @@ -154,17 +175,27 @@ */ protected function _getOrganizationElement() { - if ($this->escort instanceof Gems_Project_Organization_SingleOrganizationInterface) { + $hidden = $this->escort instanceof Gems_Project_Organization_SingleOrganizationInterface; + if ($hidden) { + $org = $this->escort->getRespondentOrganization(); + } else { + $org = $this->loader->getCurrentUser()->getCurrentOrganizationId(); + $orgs = $this->util->getDbLookup()->getOrganizationsForLogin(); + $hidden = count($orgs) < 2; + } + + if ($hidden) { $element = new Zend_Form_Element_Hidden('organization'); - $element->setValue($this->escort->getRespondentOrganization()); + $element->setValue($org); } else { $element = new Zend_Form_Element_Select('organization'); $element->setLabel($this->_('Organization')); - $element->setMultiOptions($this->util->getDbLookup()->getOrganizations()); + $element->setMultiOptions($orgs); $element->setRequired(true); + $element->setAttrib('size', max(count($orgs) + 1, 6)); if (! $this->_request->isPost()) { - $element->setValue($this->loader->getCurrentUser()->getCurrentOrganizationId()); + $element->setValue($org); } } Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-28 10:49:52 UTC (rev 294) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-28 11:37:20 UTC (rev 295) @@ -136,6 +136,7 @@ ); $yesNo = $this->util->getTranslated()->getYesNo(); $model->set('gor_active', 'label', $this->_('Active'), 'description', $this->_('Can the organization be used?'), 'elementClass', 'Checkbox', 'multiOptions', $yesNo); + $model->set('gor_has_login', 'label', $this->_('Login'), 'description', $this->_('Can people login for this organization?'), 'elementClass', 'CheckBox', 'multiOptions', $yesNo); $model->set('gor_add_respondents', 'label', $this->_('Accepting'), 'description', $this->_('Can new respondents be added to the organization?'), 'elementClass', 'CheckBox', 'multiOptions', $yesNo); $model->set('gor_has_respondents', 'label', $this->_('Respondents'), 'description', $this->_('Does the organization have respondents?'), 'elementClass', 'Exhibitor', 'multiOptions', $yesNo); $model->set('gor_respondent_group', 'label', $this->_('Respondent group'), 'description', $this->_('Allows respondents to login.'), 'multiOptions', $this->util->getDbLookup()->getAllowedRespondentGroups()); Modified: trunk/library/classes/Gems/Default/TokenPlanAction.php =================================================================== --- trunk/library/classes/Gems/Default/TokenPlanAction.php 2011-11-28 10:49:52 UTC (rev 294) +++ trunk/library/classes/Gems/Default/TokenPlanAction.php 2011-11-28 11:37:20 UTC (rev 295) @@ -341,7 +341,7 @@ if (($this->escort instanceof Gems_Project_Organization_MultiOrganizationInterface) && $this->escort->hasPrivilege('pr.plan.choose-org')){ // Select organisation - $options = $this->util->getDbLookup()->getActiveOrganizations(); + $options = $this->util->getDbLookup()->getOrganizationsWithRespondents(); $elements[] = $this->_createSelectElement('gto_id_organization', $options); } Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2011-11-28 10:49:52 UTC (rev 294) +++ trunk/library/classes/Gems/Util/DbLookup.php 2011-11-28 11:37:20 UTC (rev 295) @@ -75,24 +75,7 @@ */ protected $session; - public function getActiveOrganizations() - { - static $organizations; - if (! $organizations) { - $orgId = GemsEscort::getInstance()->getCurrentOrganization(); - $organizations = $this->db->fetchPairs(' - SELECT gor_id_organization, gor_name - FROM gems__organizations - WHERE (gor_active=1 AND - gor_id_organization IN (SELECT gr2o_id_organization FROM gems__respondent2org)) OR - gor_id_organization = ? - ORDER BY gor_name', $orgId); - } - - return $organizations; - } - /** * Return key/value pairs of all active staff members * @@ -230,6 +213,42 @@ return $organizations; } + /** + * Returns a list of the organizations where users can login. + * + * @staticvar array $organizations + * @return array List of the active organizations + */ + public function getOrganizationsForLogin() + { + static $organizations; + + if (! $organizations) { + $organizations = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active=1 AND gor_has_login=1 ORDER BY gor_name'); + natsort($organizations); + } + + return $organizations; + } + + /** + * Returns a list of the organizations that have respondents. + * + * @staticvar array $organizations + * @return array List of the active organizations + */ + public function getOrganizationsWithRespondents() + { + static $organizations; + + if (! $organizations) { + $organizations = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active=1 AND gor_has_respondents=1 ORDER BY gor_name'); + natsort($organizations); + } + + return $organizations; + } + public function getRoles() { $roles = array(); Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-28 10:49:52 UTC (rev 294) +++ trunk/library/configs/db/patches.sql 2011-11-28 11:37:20 UTC (rev 295) @@ -327,6 +327,10 @@ ALTER TABLE `gems__organizations` ADD gor_respondent_group bigint unsigned null AFTER gor_add_respondents; +ALTER TABLE `gems__organizations` ADD gor_has_login boolean not null default 1 AFTER gor_iso_lang; + +UPDATE `gems__organizations` SET gor_has_login = COALESCE((SELECT 1 FROM gems__staff WHERE gsf_id_organization = gor_id_organization GROUP BY gsf_id_organization), 0); + -- PATCH: Log failed logins INSERT INTO `gems__log_actions` (`glac_id_action`, `glac_name`, `glac_change`, `glac_log`, `glac_created`) VALUES (NULL , 'loginFail', '0', '1', CURRENT_TIMESTAMP); Modified: trunk/library/configs/db/tables/gems__organizations.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__organizations.20.sql 2011-11-28 10:49:52 UTC (rev 294) +++ trunk/library/configs/db/tables/gems__organizations.20.sql 2011-11-28 11:37:20 UTC (rev 295) @@ -20,6 +20,7 @@ gor_iso_lang char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'en' references gems__languages (gml_iso_lang), + gor_has_login boolean not null default 1, gor_has_respondents boolean not null default 1, gor_add_respondents boolean not null default 1, gor_respondent_group bigint unsigned references gems__groups (ggp_id_group) null, 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-28 10:49:52 UTC (rev 294) +++ trunk/library/languages/default-en.po 2011-11-28 11:37:20 UTC (rev 295) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-25 17:05+0100\n" +"POT-Creation-Date: 2011-11-28 12:25+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -1023,7 +1023,7 @@ msgstr "%s records found." #: classes/Gems/Default/ExportAction.php:172 -#: classes/Gems/Default/IndexAction.php:162 +#: classes/Gems/Default/IndexAction.php:179 #: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organization" @@ -1056,88 +1056,88 @@ msgid "Administrative groups" msgstr "Administrative groups" -#: classes/Gems/Default/IndexAction.php:83 +#: classes/Gems/Default/IndexAction.php:91 msgid "Enter your token..." msgstr "Enter your token..." -#: classes/Gems/Default/IndexAction.php:124 +#: classes/Gems/Default/IndexAction.php:132 #, php-format msgid "Login to %s application" msgstr "Login to %s application" -#: classes/Gems/Default/IndexAction.php:128 +#: classes/Gems/Default/IndexAction.php:136 msgid "Login" msgstr "Login" -#: classes/Gems/Default/IndexAction.php:145 +#: classes/Gems/Default/IndexAction.php:153 msgid "Back to login" msgstr "Back to login" -#: classes/Gems/Default/IndexAction.php:183 +#: classes/Gems/Default/IndexAction.php:201 msgid "Password" msgstr "Password" -#: classes/Gems/Default/IndexAction.php:198 +#: classes/Gems/Default/IndexAction.php:216 #, php-format msgid "Reset password for %s application" msgstr "Reset password for %s application" -#: classes/Gems/Default/IndexAction.php:202 +#: classes/Gems/Default/IndexAction.php:220 msgid "Reset password" msgstr "Reset password" -#: classes/Gems/Default/IndexAction.php:248 +#: classes/Gems/Default/IndexAction.php:266 msgid "Username" msgstr "Username" -#: classes/Gems/Default/IndexAction.php:288 +#: classes/Gems/Default/IndexAction.php:306 msgid "Your password must be changed." msgstr "Your password must be changed." -#: classes/Gems/Default/IndexAction.php:300 +#: classes/Gems/Default/IndexAction.php:318 #, php-format msgid "Login successful, welcome %s." msgstr "Login successful, welcome %s." -#: classes/Gems/Default/IndexAction.php:340 +#: classes/Gems/Default/IndexAction.php:358 #, php-format msgid "Good bye: %s." msgstr "Good bye: %s." -#: classes/Gems/Default/IndexAction.php:365 +#: classes/Gems/Default/IndexAction.php:383 msgid "Reset accepted, enter your new password." msgstr "Reset accepted, enter your new password." -#: classes/Gems/Default/IndexAction.php:369 +#: classes/Gems/Default/IndexAction.php:387 msgid "This key timed out or does not belong to this user." msgstr "This key timed out or does not belong to this user." -#: classes/Gems/Default/IndexAction.php:386 +#: classes/Gems/Default/IndexAction.php:404 msgid "Password reset requested" msgstr "Password reset requested" -#: classes/Gems/Default/IndexAction.php:387 +#: classes/Gems/Default/IndexAction.php:405 #, php-format msgid "To reset your password for %s, please click this link: %s" msgstr "To reset your password for %s, please click this link: %s" -#: classes/Gems/Default/IndexAction.php:392 +#: classes/Gems/Default/IndexAction.php:410 msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail." msgstr "We sent you an e-mail with a reset link. Click on the link in the e-mail." -#: classes/Gems/Default/IndexAction.php:394 +#: classes/Gems/Default/IndexAction.php:412 msgid "Unable to send e-mail." msgstr "Unable to send e-mail." -#: classes/Gems/Default/IndexAction.php:399 +#: classes/Gems/Default/IndexAction.php:417 msgid "No such user found or no e-mail address known or user cannot be reset." msgstr "No such user found or no e-mail address known or user cannot be reset." -#: classes/Gems/Default/IndexAction.php:403 +#: classes/Gems/Default/IndexAction.php:421 msgid "We received your password reset key." msgstr "We received your password reset key." -#: classes/Gems/Default/IndexAction.php:404 +#: classes/Gems/Default/IndexAction.php:422 msgid "Please enter the organization and username belonging to this key." msgstr "Please enter the organization and username belonging to this key." @@ -1546,67 +1546,71 @@ msgstr "Can the organization be used?" #: classes/Gems/Default/OrganizationAction.php:139 +msgid "Can people login for this organization?" +msgstr "Can people login for this organization?" + +#: classes/Gems/Default/OrganizationAction.php:140 msgid "Accepting" msgstr "Accepting" -#: classes/Gems/Default/OrganizationAction.php:139 +#: classes/Gems/Default/OrganizationAction.php:140 msgid "Can new respondents be added to the organization?" msgstr "Can new patients be added to the organization?" -#: classes/Gems/Default/OrganizationAction.php:140 +#: classes/Gems/Default/OrganizationAction.php:141 msgid "Does the organization have respondents?" msgstr "Does the organization have patients?" -#: classes/Gems/Default/OrganizationAction.php:141 +#: classes/Gems/Default/OrganizationAction.php:142 msgid "Respondent group" msgstr "Patient group" -#: classes/Gems/Default/OrganizationAction.php:141 +#: classes/Gems/Default/OrganizationAction.php:142 msgid "Allows respondents to login." msgstr "Allow patients to login." -#: classes/Gems/Default/OrganizationAction.php:145 +#: classes/Gems/Default/OrganizationAction.php:146 msgid "Greeting" msgstr "Greeting" -#: classes/Gems/Default/OrganizationAction.php:145 #: classes/Gems/Default/OrganizationAction.php:146 +#: classes/Gems/Default/OrganizationAction.php:147 msgid "For emails and token forward screen." msgstr "For emails and token forward screen." -#: classes/Gems/Default/OrganizationAction.php:146 +#: classes/Gems/Default/OrganizationAction.php:147 msgid "Signature" msgstr "Signature" -#: classes/Gems/Default/OrganizationAction.php:148 +#: classes/Gems/Default/OrganizationAction.php:149 msgid "Accessible by" msgstr "Accessible by" -#: classes/Gems/Default/OrganizationAction.php:148 +#: classes/Gems/Default/OrganizationAction.php:149 msgid "Checked organizations see this organizations respondents." msgstr "Checked organizations see this organizations patients." -#: classes/Gems/Default/OrganizationAction.php:158 +#: classes/Gems/Default/OrganizationAction.php:159 msgid "Code name" msgstr "Code name" -#: classes/Gems/Default/OrganizationAction.php:158 +#: classes/Gems/Default/OrganizationAction.php:159 msgid "Only for programmers." msgstr "Only for programmers." -#: classes/Gems/Default/OrganizationAction.php:172 +#: classes/Gems/Default/OrganizationAction.php:173 msgid "Delete organization" msgstr "Delete organization" -#: classes/Gems/Default/OrganizationAction.php:182 +#: classes/Gems/Default/OrganizationAction.php:183 msgid "Edit organization" msgstr "Edit organization" -#: classes/Gems/Default/OrganizationAction.php:192 +#: classes/Gems/Default/OrganizationAction.php:193 msgid "Participating organizations" msgstr "Participating organizations" -#: classes/Gems/Default/OrganizationAction.php:202 +#: classes/Gems/Default/OrganizationAction.php:203 msgid "Show organization" msgstr "Show organization" @@ -1912,41 +1916,41 @@ msgid "Has the respondent signed the informed consent letter?" msgstr "Has the patient signed the informed consent letter?" -#: classes/Gems/Default/RespondentAction.php:199 +#: classes/Gems/Default/RespondentAction.php:204 msgid "Comments" msgstr "Comments" -#: classes/Gems/Default/RespondentAction.php:200 +#: classes/Gems/Default/RespondentAction.php:205 msgid "Physician" msgstr "Physician" -#: classes/Gems/Default/RespondentAction.php:201 +#: classes/Gems/Default/RespondentAction.php:206 msgid "Treatment" msgstr "Treatment" -#: classes/Gems/Default/RespondentAction.php:230 +#: classes/Gems/Default/RespondentAction.php:235 msgid "Rejection code" msgstr "Rejection code" -#: classes/Gems/Default/RespondentAction.php:237 +#: classes/Gems/Default/RespondentAction.php:242 msgid "Delete respondent" msgstr "Delete patient" -#: classes/Gems/Default/RespondentAction.php:288 +#: classes/Gems/Default/RespondentAction.php:293 msgid "Respondent deleted." msgstr "Patient deleted" -#: classes/Gems/Default/RespondentAction.php:291 +#: classes/Gems/Default/RespondentAction.php:296 msgid "Choose a reception code to delete." msgstr "Choose a reception code to delete." -#: classes/Gems/Default/RespondentAction.php:335 +#: classes/Gems/Default/RespondentAction.php:340 msgid "respondent" msgid_plural "respondents" msgstr[0] "patient" msgstr[1] "patients" -#: classes/Gems/Default/RespondentAction.php:405 +#: classes/Gems/Default/RespondentAction.php:410 msgid "Please settle the informed consent form for this respondent." msgstr "Please settle the informed consent form for this patient." 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-28 10:49:52 UTC (rev 294) +++ trunk/library/languages/default-nl.po 2011-11-28 11:37:20 UTC (rev 295) @@ -1,4489 +1,4519 @@ -msgid "" -msgstr "" -"Project-Id-Version: Pulse NL\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-25 17:23+0100\n" -"PO-Revision-Date: \n" -"Last-Translator: Michiel Rook <in...@to...>\n" -"Language-Team: Erasmus MGZ <mat...@ma...>\n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Poedit-Language: Dutch\n" -"X-Poedit-Country: NETHERLANDS\n" -"X-Poedit-SourceCharset: iso-8859-1\n" -"X-Poedit-Basepath: ../\n" -"X-Poedit-KeywordsList: plural:1,2\n" -"X-Poedit-SearchPath-0: .\n" - -#: classes/GemsEscort.php:207 -#, php-format -msgid "Path %s not writable" -msgstr "Path %s niet schrijfbaar" - -#: classes/GemsEscort.php:891 -#, php-format -msgid "User: %s" -msgstr "Login: %s" - -#: classes/GemsEscort.php:916 -msgid "version" -msgstr "versie" - -#: classes/GemsEscort.php:1347 -msgid "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" -msgstr "Let op: uw sessie is verlopen, uw invoer is niet opgeslagen. Controleer uw gegevens en probeer a.u.b. opnieuw." - -#: classes/GemsEscort.php:1474 -msgid "Please check back later." -msgstr "Probeer het later opnieuw." - -#: classes/GemsEscort.php:1476 -#: classes/GemsEscort.php:1481 -msgid "System is in maintenance mode" -msgstr "Systeem is in onderhoudsmodus" - -#: classes/GemsEscort.php:1491 -msgid "No access to site." -msgstr "Geen toegang tot website." - -#: classes/GemsEscort.php:1493 -msgid "You have no access to this site." -msgstr "U heeft geen toegang tot deze website." - -#: classes/GemsEscort.php:1509 -msgid "No access to page" -msgstr "Geen toegang tot pagina" - -#: classes/GemsEscort.php:1511 -#, 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:1516 -msgid "You are no longer logged in." -msgstr "U bent niet meer ingelogd." - -#: classes/GemsEscort.php:1517 -msgid "You must login to access this page." -msgstr "U moet ingelogd zijn voor toegang tot deze pagina." - -#: classes/Gems/Pdf.php:195 -#, php-format -msgid "PDF Source File '%s' not found!" -msgstr "PDF bron bestand %s niet gevonden!" - -#: classes/Gems/Pdf.php:237 -#, php-format -msgid "Could not create '%s' directory." -msgstr "Kon de directory '%s' niet aanmaken." - -#: classes/Gems/Pdf.php:280 -#, php-format -msgid " The error message is: %s" -msgstr "De foutmelding is: %s" - -#: classes/Gems/Tracker.php:732 -msgid "Checks performed" -msgstr "Controle uitgevoerd" - -#: classes/Gems/AccessLog.php:239 -msgid "Database needs to be updated!" -msgstr "Database dient ververst te worden!" - -#: classes/Gems/Html.php:154 -msgid "<< First" -msgstr "<< Eerste" - -#: classes/Gems/Html.php:155 -msgid "< Previous" -msgstr "< Terug" - -#: classes/Gems/Html.php:156 -msgid "Next >" -msgstr "Verder >" - -#: classes/Gems/Html.php:157 -msgid "Last >>" -msgstr "Laatste >>" - -#: classes/Gems/Html.php:158 -msgid " | " -msgstr " | " - -#: classes/Gems/Html.php:162 -msgid "to" -msgstr "tot" - -#: classes/Gems/Html.php:163 -msgid "of" -msgstr "van" - -#: classes/Gems/Menu.php:139 -#, php-format -msgid "About %s" -msgstr "Over %s" - -#: classes/Gems/Menu.php:143 -msgid "Reporting bugs" -msgstr "Meld een bug" - -#: classes/Gems/Menu.php:146 -msgid "Support" -msgstr "Ondersteuning" - -#: classes/Gems/Menu.php:166 -msgid "Project setup" -msgstr "Projectinfo" - -#: classes/Gems/Menu.php:169 -msgid "Database" -msgstr "Database" - -#: classes/Gems/Menu.php:173 -msgid "Content" -msgstr "Inhoud" - -#: classes/Gems/Menu.php:176 -msgid "Execute" -msgstr "Uitvoeren" - -#: classes/Gems/Menu.php:181 -msgid "Patches" -msgstr "Patches" - -#: classes/Gems/Menu.php:182 -msgid "Execute new" -msgstr "Nieuwe aanmaken" - -#: classes/Gems/Menu.php:184 -msgid "Refresh translateables" -msgstr "Ververs vertaalbaren" - -#: classes/Gems/Menu.php:186 -msgid "Run SQL" -msgstr "SQL uitvoeren" - -#: classes/Gems/Menu.php:189 -msgid "Reception codes" -msgstr "Ontvangst codes" - -#: classes/Gems/Menu.php:192 -msgid "Consents" -msgstr "Toestemmingen" - -#: classes/Gems/Menu.php:195 -msgid "Roles" -msgstr "Rollen" - -#: classes/Gems/Menu.php:196 -msgid "Assigned" -msgstr "Toegewezen" - -#: classes/Gems/Menu.php:197 -msgid "Privileges" -msgstr "Priviléges" - -#: classes/Gems/Menu.php:200 -msgid "Groups" -msgstr "Groepen" - -#: classes/Gems/Menu.php:203 -msgid "Organizations" -msgstr "Organisaties" - -#: classes/Gems/Menu.php:206 -msgid "Staff" -msgstr "Medewerkers" - -#: classes/Gems/Menu.php:209 -msgid "Logging" -msgstr "Logboek" - -#: classes/Gems/Menu.php:213 -msgid "Maintenance" -msgstr "Onderhoud" - -#: classes/Gems/Menu.php:218 -msgid "Upgrade" -msgstr "Upgrade" - -#: classes/Gems/Menu.php:219 -msgid "Show" -msgstr "Toon" - -#: classes/Gems/Menu.php:220 -msgid "Execute all" -msgstr "Alles uitvoeren" - -#: classes/Gems/Menu.php:221 -msgid "Execute this" -msgstr "Dit uitvoeren" - -#: classes/Gems/Menu.php:222 -msgid "Execute from here" -msgstr "Uitvoeren vanaf hier" - -#: classes/Gems/Menu.php:223 -msgid "Execute to here" -msgstr "Uitvoeren tot hier" - -#: classes/Gems/Menu.php:235 -#, php-format -msgid "Stand-alone privilige: %s" -msgstr "Zelfstandig privilege: %s" - -#: classes/Gems/Menu.php:242 -msgid "Logon" -msgstr "Login" - -#: classes/Gems/Menu.php:243 -msgid "Lost password" -msgstr "Wachtwoord vergeten" - -#: classes/Gems/Menu.php:244 -msgid "Your account" -msgstr "Uw account" - -#: classes/Gems/Menu.php:245 -msgid "Activity overview" -msgstr "Activiteiten overzicht" - -#: classes/Gems/Menu.php:246 -msgid "Change password" -msgstr "Uw wachtwoord" - -#: classes/Gems/Menu.php:247 -#: classes/Gems/Menu.php:322 -msgid "Token" -msgstr "Kenmerk" - -#: classes/Gems/Menu.php:248 -msgid "Logoff" -msgstr "Uitloggen" - -#: classes/Gems/Menu.php:283 -msgid "Track" -msgstr "Traject" - -#: classes/Gems/Menu.php:290 -#: classes/Gems/Menu.php:341 -msgid "Add" -msgstr "Voeg toe" - -#: classes/Gems/Menu.php:294 -msgid "Preview" -msgstr "Preview" - -#: classes/Gems/Menu.php:301 -msgid "Tracks" -msgstr "Trajecten" - -#: classes/Gems/Menu.php:314 -msgid "Assignments" -msgstr "Toewijzingen" - -#: classes/Gems/Menu.php:326 -msgid "Edit" -msgstr "Wijzig" - -#: classes/Gems/Menu.php:330 -msgid "Delete" -msgstr "Verwijder" - -#: classes/Gems/Menu.php:335 -msgid "Surveys" -msgstr "Vragenlijsten" - -#: classes/Gems/Menu.php:367 -msgid "Fill in" -msgstr "Vul in" - -#: classes/Gems/Menu.php:371 -msgid "Print PDF" -msgstr "Print PDF" - -#: classes/Gems/Menu.php:374 -msgid "E-Mail now!" -msgstr "Email nu!" - -#: classes/Gems/Menu.php:380 -msgid "Answers" -msgstr "Antwoorden" - -#: classes/Gems/Menu.php:518 -msgid "Respondents" -msgstr "Patiënten" - -#: classes/Gems/Menu.php:526 -msgid "Overview" -msgstr "Overzicht" - -#: classes/Gems/Menu.php:533 -msgid "Project" -msgstr "Project" - -#: classes/Gems/Menu.php:536 -msgid "Setup" -msgstr "Beheer" - -#: classes/Gems/Menu.php:539 -msgid "Mail" -msgstr "Email" - -#: classes/Gems/Menu.php:542 -msgid "Track Builder" -msgstr "Traject bouwer" - -#: classes/Gems/Menu.php:551 -msgid "Contact" -msgstr "Contact" - -#: classes/Gems/Menu.php:564 -msgid "Changelog" -msgstr "Changelog" - -#: classes/Gems/Model.php:193 -msgid "Respondent nr" -msgstr "Patiënt nr" - -#: classes/Gems/Model.php:194 -msgid "Opened" -msgstr "Bekeken" - -#: classes/Gems/Model.php:195 -msgid "Consent" -msgstr "Toestemming" - -#: classes/Gems/Model.php:197 -msgid "E-Mail" -msgstr "Email" - -#: classes/Gems/Model.php:202 -msgid "Gender" -msgstr "Geslacht" - -#: classes/Gems/Model.php:203 -msgid "First name" -msgstr "Voornaam" - -#: classes/Gems/Model.php:204 -msgid "Surname prefix" -msgstr "Tussenvoegsel" - -#: classes/Gems/Model.php:205 -msgid "Last name" -msgstr "Achternaam" - -#: classes/Gems/Model.php:207 -msgid "Name" -msgstr "Naam" - -#: classes/Gems/Model.php:210 -msgid "Street" -msgstr "Straat" - -#: classes/Gems/Model.php:211 -msgid "Zipcode" -msgstr "Postcode" - -#: classes/Gems/Model.php:212 -msgid "City" -msgstr "Stad" - -#: classes/Gems/Model.php:214 -msgid "Phone" -msgstr "Telefoon" - -#: classes/Gems/Model.php:216 -msgid "Birthday" -msgstr "Geboren op" - -#: classes/Gems/UpgradesAbstract.php:164 -msgid "Already at max. level." -msgstr "Al op het hoogste niveau." - -#: classes/Gems/UpgradesAbstract.php:171 -#, php-format -msgid "Trying upgrade for %s from level %s to level %s" -msgstr "Probeert upgrade voor %s van niveau %s naar niveau %s uit te voeren" - -#: classes/Gems/UpgradesAbstract.php:179 -#, php-format -msgid "Trying upgrade for %s to level %s: %s" -msgstr "Probeert upgrade voor %s naar niveau %s: %s" - -#: classes/Gems/UpgradesAbstract.php:337 -msgid "Cache cleaned" -msgstr "Cache opgeschoond" - -#: classes/Gems/Auth.php:241 -msgid "Combination of organization, username and password not found." -msgstr "Combinatie van organisatie, gebruikersnaam en wachtwoord niet gevonden." - -#: classes/Gems/Export/Spss.php:59 -msgid "Which file" -msgstr "Kies bestand" - -#: classes/Gems/Export/Spss.php:60 -msgid "syntax" -msgstr "syntax" - -#: classes/Gems/Export/Spss.php:61 -msgid "data" -msgstr "data" - -#: classes/Gems/Export/Spss.php:66 -msgid "Some help for this export" -msgstr "Uitleg over deze export mogelijkheid" - -#: classes/Gems/Export/Excel.php:60 -msgid "Excel options" -msgstr "Excel opties" - -#: classes/Gems/Export/Excel.php:62 -msgid "Export questions instead of variable names" -msgstr "Exporteer vragen in plaats van variabele namen" - -#: classes/Gems/Export/Excel.php:63 -msgid "Format answers" -msgstr "Antwoorden opmaken" - -#: classes/Gems/Util/Translated.php:84 -msgid "-" -msgstr "n.v.t." - -#: classes/Gems/Util/Translated.php:99 -msgid "forever" -msgstr "altijd" - -#: classes/Gems/Util/Translated.php:108 -msgid "n/a" -msgstr "n.v.t." - -#: classes/Gems/Util/Translated.php:117 -msgid "never" -msgstr "nooit" - -#: classes/Gems/Util/Translated.php:126 -msgid "unknown" -msgstr "onbekend" - -#: classes/Gems/Util/Translated.php:142 -msgid "2 days ago" -msgstr "Eergisteren" - -#: classes/Gems/Util/Translated.php:145 -msgid "Yesterday" -msgstr "Gisteren" - -#: classes/Gems/Util/Translated.php:148 -msgid "Today" -msgstr "Vandaag" - -#: classes/Gems/Util/Translated.php:151 -msgid "Tomorrow" -msgstr "Morgen" - -#: classes/Gems/Util/Translated.php:154 -msgid "Over 2 days" -msgstr "Overmorgen" - -#: classes/Gems/Util/Translated.php:159 -#, php-format -msgid "Over %d days" -msgstr "Over %d dagen" - -#: classes/Gems/Util/Translated.php:161 -#, php-format -msgid "%d days ago" -msgstr "%d dagen terug" - -#: classes/Gems/Util/Translated.php:180 -msgid "Send multiple mails per respondent, one for each checked token." -msgstr "Verstuur meerdere emails per patiënt, één per gekozen kenmerk." - -#: classes/Gems/Util/Translated.php:181 -msgid "Send one mail per respondent, mark all checked tokens as send." -msgstr "Verstuur één email per patiënt, zet alle gekozen kenmerken op verzonden." - -#: classes/Gems/Util/Translated.php:182 -msgid "Send one mail per respondent, mark only mailed tokens as send." -msgstr "Verstuur één email per patiënt, zet alleen de verzonden kenmerken op verzonden." - -#: classes/Gems/Util/Translated.php:201 -msgid "Male" -msgstr "Man" - -#: classes/Gems/Util/Translated.php:201 -msgid "Female" -msgstr "Vrouw" - -#: classes/Gems/Util/Translated.php:201 -msgid "Unknown" -msgstr "Onbekend" - -#: classes/Gems/Util/Translated.php:206 -msgid "mr." -msgstr "meneer" - -#: classes/Gems/Util/Translated.php:206 -msgid "mrs." -msgstr "mevrouw" - -#: classes/Gems/Util/Translated.php:206 -msgid "mr./mrs." -msgstr "de heer/mevrouw" - -#: classes/Gems/Util/Translated.php:211 -msgid "Mr." -msgstr "De heer" - -#: classes/Gems/Util/Translated.php:211 -msgid "Mrs." -msgstr "Mevrouw" - -#: classes/Gems/Util/Translated.php:211 -msgid "Mr./Mrs." -msgstr "De heer/Mevrouw" - -#: classes/Gems/Util/Translated.php:229 -#: classes/Gems/Controller/BrowseEditAction.php:785 -msgid "No" -msgstr "Nee" - -#: classes/Gems/Util/Translated.php:229 -msgid "Yes (forget answers)" -msgstr "Ja (vergeet antwoorden)" - -#: classes/Gems/Util/Translated.php:229 -msgid "Yes (keep answers)" -msgstr "Ja (met behoud van antwoorden)" - -#: classes/Gems/Util/Translated.php:240 -#: classes/Gems/Controller/BrowseEditAction.php:784 -msgid "Yes" -msgstr "Ja" - -#: classes/Gems/Controller/ModelActionAbstract.php:97 -msgid "Cancel" -msgstr "Annuleren" - -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:181 -msgid "No data found." -msgstr "Geen gegevens gevonden." - -#: classes/Gems/Controller/BrowseEditAction.php:346 -#, php-format -msgid "New %s..." -msgstr "Nieuw %s..." - -#: classes/Gems/Controller/BrowseEditAction.php:378 -#, php-format -msgid "Delete %s" -msgstr "Verwijder %s" - -#: classes/Gems/Controller/BrowseEditAction.php:382 -#, php-format -msgid "%2$u %1$s deleted" -msgstr "%2$u %1$s verwijderd" - -#: classes/Gems/Controller/BrowseEditAction.php:396 -#, php-format -msgid "Edit %s" -msgstr "Bewerk %s" - -#: classes/Gems/Controller/BrowseEditAction.php:493 -msgid "Free search text" -msgstr "Vrije zoek tekst" - -#: classes/Gems/Controller/BrowseEditAction.php:564 -msgid "Search" -msgstr "Zoeken" - -#: classes/Gems/Controller/BrowseEditAction.php:580 -#, php-format -msgid "No %s found" -msgstr "Geen %s gevonden" - -#: classes/Gems/Controller/BrowseEditAction.php:653 -#, php-format -msgid "No %s found." -msgstr "Geen %s gevonden." - -#: classes/Gems/Controller/BrowseEditAction.php:768 -msgid "Are you sure?" -msgstr "Weet u het zeker?" - -#: classes/Gems/Controller/BrowseEditAction.php:838 -#, php-format -msgid "Unknown %s requested" -msgstr "Onjuist %s verzoek" - -#: classes/Gems/Controller/BrowseEditAction.php:861 -#, php-format -msgid "New %1$s..." -msgstr "Nieuwe %1$s..." - -#: classes/Gems/Controller/BrowseEditAction.php:869 -msgid "Save" -msgstr "Opslaan" - -#: classes/Gems/Controller/BrowseEditAction.php:905 -#, php-format -msgid "%2$u %1$s saved" -msgstr "%2$u %1$s opgeslagen" - -#: classes/Gems/Controller/BrowseEditAction.php:908 -msgid "No changes to save." -msgstr "Geen verandering om op te slaan." - -#: classes/Gems/Controller/BrowseEditAction.php:917 -msgid "Input error! No changes saved!" -msgstr "Invoer fout! Veranderingen niet opgeslagen!" - -#: classes/Gems/Controller/BrowseEditAction.php:945 -#, php-format -msgid "Show %s" -msgstr "Toon %s" - -#: classes/Gems/Controller/BrowseEditAction.php:952 -#, php-format -msgid "Unknown %s." -msgstr "%s is onbekend." - -#: classes/Gems/Email/MailTemplateForm.php:56 -msgid "Send (test)" -msgstr "Verstuur (test)" - -#: classes/Gems/Email/MailTemplateForm.php:81 -#: classes/Gems/Email/EmailFormAbstract.php:193 -#: classes/Gems/Email/EmailFormAbstract.php:250 -msgid "From" -msgstr "Van" - -#: classes/Gems/Email/MailTemplateForm.php:95 -msgid "Test using" -msgstr "Test met" - -#: classes/Gems/Email/MailTemplateForm.php:124 -msgid "To (test)" -msgstr "Aan (test)" - -#: classes/Gems/Email/MailTemplateForm.php:168 -msgid "Test mail send, changes not saved!" -msgstr "Test email verstuurd. De veranderingen zijn nog niet opgeslagen!" - -#: classes/Gems/Email/EmailFormAbstract.php:101 -msgid "no email adress" -msgstr "geen email adres" - -#: classes/Gems/Email/EmailFormAbstract.php:145 -msgid "Available fields" -msgstr "Beschikbare velden" - -#: classes/Gems/Email/EmailFormAbstract.php:153 -msgid "BBCode" -msgstr "BBCode" - -#: classes/Gems/Email/EmailFormAbstract.php:168 -msgid "Message" -msgstr "Bericht" - -#: classes/Gems/Email/EmailFormAbstract.php:216 -msgid "Organization does not have an e-mail address." -msgstr "Organisatie heeft geen email adres." - -#: classes/Gems/Email/EmailFormAbstract.php:231 -msgid "You do not have an e-mail address." -msgstr "U heeft geen email adres." - -#: classes/Gems/Email/EmailFormAbstract.php:289 -msgid "Preview HTML" -msgstr "Html voorbeeld" - -#: classes/Gems/Email/EmailFormAbstract.php:298 -msgid "Preview text" -msgstr "Tekstvoorbeeld" - -#: classes/Gems/Email/EmailFormAbstract.php:306 -msgid "Template" -msgstr "Sjabloon" - -#: classes/Gems/Email/EmailFormAbstract.php:330 -msgid "Send" -msgstr "Verstuur" - -#: classes/Gems/Email/EmailFormAbstract.php:347 -msgid "Subject" -msgstr "Onderwerp" - -#: classes/Gems/Email/EmailFormAbstract.php:427 -msgid "Input error! No changes made!" -msgstr "Invoer fout! Veranderingen niet uitgevoerd!" - -#: classes/Gems/Email/EmailFormAbstract.php:444 -msgid "Subject:" -msgstr "Onderwerp:" - -#: classes/Gems/Email/EmailFormAbstract.php:472 -msgid "Field" -msgstr "Veld" - -#: classes/Gems/Email/EmailFormAbstract.php:473 -msgid "Value" -msgstr "waarde" - -#: classes/Gems/Email/EmailFormAbstract.php:476 -msgid "BBCode info page" -msgstr "BBCode info pagina" - -#: classes/Gems/Email/OneMailForm.php:47 -#: classes/Gems/Email/MultiMailForm.php:49 -msgid "On this test system all mail will be delivered to the from address." -msgstr "Op dit test systeem worden alle emails gestuurd naar het \"van\" adres." - -#: classes/Gems/Email/OneMailForm.php:55 -msgid "Round" -msgstr "Ronde" - -#: classes/Gems/Email/OneMailForm.php:57 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:705 -msgid "Survey" -msgstr "Vragenlijst" - -#: classes/Gems/Email/OneMailForm.php:58 -msgid "Last contact" -msgstr "Contactdatum" - -#: classes/Gems/Email/OneMailForm.php:87 -#: classes/Gems/Email/MultiMailForm.php:101 -msgid "To" -msgstr "Aan" - -#: classes/Gems/Email/OneMailForm.php:131 -#: classes/Gems/Email/TemplateMailer.php:217 -msgid "The sending of emails was blocked for this installation." -msgstr "Het versturen van emails is geblokkeerd in deze installatie." - -#: classes/Gems/Email/OneMailForm.php:140 -#: classes/Gems/Email/TemplateMailer.php:250 -msgid "Mail failed to send." -msgstr "Mail sturen mislukt." - -#: classes/Gems/Email/OneMailForm.php:144 -#, php-format -msgid "Sent email to %s." -msgstr "Email naar %s verzonden." - -#: classes/Gems/Email/TemplateMailer.php:266 -#, php-format -msgid "Sent %d e-mails, updated %d tokens." -msgstr "%d emails verzonden en %d kenmerken bijgewerkt." - -#: classes/Gems/Email/MultiMailForm.php:75 -msgid "Method" -msgstr "Methode" - -#: classes/Gems/Email/MultiMailForm.php:122 -msgid "Survey has been taken." -msgstr "Vragenlijsten is al afgenomen" - -#: classes/Gems/Email/MultiMailForm.php:125 -msgid "Respondent does not have an e-mail address." -msgstr "Patiënt heeft geen email adres" - -#: classes/Gems/Email/MultiMailForm.php:128 -msgid "Survey cannot be taken by a respondent." -msgstr "Deze vragenlijst kan niet door een patiënt ingevuld worden." - -#: classes/Gems/Email/MultiMailForm.php:130 -msgid "Survey cannot be taken at this moment." -msgstr "Deze vragenlijst kan op dit moment niet afgenomen worden." - -#: classes/Gems/Tracker/ChangeTracker.php:63 -#, php-format -msgid "Checked %d tracks." -msgstr "%d trajecten gecontroleerd." - -#: classes/Gems/Tracker/ChangeTracker.php:66 -#, php-format -msgid "Checked %d tokens." -msgstr "%d kenmerken gecontroleerd." - -#: classes/Gems/Tracker/ChangeTracker.php:71 -#, php-format -msgid "Answers changed by survey completion event for %d tokens." -msgstr "Bij %d kenmerken zijn de antwoorden aangepast door vragenlijst afrondingscode." - -#: classes/Gems/Tracker/ChangeTracker.php:74 -#, php-format -msgid "Results and timing changed for %d tokens." -msgstr "Bij %d kenmerken zijn de resultaten en/of de tijdstippen aangepast." - -#: classes/Gems/Tracker/ChangeTracker.php:77 -#, php-format -msgid "%d token round completion events caused changed to %d tokens." -msgstr "%2$d kenmerken zijn aangepast vanwege %1$d ronde voltooiingen." - -#: classes/Gems/Tracker/ChangeTracker.php:80 -#, php-format -msgid "%2$d token date changes in %1$d tracks." -msgstr "De datum van %2$d kenmerken is aangepast in %1$d trajecten." - -#: classes/Gems/Tracker/ChangeTracker.php:83 -#, php-format -msgid "Round changes propagated to %d tokens." -msgstr "%d kenmerken veranderd door ronde aanpassingen." - -#: classes/Gems/Tracker/ChangeTracker.php:86 -#, php-format -msgid "%d tokens created to by round changes." -msgstr "Vanwege ronde aanpassingen zijn nieuwe %d kenmerken gecreëerd." - -#: classes/Gems/Tracker/ChangeTracker.php:89 -msgid "No tokens were changed." -msgstr "Geen kenmerken veranderd." - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:365 -msgid "Track start" -msgstr "Traject start" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:366 -msgid "Track end" -msgstr "Traject einde" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:380 -msgid "Valid from" -msgstr "Geldig vanaf" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:381 -msgid "Valid until" -msgstr "Geldig tot" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:382 -msgid "Start time" -msgstr "Starten tijd" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:383 -msgid "Completion time" -msgstr "Datum invullen" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:398 -msgid "Minutes" -msgstr "Minuten" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:399 -msgid "Hours" -msgstr "Uren" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:400 -msgid "Days" -msgstr "Dagen" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:401 -msgid "Weeks" -msgstr "Weken" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:402 -msgid "Months" -msgstr "Maanden" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:403 -msgid "Quarters" -msgstr "Kwartieren" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:404 -msgid "Years" -msgstr "Jaren" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:438 -msgid "Valid from calculation" -msgstr "Berekening datum geldig vanaf" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:439 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:447 -msgid "Date source" -msgstr "Datum bron" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:440 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:448 -msgid "Round used" -msgstr "Gebruikte ronde" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:441 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:449 -msgid "Date used" -msgstr "Gebruikte datum" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:442 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:450 -msgid "Add to date" -msgstr "Optellen bij datum" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:443 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:451 -msgid "Add to date unit" -msgstr "Datumoptel eenheid" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:446 -msgid "Valid for calculation" -msgstr "Berekening datum geldig tot" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:480 -msgid "Does not expire" -msgstr "Blijft altijd geldig" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:483 -msgid "Use an answer from a survey." -msgstr "Gebruikt een antwoord uit een vragenlijst." - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:484 -msgid "Use a standard token date." -msgstr "Gebruik een datum uit een kenmerk." - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:486 -msgid "Use a track level date." -msgstr "Gebruik een op traject niveau ingestelde datum." - -#: classes/Gems/Tracker/Engine/AnyStepEngine.php:95 -msgid "This round" -msgstr "Deze ronde" - -#: classes/Gems/Tracker/Engine/AnyStepEngine.php:106 -msgid "Engine for tracks where a rounds activation can depend on any previous survey." -msgstr "Een traject type waar de activatie van een ronde van elke willekeurige eerdere ronde afhankelijk kan zijn." - -#: classes/Gems/Tracker/Engine/AnyStepEngine.php:116 -msgid "Previous Survey" -msgstr "Eerdere vragenlijst" - -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:414 -#, php-format -msgid "%s track engines cannot be converted to %s track engines." -msgstr "Traject type %s kan niet geconverteerd worden naar %s." - -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:657 -#, php-format -msgid "%d: %s - %s" -msgstr "%d: %s - %s" - -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:660 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:663 -#, php-format -msgid "%d: %s" -msgstr "%d: %s" - -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:666 -#, php-format -msgid "%s - %s" -msgstr "%s - %s" - -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:706 -msgid "Order" -msgstr "Volgorde" - -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:707 -msgid "Description" -msgstr "Omschrijving" - -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:708 -msgid "After change" -msgstr "Ronde veranderingscode" - -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:709 -msgid "Active" -msgstr "Actief" - -#: classes/Gems/Tracker/Engine/SingleSurveyEngine.php:117 -msgid "Engine for tracks containing a single survey." -msgstr "Een traject type voor trajecten die bestaan uit een enkele vragenlijst." - -#: classes/Gems/Tracker/Engine/SingleSurveyEngine.php:127 -msgid "Single Survey" -msgstr "Losse vragenlijst" - -#: classes/Gems/Tracker/Engine/SingleSurveyEngine.php:149 -msgid "This track type does not allow the creation of new rounds." -msgstr "Dit type traject staat het niet toe dat nieuwe rondes aangemaakt worden." - -#: classes/Gems/Tracker/Engine/NextStepEngine.php:147 -msgid "Engine for tracks where the next round is always dependent on the previous step." -msgstr "Een traject type waar de activatie van een volgende ronde alleen afhangt van de ronde ervoor." - -#: classes/Gems/Tracker/Engine/NextStepEngine.php:158 -msgid "Next Step" -msgstr "Stap voor stap" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:209 -msgid "Measure(d) on" -msgstr "Afname op" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:212 -msgid "Completed" -msgstr "Ingevuld" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:213 -msgid "Duration in seconds" -msgstr "Antwoordtijd (in sec.)" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:214 -msgid "Score" -msgstr "Score" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:215 -msgid "Comments" -msgstr "Opmerkingen" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:216 -msgid "Changed on" -msgstr "Veranderd op" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:219 -msgid "Assigned by" -msgstr "Toewijzer" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:220 -msgid "Respondent name" -msgstr "Patiënt naam" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:223 -msgid "Assigned to" -msgstr "invuller" - -#: classes/Gems/Tracker/Model/StandardTokenModel.php:224 -msgid "Rejection code" -msgstr "Afkeuringscode" - -#: classes/Gems/Tracker/Model/TrackModel.php:107 -msgid "Track Engine" -msgstr "Traject type" - -#: classes/Gems/Tracker/Model/TrackModel.php:112 -msgid "Use until" -msgstr "Geldig tot" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:149 -msgid "Uncertain" -msgstr "Weet niet" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:152 -msgid "Increase" -msgstr "Toenemend" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:153 -msgid "Same" -msgstr "Zelfde" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:154 -msgid "Decrease" -msgstr "Afnemend" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:162 -msgid "Checked" -msgstr "Aangevinkt" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:163 -msgid "Not checked" -msgstr "Niet aangevinkt" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:258 -#, php-format -msgid "Rank %d" -msgstr "Schaal %d" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:277 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:300 -msgid "Comment" -msgstr "Opmerkingen" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:277 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:300 -msgid " (comment)" -msgstr "(opmerkingen)" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:289 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:338 -msgid "Other" -msgstr "Overige" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:472 -msgid "Date" -msgstr "Datum" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:475 -msgid "Free number" -msgstr "Vrij getal" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:481 -msgid "Free text (long)" -msgstr "Vrije tekst (lang)" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:484 -msgid "Free text (very long)" -msgstr "Vrije tekst (zeer lang)" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:487 -msgid "Free text" -msgstr "Vrije tekst" - -#: 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:755 -#, php-format -msgid "- %s" -msgstr "- %s" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:507 -msgid "Submitdate" -msgstr "Invoerdatum" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:883 -#, php-format -msgid "Updated %d Gems tokens to new token definition." -msgstr "%d Gems kenmerken zijn aangepast aan de nieuwe kenmerk definitie." - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:903 -#, php-format -msgid "The '%s' survey is no longer active. The survey was removed from LimeSurvey!" -msgstr "De vragenlijst '%s' is niet meer actief. De vragenlijst is verwijderd uit LimeSurvey!" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1020 -#, php-format -msgid "Updated %d token to new token definition in survey '%s'." -msgid_plural "Updated %d tokens to new token definition in survey '%s'." -msgstr[0] "%d kenmerk in de vragenlijst '%s' is aangepast aan de nieuwe kenmerk definitie." -msgstr[1] "%d kenmerken in de vragenlijst '%s' zijn aangepast aan de nieuwe kenmerk definitie." - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1038 -#, php-format -msgid "The status of the '%s' survey has changed." -msgstr "De status van de vragenlijst '%s' is veranderd." - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1044 -#, php-format -msgid "Survey '%s' IS NO LONGER ACTIVE!!!" -msgstr "De vragenlijst '%s' IS NIET MEER ACTIEF!!!" - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1050 -#, php-format -msgid "The status of the '%s' survey has changed to '%s'." -msgstr "De status van de vragenlijst '%s' is veranderd naar '%s'." - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1053 -#, php-format -msgid "The status warning for the '%s' survey was removed." -msgstr "De status waarschuwing voor de vragenlijst '%s' is verdwenen." - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1059 -#, php-format -msgid "The name of the '%s' survey has changed to '%s'." -msgstr "De naam van de vragenlijst '%s' is veranderd in '%s'." - -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1069 -#, php-format -msgid "Imported the '%s' survey." -msgstr "De vragenlijst '%s' is geïmporteerd." - -#: classes/Gems/Tracker/Snippets/ShowTokenSnippetAbstract.php:164 -#: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:124 -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:223 -#, php-format -msgid "Token %s not found." -msgstr "Kenmerk %s niet gevonden" - -#: classes/Gems/Tracker/Snippets/ShowTokenSnippetAbstract.php:168 -#: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:128 -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:227 -msgid "No token specified." -msgstr "Geen kenmerk opgegeven." - -#: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:149 -msgid "Enter the particulars concerning the assignment to this respondent." -msgstr "Beschrijf de redenen om dit aan deze patiënt toe te wijzen." - -#: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:151 -#: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:152 -msgid "Start" -msgstr "Aanvang" - -#: classes/Gems/Tracker/Snippets/ShowRoundSnippetAbstract.php:132 -#, php-format -msgid "%s round" -msgstr "%s ronde" - -#: classes/Gems/Tracker/Snippets/ShowRoundSnippetAbstract.php:144 -msgid "No round specified." -msgstr "Geen ronde opgegeven." - -#: classes/Gems/Tracker/Snippets/ShowRoundSnippetAbstract.php:163 -msgid "< Previous" -msgstr "< Terug" - -#: classes/Gems/Tracker/Snippets/ShowRoundSnippetAbstract.php:168 -msgid "Next >" -msgstr "Verder >" - -#: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:141 -msgid "token" -msgid_plural "tokens" -msgstr[0] "kenmerk" -msgstr[1] "kenmerken" - -#: classes/Gems/Tracker/Snippets/EditSingleSurveyTokenSnippetAbstract.php:157 -msgid "survey" -msgid_plural "surveys" -msgstr[0] "vragenlijst" -msgstr[1] "vragenlijsten" - -#: classes/Gems/Tracker/Snippets/EditSingleSurveyTokenSnippetAbstract.php:179 -msgid "Add survey" -msgstr "Vragenlijst toevoegen" - -#: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:169 -msgid "track" -msgid_plural "tracks" -msgstr[0] "traject" -msgstr[1] "trajecten" - -#: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:179 -#: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:229 -msgid "Add track" -msgstr "Voeg traject toe" - -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:134 -msgid "Status" -msgstr "Status" - -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:135 -msgid "OK" -msgstr "OK" - -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:138 -msgid "Question" -msgstr "Vraag" - -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:207 -#, php-format -msgid "%s answers for patient number %s" -msgstr "%s antwoorden voor patientnummer %s" - -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:210 -#, php-format -msgid "Answers for token %s, patient number %s: %s." -msgstr "Antwoorden voor kenmerk %s, patientnummer %s: %s." - -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:232 -msgid "Close" -msgstr "Sluiten" - -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:233 -msgid "Print" -msgstr "Afdrukken" - -#: classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php:119 -msgid "round" -msgid_plural "rounds" -msgstr[0] "ronde" -msgstr[1] "rondes" - -#: classes/Gems/Tracker/Snippets/EditRoundSnippetAbstract.php:129 -msgid "Add new round" -msgstr "Nieuwe ronde toevoegen" - -#: classes/Gems/Menu/SubMenuItem.php:355 -msgid "New" -msgstr "Nieuw" - -#: classes/Gems/Menu/SubMenuItem.php:409 -msgid "Export the current data set to Excel" -msgstr "Exporteer de huidige gegevens naar Excel" - -#: classes/Gems/Menu/SubMenuItem.php:413 -msgid "Excel export" -msgstr "Excel export" - -#: classes/Gems/Menu/MenuAbstract.php:243 -msgid "Activity log" -msgstr "Activiteit" - -#: classes/Gems/Menu/MenuAbstract.php:249 -msgid "Automatic mail" -msgstr "Automatische mail" - -#: classes/Gems/Menu/MenuAbstract.php:250 -msgid "Turn Automatic Mail Jobs OFF" -msgstr "Automatische mail opdrachten UITzetten" - -#: classes/Gems/Menu/MenuAbstract.php:251 -msgid "Run" -msgstr "Uitvoeren" - -#: classes/Gems/Menu/MenuAbstract.php:254 -msgid "Servers" -msgstr "Servers" - -#: classes/Gems/Menu/MenuAbstract.php:258 -msgid "Templates" -msgstr "Sjablonen" - -#: classes/Gems/Menu/MenuAbstract.php:290 -msgid "By period" -msgstr "Per periode" - -#: classes/Gems/Menu/MenuAbstract.php:291 -msgid "By token" -msgstr "Per kenmerk" - -#: classes/Gems/Menu/MenuAbstract.php:292 -msgid "By respondent" -msgstr "Per patiënt" - -#: classes/Gems/Menu/MenuAbstract.php:296 -msgid "Bulk mail" -msgstr "Bulk mail" - -#: classes/Gems/Menu/MenuAbstract.php:314 -msgid "Errors" -msgstr "Foutmeldingen" - -#: classes/Gems/Menu/MenuAbstract.php:315 -msgid "PHP" -msgstr "PHP" - -#: classes/Gems/Menu/MenuAbstract.php:317 -msgid "Session" -msgstr "Sessie" - -#: classes/Gems/Menu/MenuAbstract.php:318 -msgid "Maintenance mode" -msgstr "Onderhoudsmodus" - -#: classes/Gems/Menu/MenuAbstract.php:319 -msgid "Clean cache" -msgstr "Cache opruimen" - -#: classes/Gems/Menu/MenuAbstract.php:408 -msgid "Survey Sources" -msgstr "Bronnen" - -#: classes/Gems/Menu/MenuAbstract.php:410 -msgid "Check status" -msgstr "Status controle" - -#: classes/Gems/Menu/MenuAbstract.php:411 -msgid "Synchronize surveys" -msgstr "Synchroniseer vragenlijsten" - -#: classes/Gems/Menu/MenuAbstract.php:412 -#: classes/Gems/Menu/MenuAbstract.php:423 -msgid "Check answers" -msgstr "Antwoord controle" - -#: classes/Gems/Menu/MenuAbstract.php:413 -msgid "Synchronize all surveys" -msgstr "Synchroniseer alle vragenlijsten" - -#: classes/Gems/Menu/MenuAbstract.php:414 -#: classes/Gems/Menu/MenuAbstract.php:424 -msgid "Check all answers" -msgstr "Controleer alle antwoorden" - -#: classes/Gems/Menu/MenuAbstract.php:420 -msgid "PDF" -msgstr "PDF" - -#: classes/Gems/Menu/MenuAbstract.php:432 -msgid "Fields" -msgstr "Velden" - -#: classes/Gems/Menu/MenuAbstract.php:439 -msgid "Rounds" -msgstr "Rondes" - -#: classes/Gems/Menu/MenuAbstract.php:454 -msgid "Check assignments" -msgstr "Controleer toewijzingen" - -#: classes/Gems/Menu/MenuAbstract.php:457 -msgid "Check all assignments" -msgstr "Controleer alle toewijzingen" - -#: classes/Gems/Selector/DateSelectorAbstract.php:309 -msgid "<<" -msgstr "<<" - -#: classes/Gems/Selector/DateSelectorAbstract.php:311 -msgid ">>" -msgstr ">>" - -#: classes/Gems/Selector/DateSelectorAbstract.php:315 -msgid "<" -msgstr "<" - -#: classes/Gems/Selector/DateSelectorAbstract.php:317 -msgid ">" -msgstr ">" - -#: classes/Gems/Selector/DateSelectorAbstract.php:320 -msgid "Now!" -msgstr "Nu!" - -#: classes/Gems/Selector/DateSelectorAbstract.php:360 -msgid "Show by day" -msgstr "Toon per dag" - -#: classes/Gems/Selector/DateSelectorAbstract.php:361 -msgid "Show by week" -msgstr "Toon per weerk" - -#: classes/Gems/Selector/DateSelectorAbstract.php:362 -msgid "Show by month" -msgstr "Toon per maand" - -#: classes/Gems/Selector/DateSelectorAbstract.php:363 -msgid "Show by year" -msgstr "Toon per jaar" - -#: classes/Gems/Selector/DateSelectorAbstract.php:370 -msgid "D" -msgstr "D" - -#: classes/Gems/Selector/DateSelectorAbstract.php:371 -msgid "W" -msgstr "W" - -#: classes/Gems/Selector/DateSelectorAbstract.php:372 -msgid "M" -msgstr "M" - -#: classes/Gems/Selector/DateSelectorAbstract.php:373 -msgid "Y" -msgstr "J" - -#: classes/Gems/Selector/DateSelectorAbstract.php:605 -msgid "Period" -msgstr "Periode" - -#: classes/Gems/Selector/DateSelectorAbstract.php:633 -#, php-format -msgid "week %s" -msgstr "week %s" - -#: classes/Gems/Selector/TokenDateSelector.php:82 -#: classes/Gems/Selector/TokenByGroupDateSelector.php:83 -msgid "for respondents" -msgstr "voor patiënten" - -#: classes/Gems/Selector/TokenDateSelector.php:83 -#: classes/Gems/Selector/TokenByGroupDateSelector.php:84 -msgid "for staff" -msgstr "voor medewerkers" - -#: classes/Gems/Selector/TokenDateSelector.php:86 -msgid "Activated surveys" -msgstr "Geactiveerde vragenlijsten" - -#: classes/Gems/Selector/TokenDateSelector.php:90 -msgid "Unanswered surveys" -msgstr "Onbeantwoorde vragenlijsten" - -#: classes/Gems/Selector/TokenDateSelector.php:94 -#: classes/Gems/Selector/TokenByGroupDateSelector.php:109 -msgid "Partially completed" -msgstr "Gedeeltelijk ingevoerd" - -#: classes/Gems/Selector/TokenDateSelector.php:103 -msgid "Expired surveys" -msgstr "Verlopen vragenlijsten" - -#: classes/Gems/Selector/TokenDateSelector.php:107 -msgid "Answered surveys" -msgstr "Beantwoorde vragenlijsten" - -#: classes/Gems/Selector/TokenByGroupDateSelector.php:87 -msgid "Tokens" -msgstr "Kenmerken" - -#: classes/Gems/Selector/TokenByGroupDateSelector.php:99 -msgid "Todo" -msgstr "Te doen" - -#: classes/Gems/Selector/TokenByGroupDateSelector.php:119 -msgid "Time left in days - average" -msgstr "Tijd over in dagen - gemiddeld" - -#: classes/Gems/Selector/TokenByGroupDateSelector.php:122 -msgid "least time left" -msgstr "de minste tijd over" - -#: classes/Gems/Selector/TokenByGroupDateSelector.php:125 -msgid "most time left" -msgstr "de meeste tijd over" - -#: classes/Gems/Selector/TokenByGroupDateSelector.php... [truncated message content] |
From: <gem...@li...> - 2011-11-28 15:16:51
|
Revision: 299 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=299&view=rev Author: michieltcs Date: 2011-11-28 15:16:40 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Allow switching to a specific organization that matches with the base URL (in multi-layout situations) Modified Paths: -------------- trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/classes/Gems/Util/DbLookup.php trunk/library/configs/db/patches.sql trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-28 13:12:29 UTC (rev 298) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-11-28 15:16:40 UTC (rev 299) @@ -295,8 +295,22 @@ public function loginAction() { $form = $this->_getLoginForm(); + + $request = $this->getRequest(); + + // Allow layout switching based on request base url + if ($this->escort instanceof Gems_Project_Layout_MultiLayoutInterface) { + $hostUrl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath(); + + $organizationId = $this->util->getDbLookup()->getOrganizationForUrl($hostUrl); + + if ($organizationId) { + $user = $this->escort->getLoader()->getUserLoader()->getCurrentUser(); + $user->setCurrentOrganization($organizationId); + $this->escort->layoutSwitch($request); + } + } - $request = $this->getRequest(); if ($request->isPost()) { if ($form->isValid($request->getPost(), false)) { Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-28 13:12:29 UTC (rev 298) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-28 15:16:40 UTC (rev 299) @@ -129,6 +129,11 @@ 'gor_style', 'label', $this->_('Style'), 'multiOptions', MUtil_Lazy::call(array($this->escort, 'getStyles')) ); + $model->setIfExists( + 'gor_url_base', 'label', $this->_('Default url'), + 'size', 50, + 'description', sprintf($this->_('Always switch to this organization when %s is accessed from this url'), $this->project->getName()) + ); } $model->set( 'gor_iso_lang', 'label', $this->_('Language'), Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2011-11-28 13:12:29 UTC (rev 298) +++ trunk/library/classes/Gems/Util/DbLookup.php 2011-11-28 15:16:40 UTC (rev 299) @@ -274,6 +274,20 @@ return $organizations; } + + /** + * Returns the organization + * @param string $url + * @return int|null the organization + */ + public function getOrganizationForUrl($url) + { + try { + return $this->db->fetchOne("SELECT gor_id_organization FROM gems__organizations WHERE gor_active=1 AND gor_url_base = ?", $url); + } catch (Exception $e) { + return null; + } + } public function getRoles() { Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-28 13:12:29 UTC (rev 298) +++ trunk/library/configs/db/patches.sql 2011-11-28 15:16:40 UTC (rev 299) @@ -341,3 +341,6 @@ -- PATCH: Roles fields sometimes empty ALTER TABLE gems__roles CHANGE grl_parents grl_parents text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null; ALTER TABLE gems__roles CHANGE grl_privileges grl_privileges text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null; + +-- PATCH: Base URL / installation URL to facilitate org switching +ALTER TABLE gems__organizations ADD `gor_url_base` VARCHAR(1270) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER `gor_url`; 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-28 13:12:29 UTC (rev 298) +++ trunk/library/languages/default-nl.po 2011-11-28 15:16:40 UTC (rev 299) @@ -1,4519 +1,4502 @@ -msgid "" -msgstr "" -"Project-Id-Version: Pulse NL\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-28 12:25+0100\n" -"PO-Revision-Date: \n" -"Last-Translator: Matijs de Jong <mj...@ma...>\n" -"Language-Team: Erasmus MGZ <mat...@ma...>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: \n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Poedit-Language: Dutch\n" -"X-Poedit-Country: NETHERLANDS\n" -"X-Poedit-SourceCharset: iso-8859-1\n" -"X-Poedit-Basepath: ../\n" -"X-Poedit-KeywordsList: plural:1,2\n" -"X-Poedit-SearchPath-0: .\n" - -#: classes/GemsEscort.php:207 -#, php-format -msgid "Path %s not writable" -msgstr "Path %s niet schrijfbaar" - -#: classes/GemsEscort.php:891 -#, php-format -msgid "User: %s" -msgstr "Login: %s" - -#: classes/GemsEscort.php:916 -msgid "version" -msgstr "versie" - -#: classes/GemsEscort.php:1347 -msgid "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" -msgstr "Let op: uw sessie is verlopen, uw invoer is niet opgeslagen. Controleer uw gegevens en probeer a.u.b. opnieuw." - -#: classes/GemsEscort.php:1474 -msgid "Please check back later." -msgstr "Probeer het later opnieuw." - -#: classes/GemsEscort.php:1476 -#: classes/GemsEscort.php:1480 -#: classes/GemsEscort.php:1481 -msgid "System is in maintenance mode" -msgstr "Systeem is in onderhoudsmodus" - -#: classes/GemsEscort.php:1491 -msgid "No access to site." -msgstr "Geen toegang tot website." - -#: classes/GemsEscort.php:1493 -#: classes/GemsEscort.php:1529 -msgid "You have no access to this site." -msgstr "U heeft geen toegang tot deze website." - -#: classes/GemsEscort.php:1509 -msgid "No access to page" -msgstr "Geen toegang tot pagina" - -#: classes/GemsEscort.php:1511 -#, 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:1516 -#: classes/GemsEscort.php:1527 -msgid "You are no longer logged in." -msgstr "U bent niet meer ingelogd." - -#: classes/GemsEscort.php:1517 -msgid "You must login to access this page." -msgstr "U moet ingelogd zijn voor toegang tot deze pagina." - -#: classes/Gems/AccessLog.php:239 -msgid "Database needs to be updated!" -msgstr "Database dient ververst te worden!" - -#: classes/Gems/Auth.php:241 -msgid "Combination of organization, username and password not found." -msgstr "Combinatie van organisatie, gebruikersnaam en wachtwoord niet gevonden." - -#: classes/Gems/Html.php:154 -msgid "<< First" -msgstr "<< Eerste" - -#: classes/Gems/Html.php:155 -msgid "< Previous" -msgstr "< Terug" - -#: classes/Gems/Html.php:156 -msgid "Next >" -msgstr "Verder >" - -#: classes/Gems/Html.php:157 -msgid "Last >>" -msgstr "Laatste >>" - -#: classes/Gems/Html.php:158 -msgid " | " -msgstr " | " - -#: classes/Gems/Html.php:162 -msgid "to" -msgstr "tot" - -#: classes/Gems/Html.php:163 -msgid "of" -msgstr "van" - -#: classes/Gems/Menu.php:139 -#, php-format -msgid "About %s" -msgstr "Over %s" - -#: classes/Gems/Menu.php:143 -msgid "Reporting bugs" -msgstr "Meld een bug" - -#: classes/Gems/Menu.php:146 -msgid "Support" -msgstr "Ondersteuning" - -#: classes/Gems/Menu.php:166 -msgid "Project setup" -msgstr "Projectinfo" - -#: classes/Gems/Menu.php:169 -msgid "Database" -msgstr "Database" - -#: classes/Gems/Menu.php:173 -msgid "Content" -msgstr "Inhoud" - -#: classes/Gems/Menu.php:176 -msgid "Execute" -msgstr "Uitvoeren" - -#: classes/Gems/Menu.php:181 -msgid "Patches" -msgstr "Patches" - -#: classes/Gems/Menu.php:182 -msgid "Execute new" -msgstr "Nieuwe aanmaken" - -#: classes/Gems/Menu.php:184 -msgid "Refresh translateables" -msgstr "Ververs vertaalbaren" - -#: classes/Gems/Menu.php:186 -msgid "Run SQL" -msgstr "SQL uitvoeren" - -#: classes/Gems/Menu.php:189 -msgid "Reception codes" -msgstr "Ontvangst codes" - -#: classes/Gems/Menu.php:192 -msgid "Consents" -msgstr "Toestemmingen" - -#: classes/Gems/Menu.php:195 -msgid "Roles" -msgstr "Rollen" - -#: classes/Gems/Menu.php:196 -#: classes/Gems/Menu.php:345 -msgid "Assigned" -msgstr "Toegewezen" - -#: classes/Gems/Menu.php:197 -msgid "Privileges" -msgstr "Priviléges" - -#: classes/Gems/Menu.php:200 -msgid "Groups" -msgstr "Groepen" - -#: classes/Gems/Menu.php:203 -msgid "Organizations" -msgstr "Organisaties" - -#: classes/Gems/Menu.php:206 -msgid "Staff" -msgstr "Medewerkers" - -#: classes/Gems/Menu.php:209 -msgid "Logging" -msgstr "Logboek" - -#: classes/Gems/Menu.php:213 -msgid "Maintenance" -msgstr "Onderhoud" - -#: classes/Gems/Menu.php:218 -msgid "Upgrade" -msgstr "Upgrade" - -#: classes/Gems/Menu.php:219 -#: classes/Gems/Menu.php:318 -msgid "Show" -msgstr "Toon" - -#: classes/Gems/Menu.php:220 -msgid "Execute all" -msgstr "Alles uitvoeren" - -#: classes/Gems/Menu.php:221 -msgid "Execute this" -msgstr "Dit uitvoeren" - -#: classes/Gems/Menu.php:222 -msgid "Execute from here" -msgstr "Uitvoeren vanaf hier" - -#: classes/Gems/Menu.php:223 -msgid "Execute to here" -msgstr "Uitvoeren tot hier" - -#: classes/Gems/Menu.php:235 -#, php-format -msgid "Stand-alone privilige: %s" -msgstr "Zelfstandig privilege: %s" - -#: classes/Gems/Menu.php:242 -msgid "Logon" -msgstr "Login" - -#: classes/Gems/Menu.php:243 -msgid "Lost password" -msgstr "Wachtwoord vergeten" - -#: classes/Gems/Menu.php:244 -msgid "Your account" -msgstr "Uw account" - -#: classes/Gems/Menu.php:245 -msgid "Activity overview" -msgstr "Activiteiten overzicht" - -#: classes/Gems/Menu.php:246 -msgid "Change password" -msgstr "Uw wachtwoord" - -#: classes/Gems/Menu.php:247 -#: classes/Gems/Menu.php:287 -#: classes/Gems/Menu.php:322 -msgid "Token" -msgstr "Kenmerk" - -#: classes/Gems/Menu.php:248 -msgid "Logoff" -msgstr "Uitloggen" - -#: classes/Gems/Menu.php:283 -msgid "Track" -msgstr "Traject" - -#: classes/Gems/Menu.php:290 -#: classes/Gems/Menu.php:310 -#: classes/Gems/Menu.php:341 -msgid "Add" -msgstr "Voeg toe" - -#: classes/Gems/Menu.php:294 -#: classes/Gems/Menu.php:377 -msgid "Preview" -msgstr "Preview" - -#: classes/Gems/Menu.php:301 -msgid "Tracks" -msgstr "Trajecten" - -#: classes/Gems/Menu.php:314 -msgid "Assignments" -msgstr "Toewijzingen" - -#: classes/Gems/Menu.php:326 -msgid "Edit" -msgstr "Wijzig" - -#: classes/Gems/Menu.php:330 -msgid "Delete" -msgstr "Verwijder" - -#: classes/Gems/Menu.php:335 -msgid "Surveys" -msgstr "Vragenlijsten" - -#: classes/Gems/Menu.php:367 -msgid "Fill in" -msgstr "Vul in" - -#: classes/Gems/Menu.php:371 -msgid "Print PDF" -msgstr "Print PDF" - -#: classes/Gems/Menu.php:374 -msgid "E-Mail now!" -msgstr "Email nu!" - -#: classes/Gems/Menu.php:380 -msgid "Answers" -msgstr "Antwoorden" - -#: classes/Gems/Menu.php:518 -msgid "Respondents" -msgstr "Patiënten" - -#: classes/Gems/Menu.php:526 -msgid "Overview" -msgstr "Overzicht" - -#: classes/Gems/Menu.php:533 -msgid "Project" -msgstr "Project" - -#: classes/Gems/Menu.php:536 -msgid "Setup" -msgstr "Beheer" - -#: classes/Gems/Menu.php:539 -msgid "Mail" -msgstr "Email" - -#: classes/Gems/Menu.php:542 -msgid "Track Builder" -msgstr "Traject bouwer" - -#: classes/Gems/Menu.php:551 -msgid "Contact" -msgstr "Contact" - -#: classes/Gems/Menu.php:564 -msgid "Changelog" -msgstr "Changelog" - -#: classes/Gems/Model.php:193 -msgid "Respondent nr" -msgstr "Patiënt nr" - -#: classes/Gems/Model.php:194 -msgid "Opened" -msgstr "Bekeken" - -#: classes/Gems/Model.php:195 -msgid "Consent" -msgstr "Toestemming" - -#: classes/Gems/Model.php:197 -msgid "E-Mail" -msgstr "Email" - -#: classes/Gems/Model.php:202 -msgid "Gender" -msgstr "Geslacht" - -#: classes/Gems/Model.php:203 -msgid "First name" -msgstr "Voornaam" - -#: classes/Gems/Model.php:204 -msgid "Surname prefix" -msgstr "Tussenvoegsel" - -#: classes/Gems/Model.php:205 -msgid "Last name" -msgstr "Achternaam" - -#: classes/Gems/Model.php:207 -msgid "Name" -msgstr "Naam" - -#: classes/Gems/Model.php:210 -msgid "Street" -msgstr "Straat" - -#: classes/Gems/Model.php:211 -msgid "Zipcode" -msgstr "Postcode" - -#: classes/Gems/Model.php:212 -msgid "City" -msgstr "Stad" - -#: classes/Gems/Model.php:214 -msgid "Phone" -msgstr "Telefoon" - -#: classes/Gems/Model.php:216 -msgid "Birthday" -msgstr "Geboren op" - -#: classes/Gems/Pdf.php:195 -#, php-format -msgid "PDF Source File '%s' not found!" -msgstr "PDF bron bestand %s niet gevonden!" - -#: classes/Gems/Pdf.php:237 -#, php-format -msgid "Could not create '%s' directory." -msgstr "Kon de directory '%s' niet aanmaken." - -#: classes/Gems/Pdf.php:280 -#, php-format -msgid " The error message is: %s" -msgstr "De foutmelding is: %s" - -#: classes/Gems/Tracker.php:732 -msgid "Checks performed" -msgstr "Controle uitgevoerd" - -#: classes/Gems/UpgradesAbstract.php:164 -msgid "Already at max. level." -msgstr "Al op het hoogste niveau." - -#: classes/Gems/UpgradesAbstract.php:171 -#, php-format -msgid "Trying upgrade for %s from level %s to level %s" -msgstr "Probeert upgrade voor %s van niveau %s naar niveau %s uit te voeren" - -#: classes/Gems/UpgradesAbstract.php:179 -#, php-format -msgid "Trying upgrade for %s to level %s: %s" -msgstr "Probeert upgrade voor %s naar niveau %s: %s" - -#: classes/Gems/UpgradesAbstract.php:337 -msgid "Cache cleaned" -msgstr "Cache opgeschoond" - -#: classes/Gems/Controller/BrowseEditAction.php:346 -#, php-format -msgid "New %s..." -msgstr "Nieuw %s..." - -#: classes/Gems/Controller/BrowseEditAction.php:378 -#, php-format -msgid "Delete %s" -msgstr "Verwijder %s" - -#: classes/Gems/Controller/BrowseEditAction.php:382 -#, php-format -msgid "%2$u %1$s deleted" -msgstr "%2$u %1$s verwijderd" - -#: classes/Gems/Controller/BrowseEditAction.php:396 -#, php-format -msgid "Edit %s" -msgstr "Bewerk %s" - -#: classes/Gems/Controller/BrowseEditAction.php:493 -msgid "Free search text" -msgstr "Vrije zoek tekst" - -#: classes/Gems/Controller/BrowseEditAction.php:564 -msgid "Search" -msgstr "Zoeken" - -#: classes/Gems/Controller/BrowseEditAction.php:580 -#, php-format -msgid "No %s found" -msgstr "Geen %s gevonden" - -#: classes/Gems/Controller/BrowseEditAction.php:653 -#, php-format -msgid "No %s found." -msgstr "Geen %s gevonden." - -#: classes/Gems/Controller/BrowseEditAction.php:768 -msgid "Are you sure?" -msgstr "Weet u het zeker?" - -#: classes/Gems/Controller/BrowseEditAction.php:784 -msgid "Yes" -msgstr "Ja" - -#: classes/Gems/Controller/BrowseEditAction.php:785 -msgid "No" -msgstr "Nee" - -#: classes/Gems/Controller/BrowseEditAction.php:838 -#, php-format -msgid "Unknown %s requested" -msgstr "Onjuist %s verzoek" - -#: classes/Gems/Controller/BrowseEditAction.php:861 -#, php-format -msgid "New %1$s..." -msgstr "Nieuwe %1$s..." - -#: classes/Gems/Controller/BrowseEditAction.php:869 -msgid "Save" -msgstr "Opslaan" - -#: classes/Gems/Controller/BrowseEditAction.php:905 -#, php-format -msgid "%2$u %1$s saved" -msgstr "%2$u %1$s opgeslagen" - -#: classes/Gems/Controller/BrowseEditAction.php:908 -msgid "No changes to save." -msgstr "Geen verandering om op te slaan." - -#: classes/Gems/Controller/BrowseEditAction.php:917 -msgid "Input error! No changes saved!" -msgstr "Invoer fout! Veranderingen niet opgeslagen!" - -#: classes/Gems/Controller/BrowseEditAction.php:945 -#, php-format -msgid "Show %s" -msgstr "Toon %s" - -#: classes/Gems/Controller/BrowseEditAction.php:952 -#, php-format -msgid "Unknown %s." -msgstr "%s is onbekend." - -#: classes/Gems/Controller/ModelActionAbstract.php:97 -#: classes/Gems/Default/AskAction.php:150 -#: classes/Gems/Default/DatabaseAction.php:532 -msgid "Cancel" -msgstr "Annuleren" - -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:181 -msgid "No data found." -msgstr "Geen gegevens gevonden." - -#: classes/Gems/Default/AskAction.php:128 -#, php-format -msgid "Welcome %s," -msgstr "Welkom %s," - -#: classes/Gems/Default/AskAction.php:131 -#, php-format -msgid "Thank you for answering the survey for token %s." -msgstr "Dank u voor het invullen van de vragenlijst voor kenmerk %s." - -#: classes/Gems/Default/AskAction.php:132 -msgid "Please click the button below to answer the next survey." -msgstr "Klik op de onderstaande knop om de volgende vragenlijst in te vullen." - -#: classes/Gems/Default/AskAction.php:137 -#, php-format -msgid "Please click the button below to answer the survey for token %s." -msgstr "Klik op de onderstaande knop om de vragenlijst behorende bij kenmerk %s in te vullen." - -#: classes/Gems/Default/AskAction.php:141 -#, php-format -msgid "Wait one second to open the survey automatically or click on Cancel to stop." -msgid_plural "Wait %d seconds to open the survey automatically or click on Cancel to stop." -msgstr[0] "Over één seconde start de vragenlijst automatisch. Klik op annuleren om dit te onderbreken." -msgstr[1] "Over %d seconden start de vragenlijst automatisch. Klik op annuleren om dit te onderbreken." - -#: classes/Gems/Default/AskAction.php:156 -#, php-format -msgid "After this survey there is one other survey we would like you to answer." -msgid_plural "After this survey there are another %d surveys we would like you to answer." -msgstr[0] "Na deze vragenlijst hebben we nog één andere vragenlijst voor u." -msgstr[1] "Na deze vragenlijst hebben we nog %d andere vragenlijsten voor u." - -#: classes/Gems/Default/AskAction.php:166 -#, php-format -msgid "The survey for token %s is no longer active." -msgstr "De vragenlijst voor kenmerk %s is niet meer in gebruik." - -#: classes/Gems/Default/AskAction.php:170 -#, php-format -msgid "The token %s does not exist." -msgstr "Het kenmerk %s bestaat niet." - -#: classes/Gems/Default/AskAction.php:172 -#, php-format -msgid "Thank you for answering. At the moment we have no further surveys for you to take." -msgstr "Dank u voor uw antwoorden. Op dit moment hebben we geen vragenlijsten meer voor u." - -#: classes/Gems/Default/AskAction.php:174 -#, php-format -msgid "The survey for token %s has been answered and no further surveys are open." -msgstr "De vragenlijst met het kenmerk %s is beantwoord en er staan verder geen vragenlijsten open." - -#: classes/Gems/Default/AskAction.php:181 -#, php-format -msgid "The token %s does not exist (any more)." -msgstr "Het kenmerk %s bestaat niet (meer)." - -#: classes/Gems/Default/AskAction.php:198 -#, php-format -msgid "Enter your %s token" -msgstr "Voer uw %s kenmerk in" - -#: classes/Gems/Default/AskAction.php:203 -#, php-format -msgid "Enter tokens as %s." -msgstr "Kenmerk invoeren als %s." - -#: classes/Gems/Default/AskAction.php:213 -msgid "OK" -msgstr "OK" - -#: classes/Gems/Default/AskAction.php:233 -msgid "The server is currently busy, please wait a while and try again." -msgstr "De server is bezet, wacht u alstublieft een moment en probeer het dan nogmaals." - -#: classes/Gems/Default/AskAction.php:255 -msgid "Tokens identify a survey that was assigned to you personally." -msgstr "Elk kenmerk verwijst naar een specifiek aan u toegekende vragenlijst." - -#: classes/Gems/Default/AskAction.php:255 -msgid "Entering the token and pressing OK will open that survey." -msgstr "Vul uw kenmerk in en druk op OK om die vragenlijst te openen." - -#: classes/Gems/Default/AskAction.php:259 -msgid "After answering the survey you will be logged off automatically." -msgstr "Na het invullen wordt u automatisch uitgelogd." - -#: classes/Gems/Default/AskAction.php:261 -msgid "After answering the survey you will return to the respondent overview screen." -msgstr "Na het invullen van de vragenlijst komt u terug in het patient scherm." - -#: classes/Gems/Default/AskAction.php:268 -msgid "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive." -msgstr "Een kenmerk bestaat uit twee groepen van vier cijfers en letters met een (niet verplicht) streepje ertussen. Hoofdletters of gewone letters maakt niets uit." - -#: classes/Gems/Default/AskAction.php:269 -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:68 -#: classes/Gems/Default/GroupAction.php:88 -msgid "Description" -msgstr "Omschrijving" - -#: classes/Gems/Default/ConsentAction.php:70 -#: classes/Gems/Default/DatabaseAction.php:167 -msgid "Order" -msgstr "Volgorde" - -#: classes/Gems/Default/ConsentAction.php:71 -msgid "Determines order of presentation in interface." -msgstr "Bepaald de presentatie volgorde." - -#: classes/Gems/Default/ConsentAction.php:73 -msgid "Consent code" -msgstr "Consent code" - -#: 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:92 -msgid "respondent consent" -msgid_plural "respondent consents" -msgstr[0] "patiënt toestemming" -msgstr[1] "patiënt toestemmingen" - -#: classes/Gems/Default/ConsentAction.php:97 -msgid "Respondent consents" -msgstr "Patiënt toestemming" - -#: classes/Gems/Default/ContactAction.php:71 -#, php-format -msgid "%s is a web application." -msgstr "%s is een web applicatie." - -#: classes/Gems/Default/ContactAction.php:76 -#, php-format -msgid "The %s project is run by: " -msgstr "%s is een project van: " - -#: classes/Gems/Default/ContactAction.php:82 -#, php-format -msgid "%s is a collaboration of these organizations:" -msgstr "Deze organisaties werken samen voor het %s project:" - -#: classes/Gems/Default/ContactAction.php:103 -#, php-format -msgid "The %s project" -msgstr "Het %s project" - -#: classes/Gems/Default/ContactAction.php:106 -msgid "Information on this application" -msgstr "Information over deze website" - -#: classes/Gems/Default/ContactAction.php:107 -msgid "Links concerning this web application:" -msgstr "Links met informatie over deze website:" - -#: classes/Gems/Default/CronAction.php:148 -msgid "Cron jobs turned off." -msgstr "Cron opdrachten uitgezet." - -#: classes/Gems/Default/CronAction.php:218 -msgid "No mails sent." -msgstr "Geen mail verzonden." - -#: classes/Gems/Default/CronAction.php:221 -msgid "On this test system all mail will be delivered to the from address." -msgstr "Op dit test systeem worden alle emails gestuurd naar het \"van\" adres." - -#: classes/Gems/Default/DatabaseAction.php:64 -#, php-format -msgid "Executed %2$s creation script %1$s:" -msgstr "Uitvoerresultaat %2$s script %1$s:" - -#: classes/Gems/Default/DatabaseAction.php:74 -#, php-format -msgid "%d record(s) returned as result set %d in step %d of %d." -msgstr "%d rij(en) in resultaat %d in stap %d van %d." - -#: classes/Gems/Default/DatabaseAction.php:78 -#, php-format -msgid "%d record(s) updated in step %d of %d." -msgstr "In stap %2$d van %3$d zijn %1$d rij(en) aangepast." - -#: classes/Gems/Default/DatabaseAction.php:81 -#, php-format -msgid "Script ran step %d of %d succesfully." -msgstr "Stap %d van %d in het script met succes uitgevoerd." - -#: classes/Gems/Default/DatabaseAction.php:84 -msgid " in step " -msgstr " in stap " - -#: classes/Gems/Default/DatabaseAction.php:89 -#, php-format -msgid "No script for %1$s." -msgstr "Geen script voor %1$s:" - -#: classes/Gems/Default/DatabaseAction.php:133 -#, php-format -msgid "No rows in %s." -msgstr "Geen gegevens in %s." - -#: classes/Gems/Default/DatabaseAction.php:162 -msgid "Type" -msgstr "Type" - -#: classes/Gems/Default/DatabaseAction.php:166 -msgid "Group" -msgstr "Groep" - -#: classes/Gems/Default/DatabaseAction.php:168 -msgid "Location" -msgstr "Locatie" - -#: classes/Gems/Default/DatabaseAction.php:171 -msgid "Status" -msgstr "Status" - -#: classes/Gems/Default/DatabaseAction.php:172 -msgid "created" -msgstr "bestaat" - -#: classes/Gems/Default/DatabaseAction.php:173 -msgid "not created" -msgstr "niet aanwezig" - -#: classes/Gems/Default/DatabaseAction.php:174 -msgid "unknown" -msgstr "onbekend" - -#: classes/Gems/Default/DatabaseAction.php:177 -msgid "Script" -msgstr "Script" - -#: classes/Gems/Default/DatabaseAction.php:179 -msgid "Changed on" -msgstr "Veranderd op" - -#: classes/Gems/Default/DatabaseAction.php:198 -msgid "This database object does not exist. You cannot delete it." -msgstr "Dit database object bestaat. Het kan dus ook niet verwijderd worden." - -#: classes/Gems/Default/DatabaseAction.php:203 -#, php-format -msgid "Drop %s" -msgstr "Verwijder %s" - -#: classes/Gems/Default/DatabaseAction.php:211 -#, php-format -msgid "There are %d rows in the table." -msgstr "Er zijn %d rijen in deze tabel." - -#: classes/Gems/Default/DatabaseAction.php:213 -#, php-format -msgid "Drop table with %d rows" -msgstr "Tabel met %d rijen aan data verwijderen" - -#: classes/Gems/Default/DatabaseAction.php:214 -msgid "Are you really sure?" -msgstr "Weet u het heel erg zeker?" - -#: classes/Gems/Default/DatabaseAction.php:230 -#, php-format -msgid "%1$s %2$s dropped" -msgstr "%1$s %2$s verwijderd" - -#: classes/Gems/Default/DatabaseAction.php:235 -msgid " during statement " -msgstr " tijdens het commando " - -#: classes/Gems/Default/DatabaseAction.php:246 -#, php-format -msgid "%s no longer exists in the database." -msgstr "%s bestaat niet meer in de database." - -#: classes/Gems/Default/DatabaseAction.php:249 -#, php-format -msgid "%s does not yet exist in the database." -msgstr "%s bestaat nog niet in de database." - -#: classes/Gems/Default/DatabaseAction.php:252 -#, php-format -msgid "%s object does exist." -msgstr "%s object bestaat." - -#: classes/Gems/Default/DatabaseAction.php:270 -msgid "Object is not a table." -msgstr "Niet een tabel object." - -#: classes/Gems/Default/DatabaseAction.php:293 -msgid "Structure" -msgstr "Structuur" - -#: classes/Gems/Default/DatabaseAction.php:302 -msgid "database object" -msgid_plural "database objects" -msgstr[0] "database object" -msgstr[1] "database objects" - -#: classes/Gems/Default/DatabaseAction.php:307 -msgid "Database object overview" -msgstr "Database object overzicht" - -#: classes/Gems/Default/DatabaseAction.php:316 -#: classes/Gems/Default/DatabaseAction.php:368 -msgid "Level" -msgstr "Niveau" - -#: classes/Gems/Default/DatabaseAction.php:317 -#: classes/Gems/Default/DatabaseAction.php:369 -msgid "Subtype" -msgstr "Subtype" - -#: classes/Gems/Default/DatabaseAction.php:319 -msgid "To be executed" -msgstr "Uit te voeren" - -#: classes/Gems/Default/DatabaseAction.php:320 -#: classes/Gems/Default/DatabaseAction.php:372 -msgid "Executed" -msgstr "Uitgevoerd" - -#: classes/Gems/Default/DatabaseAction.php:321 -#: classes/Gems/Default/DatabaseAction.php:373 -msgid "Finished" -msgstr "Afgerond" - -#: classes/Gems/Default/DatabaseAction.php:324 -msgid "Create the patch table!" -msgstr "De patch tabel bestaat nog niet!" - -#: classes/Gems/Default/DatabaseAction.php:326 -#, php-format -msgid "%d new or changed patch(es)." -msgstr "%d nieuwe of veranderde patch(es)." - -#: classes/Gems/Default/DatabaseAction.php:331 -msgid "Gems build" -msgstr "Gems bouwnummer" - -#: classes/Gems/Default/DatabaseAction.php:332 -msgid "Database build" -msgstr "Database versie" - -#: classes/Gems/Default/DatabaseAction.php:334 -msgid "Execute level" -msgstr "Uit te voeren versie" - -#: classes/Gems/Default/DatabaseAction.php:338 -msgid "Ignore finished" -msgstr "Afgeronde patches overslaan" - -#: classes/Gems/Default/DatabaseAction.php:339 -msgid "Ignore executed" -msgstr "Uitgevoerde patches overslaan" - -#: classes/Gems/Default/DatabaseAction.php:340 -msgid "Show patches" -msgstr "Toon patches" - -#: classes/Gems/Default/DatabaseAction.php:354 -#, php-format -msgid "%d patch(es) executed." -msgstr "%d patch(es) uitgevoerd." - -#: classes/Gems/Default/DatabaseAction.php:367 -msgid "Patch" -msgstr "Patch" - -#: classes/Gems/Default/DatabaseAction.php:371 -msgid "Query" -msgstr "Query" - -#: classes/Gems/Default/DatabaseAction.php:374 -msgid "Result" -msgstr "Resultaat" - -#: classes/Gems/Default/DatabaseAction.php:398 -msgid "Patch maintenance" -msgstr "Patch onderhoud" - -#: classes/Gems/Default/DatabaseAction.php:402 -msgid "Patch overview" -msgstr "Patch overzicht" - -#: classes/Gems/Default/DatabaseAction.php:464 -msgid "This database object does not exist. You cannot create it." -msgstr "Dit database object bestaat niet en kan ook niet aangemaakt worden." - -#: classes/Gems/Default/DatabaseAction.php:470 -msgid "This database object has no script. You cannot execute it." -msgstr "Dit database object heeft geen script. Het kan dus ook niet uitgevoerd worden." - -#: classes/Gems/Default/DatabaseAction.php:481 -#, php-format -msgid "Run %s" -msgstr "Voer %s script uit" - -#: classes/Gems/Default/DatabaseAction.php:500 -#, php-format -msgid "Starting %d object creation scripts." -msgstr "Aanvang %d object aanmaak scripts." - -#: classes/Gems/Default/DatabaseAction.php:505 -#, php-format -msgid "Finished %s creation script for object %d of %d" -msgstr "Klaar %s met aanmaak script voor object %d van %d" - -#: classes/Gems/Default/DatabaseAction.php:509 -msgid "All objects exist. Nothing was executed." -msgstr "Alle objects bestaan. Niets was uitgevoerd." - -#: classes/Gems/Default/DatabaseAction.php:515 -msgid "Create not-existing database objects" -msgstr "Aanmaak van database objecten die nog niet bestaan" - -#: classes/Gems/Default/DatabaseAction.php:517 -#, php-format -msgid "One database object does not exist." -msgid_plural "These %d database objects do not exist." -msgstr[0] "Één object bestaat nog niet in de database." -msgstr[1] "%d objecten bestaan nog niet in de database." - -#: classes/Gems/Default/DatabaseAction.php:518 -msgid "Are you sure you want to create it?" -msgid_plural "Are you sure you want to create them all?" -msgstr[0] "Weet je zeker dat je dat object wil aanmaken?" -msgstr[1] "Weet je zeker dat je ze allemaal wil aanmaken?" - -#: classes/Gems/Default/DatabaseAction.php:531 -msgid "All database objects exist. There is nothing to create." -msgstr "Alle database objecten bestaan. Er valt niets te maken." - -#: classes/Gems/Default/DatabaseAction.php:544 -msgid "Separate multiple commands with semicolons (;)." -msgstr "Scheidt meerdere commando's met punt-comma's (;)." - -#: classes/Gems/Default/DatabaseAction.php:551 -msgid "Run" -msgstr "Uitvoeren" - -#: classes/Gems/Default/DatabaseAction.php:560 -msgid "raw" -msgstr "rauw" - -#: classes/Gems/Default/DatabaseAction.php:569 -#, php-format -msgid "Result set %s." -msgstr "Resultaat %s." - -#: classes/Gems/Default/DatabaseAction.php:592 -msgid "Execute raw SQL" -msgstr "SQL direct uitvoeren" - -#: classes/Gems/Default/DatabaseAction.php:595 -msgid "Result sets" -msgstr "Resultaten" - -#: classes/Gems/Default/DatabaseAction.php:620 -msgid "This database object does not exist. You cannot view it." -msgstr "Dit database object bestaat. Het kan dus ook niet bekeken worden." - -#: classes/Gems/Default/DatabaseAction.php:625 -#, php-format -msgid "The data in table %s" -msgstr "De gegevens in tabel %s" - -#: classes/Gems/Default/DatabaseAction.php:626 -#, php-format -msgid "Contents of %s %s" -msgstr "De inhoud van %s %s" - -#: classes/Gems/Default/ExportAction.php:69 -msgid "Data" -msgstr "Data" - -#: classes/Gems/Default/ExportAction.php:74 -msgid "Export data" -msgstr "Exporteer gegevens" - -#: classes/Gems/Default/ExportAction.php:153 -#: classes/Gems/Default/MailJobAction.php:121 -msgid "Survey" -msgstr "Vragenlijst" - -#: classes/Gems/Default/ExportAction.php:168 -#, php-format -msgid "%s records found." -msgstr "%s records gevonden." - -#: classes/Gems/Default/ExportAction.php:172 -#: classes/Gems/Default/IndexAction.php:179 -#: classes/Gems/Default/MailJobAction.php:119 -msgid "Organization" -msgstr "Organisatie" - -#: classes/Gems/Default/ExportAction.php:181 -msgid "Export to" -msgstr "Exporteer naar" - -#: classes/Gems/Default/GroupAction.php:89 -#: classes/Gems/Default/LogAction.php:170 -msgid "Role" -msgstr "Rol" - -#: classes/Gems/Default/GroupAction.php:92 -#: classes/Gems/Default/MailJobAction.php:104 -msgid "Active" -msgstr "Actief" - -#: classes/Gems/Default/GroupAction.php:96 -msgid "Allowed IP Ranges" -msgstr "Toegestane IP adres reeksen" - -#: classes/Gems/Default/GroupAction.php:105 -msgid "group" -msgid_plural "groups" -msgstr[0] "groep" -msgstr[1] "groepen" - -#: classes/Gems/Default/GroupAction.php:110 -msgid "Administrative groups" -msgstr "Beheer groepen" - -#: classes/Gems/Default/IndexAction.php:91 -msgid "Enter your token..." -msgstr "Voer uw kenmerk in..." - -#: classes/Gems/Default/IndexAction.php:132 -#, php-format -msgid "Login to %s application" -msgstr "%s login" - -#: classes/Gems/Default/IndexAction.php:136 -msgid "Login" -msgstr "Login" - -#: classes/Gems/Default/IndexAction.php:153 -msgid "Back to login" -msgstr "Terug naar de login" - -#: classes/Gems/Default/IndexAction.php:201 -msgid "Password" -msgstr "Wachtwoord" - -#: classes/Gems/Default/IndexAction.php:216 -#, php-format -msgid "Reset password for %s application" -msgstr "Reset wachtwoord voor %s" - -#: classes/Gems/Default/IndexAction.php:220 -msgid "Reset password" -msgstr "Reset wachtwoord" - -#: classes/Gems/Default/IndexAction.php:266 -msgid "Username" -msgstr "Gebruikersnaam" - -#: classes/Gems/Default/IndexAction.php:306 -msgid "Your password must be changed." -msgstr "Uw wachtwoord moet veranderd worden." - -#: classes/Gems/Default/IndexAction.php:318 -#, php-format -msgid "Login successful, welcome %s." -msgstr "Login in orde, welkom %s." - -#: classes/Gems/Default/IndexAction.php:358 -#, php-format -msgid "Good bye: %s." -msgstr "Tot ziens: %s." - -#: classes/Gems/Default/IndexAction.php:383 -msgid "Reset accepted, enter your new password." -msgstr "Reset geaccepteerd, voer uw nieuwe wachtwoord in." - -#: classes/Gems/Default/IndexAction.php:387 -msgid "This key timed out or does not belong to this user." -msgstr "Te oude sleutel of sleutel hoort niet bij gebruiker." - -#: classes/Gems/Default/IndexAction.php:404 -msgid "Password reset requested" -msgstr "Wachtwoord reset aangevraagd" - -#: classes/Gems/Default/IndexAction.php:405 -#, php-format -msgid "To reset your password for %s, please click this link: %s" -msgstr "Om uw wachtwoord voor %s te resetten, klik op deze link: %s" - -#: classes/Gems/Default/IndexAction.php:410 -msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail." -msgstr "We hebben u een email met reset link gestuurd. Klik op de link in de email." - -#: classes/Gems/Default/IndexAction.php:412 -msgid "Unable to send e-mail." -msgstr "Verzenden e-mail mislukt." - -#: classes/Gems/Default/IndexAction.php:417 -msgid "No such user found or no e-mail address known or user cannot be reset." -msgstr "Gebruiker niet gevonden of e-mail adres onbekend of gebruiker kan niet gereset worden." - -#: classes/Gems/Default/IndexAction.php:421 -msgid "We received your password reset key." -msgstr "Wachtwoord resetsleutel ontvangen." - -#: classes/Gems/Default/IndexAction.php:422 -msgid "Please enter the organization and username belonging to this key." -msgstr "Geef de organisatie en gebruikersnaam die bij deze sleutel horen op." - -#: classes/Gems/Default/InvitationAction.php:52 -msgid "Invite" -msgstr "Uitnodigen" - -#: classes/Gems/Default/LanguageAction.php:63 -msgid "Cookies must be enabled for setting the language." -msgstr "Zonder cookies kan de taal niet ingesteld worden." - -#: classes/Gems/Default/LanguageAction.php:66 -msgid "Invalid language setting." -msgstr "Ongeldige taal instelling." - -#: classes/Gems/Default/LogAction.php:61 -msgid "from" -msgstr "vanaf" - -#: classes/Gems/Default/LogAction.php:66 -msgid "until" -msgstr "tot" - -#: classes/Gems/Default/LogAction.php:72 -msgid "days" -msgstr "dagen" - -#: classes/Gems/Default/LogAction.php:73 -msgid "weeks" -msgstr "weken" - -#: classes/Gems/Default/LogAction.php:74 -msgid "months" -msgstr "maanden" - -#: classes/Gems/Default/LogAction.php:75 -msgid "years" -msgstr "jaren" - -#: classes/Gems/Default/LogAction.php:96 -msgid "Staff:" -msgstr "Medewerkers:" - -#: classes/Gems/Default/LogAction.php:100 -msgid "All staff" -msgstr "Alle medewerkers" - -#: classes/Gems/Default/LogAction.php:102 -msgid "Patient:" -msgstr "Patiënt:" - -#: classes/Gems/Default/LogAction.php:106 -msgid "All patients" -msgstr "Alle patiënten" - -#: classes/Gems/Default/LogAction.php:109 -msgid "Action:" -msgstr "Actie:" - -#: classes/Gems/Default/LogAction.php:112 -msgid "All actions" -msgstr "Alle acties" - -#: classes/Gems/Default/LogAction.php:163 -msgid "Date" -msgstr "Datum" - -#: classes/Gems/Default/LogAction.php:164 -#: classes/Gems/Default/LogMaintenanceAction.php:52 -msgid "Action" -msgstr "Actie" - -#: classes/Gems/Default/LogAction.php:165 -msgid "Message" -msgstr "Bericht" - -#: classes/Gems/Default/LogAction.php:167 -msgid "Respondent" -msgstr "Patiënt" - -#: classes/Gems/Default/LogAction.php:171 -msgid "IP address" -msgstr "IP adres" - -#: classes/Gems/Default/LogAction.php:178 -#: classes/Gems/Default/LogMaintenanceAction.php:53 -msgid "Log" -msgstr "Logboek" - -#: classes/Gems/Default/LogMaintenanceAction.php:70 -msgid "Log:" -msgstr "Logboek:" - -#: classes/Gems/Default/LogMaintenanceAction.php:71 -msgid "All" -msgstr "Alles" - -#: classes/Gems/Default/LogMaintenanceAction.php:77 -msgid "Log action" -msgstr "Logboek actie" - -#: classes/Gems/Default/LogMaintenanceAction.php:81 -msgid "Log maintenance" -msgstr "Logboek onderhoud" - -#: classes/Gems/Default/MailJobAction.php:62 -msgid "No automatic mail jobs found..." -msgstr "Geen automatische mail opdrachten gevonden.." - -#: classes/Gems/Default/MailJobAction.php:72 -msgid "New automatic mail job..." -msgstr "Nieuwe automatische mail opdracht..." - -#: classes/Gems/Default/MailJobAction.php:100 -msgid "Template" -msgstr "Sjabloon" - -#: classes/Gems/Default/MailJobAction.php:101 -msgid "By staff member" -msgstr "Door medewerke" - -#: classes/Gems/Default/MailJobAction.php:103 -msgid "Used for logging and possibly from address." -msgstr "Gebruikt voor activiteiten log en eventueel voor vanaf adres." - -#: classes/Gems/Default/MailJobAction.php:106 -msgid "Job is only run when active." -msgstr "Een opdracht wordt alleen uitgevoerd als deze actief is." - -#: classes/Gems/Default/MailJobAction.php:109 -msgid "From address used" -msgstr "Gebruikte vanaf adres" - -#: classes/Gems/Default/MailJobAction.php:111 -msgid "From other" -msgstr "Vanaf overig" - -#: classes/Gems/Default/MailJobAction.php:112 -#, php-format -msgid "Only when '%s' is '%s'." -msgstr "Aleen als '%s' is '%s'." - -#: classes/Gems/Default/MailJobAction.php:114 -msgid "Processing Method" -msgstr "Verwerkings methode" - -#: classes/Gems/Default/MailJobAction.php:115 -msgid "Filter for" -msgstr "Selecteer op" - -#: classes/Gems/Default/MailJobAction.php:116 -msgid "Days between reminders" -msgstr "Aantal dagen tussen herinneringen" - -#: classes/Gems/Default/MailJobAction.php:132 -msgid "Do you want to delete this mail job?" -msgstr "Weet je zeker dat deze automatische mail opdracht verwijderd moet worden?" - -#: classes/Gems/Default/MailJobAction.php:143 -msgid "Edit automatic mail job" -msgstr "Automatische mail opdracht bewerken" - -#: classes/Gems/Default/MailJobAction.php:156 -msgid "First mail" -msgstr "Eerste mail" - -#: classes/Gems/Default/MailJobAction.php:157 -msgid "Reminder" -msgstr "Herinnering" - -#: classes/Gems/Default/MailJobAction.php:168 -msgid "Use organizational from address" -msgstr "Gebruik vanaf adres van organisatie" - -#: classes/Gems/Default/MailJobAction.php:171 -#, php-format -msgid "Use site %s address" -msgstr "Gebruik %s adres van de site" - -#: classes/Gems/Default/MailJobAction.php:174 -msgid "Use the 'By staff member' address" -msgstr "Gebruik 'Door medewerker' adres" - -#: classes/Gems/Default/MailJobAction.php:175 -msgid "Other" -msgstr "Overige" - -#: classes/Gems/Default/MailJobAction.php:185 -msgid "Automatic mail jobs" -msgstr "Automatische mail opdrachten " - -#: classes/Gems/Default/MailJobAction.php:189 -#, php-format -msgid "Automatic mails have been turned off since %s." -msgstr "Automatische mail opdrachten staan sinds %s uit." - -#: classes/Gems/Default/MailJobAction.php:193 -msgid "Turn Automatic Mail Jobs ON" -msgstr "Automatische mail opdrachten AANzetten" - -#: 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 "Met automatische mail opdrachten en een cron opdracht op de server, kunnen mails verstuurd worden zonder dat een gebruiker actie hoeft te ondernemen." - -#: classes/Gems/Default/MailJobAction.php:207 -msgid "Automatic mail job details" -msgstr "Automatische mail opdracht details" - -#: classes/Gems/Default/MailLogAction.php:107 -msgid "Date sent" -msgstr "Verzend datum" - -#: classes/Gems/Default/MailLogAction.php:108 -msgid "Receiver" -msgstr "Ontvanger" - -#: classes/Gems/Default/MailLogAction.php:109 -msgid "To address" -msgstr "Adres aan" - -#: classes/Gems/Default/MailLogAction.php:110 -msgid "Sender" -msgstr "Verzender" - -#: classes/Gems/Default/MailLogAction.php:111 -msgid "From address" -msgstr "Adres van" - -#: classes/Gems/Default/MailLogAction.php:113 -#: classes/Gems/Default/MailTemplateAction.php:61 -msgid "Subject" -msgstr "Onderwerp" - -#: classes/Gems/Default/MailLogAction.php:129 -msgid "Mail Activity Log" -msgstr "Logboek Mail Activiteit" - -#: classes/Gems/Default/MailLogAction.php:140 -msgid "Show Mail Activity Log item" -msgstr "Toon Logboek Mail item" - -#: classes/Gems/Default/MailServerAction.php:68 -msgid "From address [part]" -msgstr "Vanaf adres [gedeelte]" - -#: classes/Gems/Default/MailServerAction.php:70 -msgid "E.g.: '%', '%.org' or '%@gemstracker.org' or 'ro...@ge...'." -msgstr "Bijvoorbeeld: '%', '%.nl' of '%@gemstracker.nl' of 'ro...@ge...'." - -#: classes/Gems/Default/MailServerAction.php:71 -msgid "Server" -msgstr "Server" - -#: classes/Gems/Default/MailServerAction.php:73 -msgid "Encryption" -msgstr "Encryptie" - -#: classes/Gems/Default/MailServerAction.php:76 -msgid "None" -msgstr "Geen" - -#: classes/Gems/Default/MailServerAction.php:77 -msgid "SSL" -msgstr "SSL" - -#: classes/Gems/Default/MailServerAction.php:78 -msgid "TLS" -msgstr "TLS" - -#: classes/Gems/Default/MailServerAction.php:80 -msgid "Port" -msgstr "Poort" - -#: classes/Gems/Default/MailServerAction.php:82 -msgid "Normal values: 25 for TLS and no encryption, 465 for SSL" -msgstr "Standaard waardes: 25 voor TLS en voor geen encryptie, 465 voor SSL" - -#: classes/Gems/Default/MailServerAction.php:84 -msgid "User ID" -msgstr "Gebruikers ID" - -#: classes/Gems/Default/MailServerAction.php:90 -#: classes/Gems/Default/OptionAction.php:113 -#: classes/Gems/Default/OptionAction.php:118 -#: classes/Gems/Default/SourceAction.php:95 -#: classes/Gems/Default/StaffAction.php:151 -msgid "Repeat password" -msgstr "Herhaal wachtwoord" - -#: classes/Gems/Default/MailServerAction.php:91 -#: classes/Gems/Default/SourceAction.php:74 -#: classes/Gems/Default/StaffAction.php:126 -msgid "Enter only when changing" -msgstr "Alleen invoeren om het wachtwoord te wijzigen" - -#: classes/Gems/Default/MailServerAction.php:100 -msgid "email server" -msgid_plural "email servers" -msgstr[0] "email server" -msgstr[1] "email servers" - -#: classes/Gems/Default/MailServerAction.php:105 -msgid "Email servers" -msgstr "Email servers" - -#: classes/Gems/Default/MailTemplateAction.php:75 -#: classes/Gems/Default/StaffAction.php:239 -msgid "(all organizations)" -msgstr "(alle organisaties)" - -#: classes/Gems/Default/MailTemplateAction.php:94 -msgid "email template" -msgid_plural "email templates" -msgstr[0] "email sjabloon" -msgstr[1] "email sjablonen" - -#: classes/Gems/Default/MailTemplateAction.php:99 -msgid "Email templates" -msgstr "Email sjabloon" - -#: classes/Gems/Default/OptionAction.php:84 -msgid "You are not allowed to change your password." -msgstr "U mag uw wachtwoord niet wijzigen." - -#: classes/Gems/Default/OptionAction.php:96 -msgid "Current password" -msgstr "Huidig wachtwoord" - -#: classes/Gems/Default/OptionAction.php:107 -#: classes/Gems/Default/OptionAction.php:123 -msgid "New password" -msgstr "Nieuw wachtwoord" - -#: classes/Gems/Default/OptionAction.php:137 -msgid "New password is active." -msgstr "Nieuwe wachtwoord geactiveerd." - -#: classes/Gems/Default/OptionAction.php:143 -msgid "Caps Lock seems to be on!" -msgstr "De Caps Lock toets lijkt aan te staan!" - -#: classes/Gems/Default/OptionAction.php:181 -msgid "Login Name" -msgstr "Login Naam" - -#: classes/Gems/Default/OptionAction.php:188 -#: classes/Gems/Default/OrganizationAction.php:134 -#: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:224 -msgid "Language" -msgstr "Taal" - -#: classes/Gems/Default/OptionAction.php:198 -#, php-format -msgid "Options" -msgstr "Instellingen" - -#: classes/Gems/Default/OptionAction.php:207 -msgid "This overview provides information about the last login activity on your account." -msgstr "Dit overzicht geeft informatie over de recente inlog activiteit op uw account." - -#: classes/Gems/Default/OptionAction.php:227 -msgid "Date / time" -msgstr "Datum / tijd" - -#: classes/Gems/Default/OptionAction.php:233 -msgid "item" -msgid_plural "items" -msgstr[0] "item" -msgstr[1] "items" - -#: classes/Gems/Default/OptionAction.php:238 -msgid "Item" -msgstr "Item" - -#: classes/Gems/Default/OrganizationAction.php:91 -msgid "Invalid organization." -msgstr "Ongeldige organisatie." - -#: classes/Gems/Default/OrganizationAction.php:99 -msgid "New organization..." -msgstr "Nieuwe organisatie..." - -#: classes/Gems/Default/OrganizationAction.php:123 -msgid "Url" -msgstr "Url" - -#: classes/Gems/Default/OrganizationAction.php:124 -msgid "Task" -msgstr "Taak" - -#: classes/Gems/Default/OrganizationAction.php:125 -msgid "Contact name" -msgstr "Contact naam" - -#: classes/Gems/Default/OrganizationAction.php:126 -msgid "Contact email" -msgstr "Contact email" - -#: classes/Gems/Default/OrganizationAction.php:129 -msgid "Style" -msgstr "Stijl" - -#: classes/Gems/Default/OrganizationAction.php:138 -msgid "Can the organization be used?" -msgstr "Is de organisatie in gebruik?" - -#: classes/Gems/Default/OrganizationAction.php:139 -msgid "Can people login for this organization?" -msgstr "Kunnen personen inloggen voor deze organisatie?" - -#: classes/Gems/Default/OrganizationAction.php:140 -msgid "Accepting" -msgstr "Accepteerd" - -#: classes/Gems/Default/OrganizationAction.php:140 -msgid "Can new respondents be added to the organization?" -msgstr "Accepteert de organisatie nieuwe patiënten?" - -#: classes/Gems/Default/OrganizationAction.php:141 -msgid "Does the organization have respondents?" -msgstr "Heeft de organisatie patiënten?" - -#: classes/Gems/Default/OrganizationAction.php:142 -msgid "Respondent group" -msgstr "Patiënt groep" - -#: classes/Gems/Default/OrganizationAction.php:142 -msgid "Allows respondents to login." -msgstr "Patiënten toestaan in te loggen." - -#: classes/Gems/Default/OrganizationAction.php:146 -msgid "Greeting" -msgstr "Begroeting" - -#: classes/Gems/Default/OrganizationAction.php:146 -#: classes/Gems/Default/OrganizationAction.php:147 -msgid "For emails and token forward screen." -msgstr "Voor emails en kenmerk scherm." - -#: classes/Gems/Default/OrganizationAction.php:147 -msgid "Signature" -msgstr "Handtekening" - -#: classes/Gems/Default/OrganizationAction.php:149 -msgid "Accessible by" -msgstr "Toegankelijk voor" - -#: classes/Gems/Default/OrganizationAction.php:149 -msgid "Checked organizations see this organizations respondents." -msgstr "Geselecteerde organizaties kunnen de patiënten van deze organisatie bekijken." - -#: classes/Gems/Default/OrganizationAction.php:159 -msgid "Code name" -msgstr "Code naam" - -#: classes/Gems/Default/OrganizationAction.php:159 -msgid "Only for programmers." -msgstr "Uitsluitend voor programmeurs." - -#: classes/Gems/Default/OrganizationAction.php:173 -msgid "Delete organization" -msgstr "Verwijder organisatie" - -#: classes/Gems/Default/OrganizationAction.php:183 -msgid "Edit organization" -msgstr "Bewerk organisatie" - -#: classes/Gems/Default/OrganizationAction.php:193 -msgid "Participating organizations" -msgstr "Deelnemende organisaties" - -#: classes/Gems/Default/OrganizationAction.php:203 -msgid "Show organization" -msgstr "Toon organisatie" - -#: classes/Gems/Default/OverviewPlanAction.php:115 -#: classes/Gems/Default/ProjectSurveysAction.php:88 -#: classes/Gems/Default/SurveyAction.php:203 -msgid "survey" -msgid_plural "surveys" -msgstr[0] "vragenlijst" -msgstr[1] "vragenlijsten" - -#: classes/Gems/Default/OverviewPlanAction.php:120 -msgid "Planning overview" -msgstr "Planning overzicht" - -#: classes/Gems/Default/ProjectInformationAction.php:83 -msgid "empty file" -msgstr "leeg bestand" - -#: classes/Gems/Default/ProjectInformationAction.php:87 -msgid "file not found" -msgstr "bestand niet gevonden" - -#: classes/Gems/Default/ProjectInformationAction.php:120 -msgid "Logged errors" -msgstr "Opgeslagen foutmeldingen" - -#: classes/Gems/Default/ProjectInformationAction.php:120 -msgid "Empty logfile" -msgstr "Verwijder alle foutmeldingen" - -#: classes/Gems/Default/ProjectInformationAction.php:125 -msgid "Project information" -msgstr "Project informatie" - -#: classes/Gems/Default/ProjectInformationAction.php:129 -msgid "Project name" -msgstr "Project naam" - -#: classes/Gems/Default/ProjectInformationAction.php:130 -msgid "Project version" -msgstr "Project versie" - -#: classes/Gems/Default/ProjectInformationAction.php:131 -msgid "Gems version" -msgstr "Gems versie" - -#: classes/Gems/Default/ProjectInformationAction.php:133 -msgid "Gems project" -msgstr "Gems project" - -#: classes/Gems/Default/ProjectInformationAction.php:134 -msgid "Gems web directory" -msgstr "Gems web folder" - -#: classes/Gems/Default/ProjectInformationAction.php:135 -msgid "Gems code directory" -msgstr "Gems code folder" - -#: classes/Gems/Default/ProjectInformationAction.php:136 -msgid "Gems project path" -msgstr "Gems project folder" - -#: classes/Gems/Default/ProjectInformationAction.php:137 -msgid "MUtil version" -msgstr "MUtil versie" - -#: classes/Gems/Default/ProjectInformationAction.php:138 -msgid "Zend version" -msgstr "Zend versie" - -#: classes/Gems/Default/ProjectInformationAction.php:139 -msgid "Application environment" -msgstr "Applicatie omgeving" - -#: classes/Gems/Default/ProjectInformationAction.php:140 -msgid "Application baseuri" -msgstr "Applicatie baseuri" - -#: classes/Gems/Default/ProjectInformationAction.php:141 -msgid "Application directory" -msgstr "Applicatie folder" - -#: classes/Gems/Default/ProjectInformationAction.php:142 -msgid "PHP version" -msgstr "PHP versie" - -#: classes/Gems/Default/ProjectInformationAction.php:143 -msgid "Server Hostname" -msgstr "Webserver naam" - -#: classes/Gems/Default/ProjectInformationAction.php:144 -msgid "Server OS" -msgstr "Server besturingssysteem" - -#: classes/Gems/Default/ProjectInformationAction.php:145 -msgid "Time on server" -msgstr "De tijd op de server" - -#: classes/Gems/Default/ProjectInformationAction.php:149 -msgid "Turn Maintenance Mode OFF" -msgstr "Onderhoudsmodus UITzetten" - -#: classes/Gems/Default/ProjectInformationAction.php:151 -msgid "Turn Maintenance Mode ON" -msgstr "Onderhoudsmodus AANzetten" - -#: classes/Gems/Default/ProjectInformationAction.php:161 -msgid "Version information" -msgstr "Versie informatie" - -#: classes/Gems/Default/ProjectInformationAction.php:195 -msgid "Server PHP Info" -msgstr "Server PHP Info" - -#: classes/Gems/Default/ProjectInformationAction.php:208 -msgid "Project settings" -msgstr "Project instellingen" - -#: classes/Gems/Default/ProjectInformationAction.php:215 -msgid "Session content" -msgstr "Sessie inhoud" - -#: classes/Gems/Default/ProjectInformationAction.php:216 -msgid "Session" -msgstr "Sessie" - -#: classes/Gems/Default/ProjectSurveysAction.php:68 -#: classes/Gems/Default/SurveyAction.php:192 -msgid "By" -msgstr "Door" - -#: classes/Gems/Default/ProjectSurveysAction.php:69 -#: classes/Gems/Default/ProjectTracksAction.php:67 -#: classes/Gems/Default/SurveyAction.php:193 -msgid "From" -msgstr "Van" - -#: classes/Gems/Default/ProjectSurveysAction.php:70 -#: classes/Gems/Default/ProjectTracksAction.php:68 -#: classes/Gems/Default/SurveyAction.php:195 -msgid "Until" -msgstr "Tot" - -#: classes/Gems/Default/ProjectSurveysAction.php:93 -msgid "Active surveys" -msgstr "Beschikbare vragenlijsten" - -#: classes/Gems/Default/ProjectTracksAction.php:65 -msgid "Survey #" -msgstr "Vragenlijsten" - -#: classes/Gems/Default/ProjectTracksAction.php:85 -msgid "track" -msgid_plural "tracks" -msgstr[0] "traject" -msgstr[1] "trajecten" - -#: classes/Gems/Default/ProjectTracksAction.php:90 -msgid "Active tracks" -msgstr "Beschikbare trajecten" - -#: classes/Gems/Default/ProjectTracksAction.php:110 -#, php-format -msgid "Questions in survey %s" -msgstr "Vragen in vragenlijsten %s" - -#: classes/Gems/Default/ProjectTracksAction.php:118 -#: classes/Gems/Default/SurveyAction.php:85 -#, php-format -msgid "Survey %s does not exist." -msgstr "Vragenlijst %s bestaat niet." - -#: classes/Gems/Default/ProjectTracksAction.php:121 -msgid "Survey not specified." -msgstr "Vragenlijst niet opgegeven." - -#: classes/Gems/Default/ProjectTracksAction.php:132 -#, php-format -msgid "Track %s does not exist." -msgstr "Trajectnummer %s bestaat niet." - -#: classes/Gems/Default/ReceptionAction.php:55 -msgid "Can be assigned to" -msgstr "Kan toegewezen worden aan" - -#: classes/Gems/Default/ReceptionAction.php:56 -msgid "Additional action" -msgstr "Aanvullende actie" - -#: classes/Gems/Default/ReceptionAction.php:79 -msgid "Code" -msgstr "Code" - -#: classes/Gems/Default/ReceptionAction.php:82 -msgid "Is success code" -msgstr "Is succes code" - -#: classes/Gems/Default/ReceptionAction.php:86 -msgid "This reception code is a success code." -msgstr "Aanzetten als deze ontvangst code positief is." - -#: classes/Gems/Default/ReceptionAction.php:90 -msgid "Only active codes can be selected." -msgstr "Alleen actieve codes kunnen geselecteerd worden." - -#: classes/Gems/Default/ReceptionAction.php:91 -msgid "For respondents" -msgstr "Voor patiënten" - -#: classes/Gems/Default/ReceptionAction.php:94 -msgid "This reception code can be assigned to a respondent." -msgstr "Deze ontvangstcode kan aan een patiënt toegewezen worden." - -#: classes/Gems/Default/ReceptionAction.php:95 -msgid "For tracks" -msgstr "Voor trajecten" - -#: classes/Gems/Default/ReceptionAction.php:98 -msgid "This reception code can be assigned to a track." -msgstr "Deze ontvangstcode kan aan een traject toegewezen worden." - -#: classes/Gems/Default/ReceptionAction.php:99 -msgid "For surveys" -msgstr "Voor vragenlijsten" - -#: classes/Gems/Default/ReceptionAction.php:102 -msgid "This reception code can be assigned to a survey." -msgstr "Deze ontvangstcode kan aan een vragenlijst toegewezen worden." - -#: classes/Gems/Default/ReceptionAction.php:103 -msgid "Redo survey" -msgstr "Vragenlijsten herhalen" - -#: classes/Gems/Default/ReceptionAction.php:106 -msgid "Redo a survey on this reception code." -msgstr "Herhaal vragenlijst bij deze ontvangstcode." - -#: classes/Gems/Default/ReceptionAction.php:107 -msgid "Overwrite ansers" -msgstr "Overschrijf bestaande antwoorden" - -#: classes/Gems/Default/ReceptionAction.php:110 -msgid "Remove the consent from already answered surveys." -msgstr "Verwijder \"informed consent\" van beantwoorde vragenlijsten" - -#: classes/Gems/Default/ReceptionAction.php:128 -msgid "reception code" -msgid_plural "reception codes" -msgstr[0] "Ontvangst code" -msgstr[1] "Ontvangst code" - -#: classes/Gems/Default/RespondentAction.php:119 -#, php-format -msgid "Random Example BSN: %s" -msgstr "Willekeurig voorbeeld BSN: %s" - -#: classes/Gems/Default/RespondentAction.php:122 -msgid "Enter a 9-digit SSN number." -msgstr "Voer een BSN nummer van 9 cijfers in." - -#: classes/Gems/Default/RespondentAction.php:131 -msgid "Identification" -msgstr "Identificatie" - -#: classes/Gems/Default/RespondentAction.php:132 -msgid "SSN" -msgstr "SSN" - -#: classes/Gems/Default/RespondentAction.php:136 -msgid "Patient number" -msgstr "Patiënt nummer" - -#: classes/Gems/Default/RespondentAction.php:145 -msgid "Medical data" -msgstr "Medische gegevens" - -#: classes/Gems/Default/RespondentAction.php:152 -msgid "DBC's, etc..." -msgstr "DBC's, etc..." - -#: classes/Gems/Default/RespondentAction.php:155 -msgid "Contact information" -msgstr "Contact informatie" - -#: classes/Gems/Default/RespondentAction.php:160 -msgid "Respondent has no e-mail" -msgstr "Patiënt zonder e-mail" - -#: classes/Gems/Default/RespondentAction.php:161 -msgid "With housenumber" -msgstr "Met huisnummer" - -#: classes/Gems/Default/RespondentAction.php:168 -msgid "Country" -msgstr "Land" - -#: classes/Gems/Default/RespondentAction.php:172 -msgid "Settings" -msgstr "Instellingen" - -#: classes/Gems/Default/RespondentAction.php:174 -msgid "Has the respondent signed the informed consent letter?" -msgstr "Heeft de patiënt het \"informed consent\" formulier ondertekend?" - -#: classes/Gems/Default/RespondentAction.php:204 -msgid "Comments" -msgstr "Opmerkingen" - -#: classes/Gems/Default/RespondentAction.php:205 -msgid "Physician" -msgstr "Dokter" - -#: classes/Gems/Default/RespondentAction.php:206 -msgid "Treatment" -msgstr "Behandeling" - -#: classes/Gems/Default/RespondentAction.php:235 -msgid "Rejection code" -msgstr "Afkeuringscode" - -#: classes/Gems/Default/RespondentAction.php:242 -msgid "Delete respondent" -msgstr "Verwijder patiënt" - -#: classes/Gems/Default/RespondentAction.php:293 -msgid "Respondent deleted." -msgstr "Patiënt verwijderd" - -#: classes/Gems/Default/RespondentAction.php:296 -msgid "Choose a reception code to delete." -msgstr "Kies een ontvangst code om te verwijderen." - -#: classes/Gems/Default/RespondentAction.php:340 -msgid "respondent" -msgid_plural "respondents" -msgstr[0] "patiënt" -msgstr[1] "patiënten" - -#: classes/Gems/Default/RespondentAction.php:410 -msgid "Please settle the informed consent form for this respondent." -msgstr "A.u.b. het informed consent formulier doornemen met deze patiënt" - -#: classes/Gems/Default/RespondentPlanAction.php:67 -#: classes/Gems/Default/SurveyAction.php:171 -msgid "Show respondent" -msgstr "Toon patiënt" - -#: classes/Gems/Default/RespondentPlanAction.php:73 -msgid "Show track" -msgstr "Toon traject" - -#: classes/Gems/Default/RespondentPlanAction.php:136 -msgid " of " -msgstr " van " - -#: classes/Gems/Default/RespondentPlanAction.php:137 -msgid "Progress" -msgstr "Voortgang" - -#: classes/Gems/Default/RespondentPlanAction.php:144 -msgid "Respondent planning" -msgstr "Per patiënt plannen" - -#: classes/Gems/Default/RoleAction.php:175 -msgid "Illegal name" -msgstr "Naam niet toegestaan" - -#: classes/Gems/Default/RoleAction.php:199 -#: classes/Gems/Default/RoleAction.php:258 -msgid "Parents" -msgstr "Afgeleid van" - -#: classes/Gems/Default/RoleAction.php:214 -msgid "Editing `master` is not allowed" -msgstr "Het wijzigen van `master` is niet toegestaan" - -#: classes/Gems/Default/RoleAction.php:232 -msgid "role" -msgid_plural "roles" -msgstr[0] "Rol" -msgstr[1] "Rollen" - -#: classes/Gems/Default/RoleAction.php:237 -msgid "Administrative roles" -msgstr "Beheer rollen en rechten" - -#: classes/Gems/Default/RoleAction.php:259 -#: classes/Gems/Default/RoleAction.php:275 -msgid "Allowed" -msgstr "Toegestaan" - -#: classes/Gems/Default/RoleAction.php:260 -#: classes/Gems/Default/RoleAction.php:276 -msgid "Denied" -msgstr "Geweigerd" - -#: classes/Gems/Default/RoleAction.php:264 -msgid "Project role overview" -msgstr "Project rollen" - -#: classes/Gems/Default/RoleAction.php:274 -msgid "Priv... [truncated message content] |
From: <gem...@li...> - 2011-11-28 18:24:41
|
Revision: 301 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=301&view=rev Author: matijsdejong Date: 2011-11-28 18:24:32 +0000 (Mon, 28 Nov 2011) Log Message: ----------- #44 Reception codes can be stopped. Reception codes got their own objects in the margin. Processing changes has become more simple: just cascade to respondentTrack and token and let them decide to change anything. Modified Paths: -------------- trunk/library/classes/Gems/Default/ReceptionAction.php trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/Gems/Tracker/RespondentTrack.php trunk/library/classes/Gems/Tracker/Token.php trunk/library/classes/Gems/Tracker.php trunk/library/classes/Gems/User/Organization.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/Util/Translated.php trunk/library/classes/Gems/Util.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__reception_codes.10.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 trunk/library/snippets/DeleteInSourceTrackSnippet.php trunk/library/snippets/DeleteSingleSurveyInSourceTokenSnippet.php trunk/library/snippets/DeleteTrackTokenSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Registry/CachedArrayTargetAbstract.php trunk/library/classes/Gems/Util/ReceptionCode.php trunk/library/classes/Gems/Util/ReceptionCodeLibrary.php Modified: trunk/library/classes/Gems/Default/ReceptionAction.php =================================================================== --- trunk/library/classes/Gems/Default/ReceptionAction.php 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/classes/Gems/Default/ReceptionAction.php 2011-11-28 18:24:32 UTC (rev 301) @@ -71,9 +71,10 @@ */ public function createModel($detailed, $action) { - $yesNo = $this->util->getTranslated()->getYesNo(); + $rcLib = $this->util->getReceptionCodeLibrary(); + $yesNo = $this->util->getTranslated()->getYesNo(); - $model = new MUtil_Model_TableModel('gems__reception_codes'); + $model = new MUtil_Model_TableModel('gems__reception_codes'); $model->copyKeys(); // The user can edit the keys. $model->set('grc_id_reception_code', 'label', $this->_('Code'), 'size', '10'); @@ -85,11 +86,11 @@ 'elementClass', 'CheckBox', 'description', $this->_('This reception code is a success code.')); $model->set('grc_active', 'label', $this->_('Active'), - 'multiOptions', $yesNo , + 'multiOptions', $yesNo, 'elementClass', 'CheckBox', 'description', $this->_('Only active codes can be selected.')); $model->set('grc_for_respondents', 'label', $this->_('For respondents'), - 'multiOptions', $yesNo , + 'multiOptions', $yesNo, 'elementClass', 'CheckBox', 'description', $this->_('This reception code can be assigned to a respondent.')); $model->set('grc_for_tracks', 'label', $this->_('For tracks'), @@ -97,15 +98,13 @@ 'elementClass', 'CheckBox', 'description', $this->_('This reception code can be assigned to a track.')); $model->set('grc_for_surveys', 'label', $this->_('For surveys'), - 'multiOptions', $yesNo , - 'elementClass', 'CheckBox', + 'multiOptions', $rcLib->getSurveyApplicationValues(), 'description', $this->_('This reception code can be assigned to a survey.')); $model->set('grc_redo_survey', 'label', $this->_('Redo survey'), - 'multiOptions', $this->util->getTranslated()->getRedoCodes(), - 'elementClass', 'Select', + 'multiOptions', $rcLib->getRedoValues(), 'description', $this->_('Redo a survey on this reception code.')); $model->set('grc_overwrite_answers', 'label', $this->_('Overwrite ansers'), - 'multiOptions', $yesNo , + 'multiOptions', $yesNo, 'elementClass', 'CheckBox', 'description', $this->_('Remove the consent from already answered surveys.')); Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2011-11-28 18:24:32 UTC (rev 301) @@ -227,8 +227,7 @@ // Log $this->openedRespondent($data['gr2o_patient_nr'], $data['gr2o_id_organization'], $data['grs_id_user']); - $sql = 'SELECT grc_id_reception_code, grc_description FROM gems__reception_codes WHERE grc_active = 1 AND grc_for_respondents = 1 ORDER BY grc_description'; - $options = $this->db->fetchPairs($sql); + $options = $this->util->getReceptionCodeLibrary()->getRespondentDeletionCodes(); $bridge = new MUtil_Model_FormBridge($model, $this->createForm()); $bridge->addSelect('gr2o_reception_code', @@ -245,53 +244,39 @@ if ($request->isPost()) { $data = $_POST + $data; if ($form->isValid($data )) { - // Is really removed - if ($data['gr2o_reception_code'] != GemsEscort::RECEPTION_OK) { - // Perform actual save - $where = 'gr2o_id_user = ? AND gr2o_id_organization = ?'; - $where = $this->db->quoteInto($where, $data['gr2o_id_user'], null, 1); - $where = $this->db->quoteInto($where, $data['gr2o_id_organization'], null, 1); - $this->db->update('gems__respondent2org', array( - 'gr2o_reception_code' => $data['gr2o_reception_code'], - 'gr2o_changed' => new Zend_Db_Expr('CURRENT_TIMESTAMP'), - 'gr2o_changed_by' => $this->session->user_id), - $where); + $code = $this->util->getReceptionCode($data['gr2o_reception_code']); - // Check for redo or overwrite answer in reception code. - $sql = 'SELECT grc_overwrite_answers - FROM gems__reception_codes - WHERE grc_overwrite_answers = 1 AND grc_id_reception_code = ? LIMIT 1'; - if ($this->db->fetchOne($sql, $data['gr2o_reception_code'])) { - // Update consent for tokens - $consentCode = $this->util->getConsentRejected(); + // Is the respondent really removed + if (! $code->isSuccess()) { + $userId = $this->loader->getCurrentUser()->getUserId(); - $tracker = $this->loader->getTracker(); - $tokenSelect = $tracker->getTokenSelect(true); - $tokenSelect - ->andReceptionCodes() - ->andRespondentOrganizations() - ->andConsents() - ->forRespondent($data['gr2o_id_user'], $data['gr2o_id_organization']); + // Cascade to tracks + // the responsiblilty to handle it correctly is on the sub objects now. + $tracks = $this->loader->getTracker()->getRespondentTracks($data['gr2o_id_user'], $data['gr2o_id_organization']); + foreach ($tracks as $track) { + $track->setReceptionCode($code, null, $userId); + } - // Update reception code for tokens - $tokens = $tokenSelect->fetchAll(); + // Perform actual save, but not simple stop codes. + if ($code->isForRespondents()) { + $values['gr2o_reception_code'] = $data['gr2o_reception_code']; + $values['gr2o_changed'] = new Zend_Db_Expr('CURRENT_TIMESTAMP'); + $values['gr2o_changed_by'] = $userId; - // When a TRACK is removed, all tokens are automatically revoked - foreach ($tokens as $tokenData) { - $token = $tracker->getToken($tokenData); - if ($token->hasSuccesCode() && $token->inSource()) { + $where = 'gr2o_id_user = ? AND gr2o_id_organization = ?'; + $where = $this->db->quoteInto($where, $data['gr2o_id_user'], null, 1); + $where = $this->db->quoteInto($where, $data['gr2o_id_organization'], null, 1); - $token->getSurvey()->updateConsent($token, $consentCode); + $this->db->update('gems__respondent2org', $values, $where); - // TODO: Decide what to do: now we only update the consent codes, not - // the token and respondentTrack consent codes - // $token->setReceptionCode($data['gr2t_reception_code'], null, $this->session->user_id); - } - } + $this->addMessage($this->_('Respondent deleted.')); + $this->_reroute(array('action' => 'index'), true); + } else { + // Just a stop code + $this->addMessage($this->_('Respondent tracks stopped.')); + $this->_reroute(array('action' => 'show')); } - $this->addMessage($this->_('Respondent deleted.')); - $this->_reroute(array('action' => 'index'), true); } else { $this->addMessage($this->_('Choose a reception code to delete.')); } Added: trunk/library/classes/Gems/Registry/CachedArrayTargetAbstract.php =================================================================== --- trunk/library/classes/Gems/Registry/CachedArrayTargetAbstract.php (rev 0) +++ trunk/library/classes/Gems/Registry/CachedArrayTargetAbstract.php 2011-11-28 18:24:32 UTC (rev 301) @@ -0,0 +1,175 @@ +<?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. + * + * + * @package Gems + * @subpackage Registry + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * Add's automatic caching to an registry target object. + * + * @package Gems + * @subpackage Registry + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +abstract class Gems_Registry_CachedArrayTargetAbstract extends Gems_Registry_TargetAbstract +{ + /** + * Variable to add tags to the cache for cleanup. + * + * @var array + */ + protected $_cacheTags = array(); + + /** + * The current data. + * + * @var array + */ + protected $_data; + + /** + * The id for this data + * + * @var mixed + */ + protected $_id; + + /** + * + * @var Zend_Cache_Core + */ + protected $cache; + + /** + * Creates the object. + * + * @param mixed $id Whatever identifies this object. + */ + public function __construct($id) + { + $this->_id = $id; + } + + /** + * isset() safe array access helper function. + * + * @param string $name + * @return mixed + */ + protected function _get($name) + { + if (isset($this->_data[$name])) { + return $this->_data[$name]; + } + } + + /** + * Get the cacheId for the organization + * + * @return string + */ + private function _getCacheId() { + return GEMS_PROJECT_NAME . '__' . get_class($this) . '__' . $this->_id; + } + + /** + * Changes a value and signals the cache. + * + * @param string $name + * @param mixed $value + * @return Gems_Registry_CachedArrayTargetAbstract (continuation pattern) + */ + protected function _set($name, $value) + { + $this->_data[$name] = $value; + + // Do not reload / save here: + // 1: other changes might follow, + // 2: it might not be used, + // 3: e.g. database saves may change other data. + $this->invalidateCache(); + + return $this; + } + + /** + * 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 are missing. + */ + public function checkRegistryRequestsAnswers() + { + if ($this->cache) { + $cacheId = $this->_getCacheId(); + $this->_data = $this->cache->load($cacheId); + } else { + $cacheId = false; + } + + if (! $this->_data) { + $this->_data = $this->loadData($this->_id); + + if ($cacheId) { + $this->cache->save($this->_data, $cacheId, $this->_cacheTags); + } + } + // MUtil_Echo::track($this->_data); + + return is_array($this->_data) && parent::checkRegistryRequestsAnswers(); + } + + /** + * Empty the cache of the organization + * + * @return Gems_User_Organization (continutation pattern) + */ + public function invalidateCache() { + if ($this->cache) { + $cacheId = $this->_getCacheId(); + $this->cache->remove($cacheId); + } + return $this; + } + + /** + * Load the data when the cache is empty. + * + * @param mixed $id + * @return array The array of data values + */ + abstract protected function loadData($id); +} Modified: trunk/library/classes/Gems/Tracker/RespondentTrack.php =================================================================== --- trunk/library/classes/Gems/Tracker/RespondentTrack.php 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/classes/Gems/Tracker/RespondentTrack.php 2011-11-28 18:24:32 UTC (rev 301) @@ -100,6 +100,12 @@ /** * + * @var Gems_Util + */ + protected $util; + + /** + * * @param mixed $respTracksData Track Id or array containing reps2track record */ public function __construct($respTracksData) @@ -113,6 +119,40 @@ } /** + * Check this respondent track for the number of tokens completed / to do + * + * @param int $userId Id of the user who takes the action (for logging) + * @return int 1 if the track was changed by this code + */ + public function _checkTrackCount($userId) + { + $sqlCount = 'SELECT COUNT(*) AS count, COALESCE(SUM(CASE WHEN gto_completion_time IS NULL THEN 0 ELSE 1 END), 0) AS completed + FROM gems__tokens + JOIN gems__reception_codes ON gto_reception_code = grc_id_reception_code AND grc_success = 1 + WHERE gto_id_respondent_track = ?'; + + if ($counts = $this->db->fetchRow($sqlCount, $this->_respTrackId)) { + $values['gr2t_count'] = intval($counts['count']); + $values['gr2t_completed'] = intval($counts['completed']); + + if ($values['gr2t_count'] == $values['gr2t_completed']) { + $tokenSelect = $this->tracker->getTokenSelect(array('MAX(gto_completion_time)')); + $tokenSelect->andReceptionCodes(array()) + ->forRespondentTrack($this->_respTrackId) + ->onlySucces(); + + $values['gr2t_end_date'] = $tokenSelect->fetchOne(); + } else { + $values['gr2t_end_date'] = null; + } + + return $this->_updateTrack($values, $userId); + } + + return 0; + } + + /** * Makes sure the fieldData is in $this->_fieldData * * @param boolean $reload Optional parameter to force reload. @@ -129,7 +169,7 @@ $fieldData[$fieldMap[$key]] = $value; } } - + $this->_fieldData = $fieldData; } } @@ -137,19 +177,23 @@ /** * Makes sure the receptioncode data is part of the $this->_respTrackData * - * @param boolean $reload Optional parameter to force reload. + * @param boolean $reload Optional parameter to force reload or array with new values. */ private function _ensureReceptionCode($reload = false) { if ($reload || (! isset($this->_respTrackData['grc_success']))) { - $sql = "SELECT * FROM gems__reception_codes WHERE grc_id_reception_code = ?"; - $code = $this->_respTrackData['gr2t_reception_code']; + if (is_array($reload)) { + $this->_respTrackData = $reload + $this->_respTrackData; + } else { + $sql = "SELECT * FROM gems__reception_codes WHERE grc_id_reception_code = ?"; + $code = $this->_respTrackData['gr2t_reception_code']; - if ($row = $this->db->fetchRow($sql, $code)) { - $this->_respTrackData = $row + $this->_respTrackData; - } else { - $trackId = $this->_respTrackId; - throw new Gems_Exception("Reception code $code is missing for track $trackId."); + if ($row = $this->db->fetchRow($sql, $code)) { + $this->_respTrackData = $row + $this->_respTrackData; + } else { + $trackId = $this->_respTrackId; + throw new Gems_Exception("Reception code $code is missing for track $trackId."); + } } } } @@ -292,31 +336,12 @@ */ public function checkTrackTokens($userId, Gems_Tracker_Token $fromToken = null) { - $sqlCount = 'SELECT COUNT(*) AS count, COALESCE(SUM(CASE WHEN gto_completion_time IS NULL THEN 0 ELSE 1 END), 0) AS completed - FROM gems__tokens - JOIN gems__reception_codes ON gto_reception_code = grc_id_reception_code AND grc_success = 1 - WHERE gto_id_respondent_track = ?'; + // Update token completion count. + $this->_checkTrackCount($userId); - if ($counts = $this->db->fetchRow($sqlCount, $this->_respTrackId)) { - $values['gr2t_count'] = intval($counts['count']); - $values['gr2t_completed'] = intval($counts['completed']); - - if ($values['gr2t_count'] == $values['gr2t_completed']) { - $tokenSelect = $this->tracker->getTokenSelect(array('MAX(gto_completion_time)')); - $tokenSelect->andReceptionCodes(array()) - ->forRespondentTrack($this->_respTrackId) - ->onlySucces(); - - $values['gr2t_end_date'] = $tokenSelect->fetchOne(); - } else { - $values['gr2t_end_date'] = null; - } - - $this->_updateTrack($values, $userId); - } - $engine = $this->getTrackEngine(); + // Check for validFrom and validUntil dates that have changed. if ($fromToken) { return $engine->checkTokensFrom($this, $fromToken, $userId); } elseif ($this->_checkStart) { @@ -619,7 +644,7 @@ $this->_respTrackData = $this->db->fetchRow($sql, $this->_respTrackId); } - + $this->_ensureFieldData(true); return $this; @@ -629,30 +654,57 @@ * Set the reception code for this respondent track and make sure the * necessary cascade to the tokens and thus the source takes place. * - * @param string $code The new reception code + * @param string $code The new (non-success) reception code or a Gems_Util_ReceptionCode object * @param string $comment Comment for tokens. False values leave value unchanged * @param int $userId The current user * @return int 1 if the token has changed, 0 otherwise */ public function setReceptionCode($code, $comment, $userId) { - $values['gr2t_reception_code'] = $code; + // Make sure it is a Gems_Util_ReceptionCode object + if (! $code instanceof Gems_Util_ReceptionCode) { + $code = $this->util->getReceptionCode($code); + } + $changed = 0; - $changed = $this->_updateTrack($values, $userId); + // Apply this code both only when it is a track code. + // Patient level codes are just cascaded to the tokens. + // + // The exception is of course when the exiting values must + // be overwritten, e.g. when cooperation is retracted. + if ($code->isForTracks() || $code->isOverwriter()) { + $values['gr2t_reception_code'] = $code->getCode(); - if ($changed) { - // Reload reception code values - $this->_ensureReceptionCode(true); + $changed = $this->_updateTrack($values, $userId); - // Cascade to tokens - if (! $this->hasSuccesCode()) { - foreach ($this->getTokens() as $token) { - if ($token->hasSuccesCode()) { - $token->setReceptionCode($code, $comment, $userId); - } + if ($changed) { + // Reload reception code values + $this->_ensureReceptionCode($code->getAllData()); + } + } + + // Stopcodes have a different logic. + if ($code->isStopCode()) { + // Cascade stop to tokens + foreach ($this->getTokens() as $token) { + if ($token->hasSuccesCode() && (! $token->isCompleted())) { + $changed += $token->setReceptionCode($code, $comment, $userId); } } + $changed = max($changed, 1); + + // Update token count / completion + $this->_checkTrackCount($userId); + + } elseif (! $code->isSuccess()) { + // Cascade code to tokens + foreach ($this->getTokens() as $token) { + if ($token->hasSuccesCode()) { + $token->setReceptionCode($code, $comment, $userId); + } + } } + return $changed; } } Modified: trunk/library/classes/Gems/Tracker/Token.php =================================================================== --- trunk/library/classes/Gems/Tracker/Token.php 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/classes/Gems/Tracker/Token.php 2011-11-28 18:24:32 UTC (rev 301) @@ -147,19 +147,23 @@ /** * Makes sure the receptioncode data is part of the $this->_gemsData * - * @param boolean $reload Optional parameter to force reload. + * @param boolean $reload Optional parameter to force reload or an array with the new values. */ private function _ensureReceptionCode($reload = false) { if ($reload || (! isset($this->_gemsData['grc_success']))) { - $sql = "SELECT * FROM gems__reception_codes WHERE grc_id_reception_code = ?"; - $code = $this->_gemsData['gto_reception_code']; + if (is_array($reload)) { + $this->_gemsData = $reload + $this->_gemsData; + } else { + $sql = "SELECT * FROM gems__reception_codes WHERE grc_id_reception_code = ?"; + $code = $this->_gemsData['gto_reception_code']; - if ($row = $this->db->fetchRow($sql, $code)) { - $this->_gemsData = $row + $this->_gemsData; - } else { - $token = $this->_tokenId; - throw new Gems_Exception("Reception code $code is missing for token $token."); + if ($row = $this->db->fetchRow($sql, $code)) { + $this->_gemsData = $row + $this->_gemsData; + } else { + $token = $this->_tokenId; + throw new Gems_Exception("Reception code $code is missing for token $token."); + } } } } @@ -973,6 +977,7 @@ /** * + * @deprecated Use the ReceptionCode->hadRedoCode * @return boolean */ public function hasRedoCode() @@ -987,6 +992,7 @@ /** * True if the reception code is a redo survey copy. * + * @deprecated Use the ReceptionCode->hasRedoCopyCode * @return boolean */ public function hasRedoCopyCode() @@ -995,7 +1001,7 @@ $this->_ensureReceptionCode(); } - return Gems_Util_Translated::REDO_COPY == $this->_gemsData['grc_redo_survey']; + return Gems_Util_ReceptionCodeLibrary::REDO_COPY == $this->_gemsData['grc_redo_survey']; } /** @@ -1101,25 +1107,31 @@ * Set the reception code for this token and make sure the necessary * cascade to the source takes place. * - * @param string $code The new reception code + * @param string $code The new (non-success) reception code or a Gems_Util_ReceptionCode object * @param string $comment Comment False values leave value unchanged * @param int $userId The current user * @return int 1 if the token has changed, 0 otherwise */ public function setReceptionCode($code, $comment, $userId) { - $values['gto_reception_code'] = $code; + // Make sure it is a Gems_Util_ReceptionCode object + if (! $code instanceof Gems_Util_ReceptionCode) { + $code = $this->util->getReceptionCode($code); + } + + $values['gto_reception_code'] = $code->getCode(); if ($comment) { $values['gto_comment'] = $comment; } + MUtil_Echo::track($values); $changed = $this->_updateToken($values, $userId); if ($changed) { // Reload reception code values - $this->_ensureReceptionCode(true); + $this->_ensureReceptionCode($code->getAllData()); - if (! $this->hasSuccesCode()) { + if ($code->isOverwriter() || (! $code->isSuccess())) { $survey = $this->getSurvey(); // Update the consent code in the source Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/classes/Gems/Tracker.php 2011-11-28 18:24:32 UTC (rev 301) @@ -331,6 +331,27 @@ /** * + * @param int $userId + * @param int $organizationId + * @return array of Gems_Tracker_RespondentTrack + */ + public function getRespondentTracks($userId, $organizationId) + { + $sql = "SELECT * + FROM gems__respondent2track INNER JOIN gems__reception_codes ON gr2t_reception_code = grc_id_reception_code + WHERE gr2t_id_user = ? AND gr2t_id_organization = ?"; + $rows = $this->db->fetchAll($sql, array($userId, $organizationId)); + $tracks = array(); + + foreach ($rows as $row) { + $tracks[$row['gr2t_id_respondent_track']] = $this->getRespondentTrack($row); + } + + return $tracks; + } + + /** + * * @param mixed $respTrackData Track id or array containing trackdata * @return Gems_Tracker_RespondentTrack */ Modified: trunk/library/classes/Gems/User/Organization.php =================================================================== --- trunk/library/classes/Gems/User/Organization.php 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/classes/Gems/User/Organization.php 2011-11-28 18:24:32 UTC (rev 301) @@ -46,9 +46,16 @@ * @license New BSD License * @since Class available since version 1.5 */ -class Gems_User_Organization extends Gems_Registry_TargetAbstract +class Gems_User_Organization extends Gems_Registry_CachedArrayTargetAbstract { /** + * Variable to add tags to the cache for cleanup. + * + * @var array + */ + protected $_cacheTags = array('organization'); + + /** * The default organization data for 'no organization'. * * @var array @@ -56,16 +63,6 @@ protected $_noOrganization = array( 'gor_id_organization' => 1, 'gor_name' => 'NO ORGANIZATION', - 'gor_code' => null, - 'gor_location' => null, - 'gor_url' => null, - 'gor_task' => null, - 'gor_accessible_by' => null, - 'gor_contact_name' => null, - 'gor_contact_email' => null, - 'gor_welcome' => null, - 'gor_signature' => null, - 'gor_style' => null, 'gor_iso_lang' => 'en', 'gor_has_respondents' => 0, 'gor_add_respondents' => 0, @@ -75,39 +72,11 @@ /** * - * @var array - */ - protected $_organizationData; - - /** - * - * @var int - */ - protected $_organizationId; - - /** - * - * @var Zend_Cache_Core - */ - protected $cache; - - /** - * * @var Zend_Db_Adapter_Abstract */ protected $db; /** - * Creates the organization object. - * - * @param int $organizationId - */ - public function __construct($organizationId) - { - $this->_organizationId = $organizationId; - } - - /** * Returns a callable if a method is called as a variable * or the value from the organizationData if it exists * @@ -116,26 +85,14 @@ */ public function __get($name) { - if (method_exists($this, $name)) { - // Return a callable - return array($this, $name); - } elseif (isset($this->_organizationData[$name])) { - return $this->_organizationData[$name]; + if (isset($this->_data[$name])) { + return $this->_data[$name]; } - throw new Gems_Exception_Coding("Unknown method '$name' requested as callable."); + return parent::__get($name); } /** - * Get the cacheId for the organization - * - * @return string - */ - private function _getCacheId() { - return GEMS_PROJECT_NAME . '__' . __CLASS__ . '__' . $this->_organizationId; - } - - /** * Set menu parameters from the organization * * @param Gems_Menu_ParameterSource $source @@ -153,7 +110,7 @@ */ public function canCreateRespondents() { - return (boolean) $this->_organizationData['gor_add_respondents']; + return (boolean) $this->_get('gor_add_respondents'); } /** @@ -163,62 +120,17 @@ */ public function canHaveRespondents() { - return (boolean) $this->_organizationData['gor_has_respondents'] || $this->_organizationData['gor_add_respondents']; + return (boolean) $this->_get('gor_has_respondents') || $this->_get('gor_add_respondents'); } /** - * 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 are missing. - */ - public function checkRegistryRequestsAnswers() - { - if ($this->cache) { - $cacheId = $this->_getCacheId(); - $this->_organizationData = $this->cache->load($cacheId); - } else { - $cacheId = false; - } - - if (! $this->_organizationData) { - $sql = "SELECT * FROM gems__organizations WHERE gor_id_organization = ? LIMIT 1"; - $this->_organizationData = $this->db->fetchRow($sql, $this->_organizationId); - - if (! $this->_organizationData) { - $this->_organizationData = $this->_noOrganization; - } else { - $dbOrgId = $this->db->quote($this->_organizationId, Zend_Db::INT_TYPE); - $sql = "SELECT gor_id_organization, gor_name - FROM gems__organizations - WHERE gor_active = 1 AND - ( - gor_id_organization = $dbOrgId OR - gor_accessible_by LIKE '%:$dbOrgId:%' - ) - ORDER BY gor_name"; - $this->_organizationData['can_access'] = $this->db->fetchPairs($sql); - - // MUtil_Echo::track($sql, $this->_organizationData['can_access']); - } - - if ($cacheId) { - $this->cache->save($this->_organizationData, $cacheId); - } - } - // MUtil_Echo::track($this->_organizationData); - - return is_array($this->_organizationData) && parent::checkRegistryRequestsAnswers(); - } - - /** * Get the organizations this organizations can access. * * @return array Of type orgId => orgName */ public function getAllowedOrganizations() { - return $this->_organizationData['can_access']; + return $this->_get('can_access'); } /** @@ -228,7 +140,7 @@ */ public function getCode() { - return $this->_organizationData['gor_code']; + return $this->_get('gor_code'); } /** @@ -238,7 +150,7 @@ */ public function getId() { - return $this->_organizationData['gor_id_organization']; + return $this->_get('gor_id_organization'); } /** @@ -248,7 +160,7 @@ */ public function getName() { - return $this->_organizationData['gor_name']; + return $this->_get('gor_name'); } /** @@ -258,7 +170,7 @@ */ public function getSignature() { - return $this->_organizationData['gor_signature']; + return $this->_get('gor_signature'); } /** @@ -268,30 +180,49 @@ */ public function getStyle() { - return $this->_organizationData['gor_style']; + return $this->_get('gor_style'); } /** - * Get the welcome message for the organization. + * Load the data when the cache is empty. * - * @return string + * @param mixed $id + * @return array The array of data values */ - public function getWelcome() + protected function loadData($id) { - return $this->_organizationData['gor_welcome']; + $sql = "SELECT * FROM gems__organizations WHERE gor_id_organization = ? LIMIT 1"; + $data = $this->db->fetchRow($sql, $id); + + if ($data) { + $dbOrgId = $this->db->quote($id, Zend_Db::INT_TYPE); + $sql = "SELECT gor_id_organization, gor_name + FROM gems__organizations + WHERE gor_active = 1 AND + ( + gor_id_organization = $dbOrgId OR + gor_accessible_by LIKE '%:$dbOrgId:%' + ) + ORDER BY gor_name"; + $data['can_access'] = $this->db->fetchPairs($sql); + natsort($data['can_access']); + + // MUtil_Echo::track($sql, $data['can_access']); + } else { + $data = $this->_noOrganization; + } + + return $data; } /** - * Empty the cache of the organization + * Get the welcome message for the organization. * - * @return Gems_User_Organization (continutation pattern) + * @return string */ - public function invalidateCache() { - if ($this->cache) { - $cacheId = $this->_getCacheId(); - $this->cache->remove($cacheId); - } - return $this; + public function getWelcome() + { + return $this->_get('gor_welcome'); } /** @@ -304,17 +235,17 @@ */ public function setHasRespondents($userId) { - if (0 == $this->_organizationData['gor_has_respondents']) { - $this->_organizationData['gor_has_respondents'] = 1; - + if (! $this->_get('gor_has_respondents')) { $values['gor_has_respondents'] = 1; $values['gor_changed'] = new Zend_Db_Expr('CURRENT_TIMESTAMP'); $values['gor_changed_by'] = $userId; - $where = $this->db->quoteInto('gor_id_organization = ?', $this->_organizationId); + $where = $this->db->quoteInto('gor_id_organization = ?', $this->_id); $this->db->update('gems__organizations', $values, $where); - $this->invalidateCache(); + + // Invalidate cache / change value + $this->_set('gor_has_respondents', 1); } return $this; Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/classes/Gems/User/User.php 2011-11-28 18:24:32 UTC (rev 301) @@ -648,10 +648,10 @@ // Privilege overrules organizational settings if ($this->hasPrivilege('pr.organization-switch')) { $orgs = $this->db->fetchPairs("SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active = 1 ORDER BY gor_name"); + natsort($orgs); } else { $orgs = $this->getBaseOrganization()->getAllowedOrganizations(); } - natsort($orgs); // MUtil_Echo::track($orgs); $this->_setVar('__allowedOrgs', $orgs); Added: trunk/library/classes/Gems/Util/ReceptionCode.php =================================================================== --- trunk/library/classes/Gems/Util/ReceptionCode.php (rev 0) +++ trunk/library/classes/Gems/Util/ReceptionCode.php 2011-11-28 18:24:32 UTC (rev 301) @@ -0,0 +1,175 @@ +<?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. + * + * + * @package Gems + * @subpackage Ytil + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * Utility function for the user of reception codes. + * + * @package Gems + * @subpackage Util + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Util_ReceptionCode extends Gems_Registry_CachedArrayTargetAbstract +{ + /** + * Variable to add tags to the cache for cleanup. + * + * @var array + */ + protected $_cacheTags = array('reception_code'); + + /** + * + * @var Zend_Db_Adapter_Abstract + */ + protected $db; + + /** + * Returns the complete record. + * + * @return array + */ + public function getAllData() + { + return $this->_data; + } + + /** + * The reception code. + * + * @return string + */ + public function getCode() + { + return $this->_id; + } + + /** + * + * @return boolean + */ + public function hasRedoCode() + { + return (boolean) $this->_get('grc_redo_survey'); + } + + /** + * True if the reception code is a redo survey copy. + * + * @return boolean + */ + public function hasRedoCopyCode() + { + return Gems_Util_ReceptionCodeLibrary::REDO_COPY == $this->_get('grc_redo_survey'); + } + + /** + * Is this code for respondent use? + * + * @return boolean + */ + public function isForRespondents() + { + return (boolean) $this->_get('grc_for_respondents'); + } + + /** + * Is this code for track use? + * + * @return boolean + */ + public function isForTracks() + { + return (boolean) $this->_get('grc_for_tracks'); + } + + /** + * Is this code for survey use? + * + * @return boolean + */ + public function isForSurveys() + { + return $this->_get('grc_for_surveys') > Gems_Util_ReceptionCodeLibrary::APPLY_NOT; + } + + /** + * Does this code overwrite set values? + * + * @return boolean + */ + public function isOverwriter() + { + return (boolean) $this->_get('grc_overwrite_answers'); + } + + /** + * Is this code a survey stop code. + * + * Then do not apply it to the track or respondent, but do apply it to the tokens. + * + * @return boolean + */ + public function isStopCode() + { + // MUtil_Echo::track($this->_data); + return $this->_get('grc_for_surveys') === Gems_Util_ReceptionCodeLibrary::APPLY_STOP; + } + + /** + * Is this code a success code. + * + * @return boolean + */ + public function isSuccess() + { + return (boolean) $this->_get('grc_success'); + } + + /** + * Load the data when the cache is empty. + * + * @param mixed $id + * @return array The array of data values + */ + protected function loadData($id) + { + $sql = "SELECT * FROM gems__reception_codes WHERE grc_id_reception_code = ? LIMIT 1"; + return $this->db->fetchRow($sql, $id); + } +} Added: trunk/library/classes/Gems/Util/ReceptionCodeLibrary.php =================================================================== --- trunk/library/classes/Gems/Util/ReceptionCodeLibrary.php (rev 0) +++ trunk/library/classes/Gems/Util/ReceptionCodeLibrary.php 2011-11-28 18:24:32 UTC (rev 301) @@ -0,0 +1,170 @@ +<?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. + * + * + * @package Gems + * @subpackage Util + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * Library functions and constants for working with reception codes. + * + * @package Gems + * @subpackage Util + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Util_ReceptionCodeLibrary extends Gems_Registry_TargetAbstract +{ + const APPLY_NOT = 0; + const APPLY_DO = 1; + const APPLY_STOP = 2; + + const REDO_NONE = 0; + const REDO_ONLY = 1; + const REDO_COPY = 2; + + /** + * + * @var Zend_Db_Adapter_Abstract + */ + protected $db; + + /** + * + * @var Zend_Translate + */ + protected $translate; + + /** + * + * @return Zend_Db_Select for a fetchPairs + */ + protected function _getDeletionCodeSelect() + { + $select = $this->db->select(); + $select->from('gems__reception_codes', array('grc_id_reception_code', 'grc_description')) + ->where('grc_active = 1') + ->order('grc_description'); + + return $select; + } + + /** + * Return the field values for the redo code. + * + * <ul><li>0: do not redo</li> + * <li>1: redo but do not copy answers</li> + * <li>2: redo and copy answers</li></ul> + * + * @staticvar array $data + * @return array + */ + public function getRedoValues() + { + static $data; + + if (! $data) { + $data = array( + self::REDO_NONE => $this->translate->_('No'), + self::REDO_ONLY => $this->translate->_('Yes (forget answers)'), + self::REDO_COPY => $this->translate->_('Yes (keep answers)')); + } + + return $data; + } + + /** + * Return the field values for surveys. + * + * <ul><li>0: do not use</li> + * <li>1: use (and cascade)</li> + * <li>2: use for open rounds only</li></ul> + * + * @staticvar array $data + * @return array + */ + public function getSurveyApplicationValues() + { + static $data; + + if (! $data) { + $data = array( + self::APPLY_NOT => $this->translate->_('No'), + self::APPLY_DO => $this->translate->_('Yes (individual surveys only)'), + self::APPLY_STOP => $this->translate->_('Stop (per respondent or track only)')); + } + + return $data; + } + + /** + * Returns the respondent deletion reception code list. + * + * @return array a value => label array. + */ + public function getRespondentDeletionCodes() + { + $select = $this->_getDeletionCodeSelect(); + $select->where('(grc_for_respondents = 1 OR grc_for_surveys = ?)', self::APPLY_STOP); + + return $this->db->fetchPairs($select); + } + + /** + * Returns the single survey deletion reception code list. + * + * @return array a value => label array. + */ + public function getSingleSurveyDeletionCodes() + { + $select = $this->_getDeletionCodeSelect(); + $select->where('(grc_for_surveys = ? OR grc_for_tracks = 1)', self::APPLY_DO) + ->where('grc_redo_survey = ?', self::REDO_NONE); + + return $this->db->fetchPairs($select); + } + + /** + * Returns the track deletion reception code list. + * + * @return array a value => label array. + */ + public function getTrackDeletionCodes() + { + $select = $this->_getDeletionCodeSelect(); + $select->where('(grc_for_tracks = 1 OR grc_for_surveys = ?)', self::APPLY_STOP); + + return $this->db->fetchPairs($select); + } +} Modified: trunk/library/classes/Gems/Util/Translated.php =================================================================== --- trunk/library/classes/Gems/Util/Translated.php 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/classes/Gems/Util/Translated.php 2011-11-28 18:24:32 UTC (rev 301) @@ -1,4 +1,5 @@ <?php + /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -42,10 +43,6 @@ */ class Gems_Util_Translated extends Gems_Registry_TargetAbstract { - const REDO_NONE = 0; - const REDO_ONLY = 1; - const REDO_COPY = 2; - protected $phpDateFormatString = 'd-m-Y'; /** @@ -211,27 +208,6 @@ return array('M' => $this->_('Mr.'), 'F' => $this->_('Mrs.'), 'U' => $this->_('Mr./Mrs.')); } - /** - * Return the field values for the redo code. - * - * <ul><li>0: do not redo</li> - * <li>1: redo but do not copy answers</li> - * <li>2: redo and copy answers</li></ul> - * - * @staticvar array $data - * @return array - */ - public function getRedoCodes() - { - static $data; - - if (! $data) { - $data = array(self::REDO_NONE => $this->_('No'), self::REDO_ONLY => $this->_('Yes (forget answers)'), self::REDO_COPY => $this->_('Yes (keep answers)')); - } - - return $data; - } - public function getYesNo() { static $data; Modified: trunk/library/classes/Gems/Util.php =================================================================== --- trunk/library/classes/Gems/Util.php 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/classes/Gems/Util.php 2011-11-28 18:24:32 UTC (rev 301) @@ -79,6 +79,12 @@ /** * + * @var Gems_Util_ReceptionCodeLibrary + */ + protected $receptionCodeLibrary; + + /** + * * @var Gems_Util_RequestCache */ protected $requestCache; @@ -188,7 +194,34 @@ } /** + * Returns a single reception code object. * + * @param string $code + * @return Gems_Util_ReceptionCode + */ + public function getReceptionCode($code) + { + static $codes = array(); + + if (! isset($codes[$code])) { + $codes[$code] = $this->_loadClass('receptionCode', true, array($code)); + } + + return $codes[$code]; + } + + /** + * Returns a + * + * @return Gems_Util_ReceptionCodeLibrary + */ + public function getReceptionCodeLibrary() + { + return $this->_getClass('receptionCodeLibrary'); + } + + /** + * * @param string $sourceAction The action to get the cache from if not the current one. * @param boolean $readonly Optional, tell the cache not to store any new values * @return Gems_Util_RequestCache @@ -215,15 +248,15 @@ { return $this->_getClass('translated'); } - + /** * Checks if a given IP is allowed according to a set * of IP addresses / ranges. - * + * * Multiple addresses/ranges are separated by a colon, * an individual range takes the form of * 10.0.0.0-10.0.0.255 (subnet masks are not supported) - * + * * @param string $ip * @param string $ipRanges * @return bool @@ -233,23 +266,23 @@ if (!strlen($ipRanges)) { return true; } - + $ipLong = ip2long($ip); - + $ranges = explode('|', $ipRanges); - + foreach ($ranges as $range) { if (($sep = strpos($range, '-')) !== false) { $min = ip2long(substr($range, 0, $sep)); $max = ip2long(substr($range, $sep + 1)); - + $validate = new Zend_Validate_Between( array( 'min' => $min, 'max' => $max ) ); - + if ($min <= $ipLong && $ipLong <= $max) { return true; } @@ -259,7 +292,7 @@ } } } - + return false; } } Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/configs/db/patches.sql 2011-11-28 18:24:32 UTC (rev 301) @@ -344,3 +344,10 @@ -- PATCH: Base URL / installation URL to facilitate org switching ALTER TABLE gems__organizations ADD `gor_url_base` VARCHAR(1270) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER `gor_url`; + +-- PATCH: New fundamental reception code 'STOP' +INSERT INTO gems__reception_codes (grc_id_reception_code, grc_description, grc_success, + grc_for_surveys, grc_redo_survey, grc_for_tracks, grc_for_respondents, grc_overwrite_answers, grc_active, + grc_changed, grc_changed_by, grc_created, grc_created_by) + VALUES + ('stop', 'Stop surveys', 0, 2, 0, 0, 0, 0, 1, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); Modified: trunk/library/configs/db/tables/gems__reception_codes.10.sql =================================================================== --- trunk/library/configs/db/tables/gems__reception_codes.10.sql 2011-11-28 15:20:01 UTC (rev 300) +++ trunk/library/configs/db/tables/gems__reception_codes.10.sql 2011-11-28 18:24:32 UTC (rev 301) @@ -5,7 +5,7 @@ grc_success boolean not null default 0, - grc_for_surveys boolean not null default 0, + grc_for_surveys tinyint not null default 0, grc_redo_survey tinyint not null default 0, grc_for_tracks boolean not null default 0, grc_for_respondents boolean not null default 0, @@ -25,9 +25,9 @@ CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; INSERT INTO gems__reception_codes (grc_id_reception_code, grc_description, grc_success, - grc_for_surveys, grc_redo_survey, grc_for_tracks, grc_for_respondents, grc_active, + grc_for_surveys, grc_redo_survey, grc_for_tracks, grc_for_respondents, grc_overwrite_answers, grc_active, grc_changed, grc_changed_by, grc_created, grc_created_by) VALUES - ('OK', '', 1, 1, 0, 1, 1, 1, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('skip', 'Skipped by calculation', 0, 1, 0, 0, 0, 0, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); - + ('OK', '', 1, 1, 0, 1, 1, 0, 1, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), + ('skip', 'Skipped by calculation', 0, 1, 0, 0, 0, 1, 0, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), + ('stop', 'Stop surveys', 0, 2, 0, 0, 0, 0, 1, CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); 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-28 15:20:01 UTC (rev 300) +++ trunk/library/languages/default-en.po 2011-11-28 18:24:32 UTC (rev 301) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-28 12:25+0100\n" +"POT-Creation-Date: 2011-11-28 19:14+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -409,7 +409,7 @@ msgid " The error message is: %s" msgstr " The error message is: %s" -#: classes/Gems/Tracker.php:732 +#: classes/Gems/Tracker.php:753 msgid "Checks performed" msgstr "Checks performed" @@ -1023,7 +1023,7 @@ msgstr "%s records found." #: classes/Gems/Default/ExportAction.php:172 -#: classes/Gems/Default/IndexAction.php:179 +#: classes/Gems/Default/IndexAction.php:192 #: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organization" @@ -1056,88 +1056,88 @@ msgid "Administrative groups" msgstr "Administrative groups" -#: classes/Gems/Default/IndexAction.php:91 +#: classes/Gems/Default/IndexAction.php:97 msgid "Enter your token..." msgstr "Enter your token..." -#: classes/Gems/Default/IndexAction.php:132 +#: classes/Gems/Default/IndexAction.php:140 #, php-format msgid "Login to %s application" msgstr "Login to %s application" -#: classes/Gems/Default/IndexAction.php:136 +#: classes/Gems/Default/IndexAction.php:144 msgid "Login" msgstr "Login" -#: classes/Gems/Default/IndexAction.php:153 +#: classes/Gems/Default/IndexAction.php:166 msgid "Back to login" msgstr "Back to login" -#: classes/Gems/Default/IndexAction.php:201 +#: classes/Gems/Default/IndexAction.php:214 msgid "Password" msgstr "Password" -#: classes/Gems/Default/IndexAction.php:216 +#: classes/Gems/Default/IndexAction.php:229 #, php-format msgid "Reset password for %s application" msgstr "Reset password for %s application" -#: classes/Gems/Default/IndexAction.php:220 +#: classes/Gems/Default/IndexAction.php:233 msgid "Reset password" msgstr "Reset password" -#: classes/Gems/Default/IndexAction.php:266 +#: classes/Gems/Default/IndexAction.php:279 msgid "Username" msgstr "Username" -#: classes/Gems/Default/IndexAction.php:306 +#: classes/Gems/Default/IndexAction.php:333 msgid "Your password must be changed." msgstr "Your password must be changed." -#: classes/Gems/Default/IndexAction.php:318 +#: classes/Gems/Default/IndexAction.php:345 #, php-format msgid "Login successful, welcome %s." msgstr "Login successful, welcome %s." -#: classes/Gems/Default/IndexAction.php:358 +#: classes/Gems/Default/IndexAction.php:385 #, php-format msgid "Good bye: %s." msgstr "Good bye: %s." -#: classes/Gems/Default/IndexAction.php:383 +#: classes/Gems/Default/IndexAction.php:410 msgid "Reset accepted, enter your new password." msgstr "Reset accepted, enter your new password." -#: classes/Gems/Default/IndexAction.php:387 +#: classes/Gems/Default/IndexAction.php:414 msgid "This key timed out or does not belong to this user." msgstr "This key timed out or does not belong to this user." -#: classes/Gems/Default/IndexAction.php:404 +#: classes/Gems/Default/IndexAction.php:431 msgid "Password reset requested" msgstr "Password reset requested" -#: classes/Gems/Defau... [truncated message content] |
From: <gem...@li...> - 2011-12-07 11:27:57
|
Revision: 345 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=345&view=rev Author: michieltcs Date: 2011-12-07 11:27:48 +0000 (Wed, 07 Dec 2011) Log Message: ----------- Merge Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Token.php Property Changed: ---------------- trunk/library/ Property changes on: trunk/library ___________________________________________________________________ Modified: svn:mergeinfo - /branches/1.5.0-pulse/library:306-342 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 + /branches/1.5.0-pulse/library:306-344 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 Modified: trunk/library/classes/Gems/Tracker/Token.php =================================================================== --- trunk/library/classes/Gems/Tracker/Token.php 2011-12-07 10:51:24 UTC (rev 344) +++ trunk/library/classes/Gems/Tracker/Token.php 2011-12-07 11:27:48 UTC (rev 345) @@ -60,7 +60,7 @@ * * @var array The gems token data */ - private $_gemsData; + private $_gemsData = array(); /** * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-15 15:54:29
|
Revision: 360 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=360&view=rev Author: matijsdejong Date: 2011-12-15 15:54:19 +0000 (Thu, 15 Dec 2011) Log Message: ----------- Added initRawOutput() and disableLayout() to MUtil_Controller_Action Renamed MUtil/Html/Link to MUtil/Html/Code Modified Paths: -------------- trunk/library/classes/Gems/Controller/BrowseEditAction.php trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php trunk/library/classes/Gems/Default/TrackActionAbstract.php trunk/library/classes/Gems/Pdf.php trunk/library/classes/MUtil/Controller/Action.php trunk/library/classes/MUtil/Controller/html-view.phtml trunk/library/classes/MUtil/Html/ProgressPanel.php trunk/library/layouts/scripts/gems.phtml Added Paths: ----------- trunk/library/classes/MUtil/Html/Code/ trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php trunk/library/classes/MUtil/Html/Code/JavaScript.php Removed Paths: ------------- trunk/library/classes/MUtil/Html/Link/ Modified: trunk/library/classes/Gems/Controller/BrowseEditAction.php =================================================================== --- trunk/library/classes/Gems/Controller/BrowseEditAction.php 2011-12-15 15:40:20 UTC (rev 359) +++ trunk/library/classes/Gems/Controller/BrowseEditAction.php 2011-12-15 15:54:19 UTC (rev 360) @@ -275,7 +275,7 @@ // MUtil_Model::$verbose = true; // We do not need to return the layout, just the above table - Zend_Layout::resetMvcInstance(); + $this->disableLayout(); $this->html[] = $this->_createTable(); $this->html->raw(MUtil_Echo::out()); Modified: trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2011-12-15 15:40:20 UTC (rev 359) +++ trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2011-12-15 15:54:19 UTC (rev 360) @@ -415,6 +415,10 @@ public function pdfAction() { + // Make sure nothing else is output + $this->initRawOutput(); + + // Output the PDF $this->loader->getPdf()->echoPdfBySurveyId($this->_getParam(MUtil_Model::REQUEST_ID)); } Modified: trunk/library/classes/Gems/Default/TrackActionAbstract.php =================================================================== --- trunk/library/classes/Gems/Default/TrackActionAbstract.php 2011-12-15 15:40:20 UTC (rev 359) +++ trunk/library/classes/Gems/Default/TrackActionAbstract.php 2011-12-15 15:54:19 UTC (rev 360) @@ -400,6 +400,10 @@ */ public function pdfAction() { + // Make sure nothing else is output + $this->initRawOutput(); + + // Output the PDF $this->loader->getPdf()->echoPdfByTokenId($this->_getIdParam()); } Modified: trunk/library/classes/Gems/Pdf.php =================================================================== --- trunk/library/classes/Gems/Pdf.php 2011-12-15 15:40:20 UTC (rev 359) +++ trunk/library/classes/Gems/Pdf.php 2011-12-15 15:54:19 UTC (rev 360) @@ -118,12 +118,10 @@ * @param Zend_Pdf $pdf * @param string $filename * @param boolean $download + * @param boolean $exit Should the application stop running after output */ - protected function echoPdf(Zend_Pdf $pdf, $filename, $download = false) + protected function echoPdf(Zend_Pdf $pdf, $filename, $download = false, $exit = true) { - // We do not need to return the layout, just the above table - Zend_Layout::resetMvcInstance(); - $content = $pdf->render(); // MUtil_Echo::track($filename); @@ -140,6 +138,11 @@ header('Pragma: public'); echo $content; + + if ($exit) { + // No further output + exit; + } } /** Modified: trunk/library/classes/MUtil/Controller/Action.php =================================================================== --- trunk/library/classes/MUtil/Controller/Action.php 2011-12-15 15:40:20 UTC (rev 359) +++ trunk/library/classes/MUtil/Controller/Action.php 2011-12-15 15:54:19 UTC (rev 360) @@ -1,6 +1,5 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -26,15 +25,14 @@ * 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 * @subpackage Controller - * @copyright Copyright (c) 2010 Erasmus MC (www.erasmusmc.nl) & MagnaFacta (www.magnafacta.nl) + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** @@ -44,15 +42,18 @@ * - title attribute for use in htm/head/title element * - flashMessenger use standardised and simplified * - use of Zend_Translate simplified and shortened in code + * - disable Zend_Layout and Zend_View with initRawOutput() and $useRawOutput. * * MUtil_Html functionality provided: * - semi automatic MUtil_Html_Sequence initiation * - view script set to html-view.phtml when using html * - snippet usage for repeatably used snippets of html on a page * - * @author Matijs de Jong * @package MUtil * @subpackage Controller + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 */ abstract class MUtil_Controller_Action extends Zend_Controller_Action { @@ -94,13 +95,28 @@ /** * Set to true in child class for automatic creation of $this->html. * - * Otherwise call $this->initHtml() + * To initiate the use of $this->html from the code call $this->initHtml() * + * Overrules $useRawOutput. + * + * @see $useRawOutput * @var boolean $useHtmlView */ public $useHtmlView = false; /** + * Set to true in child class for automatic use of raw (e.g. echo) output only. + * + * Otherwise call $this->initRawOutput() to switch to raw echo output. + * + * Overruled in initialization if $useHtmlView is true. + * + * @see $useHtmlView + * @var boolean $useRawOutput + */ + public $useRawOutput = false; + + /** * A ssession based message store. * * Standard the flash messenger for storing messages @@ -232,6 +248,24 @@ } /** + * Disable the use of Zend_Layout + * + * @return Zend_Controller_Action (continuation pattern) + */ + public function disableLayout() + { + // Actually I would like a check if there is a + // layout instance in the first place. + $layout = Zend_Layout::getMvcInstance(); + if ($layout instanceof Zend_Layout) { + $layout->disableLayout(); + } + // Zend_Layout::resetMvcInstance(); + + return $this; + } + + /** * Returns a session based message store for adding messages to. * * @return Zend_Controller_Action_Helper_FlashMessenger @@ -318,6 +352,7 @@ if (null === $translate) { // Make sure there always is a translator $translate = new MUtil_Translate_Adapter_Potemkin(); + Zend_Registry::set('Zend_Translate', $translate); } $this->setTranslate($translate); @@ -348,6 +383,8 @@ if ($this->useHtmlView) { $this->initHtml(); + } elseif ($this->useRawOutput) { + $this->initRawOutput(); } } @@ -369,10 +406,30 @@ $this->view->setScriptPath(dirname(__FILE__)); $this->_helper->viewRenderer->setNoController(); $this->_helper->viewRenderer->setScriptAction('html-view'); + + $this->useHtmlView = true; + $this->useRawOutput = false; } } /** + * Intializes the raw (echo) output component. + * + * @return void + */ + public function initRawOutput() + { + // Disable layout ((if any) + $this->disableLayout(); + + // Set view rendering off + $this->_helper->viewRenderer->setNoRender(true); + + $this->useHtmlView = false; + $this->useRawOutput = true; + } + + /** * Stub for overruling default snippet loader initiation. */ protected function loadSnippetLoader() Modified: trunk/library/classes/MUtil/Controller/html-view.phtml =================================================================== --- trunk/library/classes/MUtil/Controller/html-view.phtml 2011-12-15 15:40:20 UTC (rev 359) +++ trunk/library/classes/MUtil/Controller/html-view.phtml 2011-12-15 15:54:19 UTC (rev 360) @@ -1 +1 @@ -<?php echo $this->html->render($this); ?> +<?php echo $this->html->render($this); ?> \ No newline at end of file Property changes on: trunk/library/classes/MUtil/Html/Code ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:logregex + #(\d+) Added: trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php =================================================================== --- trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php (rev 0) +++ trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php 2011-12-15 15:54:19 UTC (rev 360) @@ -0,0 +1,162 @@ +<?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 MUtil + * @subpackage Html + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * + * @package MUtil + * @subpackage Html + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +abstract class MUtil_Html_Code_DynamicAbstract implements MUtil_Html_HtmlInterface +{ + /** + * Contains the content to output. Can be a mix of filenames and string content. + * + * @var array Numeric array of strings or MUtil_Html_HtmlInterface elements + */ + protected $_content = array(); + + /** + * The fields that must be replaced in the content before output. + * + * @var array Key => string array + */ + protected $_fields = array(); + + /** + * + * @var string The seperator used to join multiple content items together + */ + protected $_seperator = "\n"; + + /** + * Creates the object storing any values with a name as a field, unless + * there exists a set{Name} function. Other values are treated as content. + * + * @param mixed $args_array MUtil_Ra::args() parameters + */ + public function __construct($args_array = null) + { + $args = MUtil_Ra::args(func_get_args()); + + foreach ($args as $name => $value) { + if (is_integer($name)) { + $this->addContent($value); + } else { + $function = 'set' . ucfirst($name); + if (method_exists($this, $function)) { + $this->$function($value); + } else { + $this->setField($name, $value); + } + } + } + } + + /** + * Add a filename or some other content that can be rendered. + * + * @param mixed $content + */ + public function addContent($content) + { + $this->_content[] = $content; + } + + /** + * Renders the content + * + * @param Zend_View_Abstract $view + * @return string + */ + protected function getContentOutput(Zend_View_Abstract $view) + { + if (! $this->_content) { + return null; + } + + $output = array(); + + foreach ($this->_content as $content) { + if (! is_string($content)) { + $content = MUtil_Html::renderAny($view, $content); + } + + if ((false === strpos($content, "\n")) && file_exists($content)) { + $content = file_get_contents($content); + } + + $output[] = $content; + } + + if ($this->_fields) { + $output = str_replace(array_keys($this->_fields), $this->_fields, $output); + } + + return implode($this->_seperator, $output); + } + + /** + * Set a field to search and replace in the content. + * + * No markers are used. If you want to replace '{path}' with 'x', you + * must specificy the name '{path}', not 'path'. + * + * @param string $name Full name to replace. + * @param string $value The value placed. + * @return MUtil_Html_Link_LinkAbstract (continuation pattern) + */ + public function setField($name, $value) + { + $this->_fields[$name] = $value; + return $this; + } + + /** + * + * @param string $seperator + * @return MUtil_Html_Link_LinkAbstract (continuation pattern) + */ + public function setSeperator($seperator) + { + $this->_seperator = $seperator; + return $this; + } +} Added: trunk/library/classes/MUtil/Html/Code/JavaScript.php =================================================================== --- trunk/library/classes/MUtil/Html/Code/JavaScript.php (rev 0) +++ trunk/library/classes/MUtil/Html/Code/JavaScript.php 2011-12-15 15:54:19 UTC (rev 360) @@ -0,0 +1,102 @@ +<?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 MUtil + * @subpackage Html + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * + * @package MUtil + * @subpackage Html + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class MUtil_Html_Code_JavaScript extends MUtil_Html_Code_DynamicAbstract +{ + protected $_inHeader = true; + + /** + * When true the output should be displayed in the result HEAD, + * otherwise in the BODY. + * + * @return boolean + */ + public function getInHeader() + { + if ($this->_inHeader instanceof MUtil_Lazy_LazyInterface) { + return (boolean) MUtil_Lazy::raise($this->_inHeader); + } else { + return (boolean) $this->_inHeader; + } + } + /** + * Renders the element into a html string + * + * The $view is used to correctly encode and escape the output + * + * @param Zend_View_Abstract $view + * @return string Correctly encoded and escaped html output + */ + public function render(Zend_View_Abstract $view) + { + $content = $this->getContentOutput($view); + + // Of course this setting makes little difference if you have optimized + // your JavaScript loading by putting all script tags at the end of + // your body. (Except that inlineScript is always loaded last.) + if ($this->getInHeader()) { + $scriptTag = $view->headScript(); + } else { + $scriptTag = $view->inlineScript(); + } + $scriptTag->appendScript($content); + + return ''; + } + + /** + * When true the result is displayed in the result HEAD, + * otherwise in the BODY. + * + * @param boolean $value + * @return MUtil_Html_Code_JavaScript (continuation pattern) + */ + public function setInHeader($value = true) + { + $this->_inHeader = $value; + return $this; + } +} Modified: trunk/library/classes/MUtil/Html/ProgressPanel.php =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanel.php 2011-12-15 15:40:20 UTC (rev 359) +++ trunk/library/classes/MUtil/Html/ProgressPanel.php 2011-12-15 15:54:19 UTC (rev 360) @@ -46,6 +46,8 @@ */ class MUtil_Html_ProgressPanel extends MUtil_Html_HtmlElement { + const CODE = "MUtil_Html_ProgressPanel_Code"; + /** * Usually no text is appended after an element, but for certain elements we choose * to add a "\n" newline character instead, to keep the output readable in source @@ -87,6 +89,28 @@ } /** + * Returns the JavaScript object associated with this object. + * + * WARNING: calling this object sets it's position in the order the + * objects are rendered. If you use MUtil_Lazy objects, make sure they + * have the correct value when rendering. + * + * @return MUtil_Html_Code_JavaScript + */ + public function getCode() + { + if (! $this->offsetExists(self::CODE)) { + $js = new MUtil_Html_Code_JavaScript(dirname(__FILE__) . '/ProgressPanel.js'); + // $js->setInHeader(false); + $js->setField('FUNCTION_PREFIX', __CLASS__); + + $this->offsetSet(self::CODE, $js); + } + + return $this->offsetGet(self::CODE); + } + + /** * Creates a 'div' progress panel * * @param mixed $arg_array A MUtil_Ra::args data collection. @@ -110,11 +134,9 @@ */ protected function renderElement(Zend_View_Abstract $view) { - $js = new MUtil_Html_Link_JavaScript(dirname(__FILE__) . '/ProgressPanel.js'); - $js->setField('FUNCTION_PREFIX', __CLASS__); + // Make sure the JS code is added + $this->getCode(); - $this->append($js); - return parent::renderElement($view); } } Modified: trunk/library/layouts/scripts/gems.phtml =================================================================== --- trunk/library/layouts/scripts/gems.phtml 2011-12-15 15:40:20 UTC (rev 359) +++ trunk/library/layouts/scripts/gems.phtml 2011-12-15 15:54:19 UTC (rev 360) @@ -50,6 +50,8 @@ ?></div> </div><?php echo MUtil_Echo::out(); + + // Scripts here for load optimization echo $this->headScript(); echo $this->inlineScript(); ?></body> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-15 15:56:59
|
Revision: 361 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=361&view=rev Author: mennodekker Date: 2011-12-15 15:56:53 +0000 (Thu, 15 Dec 2011) Log Message: ----------- Organization can now have a default userclass, can not be changed (yet) as it needs logic to update the users Next step is to use this class in the staffAction Modified Paths: -------------- trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/configs/db/patches.sql Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2011-12-15 15:54:19 UTC (rev 360) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2011-12-15 15:56:53 UTC (rev 361) @@ -163,6 +163,21 @@ } $model->setIfExists('gor_code', 'label', $this->_('Code name'), 'size', 10, 'description', $this->_('Only for programmers.')); + if($model->has('gor_user_class')) { + $definitions = $this->loader->getUserLoader()->getAvailableStaffDefinitions(); + //Use first element as default + $default = array_shift(array_keys($definitions)); + $model->set('gor_user_class', 'default', $default); + if (count($definitions)>1) { + if ($action !== 'create') { + $model->set('gor_user_class', 'elementClass', 'Exhibitor', 'description', $this->_('This can not be changed yet')); + } + $model->set('gor_user_class', 'label', $this->_('User Definition'), 'multiOptions', $definitions); + } else { + $model->set('elementClass', 'hidden'); + } + } + $model->addColumn("CASE WHEN gor_active = 1 THEN '' ELSE 'deleted' END", 'row_class'); Gems_Model::setChangeFieldsByPrefix($model, 'gor'); Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-12-15 15:54:19 UTC (rev 360) +++ trunk/library/configs/db/patches.sql 2011-12-15 15:56:53 UTC (rev 361) @@ -361,3 +361,6 @@ -- GEMS VERSION: 43 -- PATCH: Add comment field to respondent tracks ALTER TABLE `gems__respondent2track` ADD gr2t_comment varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null AFTER `gr2t_reception_code`; + +-- PATCH: Default userdefinition per organization +ALTER TABLE gems__organizations ADD `gor_user_class` VARCHAR( 30 ) NOT NULL DEFAULT 'StaffUser' AFTER `gor_code`; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-16 11:07:30
|
Revision: 364 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=364&view=rev Author: mennodekker Date: 2011-12-16 11:07:19 +0000 (Fri, 16 Dec 2011) Log Message: ----------- Introducing the ModelTabFormSnippet(Generic) first working draft Modified Paths: -------------- trunk/library/classes/MUtil/Model/FormBridge.php trunk/library/snippets/Organization/OrganizationEditSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php Added: trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php (rev 0) +++ trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2011-12-16 11:07:19 UTC (rev 364) @@ -0,0 +1,169 @@ +<?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. + * + * Short description of file + * + * @package Gems + * @subpackage Snippets + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + */ + +/** + * Short description for ModelTabFormSnippetGeneric + * + * Long description for class ModelTabFormSnippetGeneric (if any)... + * + * @package Gems + * @subpackage Snippets + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 + * @deprecated Class deprecated since version 2.0 + */ +class Gems_Snippets_ModelTabFormSnippetGeneric extends Gems_Snippets_ModelFormSnippetGeneric +{ + /** + * + * @var Gems_TabForm + */ + protected $_form; + + /** + * Array of item names still to be added to the form + * + * @var array + */ + protected $_items; + + /** + * Add items to the bridge, and remove them from the items array + * + * @param MUtil_Model_FormBridge $bridge + * @param string $element1 + * + * @return void + */ + protected function addItems($bridge, $element1) + { + $args = func_get_args(); + if (count($args)<2) { + throw new Gems_Exception_Coding('Use at least 2 arguments, first the bridge and then one or more idividual items'); + } + + $bridge = array_shift($args); + $elements = $args; + + //Remove the elements from the _items variable + $this->_items = array_diff($this->_items, $elements); + + //And add them to the bridge + foreach($elements as $name) { + if ($label = $this->model->get($name, 'label')) { + $bridge->add($name); + } else { + $bridge->addHidden($name); + } + } + } + + /** + * Adds elements from the model to the bridge that creates the form. + * + * Overrule this function to add different elements to the browse table, without + * having to recode the core table building code. + * + * @param MUtil_Model_FormBridge $bridge + * @param MUtil_Model_ModelAbstract $model + * @param array $items + */ + protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model, $items = null) + { + //Get all elements in the model if not already done + $this->initItems(); + + //Now add all remaining items to the last last tab (if any) + foreach($this->_items as $name) { + if ($label = $model->get($name, 'label')) { + $bridge->add($name); + } else { + $bridge->addHidden($name); + } + } + } + + /** + * Perform some actions on the form, right before it is displayed but already populated + * + * Here we add the table display to the form. + * + * @return Zend_Form + */ + public function beforeDisplay() + { + //If needed, add a row of link buttons to the bottom of the form + $form = $this->_form; + if ($links = $this->getMenuList()) { + $element = new MUtil_Form_Element_Html('formLinks'); + $element->setValue($links); + $element->setOrder(999); + if ($form instanceof Gems_TabForm) { + $form->resetContext(); + } + $form->addElement($element); + $form->addDisplayGroup(array('formLinks'), 'form_buttons'); + } + } + + /** + * Creates an empty form. Allows overruling in sub-classes. + * + * @param mixed $options + * @return Gems_TabForm + */ + protected function createForm($options = null) + { + $form = new Gems_TabForm($options); + $this->_form = $form; + + //Now first add the saveButton as it needs to be outside the tabs + $this->addSaveButton(); + + return $form; + } + + /** + * Initialize the _items variable to hold all items from the model + */ + protected function initItems() + { + if (is_null($this->_items)) { + $this->_items = $this->model->getItemsOrdered(); + } + } +} \ No newline at end of file Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2011-12-16 10:11:39 UTC (rev 363) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2011-12-16 11:07:19 UTC (rev 364) @@ -701,4 +701,17 @@ { return $this->model; } + + /** + * Retrieve a tab from a Gems_TabForm to add extra content to it + * + * @param string $name + * @return Gems_Form_TabSubForm + */ + public function getTab($name) + { + if (method_exists($this->form, 'getTab')) { + return $this->form->getTab($name); + } + } } Modified: trunk/library/snippets/Organization/OrganizationEditSnippet.php =================================================================== --- trunk/library/snippets/Organization/OrganizationEditSnippet.php 2011-12-16 10:11:39 UTC (rev 363) +++ trunk/library/snippets/Organization/OrganizationEditSnippet.php 2011-12-16 11:07:19 UTC (rev 364) @@ -44,7 +44,7 @@ * @license New BSD License * @since Class available since version 1.5 */ -class Organization_OrganizationEditSnippet extends Gems_Snippets_ModelFormSnippetGeneric +class Organization_OrganizationEditSnippet extends Gems_Snippets_ModelTabFormSnippetGeneric { /** * @@ -52,6 +52,51 @@ */ protected $loader; + /** + * Adds elements from the model to the bridge that creates the form. + * + * Overrule this function to add different elements to the browse table, without + * having to recode the core table building code. + * + * @param MUtil_Model_FormBridge $bridge + * @param MUtil_Model_ModelAbstract $model + */ + protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) + { + //Get all elements in the model if not already done + $this->initItems(); + + //Create our tab structure first check if tab already exists to allow extension + if (!($bridge->getTab('general'))) { + $bridge->addTab('general', 'value', $this->_('General')); + } + //Need the first two together for validation + $bridge->addHtml('org')->b($this->_('Organization')); + $this->addItems($bridge, 'gor_name', 'gor_id_organization', 'gor_location', 'gor_url', 'gor_active'); + $bridge->addHtml('contact')->b($this->_('Contact')); + $bridge->addHtml('contact_desc')->i($this->_('The contact details for this organization, used for emailing.')); + $this->addItems($bridge, 'gor_contact_name', 'gor_contact_email'); + $bridge->addHtml('general_other')->b($this->_('Other')); + $this->addItems($bridge, 'gor_iso_lang', 'gor_code', 'gor_has_respondents'); + + if (!($bridge->getTab('email'))) { + $bridge->addTab('email', 'value', $this->_('Email') . ' & ' . $this->_('Token')); + } + $this->addItems($bridge, 'gor_welcome', 'gor_signature'); + + if (!($bridge->getTab('access'))) { + $bridge->addTab('access', 'value', $this->_('Access')); + } + $this->addItems($bridge, 'gor_has_login', 'gor_add_respondents', 'gor_respondent_group', 'gor_accessible_by', 'gor_user_class'); + + //now add remaining items if any + + if (count($this->_items)>0 && !($bridge->getTab('other'))) { + $bridge->addTab('other', 'value', $this->_('Other')); + } + parent::addFormElements($bridge, $model); + } + public function afterSave($changed) { $org = $this->loader->getOrganization($data['gor_id_organization']); @@ -62,4 +107,4 @@ return parent::afterSave($changed); } -} +} \ 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-12-16 15:06:52
|
Revision: 367 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=367&view=rev Author: mennodekker Date: 2011-12-16 15:06:43 +0000 (Fri, 16 Dec 2011) Log Message: ----------- Bugfix in OrganizationEditSnipper.php afterSave OrganizationModel can now have a a userDefinition with it's own config options that can be saved anywhere Modified Paths: -------------- trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/classes/Gems/Model.php trunk/library/snippets/Organization/OrganizationEditSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Model/OrganizationModel.php trunk/library/classes/Gems/User/UserDefinitionConfigurableInterface.php Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2011-12-16 15:03:03 UTC (rev 366) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2011-12-16 15:06:43 UTC (rev 367) @@ -114,7 +114,7 @@ */ public function createModel($detailed, $action) { - $model = new MUtil_Model_TableModel('gems__organizations'); + $model = $this->loader->getModels()->getOrganizationModel(); $model->setDeleteValues('gor_active', 0, 'gor_add_respondents', 0); Added: trunk/library/classes/Gems/Model/OrganizationModel.php =================================================================== --- trunk/library/classes/Gems/Model/OrganizationModel.php (rev 0) +++ trunk/library/classes/Gems/Model/OrganizationModel.php 2011-12-16 15:06:43 UTC (rev 367) @@ -0,0 +1,160 @@ +<?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. + * + * The organization model + * + * @package Gems + * @subpackage Model + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + */ + +/** + * Contains the organization + * + * Handles saving of the user definition config + * + * @package Gems + * @subpackage Model + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Model_OrganizationModel extends Gems_Model_JoinModel implements MUtil_Registry_TargetInterface +{ + /** + * @var Gems_Loader + */ + public $loader; + + public function __construct() + { + parent::__construct('organization', 'gems__organizations', 'gor'); + } + + /** + * 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; + } + + /** + * 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 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]; + } + + /** + * 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')); + } + + /** + * Save a single model item. + * + * Makes sure the password is saved too using the userclass + * + * @param array $newValues The values to store for a single model item. + * @param array $filter If the filter contains old key values these are used + * to decide on update versus insert. + * @param array $saveTables Optional array containing the table names to save, + * otherwise the tables set to save at model level will be saved. + * @return array The values as they are after saving (they may change). + */ + public function save(array $newValues, array $filter = null, array $saveTables = null) + { + //First perform a save + $savedValues = parent::save($newValues, $filter, $saveTables); + + //Now check if we need to save config values + if (isset($newValues['gor_user_class']) && !empty($newValues['gor_user_class'])) { + $class = $newValues['gor_user_class'] . 'Definition'; + $definition = $this->loader->getUserLoader()->getUserDefinition($class); + + if ($definition->hasConfig()) { + $savedValues['config'] = $definition->saveConfig($savedValues,$newValues['config']); + if ($definition->getConfigChanged()>0 && $this->getChanged()<1) { + $this->setChanged(1); + } + } + } + + return $savedValues; + } + + public function loadFirst($filter = true, $sort = true) + { + $data = parent::loadFirst($filter, $sort); + + if (isset($data['gor_user_class']) && !empty($data['gor_user_class'])) { + $class = $data['gor_user_class'] . 'Definition'; + $definition = $this->loader->getUserLoader()->getUserDefinition($class); + + if ($definition->hasConfig()) { + $data['config'] = $definition->loadConfig($data); + } + } + + return $data; + } +} \ No newline at end of file Modified: trunk/library/classes/Gems/Model.php =================================================================== --- trunk/library/classes/Gems/Model.php 2011-12-16 15:03:03 UTC (rev 366) +++ trunk/library/classes/Gems/Model.php 2011-12-16 15:06:43 UTC (rev 367) @@ -171,6 +171,13 @@ return $model; } + public function getOrganizationModel() + { + $model = $this->_loadClass('OrganizationModel', true); + + return $model; + } + /** * Load project specific model or general Gems model otherwise * Added: trunk/library/classes/Gems/User/UserDefinitionConfigurableInterface.php =================================================================== --- trunk/library/classes/Gems/User/UserDefinitionConfigurableInterface.php (rev 0) +++ trunk/library/classes/Gems/User/UserDefinitionConfigurableInterface.php 2011-12-16 15:06:43 UTC (rev 367) @@ -0,0 +1,83 @@ +<?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. + * + * + * @package Gems + * @subpackage User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +interface Gems_User_UserDefinitionConfigurableInterface +{ + /** + * Appends the needed fields for this config to the $bridge + * + * @param MUtil_Model_FormBridge $bridge + */ + public function appendConfigFields(MUtil_Model_FormBridge $bridge); + + /** + * Should return the number of changed records for the save performed + */ + public function getConfigChanged(); + + /** + * Do we need to add custom config parameters to use this definition? + * + * @return boolean + */ + public function hasConfig(); + + /** + * Handles loading the config for the given data + * + * @param array $data + * @return array + */ + public function loadConfig($data); + + /** + * Handles saving the configvalues in $values using the $data + * + * @param array $data + * @param array $values + * @return array + */ + public function saveConfig($data, $values); +} \ No newline at end of file Modified: trunk/library/snippets/Organization/OrganizationEditSnippet.php =================================================================== --- trunk/library/snippets/Organization/OrganizationEditSnippet.php 2011-12-16 15:03:03 UTC (rev 366) +++ trunk/library/snippets/Organization/OrganizationEditSnippet.php 2011-12-16 15:06:43 UTC (rev 367) @@ -89,8 +89,17 @@ } $this->addItems($bridge, 'gor_has_login', 'gor_add_respondents', 'gor_respondent_group', 'gor_accessible_by', 'gor_user_class'); + if (isset($this->formData['gor_user_class']) && !empty($this->formData['gor_user_class'])) { + $class = $this->formData['gor_user_class'] . 'Definition'; + $definition = $this->loader->getUserLoader()->getUserDefinition($class); + + if ($definition->hasConfig()) { + $definition->appendConfigFields($bridge); + } + + } + //now add remaining items if any - if (count($this->_items)>0 && !($bridge->getTab('other'))) { $bridge->addTab('other', 'value', $this->_('Other')); } @@ -99,7 +108,7 @@ public function afterSave($changed) { - $org = $this->loader->getOrganization($data['gor_id_organization']); + $org = $this->loader->getOrganization($changed['gor_id_organization']); $org->invalidateCache(); // Make sure any changes in the allowed list are reflected. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-16 15:23:35
|
Revision: 368 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=368&view=rev Author: mennodekker Date: 2011-12-16 15:23:24 +0000 (Fri, 16 Dec 2011) Log Message: ----------- Forgot check for compatibility with definitions that are not configurable :) Modified Paths: -------------- trunk/library/classes/Gems/Model/OrganizationModel.php trunk/library/snippets/Organization/OrganizationEditSnippet.php Modified: trunk/library/classes/Gems/Model/OrganizationModel.php =================================================================== --- trunk/library/classes/Gems/Model/OrganizationModel.php 2011-12-16 15:06:43 UTC (rev 367) +++ trunk/library/classes/Gems/Model/OrganizationModel.php 2011-12-16 15:23:24 UTC (rev 368) @@ -131,7 +131,7 @@ $class = $newValues['gor_user_class'] . 'Definition'; $definition = $this->loader->getUserLoader()->getUserDefinition($class); - if ($definition->hasConfig()) { + if ($definition instanceof Gems_User_UserDefinitionConfigurableInterface && $definition->hasConfig()) { $savedValues['config'] = $definition->saveConfig($savedValues,$newValues['config']); if ($definition->getConfigChanged()>0 && $this->getChanged()<1) { $this->setChanged(1); @@ -150,7 +150,7 @@ $class = $data['gor_user_class'] . 'Definition'; $definition = $this->loader->getUserLoader()->getUserDefinition($class); - if ($definition->hasConfig()) { + if ($definition instanceof Gems_User_UserDefinitionConfigurableInterface && $definition->hasConfig()) { $data['config'] = $definition->loadConfig($data); } } Modified: trunk/library/snippets/Organization/OrganizationEditSnippet.php =================================================================== --- trunk/library/snippets/Organization/OrganizationEditSnippet.php 2011-12-16 15:06:43 UTC (rev 367) +++ trunk/library/snippets/Organization/OrganizationEditSnippet.php 2011-12-16 15:23:24 UTC (rev 368) @@ -93,7 +93,7 @@ $class = $this->formData['gor_user_class'] . 'Definition'; $definition = $this->loader->getUserLoader()->getUserDefinition($class); - if ($definition->hasConfig()) { + if ($definition instanceof Gems_User_UserDefinitionConfigurableInterface && $definition->hasConfig()) { $definition->appendConfigFields($bridge); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-21 09:43:35
|
Revision: 380 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=380&view=rev Author: mennodekker Date: 2011-12-21 09:43:26 +0000 (Wed, 21 Dec 2011) Log Message: ----------- Introducing the RadiusUserDefinition Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Added Paths: ----------- trunk/library/classes/Gems/User/Adapter/ trunk/library/classes/Gems/User/Adapter/Radius/ trunk/library/classes/Gems/User/Adapter/Radius/COPYING trunk/library/classes/Gems/User/Adapter/Radius/COPYING.LESSER trunk/library/classes/Gems/User/Adapter/Radius/README.TXT trunk/library/classes/Gems/User/Adapter/Radius/radius.class.php trunk/library/classes/Gems/User/Adapter/Radius.php trunk/library/classes/Gems/User/RadiusUserDefinition.php trunk/library/configs/db/tables/gems__radius_config.999.sql Added: trunk/library/classes/Gems/User/Adapter/Radius/COPYING =================================================================== --- trunk/library/classes/Gems/User/Adapter/Radius/COPYING (rev 0) +++ trunk/library/classes/Gems/User/Adapter/Radius/COPYING 2011-12-21 09:43:26 UTC (rev 380) @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. Added: trunk/library/classes/Gems/User/Adapter/Radius/COPYING.LESSER =================================================================== --- trunk/library/classes/Gems/User/Adapter/Radius/COPYING.LESSER (rev 0) +++ trunk/library/classes/Gems/User/Adapter/Radius/COPYING.LESSER 2011-12-21 09:43:26 UTC (rev 380) @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. Added: trunk/library/classes/Gems/User/Adapter/Radius/README.TXT =================================================================== --- trunk/library/classes/Gems/User/Adapter/Radius/README.TXT (rev 0) +++ trunk/library/classes/Gems/User/Adapter/Radius/README.TXT 2011-12-21 09:43:26 UTC (rev 380) @@ -0,0 +1,84 @@ +Pure PHP radius class + +Last update: 2009-01-05, release 1.2.2 + +This Radius class is a radius client implementation in pure PHP +following the RFC 2865 rules (http://www.ietf.org/rfc/rfc2865.txt) + + +This class works with at least the following RADIUS servers: + - Authenex Strong Authentication System (ASAS) with two-factor authentication + - FreeRADIUS, a free Radius server implementation for Linux and *nix environments + - Microsoft Radius server IAS + - Mideye RADIUS server (http://www.mideye.com) + - Radl, a free Radius server for Windows + - RSA SecurID + - VASCO Middleware 3.0 server + - WinRadius, Windows Radius server (free for 5 users) + - ZyXEL ZyWALL OTP (Authenex ASAS branded by ZyXEL, cheaper) + + + +USAGE + +require_once('radius.class.php'); +$radius = new Radius($ip_radius_server = 'radius_server_ip_address', $shared_secret = 'radius_shared_secret'[, $radius_suffix = 'optional_radius_suffix'[, $udp_timeout = udp_timeout_in_seconds[, $authentication_port = 1812]]]); +$result = $radius->Access_Request($username = 'username', $password = 'password'[, $udp_timeout = udp_timeout_in_seconds]); + + + +EXAMPLES + +Example 1 + require_once('radius.class.php'); + $radius = new Radius('127.0.0.1', 'secret'); + $radius->SetNasIpAddress('1.2.3.4'); // Needed for some devices (not always auto-detected) + if ($radius->AccessRequest('user', 'pass')) + { + echo "Authentication accepted."; + } + else + { + echo "Authentication rejected."; + } + + +Example 2 + require_once('radius.class.php'); + $radius = new Radius('127.0.0.1', 'secret'); + $radius->SetNasPort(0); + $radius->SetNasIpAddress('1.2.3.4'); // Needed for some devices (not always auto-detected) + if ($radius->AccessRequest('user', 'pass')) + { + echo "Authentication accepted."; + echo "<br />"; + } + else + { + echo "Authentication rejected."; + echo "<br />"; + } + echo $radius->GetReadableReceivedAttributes(); + + + +LICENCE + +Copyright (c) 2008, SysCo systemes de communication sa +SysCo (tm) is a trademark of SysCo systemes de communication sa +(http://www.sysco.ch/) +All rights reserved. + +Pure PHP radius class is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation, either version 3 of the License, +or (at your option) any later version. + +Pure PHP radius class is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with Pure PHP radius class. +If not, see <http://www.gnu.org/licenses/>. Added: trunk/library/classes/Gems/User/Adapter/Radius/radius.class.php =================================================================== --- trunk/library/classes/Gems/User/Adapter/Radius/radius.class.php (rev 0) +++ trunk/library/classes/Gems/User/Adapter/Radius/radius.class.php 2011-12-21 09:43:26 UTC (rev 380) @@ -0,0 +1,840 @@ +<?php + +/********************************************************************* + * + * Pure PHP radius class + * + * This Radius class is a radius client implementation in pure PHP + * following the RFC 2865 rules (http://www.ietf.org/rfc/rfc2865.txt) + * + * This class works with at least the following RADIUS servers: + * - Authenex Strong Authentication System (ASAS) with two-factor authentication + * - FreeRADIUS, a free Radius server implementation for Linux and *nix environments + * - Microsoft Radius server IAS + * - Mideye RADIUS server (http://www.mideye.com) + * - Radl, a free Radius server for Windows + * - RSA SecurID + * - VASCO Middleware 3.0 server + * - WinRadius, Windows Radius server (free for 5 users) + * - ZyXEL ZyWALL OTP (Authenex ASAS branded by ZyXEL, cheaper) + * + * + * LICENCE + * + * Copyright (c) 2008, SysCo systemes de communication sa + * SysCo (tm) is a trademark of SysCo systemes de communication sa + * (http://www.sysco.ch/) + * All rights reserved. + * + * This file is part of the Pure PHP radius class + * + * Pure PHP radius class is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * Pure PHP radius class is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Pure PHP radius class. + * If not, see <http://www.gnu.org/licenses/>. + * + * + * @author: SysCo/al + * @since CreationDate: 2008-01-04 + * @copyright (c) 2008 by SysCo systemes de communication sa + * @version $LastChangedRevision: 1.2.2 $ + * @version $LastChangedDate: 2009-01-05 $ + * @version $LastChangedBy: SysCo/al $ + * @link $HeadURL: radius.class.php $ + * @link http://developer.sysco.ch/php/ + * @link dev...@sy... + * Language: PHP 4.0.7 or higher + * + * + * Usage + * + * require_once('radius.class.php'); + * $radius = new Radius($ip_radius_server = 'radius_server_ip_address', $shared_secret = 'radius_shared_secret'[, $radius_suffix = 'optional_radius_suffix'[, $udp_timeout = udp_timeout_in_seconds[, $authentication_port = 1812]]]); + * $result = $radius->Access_Request($username = 'username', $password = 'password'[, $udp_timeout = udp_timeout_in_seconds]); + * + * + * Examples + * + * Example 1 + * <?php + * require_once('radius.class.php'); + * $radius = new Radius('127.0.0.1', 'secret'); + * $radius->SetNasIpAddress('1.2.3.4'); // Needed for some devices, and not auto_detected if PHP not runned through a web server + * if ($radius->AccessRequest('user', 'pass')) + * { + * echo "Authentication accepted."; + * } + * else + * { + * echo "Authentication rejected."; + * } + * ?> + * + * Example 2 + * <?php + * require_once('radius.class.php'); + * $radius = new Radius('127.0.0.1', 'secret'); + * $radius->SetNasPort(0); + * $radius->SetNasIpAddress('1.2.3.4'); // Needed for some devices, and not auto_detected if PHP not runned through a web server + * if ($radius->AccessRequest('user', 'pass')) + * { + * echo "Authentication accepted."; + * echo "<br />"; + * } + * else + * { + * echo "Authentication rejected."; + * echo "<br />"; + * } + * echo $radius->GetReadableReceivedAttributes(); + * ?> + * + * + * External file needed + * + * none. + * + * + * External file created + * + * none. + * + * + * Special issues + * + * - Sockets support must be enabled. + * * In Linux and *nix environments, the extension is enabled at + * compile time using the --enable-sockets configure option + * * In Windows, PHP Sockets can be activated by un-commenting + * extension=php_sockets.dll in php.ini + * + * + * Other related ressources + * + * FreeRADIUS, a free Radius server implementation for Linux and *nix environments: + * http://www.freeradius.org/ + * + * WinRadius, Windows Radius server (free for 5 users): + * http://www.itconsult2000.com/en/product/WinRadius.zip + * + * Radl, a free Radius server for Windows: + * http://www.loriotpro.com/Products/RadiusServer/FreeRadiusServer_EN.php + * + * DOS command line Radius client: + * http://www.itconsult2000.com/en/product/WinRadiusClient.zip + * + * + * Users feedbacks and comments + * + * 2008-07-02 Pim Koeman/Parantion + * + * When using a radius connection behind a linux iptables firewall + * allow port 1812 and 1813 with udp protocol + * + * IPTABLES EXAMPLE (command line): + * iptables -A AlwaysACCEPT -p udp --dport 1812 -j ACCEPT + * iptables -A AlwaysACCEPT -p udp --dport 1813 -j ACCEPT + * + * or put the lines in /etc/sysconfig/iptables (red-hat type systems (fedora, centos, rhel etc.) + * -A AlwaysACCEPT -p udp --dport 1812 -j ACCEPT + * -A AlwaysACCEPT -p udp --dport 1813 -j ACCEPT + * + * + * Change Log + * + * 2009-01-05 1.2.2 SysCo/al Added Robert Svensson feedback, Mideye RADIUS server is supported + * 2008-11-11 1.2.1 SysCo/al Added Carlo Ferrari resolution in examples (add NAS IP Address for a VASCO Middleware server) + * 2008-07-07 1.2 SysCo/al Added Pim Koeman (Parantion) contribution + * - comments concerning using radius behind a linux iptables firewall + * Added Jon Bright (tick Trading Software AG) contribution + * - false octal encoding with 0xx indexes (indexes are now rewritten in xx only) + * - challenge/response support for the RSA SecurID New-PIN mode + * Added GetRadiusPacketInfo() method + * Added GetAttributesInfo() method + * Added DecodeVendorSpecificContent() (to answer Raul Carvalho's question) + * Added Decoded Vendor Specific Content in debug messages + * 2008-02-04 1.1 SysCo/al Typo error for the udp_timeout parameter (line 256 in the version 1.0) + * 2008-01-07 1.0 SysCo/al Initial release + * + *********************************************************************/ + + +/********************************************************************* + * + * Radius + * Pure PHP radius class + * + * Creation 2008-01-04 + * Update 2009-01-05 + * @package radius + * @version v.1.2.2 + * @author SysCo/al + * + *********************************************************************/ +class Radius +{ + var $_ip_radius_server; // Radius server IP address + var $_shared_secret; // Shared secret with the radius server + var $_radius_suffix; // Radius suffix (default is ''); + var $_udp_timeout; // Timeout of the UDP connection in seconds (default value is 5) + var $_authentication_port; // Authentication port (default value is 1812) + var $_accounting_port; // Accouting port (default value is 1813) + var $_nas_ip_address; // NAS IP address + var $_nas_port; // NAS port + var $_encrypted_password; // Encrypted password, as described in the RFC 2865 + var $_user_ip_address; // Remote IP address of the user + var $_request_authenticator; // Request-Authenticator, 16 octets random number + var $_response_authenticator; // Request-Authenticator, 16 octets random number + var $_username; // Username to sent to the Radius server + var $_password; // Password to sent to the Radius server (clear password, must be encrypted) + var $_identifier_to_send; // Identifier field for the packet to be sent + var $_identifier_received; // Identifier field for the received packet + var $_radius_packet_to_send; // Radius packet code (1=Access-Request, 2=Access-Accept, 3=Access-Reject, 4=Accounting-Request, 5=Accounting-Response, 11=Access-Challenge, 12=Status-Server (experimental), 13=Status-Client (experimental), 255=Reserved + var $_radius_packet_received; // Radius packet code (1=Access-Request, 2=Access-Accept, 3=Access-Reject, 4=Accounting-Request, 5=Accounting-Response, 11=Access-Challenge, 12=Status-Server (experimental), 13=Status-Client (experimental), 255=Reserved + var $_attributes_to_send; // Radius attributes to send + var $_attributes_received; // Radius attributes received + var $_socket_to_server; // Socket connection + var $_debug_mode; // Debug mode flag + var $_attributes_info; // Attributes info array + var $_radius_packet_info; // Radius packet codes info array + var $_last_error_code; // Last error code + var $_last_error_message; // Last error message + + + /********************************************************************* + * + * Name: Radius + * short description: Radius class constructor + * + * Creation 2008-01-04 + * Update 2009-01-05 + * @version v.1.2.2 + * @author SysCo/al + * @param string ip address of the radius server + * @param string shared secret with the radius server + * @param string radius domain name suffix (default is empty) + * @param integer UDP timeout (default is 5) + * @param integer authentication port + * @param integer accounting port + * @return NULL + *********************************************************************/ + public function Radius($ip_radius_server = '127.0.0.1', $shared_secret = '', $radius_suffix = '', $udp_timeout = 5, $authentication_port = 1812, $accounting_port = 1813) + { + $this->_radius_packet_info[1] = 'Access-Request'; + $this->_radius_packet_info[2] = 'Access-Accept'; + $this->_radius_packet_info[3] = 'Access-Reject'; + $this->_radius_packet_info[4] = 'Accounting-Request'; + $this->_radius_packet_info[5] = 'Accounting-Response'; + $this->_radius_packet_info[11] = 'Access-Challenge'; + $this->_radius_packet_info[12] = 'Status-Server (experimental)'; + $this->_radius_packet_info[13] = 'Status-Client (experimental)'; + $this->_radius_packet_info[255] = 'Reserved'; + + $this->_attributes_info[1] = array('User-Name', 'S'); + $this->_attributes_info[2] = array('User-Password', 'S'); + $this->_attributes_info[3] = array('CHAP-Password', 'S'); // Type (1) / Length (1) / CHAP Ident (1) / String + $this->_attributes_info[4] = array('NAS-IP-Address', 'A'); + $this->_attributes_info[5] = array('NAS-Port', 'I'); + $this->_attributes_info[6] = array('Service-Type', 'I'); + $this->_attributes_info[7] = array('Framed-Protocol', 'I'); + $this->_attributes_info[8] = array('Framed-IP-Address', 'A'); + $this->_attributes_info[9] = array('Framed-IP-Netmask', 'A'); + $this->_attributes_info[10] = array('Framed-Routing', 'I'); + $this->_attributes_info[11] = array('Filter-Id', 'T'); + $this->_attributes_info[12] = array('Framed-MTU', 'I'); + $this->_attributes_info[13] = array('Framed-Compression', 'I'); + $this->_attributes_info[14] = array( 'Login-IP-Host', 'A'); + $this->_attributes_info[15] = array('Login-service', 'I'); + $this->_attributes_info[16] = array('Login-TCP-Port', 'I'); + $this->_attributes_info[17] = array('(unassigned)', ''); + $this->_attributes_info[18] = array('Reply-Message', 'T'); + $this->_attributes_info[19] = array('Callback-Number... [truncated message content] |
From: <gem...@li...> - 2012-01-06 14:09:26
|
Revision: 403 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=403&view=rev Author: mennodekker Date: 2012-01-06 14:09:20 +0000 (Fri, 06 Jan 2012) Log Message: ----------- reverting #400 and committing other fix for the same problem Modified Paths: -------------- trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php trunk/library/snippets/Organization/OrganizationEditSnippet.php Modified: trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2012-01-06 14:02:50 UTC (rev 402) +++ trunk/library/classes/MUtil/Snippets/ModelFormSnippetAbstract.php 2012-01-06 14:09:20 UTC (rev 403) @@ -157,10 +157,10 @@ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) { //Get all elements in the model if not already done - $this->initItems($model); + $this->initItems(); //And any remaining item - $this->addItems($bridge, $model, $this->_items); + $this->addItems($bridge, $this->_items); } /** @@ -171,22 +171,22 @@ * * @return void */ - protected function addItems(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model, $element1) + protected function addItems(MUtil_Model_FormBridge $bridge, $element1) { $args = func_get_args(); - if (count($args) < 3) { - throw new Gems_Exception_Coding('Use at least 3 arguments; bridge, model and then one or more individual items'); + if (count($args)<2) { + throw new Gems_Exception_Coding('Use at least 2 arguments, first the bridge and then one or more idividual items'); } $bridge = array_shift($args); - $model = array_shift($args); $elements = MUtil_Ra::flatten($args); //Remove the elements from the _items variable $this->_items = array_diff($this->_items, $elements); - + //And add them to the bridge foreach($elements as $name) { + $model = $this->getModel(); if ($label = $model->get($name, 'label')) { $bridge->add($name); } else { @@ -362,9 +362,10 @@ /** * Initialize the _items variable to hold all items from the model */ - protected function initItems(MUtil_Model_ModelAbstract $model) + protected function initItems() { if (is_null($this->_items)) { + $model = $this->getModel(); $this->_items = $model->getItemsOrdered(); } } @@ -549,4 +550,4 @@ // Note we use an MUtil_Form return $this->_form->isValid($this->formData, $this->disableValidatorTranslation); } -} +} \ No newline at end of file Modified: trunk/library/snippets/Organization/OrganizationEditSnippet.php =================================================================== --- trunk/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-06 14:02:50 UTC (rev 402) +++ trunk/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-06 14:09:20 UTC (rev 403) @@ -64,7 +64,7 @@ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) { //Get all elements in the model if not already done - $this->initItems($model); + $this->initItems(); //Create our tab structure first check if tab already exists to allow extension if (!($bridge->getTab('general'))) { @@ -72,17 +72,17 @@ } //Need the first two together for validation $bridge->addHtml('org')->b($this->_('Organization')); - $this->addItems($bridge, $model, 'gor_name', 'gor_id_organization', 'gor_location', 'gor_url', 'gor_active'); + $this->addItems($bridge, 'gor_name', 'gor_id_organization', 'gor_location', 'gor_url', 'gor_active'); $bridge->addHtml('contact')->b($this->_('Contact')); $bridge->addHtml('contact_desc')->i($this->_('The contact details for this organization, used for emailing.')); - $this->addItems($bridge, $model, 'gor_contact_name', 'gor_contact_email'); + $this->addItems($bridge, 'gor_contact_name', 'gor_contact_email'); $bridge->addHtml('general_other')->b($this->_('Other')); - $this->addItems($bridge, $model, 'gor_iso_lang', 'gor_code', 'gor_has_respondents'); + $this->addItems($bridge, 'gor_iso_lang', 'gor_code', 'gor_has_respondents'); if (!($bridge->getTab('email'))) { $bridge->addTab('email', 'value', $this->_('Email') . ' & ' . $this->_('Token')); } - $this->addItems($bridge, $model, 'gor_welcome', 'gor_signature'); + $this->addItems($bridge, 'gor_welcome', 'gor_signature'); if (!($bridge->getTab('access'))) { $bridge->addTab('access', 'value', $this->_('Access')); @@ -94,7 +94,7 @@ unset($multiOptions[$this->formData['gor_id_organization']]); $model->set('gor_accessible_by', 'multiOptions', $multiOptions); } - $this->addItems($bridge, $model, 'gor_has_login', 'gor_add_respondents', 'gor_respondent_group', 'gor_accessible_by'); + $this->addItems($bridge, 'gor_has_login', 'gor_add_respondents', 'gor_respondent_group', 'gor_accessible_by'); //Show what organizations we can access if (isset($this->formData['gor_id_organization']) && !empty($this->formData['gor_id_organization'])) { @@ -106,7 +106,7 @@ $bridge->addExhibitor('allowed', 'value', $display, 'label', $this->_('Can access')); } - $this->addItems($bridge, $model, 'gor_user_class'); + $this->addItems($bridge, 'gor_user_class'); if (isset($this->formData['gor_user_class']) && !empty($this->formData['gor_user_class'])) { $class = $this->formData['gor_user_class'] . 'Definition'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-02-16 17:15:42
|
Revision: 498 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=498&view=rev Author: matijsdejong Date: 2012-02-16 17:15:30 +0000 (Thu, 16 Feb 2012) Log Message: ----------- refreshTokenAttributesBatch works, but could yet be implemented at other levels than source level LimeSurvey token tables now have token length corrected when needed LimeSurvey 1.91 token tables now get usesleft field when it does not exists Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m91Database.php trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php trunk/library/classes/Gems/Tracker/TrackerInterface.php trunk/library/classes/Gems/Tracker.php trunk/library/configs/db/patches.sql Added Paths: ----------- trunk/library/classes/Gems/Tracker/Batch/RefreshTokenAttributesBatch.php Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2012-02-16 15:22:35 UTC (rev 497) +++ trunk/library/classes/Gems/Default/SourceAction.php 2012-02-16 17:15:30 UTC (rev 498) @@ -103,6 +103,22 @@ } /** + * Check all token attributes for a single source + */ + public function attributesAction() + { + $sourceId = $this->getSourceId(); + $where = $this->db->quoteInto('gsu_id_source = ?', $sourceId); + + $batch = $this->loader->getTracker()->refreshTokenAttributesBatch('sourceCheck' . $sourceId, $where); + + $title = sprintf($this->_('Refreshing token attributes for for %s source.'), + $this->db->fetchOne("SELECT gso_source_name FROM gems__sources WHERE gso_id_source = ?", $sourceId)); + + $this->_helper->BatchRunner($batch, $title); + } + + /** * Check all the tokens for a single source */ public function checkAction() Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2012-02-16 15:22:35 UTC (rev 497) +++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2012-02-16 17:15:30 UTC (rev 498) @@ -412,6 +412,7 @@ $page->addAction($this->_('Check status'), null, 'ping')->addParameters(MUtil_Model::REQUEST_ID); $page->addAction($this->_('Synchronize surveys'), 'pr.source.synchronize', 'synchronize')->addParameters(MUtil_Model::REQUEST_ID); $page->addAction($this->_('Check answers'), 'pr.source.check-answers', 'check')->addParameters(MUtil_Model::REQUEST_ID); + $page->addAction($this->_('Check attributes'), 'pr.source.check-attributes', 'attributes')->addParameters(MUtil_Model::REQUEST_ID); $page->addAction($this->_('Synchronize all surveys'), 'pr.source.synchronize-all', 'synchronize-all'); $page->addAction($this->_('Check all answers'), 'pr.source.check-answers-all', 'check-all'); Added: trunk/library/classes/Gems/Tracker/Batch/RefreshTokenAttributesBatch.php =================================================================== --- trunk/library/classes/Gems/Tracker/Batch/RefreshTokenAttributesBatch.php (rev 0) +++ trunk/library/classes/Gems/Tracker/Batch/RefreshTokenAttributesBatch.php 2012-02-16 17:15:30 UTC (rev 498) @@ -0,0 +1,133 @@ +<?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 Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Refresh the attributes of all tokens + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Tracker_Batch_RefreshTokenAttributesBatch extends MUtil_Batch_BatchAbstract +{ + /** + * + * @var Gems_Tracker + */ + protected $tracker; + + /** + * + * @var Zend_Translate + */ + protected $translate; + + /** + * Add a token check step to the batch + * + * @param string $tokenId A token id + * @return Gems_Tracker_Batch_UpdateAttributesBatch (Continuation pattern) + */ + public function addToken($tokenId) + { + $this->addStep('updateAttributes', $tokenId); + + return $this; + } + + /** + * Add token check steps to the batch + * + * @param array $tokenIds An array of token ids + * @return Gems_Tracker_Batch_UpdateAttributesBatch (Continuation pattern) + */ + public function addTokens(array $tokenIds) + { + foreach ($tokenIds as $tokenId) { + $this->addStep('updateAttributes', $tokenId); + } + + return $this; + } + + /** + * String of messages from the batch + * + * Do not forget to reset() the batch if you're done with it after + * displaying the report. + * + * @param boolean $reset When true the batch is reset afterwards + * @return array + */ + public function getMessages($reset = false) + { + + $cAll = $this->count(); + $cTokens = $this->getCounter('changedTokens'); + + $messages = parent::getMessages($reset); + + array_unshift($messages, sprintf($this->translate->_('Checked %d token.'), $cAll)); + if ($cTokens == 0) { + $messages[] = $this->translate->_('No attributes were updated.'); + } else { + $messages[] = sprintf($this->translate->plural('%d token changed.', '%d tokens changed.', $cTokens), $cTokens); + } + + return $messages; + } + + /** + * Update the attributes of a token, if the token is + * already in the source. + * + * @param string $tokenId A token id + */ + protected function updateAttributes($tokenId) + { + $token = $this->tracker->getToken($tokenId); + + if ($token->inSource()) { + $survey = $token->getSurvey(); + if ($survey->copyTokenToSource($token, '')) { + $this->addToCounter('changedTokens'); + } + } + } +} Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m91Database.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m91Database.php 2012-02-16 15:22:35 UTC (rev 497) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m91Database.php 2012-02-16 17:15:30 UTC (rev 498) @@ -1,4 +1,5 @@ <?php + /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -54,4 +55,38 @@ */ protected $_anonymizedField = 'anonymized'; + /** + * Returns a list of field names that should be set in a newly inserted token. + * + * Added the usesleft value. + * + * @param Gems_Tracker_Token $token + * @return array Of fieldname => value type + */ + protected function _fillAttributeMap(Gems_Tracker_Token $token) + { + $values = parent::_fillAttributeMap($token); + + // Not really an attribute, but it is the best place to set this + $values['usesleft'] = $token->isCompleted() ? 0 : 1; + + return $values; + } + + /** + * Check a token table for any changes needed by this version. + * + * @param array $tokenTable + * @return array Fieldname => change field commands + */ + protected function _checkTokenTable(array $tokenTable) + { + $missingFields = parent::_checkTokenTable($tokenTable); + + if (! isset($tokenTable['usesleft'])) { + $missingFields['usesleft'] = "ADD `usesleft` INT( 11 ) NULL DEFAULT '1' AFTER `completed`"; + } + + return $missingFields; + } } \ No newline at end of file Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-02-16 15:22:35 UTC (rev 497) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-02-16 17:15:30 UTC (rev 498) @@ -48,8 +48,9 @@ { const CACHE_TOKEN_INFO = 'tokenInfo'; - const LS_DB_DATE_FORMAT = 'yyyy-MM-dd'; - const LS_DB_DATETIME_FORMAT = 'yyyy-MM-dd HH:mm:ss'; + const LS_DB_COMPLETION_FORMAT = 'yyyy-MM-dd HH:mm'; + const LS_DB_DATE_FORMAT = 'yyyy-MM-dd'; + const LS_DB_DATETIME_FORMAT = 'yyyy-MM-dd HH:mm:ss'; const QUESTIONS_TABLE = 'questions'; const SURVEY_TABLE = 'survey_'; @@ -119,9 +120,41 @@ protected $util; /** + * Check a token table for any changes needed by this version. + * + * @param array $tokenTable + * @return array Fieldname => change field commands + */ + protected function _checkTokenTable(array $tokenTable) + { + $missingFields = array(); + + $lengths = array(); + if (preg_match('/\(([^\)]+)\)/', $tokenTable['token']['Type'], $lengths)) { + $tokenLength = $lengths[1]; + } else { + $tokenLength = 0; + } + $token_library = $this->tracker->getTokenLibrary(); + if ($tokenLength < $token_library->getLength()) { + $tokenLength = $token_library->getLength(); + $missingFields['token'] = "CHANGE COLUMN `token` `token` varchar($tokenLength) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' NULL"; + } + + foreach ($this->_attributeMap as $name => $field) { + if (! isset($tokenTable[$field])) { + $missingFields[$field] = "ADD $field varchar(255) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'"; + } + } + + return $missingFields; + } + + /** * Returns a list of field names that should be set in a newly inserted token. * * @param Gems_Tracker_Token $token + * @return array Of fieldname => value type */ protected function _fillAttributeMap(Gems_Tracker_Token $token) { @@ -377,7 +410,7 @@ $messages[] = sprintf($this->translate->_('The \'%s\' survey is no longer active. The survey was removed from LimeSurvey!'), $survey->getName()); } } else { - $lsDb = $this->getSourceDatabase(); + $lsDb = $this->getSourceDatabase(); // SELECT sid, surveyls_title AS short_title, surveyls_description AS description, active, datestamp, ' . $this->_anonymizedField . ' $select = $lsDb->select(); @@ -401,7 +434,7 @@ break; default: // This is for the case that $this->_anonymizedField is empty, we show an update statement. - // The answers already in the table can only be linked to the repsonse based on the completion time + // The answers already in the table can only be linked to the response based on the completion time // this requires a manual action as token table only hold minuts while survey table holds seconds // and we might have responses with the same timestamp. $lsDb->query("UPDATE " . $this->_getSurveysTableName() . " SET `" . $this->_anonymizedField . "` = 'N' WHERE sid = ?;", $sourceSurveyId); @@ -425,34 +458,21 @@ } if ($tokenTable) { - $lengths = array(); - if (preg_match('/\(([^\)]+)\)/', $tokenTable['token']['Type'], $lengths)) { - $tokenLength = $lengths[1]; - } else { - $tokenLength = 0; - } - $token_library = $this->tracker->getTokenLibrary(); - if ($tokenLength < $token_library->getLength()) { - $surveyor_status .= 'Token field length is too short. '; - } + $missingFields = $this->_checkTokenTable($tokenTable); - $missingFields = array(); - foreach ($this->_attributeMap as $name => $field) { - if (! isset($tokenTable[$field])) { - $missingFields[$field] = "ADD $field varchar(255) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'"; - } - } if ($missingFields) { - $sql = "ALTER TABLE " . $this->_getTokenTableName($sourceSurveyId) . " " . implode(', ', $missingFields); + $sql = "ALTER TABLE " . $this->_getTokenTableName($sourceSurveyId) . " " . implode(', ', $missingFields); + $fields = implode($this->translate->_(', '), array_keys($missingFields)); + // MUtil_Echo::track($missingFields, $sql); try { $lsDb->query($sql); - $messages[] = sprintf($this->translate->_("Added attribute fields to token table for '%s'"), $surveyor_title); + $messages[] = sprintf($this->translate->_("Added to token table '%s' the field(s): %s"), $surveyor_title, $fields); } catch (Zend_Exception $e) { $surveyor_status .= 'Token attributes could not be created. '; $surveyor_status .= $e->getMessage() . ' '; $messages[] = sprintf($this->translate->_("Attribute fields not created for token table for '%s'"), $surveyor_title); - $messages[] = sprintf($this->translate->_('Required fields: %s', implode($this->translate->_(', '), array_keys($missingFields)))); + $messages[] = sprintf($this->translate->_('Required fields: %s', $fields)); $messages[] = $e->getMessage(); // Maximum reporting for this case @@ -587,7 +607,12 @@ // Get the mapped values $values = $this->_fillAttributeMap($token); - $values['completed'] = 'N'; // Apparently it is possible to have this value filled without a survey questionnaire. + // Apparently it is possible to have this value filled without a survey questionnaire. + if ($token->isCompleted()) { + $values['completed'] = $token->getCompletionTime()->toString(self::LS_DB_COMPLETION_FORMAT); + } else { + $values['completed'] = 'N'; + } $result = 0; if ($oldValues = $lsDb->fetchRow("SELECT * FROM $lsTokens WHERE token = ? LIMIT 1", $tokenId)) { @@ -974,7 +999,7 @@ $result = $token->cacheGet(self::CACHE_TOKEN_INFO); } - if ($fields !== null) $result = array_intersect_key((array) $result, array_flip ($fields)); + if ($fields !== null) $result = array_intersect_key((array) $result, array_flip($fields)); return $result; } Modified: trunk/library/classes/Gems/Tracker/TrackerInterface.php =================================================================== --- trunk/library/classes/Gems/Tracker/TrackerInterface.php 2012-02-16 15:22:35 UTC (rev 497) +++ trunk/library/classes/Gems/Tracker/TrackerInterface.php 2012-02-16 17:15:30 UTC (rev 498) @@ -301,4 +301,13 @@ * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes */ public function recalculateTokensBatch($batch_id, $userId = null, $cond = null); + + /** + * Refreshes the tokens in the source + * + * @param string $batch_id A unique identifier for the current batch + * @param string $cond An optional where statement + * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes + */ + public function refreshTokenAttributesBatch($batch_id, $cond = null); } Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2012-02-16 15:22:35 UTC (rev 497) +++ trunk/library/classes/Gems/Tracker.php 2012-02-16 17:15:30 UTC (rev 498) @@ -887,6 +887,7 @@ return $batch; } + /** * Recalculates all token dates, timing and results * and outputs text messages. @@ -916,4 +917,37 @@ self::$verbose = true; return $this->processTokensBatch($batch_id, $tokenSelect, $userId); } + + /** + * Refreshes the tokens in the source + * + * @param string $batch_id A unique identifier for the current batch + * @param string $cond An optional where statement + * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes + */ + public function refreshTokenAttributesBatch($batch_id, $cond = null) + { + $batch = $this->_loadClass('Batch_RefreshTokenAttributesBatch', true, array($batch_id)); + + if (! $batch->isLoaded()) { + $tokenSelect = $this->getTokenSelect(array('gto_id_token')); + $tokenSelect->andSurveys(array()) + ->forWhere('gsu_surveyor_active = 1') + ->forWhere('gto_in_source = 1'); + + if ($cond) { + // Add all connections for filtering, but select only surveys that are active in the source + $tokenSelect->andReceptionCodes(array()) + ->andRespondents(array()) + ->andRespondentOrganizations(array()) + ->andConsents(array()) + ->forWhere($cond); + } + + $batch->addTokens($this->db->fetchCol($tokenSelect->getSelect())); + } + self::$verbose = true; + + return $batch; + } } Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2012-02-16 15:22:35 UTC (rev 497) +++ trunk/library/configs/db/patches.sql 2012-02-16 17:15:30 UTC (rev 498) @@ -375,3 +375,7 @@ -- PATCH: Add track completion event ALTER TABLE `gems__tracks` ADD gtr_completed_event varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' AFTER gtr_track_class; + +-- GEMS VERSION: 45 +-- PATCH: Assign attribute sync to super role +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.source.check-attributes') WHERE grl_name = 'super' AND grl_privileges NOT LIKE '%pr.source.check-attributes%'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-01 16:05:40
|
Revision: 531 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=531&view=rev Author: matijsdejong Date: 2012-03-01 16:05:31 +0000 (Thu, 01 Mar 2012) Log Message: ----------- Second round in simplifying ModelSnippetActionAbstract Modified Paths: -------------- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php Added Paths: ----------- trunk/library/snippets/Generic/CurrentButtonRowSnippet.php Removed Paths: ------------- trunk/library/snippets/Generic/CurrentButtonRow.php Modified: trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php =================================================================== --- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-03-01 15:35:00 UTC (rev 530) +++ trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-03-01 16:05:31 UTC (rev 531) @@ -104,7 +104,7 @@ * * @var mixed String or array of snippets name */ - protected $indexStopSnippets = 'Generic_CurrentButtonRow'; + protected $indexStopSnippets = 'Generic_CurrentButtonRowSnippet'; /** * The snippets used for the show action Deleted: trunk/library/snippets/Generic/CurrentButtonRow.php =================================================================== --- trunk/library/snippets/Generic/CurrentButtonRow.php 2012-03-01 15:35:00 UTC (rev 530) +++ trunk/library/snippets/Generic/CurrentButtonRow.php 2012-03-01 16:05:31 UTC (rev 531) @@ -1,85 +0,0 @@ -<?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. - * - * Short description of file - * - * @package Gems - * @subpackage Snippets\Generic - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ - */ - -/** - * Short description for class - * - * Long description for class (if any)... - * - * @package Gems - * @subpackage Snippets\Generic - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.4.2 - */ -class Generic_CurrentButtonRow extends MUtil_Snippets_SnippetAbstract -{ - /** - * Required - * - * @var Gems_Menu - */ - protected $menu; - - /** - * Required - * - * @var Zend_Controller_Request_Abstract - */ - protected $request; - - /** - * Create the snippets content - * - * This is a stub function either override getHtmlOutput() or override render() - * - * @param Zend_View_Abstract $view Just in case it is needed here - * @return MUtil_Html_HtmlInterface Something that can be rendered - */ - public function getHtmlOutput(Zend_View_Abstract $view) - { - $menuList = $this->menu->getMenuList(); - - $menuList->addParameterSources($this->request) - ->addCurrentParent($this->_('Cancel')) - ->addCurrentChildren(); - - return $menuList; - } - -} Added: trunk/library/snippets/Generic/CurrentButtonRowSnippet.php =================================================================== --- trunk/library/snippets/Generic/CurrentButtonRowSnippet.php (rev 0) +++ trunk/library/snippets/Generic/CurrentButtonRowSnippet.php 2012-03-01 16:05:31 UTC (rev 531) @@ -0,0 +1,83 @@ +<?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. + * + * + * @package Gems + * @subpackage Snippets\Generic + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * Displays the parent menu item (if existing) plus any current + * level buttons that are visible + * + * @package Gems + * @subpackage Snippets\Generic + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4.2 + */ +class Generic_CurrentButtonRowSnippet extends MUtil_Snippets_SnippetAbstract +{ + /** + * Required + * + * @var Gems_Menu + */ + protected $menu; + + /** + * Required + * + * @var Zend_Controller_Request_Abstract + */ + protected $request; + + /** + * Create the snippets content + * + * This is a stub function either override getHtmlOutput() or override render() + * + * @param Zend_View_Abstract $view Just in case it is needed here + * @return MUtil_Html_HtmlInterface Something that can be rendered + */ + public function getHtmlOutput(Zend_View_Abstract $view) + { + $menuList = $this->menu->getMenuList(); + + $menuList->addParameterSources($this->request) + ->addCurrentParent($this->_('Cancel')) + ->addCurrentChildren(); + + return $menuList; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |