You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
(70) |
Nov
(164) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(52) |
Feb
(77) |
Mar
(70) |
Apr
(58) |
May
(81) |
Jun
(74) |
Jul
(87) |
Aug
(30) |
Sep
(45) |
Oct
(37) |
Nov
(51) |
Dec
(31) |
2013 |
Jan
(47) |
Feb
(29) |
Mar
(40) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gem...@li...> - 2012-03-19 18:34:52
|
Revision: 555 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=555&view=rev Author: matijsdejong Date: 2012-03-19 18:34:45 +0000 (Mon, 19 Mar 2012) Log Message: ----------- Moving login form from IndexAction.php Moving away from array values in authenticate simplified layoutSwitch Modified Paths: -------------- trunk/library/classes/Gems/Auth/Adapter/Callback.php trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Form.php trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php trunk/library/classes/Gems/User/DbUserDefinitionAbstract.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/RadiusUserDefinition.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/User/UserDefinitionInterface.php trunk/library/classes/Gems/User/UserLoader.php trunk/library/classes/Gems/Util/DbLookup.php trunk/library/classes/GemsEscort.php Added Paths: ----------- trunk/library/classes/Gems/User/Form/ trunk/library/classes/Gems/User/Form/LoginForm.php Modified: trunk/library/classes/Gems/Auth/Adapter/Callback.php =================================================================== --- trunk/library/classes/Gems/Auth/Adapter/Callback.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/Auth/Adapter/Callback.php 2012-03-19 18:34:45 UTC (rev 555) @@ -75,7 +75,7 @@ * @param string $identity The identity to use * @param array $params Array of parameters needed for the callback */ - public function __construct($callback, $identity, $params) + public function __construct($callback, $identity, $params = array()) { $this->_callback = $callback; $this->_identity = $identity; Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/Default/IndexAction.php 2012-03-19 18:34:45 UTC (rev 555) @@ -139,22 +139,39 @@ /** * 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 + * @param boolean $showToken Optional, show 'Ask token' button, $this->showTokenButton is used when not specified + * @param boolean $showPasswordLost Optional, show 'Lost password' button, $this->showPasswordLostButton is used when not specified * @return Gems_Form */ - protected function _getLoginForm($showTokenButton = null, $showPasswordLostButton = null) + protected function _getLoginForm($showToken = null, $showPasswordLost = null) { - $form = $this->_getBasicForm($this->_('Login to %s application')); + $args = MUtil_Ra::args(func_get_args(), + array( + 'showToken' => 'is_boolean', + 'showPasswordLost' => 'is_boolean', + 'description' => 'is_string', + ), + array( + 'showToken' => $this->showTokenButton, + 'showPasswordLost' => $this->showPasswordLostButton, + 'description' => $this->_('Login to %s application'), + 'labelWidthFactor' => $this->labelWidthFactor, + )); + + Gems_Html::init(); + + return $this->loader->getUserLoader()->getLoginForm($args); + + $form = $this->_getBasicForm(); $form->addElement($this->_getOrganizationElement()); $form->addElement($this->_getUserLoginElement()); $form->addElement($this->_getPasswordElement()); $form->addElement($this->_getSubmitButton($this->_('Login'))); - if (null === $showTokenButton ? $this->showTokenButton : $showTokenButton) { + if (null === $showToken ? $this->showTokenButton : $showToken) { $form->addElement($this->_getAskTokenLinkElement()); } - if (null === $showPasswordLostButton ? $this->showPasswordLostButton : $showPasswordLostButton) { + if (null === $showPasswordLost ? $this->showPasswordLostButton : $showPasswordLost) { $form->addElement($this->_getResetLinkElement()); } @@ -309,30 +326,6 @@ { $request = $this->getRequest(); - /** - * @@TODO: Start block to move to Gems_User_User->getCurrentOrganizationId() - * - * At that place the cookie is read, but this could be changed to use url like here - * or maybe referrer, ip-range, get-param etc. - */ - // Allow layout switching based on request base url - if ($this->escort instanceof Gems_Project_Layout_MultiLayoutInterface) { - $hostUrl = $this->escort->loader->getUtil()->getCurrentURI(); - - // MUtil_Echo::track($hostUrl); - - $organizationId = $this->util->getDbLookup()->getOrganizationForUrl($hostUrl); - - if ($organizationId) { - $user = $this->escort->getLoader()->getUserLoader()->getCurrentUser(); - $user->setCurrentOrganization($organizationId); - $this->escort->layoutSwitch($request); - } - } - /** - * End block to move to Gems_User_User->getCurrentOrganizationId() - */ - $form = $this->_getLoginForm(); if ($request->isPost()) { @@ -360,7 +353,7 @@ } // */ /** - * Fix current locale / organization in cookies + * Fix current locale in cookies */ Gems_Cookies::setLocale($user->getLocale(), $this->basepath->getBasePath()); Modified: trunk/library/classes/Gems/Form.php =================================================================== --- trunk/library/classes/Gems/Form.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/Form.php 2012-03-19 18:34:45 UTC (rev 555) @@ -40,7 +40,7 @@ * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License */ -class Gems_Form extends MUtil_Form +class Gems_Form extends MUtil_Form implements MUtil_Registry_TargetInterface { /** * This variable holds all the stylesheets attached to this form @@ -116,15 +116,75 @@ $this->_css[$file] = $media; } - public function getCss() { + /** + * 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) + { + if (MUtil_Registry_Source::$verbose) { + MUtil_Echo::r('Resource set: ' . get_class($this) . '->' . __FUNCTION__ . + '("' . $name . '", ' . + (is_object($resource) ? get_class($resource) : gettype($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 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 getCss() + { return $this->_css; } - public function getAutoSubmit() { + public function getAutoSubmit() + { return $this->_autosubmit; } /** + * 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() + { + // MUtil_Echo::track(array_filter(array_keys(get_object_vars($this)), array($this, 'filterRequestNames'))); + return array_filter(array_keys(get_object_vars($this)), array($this, 'filterRequestNames')); + } + + /** * Is this a form that autosubmits? * * @return boolean Modified: trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php 2012-03-19 18:34:45 UTC (rev 555) @@ -62,7 +62,7 @@ /** * Performs the actual switch of the layout * - * @param Zend_Controller_Request_Abstract $request + * @param string $style Style, when null derived from request */ - public function layoutSwitch(Zend_Controller_Request_Abstract $request); + public function layoutSwitch($style = null); } \ No newline at end of file Modified: trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php =================================================================== --- trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-03-19 18:34:45 UTC (rev 555) @@ -120,18 +120,26 @@ return false; } - public function getAuthAdapter($formValues) + /** + * Returns an initialized Zend_Auth_Adapter_Interface + * + * @param string $username + * @param int $organizationId + * @param string $password + * @return Zend_Auth_Adapter_Interface + */ + public function getAuthAdapter($username, $organizationId, $password) { $adapter = new Zend_Auth_Adapter_DbTable($this->db, 'gems__user_passwords', 'gul_login', 'gup_password'); - $pwd_hash = $this->hashPassword($formValues['password']); + $pwd_hash = $this->hashPassword($password); $select = $adapter->getDbSelect(); $select->join('gems__user_logins', 'gup_id_user = gul_id_user', array()) ->where('gul_can_login = 1') - ->where('gul_id_organization = ?', $formValues['organization']); + ->where('gul_id_organization = ?', $organizationId); - $adapter->setIdentity($formValues['userlogin']) + $adapter->setIdentity($username) ->setCredential($pwd_hash); return $adapter; @@ -185,7 +193,7 @@ $result = array( 'user_active' => false, 'user_role' => 'nologin', - ); + ); } return $result; Property changes on: trunk/library/classes/Gems/User/Form ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:logregex + #(\d+) Added: trunk/library/classes/Gems/User/Form/LoginForm.php =================================================================== --- trunk/library/classes/Gems/User/Form/LoginForm.php (rev 0) +++ trunk/library/classes/Gems/User/Form/LoginForm.php 2012-03-19 18:34:45 UTC (rev 555) @@ -0,0 +1,460 @@ +<?php + +/** + * Copyright (c) 2012, 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) 2012 Erasmus MC + * @license New BSD License + * @version $id: LoginForm.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_User_Form_LoginForm extends Gems_Form +{ + /** + * The field name for the lost password element. + * + * @var string + */ + protected $_lostPasswordFieldName = 'lost_password'; + + /** + * The field name for the organization element. + * + * @var string + */ + protected $_organizationFieldName = 'organization'; + + + /** + * When true the organization was derived from the the url + * + * @var boolean + */ + protected $_organizationFromUrl = false; + + /** + * The field name for the password element. + * + * @var string + */ + protected $_passwordFieldName = 'password'; + + /** + * The field name for the submit element. + * + * @var string + */ + protected $_submitFieldName = 'button'; + + /** + * The field name for the token element. + * + * @var string + */ + protected $_tokenFieldName = 'token_link'; + + /** + * The field name for the username element. + * + * @var string + */ + protected $_usernameFieldName = 'userlogin'; + + /** + * When true all elements are loaded after initiation. + * + * @var boolean + */ + protected $loadDefault = true; + + /** + * + * @var Gems_Loader + */ + protected $loader; + + /** + * For small numbers of organizations a multiline selectbox will be nice. This + * setting handles how many lines will display at once. Use 1 for the normal + * dropdown selectbox + * + * @var int + */ + protected $organizationMaxLines = 6; + + /** + * + * @var Zend_Controller_Request_Abstract + */ + protected $request; + + /** + * The default behaviour for showing a lost password button + * + * @var boolean + */ + protected $showPasswordLost = true; + + /** + * The default behaviour for showing an 'ask token' button + * + * @var boolean + */ + protected $showToken = true; + + /** + * + * @var Zend_Translate + */ + protected $translate; + + /** + * + * @var Zend_Util + */ + protected $util; + + /** + * 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() + { + if ($this->loadDefault) { + $this->loadDefaultElements(); + } + + return true; + } + + /** + * Returns the organization id that should currently be used for this form. + * + * @return int Returns the current organization id, if any + */ + public function getCurrentOrganizationId() + { + // Url determines organization first. + $uri = $this->util->getCurrentURI(); + // MUtil_Echo::track($uri); + + if ($orgId = $this->util->getDbLookup()->getOrganizationForUrl($uri)) { + $this->_organizationFromUrl = true; + $this->loader->getCurrentUser()->setCurrentOrganization($orgId); + return $orgId; + } + + $request = $this->getRequest(); + if ($request->isPost() && ($orgId = $request->getParam($this->_organizationFieldName))) { + return $orgId; + } + + return $this->loader->getCurrentUser()->getCurrentOrganizationId(); + } + + /** + * Returns a list with the organizations the user can select for login. + * + * @return array orgId => Name + */ + public function getLoginOrganizations() + { + return $this->util->getDbLookup()->getOrganizationsForLogin(); + } + + /** + * Returns/sets a link to the reset password page + * + * @return MUtil_Form_Element_Html + */ + public function getLostPasswordElement() + { + $element = $this->getElement($this->_lostPasswordFieldName); + + if (! $element) { + // Reset password + $element = new MUtil_Form_Element_Html($this->_lostPasswordFieldName); + // $element->br(); + $element->a(array('controller' => 'index', 'action' => 'resetpassword'), $this->translate->_('Lost password'), array('class' => 'actionlink')); + + $this->addElement($element); + } + + return $element; + } + + /** + * Returns/sets an element for determining / selecting the organization. + * + * @return Zend_Form_Element_Xhtml + */ + public function getOrganizationElement() + { + $element = $this->getElement($this->_organizationFieldName); + $orgId = $this->getCurrentOrganizationId(); + $orgs = $this->getLoginOrganizations(); + $hidden = $this->_organizationFromUrl || (count($orgs) < 2); + + if ($hidden) { + if (! $element instanceof Zend_Form_Element_Hidden) { + $element = new Zend_Form_Element_Hidden($this->_organizationFieldName); + + $this->addElement($element); + } + + if (! $this->_organizationFromUrl) { + $orgIds = array_keys($orgs); + $orgId = reset($orgIds); + } + + } elseif (! $element instanceof Zend_Form_Element_Select) { + $element = new Zend_Form_Element_Select($this->_organizationFieldName); + $element->setLabel($this->translate->_('Organization')); + $element->setRequired(true); + $element->setMultiOptions($orgs); + + if ($this->organizationMaxLines > 1) { + $element->setAttrib('size', max(count($orgs) + 1, $this->organizationMaxLines)); + } + $this->addElement($element); + + } + $element->setValue($orgId); + + return $element; + } + + /** + * Returns/sets a password element. + * + * @return Zend_Form_Element_Password + */ + public function getPasswordElement() + { + $element = $this->getElement($this->_passwordFieldName); + + if (! $element) { + // Veld password + $element = new Zend_Form_Element_Password($this->_passwordFieldName); + $element->setLabel($this->translate->_('Password')); + $element->setAttrib('size', 10); + $element->setAttrib('maxlength', 20); + $element->setRequired(true); + + $this->addElement($element); + } + + return $element; + } + + /** + * Return the Request object + * + * @return Zend_Controller_Request_Abstract + */ + public function getRequest() + { + if (! $this->request) { + $this->request = Zend_Controller_Front::getInstance()->getRequest(); + } + return $this->request; + } + + /** + * Returns/sets a submit button. + * + * @param string $label + * @return Zend_Form_Element_Submit + */ + public function getSubmitButton($label = null) + { + $element = $this->getElement($this->_submitFieldName); + + if (! $element) { + // Submit knop + $element = new Zend_Form_Element_Submit($this->_submitFieldName); + $element->setLabel(null === $label ? $this->translate->_('Login') : $label); + $element->setAttrib('class', 'button'); + + $this->addElement($element); + } + + return $element; + } + + /** + * Returns/sets a link for the token input page. + * + * @return MUtil_Form_Element_Html + */ + public function getTokenElement() + { + $element = $this->getElement($this->_tokenFieldName); + + if (! $element) { + // Veld token + $element = new MUtil_Form_Element_Html($this->_tokenFieldName); + // $element->br(); + $element->a(array('controller' => 'ask', 'action' => 'token'), $this->translate->_('Enter your token...'), array('class' => 'actionlink')); + + $this->addElement($element); + } + + return $element; + } + + /** + * Returns/sets a login name element. + * + * @return Zend_Form_Element_Text + */ + public function getUserNameElement() + { + $element = $this->getElement($this->_usernameFieldName); + + if (! $element) { + // Veld inlognaam + $element = new Zend_Form_Element_Text($this->_usernameFieldName); + $element->setLabel($this->translate->_('Username')); + $element->setAttrib('size', 10); + $element->setAttrib('maxlength', 20); + $element->setRequired(true); + + $this->addElement($element); + } + + return $element; + } + + /** + * The function that determines the element load order + * + * @return Gems_User_Form_LoginForm (continuation pattern) + */ + public function loadDefaultElements() + { + $this->getOrganizationElement(); + $this->getUserNameElement(); + $this->getPasswordElement(); + $this->getSubmitButton(); + + if ($this->showPasswordLost) { + $this->getLostPasswordElement(); + } + if ($this->showToken) { + $this->getTokenElement(); + } + + return $this; + } + + /** + * When true all elements are loaded after initiation. + * + * Enables loading of parameter through Zend_Form::__construct() + * + * @param boolean $loadDefault + * @return Gems_User_Form_LoginForm (continuation pattern) + */ + public function setLoadDefault($loadDefault = true) + { + $this->loadDefault = $loadDefault; + + return $this; + } + + /** + * For small numbers of organizations a multiline selectbox will be nice. This + * setting handles how many lines will display at once. Use 1 for the normal + * dropdown selectbox + * + * Enables loading of parameter through Zend_Form::__construct() + * + * @param int $organizationMaxLines + * @return Gems_User_Form_LoginForm (continuation pattern) + */ + public function setOrganizationMaxLines($organizationMaxLines) + { + $this->organizationMaxLines = $organizationMaxLines; + + return $this; + } + + /** + * The behaviour for showing a lost password button + * + * Enables loading of parameter through Zend_Form::__construct() + * + * @param boolean $showPasswordLost + * @return Gems_User_Form_LoginForm (continuation pattern) + */ + public function setShowPasswordLost($showPasswordLost = true) + { + $this->showPasswordLost = $showPasswordLost; + + return $this; + } + + /** + * The default behaviour for showing an 'ask token' button + * + * Enables loading of parameter through Zend_Form::__construct() + * + * @param boolean $showToken + * @return Gems_User_Form_LoginForm (continuation pattern) + */ + public function setShowToken($showToken = true) + { + $this->showToken = $showToken; + + return $this; + } + + /** + * True when this form was submitted. + * + * @return boolean + */ + public function wasSubmitted() + { + return $this->getSubmitButton()->isChecked(); + } +} Modified: trunk/library/classes/Gems/User/NoLoginDefinition.php =================================================================== --- trunk/library/classes/Gems/User/NoLoginDefinition.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/User/NoLoginDefinition.php 2012-03-19 18:34:45 UTC (rev 555) @@ -46,14 +46,27 @@ */ class Gems_User_NoLoginDefinition extends Gems_User_UserDefinitionAbstract { - public function alwaysFalse($params) + /** + * Helper method for the case a user tries to authenticate while he is inactive + * + * @return boolean + */ + public function alwaysFalse() { return false; } - public function getAuthAdapter($formValues) + /** + * Returns an initialized Zend_Auth_Adapter_Interface + * + * @param string $username + * @param int $organizationId + * @param string $password + * @return Zend_Auth_Adapter_Interface + */ + public function getAuthAdapter($username, $organizationId, $password) { - $adapter = new Gems_Auth_Adapter_Callback(array($this,'alwaysFalse'), $formValues['userlogin'], $formValues); + $adapter = new Gems_Auth_Adapter_Callback(array($this,'alwaysFalse'), $username); return $adapter; } Modified: trunk/library/classes/Gems/User/OldStaffUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2012-03-19 18:34:45 UTC (rev 555) @@ -119,17 +119,25 @@ } } - public function getAuthAdapter($formValues) + /** + * Returns an initialized Zend_Auth_Adapter_Interface + * + * @param string $username + * @param int $organizationId + * @param string $password + * @return Zend_Auth_Adapter_Interface + */ + public function getAuthAdapter($username, $organizationId, $password) { $adapter = new Zend_Auth_Adapter_DbTable(null, 'gems__staff', 'gsf_login', 'gsf_password'); - $pwd_hash = $this->hashPassword($formValues['password']); + $pwd_hash = $this->hashPassword($password); $select = $adapter->getDbSelect(); $select->where('gsf_active = 1') - ->where('gsf_id_organization = ?', $formValues['organization']); + ->where('gsf_id_organization = ?', $organizationId); - $adapter->setIdentity($formValues['userlogin']) + $adapter->setIdentity($username) ->setCredential($pwd_hash); return $adapter; Modified: trunk/library/classes/Gems/User/ProjectUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/ProjectUserDefinition.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/User/ProjectUserDefinition.php 2012-03-19 18:34:45 UTC (rev 555) @@ -52,9 +52,17 @@ */ protected $project; - public function getAuthAdapter($formValues) + /** + * Returns an initialized Zend_Auth_Adapter_Interface + * + * @param string $username + * @param int $organizationId + * @param string $password + * @return Zend_Auth_Adapter_Interface + */ + public function getAuthAdapter($username, $organizationId, $password) { - $adapter = new Gems_Auth_Adapter_Callback(array($this->project,'checkSuperAdminPassword'), $formValues['userlogin'], array($formValues['password'])); + $adapter = new Gems_Auth_Adapter_Callback(array($this->project,'checkSuperAdminPassword'), $username, array($password)); return $adapter; } Modified: trunk/library/classes/Gems/User/RadiusUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-03-19 18:34:45 UTC (rev 555) @@ -2,7 +2,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 @@ -13,7 +13,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 @@ -24,7 +24,7 @@ * 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 * @copyright Copyright (c) 2011 Erasmus MC @@ -128,17 +128,20 @@ /** * Returns an initialized Zend_Auth_Adapter_Interface * + * @param string $username + * @param int $organizationId + * @param string $password * @return Zend_Auth_Adapter_Interface */ - public function getAuthAdapter($formValues) + public function getAuthAdapter($username, $organizationId, $password) { //Ok hardcoded for now this needs to be read from the userdefinition - $configData = $this->loadConfig(array('gor_id_organization' => $formValues['organization'])); + $configData = $this->loadConfig(array('gor_id_organization' => $organizationId)); $config = array('ip' => $configData['grcfg_ip'], 'authenticationport' => $configData['grcfg_port'], 'sharedsecret' => $configData['grcfg_secret']); - + //Unset empty foreach($config as $key=>$value) { if (empty($value)) { @@ -147,8 +150,8 @@ } $adapter = new Gems_User_Adapter_Radius($config); - $adapter->setIdentity($formValues['userlogin']) - ->setCredential($formValues['password']); + $adapter->setIdentity($username) + ->setCredential($password); return $adapter; } @@ -243,7 +246,7 @@ * * For now these will be added in the organization dialog as most of the time the config * will be organization specific. To be extended when needed - * + * * @return boolean */ public function hasConfig() @@ -274,7 +277,7 @@ public function loadConfig($data) { $model = $this->getConfigModel(); - + $newData = $model->loadFirst(array('grcfg_id_organization'=>$data['gor_id_organization'])); $newData['grcfg_id_organization'] = $data['gor_id_organization']; Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/User/User.php 2012-03-19 18:34:45 UTC (rev 555) @@ -87,6 +87,12 @@ protected $definition; /** + * + * @var Zend_Controller_Request_Abstract + */ + protected $request; + + /** * Required * * @var Zend_Session_Namespace @@ -230,10 +236,9 @@ /** * Helper method for the case a user tries to authenticate while he is inactive * - * @param array $params * @return boolean */ - public function alwaysFalse($params) + public function alwaysFalse() { return false; } @@ -252,9 +257,9 @@ $formValues['organization'] = $this->getBaseOrganizationId(); if ($this->isActive()) { - $adapter = $this->definition->getAuthAdapter($formValues); + $adapter = $this->definition->getAuthAdapter($formValues['userlogin'], $formValues['organization'], $formValues['password']); } else { - $adapter = new Gems_Auth_Adapter_Callback(array($this,'alwaysFalse'), $formValues['userlogin'], $formValues); + $adapter = new Gems_Auth_Adapter_Callback(array($this,'alwaysFalse'), $formValues['userlogin']); } $authResult = $auth->authenticate($adapter, $formValues); @@ -397,8 +402,8 @@ $orgId = $this->_getVar('user_organization_id'); //If not set, read it from the cookie - if ($this->isCurrentUser() && is_null($orgId)) { - $orgId = Gems_Cookies::getOrganization(Zend_Controller_Front::getInstance()->getRequest()); + if ($this->isCurrentUser() && (null === $orgId)) { + $orgId = Gems_Cookies::getOrganization($this->getRequest()); } return $orgId; } @@ -591,6 +596,19 @@ } /** + * Return the Request object + * + * @return Zend_Controller_Request_Abstract + */ + public function getRequest() + { + if (! $this->request) { + $this->request = Zend_Controller_Front::getInstance()->getRequest(); + } + return $this->request; + } + + /** * Returns the current user role. * * @return string @@ -871,6 +889,15 @@ // End depreciation warning if ($this->isCurrentUser()) { + if (! Gems_Cookies::setOrganization($organizationId, $this->basepath->getBasePath())) { + throw new Exception($this->translate->_('Cookies must be enabled for this site.')); + } + + $escort = GemsEscort::getInstance(); + if ($escort instanceof Gems_Project_Layout_MultiLayoutInterface) { + $escort->layoutSwitch($organization->getStyle()); + } + // Now update the requestcache to change the oldOrgId to the new orgId // Don't do it when the oldOrgId doesn't match if ($requestCache = $this->session->requestCache) { @@ -894,10 +921,6 @@ $this->session->requestCache = $requestCache; } } - - if (! Gems_Cookies::setOrganization($organizationId, $this->basepath->getBasePath())) { - throw new Exception($this->translate->_('Cookies must be enabled for this site.')); - } } } Modified: trunk/library/classes/Gems/User/UserDefinitionInterface.php =================================================================== --- trunk/library/classes/Gems/User/UserDefinitionInterface.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/User/UserDefinitionInterface.php 2012-03-19 18:34:45 UTC (rev 555) @@ -80,9 +80,12 @@ /** * Returns an initialized Zend_Auth_Adapter_Interface * + * @param string $username + * @param int $organizationId + * @param string $password * @return Zend_Auth_Adapter_Interface */ - public function getAuthAdapter($formValues); + public function getAuthAdapter($username, $organizationId, $password); /** * Return a password reset key Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/User/UserLoader.php 2012-03-19 18:34:45 UTC (rev 555) @@ -208,6 +208,25 @@ } /** + * Returns a login form + * + * @param mixed $args_array MUtil_Ra::args array for LoginForm initiation. + * @return Gems_User_Form_LoginForm + */ + public function getLoginForm($args_array) + { + $args = MUtil_Ra::args(func_get_args()); + + if (isset($args['description'])) { + $args['description'] = sprintf($args['description'], $this->project->getName()); + } + + $form = $this->_loadClass('Form_LoginForm', true, array($args)); + + return $form; + } + + /** * Returns an organization object, initiated from the database or from * self::$_noOrganization when the database does not yet exist. * Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/Gems/Util/DbLookup.php 2012-03-19 18:34:45 UTC (rev 555) @@ -250,6 +250,7 @@ $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'); } catch (Exception $e) { try { + // 1.4 fallback $organizations = $this->db->fetchPairs('SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active=1 ORDER BY gor_name'); } catch (Exception $e) { $organizations = array(); @@ -278,7 +279,7 @@ return $organizations; } - + /** * Returns the organization * @param string $url @@ -287,7 +288,8 @@ 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); + $url = trim($this->db->quote($url), "'"); + return $this->db->fetchOne("SELECT gor_id_organization FROM gems__organizations WHERE gor_active=1 AND CONCAT(' ', gor_url_base, ' ') LIKE '% $url %'"); } catch (Exception $e) { return null; } Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-03-16 15:26:05 UTC (rev 554) +++ trunk/library/classes/GemsEscort.php 2012-03-19 18:34:45 UTC (rev 555) @@ -1398,7 +1398,7 @@ public function prepareController() { if ($this instanceof Gems_Project_Layout_MultiLayoutInterface) { - $this->layoutSwitch($this->request); + $this->layoutSwitch(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-16 15:26:16
|
Revision: 554 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=554&view=rev Author: matijsdejong Date: 2012-03-16 15:26:05 +0000 (Fri, 16 Mar 2012) Log Message: ----------- Moved changePasswordForm to User class Modified Paths: -------------- trunk/library/classes/Gems/Default/OptionAction.php trunk/library/classes/Gems/User/User.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 Modified: trunk/library/classes/Gems/Default/OptionAction.php =================================================================== --- trunk/library/classes/Gems/Default/OptionAction.php 2012-03-16 12:32:50 UTC (rev 553) +++ trunk/library/classes/Gems/Default/OptionAction.php 2012-03-16 15:26:05 UTC (rev 554) @@ -73,11 +73,6 @@ */ public function changePasswordAction() { - /************* - * Make form * - *************/ - $form = $this->createForm(); - $user = $this->loader->getCurrentUser(); if (! $user->canSetPassword()) { @@ -85,67 +80,33 @@ return; } - if ($user->isPasswordResetRequired()) { - $this->menu->setVisible(false); + /************* + * Make form * + *************/ + $form = $user->getPasswordChangeForm(); - } 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_User_UserPasswordValidator($user, $this->translate)); - $form->addElement($element); - } - - // Field new password - $element = new Zend_Form_Element_Password('new_password'); - $element->setLabel($this->_('New password')); - $element->setAttrib('size', 10); - $element->setAttrib('maxlength', 20); - $element->setRequired(true); - $element->setRenderPassword(true); - $element->addValidator(new Gems_User_UserNewPasswordValidator($user)); - $element->addValidator(new MUtil_Validate_IsConfirmed('repeat_password', $this->_('Repeat password'))); - $form->addElement($element); - - // Field repeat password - $element = new Zend_Form_Element_Password('repeat_password'); - $element->setLabel($this->_('Repeat password')); - $element->setAttrib('size', 10); - $element->setAttrib('maxlength', 20); - $element->setRequired(true); - $element->setRenderPassword(true); - $element->addValidator(new MUtil_Validate_IsConfirmed('new_password', $this->_('New password'))); - $form->addElement($element); - // Show password info if ($info = $user->reportPasswordWeakness()) { - foreach ($info as &$line) { - $line .= ','; - } - $line[strlen($line) - 1] = '.'; - $element = new MUtil_Form_Element_Html('rules'); $element->setLabel($this->_('Password rules')); - $element->div($this->_('A password:'))->ul($info); - $form->addElement($element); - $element = new Zend_Form_Element_Submit('submit'); - $element->setAttrib('class', 'button'); - $element->setLabel($this->_('Save')); + if (1 == count($info)) { + $element->div(sprintf($this->_('A password %s.'), reset($info))); + } else { + foreach ($info as &$line) { + $line .= ','; + } + $line[strlen($line) - 1] = '.'; + + $element->div($this->_('A password:'))->ul($info); + } $form->addElement($element); } /**************** * Process form * ****************/ - if ($this->_request->isPost() && $form->isValid($_POST)) { + if ($this->_request->isPost() && $form->isValid($_POST, false)) { $user->setPassword($_POST['new_password']); $this->addMessage($this->_('New password is active.')); @@ -167,7 +128,9 @@ $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 (! $user->isPasswordResetRequired() && ($links = $this->createMenuLinks())) { + if ($user->isPasswordResetRequired()) { + $this->menu->setVisible(false); + } elseif ($links = $this->createMenuLinks()) { $table->tf(); // Add empty cell, no label $linksCell = $table->tf($links); } Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2012-03-16 12:32:50 UTC (rev 553) +++ trunk/library/classes/Gems/User/User.php 2012-03-16 15:26:05 UTC (rev 554) @@ -515,6 +515,72 @@ } /** + * Returns a form to change the possword for this user. + * + * @param boolean $askOld Ask for the old password, calculated when not set. + * @return Gems_Form + */ + public function getPasswordChangeForm($askOld = null) + { + if (! $this->canSetPassword()) { + return; + } + + if (null === $askOld) { + // By default only ask for the old password if the user just entered + // it but is required to change it. + $askOld = (! $this->isPasswordResetRequired()); + } + + $form = new Gems_Form(); + + // Never ask for the old password if it does not exist + // + // A password does not always exist, e.g. when using embedded login in Pulse + // or after creating a new user. + if ($askOld && $this->hasPassword()) { + // Field current password + $element = new Zend_Form_Element_Password('old_password'); + $element->setLabel($this->translate->_('Current password')); + $element->setAttrib('size', 10); + $element->setAttrib('maxlength', 20); + $element->setRenderPassword(true); + $element->setRequired(true); + $element->addValidator(new Gems_User_UserPasswordValidator($this, $this->translate)); + $form->addElement($element); + } + + // Field new password + $element = new Zend_Form_Element_Password('new_password'); + $element->setLabel($this->translate->_('New password')); + $element->setAttrib('size', 10); + $element->setAttrib('maxlength', 20); + $element->setRequired(true); + $element->setRenderPassword(true); + $element->addValidator(new Gems_User_UserNewPasswordValidator($this)); + $element->addValidator(new MUtil_Validate_IsConfirmed('repeat_password', $this->translate->_('Repeat password'))); + $form->addElement($element); + + // Field repeat password + $element = new Zend_Form_Element_Password('repeat_password'); + $element->setLabel($this->translate->_('Repeat password')); + $element->setAttrib('size', 10); + $element->setAttrib('maxlength', 20); + $element->setRequired(true); + $element->setRenderPassword(true); + $element->addValidator(new MUtil_Validate_IsConfirmed('new_password', $this->translate->_('New password'))); + $form->addElement($element); + + // Submit button + $element = new Zend_Form_Element_Submit('submit'); + $element->setAttrib('class', 'button'); + $element->setLabel($this->translate->_('Save')); + $form->addElement($element); + + return $form; + } + + /** * Return a password reset key * * @return string Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2012-03-16 12:32:50 UTC (rev 553) +++ trunk/library/languages/default-en.po 2012-03-16 15:26:05 UTC (rev 554) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-15 15:34+0100\n" +"POT-Creation-Date: 2012-03-16 16:16+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -1439,8 +1439,6 @@ msgstr "User 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:161 msgid "Repeat password" @@ -1478,52 +1476,56 @@ msgid "Email templates" msgstr "Email templates" -#: classes/Gems/Default/OptionAction.php:84 +#: classes/Gems/Default/OptionAction.php:79 msgid "You are not allowed to change your password." msgstr "You are not allowed to change your password." -#: classes/Gems/Default/OptionAction.php:96 -msgid "Current password" -msgstr "Current password" +#: classes/Gems/Default/OptionAction.php:91 +msgid "Password rules" +msgstr "Password rules" -#: classes/Gems/Default/OptionAction.php:107 -#: classes/Gems/Default/OptionAction.php:123 -msgid "New password" -msgstr "New password" +#: classes/Gems/Default/OptionAction.php:94 +#, php-format +msgid "A password %s." +msgstr "A password %s." -#: classes/Gems/Default/OptionAction.php:137 +#: classes/Gems/Default/OptionAction.php:101 +msgid "A password:" +msgstr "A password:" + +#: classes/Gems/Default/OptionAction.php:112 msgid "New password is active." msgstr "New password is active." -#: classes/Gems/Default/OptionAction.php:143 +#: classes/Gems/Default/OptionAction.php:118 msgid "Caps Lock seems to be on!" msgstr "Caps Lock seems to be on!" -#: classes/Gems/Default/OptionAction.php:181 +#: classes/Gems/Default/OptionAction.php:158 msgid "Login Name" msgstr "Login Name" -#: classes/Gems/Default/OptionAction.php:188 +#: classes/Gems/Default/OptionAction.php:165 #: classes/Gems/Default/OrganizationAction.php:129 #: classes/Gems/Default/RespondentAction.php:175 #: classes/Gems/Default/StaffAction.php:319 msgid "Language" msgstr "Language" -#: classes/Gems/Default/OptionAction.php:198 +#: classes/Gems/Default/OptionAction.php:175 #, php-format msgid "Options" msgstr "Options" -#: classes/Gems/Default/OptionAction.php:207 +#: classes/Gems/Default/OptionAction.php:184 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:227 +#: classes/Gems/Default/OptionAction.php:204 msgid "Date / time" msgstr "Date / time" -#: classes/Gems/Default/OptionAction.php:238 +#: classes/Gems/Default/OptionAction.php:215 msgid "Item" msgstr "Item" @@ -3560,53 +3562,75 @@ #: 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." +msgid "should contain at least one uppercase character" +msgid_plural "should contain at least %d uppercase characters" +msgstr[0] "should contain at least one uppercase character" +msgstr[1] "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." +msgid "should contain at least one lowercase character" +msgid_plural "should contain at least %d lowercase characters" +msgstr[0] "should contain at least one lowercase character" +msgstr[1] "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." +msgid "should be at least %d characters long" +msgstr "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." +msgid "should contain at least one non alphabetic character" +msgid_plural "should contain at least %d non alphabetic characters" +msgstr[0] "should contain at least one non alphabetic character" +msgstr[1] "should contain at least %d non alphabetic characters" -#: classes/Gems/User/PasswordChecker.php:165 +#: classes/Gems/User/PasswordChecker.php:148 +msgid "should not contain non alphabetic characters" +msgstr "should not contain non alphabetic characters" + +#: classes/Gems/User/PasswordChecker.php:167 #, 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." +msgid "should contain at least one non alphanumeric character" +msgid_plural "should contain at least %d non alphanumeric characters" +msgstr[0] "should contain at least one non alphanumeric character" +msgstr[1] "should contain at least %d non 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:170 +msgid "should not contain non alphanumeric characters" +msgstr "should not contain non alphanumeric characters" -#: classes/Gems/User/PasswordChecker.php:201 +#: classes/Gems/User/PasswordChecker.php:188 #, 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." +msgid "should not contain your login name \"%s\"" +msgstr "should not contain your login name \"%s\"" +#: classes/Gems/User/PasswordChecker.php:207 +#, php-format +msgid "should contain at least one number" +msgid_plural "should contain at least %d numbers" +msgstr[0] "should contain at least one number" +msgstr[1] "should contain at least %d numbers" + +#: classes/Gems/User/PasswordChecker.php:210 +msgid "may not contain numbers" +msgstr "may not contain numbers" + #: classes/Gems/User/RadiusUserDefinition.php:175 msgid "Shared secret" msgstr "Shared secret" -#: classes/Gems/User/User.php:833 +#: classes/Gems/User/User.php:538 +msgid "Current password" +msgstr "Current password" + +#: classes/Gems/User/User.php:549 +#: classes/Gems/User/User.php:565 +msgid "New password" +msgstr "New password" + +#: classes/Gems/User/User.php:893 msgid "Cookies must be enabled for this site." msgstr "Cookies must be enabled for this site." Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2012-03-16 12:32:50 UTC (rev 553) +++ trunk/library/languages/default-nl.po 2012-03-16 15:26:05 UTC (rev 554) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-15 15:34+0100\n" +"POT-Creation-Date: 2012-03-16 16:15+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -1439,8 +1439,6 @@ 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:161 msgid "Repeat password" @@ -1478,52 +1476,56 @@ msgid "Email templates" msgstr "Email sjabloon" -#: classes/Gems/Default/OptionAction.php:84 +#: classes/Gems/Default/OptionAction.php:79 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:91 +msgid "Password rules" +msgstr "Wachtwoord regels" -#: classes/Gems/Default/OptionAction.php:107 -#: classes/Gems/Default/OptionAction.php:123 -msgid "New password" -msgstr "Nieuw wachtwoord" +#: classes/Gems/Default/OptionAction.php:94 +#, php-format +msgid "A password %s." +msgstr "Een wachtwoord %s." -#: classes/Gems/Default/OptionAction.php:137 +#: classes/Gems/Default/OptionAction.php:101 +msgid "A password:" +msgstr "Een wachtwoord:" + +#: classes/Gems/Default/OptionAction.php:112 msgid "New password is active." msgstr "Nieuwe wachtwoord geactiveerd." -#: classes/Gems/Default/OptionAction.php:143 +#: classes/Gems/Default/OptionAction.php:118 msgid "Caps Lock seems to be on!" msgstr "De Caps Lock toets lijkt aan te staan!" -#: classes/Gems/Default/OptionAction.php:181 +#: classes/Gems/Default/OptionAction.php:158 msgid "Login Name" msgstr "Login Naam" -#: classes/Gems/Default/OptionAction.php:188 +#: classes/Gems/Default/OptionAction.php:165 #: classes/Gems/Default/OrganizationAction.php:129 #: classes/Gems/Default/RespondentAction.php:175 #: classes/Gems/Default/StaffAction.php:319 msgid "Language" msgstr "Taal" -#: classes/Gems/Default/OptionAction.php:198 +#: classes/Gems/Default/OptionAction.php:175 #, php-format msgid "Options" msgstr "Instellingen" -#: classes/Gems/Default/OptionAction.php:207 +#: classes/Gems/Default/OptionAction.php:184 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 +#: classes/Gems/Default/OptionAction.php:204 msgid "Date / time" msgstr "Datum / tijd" -#: classes/Gems/Default/OptionAction.php:238 +#: classes/Gems/Default/OptionAction.php:215 msgid "Item" msgstr "Item" @@ -3560,53 +3562,75 @@ #: 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] "Het wachtwoord moet minstens een hoofdletter bevatten." -msgstr[1] "Het wachtwoord moet minstens %d hoofdletters bevatten." +msgid "should contain at least one uppercase character" +msgid_plural "should contain at least %d uppercase characters" +msgstr[0] "moet minstens één hoofdletter bevatten" +msgstr[1] "moet minstens %d hoofdletters bevatten" #: 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] "Het wachtwoord moet minstens een kleine letter bevatten." -msgstr[1] "Het wachtwoord moet minstens %d kleine letters bevatten." +msgid "should contain at least one lowercase character" +msgid_plural "should contain at least %d lowercase characters" +msgstr[0] "moet minstens één kleine letter bevatten" +msgstr[1] "moet minstens %d kleine letters bevatten" #: classes/Gems/User/PasswordChecker.php:127 #, php-format -msgid "A password should be at least %d characters long." -msgstr "Het wachtwoordt moet minstens %d tekens lang zijn." +msgid "should be at least %d characters long" +msgstr "moet minstens %d tekens lang zijn" #: 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] "Het wachtwoord moet minstens een niet-alphabetisch teken bevatten." -msgstr[1] "Het wachtwoord moet minstens %d niet-alphabetisch tekens bevatten." +msgid "should contain at least one non alphabetic character" +msgid_plural "should contain at least %d non alphabetic characters" +msgstr[0] "moet minstens één niet-letter bevatten" +msgstr[1] "moet minstens %d niet-letter bevatten" -#: classes/Gems/User/PasswordChecker.php:165 +#: classes/Gems/User/PasswordChecker.php:148 +msgid "should not contain non alphabetic characters" +msgstr "moet alleen uit letters bestaan" + +#: classes/Gems/User/PasswordChecker.php:167 #, 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] "Het wachtwoord moet minstens een teken anders dan getallen of letters bevatten." -msgstr[1] "Het wachtwoord moet minstens %d tekens anders dan getallen of letters bevatten." +msgid "should contain at least one non alphanumeric character" +msgid_plural "should contain at least %d non alphanumeric characters" +msgstr[0] "moet minstens één teken anders dan getallen of letters bevatten" +msgstr[1] "moet minstens %d tekens anders dan getallen of letters bevatten" -#: classes/Gems/User/PasswordChecker.php:184 -msgid "A password should not contain the login name." -msgstr "Het wachtwoord mag niet de gebruikersnaam bevatten." +#: classes/Gems/User/PasswordChecker.php:170 +msgid "should not contain non alphanumeric characters" +msgstr "mag alleen letters en cijfers bevatten" -#: classes/Gems/User/PasswordChecker.php:201 +#: classes/Gems/User/PasswordChecker.php:188 #, php-format -msgid "A password should contain at least one number." -msgid_plural "A password should contain at least %d numbers." -msgstr[0] "Het wachtwoord moet minstens een getal bevatten." -msgstr[1] "Het wachtwoord moet minstens %d getallen bevatten." +msgid "should not contain your login name \"%s\"" +msgstr "mag niet je gebruikersnaam \"%s\" bevatten" +#: classes/Gems/User/PasswordChecker.php:207 +#, php-format +msgid "should contain at least one number" +msgid_plural "should contain at least %d numbers" +msgstr[0] "moet minstens één cijfer bevatten" +msgstr[1] "moet minstens %d cijfers bevatten" + +#: classes/Gems/User/PasswordChecker.php:210 +msgid "may not contain numbers" +msgstr "mag geen getallen bevatten" + #: classes/Gems/User/RadiusUserDefinition.php:175 msgid "Shared secret" msgstr "Shared secret" -#: classes/Gems/User/User.php:833 +#: classes/Gems/User/User.php:538 +msgid "Current password" +msgstr "Huidig wachtwoord" + +#: classes/Gems/User/User.php:549 +#: classes/Gems/User/User.php:565 +msgid "New password" +msgstr "Nieuw wachtwoord" + +#: classes/Gems/User/User.php:893 msgid "Cookies must be enabled for this site." msgstr "Zonder cookies heeft u geen toegang tot deze site." This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-16 12:32:59
|
Revision: 553 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=553&view=rev Author: matijsdejong Date: 2012-03-16 12:32:50 +0000 (Fri, 16 Mar 2012) Log Message: ----------- Added password report option Modified Paths: -------------- trunk/library/classes/Gems/Default/OptionAction.php trunk/library/classes/Gems/User/PasswordChecker.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/User/UserLoader.php trunk/library/classes/Gems/User/UserNewPasswordValidator.php Modified: trunk/library/classes/Gems/Default/OptionAction.php =================================================================== --- trunk/library/classes/Gems/Default/OptionAction.php 2012-03-15 14:59:14 UTC (rev 552) +++ trunk/library/classes/Gems/Default/OptionAction.php 2012-03-16 12:32:50 UTC (rev 553) @@ -87,6 +87,7 @@ if ($user->isPasswordResetRequired()) { $this->menu->setVisible(false); + } elseif ($user->hasPassword()) { // Field current password // @@ -123,11 +124,24 @@ $element->addValidator(new MUtil_Validate_IsConfirmed('new_password', $this->_('New password'))); $form->addElement($element); - $element = new Zend_Form_Element_Submit('submit'); - $element->setAttrib('class', 'button'); - $element->setLabel($this->_('Save')); - $form->addElement($element); + // Show password info + if ($info = $user->reportPasswordWeakness()) { + foreach ($info as &$line) { + $line .= ','; + } + $line[strlen($line) - 1] = '.'; + $element = new MUtil_Form_Element_Html('rules'); + $element->setLabel($this->_('Password rules')); + $element->div($this->_('A password:'))->ul($info); + $form->addElement($element); + + $element = new Zend_Form_Element_Submit('submit'); + $element->setAttrib('class', 'button'); + $element->setLabel($this->_('Save')); + $form->addElement($element); + } + /**************** * Process form * ****************/ Modified: trunk/library/classes/Gems/User/PasswordChecker.php =================================================================== --- trunk/library/classes/Gems/User/PasswordChecker.php 2012-03-15 14:59:14 UTC (rev 552) +++ trunk/library/classes/Gems/User/PasswordChecker.php 2012-03-16 12:32:50 UTC (rev 553) @@ -92,7 +92,7 @@ $results = array(); 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), + $this->translate->plural('should contain at least one uppercase character', 'should contain at least %d uppercase characters', $len), $len)); } } @@ -109,7 +109,7 @@ $results = array(); 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), + $this->translate->plural('should contain at least one lowercase character', 'should contain at least %d lowercase characters', $len), $len)); } } @@ -124,7 +124,7 @@ { $len = intval($parameter); if ($len && (strlen($password) < $len)) { - $this->_addError(sprintf($this->translate->_('A password should be at least %d characters long.'), $len)); + $this->_addError(sprintf($this->translate->_('should be at least %d characters long'), $len)); } } @@ -138,12 +138,14 @@ { $len = intval($parameter); if ($len) { - $results = array(); - $count = preg_match_all('/[A-Za-z]/', $password, $results); - if (strlen($password) - $count < $len) { + $results = array(); // Not used but required + $count = strlen($password) - preg_match_all('/[A-Za-z]/', $password, $results); + if (($len > 0) && ($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), + $this->translate->plural('should contain at least one non alphabetic character', 'should contain at least %d non alphabetic characters', $len), $len)); + } elseif (($len < 0) && (($count > 0) || (null === $password))) { + $this->_addError($this->translate->_('should not contain non alphabetic characters')); } } } @@ -158,12 +160,14 @@ { $len = intval($parameter); if ($len) { - $results = array(); - $count = preg_match_all('/[A-Za-z]/', $password, $results); - if (strlen($password) - $count < $len) { + $results = array(); // Not used but required + $count = strlen($password) - preg_match_all('/[0-9A-Za-z]/', $password, $results); + if (($len > 0) && ($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), + $this->translate->plural('should contain at least one non alphanumeric character', 'should contain at least %d non alphanumeric characters', $len), $len)); + } elseif (($len < 0) && (($count > 0) || (null === $password))) { + $this->_addError($this->translate->_('should not contain non alphanumeric characters')); } } } @@ -180,8 +184,8 @@ if ($on) { $lpwd = strtolower($password); - if (false !== strpos($lpwd, strtolower($this->user->getLoginName()))) { - $this->_addError($this->translate->_('A password should not contain the login name.')); + if ((false !== strpos($lpwd, strtolower($this->user->getLoginName()))) || (null === $password)) { + $this->_addError(sprintf($this->translate->_('should not contain your login name "%s"'), $this->user->getLoginName())); } } } @@ -195,18 +199,24 @@ protected function numCount($parameter, $password) { $len = intval($parameter); - $results = array(); - 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)); + if ($len) { + $results = array(); // Not used but required + $count = preg_match_all('/[0-9]/', $password, $results); + if (($len > 0) && ($count < $len)) { + $this->_addError(sprintf( + $this->translate->plural('should contain at least one number', 'should contain at least %d numbers', $len), + $len)); + } elseif (($len < 0) && (($count > 0) || (null === $password))) { + $this->_addError($this->translate->_('may not contain numbers')); + } } } /** * Check for password weakness. * - * @param string $password + * @param Gems_User_User $user + * @param string $password Or null when you want a report on all the rules for this 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 */ Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2012-03-15 14:59:14 UTC (rev 552) +++ trunk/library/classes/Gems/User/User.php 2012-03-16 12:32:50 UTC (rev 553) @@ -730,10 +730,10 @@ /** * Check for password weakness. * - * @param string $password + * @param string $password Or null when you want a report on all the rules for this password. * @return mixed String or array of strings containing warning messages or nothing */ - public function reportPasswordWeakness($password) + public function reportPasswordWeakness($password = null) { if ($this->canSetPassword()) { $checker = $this->userLoader->getPasswordChecker(); Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2012-03-15 14:59:14 UTC (rev 552) +++ trunk/library/classes/Gems/User/UserLoader.php 2012-03-16 12:32:50 UTC (rev 553) @@ -431,13 +431,11 @@ * Check for password weakness. * * @param Gems_User_User $user The user for e.g. name checks - * @param string $password + * @param string $password Or null when you want a report on all the rules for this password. * @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 = null) { - $checker = $this->_getClass('passwordChecker'); - return $user->reportPasswordWeakness($password); } Modified: trunk/library/classes/Gems/User/UserNewPasswordValidator.php =================================================================== --- trunk/library/classes/Gems/User/UserNewPasswordValidator.php 2012-03-15 14:59:14 UTC (rev 552) +++ trunk/library/classes/Gems/User/UserNewPasswordValidator.php 2012-03-16 12:32:50 UTC (rev 553) @@ -84,6 +84,10 @@ { $this->_report = $this->_user->reportPasswordWeakness($value); + foreach ($this->_report as &$report) { + $report = ucfirst($report) . '.'; + } + // MUtil_Echo::track($value, $this->_report); return ! (boolean) $this->_report; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-15 14:59:26
|
Revision: 552 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=552&view=rev Author: matijsdejong Date: 2012-03-15 14:59:14 +0000 (Thu, 15 Mar 2012) Log Message: ----------- Updated translations Temporarily fixed some issues with callable multiOptions Modified Paths: -------------- trunk/library/classes/Gems/Registry/TargetAbstract.php trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php trunk/library/classes/MUtil/Model/TableBridgeAbstract.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 Modified: trunk/library/classes/Gems/Registry/TargetAbstract.php =================================================================== --- trunk/library/classes/Gems/Registry/TargetAbstract.php 2012-03-14 17:29:56 UTC (rev 551) +++ trunk/library/classes/Gems/Registry/TargetAbstract.php 2012-03-15 14:59:14 UTC (rev 552) @@ -39,7 +39,7 @@ /** * Extends MUtil_Registry_TargetAbstract with the ability to create PHP * callables by request an existing method using $this->methodName. - * + * * @package Gems * @subpackage Registry * @copyright Copyright (c) 2011 Erasmus MC Modified: trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2012-03-14 17:29:56 UTC (rev 551) +++ trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2012-03-15 14:59:14 UTC (rev 552) @@ -706,6 +706,10 @@ } if ($options = $this->get($name, 'multiOptions')) { + if (is_callable($options)) { + $options = call_user_func($options); + $this->set($name, 'multiOptions', $options); + } $adapter = $this->getAdapter(); $wheres = array(); foreach ($options as $key => $value) { Modified: trunk/library/classes/MUtil/Model/TableBridgeAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/TableBridgeAbstract.php 2012-03-14 17:29:56 UTC (rev 551) +++ trunk/library/classes/MUtil/Model/TableBridgeAbstract.php 2012-03-15 14:59:14 UTC (rev 552) @@ -77,6 +77,10 @@ $value = $this->getLazy($name); if ($multi = $this->model->get($name, 'multiOptions')) { + if (is_callable($multi)) { + $multi = call_user_func($multi); + $this->model->set($name, 'multiOptions', $multi); + } $value = MUtil_Lazy::offsetGet($multi, $value); } Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2012-03-14 17:29:56 UTC (rev 551) +++ trunk/library/languages/default-en.po 2012-03-15 14:59:14 UTC (rev 552) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-08 17:17+0100\n" +"POT-Creation-Date: 2012-03-15 15:34+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -50,45 +50,45 @@ 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:1517 +#: classes/GemsEscort.php:1518 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1519 -#: classes/GemsEscort.php:1523 +#: classes/GemsEscort.php:1520 #: classes/GemsEscort.php:1524 +#: classes/GemsEscort.php:1525 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1534 +#: classes/GemsEscort.php:1535 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1536 -#: classes/GemsEscort.php:1578 +#: classes/GemsEscort.php:1537 +#: classes/GemsEscort.php:1579 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1552 +#: classes/GemsEscort.php:1553 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1554 +#: classes/GemsEscort.php:1555 #, 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:1564 -#: classes/GemsEscort.php:1576 +#: classes/GemsEscort.php:1565 +#: classes/GemsEscort.php:1577 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1565 +#: classes/GemsEscort.php:1566 msgid "You must login to access this page." msgstr "You must login to access this page." -#: classes/GemsEscort.php:1709 -#: classes/GemsEscort.php:1711 +#: classes/GemsEscort.php:1710 +#: classes/GemsEscort.php:1712 #, php-format msgid "%d survey" msgid_plural "%d surveys" @@ -99,7 +99,7 @@ msgid "Database needs to be updated!" msgstr "Database needs to be updated!" -#: classes/Gems/Auth.php:241 +#: classes/Gems/Auth.php:242 msgid "Combination of organization, username and password not found." msgstr "Combination of organization, username and password not found." @@ -431,7 +431,7 @@ msgid "Checks performed" msgstr "Checks performed" -#: classes/Gems/Upgrades.php:75 +#: classes/Gems/Upgrades.php:76 msgid "Syncing surveys for all sources" msgstr "Syncing surveys for all sources" @@ -1967,7 +1967,7 @@ msgstr[0] "patient" msgstr[1] "patients" -#: classes/Gems/Default/RespondentAction.php:396 +#: classes/Gems/Default/RespondentAction.php:398 msgid "Please settle the informed consent form for this respondent." msgstr "Please settle the informed consent form for this patient." @@ -2064,91 +2064,75 @@ msgid "Database Password" msgstr "Database Password" -#: classes/Gems/Default/SourceAction.php:115 +#: classes/Gems/Default/SourceAction.php:116 #, php-format msgid "Refreshing token attributes for %s source." msgstr "Refreshing token attributes for %s source." -#: classes/Gems/Default/SourceAction.php:131 +#: classes/Gems/Default/SourceAction.php:132 #, php-format msgid "Checking survey results for %s source." msgstr "Checking survey results for %s source." -#: classes/Gems/Default/SourceAction.php:143 +#: classes/Gems/Default/SourceAction.php:144 msgid "Checking survey results for all sources." msgstr "Checking survey results for all sources." -#: classes/Gems/Default/SourceAction.php:164 +#: classes/Gems/Default/SourceAction.php:165 msgid "Source Url" msgstr "Source Url" -#: classes/Gems/Default/SourceAction.php:166 +#: classes/Gems/Default/SourceAction.php:167 msgid "Adaptor class" msgstr "Adaptor class" -#: classes/Gems/Default/SourceAction.php:168 +#: classes/Gems/Default/SourceAction.php:169 msgid "Database Server" msgstr "Database Server" -#: classes/Gems/Default/SourceAction.php:170 +#: classes/Gems/Default/SourceAction.php:171 msgid "Database host" msgstr "Database host" -#: classes/Gems/Default/SourceAction.php:174 +#: classes/Gems/Default/SourceAction.php:173 +msgid "Charset" +msgstr "Charset" + +#: classes/Gems/Default/SourceAction.php:176 msgid "Table prefix" msgstr "Table prefix" -#: classes/Gems/Default/SourceAction.php:178 +#: classes/Gems/Default/SourceAction.php:180 msgid "Last check" msgstr "Last check" -#: classes/Gems/Default/SourceAction.php:211 +#: classes/Gems/Default/SourceAction.php:213 msgid "source" msgid_plural "sources" msgstr[0] "source" msgstr[1] "sources" -#: classes/Gems/Default/SourceAction.php:216 +#: classes/Gems/Default/SourceAction.php:218 msgid "Survey Sources" msgstr "Survey Sources" -#: classes/Gems/Default/SourceAction.php:224 +#: classes/Gems/Default/SourceAction.php:226 msgid "This installation is active." msgstr "This installation is active." -#: classes/Gems/Default/SourceAction.php:226 +#: classes/Gems/Default/SourceAction.php:228 msgid "Inactive installation." msgstr "Inactive installation." -#: classes/Gems/Default/SourceAction.php:245 +#: classes/Gems/Default/SourceAction.php:243 #, php-format msgid "Synchronize the %s source." msgstr "Synchronize the %s source." -#: classes/Gems/Default/SourceAction.php:254 -#, php-format -msgid "Check %s surveys" -msgstr "Check %s surveys" - -#: classes/Gems/Default/SourceAction.php:257 -msgid "No surveys to check." -msgstr "No surveys to check." - -#: classes/Gems/Default/SourceAction.php:274 +#: classes/Gems/Default/SourceAction.php:256 msgid "Synchronize all sources." msgstr "Synchronize all sources." -#: classes/Gems/Default/SourceAction.php:282 -#, php-format -msgid "Check %s source" -msgid_plural "Check %s sources" -msgstr[0] "Check %s source" -msgstr[1] "Check %s sources" - -#: classes/Gems/Default/SourceAction.php:285 -msgid "No sources to check." -msgstr "No sources to check." - #: classes/Gems/Default/StaffAction.php:137 msgid "Unsupported UserDefinition" msgstr "Unsupported UserDefinition" @@ -3142,6 +3126,13 @@ msgstr[0] "%d token out of %d tokens changed." msgstr[1] "%d tokens out of %d tokens changed." +#: classes/Gems/Task/Tracker/SourceSyncSurveys.php:56 +#, php-format +msgid "Check %s source" +msgid_plural "Check %s sources" +msgstr[0] "Check %s source" +msgstr[1] "Check %s sources" + #: classes/Gems/Tracker/ChangeTracker.php:84 #, php-format msgid "Round changes propagated to %d tokens." @@ -3419,82 +3410,82 @@ msgid "Next >" msgstr "Next >" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:410 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1142 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:376 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1154 #, php-format msgid "The '%s' survey is no longer active. The survey was removed from LimeSurvey!" msgstr "The '%s' survey is no longer active. The survey was removed from LimeSurvey!" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:441 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:407 #, php-format msgid "Corrected anonymization for survey '%s'" msgstr "Corrected anonymization for survey '%s'" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:465 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:431 msgid ", " msgstr ", " -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:469 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:435 #, php-format msgid "Added to token table '%s' the field(s): %s" msgstr "Added to token table '%s' the field(s): %s" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:474 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:440 #, php-format msgid "Attribute fields not created for token table for '%s'" msgstr "Attribute fields not created for token table for '%s'" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:475 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:441 #, php-format msgid "Required fields: %s" msgstr "Required fields: %s" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:500 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1295 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:466 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1307 #, php-format msgid "The status of the '%s' survey has changed." msgstr "The status of the '%s' survey has changed." -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:506 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1301 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:472 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1313 #, php-format msgid "Survey '%s' IS NO LONGER ACTIVE!!!" msgstr "Survey '%s' IS NO LONGER ACTIVE!!!" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:512 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1307 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:478 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1319 #, php-format msgid "The status of the '%s' survey has changed to '%s'." msgstr "The status of the '%s' survey has changed to '%s'." -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:515 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1310 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:481 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1322 #, php-format msgid "The status warning for the '%s' survey was removed." msgstr "The status warning for the '%s' survey was removed." -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:521 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1316 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:487 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1328 #, php-format msgid "The name of the '%s' survey has changed to '%s'." msgstr "The name of the '%s' survey has changed to '%s'." -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:530 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1326 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:498 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1338 #, php-format msgid "Imported the '%s' survey." msgstr "Imported the '%s' survey." -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:754 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:722 msgid "Submitdate" msgstr "Submitdate" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1122 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1134 #, php-format msgid "Updated %d Gems tokens to new token definition." msgstr "Updated %d Gems tokens to new token definition." -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1277 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1289 #, 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'." @@ -3615,7 +3606,7 @@ msgid "Shared secret" msgstr "Shared secret" -#: classes/Gems/User/User.php:832 +#: classes/Gems/User/User.php:833 msgid "Cookies must be enabled for this site." msgstr "Cookies must be enabled for this site." @@ -4119,6 +4110,15 @@ msgid "Can access" msgstr "Can access" +#~ msgid "Check %s surveys" +#~ msgstr "Check %s surveys" + +#~ msgid "No surveys to check." +#~ msgstr "No surveys to check." + +#~ msgid "No sources to check." +#~ msgstr "No sources to check." + #~ msgid "Creating new tables" #~ msgstr "Creating new tables" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2012-03-14 17:29:56 UTC (rev 551) +++ trunk/library/languages/default-nl.po 2012-03-15 14:59:14 UTC (rev 552) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-08 17:17+0100\n" +"POT-Creation-Date: 2012-03-15 15:34+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -50,45 +50,45 @@ 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:1517 +#: classes/GemsEscort.php:1518 msgid "Please check back later." msgstr "Probeer het later opnieuw." -#: classes/GemsEscort.php:1519 -#: classes/GemsEscort.php:1523 +#: classes/GemsEscort.php:1520 #: classes/GemsEscort.php:1524 +#: classes/GemsEscort.php:1525 msgid "System is in maintenance mode" msgstr "Systeem is in onderhoudsmodus" -#: classes/GemsEscort.php:1534 +#: classes/GemsEscort.php:1535 msgid "No access to site." msgstr "Geen toegang tot website." -#: classes/GemsEscort.php:1536 -#: classes/GemsEscort.php:1578 +#: classes/GemsEscort.php:1537 +#: classes/GemsEscort.php:1579 msgid "You have no access to this site." msgstr "U heeft geen toegang tot deze website." -#: classes/GemsEscort.php:1552 +#: classes/GemsEscort.php:1553 msgid "No access to page" msgstr "Geen toegang tot pagina" -#: classes/GemsEscort.php:1554 +#: classes/GemsEscort.php:1555 #, 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:1564 -#: classes/GemsEscort.php:1576 +#: classes/GemsEscort.php:1565 +#: classes/GemsEscort.php:1577 msgid "You are no longer logged in." msgstr "U bent niet meer ingelogd." -#: classes/GemsEscort.php:1565 +#: classes/GemsEscort.php:1566 msgid "You must login to access this page." msgstr "U moet ingelogd zijn voor toegang tot deze pagina." -#: classes/GemsEscort.php:1709 -#: classes/GemsEscort.php:1711 +#: classes/GemsEscort.php:1710 +#: classes/GemsEscort.php:1712 #, php-format msgid "%d survey" msgid_plural "%d surveys" @@ -99,7 +99,7 @@ msgid "Database needs to be updated!" msgstr "Database dient ververst te worden!" -#: classes/Gems/Auth.php:241 +#: classes/Gems/Auth.php:242 msgid "Combination of organization, username and password not found." msgstr "Combinatie van organisatie, gebruikersnaam en wachtwoord niet gevonden." @@ -431,7 +431,7 @@ msgid "Checks performed" msgstr "Controle uitgevoerd" -#: classes/Gems/Upgrades.php:75 +#: classes/Gems/Upgrades.php:76 msgid "Syncing surveys for all sources" msgstr "Vragenlijsten synchroniseren voor alle bronnen." @@ -1967,7 +1967,7 @@ msgstr[0] "patiënt" msgstr[1] "patiënten" -#: classes/Gems/Default/RespondentAction.php:396 +#: classes/Gems/Default/RespondentAction.php:398 msgid "Please settle the informed consent form for this respondent." msgstr "A.u.b. het informed consent formulier doornemen met deze patiënt" @@ -2064,91 +2064,75 @@ msgid "Database Password" msgstr "Database wachtwoord" -#: classes/Gems/Default/SourceAction.php:115 +#: classes/Gems/Default/SourceAction.php:116 #, php-format msgid "Refreshing token attributes for %s source." msgstr "Kenmerk attributen verversing voor %s bron." -#: classes/Gems/Default/SourceAction.php:131 +#: classes/Gems/Default/SourceAction.php:132 #, php-format msgid "Checking survey results for %s source." msgstr "Controle vragenlijstresultaten voor %s bron." -#: classes/Gems/Default/SourceAction.php:143 +#: classes/Gems/Default/SourceAction.php:144 msgid "Checking survey results for all sources." msgstr "Controle vragenlijstresultaten voor alle bronnen." -#: classes/Gems/Default/SourceAction.php:164 +#: classes/Gems/Default/SourceAction.php:165 msgid "Source Url" msgstr "Bron Url" -#: classes/Gems/Default/SourceAction.php:166 +#: classes/Gems/Default/SourceAction.php:167 msgid "Adaptor class" msgstr "Adaptor klasse" -#: classes/Gems/Default/SourceAction.php:168 +#: classes/Gems/Default/SourceAction.php:169 msgid "Database Server" msgstr "Database Server" -#: classes/Gems/Default/SourceAction.php:170 +#: classes/Gems/Default/SourceAction.php:171 msgid "Database host" msgstr "Database machine" -#: classes/Gems/Default/SourceAction.php:174 +#: classes/Gems/Default/SourceAction.php:173 +msgid "Charset" +msgstr "Tekenset" + +#: classes/Gems/Default/SourceAction.php:176 msgid "Table prefix" msgstr "Voorvoegsel tabel" -#: classes/Gems/Default/SourceAction.php:178 +#: classes/Gems/Default/SourceAction.php:180 msgid "Last check" msgstr "Laatste controle" -#: classes/Gems/Default/SourceAction.php:211 +#: classes/Gems/Default/SourceAction.php:213 msgid "source" msgid_plural "sources" msgstr[0] "bron" msgstr[1] "bronnen" -#: classes/Gems/Default/SourceAction.php:216 +#: classes/Gems/Default/SourceAction.php:218 msgid "Survey Sources" msgstr "Bronnen" -#: classes/Gems/Default/SourceAction.php:224 +#: classes/Gems/Default/SourceAction.php:226 msgid "This installation is active." msgstr "Deze installatie is actief" -#: classes/Gems/Default/SourceAction.php:226 +#: classes/Gems/Default/SourceAction.php:228 msgid "Inactive installation." msgstr "Deze installatie is inactief" -#: classes/Gems/Default/SourceAction.php:245 +#: classes/Gems/Default/SourceAction.php:243 #, php-format msgid "Synchronize the %s source." msgstr "Synchroniseer de %s bron" -#: classes/Gems/Default/SourceAction.php:254 -#, php-format -msgid "Check %s surveys" -msgstr "Controleer %s vragenlijsten" - -#: classes/Gems/Default/SourceAction.php:257 -msgid "No surveys to check." -msgstr "Geen vragenlijsten om te controleren." - -#: classes/Gems/Default/SourceAction.php:274 +#: classes/Gems/Default/SourceAction.php:256 msgid "Synchronize all sources." msgstr "Synchroniseer alle bronnen." -#: classes/Gems/Default/SourceAction.php:282 -#, php-format -msgid "Check %s source" -msgid_plural "Check %s sources" -msgstr[0] "Controleer %s bron" -msgstr[1] "Controleer %s bronnen" - -#: classes/Gems/Default/SourceAction.php:285 -msgid "No sources to check." -msgstr "Geen bronnen om te controleren." - #: classes/Gems/Default/StaffAction.php:137 msgid "Unsupported UserDefinition" msgstr "Onebekende UserDefinition" @@ -3142,6 +3126,13 @@ msgstr[0] "%d van %d kenmerken verandert." msgstr[1] "%d van %d kenmerken verandert." +#: classes/Gems/Task/Tracker/SourceSyncSurveys.php:56 +#, php-format +msgid "Check %s source" +msgid_plural "Check %s sources" +msgstr[0] "Controleer %s bron" +msgstr[1] "Controleer %s bronnen" + #: classes/Gems/Tracker/ChangeTracker.php:84 #, php-format msgid "Round changes propagated to %d tokens." @@ -3419,82 +3410,82 @@ msgid "Next >" msgstr "Verder >" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:410 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1142 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:376 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1154 #, 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:441 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:407 #, php-format msgid "Corrected anonymization for survey '%s'" msgstr "Anonimizatie gecorrigeerd van vragenlijst '%s'" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:465 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:431 msgid ", " msgstr ", " -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:469 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:435 #, php-format msgid "Added to token table '%s' the field(s): %s" msgstr "Toegevoegd aan kenmerk tabel '%s', de velden: %s" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:474 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:440 #, php-format msgid "Attribute fields not created for token table for '%s'" msgstr "Attribuut velden voor de kenmerk tabel '%s' zijn niet toegevoegd." -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:475 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:441 #, php-format msgid "Required fields: %s" msgstr "Verplicht veld: %s" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:500 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1295 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:466 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1307 #, 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:506 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1301 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:472 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1313 #, php-format msgid "Survey '%s' IS NO LONGER ACTIVE!!!" msgstr "De vragenlijst '%s' IS NIET MEER ACTIEF!!!" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:512 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1307 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:478 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1319 #, 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:515 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1310 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:481 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1322 #, 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:521 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1316 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:487 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1328 #, 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:530 -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1326 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:498 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1338 #, php-format msgid "Imported the '%s' survey." msgstr "De vragenlijst '%s' is geïmporteerd." -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:754 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:722 msgid "Submitdate" msgstr "Invoerdatum" -#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1122 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1134 #, 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:1277 +#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1289 #, 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'." @@ -3615,7 +3606,7 @@ msgid "Shared secret" msgstr "Shared secret" -#: classes/Gems/User/User.php:832 +#: classes/Gems/User/User.php:833 msgid "Cookies must be enabled for this site." msgstr "Zonder cookies heeft u geen toegang tot deze site." @@ -4119,6 +4110,15 @@ msgid "Can access" msgstr "Toegang tot" +#~ msgid "Check %s surveys" +#~ msgstr "Controleer %s vragenlijsten" + +#~ msgid "No surveys to check." +#~ msgstr "Geen vragenlijsten om te controleren." + +#~ msgid "No sources to check." +#~ msgstr "Geen bronnen om te controleren." + #~ msgid "Creating new tables" #~ msgstr "aanmaken nieuwe tabellen" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-14 17:30:06
|
Revision: 551 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=551&view=rev Author: matijsdejong Date: 2012-03-14 17:29:56 +0000 (Wed, 14 Mar 2012) Log Message: ----------- Added setOnTextFilter for DatabaseModelAbstract.php and ConcatenatedRow.php Modified Paths: -------------- trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php trunk/library/classes/MUtil/Model/ModelAbstract.php trunk/library/classes/MUtil/Model/Type/ConcatenatedRow.php Modified: trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2012-03-13 14:06:54 UTC (rev 550) +++ trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2012-03-14 17:29:56 UTC (rev 551) @@ -55,11 +55,18 @@ * * Zend_Element allows some other extended characters, but those may not work * with some browsers. + * + * If there exists a table containing two fields where one fields maps with this key + * to the other, shoot the table designer!!! */ const KEY_COPIER = '__c_1_3_copy__%s__key_k_0_p_1__'; - // If there exists a table containing two fields that map to these, shoot the table designer!!! /** + * Name for query filter transformers + */ + const TEXTFILTER_TRANSFORMER = 'filter_transformer'; + + /** * @var array When specified delete() updates the selected rows with these values, instead of physically deleting the rows. */ protected $_deleteValues; @@ -228,7 +235,7 @@ if ($this->is($name, 'table', $table_name)) { if (array_key_exists($name, $data)) { - if ($data[$name] && ($len = $this->get($name, 'maxlength'))) { + if ($data[$name] && (! is_array($data[$name])) && ($len = $this->get($name, 'maxlength'))) { $tableData[$name] = substr($data[$name], 0, $len); } else { $tableData[$name] = $data[$name]; @@ -429,10 +436,12 @@ } // Check for actual values for this table to save. + // MUtil_Echo::track($newValues); if ($returnValues = $this->_filterDataFor($table_name, $newValues, ! $update)) { if (MUtil_Model::$verbose) { MUtil_Echo::r($returnValues, 'Return'); } + // MUtil_Echo::track($returnValues); if ($update) { // MUtil_Echo::r($filter); @@ -678,12 +687,59 @@ } /** + * Creates an SQL filter for this value on this name. + * + * @param mixed $filter The value to filter for + * @param string $name The name of the current field + * @param string $sqlField The SQL name of the current field + * @return mixed Nothing, a single filter statement or an array of OR filters + */ + public function getOnTextFilter($filter, $name, $sqlField) + { + if ($call = $this->get($name, self::TEXTFILTER_TRANSFORMER)) { + + if (is_callable($call)) { + return call_user_func($call, $filter, $name, $sqlField, $this); + } else { + return $call; + } + } + + if ($options = $this->get($name, 'multiOptions')) { + $adapter = $this->getAdapter(); + $wheres = array(); + foreach ($options as $key => $value) { + // MUtil_Echo::track($key, $value, $filter, stripos($value, $filter)); + if (stripos($value, $filter) !== false) { + if (null === $key) { + $wheres[] = $sqlField . ' IS NULL'; + } else { + $wheres[] = $sqlField . ' = ' . $adapter->quote($key); + } + } + } + return $wheres; + } + + if (is_numeric($filter) || $this->isString($name)) { + // Only for strings or all fields when numeric + return $sqlField . ' LIKE \'%' . trim($this->getAdapter()->quote($filter), '\'') . '%\''; + } + } + + /** * The select object where we get the query from. * * @return Zend_Db_Table_Select */ abstract public function getSelect(); + /** + * Creates a filter for this model for the given wildcard search text. + * + * @param string $searchText + * @return array An array of filter statements for wildcard text searching for this model type + */ public function getTextSearchFilter($searchText) { $filter = array(); @@ -705,21 +761,13 @@ if ($fields) { foreach ($this->getTextSearches($searchText) as $searchOn) { $wheres = array(); - $search = trim($adapter->quote($searchOn), '\''); foreach ($fields as $name => $sqlField) { - if ($options = $this->get($name, 'multiOptions')) { - foreach ($options as $key => $value) { - if (stripos($value, $searchOn) !== false) { - if (null === $key) { - $wheres[] = $sqlField . ' IS NULL'; - } else { - $wheres[] = $sqlField . ' = ' . $adapter->quote($key); - } - } + if ($where = $this->getOnTextFilter($searchOn, $name, $sqlField)) { + if (is_array($where)) { + $wheres = array_merge($wheres, $where); + } else { + $wheres[] = $where; } - } elseif (is_numeric($searchOn) || $this->isString($name)) { - // Only for strings or all fields when numeric - $wheres[] = $sqlField . ' LIKE \'%' . $search . '%\''; } } @@ -834,6 +882,19 @@ } /** + * Changes the key copy string that is used to create a new identifier + * for keys. + * + * @param string $value A sting of at least 3 characters containing %s. + * @return MUtil_Model_DatabaseModelAbstract (continuation pattern) + */ + public function setKeyCopier($value = self::KEY_COPIER) + { + $this->keyCopier = $value; + return $this; + } + + /** * When passed an array this method set the keys of this database object * to those keys. * When passed a string it is assumed to be a table name and the keys of @@ -855,15 +916,15 @@ } /** - * Changes the key copy string that is used to create a new identifier - * for keys. + * Sets a name to a callable function for query filtering. * - * @param string $value A sting of at least 3 characters containing %s. - * @return MUtil_Model_DatabaseModelAbstract (continuation pattern) + * @param string $name The fieldname + * @param mixed $callableOrConstant A constant or a function of this type: callable($filter, $name, $sqlField, MUtil_Model_DatabaseModelAbstract $model) + * @return MUtil_Model_ModelAbstract (continuation pattern) */ - public function setKeyCopier($value = self::KEY_COPIER) + public function setOnTextFilter($name, $callableOrConstant) { - $this->keyCopier = $value; + $this->set($name, self::TEXTFILTER_TRANSFORMER, $callableOrConstant); return $this; } } Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-03-13 14:06:54 UTC (rev 550) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-03-14 17:29:56 UTC (rev 551) @@ -716,12 +716,24 @@ return $this->getMeta('textFilter', MUtil_Model::TEXT_FILTER); } + /** + * Splits a wildcard search text into its constituent parts. + * + * @param string $searchText + * @return array + */ public function getTextSearches($searchText) { // Replace -/ with space, trim & remove all double spaces return explode(' ', str_replace(' ', ' ', trim(strtr($searchText, '-+/\\', ' ')))); } + /** + * Creates a filter for this model for the given wildcard search text. + * + * @param string $searchText + * @return array An array of filter statements for wildcard text searching for this model type + */ public function getTextSearchFilter($searchText) { } Modified: trunk/library/classes/MUtil/Model/Type/ConcatenatedRow.php =================================================================== --- trunk/library/classes/MUtil/Model/Type/ConcatenatedRow.php 2012-03-13 14:06:54 UTC (rev 550) +++ trunk/library/classes/MUtil/Model/Type/ConcatenatedRow.php 2012-03-14 17:29:56 UTC (rev 551) @@ -46,17 +46,48 @@ */ class MUtil_Model_Type_ConcatenatedRow { + /** + * The character used to separate values when displaying. + * + * @var string + */ protected $displaySeperator = ' '; + /** + * The character used to separate values when storing. + * + * @var string + */ protected $seperatorChar = ' '; + /** + * When true the value is padded on both sides with the $seperatorChar. + * + * Makes it easier to filter. + * + * @see $seperatorChar + * + * @var boolean + */ protected $valuePad = true; + /** + * MUtil_Ra::args() parameter passing is allowed. + * + * @param string $seperatorChar + * @param string $displaySeperator + * @param boolean $valuePad + */ public function __construct($seperatorChar = ' ', $displaySeperator = ' ', $valuePad = true) { - $this->seperatorChar = substr($seperatorChar . ' ', 0, 1); - $this->displaySeperator = $displaySeperator; - $this->valuePad = $valuePad; + $args = MUtil_Ra::args( + func_get_args(), + array('seperatorChar' => 'is_string', 'displaySeperator' => 'is_string', 'valuePad' => 'is_boolean'), + array('seperatorChar' => ' ', 'displaySeperator' => ' ', 'valuePad' => true)); + + $this->seperatorChar = substr($args['seperatorChar'] . ' ', 0, 1); + $this->displaySeperator = $args['displaySeperator']; + $this->valuePad = $args['valuePad']; } /** @@ -72,6 +103,10 @@ $model->setOnLoad($name, array($this, 'loadValue')); $model->setOnSave($name, array($this, 'saveValue')); + if ($model instanceof MUtil_Model_DatabaseModelAbstract) { + $model->setOnTextFilter($name, array($this, 'textFilter')); + } + return $this; } @@ -99,7 +134,7 @@ */ public function loadValue($value, $isNew = false, $name = null, array $context = array()) { - // MUtil_Echo::track($value); + // MUtil_Echo::track($value, $name, $context); if (! is_array($value)) { if ($this->valuePad) { $value = trim($value, $this->seperatorChar); @@ -125,6 +160,7 @@ */ public function saveValue($value, $isNew = false, $name = null, array $context = array()) { + // MUtil_Echo::track($value); if (is_array($value)) { $value = implode($this->seperatorChar, $value); @@ -134,4 +170,39 @@ } return $value; } + + /** + * + * @param string $filter The text to filter for + * @param string $name The model field name + * @param string $sqlField The SQL field name + * @param MUtil_Model_DatabaseModelAbstract $model + * @return array Array of OR-filter statements + */ + public function textFilter($filter, $name, $sqlField, MUtil_Model_DatabaseModelAbstract $model) + { + if ($options = $model->get($name, 'multiOptions')) { + $adapter = $model->getAdapter(); + $wheres = array(); + foreach ($options as $key => $value) { + // MUtil_Echo::track($key, $value, $filter, stripos($value, $filter)); + if (stripos($value, $filter) !== false) { + if (null === $key) { + $wheres[] = $sqlField . ' IS NULL'; + } else { + $quoted = $adapter->quote($key); + $wheres[] = $sqlField . " LIKE '%" . $this->seperatorChar . $quoted . $this->seperatorChar . "%'"; + + if (! $this->valuePad) { + // Add other options + $wheres[] = $sqlField . " LIKE '" . $quoted . $this->seperatorChar . "%'"; + $wheres[] = $sqlField . " LIKE '%" . $this->seperatorChar . $quoted . "'"; + $wheres[] = $sqlField . " = " . $quoted; + } + } + } + } + return $wheres; + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-13 14:07:05
|
Revision: 550 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=550&view=rev Author: mennodekker Date: 2012-03-13 14:06:54 +0000 (Tue, 13 Mar 2012) Log Message: ----------- Added empty dirs to new_project for the track completion event Added Paths: ----------- trunk/new_project/application/events/track/ trunk/new_project/application/events/track/completed/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-13 12:07:38
|
Revision: 549 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=549&view=rev Author: mennodekker Date: 2012-03-13 12:07:27 +0000 (Tue, 13 Mar 2012) Log Message: ----------- A little cleanup Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php trunk/library/classes/Gems/Tracker/Source/SourceAbstract.php trunk/library/classes/Gems/Tracker/Source/SourceInterface.php Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-03-12 15:22:59 UTC (rev 548) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-03-13 12:07:27 UTC (rev 549) @@ -1073,10 +1073,9 @@ * Updates the gems database with the latest information about the surveys in this source adapter * * @param int $userId Id of the user who takes the action (for logging) - * @param bool $updateTokens Wether the tokens should be updated or not, default is true * @return array Returns an array of messages */ - public function synchronizeSurveys($userId, $updateTokens = true) + public function synchronizeSurveys($userId) { // Surveys in LS $lsDb = $this->getSourceDatabase(); Modified: trunk/library/classes/Gems/Tracker/Source/SourceAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/SourceAbstract.php 2012-03-12 15:22:59 UTC (rev 548) +++ trunk/library/classes/Gems/Tracker/Source/SourceAbstract.php 2012-03-13 12:07:27 UTC (rev 549) @@ -230,21 +230,7 @@ } /** - * Add the commands to update this source to a source synchornization batch * - * @param Gems_Tracker_Batch_SynchronizeSourcesBatch $batch - * @param int $userId Id of the user who takes the action (for logging) - */ - public function addSynchronizeSurveyCommands(Gems_Tracker_Batch_SynchronizeSourcesBatch $batch, $userId) - { - // Do nothing or add the old method is the default - if (method_exists($this, 'synchronizeSurveys')) { - $batch->addSourceFunction('synchronizeSurveys', $userId); - } - } - - /** - * * @return string Base url for source */ protected function getBaseUrl() Modified: trunk/library/classes/Gems/Tracker/Source/SourceInterface.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/SourceInterface.php 2012-03-12 15:22:59 UTC (rev 548) +++ trunk/library/classes/Gems/Tracker/Source/SourceInterface.php 2012-03-13 12:07:27 UTC (rev 549) @@ -276,10 +276,9 @@ * Updates the gems database with the latest information about the surveys in this source adapter * * @param int $userId Id of the user who takes the action (for logging) - * @param bool $updateTokens Wether the tokens should be updated or not, default is true * @return array Returns an array of messages */ - public function synchronizeSurveys($userId, $updateTokens = true); + public function synchronizeSurveys($userId); /** * Updates the consent code of the the token in the source (if needed) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-12 15:23:10
|
Revision: 548 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=548&view=rev Author: mennodekker Date: 2012-03-12 15:22:59 +0000 (Mon, 12 Mar 2012) Log Message: ----------- fixing the new 'charset' attribute in sources Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__sources.20.sql Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2012-03-12 14:29:58 UTC (rev 547) +++ trunk/library/classes/Gems/Default/SourceAction.php 2012-03-12 15:22:59 UTC (rev 548) @@ -96,6 +96,7 @@ 'required', false, 'size', 15 ); + $bridge->addText('gso_ls_charset', array('size' => 15, 'description' => $in_gems)); $bridge->addExhibitor('gso_active', array('label' => $this->_('Active'), 'multiOptions' => $this->util->getTranslated()->getYesNo())); $bridge->addExhibitor('gso_status'); Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2012-03-12 14:29:58 UTC (rev 547) +++ trunk/library/configs/db/patches.sql 2012-03-12 15:22:59 UTC (rev 548) @@ -382,4 +382,4 @@ -- GEMS VERSION: 46 -- PATCH: Add charset attribute for source database -ALTER TABLE `gems__sources` ADD `gso_ls_charset` VARCHAR( 8 ) NOT NULL AFTER `gso_ls_password`; \ No newline at end of file +ALTER TABLE `gems__sources` ADD `gso_ls_charset` VARCHAR( 8 ) default NULL AFTER `gso_ls_password`; \ No newline at end of file Modified: trunk/library/configs/db/tables/gems__sources.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__sources.20.sql 2012-03-12 14:29:58 UTC (rev 547) +++ trunk/library/configs/db/tables/gems__sources.20.sql 2012-03-12 15:22:59 UTC (rev 548) @@ -11,7 +11,7 @@ `gso_ls_table_prefix` varchar(127) default NULL, `gso_ls_username` varchar(64) default NULL, `gso_ls_password` varchar(255) default NULL, - `gso_ls_charset` varchar(8) NOT NULL, + `gso_ls_charset` varchar(8) default NULL, `gso_active` tinyint(1) NOT NULL default '1', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-12 14:30:09
|
Revision: 547 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=547&view=rev Author: mennodekker Date: 2012-03-12 14:29:58 +0000 (Mon, 12 Mar 2012) Log Message: ----------- Cleanup (addSyncronizeSurveyCommands was moved to the synchronizeSurveys) Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-03-12 12:15:27 UTC (rev 546) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-03-12 14:29:58 UTC (rev 547) @@ -329,40 +329,6 @@ } /** - * Add the commands to update this source to a source synchornization batch - * - * @param Gems_Tracker_Batch_SynchronizeSourcesBatch $batch - * @param int $userId Id of the user who takes the action (for logging) - */ - public function addSynchronizeSurveyCommands(Gems_Tracker_Batch_SynchronizeSourcesBatch $batch, $userId) - { - // Surveys in LS - $lsDb = $this->getSourceDatabase(); - $select = $lsDb->select(); - $select->from($this->_getSurveysTableName(), 'sid') - ->order('sid'); - $lsSurveys = $lsDb->fetchCol($select); - $lsSurveys = array_combine($lsSurveys, $lsSurveys); - - // Surveys in Gems - $gemsSurveys = $this->_getGemsSurveysForSynchronisation(); - - foreach ($gemsSurveys as $surveyId => $sourceSurveyId) { - if (isset($lsSurveys[$sourceSurveyId])) { - $batch->addSourceFunction('checkSurvey', $sourceSurveyId, $surveyId, $userId); - } else { - $batch->addSourceFunction('checkSurvey', null, $surveyId, $userId); - } - $batch->addToSurveyCounter(); - } - - foreach (array_diff($lsSurveys, $gemsSurveys) as $sourceSurveyId) { - $batch->addSourceFunction('checkSurvey', $sourceSurveyId, null, $userId); - $batch->addToSurveyCounter(); - } - } - - /** * Check if the tableprefix exists in the source database, and change the status of this * adapter in the gems_sources table accordingly * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-12 12:15:38
|
Revision: 546 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=546&view=rev Author: mennodekker Date: 2012-03-12 12:15:27 +0000 (Mon, 12 Mar 2012) Log Message: ----------- -Moved to 1.5.3 -Added 'charset' to source database, to fix sync errors with external db -Migrated the last batch to the task system, also fixing a couple of errors with inserting new surveys Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/classes/Gems/Task/Tracker/SourceSyncSurveys.php trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php trunk/library/classes/Gems/Tracker/Source/SourceAbstract.php trunk/library/classes/Gems/Tracker/Source/SourceInterface.php trunk/library/classes/Gems/Tracker.php trunk/library/classes/Gems/Versions.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__sources.20.sql Added Paths: ----------- trunk/library/classes/Gems/Task/Tracker/SourceCommand.php Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2012-03-12 09:20:59 UTC (rev 545) +++ trunk/library/classes/Gems/Default/SourceAction.php 2012-03-12 12:15:27 UTC (rev 546) @@ -169,6 +169,7 @@ $model->set('gso_ls_dbhost', 'label', $this->_('Database host')); $model->set('gso_ls_database', 'label', $this->_('Database')); + $model->set('gso_ls_charset', 'label', $this->_('Charset')); } $model->set('gso_ls_table_prefix', 'label', $this->_('Table prefix'), 'default', 'ls__'); @@ -238,26 +239,9 @@ $batch = $this->loader->getTracker()->synchronizeSourcesBatch($sourceId, $this->loader->getCurrentUser()->getUserId()); - if ($batch->run($this->getRequest())) { - exit; - } else { - $this->html->h3( - sprintf($this->_('Synchronize the %s source.'), - $this->db->fetchOne("SELECT gso_source_name FROM gems__sources WHERE gso_id_source = ?", $sourceId))); - - if ($batch->isFinished()) { - $this->addMessage($batch->getMessages(true)); - $this->html->pInfo($batch->getRestartButton($this->_('Prepare recheck'), array('class' => 'actionlink'))); - } else { - if ($batch->count()) { - // Batch is loaded by Tracker - $this->html->pInfo($batch->getStartButton(sprintf($this->_('Check %s surveys'), $batch->getSurveyCounter()))); - $this->html->append($batch->getPanel($this->view, $batch->getProgressPercentage() . '%')); - } else { - $this->html->pInfo($this->_('No surveys to check.')); - } - } - } + $title = sprintf($this->_('Synchronize the %s source.'), + $this->db->fetchOne("SELECT gso_source_name FROM gems__sources WHERE gso_id_source = ?", $sourceId)); + $this->_helper->BatchRunner($batch, $title); } /** @@ -268,59 +252,9 @@ //* $batch = $this->loader->getTracker()->synchronizeSourcesBatch(null, $this->loader->getCurrentUser()->getUserId()); - if ($batch->run($this->getRequest())) { - exit; - } else { - $this->html->h3($this->_('Synchronize all sources.')); - - if ($batch->isFinished()) { - $this->addMessage($batch->getMessages(true)); - $this->html->pInfo($batch->getRestartButton($this->_('Prepare recheck'), array('class' => 'actionlink'))); - } else { - if ($batch->count()) { - // Batch is loaded by Tracker - $this->html->pInfo($batch->getStartButton(sprintf($this->plural('Check %s source', 'Check %s sources', $batch->getSourceCounter()), $batch->getSourceCounter()))); - $this->html->append($batch->getPanel($this->view, $batch->getProgressPercentage() . '%')); - } else { - $this->html->pInfo($this->_('No sources to check.')); - } - } - } // */ - - /* - $batch = new MUtil_Batch_WaitBatch(); - $batch->setMethodPush(5); - $batch->progressParameterName = 'waitprogress'; - // $batch->autoStart = true; - // $batch->minimalStepDurationMs = 2000; - if ($batch->run($this->getRequest())) { - exit; - } else { - if ($batch->isFinished()) { - $this->addMessage($batch->getMessages(true)); - $this->html->pInfo($batch->getRestartButton($this->_('Prepare restart'), array('class' => 'actionlink'))); - } else { - // Populate the batch (from scratch). - $batch->reset(); - if (true) { - $batch->addWaitsMs(400, 20); - $batch->addWaits(2, 1, 'Har har'); - $batch->addWaitsMs(20, 50); - } else { - $batch->addWaits(1440, 10); - //$batch->addWaits(4, 2); - //$batch->addWaits(2, 1); - //$batch->addWaitsLater(15, 1); - //$batch->addWait(4, 'That took some time!'); - //$batch->addWait(4, 'So we see the message. :)'); - //$batch->addWaitsLater(1, 2); - //$batch->addWaits(4); - } - $this->html->pInfo($batch->getStartButton($this->_('Start synchronization'))); - $this->html->append($batch->getPanel($this->view, '0%')); - } - } // */ - + $title = $this->_('Synchronize all sources.'); + $this->_helper->BatchRunner($batch, $title); + $this->html->actionLink(array('action' => 'index'), $this->_('Cancel')); } } Added: trunk/library/classes/Gems/Task/Tracker/SourceCommand.php =================================================================== --- trunk/library/classes/Gems/Task/Tracker/SourceCommand.php (rev 0) +++ trunk/library/classes/Gems/Task/Tracker/SourceCommand.php 2012-03-12 12:15:27 UTC (rev 546) @@ -0,0 +1,58 @@ +<?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 Task_Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: SourceSyncSurveys.php 528 2012-03-01 14:06:23Z mennodekker $ + */ + +/** + * Executes any command in a source for a given $sourceId + * + * @package Gems + * @subpackage Task_Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5.3 + */ +class Gems_Task_Tracker_SourceCommand extends Gems_Task_TaskAbstract +{ + public function execute($sourceId = null, $command = null) + { + $params = array_slice(func_get_args(), 2); + $source = $this->loader->getTracker()->getSource($sourceId); + $source->setBatch($this->_batch); + + if ($messages = call_user_func_array(array($source, $command), $params)) { + foreach ($messages as $message) { + $this->_batch->addMessage($command . ': ' . $message); + } + } + } +} \ No newline at end of file Modified: trunk/library/classes/Gems/Task/Tracker/SourceSyncSurveys.php =================================================================== --- trunk/library/classes/Gems/Task/Tracker/SourceSyncSurveys.php 2012-03-12 09:20:59 UTC (rev 545) +++ trunk/library/classes/Gems/Task/Tracker/SourceSyncSurveys.php 2012-03-12 12:15:27 UTC (rev 546) @@ -46,10 +46,14 @@ public function execute($id = null, $userId = null) { $source = $this->loader->getTracker()->getSource($id); + $source->setBatch($this->_batch); if (is_null($userId)) { $userId = $this->loader->getCurrentUser()->getUserId(); } + + $surveyCount = $this->_batch->addToCounter('sourceSyncSources'); + $this->_batch->setMessage('sourceSyncSources', sprintf($this->translate->plural('Check %s source', 'Check %s sources', $surveyCount), $surveyCount)); if ($messages = $source->synchronizeSurveys($userId)) { foreach ($messages as $message) { Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-03-12 09:20:59 UTC (rev 545) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-03-12 12:15:27 UTC (rev 546) @@ -399,7 +399,7 @@ { $messages = array(); $survey = $this->tracker->getSurvey($surveyId); - + if (null === $sourceSurveyId) { // Was removed $values['gsu_active'] = 0; @@ -526,6 +526,8 @@ $values['gsu_surveyor_active'] = $surveyor_active ? 1 : 0; $values['gsu_active'] = 0; $values['gsu_status'] = $surveyor_status; + $values['gsu_surveyor_id'] = $sourceSurveyId; + $values['gsu_id_source'] = $this->getId(); $messages[] = sprintf($this->translate->_('Imported the \'%s\' survey.'), $surveyor_title); } @@ -1110,6 +1112,51 @@ */ public function synchronizeSurveys($userId, $updateTokens = true) { + // Surveys in LS + $lsDb = $this->getSourceDatabase(); + $select = $lsDb->select(); + $select->from($this->_getSurveysTableName(), 'sid') + ->order('sid'); + $lsSurveys = $lsDb->fetchCol($select); + $lsSurveys = array_combine($lsSurveys, $lsSurveys); + + // Surveys in Gems + $gemsSurveys = $this->_getGemsSurveysForSynchronisation(); + + foreach ($gemsSurveys as $surveyId => $sourceSurveyId) { + if (isset($lsSurveys[$sourceSurveyId])) { + if ($this->hasBatch()) { + $this->_batch->addTask('Tracker_SourceCommand', $this->getId(), 'CheckSurvey', $sourceSurveyId, $surveyId, $userId); + } else { + $this->checkSurvey($sourceSurveyId, $surveyId, $userId); + } + } else { + if ($this->hasBatch()) { + $this->_batch->addTask('Tracker_SourceCommand', $this->getId(), 'CheckSurvey', null, $surveyId, $userId); + } else { + $this->checkSurvey(null, $surveyId, $userId); + } + } + } + + foreach (array_diff($lsSurveys, $gemsSurveys) as $sourceSurveyId) { + if ($this->hasBatch()) { + $this->_batch->addTask('Tracker_SourceCommand', $this->getId(), 'CheckSurvey', $sourceSurveyId, null, $userId); + } else { + $this->checkSurvey($sourceSurveyId, null, $userId); + } + } + } + + /** + * Updates the gems database with the latest information about the surveys in this source adapter + * + * @param int $userId Id of the user who takes the action (for logging) + * @param bool $updateTokens Wether the tokens should be updated or not, default is true + * @return array Returns an array of messages + */ + public function synchronizeSurveysOld($userId, $updateTokens = true) + { $lsDb = $this->getSourceDatabase(); $messages = array(); $source_id = $this->getId(); Modified: trunk/library/classes/Gems/Tracker/Source/SourceAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/SourceAbstract.php 2012-03-12 09:20:59 UTC (rev 545) +++ trunk/library/classes/Gems/Tracker/Source/SourceAbstract.php 2012-03-12 12:15:27 UTC (rev 546) @@ -48,6 +48,13 @@ abstract class Gems_Tracker_Source_SourceAbstract extends Gems_Registry_TargetAbstract implements Gems_Tracker_Source_SourceInterface { /** + * Holds the current batch if there is any + * + * @var Gems_Task_TaskRunnerBatch + */ + protected $_batch = null; + + /** * The database connection to Gems itself * * @var Zend_Db_Adapter_Abstract @@ -272,6 +279,10 @@ if (($dbConfig['dbname'] != $gemsName) && ($adapter = $this->_sourceData['gso_ls_adapter'])) { + //If upgrade has run and we have a 'charset' use it + if (array_key_exists('gso_ls_charset', $this->_sourceData)) { + $dbConfig['charset'] = $this->_sourceData['gso_ls_charset'] ? $this->_sourceData['gso_ls_charset'] : $gemsConfig['charset']; + } $dbConfig['host'] = $this->_sourceData['gso_ls_dbhost'] ? $this->_sourceData['gso_ls_dbhost'] : $gemsConfig['host']; $dbConfig['username'] = $this->_sourceData['gso_ls_username'] ? $this->_sourceData['gso_ls_username'] : $gemsConfig['username']; $dbConfig['password'] = $this->_sourceData['gso_ls_password'] ? $this->_sourceData['gso_ls_password'] : $gemsConfig['password']; @@ -316,6 +327,16 @@ } /** + * Returns true if a batch is set + * + * @return boolean + */ + public function hasBatch() + { + return ($this->_batch instanceof Gems_Task_TaskRunnerBatch); + } + + /** * Updates the gems__tokens table so all tokens stick to the (possibly) new token name rules. * * @param int $userId Id of the user who takes the action (for logging) @@ -334,4 +355,16 @@ return $this->_gemsDb->query($sql)->rowCount(); } + + /** + * Set the batch to be used by this source + * + * Use $this->hasBatch to check for existence + * + * @param Gems_Task_TaskRunnerBatch $batch + */ + public function setBatch(Gems_Task_TaskRunnerBatch $batch) + { + $this->_batch = $batch; + } } Modified: trunk/library/classes/Gems/Tracker/Source/SourceInterface.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/SourceInterface.php 2012-03-12 09:20:59 UTC (rev 545) +++ trunk/library/classes/Gems/Tracker/Source/SourceInterface.php 2012-03-12 12:15:27 UTC (rev 546) @@ -55,14 +55,6 @@ public function __construct(array $sourceData, Zend_Db_Adapter_Abstract $gemsDb); /** - * Add the commands to update this source to a source synchornization batch - * - * @param Gems_Tracker_Batch_SynchronizeSourcesBatch $batch - * @param int $userId Id of the user who takes the action (for logging) - */ - public function addSynchronizeSurveyCommands(Gems_Tracker_Batch_SynchronizeSourcesBatch $batch, $userId); - - /** * Inserts the token in the source (if needed) and sets those attributes the source wants to set. * * @param Gems_Tracker_Token $token @@ -233,6 +225,13 @@ public function getTokenUrl(Gems_Tracker_Token $token, $language, $surveyId, $sourceSurveyId); /** + * Returns true if a batch is set + * + * @return boolean + */ + public function hasBatch(); + + /** * Checks whether the token is in the source. * * @param Gems_Tracker_Token $token Gems token object @@ -255,6 +254,15 @@ public function isCompleted(Gems_Tracker_Token $token, $surveyId, $sourceSurveyId = null); /** + * Set the batch to be used by this source + * + * Use $this->hasBatch to check for existence + * + * @param Gems_Task_TaskRunnerBatch $batch + */ + public function setBatch(Gems_Task_TaskRunnerBatch $batch); + + /** * Sets the answers passed on. * * @param Gems_Tracker_Token $token Gems token object Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2012-03-12 09:20:59 UTC (rev 545) +++ trunk/library/classes/Gems/Tracker.php 2012-03-12 12:15:27 UTC (rev 546) @@ -469,7 +469,7 @@ $surveyId = $surveyData; } - if (! isset($this->_surveys[$surveyId])) { + if ($surveyId == null || ! isset($this->_surveys[$surveyId])) { $this->_surveys[$surveyId] = $this->_loadClass('survey', true, array($surveyData)); } @@ -877,7 +877,7 @@ public function synchronizeSourcesBatch($sourceId = null, $userId = null) { $batch_id = 'source_synch' . ($sourceId ? '_' . $sourceId : ''); - $batch = $this->_loadClass('Batch_SynchronizeSourcesBatch', true, array($batch_id)); + $batch = $this->loader->getTaskRunnerBatch($batch_id); if (! $batch->isLoaded()) { if ($sourceId) { @@ -890,7 +890,7 @@ } foreach ($sources as $source) { - $batch->addSource($source, $userId); + $batch->addTask('Tracker_SourceSyncSurveys', $source, $userId); } } Modified: trunk/library/classes/Gems/Versions.php =================================================================== --- trunk/library/classes/Gems/Versions.php 2012-03-12 09:20:59 UTC (rev 545) +++ trunk/library/classes/Gems/Versions.php 2012-03-12 12:15:27 UTC (rev 546) @@ -43,12 +43,12 @@ { public final function getBuild() { - return 45; + return 46; } public final function getGemsVersion() { - return '1.5.2'; + return '1.5.3'; } public function getProjectVersion() Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2012-03-12 09:20:59 UTC (rev 545) +++ trunk/library/configs/db/patches.sql 2012-03-12 12:15:27 UTC (rev 546) @@ -379,3 +379,7 @@ -- 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%'; + +-- GEMS VERSION: 46 +-- PATCH: Add charset attribute for source database +ALTER TABLE `gems__sources` ADD `gso_ls_charset` VARCHAR( 8 ) NOT NULL AFTER `gso_ls_password`; \ No newline at end of file Modified: trunk/library/configs/db/tables/gems__sources.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__sources.20.sql 2012-03-12 09:20:59 UTC (rev 545) +++ trunk/library/configs/db/tables/gems__sources.20.sql 2012-03-12 12:15:27 UTC (rev 546) @@ -1,30 +1,31 @@ -CREATE TABLE if not exists gems__sources ( - gso_id_source int unsigned not null auto_increment, - gso_source_name varchar(40) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' unique key not null, +CREATE TABLE IF NOT EXISTS `gems__sources` ( + `gso_id_source` int(10) unsigned NOT NULL auto_increment, + `gso_source_name` varchar(40) NOT NULL, - gso_ls_url varchar(255) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' unique key not null, - gso_ls_class varchar(60) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'Gems_Source_LimeSurvey1m8Database', - gso_ls_adapter varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gso_ls_dbhost varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gso_ls_database varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gso_ls_table_prefix varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gso_ls_username varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gso_ls_password varchar(255) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + `gso_ls_url` varchar(255) NOT NULL, + `gso_ls_class` varchar(60) NOT NULL default 'Gems_Source_LimeSurvey1m9Database', + `gso_ls_adapter` varchar(20) default NULL, + `gso_ls_dbhost` varchar(127) default NULL, + `gso_ls_database` varchar(127) default NULL, + `gso_ls_table_prefix` varchar(127) default NULL, + `gso_ls_username` varchar(64) default NULL, + `gso_ls_password` varchar(255) default NULL, + `gso_ls_charset` varchar(8) NOT NULL, - gso_active boolean not null default 1, + `gso_active` tinyint(1) NOT NULL default '1', - gso_status varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gso_last_synch timestamp null, + `gso_status` varchar(20) default NULL, + `gso_last_synch` timestamp NULL default NULL, - gso_changed timestamp not null default current_timestamp on update current_timestamp, - gso_changed_by bigint unsigned not null, - gso_created timestamp not null, - gso_created_by bigint unsigned not null, + `gso_changed` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `gso_changed_by` bigint(20) unsigned NOT NULL, + `gso_created` timestamp NOT NULL default '0000-00-00 00:00:00', + `gso_created_by` bigint(20) unsigned NOT NULL, - PRIMARY KEY(gso_id_source) - ) - ENGINE=InnoDB - auto_increment = 60 - CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; - + PRIMARY KEY (`gso_id_source`), + UNIQUE KEY `gso_source_name` (`gso_source_name`), + UNIQUE KEY `gso_ls_url` (`gso_ls_url`) +) +ENGINE=InnoDB +DEFAULT CHARSET=utf8; \ 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...> - 2012-03-12 09:21:09
|
Revision: 545 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=545&view=rev Author: mennodekker Date: 2012-03-12 09:20:59 +0000 (Mon, 12 Mar 2012) Log Message: ----------- Fixed error with survey that does not exist (yet/anymore) Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Survey.php Modified: trunk/library/classes/Gems/Tracker/Survey.php =================================================================== --- trunk/library/classes/Gems/Tracker/Survey.php 2012-03-09 15:05:30 UTC (rev 544) +++ trunk/library/classes/Gems/Tracker/Survey.php 2012-03-12 09:20:59 UTC (rev 545) @@ -191,9 +191,16 @@ public function checkRegistryRequestsAnswers() { if ($this->db && (! $this->_gemsSurvey)) { - $this->_gemsSurvey = $this->db->fetchRow("SELECT * FROM gems__surveys WHERE gsu_id_survey = ?", $this->_surveyId); + $result = $this->db->fetchRow("SELECT * FROM gems__surveys WHERE gsu_id_survey = ?", $this->_surveyId); + if ($result) { + $this->_gemsSurvey = $result; + $this->exists = true; + } else { + //Row not present, try with empty array? or should we throw an error? + $this->_gemsSurvey = array(); + $this->exists = false; + } } - $this->exists = $this->_surveyId > 0; return (boolean) $this->_gemsSurvey; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-09 15:05:40
|
Revision: 544 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=544&view=rev Author: mennodekker Date: 2012-03-09 15:05:30 +0000 (Fri, 09 Mar 2012) Log Message: ----------- Fixing unit tests, new base test class is now ControllerTestAbstract for controller test and objects that depend on the application being loaded like Gems_Util Modified Paths: -------------- trunk/library/classes/Gems/Util.php trunk/test/classes/Gems/UtilTest.php trunk/test/classes/IndexControllerTest.php Added Paths: ----------- trunk/test/classes/ControllerTestAbstract.php Modified: trunk/library/classes/Gems/Util.php =================================================================== --- trunk/library/classes/Gems/Util.php 2012-03-09 08:41:53 UTC (rev 543) +++ trunk/library/classes/Gems/Util.php 2012-03-09 15:05:30 UTC (rev 544) @@ -122,11 +122,11 @@ */ public function getConsentRejected() { - if (isset($this->project->consentRejected)) { + if ($this->project->offsetExists('consentRejected')) { return $this->project->consentRejected; } - if (isset($this->project->concentRejected)) { + if ($this->project->offsetExists('concentRejected')) { throw new Gems_Exception_Coding('project.ini setting was changed from "concentRejected" to "consentRejected", please update your project.ini'); return $this->project->concentRejected; } Added: trunk/test/classes/ControllerTestAbstract.php =================================================================== --- trunk/test/classes/ControllerTestAbstract.php (rev 0) +++ trunk/test/classes/ControllerTestAbstract.php 2012-03-09 15:05:30 UTC (rev 544) @@ -0,0 +1,29 @@ +<?php +class ControllerTestAbstract extends Zend_Test_PHPUnit_ControllerTestCase +{ + public function setUp() + { + // Zend_Application: loads the autoloader + require_once 'Zend/Application.php'; + + // Create application, bootstrap, and run + $application = new Zend_Application( + APPLICATION_ENV, + APPLICATION_PATH . '/configs/application.ini' + ); + + $this->bootstrap = $application; + + parent::setUp(); + } + + /** + * Here we fix the intentional errors that are in de default setup + * + * At the moment we only set a salt in the project resource + */ + protected function _fixSetup() { + $project = $this->bootstrap->getBootstrap()->getResource('project'); + $project->salt = 'TESTCASE'; + } +} Modified: trunk/test/classes/Gems/UtilTest.php =================================================================== --- trunk/test/classes/Gems/UtilTest.php 2012-03-09 08:41:53 UTC (rev 543) +++ trunk/test/classes/Gems/UtilTest.php 2012-03-09 15:05:30 UTC (rev 544) @@ -1,5 +1,5 @@ <?php -require_once 'IndexControllerTest.php'; +require_once 'ControllerTestAbstract.php'; /** * Copyright (c) 2011, Erasmus MC @@ -48,7 +48,7 @@ * @license New BSD License * @since Class available since version 1.0 */ -class Gems_UtilTest extends IndexControllerTest//Zend_Test_PHPUnit_ControllerTestCase +class Gems_UtilTest extends ControllerTestAbstract { /** * @var Gems_Util @@ -148,7 +148,6 @@ $this->assertEquals($expected, $actual); //Check for incorrect spelling used before 1.5.2 - unset($project->consentRejected); $project->concentRejected = 'test2'; try { $actual = $this->object->getConsentRejected(); Modified: trunk/test/classes/IndexControllerTest.php =================================================================== --- trunk/test/classes/IndexControllerTest.php 2012-03-09 08:41:53 UTC (rev 543) +++ trunk/test/classes/IndexControllerTest.php 2012-03-09 15:05:30 UTC (rev 544) @@ -1,33 +1,7 @@ <?php - -class IndexControllerTest extends Zend_Test_PHPUnit_ControllerTestCase +require_once 'ControllerTestAbstract.php'; +class IndexControllerTest extends ControllerTestAbstract { - public function setUp() - { - // Zend_Application: loads the autoloader - require_once 'Zend/Application.php'; - - // Create application, bootstrap, and run - $application = new Zend_Application( - APPLICATION_ENV, - APPLICATION_PATH . '/configs/application.ini' - ); - - $this->bootstrap = $application; - - parent::setUp(); - } - - /** - * Here we fix the intentional errors that are in de default setup - * - * At the moment we only set a salt in the project resource - */ - protected function _fixSetup() { - $project = $this->bootstrap->getBootstrap()->getResource('project'); - $project->salt = 'TESTCASE'; - } - public function testSaltRequired() { $this->dispatch('/'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-09 08:41:59
|
Revision: 543 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=543&view=rev Author: mennodekker Date: 2012-03-09 08:41:53 +0000 (Fri, 09 Mar 2012) Log Message: ----------- Release 1.5.2 version Added Paths: ----------- tags/1.5.2/ Property changes on: tags/1.5.2 ___________________________________________________________________ Added: svn:ignore + nbproject Added: svn:mergeinfo + /branches/1.5.0-pulse:306-430,467 /branches/1.5.x:426-455,458-472,475-481 /tags/1.5.0beta1:305 /tags/1.5.1:485,489,509-510 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-09 08:39:47
|
Revision: 542 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=542&view=rev Author: mennodekker Date: 2012-03-09 08:39:37 +0000 (Fri, 09 Mar 2012) Log Message: ----------- Modified Paths: -------------- trunk/library/classes/Gems/Upgrades.php Modified: trunk/library/classes/Gems/Upgrades.php =================================================================== --- trunk/library/classes/Gems/Upgrades.php 2012-03-09 08:38:44 UTC (rev 541) +++ trunk/library/classes/Gems/Upgrades.php 2012-03-09 08:39:37 UTC (rev 542) @@ -99,7 +99,7 @@ /** * To upgrade to 1.5.2 just execute patchlevel 45 */ - public function Upgrade15to151() + public function Upgrade151to152() { $this->_batch->addTask('Db_ExecutePatch', 45); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-09 08:38:50
|
Revision: 541 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=541&view=rev Author: mennodekker Date: 2012-03-09 08:38:44 +0000 (Fri, 09 Mar 2012) Log Message: ----------- Final steps before tagging 1.5.2 Modified Paths: -------------- trunk/library/changelog.txt trunk/library/classes/Gems/Upgrades.php Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2012-03-09 08:28:26 UTC (rev 540) +++ trunk/library/changelog.txt 2012-03-09 08:38:44 UTC (rev 541) @@ -1,3 +1,8 @@ +Important changes from 1.5.1 => 1.5.2 +============================================================ +Renamed project.ini setting concentRejected to consentRejected +Default consent can be changed from 'Unknown' to something else in Project.ini setting consentDefault, please check local respondentController + Important changes from 1.5.0 => 1.5.1 ============================================================ New event introduced: TrackCompletedEvent Modified: trunk/library/classes/Gems/Upgrades.php =================================================================== --- trunk/library/classes/Gems/Upgrades.php 2012-03-09 08:28:26 UTC (rev 540) +++ trunk/library/classes/Gems/Upgrades.php 2012-03-09 08:38:44 UTC (rev 541) @@ -57,6 +57,7 @@ //And add our patches $this->register('Upgrade143to15', 'Upgrade from 1.43 to 1.5'); $this->register('Upgrade15to151', 'Upgrade from 1.5.0. to 1.5.1'); + $this->register('Upgrade151to152', 'Upgrade from 1.5.1. to 1.5.2'); } @@ -94,4 +95,14 @@ return true; } + + /** + * To upgrade to 1.5.2 just execute patchlevel 45 + */ + public function Upgrade15to151() + { + $this->_batch->addTask('Db_ExecutePatch', 45); + + return true; + } } \ 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...> - 2012-03-09 08:28:35
|
Revision: 540 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=540&view=rev Author: mennodekker Date: 2012-03-09 08:28:26 +0000 (Fri, 09 Mar 2012) Log Message: ----------- Fixed incrementing login delay while still in delay period Added configurable default consent Modified Paths: -------------- trunk/library/classes/Gems/Auth.php trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/Gems/Model.php Modified: trunk/library/classes/Gems/Auth.php =================================================================== --- trunk/library/classes/Gems/Auth.php 2012-03-08 16:20:56 UTC (rev 539) +++ trunk/library/classes/Gems/Auth.php 2012-03-09 08:28:26 UTC (rev 540) @@ -110,6 +110,7 @@ public function authenticate(Zend_Auth_Adapter_Interface $adapter, array $formValues = null) { try { + $remaining = 0; $login_name = $formValues['userlogin']; $organization = $formValues['organization']; $sql = "SELECT gula_failed_logins, gula_last_failed FROM gems__user_login_attempts WHERE gula_login = ? AND gula_id_organization = ?"; @@ -159,10 +160,10 @@ $values['gula_last_failed'] = null; } else { if ($values['gula_failed_logins']) { - // MUtil_Echo::track($result->getCode(), self::ERROR_PASSWORD_DELAY); // Only increment when we have no password delay as the right password - // will not be accepted when we are in the delay. - if ($result->getCode() <> self::ERROR_PASSWORD_DELAY) { + // will not be accepted when we are in the delay. Can not check on the error + // code as it will be set to 'uncategorized' => -4 + if ($remaining>0) { $values['gula_failed_logins'] += 1; $values['gula_last_failed'] = new Zend_Db_Expr('CURRENT_TIMESTAMP'); } Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2012-03-08 16:20:56 UTC (rev 539) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2012-03-09 08:28:26 UTC (rev 540) @@ -391,7 +391,9 @@ $data = $model->applyRequest($this->getRequest(), true)->loadFirst(); } - if ($data['gr2o_consent'] == $model->get('gr2o_consent', 'default')) { + //Check if we have the 'Unknown' consent, and present a warning. The project default consent is + //normally 'Unknown' but this can be overruled in project.ini so checking for default is not right + if ($data['gr2o_consent'] == 'Unknown') { $url = $this->view->url(array('controller' => 'respondent', 'action' => 'edit', 'id' => $data['gr2o_patient_nr'])) . '#tabContainer-frag-3'; $this->addMessage(MUtil_Html::create()->a($url, $this->_('Please settle the informed consent form for this respondent.'))); } Modified: trunk/library/classes/Gems/Model.php =================================================================== --- trunk/library/classes/Gems/Model.php 2012-03-08 16:20:56 UTC (rev 539) +++ trunk/library/classes/Gems/Model.php 2012-03-09 08:28:26 UTC (rev 540) @@ -204,7 +204,7 @@ $model->setIfExists('gr2o_patient_nr', 'label', $this->translate->_('Respondent nr')); $model->setIfExists('gr2o_opened', 'label', $this->translate->_('Opened'), 'formatFunction', $translated->formatDateTime); - $model->setIfExists('gr2o_consent', 'label', $this->translate->_('Consent'), 'multiOptions', MUtil_Lazy::call($this->util->getDbLookup()->getUserConsents)); + $model->setIfExists('gr2o_consent', 'label', $this->translate->_('Consent'), 'multiOptions', MUtil_Lazy::call($this->util->getDbLookup()->getUserConsents), 'default', $this->util->getDefaultConsent()); $model->setIfExists('grs_email', 'label', $this->translate->_('E-Mail')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-08 16:21:06
|
Revision: 539 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=539&view=rev Author: matijsdejong Date: 2012-03-08 16:20:56 +0000 (Thu, 08 Mar 2012) Log Message: ----------- Updated translation ModelSnippetActionAbstract.php now has titles comparable to BrowseEditAction Modified Paths: -------------- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php trunk/library/classes/Gems/Default/MailJobAction.php trunk/library/classes/Gems/Default/MailLogAction.php trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/classes/Gems/Default/SourceAction.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 Modified: trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php =================================================================== --- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-03-08 15:44:35 UTC (rev 538) +++ trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-03-08 16:20:56 UTC (rev 539) @@ -78,7 +78,7 @@ * * @var mixed String or array of snippets name */ - protected $deleteSnippets = array('Generic_ContentTitleSnippet', 'Generic_ModelItemYesNoDeleteSnippet'); + protected $deleteSnippets = 'Generic_ModelItemYesNoDeleteSnippet'; /** * @@ -135,6 +135,37 @@ } /** + * Action for showing a create new item page with extra title + */ + public function createAction() + { + $this->createEditParameters['formTitle'] = $this->getCreateTitle(); + + parent::createAction(); + } + + /** + * Action for showing a delete item page with extra titles + */ + public function deleteAction() + { + $this->deleteParameters['displayTitle'] = $this->getDeleteTitle(); + $this->deleteParameters['deleteQuestion'] = $this->getDeleteQuestion(); + + parent::deleteAction(); + } + + /** + * Action for showing a edit item page with extra title + */ + public function editAction() + { + $this->createEditParameters['formTitle'] = $this->getEditTitle(); + + parent::editAction(); + } + + /** * Outputs the model to excel, applying all filters and searches needed * * When you want to change the output, there are two places to check: @@ -186,6 +217,46 @@ } /** + * Helper function to get the title for the create action. + * + * @return $string + */ + public function getCreateTitle() + { + return sprintf($this->_('New %s...'), $this->getTopic(1)); + } + + /** + * Helper function to get the question for the delete action. + * + * @return $string + */ + public function getDeleteQuestion() + { + return sprintf($this->_('Do you want to delete this %s?'), $this->getTopic(1)); + } + + /** + * Helper function to get the title for the delete action. + * + * @return $string + */ + public function getDeleteTitle() + { + return sprintf($this->_('Delete %s'), $this->getTopic(1)); + } + + /** + * Helper function to get the title for the edit action. + * + * @return $string + */ + public function getEditTitle() + { + return sprintf($this->_('Edit %s...'), $this->getTopic(1)); + } + + /** * Returns an array with all columns from the model that have a label * * @param array $data @@ -225,6 +296,16 @@ } /** + * Helper function to get the title for the index action. + * + * @return $string + */ + public function getIndexTitle() + { + return ucfirst($this->getTopic(100)); + } + + /** * Return the current request ID, if any. * * Overrule this function if the last item in the page title @@ -247,10 +328,20 @@ */ public function getOnEmptyText() { - return $this->_('Nothing found...'); + return sprintf($this->_('No %s found...'), $this->getTopic(0)); } /** + * Helper function to get the title for the show action. + * + * @return $string + */ + public function getShowTitle() + { + return sprintf($this->_('Showing %s'), $this->getTopic(1)); + } + + /** * Returns the current html/head/title for this page. * * If the title is an array the seperator concatenates the parts. @@ -276,11 +367,23 @@ } /** + * Helper function to allow generalized statements about the items in the model. + * + * @param int $count + * @return $string + */ + public function getTopic($count = 1) + { + return $this->plural('item', 'items', $count); + } + + /** * Action for showing a browse page */ public function indexAction() { $this->autofilterParameters = $this->autofilterParameters + $this->_autofilterExtraParameters; + $this->indexParameters['contentTitle'] = $this->getIndexTitle(); return parent::indexAction(); } @@ -299,4 +402,14 @@ parent::initHtml($reset); } + + /** + * Action for showing an item page with title + */ + public function showAction() + { + $this->showParameters['contentTitle'] = $this->getShowTitle(); + + parent::showAction(); + } } Modified: trunk/library/classes/Gems/Default/MailJobAction.php =================================================================== --- trunk/library/classes/Gems/Default/MailJobAction.php 2012-03-08 15:44:35 UTC (rev 538) +++ trunk/library/classes/Gems/Default/MailJobAction.php 2012-03-08 16:20:56 UTC (rev 539) @@ -53,16 +53,6 @@ public $project; /** - * Action for showing a create new item page - */ - public function createAction() - { - $this->createEditParameters['formTitle'] = $this->_('New automatic mail job...'); - - parent::createAction(); - } - - /** * Creates a model for getModel(). Called only for each new $action. * * The parameters allow you to easily adapt the model to the current action. The $detailed @@ -113,27 +103,6 @@ } /** - * Action for showing a delete item page - */ - public function deleteAction() - { - $this->deleteParameters['deleteQuestion'] = $this->_('Do you want to delete this mail job?'); - $this->deleteParameters['displayTitle'] = $this->deleteParameters['deleteQuestion']; - - parent::deleteAction(); - } - - /** - * Action for showing a edit item page - */ - public function editAction() - { - $this->createEditParameters['formTitle'] = $this->_('Edit automatic mail job'); - - parent::editAction(); - } - - /** * The types of mail filters * * @return array @@ -166,22 +135,31 @@ } /** - * Returns the on empty texts for the autofilter snippets + * Helper function to get the title for the index action. * - * @return string + * @return $string */ - public function getOnEmptyText() + public function getIndexTitle() { - return $this->_('No automatic mail jobs found...'); + return $this->_('Automatic mail jobs'); } /** + * Helper function to allow generalized statements about the items in the model. + * + * @param int $count + * @return $string + */ + public function getTopic($count = 1) + { + return $this->plural('automatic mail job', 'automatic mail jobs', $count); + } + + /** * Action for showing a browse page */ public function indexAction() { - $this->indexParameters['contentTitle'] = $this->_('Automatic mail jobs'); - $lock = $this->util->getCronJobLock(); if ($lock->isLocked()) { $this->addMessage(sprintf($this->_('Automatic mails have been turned off since %s.'), $lock->getLockTime())); @@ -196,14 +174,4 @@ $this->html->pInfo($this->_('With automatic mail jobs and a cron job on the server, mails can be sent without manual user action.')); } - - /** - * Action for showing an item page - */ - public function showAction() - { - $this->showParameters['displayTitle'] = $this->_('Automatic mail job details'); - - parent::showAction(); - } } Modified: trunk/library/classes/Gems/Default/MailLogAction.php =================================================================== --- trunk/library/classes/Gems/Default/MailLogAction.php 2012-03-08 15:44:35 UTC (rev 538) +++ trunk/library/classes/Gems/Default/MailLogAction.php 2012-03-08 16:20:56 UTC (rev 539) @@ -134,34 +134,23 @@ } /** - * Returns the on empty texts for the autofilter snippets + * Helper function to get the title for the index action. * - * @return string + * @return $string */ - public function getOnEmptyText() + public function getIndexTitle() { - return $this->_('No mail activity found...'); + return $this->_('Mail Activity Log'); } /** - * Action for showing a browse page + * Helper function to allow generalized statements about the items in the model. + * + * @param int $count + * @return $string */ - public function indexAction() + public function getTopic($count = 1) { - $this->indexParameters['contentTitle'] = $this->_('Mail Activity Log'); - - parent::indexAction(); + return $this->plural('mail activity', 'mail activities', $count); } - - - /** - * Action for showing an item page - */ - public function showAction() - { - $this->showParameters['displayTitle'] = $this->_('Show Mail Activity Log item'); - - // MUtil_Echo::track($this->indexParameters); - parent::showAction(); - } } Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2012-03-08 15:44:35 UTC (rev 538) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2012-03-08 16:20:56 UTC (rev 539) @@ -92,16 +92,6 @@ } /** - * Action for showing a create new item page - */ - public function createAction() - { - $this->createEditParameters['formTitle'] = $this->_('New organization...'); - - parent::createAction(); - } - - /** * Creates a model for getModel(). Called only for each new $action. * * The parameters allow you to easily adapt the model to the current action. The $detailed @@ -187,52 +177,23 @@ } /** - * Action for showing a delete item page + * Helper function to get the title for the index action. + * + * @return $string */ - public function deleteAction() + public function getIndexTitle() { - $this->indexParameters['contentTitle'] = $this->_('Delete organization'); - - parent::deleteAction(); + return $this->_('Participating organizations'); } /** - * Action for showing a edit item page - */ - public function editAction() - { - $this->createEditParameters['formTitle'] = $this->_("Edit organization"); - - parent::editAction(); - } - - /** - * Returns the on empty texts for the autofilter snippets + * Helper function to allow generalized statements about the items in the model. * - * @return string + * @param int $count + * @return $string */ - public function getOnEmptyText() + public function getTopic($count = 1) { - return $this->_('No organization found...'); + return $this->plural('organization', 'organizations', $count); } - - /** - * Action for showing a browse page - */ - public function indexAction() - { - $this->indexParameters['contentTitle'] = $this->_('Participating organizations'); - - parent::indexAction(); - } - - /** - * Action for showing an item page - */ - public function showAction() - { - $this->indexParameters['contentTitle'] = $this->_('Show organization'); - - parent::showAction(); - } } Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2012-03-08 15:44:35 UTC (rev 538) +++ trunk/library/classes/Gems/Default/SourceAction.php 2012-03-08 16:20:56 UTC (rev 539) @@ -112,7 +112,7 @@ $batch = $this->loader->getTracker()->refreshTokenAttributesBatch('sourceCheck' . $sourceId, $where); - $title = sprintf($this->_('Refreshing token attributes for for %s source.'), + $title = sprintf($this->_('Refreshing token attributes for %s source.'), $this->db->fetchOne("SELECT gso_source_name FROM gems__sources WHERE gso_id_source = ?", $sourceId)); $this->_helper->BatchRunner($batch, $title); Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2012-03-08 15:44:35 UTC (rev 538) +++ trunk/library/languages/default-en.po 2012-03-08 16:20:56 UTC (rev 539) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-02-15 14:22+0100\n" +"POT-Creation-Date: 2012-03-08 17:17+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -23,72 +23,72 @@ msgid "Path %s not writable" msgstr "Path %s not writable" -#: classes/GemsEscort.php:739 +#: classes/GemsEscort.php:743 #, php-format msgid "You are logged in as %s" msgstr "You are logged in as %s" -#: classes/GemsEscort.php:741 +#: classes/GemsEscort.php:745 #: classes/Gems/Menu.php:248 msgid "Logoff" msgstr "Logoff" -#: classes/GemsEscort.php:744 +#: classes/GemsEscort.php:748 msgid "You are not logged in" msgstr "You are not logged in" -#: classes/GemsEscort.php:927 +#: classes/GemsEscort.php:931 #, php-format msgid "User: %s" msgstr "User: %s" -#: classes/GemsEscort.php:952 +#: classes/GemsEscort.php:956 msgid "version" msgstr "version" -#: classes/GemsEscort.php:1383 +#: classes/GemsEscort.php:1387 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:1513 +#: classes/GemsEscort.php:1517 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1515 #: classes/GemsEscort.php:1519 -#: classes/GemsEscort.php:1520 +#: classes/GemsEscort.php:1523 +#: classes/GemsEscort.php:1524 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1530 +#: classes/GemsEscort.php:1534 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1532 -#: classes/GemsEscort.php:1574 +#: classes/GemsEscort.php:1536 +#: classes/GemsEscort.php:1578 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1548 +#: classes/GemsEscort.php:1552 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1550 +#: classes/GemsEscort.php:1554 #, 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:1560 -#: classes/GemsEscort.php:1572 +#: classes/GemsEscort.php:1564 +#: classes/GemsEscort.php:1576 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1561 +#: classes/GemsEscort.php:1565 msgid "You must login to access this page." msgstr "You must login to access this page." -#: classes/GemsEscort.php:1705 -#: classes/GemsEscort.php:1707 +#: classes/GemsEscort.php:1709 +#: classes/GemsEscort.php:1711 #, php-format msgid "%d survey" msgid_plural "%d surveys" @@ -103,31 +103,31 @@ msgid "Combination of organization, username and password not found." msgstr "Combination of organization, username and password not found." -#: classes/Gems/Html.php:155 +#: classes/Gems/Html.php:154 msgid "<< First" msgstr "<< First" -#: classes/Gems/Html.php:156 +#: classes/Gems/Html.php:155 msgid "< Previous" msgstr "< Previous" -#: classes/Gems/Html.php:157 +#: classes/Gems/Html.php:156 msgid "Next >" msgstr "Next >" -#: classes/Gems/Html.php:158 +#: classes/Gems/Html.php:157 msgid "Last >>" msgstr "Last >>" -#: classes/Gems/Html.php:159 +#: classes/Gems/Html.php:158 msgid " | " msgstr " | " -#: classes/Gems/Html.php:163 +#: classes/Gems/Html.php:162 msgid "to" msgstr "to" -#: classes/Gems/Html.php:164 +#: classes/Gems/Html.php:163 msgid "of" msgstr "of" @@ -324,35 +324,35 @@ msgid "Answers" msgstr "Answers" -#: classes/Gems/Menu.php:518 +#: classes/Gems/Menu.php:530 msgid "Respondents" msgstr "Patients" -#: classes/Gems/Menu.php:526 +#: classes/Gems/Menu.php:538 msgid "Overview" msgstr "Overview" -#: classes/Gems/Menu.php:533 +#: classes/Gems/Menu.php:545 msgid "Project" msgstr "Project" -#: classes/Gems/Menu.php:536 +#: classes/Gems/Menu.php:548 msgid "Setup" msgstr "Setup" -#: classes/Gems/Menu.php:539 +#: classes/Gems/Menu.php:551 msgid "Mail" msgstr "Mail" -#: classes/Gems/Menu.php:542 +#: classes/Gems/Menu.php:554 msgid "Track Builder" msgstr "Track Builder" -#: classes/Gems/Menu.php:551 +#: classes/Gems/Menu.php:563 msgid "Contact" msgstr "Contact" -#: classes/Gems/Menu.php:564 +#: classes/Gems/Menu.php:576 msgid "Changelog" msgstr "Changelog" @@ -427,47 +427,28 @@ msgid " The error message is: %s" msgstr " The error message is: %s" -#: classes/Gems/Tracker.php:753 +#: classes/Gems/Tracker.php:761 msgid "Checks performed" msgstr "Checks performed" -#: classes/Gems/Upgrades.php:69 -#: classes/Gems/Upgrades.php:71 -#, php-format -msgid "Executing patchlevel %d" -msgstr "Executing patchlevel %d" - -#: classes/Gems/Upgrades.php:76 -msgid "Creating new tables" -msgstr "Creating new tables" - -#: classes/Gems/Upgrades.php:81 +#: classes/Gems/Upgrades.php:75 msgid "Syncing surveys for all sources" msgstr "Syncing surveys for all sources" -#: classes/Gems/UpgradesAbstract.php:175 -#, php-format -msgid "Finished %s creation script for object %d of %d" -msgstr "Finished %s creation script for object %d of %d" - -#: classes/Gems/UpgradesAbstract.php:206 +#: classes/Gems/UpgradesAbstract.php:154 msgid "Already at max. level." msgstr "Already at max. level." -#: classes/Gems/UpgradesAbstract.php:213 +#: classes/Gems/UpgradesAbstract.php:161 #, php-format msgid "Trying upgrade for %s from level %s to level %s" msgstr "Trying upgrade for %s from level %s to level %s" -#: classes/Gems/UpgradesAbstract.php:221 +#: classes/Gems/UpgradesAbstract.php:169 #, php-format msgid "Trying upgrade for %s to level %s: %s" msgstr "Trying upgrade for %s to level %s: %s" -#: classes/Gems/UpgradesAbstract.php:379 -msgid "Cache cleaned" -msgstr "Cache cleaned" - #: classes/Gems/Controller/BrowseEditAction.php:354 #, php-format msgid "New %s..." @@ -557,14 +538,53 @@ #: classes/Gems/Controller/ModelActionAbstract.php:97 #: classes/Gems/Default/AskAction.php:150 -#: classes/Gems/Default/DatabaseAction.php:487 +#: classes/Gems/Default/DatabaseAction.php:488 msgid "Cancel" msgstr "Cancel" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:181 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:236 +#, php-format +msgid "Do you want to delete this %s?" +msgstr "Do you want to delete this %s?" + +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:256 +#, php-format +msgid "Edit %s..." +msgstr "Edit %s..." + +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:269 msgid "No data found." msgstr "No data found." +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:331 +#, php-format +msgid "No %s found..." +msgstr "No %s found..." + +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:341 +#, php-format +msgid "Showing %s" +msgstr "Showing %s" + +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:377 +msgid "item" +msgid_plural "items" +msgstr[0] "item" +msgstr[1] "items" + +#: classes/Gems/Controller/Action/Helper/BatchRunner.php:65 +msgid "Prepare recheck" +msgstr "Prepare recheck" + +#: classes/Gems/Controller/Action/Helper/BatchRunner.php:68 +#, php-format +msgid "Start %s jobs" +msgstr "Start %s jobs" + +#: classes/Gems/Controller/Action/Helper/BatchRunner.php:71 +msgid "Nothing to do." +msgstr "Nothing to do." + #: classes/Gems/Default/AskAction.php:128 #, php-format msgid "Welcome %s," @@ -817,180 +837,189 @@ msgid "Object is not a table." msgstr "Object is not a table." -#: classes/Gems/Default/DatabaseAction.php:246 +#: classes/Gems/Default/DatabaseAction.php:247 msgid "Structure" msgstr "Structure" -#: classes/Gems/Default/DatabaseAction.php:255 +#: classes/Gems/Default/DatabaseAction.php:256 msgid "database object" msgid_plural "database objects" msgstr[0] "database object" msgstr[1] "database objects" -#: classes/Gems/Default/DatabaseAction.php:260 +#: classes/Gems/Default/DatabaseAction.php:261 msgid "Database object overview" msgstr "Database object overview" -#: classes/Gems/Default/DatabaseAction.php:269 -#: classes/Gems/Default/DatabaseAction.php:321 +#: classes/Gems/Default/DatabaseAction.php:270 +#: classes/Gems/Default/DatabaseAction.php:322 msgid "Level" msgstr "Level" -#: classes/Gems/Default/DatabaseAction.php:270 -#: classes/Gems/Default/DatabaseAction.php:322 +#: classes/Gems/Default/DatabaseAction.php:271 +#: classes/Gems/Default/DatabaseAction.php:323 msgid "Subtype" msgstr "Subtype" -#: classes/Gems/Default/DatabaseAction.php:272 +#: classes/Gems/Default/DatabaseAction.php:273 msgid "To be executed" msgstr "To be executed" -#: classes/Gems/Default/DatabaseAction.php:273 -#: classes/Gems/Default/DatabaseAction.php:325 +#: classes/Gems/Default/DatabaseAction.php:274 +#: classes/Gems/Default/DatabaseAction.php:326 msgid "Executed" msgstr "Executed" -#: classes/Gems/Default/DatabaseAction.php:274 -#: classes/Gems/Default/DatabaseAction.php:326 +#: classes/Gems/Default/DatabaseAction.php:275 +#: classes/Gems/Default/DatabaseAction.php:327 msgid "Finished" msgstr "Finished" -#: classes/Gems/Default/DatabaseAction.php:277 +#: classes/Gems/Default/DatabaseAction.php:278 msgid "Create the patch table!" msgstr "Create the patch table!" -#: classes/Gems/Default/DatabaseAction.php:279 +#: classes/Gems/Default/DatabaseAction.php:280 #, php-format msgid "%d new or changed patch(es)." msgstr "%d new or changed patch(es)." -#: classes/Gems/Default/DatabaseAction.php:284 +#: classes/Gems/Default/DatabaseAction.php:285 msgid "Gems build" msgstr "Gems build" -#: classes/Gems/Default/DatabaseAction.php:285 +#: classes/Gems/Default/DatabaseAction.php:286 msgid "Database build" msgstr "Database build" -#: classes/Gems/Default/DatabaseAction.php:287 +#: classes/Gems/Default/DatabaseAction.php:288 msgid "Execute level" msgstr "Execute level" -#: classes/Gems/Default/DatabaseAction.php:291 +#: classes/Gems/Default/DatabaseAction.php:292 msgid "Ignore finished" msgstr "Ignore finished" -#: classes/Gems/Default/DatabaseAction.php:292 +#: classes/Gems/Default/DatabaseAction.php:293 msgid "Ignore executed" msgstr "Ignore executed" -#: classes/Gems/Default/DatabaseAction.php:293 +#: classes/Gems/Default/DatabaseAction.php:294 msgid "Show patches" msgstr "Show patches" -#: classes/Gems/Default/DatabaseAction.php:307 +#: classes/Gems/Default/DatabaseAction.php:308 #, php-format msgid "%d patch(es) executed." msgstr "%d patch(es) executed." -#: classes/Gems/Default/DatabaseAction.php:320 +#: classes/Gems/Default/DatabaseAction.php:315 +msgid "Cache cleaned" +msgstr "Cache cleaned" + +#: classes/Gems/Default/DatabaseAction.php:321 msgid "Patch" msgstr "Patch" -#: classes/Gems/Default/DatabaseAction.php:324 +#: classes/Gems/Default/DatabaseAction.php:325 msgid "Query" msgstr "Query" -#: classes/Gems/Default/DatabaseAction.php:327 +#: classes/Gems/Default/DatabaseAction.php:328 msgid "Result" msgstr "Result" -#: classes/Gems/Default/DatabaseAction.php:351 +#: classes/Gems/Default/DatabaseAction.php:352 msgid "Patch maintenance" msgstr "Patch maintenance" -#: classes/Gems/Default/DatabaseAction.php:355 +#: classes/Gems/Default/DatabaseAction.php:356 msgid "Patch overview" msgstr "Patch overview" -#: classes/Gems/Default/DatabaseAction.php:417 +#: classes/Gems/Default/DatabaseAction.php:418 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:423 +#: classes/Gems/Default/DatabaseAction.php:424 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:434 +#: classes/Gems/Default/DatabaseAction.php:435 #, php-format msgid "Run %s" msgstr "Run %s" -#: classes/Gems/Default/DatabaseAction.php:454 +#: classes/Gems/Default/DatabaseAction.php:455 #, php-format msgid "Starting %d object creation scripts." msgstr "Starting %d object creation scripts." -#: classes/Gems/Default/DatabaseAction.php:464 +#: classes/Gems/Default/DatabaseAction.php:461 +#, 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:465 msgid "All objects exist. Nothing was executed." msgstr "All objects exist. Nothing was executed." -#: classes/Gems/Default/DatabaseAction.php:470 +#: classes/Gems/Default/DatabaseAction.php:471 msgid "Create not-existing database objects" msgstr "Create not-existing database objects" -#: classes/Gems/Default/DatabaseAction.php:472 +#: classes/Gems/Default/DatabaseAction.php:473 #, 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:473 +#: classes/Gems/Default/DatabaseAction.php:474 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:486 +#: classes/Gems/Default/DatabaseAction.php:487 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:499 +#: classes/Gems/Default/DatabaseAction.php:500 msgid "Separate multiple commands with semicolons (;)." msgstr "Separate multiple commands with semicolons (;)." -#: classes/Gems/Default/DatabaseAction.php:506 +#: classes/Gems/Default/DatabaseAction.php:507 msgid "Run" msgstr "Run" -#: classes/Gems/Default/DatabaseAction.php:515 +#: classes/Gems/Default/DatabaseAction.php:516 msgid "raw" msgstr "raw" -#: classes/Gems/Default/DatabaseAction.php:525 +#: classes/Gems/Default/DatabaseAction.php:526 #, php-format msgid "Result set %s." msgstr "Result set %s." -#: classes/Gems/Default/DatabaseAction.php:548 +#: classes/Gems/Default/DatabaseAction.php:549 msgid "Execute raw SQL" msgstr "Execute raw SQL" -#: classes/Gems/Default/DatabaseAction.php:551 +#: classes/Gems/Default/DatabaseAction.php:552 msgid "Result sets" msgstr "Result sets" -#: classes/Gems/Default/DatabaseAction.php:576 +#: classes/Gems/Default/DatabaseAction.php:577 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:581 +#: classes/Gems/Default/DatabaseAction.php:582 #, php-format msgid "The data in table %s" msgstr "The data in table %s" -#: classes/Gems/Default/DatabaseAction.php:582 +#: classes/Gems/Default/DatabaseAction.php:583 #, php-format msgid "Contents of %s %s" msgstr "Contents of %s %s" @@ -1004,7 +1033,6 @@ msgstr "Export data" #: classes/Gems/Default/ExportAction.php:153 -#: classes/Gems/Default/MailJobAction.php:121 msgid "Survey" msgstr "Survey" @@ -1016,7 +1044,6 @@ #: classes/Gems/Default/ExportAction.php:172 #: classes/Gems/Default/IndexAction.php:203 #: classes/Gems/Default/LogAction.php:197 -#: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organization" @@ -1030,7 +1057,6 @@ msgstr "Role" #: classes/Gems/Default/GroupAction.php:92 -#: classes/Gems/Default/MailJobAction.php:104 msgid "Active" msgstr "Active" @@ -1247,141 +1273,130 @@ msgid "Log maintenance" msgstr "Log maintenance" -#: classes/Gems/Default/MailJobAction.php:62 -msgid "No automatic mail jobs found..." -msgstr "No automatic mail jobs found..." - -#: classes/Gems/Default/MailJobAction.php:72 -msgid "New automatic mail job..." -msgstr "New automatic mail job..." - -#: classes/Gems/Default/MailJobAction.php:100 +#: classes/Gems/Default/MailJobAction.php:78 +#: classes/Gems/Default/MailLogAction.php:118 msgid "Template" msgstr "Template" -#: classes/Gems/Default/MailJobAction.php:101 +#: classes/Gems/Default/MailJobAction.php:79 msgid "By staff member" msgstr "By staff member" -#: classes/Gems/Default/MailJobAction.php:103 +#: classes/Gems/Default/MailJobAction.php:81 msgid "Used for logging and possibly from address." msgstr "Used for logging and possibly from address." -#: classes/Gems/Default/MailJobAction.php:106 +#: classes/Gems/Default/MailJobAction.php:84 msgid "Job is only run when active." msgstr "Job is only run when active." -#: classes/Gems/Default/MailJobAction.php:109 +#: classes/Gems/Default/MailJobAction.php:87 msgid "From address used" msgstr "From address used" -#: classes/Gems/Default/MailJobAction.php:111 +#: classes/Gems/Default/MailJobAction.php:89 msgid "From other" msgstr "From other" -#: classes/Gems/Default/MailJobAction.php:112 +#: classes/Gems/Default/MailJobAction.php:90 #, php-format msgid "Only when '%s' is '%s'." msgstr "Only when '%s' is '%s'." -#: classes/Gems/Default/MailJobAction.php:114 +#: classes/Gems/Default/MailJobAction.php:92 msgid "Processing Method" msgstr "Processing Method" -#: classes/Gems/Default/MailJobAction.php:115 +#: classes/Gems/Default/MailJobAction.php:93 msgid "Filter for" msgstr "Filter for" -#: classes/Gems/Default/MailJobAction.php:116 +#: classes/Gems/Default/MailJobAction.php:94 msgid "Days between reminders" msgstr "Days between reminders" -#: 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:143 -msgid "Edit automatic mail job" -msgstr "Edit automatic mail job" - -#: classes/Gems/Default/MailJobAction.php:156 +#: classes/Gems/Default/MailJobAction.php:113 msgid "First mail" msgstr "First mail" -#: classes/Gems/Default/MailJobAction.php:157 +#: classes/Gems/Default/MailJobAction.php:114 msgid "Reminder" msgstr "Reminder" -#: classes/Gems/Default/MailJobAction.php:168 +#: classes/Gems/Default/MailJobAction.php:125 msgid "Use organizational from address" msgstr "Use organizational from address" -#: classes/Gems/Default/MailJobAction.php:171 +#: classes/Gems/Default/MailJobAction.php:128 #, php-format msgid "Use site %s address" msgstr "Use site %s address" -#: classes/Gems/Default/MailJobAction.php:174 +#: classes/Gems/Default/MailJobAction.php:131 msgid "Use the 'By staff member' address" msgstr "Use the 'By staff member' address" -#: classes/Gems/Default/MailJobAction.php:175 +#: classes/Gems/Default/MailJobAction.php:132 msgid "Other" msgstr "Other" -#: classes/Gems/Default/MailJobAction.php:185 +#: classes/Gems/Default/MailJobAction.php:144 msgid "Automatic mail jobs" msgstr "Automatic mail jobs" -#: classes/Gems/Default/MailJobAction.php:189 +#: classes/Gems/Default/MailJobAction.php:155 +msgid "automatic mail job" +msgid_plural "automatic mail jobs" +msgstr[0] "automatic mail job" +msgstr[1] "automatic mail jobs" + +#: classes/Gems/Default/MailJobAction.php:165 #, 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 +#: classes/Gems/Default/MailJobAction.php:169 msgid "Turn Automatic Mail Jobs ON" msgstr "Turn Automatic Mail Jobs ON" -#: classes/Gems/Default/MailJobAction.php:199 +#: classes/Gems/Default/MailJobAction.php:175 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:207 -msgid "Automatic mail job details" -msgstr "Automatic mail job details" - -#: classes/Gems/Default/MailLogAction.php:107 +#: classes/Gems/Default/MailLogAction.php:109 msgid "Date sent" msgstr "Date sent" -#: classes/Gems/Default/MailLogAction.php:108 +#: classes/Gems/Default/MailLogAction.php:110 msgid "Receiver" msgstr "Receiver" -#: classes/Gems/Default/MailLogAction.php:109 +#: classes/Gems/Default/MailLogAction.php:111 msgid "To address" msgstr "To address" -#: classes/Gems/Default/MailLogAction.php:110 +#: classes/Gems/Default/MailLogAction.php:112 msgid "Sender" msgstr "Sender" -#: classes/Gems/Default/MailLogAction.php:111 +#: classes/Gems/Default/MailLogAction.php:113 msgid "From address" msgstr "From address" -#: classes/Gems/Default/MailLogAction.php:113 +#: classes/Gems/Default/MailLogAction.php:115 #: classes/Gems/Default/MailTemplateAction.php:62 msgid "Subject" msgstr "Subject" -#: classes/Gems/Default/MailLogAction.php:129 +#: classes/Gems/Default/MailLogAction.php:143 msgid "Mail Activity Log" msgstr "Mail Activity Log" -#: classes/Gems/Default/MailLogAction.php:140 -msgid "Show Mail Activity Log item" -msgstr "Show Mail Activity Log item" +#: classes/Gems/Default/MailLogAction.php:154 +msgid "mail activity" +msgid_plural "mail activities" +msgstr[0] "mail activity" +msgstr[1] "mail activities" #: classes/Gems/Default/MailServerAction.php:68 msgid "From address [part]" @@ -1489,8 +1504,8 @@ msgstr "Login Name" #: classes/Gems/Default/OptionAction.php:188 -#: classes/Gems/Default/OrganizationAction.php:139 -#: classes/Gems/Default/RespondentAction.php:173 +#: classes/Gems/Default/OrganizationAction.php:129 +#: classes/Gems/Default/RespondentAction.php:175 #: classes/Gems/Default/StaffAction.php:319 msgid "Language" msgstr "Language" @@ -1508,12 +1523,6 @@ msgid "Date / time" msgstr "Date / time" -#: 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" @@ -1522,124 +1531,113 @@ msgid "Invalid organization." msgstr "Invalid organization." -#: classes/Gems/Default/OrganizationAction.php:99 -msgid "New organization..." -msgstr "New organization..." - -#: classes/Gems/Default/OrganizationAction.php:123 +#: classes/Gems/Default/OrganizationAction.php:113 msgid "Url" msgstr "Url" -#: classes/Gems/Default/OrganizationAction.php:124 +#: classes/Gems/Default/OrganizationAction.php:114 msgid "Task" msgstr "Task" -#: classes/Gems/Default/OrganizationAction.php:125 +#: classes/Gems/Default/OrganizationAction.php:115 msgid "Contact name" msgstr "Contact name" -#: classes/Gems/Default/OrganizationAction.php:126 +#: classes/Gems/Default/OrganizationAction.php:116 msgid "Contact email" msgstr "Contact email" -#: classes/Gems/Default/OrganizationAction.php:129 +#: classes/Gems/Default/OrganizationAction.php:119 msgid "Style" msgstr "Style" -#: classes/Gems/Default/OrganizationAction.php:133 +#: classes/Gems/Default/OrganizationAction.php:123 msgid "Default url" msgstr "Default url" -#: classes/Gems/Default/OrganizationAction.php:135 +#: classes/Gems/Default/OrganizationAction.php:125 #, php-format msgid "Always switch to this organization when %s is accessed from this url" msgstr "Always switch to this organization when %s is accessed from this url" -#: classes/Gems/Default/OrganizationAction.php:143 +#: classes/Gems/Default/OrganizationAction.php:133 msgid "Can the organization be used?" msgstr "Can the organization be used?" -#: classes/Gems/Default/OrganizationAction.php:144 +#: classes/Gems/Default/OrganizationAction.php:134 msgid "Can people login for this organization?" msgstr "Can people login for this organization?" -#: classes/Gems/Default/OrganizationAction.php:145 +#: classes/Gems/Default/OrganizationAction.php:135 msgid "Accepting" msgstr "Accepting" -#: classes/Gems/Default/OrganizationAction.php:145 +#: classes/Gems/Default/OrganizationAction.php:135 msgid "Can new respondents be added to the organization?" msgstr "Can new patients be added to the organization?" -#: classes/Gems/Default/OrganizationAction.php:146 +#: classes/Gems/Default/OrganizationAction.php:136 msgid "Does the organization have respondents?" msgstr "Does the organization have patients?" -#: classes/Gems/Default/OrganizationAction.php:147 +#: classes/Gems/Default/OrganizationAction.php:137 msgid "Respondent group" msgstr "Patient group" -#: classes/Gems/Default/OrganizationAction.php:147 +#: classes/Gems/Default/OrganizationAction.php:137 msgid "Allows respondents to login." msgstr "Allow patients to login." -#: classes/Gems/Default/OrganizationAction.php:151 +#: classes/Gems/Default/OrganizationAction.php:141 msgid "Greeting" msgstr "Greeting" -#: classes/Gems/Default/OrganizationAction.php:151 -#: classes/Gems/Default/OrganizationAction.php:152 +#: classes/Gems/Default/OrganizationAction.php:141 +#: classes/Gems/Default/OrganizationAction.php:142 msgid "For emails and token forward screen." msgstr "For emails and token forward screen." -#: classes/Gems/Default/OrganizationAction.php:152 +#: classes/Gems/Default/OrganizationAction.php:142 msgid "Signature" msgstr "Signature" -#: classes/Gems/Default/OrganizationAction.php:154 +#: classes/Gems/Default/OrganizationAction.php:144 msgid "Accessible by" msgstr "Accessible by" -#: classes/Gems/Default/OrganizationAction.php:154 +#: classes/Gems/Default/OrganizationAction.php:144 msgid "Checked organizations see this organizations respondents." msgstr "Checked organizations see this organizations patients." -#: classes/Gems/Default/OrganizationAction.php:164 +#: classes/Gems/Default/OrganizationAction.php:154 msgid "Code name" msgstr "Code name" -#: classes/Gems/Default/OrganizationAction.php:164 +#: classes/Gems/Default/OrganizationAction.php:154 msgid "Only for programmers." msgstr "Only for programmers." -#: classes/Gems/Default/OrganizationAction.php:174 +#: classes/Gems/Default/OrganizationAction.php:164 msgid "This can not be changed yet" msgstr "This can not be changed yet" -#: classes/Gems/Default/OrganizationAction.php:176 +#: classes/Gems/Default/OrganizationAction.php:166 #: classes/Gems/Default/StaffAction.php:131 msgid "User Definition" msgstr "User Definition" -#: classes/Gems/Default/OrganizationAction.php:194 -msgid "Delete organization" -msgstr "Delete organization" - -#: classes/Gems/Default/OrganizationAction.php:204 -msgid "Edit organization" -msgstr "Edit organization" - -#: classes/Gems/Default/OrganizationAction.php:214 +#: classes/Gems/Default/OrganizationAction.php:186 msgid "Participating organizations" msgstr "Participating organizations" -#: classes/Gems/Default/OrganizationAction.php:224 -msgid "Show organization" -msgstr "Show organization" +#: classes/Gems/Default/OrganizationAction.php:197 +msgid "organization" +msgid_plural "organizations" +msgstr[0] "organization" +msgstr[1] "organizations" #: 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] "survey" @@ -1762,19 +1760,16 @@ msgstr "Session" #: classes/Gems/Default/ProjectSurveysAction.php:68 -#: classes/Gems/Default/SurveyAction.php:192 msgid "By" msgstr "By" #: classes/Gems/Default/ProjectSurveysAction.php:69 #: classes/Gems/Default/ProjectTracksAction.php:67 -#: classes/Gems/Default/SurveyAction.php:193 msgid "From" msgstr "From" #: classes/Gems/Default/ProjectSurveysAction.php:70 #: classes/Gems/Default/ProjectTracksAction.php:68 -#: classes/Gems/Default/SurveyAction.php:195 msgid "Until" msgstr "Until" @@ -1802,7 +1797,6 @@ msgstr "Questions in survey %s" #: 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." @@ -1895,90 +1889,89 @@ msgid "Enter a 9-digit SSN number." msgstr "Enter a 9-digit BSN number." -#: classes/Gems/Default/RespondentAction.php:131 +#: classes/Gems/Default/RespondentAction.php:127 msgid "Identification" msgstr "Identification" -#: classes/Gems/Default/RespondentAction.php:132 +#: classes/Gems/Default/RespondentAction.php:134 msgid "SSN" msgstr "BSN" -#: classes/Gems/Default/RespondentAction.php:136 +#: classes/Gems/Default/RespondentAction.php:138 msgid "Patient number" msgstr "Patient number" -#: classes/Gems/Default/RespondentAction.php:145 +#: classes/Gems/Default/RespondentAction.php:147 msgid "Medical data" msgstr "Medical data" -#: classes/Gems/Default/RespondentAction.php:152 +#: classes/Gems/Default/RespondentAction.php:154 msgid "DBC's, etc..." msgstr "DBC's, etc..." -#: classes/Gems/Default/RespondentAction.php:155 +#: classes/Gems/Default/RespondentAction.php:157 msgid "Contact information" msgstr "Contact information" -#: classes/Gems/Default/RespondentAction.php:160 +#: classes/Gems/Default/RespondentAction.php:162 msgid "Respondent has no e-mail" msgstr "Patient has no e-mail" -#: classes/Gems/Default/RespondentAction.php:161 +#: classes/Gems/Default/RespondentAction.php:163 msgid "With housenumber" msgstr "With housenumber" -#: classes/Gems/Default/RespondentAction.php:168 +#: classes/Gems/Default/RespondentAction.php:170 msgid "Country" msgstr "Country" -#: classes/Gems/Default/RespondentAction.php:172 +#: classes/Gems/Default/RespondentAction.php:174 msgid "Settings" msgstr "Settings" -#: classes/Gems/Default/RespondentAction.php:174 +#: classes/Gems/Default/RespondentAction.php:176 msgid "Has the respondent signed the informed consent letter?" msgstr "Has the patient signed the informed consent letter?" -#: classes/Gems/Default/RespondentAction.php:204 +#: classes/Gems/Default/RespondentAction.php:206 msgid "Comments" msgstr "Comments" -#: classes/Gems/Default/RespondentAction.php:205 +#: classes/Gems/Default/RespondentAction.php:207 msgid "Treatment" msgstr "Treatment" -#: classes/Gems/Default/RespondentAction.php:233 +#: classes/Gems/Default/RespondentAction.php:235 msgid "Rejection code" msgstr "Rejection code" -#: classes/Gems/Default/RespondentAction.php:240 +#: classes/Gems/Default/RespondentAction.php:242 msgid "Delete respondent" msgstr "Delete patient" -#: classes/Gems/Default/RespondentAction.php:272 +#: classes/Gems/Default/RespondentAction.php:274 msgid "Respondent deleted." msgstr "Patient deleted" -#: classes/Gems/Default/RespondentAction.php:276 +#: classes/Gems/Default/RespondentAction.php:278 msgid "Respondent tracks stopped." msgstr "Patient tracks stopped." -#: classes/Gems/Default/RespondentAction.php:280 +#: classes/Gems/Default/RespondentAction.php:282 msgid "Choose a reception code to delete." msgstr "Choose a reception code to delete." -#: classes/Gems/Default/RespondentAction.php:324 +#: classes/Gems/Default/RespondentAction.php:326 msgid "respondent" msgid_plural "respondents" msgstr[0] "patient" msgstr[1] "patients" -#: classes/Gems/Default/RespondentAction.php:394 +#: classes/Gems/Default/RespondentAction.php:396 msgid "Please settle the informed consent form for this respondent." msgstr "Please settle the informed consent form for this patient." #: classes/Gems/Default/RespondentPlanAction.php:67 -#: classes/Gems/Default/SurveyAction.php:171 msgid "Show respondent" msgstr "Show patient" @@ -2071,95 +2064,91 @@ msgid "Database Password" msgstr "Database Password" -#: classes/Gems/Default/SourceAction.php:116 +#: classes/Gems/Default/SourceAction.php:115 #, php-format +msgid "Refreshing token attributes for %s source." +msgstr "Refreshing token attributes for %s source." + +#: classes/Gems/Default/SourceAction.php:131 +#, php-format msgid "Checking survey results for %s source." msgstr "Checking survey results for %s source." -#: classes/Gems/Default/SourceAction.php:121 -#: classes/Gems/Default/SourceAction.php:145 -msgid "Prepare recheck" -msgstr "Prepare recheck" - -#: classes/Gems/Default/SourceAction.php:125 -#: classes/Gems/Default/SourceAction.php:149 -#, php-format -msgid "Check %s tokens" -msgstr "Check %s tokens" - -#: classes/Gems/Default/SourceAction.php:128 -#: classes/Gems/Default/SourceAction.php:152 -msgid "No tokens to check." -msgstr "No tokens to check." - -#: classes/Gems/Default/SourceAction.php:141 +#: classes/Gems/Default/SourceAction.php:143 msgid "Checking survey results for all sources." msgstr "Checking survey results for all sources." -#: classes/Gems/Default/SourceAction.php:175 +#: classes/Gems/Default/SourceAction.php:164 msgid "Source Url" msgstr "Source Url" -#: classes/Gems/Default/SourceAction.php:177 +#: classes/Gems/Default/SourceAction.php:166 msgid "Adaptor class" msgstr "Adaptor class" -#: classes/Gems/Default/SourceAction.php:179 +#: classes/Gems/Default/SourceAction.php:168 msgid "Database Server" msgstr "Database Server" -#: classes/Gems/Default/SourceAction.php:181 +#: classes/Gems/Default/SourceAction.php:170 msgid "Database host" msgstr "Database host" -#: classes/Gems/Default/SourceAction.php:185 +#: classes/Gems/Default/SourceAction.php:174 msgid "Table prefix" msgstr "Table prefix" -#: classes/Gems/Default/SourceAction.php:189 +#: classes/Gems/Default/SourceAction.php:178 msgid "Last check" msgstr "Last check" -#: classes/Gems/Default/SourceAction.php:222 +#: classes/Gems/Default/SourceAction.php:211 msgid "source" msgid_plural "sources" msgstr[0] "source" msgstr[1] "sources" -#: classes/Gems/Default/SourceAction.php:227 +#: classes/Gems/Default/SourceAction.php:216 msgid "Survey Sources" msgstr "Survey Sources" -#: classes/Gems/Default/SourceAction.php:235 +#: classes/Gems/Default/SourceAction.php:224 msgid "This installation is active." msgstr "This installation is active." -#: classes/Gems/Default/SourceAction.php:237 +#: classes/Gems/Default/SourceAction.php:226 msgid "Inactive installation." msgstr "Inactive installation." -#: classes/Gems/Default/SourceAction.php:250 -#: classes/Gems/Default/SourceAction.php:269 -msgid "No changes." -msgstr "No changes." +#: classes/Gems/Default/SourceAction.php:245 +#, php-format +msgid "Synchronize the %s source." +msgstr "Synchronize the %s source." -#: classes/Gems/Default/SourceAction.php:265 +#: classes/Gems/Default/SourceAction.php:254 #, php-format -msgid "Synchronization of source %s:" -msgstr "Synchronization of source %s:" +msgid "Check %s surveys" +msgstr "Check %s surveys" -#: classes/Gems/Default/SourceAction.php:276 -msgid "Synchronize all sources of surveys" -msgstr "Synchronize all sources of surveys" +#: classes/Gems/Default/SourceAction.php:257 +msgid "No surveys to check." +msgstr "No surveys to check." -#: classes/Gems/Default/SourceAction.php:277 -msgid "Synchronization will update the status of all surveys imported into this project to the status at the sources." -msgstr "Synchronization will update the status of all surveys imported into this project to the status at the sources." +#: classes/Gems/Default/SourceAction.php:274 +msgid "Synchronize all sources." +msgstr "Synchronize all sources." -#: classes/Gems/Default/SourceAction.php:318 -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/SourceAction.php:282 +#, php-format +msgid "Check %s source" +msgid_plural "Check %s sources" +msgstr[0] "Check %s source" +msgstr[1] "Check %s sources" +#: classes/Gems/Default/SourceAction.php:285 +msgid "No sources to check." +msgstr "No sources to check." + #: classes/Gems/Default/StaffAction.php:137 msgid "Unsupported UserDefinition" msgstr "Unsupported UserDefinition" @@ -2291,51 +2280,51 @@ msgid "Survey should be assigned to a group before making it active." msgstr "Survey should be assigned to a group before making it active." -#: classes/Gems/Default/SurveyMaintenanceAction.php:277 +#: classes/Gems/Default/SurveyMaintenanceAction.php:276 #, php-format msgid "Checking survey results for the %s survey." msgstr "Checking survey results for the %s survey." -#: classes/Gems/Default/SurveyMaintenanceAction.php:302 +#: classes/Gems/Default/SurveyMaintenanceAction.php:288 msgid "Checking survey results for all surveys." msgstr "Checking survey results for all surveys." -#: classes/Gems/Default/SurveyMaintenanceAction.php:379 +#: classes/Gems/Default/SurveyMaintenanceAction.php:352 msgid "Source" msgstr "Source" -#: classes/Gems/Default/SurveyMaintenanceAction.php:380 +#: classes/Gems/Default/SurveyMaintenanceAction.php:353 msgid "Status in source" msgstr "Status in source" -#: classes/Gems/Default/SurveyMaintenanceAction.php:383 +#: classes/Gems/Default/SurveyMaintenanceAction.php:356 msgid "Active in source" msgstr "Active in source" -#: classes/Gems/Default/SurveyMaintenanceAction.php:384 +#: classes/Gems/Default/SurveyMaintenanceAction.php:357 #, php-format msgid "Active in %s" msgstr "Active in %s" -#: classes/Gems/Default/SurveyMaintenanceAction.php:391 +#: classes/Gems/Default/SurveyMaintenanceAction.php:364 msgid "Single" msgstr "Single" -#: classes/Gems/Default/SurveyMaintenanceAction.php:424 +#: classes/Gems/Default/SurveyMaintenanceAction.php:397 #, php-format msgid "%d times in track." msgstr "%d times in track." -#: classes/Gems/Default/SurveyMaintenanceAction.php:426 +#: classes/Gems/Default/SurveyMaintenanceAction.php:399 #, php-format msgid "%d times in %d track(s)." msgstr "%d times in %d track(s)." -#: classes/Gems/Default/SurveyMaintenanceAction.php:430 +#: classes/Gems/Default/SurveyMaintenanceAction.php:403 msgid "Not used in track." msgstr "Not used in track." -#: classes/Gems/Default/SurveyMaintenanceAction.php:432 +#: classes/Gems/Default/SurveyMaintenanceAction.php:405 msgid "Not used in tracks." msgstr "Not used in tracks." @@ -2666,31 +2655,27 @@ msgid "Rounds" msgstr "Rounds" -#: classes/Gems/Default/UpgradeAction.php:85 +#: classes/Gems/Default/UpgradeAction.php:93 #, php-format msgid "Upgrading %s" msgstr "Upgrading %s" -#: classes/Gems/Default/UpgradeAction.php:95 -msgid "Back" -msgstr "Back" - -#: classes/Gems/Default/UpgradeAction.php:126 -#: classes/Gems/Default/UpgradeAction.php:153 +#: classes/Gems/Default/UpgradeAction.php:124 +#: classes/Gems/Default/UpgradeAction.php:151 msgid "Context" msgstr "Context" -#: classes/Gems/Default/UpgradeAction.php:127 +#: classes/Gems/Default/UpgradeAction.php:125 msgid "Max level" msgstr "Max level" -#: classes/Gems/Default/UpgradeAction.php:182 +#: classes/Gems/Default/UpgradeAction.php:180 #, php-format msgid "Context %s not found!" msgstr "Context %s not found!" -#: classes/Gems/Default/UpgradeAction.php:191 -#: classes/Gems/Default/UpgradeAction.php:195 +#: classes/Gems/Default/UpgradeAction.php:189 +#: classes/Gems/Default/UpgradeAction.php:193 msgid "Upgrades" msgstr "Upgrades" @@ -2714,35 +2699,35 @@ msgid "You do not have an e-mail address." msgstr "You do not have an e-mail address." -#: classes/Gems/Email/EmailFormAbstract.php:289 +#: classes/Gems/Email/EmailFormAbstract.php:291 msgid "Preview HTML" msgstr "Preview HTML" -#: classes/Gems/Email/EmailFormAbstract.php:298 +#: classes/Gems/Email/EmailFormAbstract.php:300 msgid "Preview text" msgstr "Preview text" -#: classes/Gems/Email/EmailFormAbstract.php:330 +#: classes/Gems/Email/EmailFormAbstract.php:332 msgid "Send" msgstr "Send" -#: classes/Gems/Email/EmailFormAbstract.php:427 +#: classes/Gems/Email/EmailFormAbstract.php:429 msgid "Input error! No changes made!" msgstr "Input error! No changes made!" -#: classes/Gems/Email/EmailFormAbstract.php:444 +#: classes/Gems/Email/EmailFormAbstract.php:446 msgid "Subject:" msgstr "Subject:" -#: classes/Gems/Email/EmailFormAbstract.php:472 +#: classes/Gems/Email/EmailFormAbstract.php:474 msgid "Field" msgstr "Field" -#: classes/Gems/Email/EmailFormAbstract.php:473 +#: classes/Gems/Email/EmailFormAbstract.php:475 msgid "Value" msgstr "Value" -#: classes/Gems/Email/EmailFormAbstract.php:476 +#: classes/Gems/Email/EmailFormAbstract.php:478 msgid "BBCode info page" msgstr "BBCode info page" @@ -2800,12 +2785,12 @@ msgid "The sending of emails was blocked for this installation." msgstr "The sending of emails was blocked for this installation." -#: classes/Gems/Email/OneMailForm.php:140 +#: classes/Gems/Email/OneMailForm.php:141 #: classes/Gems/Email/TemplateMailer.php:250 msgid "Mail failed to send." msgstr "Mail failed to send." -#: classes/Gems/Email/OneMailForm.php:144 +#: classes/Gems/Email/OneMailForm.php:145 #, php-format msgid "Sent email to %s." msgstr "Sent email to %s." @@ -2843,89 +2828,93 @@ msgid "Some help for this export" msgstr "Some help for this export" -#: classes/Gems/Menu/MenuAbstract.php:243 +#: classes/Gems/Menu/MenuAbstract.php:247 msgid "Activity log" msgstr "Activity Log" -#: classes/Gems/Menu/MenuAbstract.php:249 +#: classes/Gems/Menu/MenuAbstract.php:253 msgid "Automatic mail" msgstr "Automatic mail" -#: classes/Gems/Menu/MenuAbstract.php:250 +#: classes/Gems/Menu/MenuAbstract.php:254 msgid "Turn Automatic Mail Jobs OFF" msgstr "Turn Automatic Mail Jobs OFF" -#: classes/Gems/Menu/MenuAbstract.php:254 +#: classes/Gems/Menu/MenuAbstract.php:258 msgid "Servers" msgstr "Servers" -#: classes/Gems/Menu/MenuAbstract.php:258 +#: classes/Gems/Menu/MenuAbstract.php:262 msgid "Templates" msgstr "Templates" -#: classes/Gems/Menu/MenuAbstract.php:290 +#: classes/Gems/Menu/MenuAbstract.php:294 msgid "By period" msgstr "By period" -#: classes/Gems/Menu/MenuAbstract.php:291 +#: classes/Gems/Menu/MenuAbstract.php:295 msgid "By token" msgstr "By token" -#: classes/Gems/Menu/MenuAbstract.php:292 +#: classes/Gems/Menu/MenuAbstract.php:296 msgid "By respondent" msgstr "By patient" -#: classes/Gems/Menu/MenuAbstract.php:296 +#: classes/Gems/Menu/MenuAbstract.php:300 msgid "Bulk mail" msgstr "Bulk mail" -#: classes/Gems/Menu/MenuAbstract.php:314 +#: classes/Gems/Menu/MenuAbstract.php:318 msgid "Errors" msgstr "Errors" -#: classes/Gems/Menu/MenuAbstract.php:315 +#: classes/Gems/Menu/MenuAbstract.php:319 msgid "PHP" msgstr "PHP" -#: classes/Gems/Menu/MenuAbstract.php:318 +#: classes/Gems/Menu/MenuAbstract.php:322 msgid "Maintenance mode" msgstr "Maintenance mode" -#: classes/Gems/Menu/MenuAbstract.php:319 +#: classes/Gems/Menu/MenuAbstract.php:323 msgid "Clean cache" msgstr "Clean cache" -#: classes/Gems/Menu/MenuAbstract.php:412 +#: classes/Gems/Menu/MenuAbstract.php:415 msgid "Check status" msgstr "Check status" -#: classes/Gems/Menu/MenuAbstract.php:413 +#: classes/Gems/Menu/MenuAbstract.php:416 msgid "Synchronize surveys" msgstr "Synchronize surveys" -#: classes/Gems/Menu/MenuAbstract.php:414 -#: classes/Gems/Menu/MenuAbstract.php:425 +#: classes/Gems/Menu/MenuAbstract.php:417 +#: classes/Gems/Menu/MenuAbstract.php:429 msgid "Check answers" msgstr "Check answers" -#: classes/Gems/Menu/MenuAbstract.php:415 +#: classes/Gems/Menu/MenuAbstract.php:418 +msgid "Check attributes" +msgstr "Check attributes" + +#: classes/Gems/Menu/MenuAbstract.php:419 msgid "Synchronize all surveys" msgstr "Synchronize all surveys" -#: classes/Gems/Menu/MenuAbstract.php:416 -#: classes/Gems/Menu/MenuAbstract.php:426 +#: classes/Gems/Menu/MenuAbstract.php:420 +#: classes/Gems/Menu/MenuAbstract.php:430 msgid "Check all answers" msgstr "Check all answers" -#: classes/Gems/Menu/MenuAbstract.php:422 +#: classes/Gems/Menu/MenuAbstract.php:426 msgid "PDF" msgstr "PDF" -#: classes/Gems/Menu/MenuAbstract.php:456 +#: classes/Gems/Menu/MenuAbstract.php:460 msgid "Check assignments" msgstr "Check assignments" -#: classes/Gems/Menu/MenuAbstract.php:459 +#: classes/Gems/Menu/MenuAbstract.php:463 msgid "Check all assignments" msgstr "Check all assignments" @@ -3110,65 +3099,82 @@ msgid "Answered surveys" msgstr "Answered surveys" -#: classes/Gems/Tracker/ChangeTracker.php:64 -#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:110 +#: classes/Gems/Task/Db/ExecutePatch.php:66 #, php-format -msgid "Checked %d tracks." -msgstr "Checked %d tracks." +msgid "Executing patchlevel %d" +msgstr "Executing patchlevel %d" -#: classes/Gems/Tracker/ChangeTracker.php:67 -#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:113 +#: classes/Gems/Task/Tracker/CheckTokenCompletion.php:74 #, php-format -msgid "Checked %d tokens." -msgstr "Checked %d tokens." - -#: classes/Gems/Tracker/ChangeTracker.php:72 -#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:118 -#, php-format msgid "Answers changed by survey completion event for %d tokens." msgstr "Answers changed by survey completion event for %d tokens." -#: classes/Gems/Tracker/ChangeTracker.php:75 -#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:121 +#: classes/Gems/Task/Tracker/CheckTokenCompletion.php:78 #, php-format msgid "Results and timing changed for %d tokens." msgstr "Results and timing changed for %d tokens." +#: classes/Gems/Task/Tracker/CheckTokenCompletion.php:81 +#, php-format +msgid "Checked %d tokens." +msgstr "Checked %d tokens." + +#: classes/Gems/Task/Tracker/CheckTrackTokens.php:64 +#, php-format +msgid "%2$d token date changes in %1$d tracks." +msgstr "%2$d token date changes in %1$d tracks." + +#: classes/Gems/Task/Tracker/CheckTrackTokens.php:67 +#, php-format +msgid "Checked %d tracks." +msgstr "Checked %d tracks." + +#: classes/Gems/Task/Tracker/ProcessTokenCompletion.php:70 #: classes/Gems/Tracker/ChangeTracker.php:78 -#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:124 #, php-format msgid "%d token round completion events caused changed to %d tokens." msgstr "%d token round completion events caused changed to %d tokens." -#: classes/Gems/Tracker/ChangeTracker.php:81 -#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:127 +#: classes/Gems/Task/Tracker/RefreshTokenAttributes.php:67 #, php-format -msgid "%2$d token date changes in %1$d tracks." -msgstr "%2$d token date changes in %1$d tracks." +msgid "%d token out of %d tokens changed." +msgid_plural "%d tokens out of %d tokens changed." +msgstr[0] "%d token out of %d tokens changed." +msgstr[1] "%d tokens out of %d tokens changed." #: classes/Gems/Tracker/ChangeTracker.php:84 -#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:130 #, php-format msgid "Round changes propagated to %d tokens." msgstr "Round changes propagated to %d tokens." #: classes/Gems/Tracker/ChangeTracker.php:87 -#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:133 #, php-format msgid "%d tokens deleted by round changes." msgstr "%d tokens deleted by round changes." #: classes/Gems/Tracker/ChangeTracker.php:90 -#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:136 #, php-format msgid "%d tokens created to by round changes." msgstr "%d tokens cr... [truncated message content] |
From: <gem...@li...> - 2012-03-08 15:44:45
|
Revision: 538 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=538&view=rev Author: mennodekker Date: 2012-03-08 15:44:35 +0000 (Thu, 08 Mar 2012) Log Message: ----------- Fixed unit tests, added tests and updated default project.ini also added consentDefault to let a project overrule the global default 'Unknown' Modified Paths: -------------- trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/Util.php trunk/library/classes/GemsEscort.php trunk/new_project/application/configs/project.ini trunk/test/bootstrap.php trunk/test/classes/Gems/UtilTest.php Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2012-03-08 10:40:53 UTC (rev 537) +++ trunk/library/classes/Gems/User/User.php 2012-03-08 15:44:35 UTC (rev 538) @@ -601,7 +601,8 @@ if ($menuItem) { // Prevent redirecting to the current page. if (! ($menuItem->is('controller', $request->getControllerName()) && $menuItem->is('action', $request->getActionName()))) { - echo $menuItem->get('label') . '<br/>'; + //Probably a debug statement so commented out MD20120308 + //echo $menuItem->get('label') . '<br/>'; $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector'); $redirector->gotoRoute($menuItem->toRouteUrl($request), null, true); Modified: trunk/library/classes/Gems/Util.php =================================================================== --- trunk/library/classes/Gems/Util.php 2012-03-08 10:40:53 UTC (rev 537) +++ trunk/library/classes/Gems/Util.php 2012-03-08 15:44:35 UTC (rev 538) @@ -113,15 +113,33 @@ } + /** + * Retrieve the consentCODE to use for rejected responses by the survey system + * The mapping of actual consents to consentCODEs is done in the gems__consents table + * + * @return string Default value is 'do not use' + * @throws Gems_Exception_Coding + */ public function getConsentRejected() { + if (isset($this->project->consentRejected)) { + return $this->project->consentRejected; + } + if (isset($this->project->concentRejected)) { + throw new Gems_Exception_Coding('project.ini setting was changed from "concentRejected" to "consentRejected", please update your project.ini'); return $this->project->concentRejected; } return 'do not use'; } + /** + * Retrieve the array of possible consentCODEs to use for responses by the survey system + * The mapping of actual consents to consentCODEs is done in the gems__consents table + * + * @return array Default consent codes are 'do not use' and 'consent given' + */ public function getConsentTypes() { if (isset($this->project->consentTypes)) { @@ -172,7 +190,23 @@ } /** + * Get the default user consent * + * This is de consent description from gems__consents, not the consentCODE + * + * @return string + */ + public function getDefaultConsent() + { + if (isset($this->project->consentDefault)) { + return $this->project->consentDefault; + } + + return 'Unkown'; + } + + /** + * * @return Gems_Util_DbLookup */ public function getDbLookup() Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-03-08 10:40:53 UTC (rev 537) +++ trunk/library/classes/GemsEscort.php 2012-03-08 15:44:35 UTC (rev 538) @@ -1488,9 +1488,6 @@ */ public function routeShutdown(Zend_Controller_Request_Abstract $request) { - // Npow is a good time to check for required values - $this->project->checkRequiredValues(); - $loader = $this->getLoader(); $user = $loader->getCurrentUser(); @@ -1502,6 +1499,10 @@ $this->menu = $loader->createMenu($this); $this->_updateVariable('menu'); + // Now is a good time to check for required values + // Moved down here to prevent unit test from failing on missing salt + $this->project->checkRequiredValues(); + $source = $this->menu->getParameterSource(); $this->getLoader()->getOrganization()->applyToMenuSource($source); Modified: trunk/new_project/application/configs/project.ini =================================================================== --- trunk/new_project/application/configs/project.ini 2012-03-08 10:40:53 UTC (rev 537) +++ trunk/new_project/application/configs/project.ini 2012-03-08 15:44:35 UTC (rev 538) @@ -187,7 +187,7 @@ layoutPrepare.dojo = 0 layoutPrepare.jQuery = 1 -layoutPrepare.login.class = rightFloat +layoutPrepareArgs.login.class = rightFloat ;layoutPrepareArgs.contact.class = rightFloat layoutPrepareArgs.time.class = rightFloat layoutPrepareArgs.user.class = rightFloat @@ -276,6 +276,13 @@ tokens.from = 01; tokens.to = ol; +;--------------------------------------------------------- +; CONSENT SECTION +;--------------------------------------------------------- +consentRejected = 'do not use' +consentTypes = 'do not use|consent given' +consentDefault = 'Unknown' ;Default setup makes this 'do not use' + [testing : production] admin.user = superadmin admin.pwd = superadmin Modified: trunk/test/bootstrap.php =================================================================== --- trunk/test/bootstrap.php 2012-03-08 10:40:53 UTC (rev 537) +++ trunk/test/bootstrap.php 2012-03-08 15:44:35 UTC (rev 538) @@ -42,12 +42,12 @@ * Setup environment */ define('GEMS_WEB_DIR', dirname(__FILE__)); -define('GEMS_ROOT_DIR', '../new_project'); -define('GEMS_LIBRARY_DIR', '../library'); +define('GEMS_ROOT_DIR', realpath(dirname(__FILE__) . '/../new_project')); +define('GEMS_LIBRARY_DIR', realpath(dirname(__FILE__) . '/../library')); define('GEMS_PROJECT_NAME', 'newProject'); define('GEMS_PROJECT_NAME_UC', ucfirst(GEMS_PROJECT_NAME)); define('APPLICATION_ENV', 'testing'); -define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/' . GEMS_ROOT_DIR . '/application')); +define('APPLICATION_PATH', GEMS_ROOT_DIR . '/application'); $GLOBALS['GEMS_DIRS'] = array( GEMS_PROJECT_NAME_UC => APPLICATION_PATH . '/classes', @@ -62,6 +62,7 @@ set_include_path( $path . '/library/classes' . PATH_SEPARATOR . GEMS_ROOT_DIR . '/application/classes' . PATH_SEPARATOR . + GEMS_WEB_DIR . '/classes' . PATH_SEPARATOR . get_include_path()); // Set up autoload. Modified: trunk/test/classes/Gems/UtilTest.php =================================================================== --- trunk/test/classes/Gems/UtilTest.php 2012-03-08 10:40:53 UTC (rev 537) +++ trunk/test/classes/Gems/UtilTest.php 2012-03-08 15:44:35 UTC (rev 538) @@ -1,4 +1,5 @@ <?php +require_once 'IndexControllerTest.php'; /** * Copyright (c) 2011, Erasmus MC @@ -38,6 +39,8 @@ /** * Test class for Gems_Util * + * As this class depends on all sorts of stuff being loaded we extend the IndexControllerTest + * * @author Michiel Rook <mi...@to...> * @package Gems * @subpackage Util @@ -45,32 +48,115 @@ * @license New BSD License * @since Class available since version 1.0 */ -class Gems_UtilTest extends PHPUnit_Framework_TestCase +class Gems_UtilTest extends IndexControllerTest//Zend_Test_PHPUnit_ControllerTestCase { - public function testAllowedIP1() { + /** + * @var Gems_Util + */ + protected $object; + + public function setUp() + { + parent::setUp(); + + //Fix errors in the default config + $this->_fixSetup(); + + //Now load the object we are going to test + $this->object = GemsEscort::getInstance()->loader->getUtil(); + } + + public function testAllowedIP1() + { $this->assertTrue(Gems_Util::isAllowedIP('10.0.0.1', '10.0.0.0-10.0.0.255')); } - public function testAllowedIP2() { + public function testAllowedIP2() + { $this->assertFalse(Gems_Util::isAllowedIP('10.0.1.1', '10.0.0.0-10.0.0.255')); } - public function testAllowedIP3() { + public function testAllowedIP3() + { $this->assertTrue(Gems_Util::isAllowedIP('127.0.0.1', '127.0.0.1')); } - public function testAllowedIP4() { + public function testAllowedIP4() + { $this->assertFalse(Gems_Util::isAllowedIP('127.0.0.1', '192.168.0.1')); } - public function testAllowedIP5() { + public function testAllowedIP5() + { $this->assertTrue(Gems_Util::isAllowedIP('127.0.0.1', '192.168.0.1|127.0.0.1')); } - - public function testAllowedIPEmptyRange() { + + public function testAllowedIPEmptyRange() + { $this->assertTrue(Gems_Util::isAllowedIP('127.0.0.1', '')); } + public function testConsentTypes() + { + //check the ini file to be the default + $expected = array( + 'do not use' => 'do not use', + 'consent given' => 'consent given' + ); + $actual = $this->object->getConsentTypes(); + $this->assertEquals($expected, $actual); + + //Check if we can read from an altered ini file + $project = GemsEscort::getInstance()->project; + $project->consentTypes = 'test|test2|test3'; + $expected = array( + 'test' => 'test', + 'test2' => 'test2', + 'test3' => 'test3', + ); + $actual = $this->object->getConsentTypes(); + $this->assertEquals($expected, $actual); + + //Check for class default when not found in ini + unset($project->consentTypes); + $expected = array( + 'do not use' => 'do not use', + 'consent given' => 'consent given' + ); + $actual = $this->object->getConsentTypes(); + $this->assertEquals($expected, $actual); + } + + public function testConsentRejected() + { + //Check the ini default + $expected = 'do not use'; + $actual = $this->object->getConsentRejected(); + $this->assertEquals($expected, $actual); + + //Check if we can read from an altered ini file + $project = GemsEscort::getInstance()->project; + $expected = 'test'; + $project->consentRejected = $expected; + $actual = $this->object->getConsentRejected(); + $this->assertEquals($expected, $actual); + + //Check for class default when not found in ini + unset($project->consentRejected); + $expected = 'do not use'; + $actual = $this->object->getConsentRejected(); + $this->assertEquals($expected, $actual); + + //Check for incorrect spelling used before 1.5.2 + unset($project->consentRejected); + $project->concentRejected = 'test2'; + try { + $actual = $this->object->getConsentRejected(); + } catch (Exception $e) { + } + $this->assertInstanceOf('Gems_Exception_Coding', $e, 'No failure on misspelled concentRejected in project.ini'); + } + /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-08 10:41:04
|
Revision: 537 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=537&view=rev Author: mennodekker Date: 2012-03-08 10:40:53 +0000 (Thu, 08 Mar 2012) Log Message: ----------- Updated jquery for better display of tabs and progress bars Modified Paths: -------------- trunk/templates/erasmusmc/css/jquery-mc.css Modified: trunk/templates/erasmusmc/css/jquery-mc.css =================================================================== --- trunk/templates/erasmusmc/css/jquery-mc.css 2012-03-08 10:06:27 UTC (rev 536) +++ trunk/templates/erasmusmc/css/jquery-mc.css 2012-03-08 10:40:53 UTC (rev 537) @@ -1,20 +1,21 @@ /* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ + * jQuery UI CSS Framework 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ /* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ +.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } +.ui-helper-clearfix:after { clear: both; } +.ui-helper-clearfix { zoom: 1; } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } @@ -37,43 +38,49 @@ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - /* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,Helvetica,Sans-serif&fwDefault=normal&fsDefault=100%&cornerRadius=4px&bgColorHeader=6dc3f1&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=0000a0&fcHeader=000000&iconColorHeader=0000a0&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=0000a0&fcContent=000000&iconColorContent=0000a0&bgColorDefault=dadada&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=05_inset_soft.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px -*/ + * jQuery UI CSS Framework 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ctl=themeroller&ffDefault=Verdana,Arial,Helvetica,Sans-serif&fwDefault=normal&fsDefault=100%&cornerRadius=4px&bgColorHeader=6dc3f1&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=0000a0&fcHeader=000000&iconColorHeader=0000a0&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=0000a0&fcContent=000000&iconColorContent=0000a0&bgColorDefault=dadada&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=05_inset_soft.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ /* Component containers ----------------------------------*/ .ui-widget { font-family: Verdana,Arial,Helvetica,Sans-serif; font-size: 100%; } +.ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,Helvetica,Sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #0000a0; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #000000; border: 0px;} +.ui-widget-content { border: 1px solid #0000a0; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #000000; } .ui-widget-content a { color: #000000; } .ui-widget-header { border: 1px solid #0000a0; background: #6dc3f1 url(images/ui-bg_highlight-soft_75_6dc3f1_1x100.png) 50% 50% repeat-x; color: #000000; font-weight: bold; } .ui-widget-header a { color: #000000; } /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; outline: none; text-decoration: none; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_inset-soft_95_fef1ec_1x100.png) 50% bottom repeat-x; color: #cd0a0a; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_inset-soft_95_fef1ec_1x100.png) 50% bottom repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } /* Icons ----------------------------------*/ @@ -224,6 +231,8 @@ .ui-icon-seek-next { background-position: -32px -160px; } .ui-icon-seek-prev { background-position: -48px -160px; } .ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ .ui-icon-seek-first { background-position: -80px -160px; } .ui-icon-stop { background-position: -96px -160px; } .ui-icon-eject { background-position: -112px -160px; } @@ -268,56 +277,185 @@ ----------------------------------*/ /* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } /* Overlays */ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Resizable -----------------------------------*/ +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Resizable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ .ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Accordion -----------------------------------*/ +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Accordion 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } .ui-accordion .ui-accordion-li-fix { display: inline; } .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } +/* + * jQuery UI Autocomplete 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.18 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: hidden; *overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; border: 1px solid darkblue; } +/* + * jQuery UI Slider 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } .ui-slider-horizontal { height: .8em; } .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } @@ -329,20 +467,34 @@ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* + * jQuery UI Tabs 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; border-left: 1px solid darkBlue; border-bottom: 1px solid darkBlue; border-right: 1px solid darkBlue;} +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } .ui-tabs .ui-tabs-hide { display: none !important; } -/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } +/* + * jQuery UI Datepicker 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } @@ -352,11 +504,10 @@ .ui-datepicker .ui-datepicker-next-hover { right:1px; } .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } .ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } .ui-datepicker td { border: 0; padding: 1px; } @@ -375,7 +526,7 @@ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } @@ -401,9 +552,35 @@ left: -4px; /*must have*/ width: 200px; /*must have*/ height: 200px; /*must have*/ -}/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } +}/* + * jQuery UI Progressbar 1.8.18 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; overflow: hidden; } .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } -.ui-tabs-nav {-moz-border-radius-bottomleft: 0px; -webkit-border-bottom-left-radius: 0px; -moz-border-radius-bottomright: 0px; -webkit-border-bottom-right-radius: 0px; } \ No newline at end of file +/* custom changes */ +.ui-helper-hidden-accessible { clip: auto; } /* fix datepicker wont display */ +.ui-tabs-nav {-moz-border-radius-bottomleft: 0px; -webkit-border-bottom-left-radius: 0px; -moz-border-radius-bottomright: 0px; -webkit-border-bottom-right-radius: 0px; } +.ui-tabs .ui-tabs-nav li {font-size: 0.8em;} +.ui-widget {font-size: 100%;} +#tabContainer.ui-widget-content { border: 0px;} +.ui-widget-content.ui-datepicker { border: 1px solid #0000A0; } +.ui-tabs .ui-tabs-panel { + padding: 1em 1.4em; + display: block; + border-width: 0; + background: none; + border-left: 1px solid #0000A0; + border-bottom: 1px solid #0000A0; + border-right: 1px solid #0000A0; +} + +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { + border-color: #0000A0; +} \ 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...> - 2012-03-08 10:06:37
|
Revision: 536 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=536&view=rev Author: matijsdejong Date: 2012-03-08 10:06:27 +0000 (Thu, 08 Mar 2012) Log Message: ----------- $_SERVER['HTTP_HOST'] does not exist on all systems (apparently) Modified Paths: -------------- trunk/new_project/htdocs/index.php Modified: trunk/new_project/htdocs/index.php =================================================================== --- trunk/new_project/htdocs/index.php 2012-03-08 10:05:43 UTC (rev 535) +++ trunk/new_project/htdocs/index.php 2012-03-08 10:06:27 UTC (rev 536) @@ -63,7 +63,7 @@ $env = getenv('APPLICATION_ENV'); } else { // Erasmus MC processing - if (strpos($_SERVER["HTTP_HOST"], 'survey') === false) { + if (isset($_SERVER["HTTP_HOST"]) && (strpos($_SERVER["HTTP_HOST"], 'survey') === false)) { $env = 'testing'; } else { $env = 'production'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-08 10:05:54
|
Revision: 535 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=535&view=rev Author: matijsdejong Date: 2012-03-08 10:05:43 +0000 (Thu, 08 Mar 2012) Log Message: ----------- Merged revision(s) 534 from tags/1.5.1/library: isset($this->{non existing prop}) causes PHP error ........ Modified Paths: -------------- trunk/library/classes/Gems/Project/ProjectSettings.php Property Changed: ---------------- trunk/library/ Property changes on: trunk/library ___________________________________________________________________ Modified: svn:mergeinfo - /branches/1.5.0-pulse/library:306-344,346,467 /branches/1.5.x/library:426-455,458-472,475-481 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 /tags/1.5.1/library:485,489,509-510 + /branches/1.5.0-pulse/library:306-344,346,467 /branches/1.5.x/library:426-455,458-472,475-481 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 /tags/1.5.1/library:485,489,509-510,534 Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2012-03-08 10:01:02 UTC (rev 534) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2012-03-08 10:05:43 UTC (rev 535) @@ -193,7 +193,7 @@ */ public function getAccountDelayFactor() { - if (isset($this->account) && isset($this->account['delayFactor'])) { + if ($this->offsetExists('account') && isset($this->account['delayFactor'])) { return intval($this->account['delayFactor']); } else { return 4; @@ -279,7 +279,7 @@ // MUtil_Echo::track($codes); $rules = array(); - if (isset($this->passwords) && is_array($this->passwords)) { + if ($this->offsetExists('passwords') && is_array($this->passwords)) { $this->_getPasswordRules($this->passwords, $codes, $rules); } @@ -293,7 +293,7 @@ */ public function getSessionTimeOut() { - if (isset($this->session, $this->session['idleTimeout'])) { + if ($this->offsetExists('session') && isset($this->session['idleTimeout'])) { return $this->session['idleTimeout']; } else { return $this->defaultSessionTimeout; @@ -307,7 +307,7 @@ */ public function getSuperAdminName() { - if (isset($this->admin) && isset($this->admin['user'])) { + if ($this->offsetExists('admin') && isset($this->admin['user'])) { return trim($this->admin['user']); } } @@ -319,7 +319,7 @@ */ protected function getSuperAdminPassword() { - if (isset($this->admin) && isset($this->admin['pwd'])) { + if ($this->offsetExists('admin') && isset($this->admin['pwd'])) { return trim($this->admin['pwd']); } } @@ -331,7 +331,7 @@ */ public function getSuperAdminIPRanges() { - if (isset($this->admin['ipRanges'])) { + if ($this->offsetExists('admin') && isset($this->admin['ipRanges'])) { return $this->admin['ipRanges']; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-08 10:01:08
|
Revision: 534 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=534&view=rev Author: matijsdejong Date: 2012-03-08 10:01:02 +0000 (Thu, 08 Mar 2012) Log Message: ----------- isset($this->{non existing prop}) causes PHP error Modified Paths: -------------- tags/1.5.1/library/classes/Gems/Project/ProjectSettings.php Modified: tags/1.5.1/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- tags/1.5.1/library/classes/Gems/Project/ProjectSettings.php 2012-03-06 11:51:15 UTC (rev 533) +++ tags/1.5.1/library/classes/Gems/Project/ProjectSettings.php 2012-03-08 10:01:02 UTC (rev 534) @@ -193,7 +193,7 @@ */ public function getAccountDelayFactor() { - if (isset($this->account) && isset($this->account['delayFactor'])) { + if ($this->offsetExists('account') && isset($this->account['delayFactor'])) { return intval($this->account['delayFactor']); } else { return 4; @@ -264,7 +264,7 @@ // MUtil_Echo::track($codes); $rules = array(); - if (isset($this->passwords) && is_array($this->passwords)) { + if ($this->offsetExists('passwords') && is_array($this->passwords)) { $this->_getPasswordRules($this->passwords, $codes, $rules); } @@ -278,7 +278,7 @@ */ public function getSessionTimeOut() { - if (isset($this->session, $this->session['idleTimeout'])) { + if ($this->offsetExists('session') && isset($this->session['idleTimeout'])) { return $this->session['idleTimeout']; } else { return $this->defaultSessionTimeout; @@ -292,7 +292,7 @@ */ public function getSuperAdminName() { - if (isset($this->admin) && isset($this->admin['user'])) { + if ($this->offsetExists('admin') && isset($this->admin['user'])) { return trim($this->admin['user']); } } @@ -304,7 +304,7 @@ */ protected function getSuperAdminPassword() { - if (isset($this->admin) && isset($this->admin['pwd'])) { + if ($this->offsetExists('admin') && isset($this->admin['pwd'])) { return trim($this->admin['pwd']); } } @@ -316,7 +316,7 @@ */ public function getSuperAdminIPRanges() { - if (isset($this->admin['ipRanges'])) { + if ($this->offsetExists('admin') && isset($this->admin['ipRanges'])) { return $this->admin['ipRanges']; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-06 11:51:26
|
Revision: 533 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=533&view=rev Author: mennodekker Date: 2012-03-06 11:51:15 +0000 (Tue, 06 Mar 2012) Log Message: ----------- Fixed problem with display of answers for dual scale questions Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2012-03-01 16:41:08 UTC (rev 532) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2012-03-06 11:51:15 UTC (rev 533) @@ -241,6 +241,7 @@ $map[$row1['sgq']] = $row1; $row2 = $row; + $row2['scale_id'] = 1; $row2['sgq'] .= $row['sq_title'] . '#1'; $row2['code'] = $row['title'] . '_' . $row['sq_title'] . '#1'; $row2['sq_question1'] = $this->_getQuestionAttribute($row['qid'], 'dualscale_headerB', 'scale 2'); @@ -619,16 +620,13 @@ // Juggle the labels for sub-questions etc.. if (isset($field['sq_question'])) { - if (isset($field['sq_question1'])) { - $tmpres['label'] = MUtil_Html::raw(sprintf($this->translate->_('%s: %s'), $field['sq_question'], $field['sq_question1'])); - } - if (! isset($tmpres['label'])) { - $tmpres['label'] = MUtil_Html::raw($this->removeHtml($field['sq_question'])); - } else { + if (isset($tmpres['label'])) { // Add non answered question for grouping $model->set('_' . $name . '_', $tmpres); - - // "Next" question + } + if (isset($field['sq_question1'])) { + $tmpres['label'] = MUtil_Html::raw(sprintf($this->translate->_('%s: %s'), $this->removeHtml($field['sq_question']), $this->removeHtml($field['sq_question1']))); + } else { $tmpres['label'] = MUtil_Html::raw($this->removeHtml($field['sq_question'])); } $tmpres['thClass'] = 'question_sub'; 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:41:19
|
Revision: 532 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=532&view=rev Author: matijsdejong Date: 2012-03-01 16:41:08 +0000 (Thu, 01 Mar 2012) Log Message: ----------- Second round in simplifying ModelSnippetActionAbstract Modified Paths: -------------- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php trunk/library/classes/Gems/Default/MailJobAction.php trunk/library/classes/Gems/Default/MailLogAction.php trunk/library/classes/Gems/Default/OrganizationAction.php Added Paths: ----------- trunk/library/snippets/Generic/AutosearchFormSnippet.php trunk/library/snippets/Generic/ContentTitleSnippet.php Removed Paths: ------------- trunk/library/snippets/Generic/AutosearchForm.php Modified: trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php =================================================================== --- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-03-01 16:05:31 UTC (rev 531) +++ trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-03-01 16:41:08 UTC (rev 532) @@ -56,7 +56,7 @@ 'browse' => true, 'containingId' => 'autofilter_target', 'keyboard' => true, - 'onEmpty' => 'getOnEmpty', + 'onEmpty' => 'getOnEmptyText', ); /** @@ -78,7 +78,7 @@ * * @var mixed String or array of snippets name */ - protected $deleteSnippets = 'Generic_ModelItemYesNoDeleteSnippet'; + protected $deleteSnippets = array('Generic_ContentTitleSnippet', 'Generic_ModelItemYesNoDeleteSnippet'); /** * @@ -97,7 +97,7 @@ * * @var mixed String or array of snippets name */ - protected $indexStartSnippets = 'Generic_AutosearchForm'; + protected $indexStartSnippets = array('Generic_ContentTitleSnippet', 'Generic_AutosearchFormSnippet'); /** * The snippets used for the index action, after those in autofilter @@ -111,7 +111,7 @@ * * @var mixed String or array of snippets name */ - protected $showSnippets = 'Generic_ModelItemTableSnippet'; + protected $showSnippets = array('Generic_ContentTitleSnippet', 'Generic_ModelItemTableSnippet'); /** * @@ -245,7 +245,7 @@ * * @return string */ - public function getOnEmpty() + public function getOnEmptyText() { return $this->_('Nothing found...'); } Modified: trunk/library/classes/Gems/Default/MailJobAction.php =================================================================== --- trunk/library/classes/Gems/Default/MailJobAction.php 2012-03-01 16:05:31 UTC (rev 531) +++ trunk/library/classes/Gems/Default/MailJobAction.php 2012-03-01 16:41:08 UTC (rev 532) @@ -170,7 +170,7 @@ * * @return string */ - public function getOnEmpty() + public function getOnEmptyText() { return $this->_('No automatic mail jobs found...'); } @@ -180,7 +180,7 @@ */ public function indexAction() { - $this->html->h3($this->_('Automatic mail jobs')); + $this->indexParameters['contentTitle'] = $this->_('Automatic mail jobs'); $lock = $this->util->getCronJobLock(); if ($lock->isLocked()) { Modified: trunk/library/classes/Gems/Default/MailLogAction.php =================================================================== --- trunk/library/classes/Gems/Default/MailLogAction.php 2012-03-01 16:05:31 UTC (rev 531) +++ trunk/library/classes/Gems/Default/MailLogAction.php 2012-03-01 16:41:08 UTC (rev 532) @@ -138,7 +138,7 @@ * * @return string */ - public function getOnEmpty() + public function getOnEmptyText() { return $this->_('No mail activity found...'); } @@ -148,7 +148,7 @@ */ public function indexAction() { - $this->html->h3($this->_('Mail Activity Log')); + $this->indexParameters['contentTitle'] = $this->_('Mail Activity Log'); parent::indexAction(); } Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2012-03-01 16:05:31 UTC (rev 531) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2012-03-01 16:41:08 UTC (rev 532) @@ -191,7 +191,7 @@ */ public function deleteAction() { - $this->html->h3($this->_('Delete organization')); + $this->indexParameters['contentTitle'] = $this->_('Delete organization'); parent::deleteAction(); } @@ -211,7 +211,7 @@ * * @return string */ - public function getOnEmpty() + public function getOnEmptyText() { return $this->_('No organization found...'); } @@ -221,7 +221,7 @@ */ public function indexAction() { - $this->html->h3($this->_('Participating organizations')); + $this->indexParameters['contentTitle'] = $this->_('Participating organizations'); parent::indexAction(); } @@ -231,7 +231,7 @@ */ public function showAction() { - $this->html->h3($this->_('Show organization')); + $this->indexParameters['contentTitle'] = $this->_('Show organization'); parent::showAction(); } Deleted: trunk/library/snippets/Generic/AutosearchForm.php =================================================================== --- trunk/library/snippets/Generic/AutosearchForm.php 2012-03-01 16:05:31 UTC (rev 531) +++ trunk/library/snippets/Generic/AutosearchForm.php 2012-03-01 16:41:08 UTC (rev 532) @@ -1,237 +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_AutosearchForm extends MUtil_Snippets_SnippetAbstract -{ - /** - * - * @var string The id of a div that contains target that should be replaced. - */ - protected $containingId; - - /** - * - * @var MUtil_Model_ModelAbstract - */ - protected $model; - - /** - * - * @var Zend_Controller_Request_Abstract - */ - protected $request; - - /** - * Optional, otherwise created from $util - * - * @var Gems_Util_RequestCache - */ - public $requestCache; - - /** - * - * @var Gems_Util - */ - protected $util; - - /** - * - * @var string Id for auto search button - */ - protected $searchButtonId = 'AUTO_SEARCH_TEXT_BUTTON'; - - - /** - * 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->util && (! $this->requestCache)) { - $this->requestCache = $this->util->getRequestCache(); - } - if ($this->requestCache) { - // Do not store searchButtonId - $this->requestCache->removeParams($this->searchButtonId); - } - - return parent::checkRegistryRequestsAnswers(); - } - - /** - * Creates the form itself - * - * @param array $options - * @return Gems_Form - */ - protected function createForm($options = null) - { - $form = new Gems_Form($options); - - return $form; - } - - /** - * Returns a text element for autosearch. Can be overruled. - * - * The form / html elements to search on. Elements can be grouped by inserting null's between them. - * That creates a distinct group of elements - * - * @param array $data The $form field values (can be usefull, but no need to set them) - * @return array Of Zend_Form_Element's or static tekst to add to the html or null for group breaks. - */ - protected function getAutoSearchElements(array $data) - { - // Search text - $element = new Zend_Form_Element_Text($this->model->getTextFilter(), array('label' => $this->_('Free search text'), 'size' => 20, 'maxlength' => 30)); - - return array($element); - } - - /** - * Creates an autosearch form for indexAction. - * - * @return Gems_Form|null - */ - protected function getAutoSearchForm() - { - $data = $this->getSearchData(); - - $elements = $this->getAutoSearchElements($data); - - if ($elements) { - $form = $this->createForm(array('name' => 'autosubmit')); // Assign a name so autosubmit will only work on this form (when there are others) - $form->setHtml('div'); - - $div = $form->getHtml(); - $div->class = 'search'; - - $span = $div->div(array('class' => 'inputgroup')); - - $elements[] = $this->getAutoSearchSubmit(); - - foreach ($elements as $element) { - if ($element instanceof Zend_Form_Element) { - if ($element->getLabel()) { - $span->label($element); - } - $span->input($element); - // TODO: Elementen automatisch toevoegen in MUtil_Form - $form->addElement($element); - } elseif (null === $element) { - $span = $div->div(array('class' => 'inputgroup')); - } else { - $span[] = $element; - } - } - - if ($this->request->isPost()) { - if (! $form->isValid($data)) { - $this->addMessage($form->getErrorMessages()); - $this->addMessage($form->getMessages()); - } - } else { - $form->populate($data); - } - - $href = $this->getAutoSearchHref(); - $form->setAutoSubmit($href, $this->containingId); - - return $form; - } - } - - /** - * - * @return string Href attribute for type as you go autofilter - */ - protected function getAutoSearchHref() - { - return MUtil_Html::attrib('href', array('action' => 'autofilter', $this->model->getTextFilter() => null, 'RouteReset' => true)); - } - - /** - * Creates a submit button - * - * @param MUtil_Form $form - * @return Zend_Form_Element_Submit - */ - protected function getAutoSearchSubmit() - { - return new Zend_Form_Element_Submit($this->searchButtonId, array('label' => $this->_('Search'), 'class' => 'button small')); - } - - /** - * 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) - { - return $this->getAutoSearchForm(); - } - - /** - * - * @return array The data to fill the form with - */ - protected function getSearchData() - { - if ($this->requestCache) { - return $this->requestCache->getProgramParams(); - } else { - return $this->request->getParams(); - } - } -} Added: trunk/library/snippets/Generic/AutosearchFormSnippet.php =================================================================== --- trunk/library/snippets/Generic/AutosearchFormSnippet.php (rev 0) +++ trunk/library/snippets/Generic/AutosearchFormSnippet.php 2012-03-01 16:41:08 UTC (rev 532) @@ -0,0 +1,237 @@ +<?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_AutosearchFormSnippet extends MUtil_Snippets_SnippetAbstract +{ + /** + * + * @var string The id of a div that contains target that should be replaced. + */ + protected $containingId; + + /** + * + * @var MUtil_Model_ModelAbstract + */ + protected $model; + + /** + * + * @var Zend_Controller_Request_Abstract + */ + protected $request; + + /** + * Optional, otherwise created from $util + * + * @var Gems_Util_RequestCache + */ + public $requestCache; + + /** + * + * @var Gems_Util + */ + protected $util; + + /** + * + * @var string Id for auto search button + */ + protected $searchButtonId = 'AUTO_SEARCH_TEXT_BUTTON'; + + + /** + * 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->util && (! $this->requestCache)) { + $this->requestCache = $this->util->getRequestCache(); + } + if ($this->requestCache) { + // Do not store searchButtonId + $this->requestCache->removeParams($this->searchButtonId); + } + + return parent::checkRegistryRequestsAnswers(); + } + + /** + * Creates the form itself + * + * @param array $options + * @return Gems_Form + */ + protected function createForm($options = null) + { + $form = new Gems_Form($options); + + return $form; + } + + /** + * Returns a text element for autosearch. Can be overruled. + * + * The form / html elements to search on. Elements can be grouped by inserting null's between them. + * That creates a distinct group of elements + * + * @param array $data The $form field values (can be usefull, but no need to set them) + * @return array Of Zend_Form_Element's or static tekst to add to the html or null for group breaks. + */ + protected function getAutoSearchElements(array $data) + { + // Search text + $element = new Zend_Form_Element_Text($this->model->getTextFilter(), array('label' => $this->_('Free search text'), 'size' => 20, 'maxlength' => 30)); + + return array($element); + } + + /** + * Creates an autosearch form for indexAction. + * + * @return Gems_Form|null + */ + protected function getAutoSearchForm() + { + $data = $this->getSearchData(); + + $elements = $this->getAutoSearchElements($data); + + if ($elements) { + $form = $this->createForm(array('name' => 'autosubmit')); // Assign a name so autosubmit will only work on this form (when there are others) + $form->setHtml('div'); + + $div = $form->getHtml(); + $div->class = 'search'; + + $span = $div->div(array('class' => 'inputgroup')); + + $elements[] = $this->getAutoSearchSubmit(); + + foreach ($elements as $element) { + if ($element instanceof Zend_Form_Element) { + if ($element->getLabel()) { + $span->label($element); + } + $span->input($element); + // TODO: Elementen automatisch toevoegen in MUtil_Form + $form->addElement($element); + } elseif (null === $element) { + $span = $div->div(array('class' => 'inputgroup')); + } else { + $span[] = $element; + } + } + + if ($this->request->isPost()) { + if (! $form->isValid($data)) { + $this->addMessage($form->getErrorMessages()); + $this->addMessage($form->getMessages()); + } + } else { + $form->populate($data); + } + + $href = $this->getAutoSearchHref(); + $form->setAutoSubmit($href, $this->containingId); + + return $form; + } + } + + /** + * + * @return string Href attribute for type as you go autofilter + */ + protected function getAutoSearchHref() + { + return MUtil_Html::attrib('href', array('action' => 'autofilter', $this->model->getTextFilter() => null, 'RouteReset' => true)); + } + + /** + * Creates a submit button + * + * @param MUtil_Form $form + * @return Zend_Form_Element_Submit + */ + protected function getAutoSearchSubmit() + { + return new Zend_Form_Element_Submit($this->searchButtonId, array('label' => $this->_('Search'), 'class' => 'button small')); + } + + /** + * 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) + { + return $this->getAutoSearchForm(); + } + + /** + * + * @return array The data to fill the form with + */ + protected function getSearchData() + { + if ($this->requestCache) { + return $this->requestCache->getProgramParams(); + } else { + return $this->request->getParams(); + } + } +} Added: trunk/library/snippets/Generic/ContentTitleSnippet.php =================================================================== --- trunk/library/snippets/Generic/ContentTitleSnippet.php (rev 0) +++ trunk/library/snippets/Generic/ContentTitleSnippet.php 2012-03-01 16:41:08 UTC (rev 532) @@ -0,0 +1,93 @@ +<?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 Snippets + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * + * @package Gems + * @subpackage Snippets + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Generic_ContentTitleSnippet extends MUtil_Snippets_SnippetAbstract +{ + /** + * The title to display + * + * @var string + */ + protected $contentTitle; + + /** + * Tagname of the HtmlElement to create + * + * @var string + */ + protected $tagName = 'h3'; + + /** + * 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) + { + if ($this->contentTitle) { + return MUtil_Html::create($this->tagName, $this->contentTitle); + } + } + + /** + * The place to check if the data set in the snippet is valid + * to generate the snippet. + * + * When invalid data should result in an error, you can throw it + * here but you can also perform the check in the + * checkRegistryRequestsAnswers() function from the + * {@see MUtil_Registry_TargetInterface}. + * + * @return boolean + */ + public function hasHtmlOutput() + { + return $this->contentTitle && $this->tagName; + } +} 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. |