|
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-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-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-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-29 17:08:41
|
Revision: 577
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=577&view=rev
Author: matijsdejong
Date: 2012-03-29 17:08:31 +0000 (Thu, 29 Mar 2012)
Log Message:
-----------
Organization base url now determines the layout when not logged in and url confirms
Temp error messages out in IndexAction.php needs different solution
updated fields from gems__organizations.20.sql (not all earlier patches came through to this definition)
Added filters to FormBridge
Added documentation
Modified Paths:
--------------
trunk/library/classes/Gems/Default/IndexAction.php
trunk/library/classes/Gems/Default/OrganizationAction.php
trunk/library/classes/Gems/Filter/DutchZipcode.php
trunk/library/classes/Gems/User/Form/LoginForm.php
trunk/library/classes/Gems/User/UserLoader.php
trunk/library/classes/Gems/Util/DbLookup.php
trunk/library/classes/MUtil/Form.php
trunk/library/classes/MUtil/Model/FormBridge.php
trunk/library/classes/MUtil/Model/Type/ConcatenatedRow.php
trunk/library/configs/db/tables/gems__organizations.20.sql
trunk/library/snippets/Organization/OrganizationEditSnippet.php
Added Paths:
-----------
trunk/library/classes/Gems/Filter/TrailingSlash.php
Modified: trunk/library/classes/Gems/Default/IndexAction.php
===================================================================
--- trunk/library/classes/Gems/Default/IndexAction.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/classes/Gems/Default/IndexAction.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -298,6 +298,7 @@
/**
* Fix current locale in cookies
*/
+ MUtil_Echo::track($user->getLocale(), $this->basepath->getBasePath());
Gems_Cookies::setLocale($user->getLocale(), $this->basepath->getBasePath());
/**
@@ -320,10 +321,12 @@
$this->_reroute(array('controller' => null, 'action' => null), true);
}
return;
- } else {
+ } /*
+ else {
//Now present the user with an error message
- $errors = $form->getErrorMessages();
- $this->addMessage($errors);
+ // $errors = MUtil_Ra::flatten($form->getMessages());
+ // $this->addMessage($errors);
+ MUtil_Echo::track($errors);
//Also log the error to the log table
//when the project has logging enabled
@@ -331,7 +334,7 @@
$msg = sprintf('Failed login for : %s (%s) - %s', $request->getParam($form->usernameFieldName), $request->getParam($form->organizationFieldName), $logErrors);
$log = Gems_AccessLog::getLog();
$log->log('loginFail', $this->getRequest(), $msg, null, true);
- }
+ } // */
}
$this->view->form = $form;
}
Modified: trunk/library/classes/Gems/Default/OrganizationAction.php
===================================================================
--- trunk/library/classes/Gems/Default/OrganizationAction.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/classes/Gems/Default/OrganizationAction.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -115,15 +115,18 @@
$model->set('gor_contact_name', 'label', $this->_('Contact name'), 'size', 25);
$model->set('gor_contact_email', 'label', $this->_('Contact email'), 'size', 50, 'validator', 'SimpleEmail');
if ($this->escort instanceof Gems_Project_Layout_MultiLayoutInterface) {
- $model->setIfExists(
- 'gor_style', 'label', $this->_('Style'),
+ $model->setIfExists('gor_style',
+ 'label', $this->_('Style'),
'multiOptions', MUtil_Lazy::call(array($this->escort, 'getStyles'))
);
- $model->setIfExists(
- 'gor_url_base', 'label', $this->_('Default url'),
+ $model->setIfExists('gor_url_base',
+ 'label', $this->_("Default url's"),
'size', 50,
- 'description', sprintf($this->_('Always switch to this organization when %s is accessed from this url'), $this->project->getName())
+ 'description', sprintf($this->_("Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."), $this->project->getName())
);
+ if ($detailed) {
+ $model->setIfExists('gor_url_base', 'filter', 'TrailingSlash');
+ }
}
$model->set(
'gor_iso_lang', 'label', $this->_('Language'),
Modified: trunk/library/classes/Gems/Filter/DutchZipcode.php
===================================================================
--- trunk/library/classes/Gems/Filter/DutchZipcode.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/classes/Gems/Filter/DutchZipcode.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -1,31 +1,31 @@
<?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
+
+/**
+ * Copyright (c) 2011, Erasmus MC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Erasmus MC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* @version $Id$
* @package Gems
* @subpackage Filter
@@ -39,9 +39,16 @@
* @subpackage Filter
* @copyright Copyright (c) 2011 Erasmus MC
* @license New BSD License
- */
+ */
class Gems_Filter_DutchZipcode implements Zend_Filter_Interface
{
+ /**
+ * Returns the result of filtering $value
+ *
+ * @param mixed $value
+ * @throws Zend_Filter_Exception If filtering $value is impossible
+ * @return mixed
+ */
public function filter($value)
{
// perform some transformation upon $value to arrive on $valueFiltered
@@ -51,7 +58,7 @@
$valueFiltered = substr_replace($valueFiltered, ' ', 4, 0);
}
}
-
+
return $valueFiltered;
}
}
Added: trunk/library/classes/Gems/Filter/TrailingSlash.php
===================================================================
--- trunk/library/classes/Gems/Filter/TrailingSlash.php (rev 0)
+++ trunk/library/classes/Gems/Filter/TrailingSlash.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -0,0 +1,68 @@
+<?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 Filter
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @version $id: TrailingSlash.php 203 2012-01-01t 12:51:32Z matijs $
+ */
+
+/**
+ * Removes slashes from both the end of string and words
+ *
+ * @package Gems
+ * @subpackage Filter
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.5
+ */
+class Gems_Filter_TrailingSlash implements Zend_Filter_Interface
+{
+ /**
+ * Returns the result of filtering $value
+ *
+ * @param mixed $value
+ * @throws Zend_Filter_Exception If filtering $value is impossible
+ * @return mixed
+ */
+ public function filter($value)
+ {
+ $values = explode(' ', $value);
+
+ foreach ($values as &$val) {
+ if (substr($val, -1) === '/') {
+ $val = substr($val, 0, -1);
+ }
+ }
+
+ return implode(' ', $values);
+ }
+}
Modified: trunk/library/classes/Gems/User/Form/LoginForm.php
===================================================================
--- trunk/library/classes/Gems/User/Form/LoginForm.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/classes/Gems/User/Form/LoginForm.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -155,13 +155,12 @@
*/
public function getCurrentOrganizationId()
{
- // Url determines organization first.
- $uri = $this->util->getCurrentURI();
- // MUtil_Echo::track($uri);
+ $userLoader = $this->loader->getUserLoader();
- if ($orgId = $this->util->getDbLookup()->getOrganizationForUrl($uri)) {
+ // Url determines organization first.
+ if ($orgId = $userLoader->getOrganizationIdByUrl()) {
$this->_organizationFromUrl = true;
- $this->loader->getCurrentUser()->setCurrentOrganization($orgId);
+ $userLoader->getCurrentUser()->setCurrentOrganization($orgId);
return $orgId;
}
@@ -170,7 +169,7 @@
return $orgId;
}
- return $this->loader->getCurrentUser()->getCurrentOrganizationId();
+ return $userLoader->getCurrentUser()->getCurrentOrganizationId();
}
/**
Modified: trunk/library/classes/Gems/User/UserLoader.php
===================================================================
--- trunk/library/classes/Gems/User/UserLoader.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/classes/Gems/User/UserLoader.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -68,6 +68,12 @@
public $allowStaffEmailLogin = true;
/**
+ *
+ * @var Zend_Cache_Core
+ */
+ protected $cache;
+
+ /**
* Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for.
*
* @var string $cascade An optional subdirectory where this subclass always loads from.
@@ -104,6 +110,12 @@
protected $translate;
/**
+ *
+ * @var Gems_Util
+ */
+ protected $util;
+
+ /**
* There can be only one, current user that is.
*
* @var Gems_User_User
@@ -268,7 +280,7 @@
if (substr($defName, -10, 10) != 'Definition') {
$defName .= 'Definition';
}
-
+
self::$currentUser = $this->_loadClass('User', true, array($this->session, $this->_getClass($defName)));
} else {
self::$currentUser = $this->getUser(null, null);
@@ -302,7 +314,7 @@
* Returns an organization object, initiated from the database or from
* self::$_noOrganization when the database does not yet exist.
*
- * @param int $organizationId Optional, uses current user when empty
+ * @param int $organizationId Optional, uses current user or url when empty
* @return Gems_User_Organization
*/
public function getOrganization($organizationId = null)
@@ -310,7 +322,15 @@
static $organizations = array();
if (null === $organizationId) {
- $organizationId = intval(self::getCurrentUser()->getCurrentOrganizationId());
+ $user = $this->getCurrentUser();
+
+ if (! $user->isActive()) {
+ $organizationId = $this->getOrganizationIdByUrl();
+ }
+
+ if (! $organizationId) {
+ $organizationId = intval($user->getCurrentOrganizationId());
+ }
}
if (! isset($organizations[$organizationId])) {
@@ -321,6 +341,49 @@
}
/**
+ * Returns the current organization according to the current site url.
+ *
+ * @static array $url An array of url => orgId values
+ * @return int An organization id or null
+ */
+ public function getOrganizationIdByUrl()
+ {
+ static $urls;
+
+ if (! is_array($urls)) {
+ if ($this->cache) {
+ $cacheId = GEMS_PROJECT_NAME . '__' . get_class($this) . '__organizations_url';
+ $urls = $this->cache->load($cacheId);
+ } else {
+ $cacheId = false;
+ }
+
+ if (! $urls) {
+ $data = $this->db->fetchPairs("SELECT gor_id_organization, gor_url_base FROM gems__organizations WHERE gor_active=1 AND gor_url_base IS NOT NULL");
+ $urls = array();
+ foreach ($data as $orgId => $urlsBase) {
+ foreach (explode(' ', $urlsBase) as $url) {
+ if ($url) {
+ $urls[$url] = $orgId;
+ }
+ }
+ }
+
+ if ($cacheId) {
+ $this->cache->save($urls, $cacheId, array('organization', 'organizations'));
+ }
+ }
+ // MUtil_Echo::track($urls);
+ }
+
+ $current = $this->util->getCurrentURI();
+
+ if (isset($urls[$current])) {
+ return $urls[$current];
+ }
+ }
+
+ /**
* Get password weakness checker.
*
* @return Gems_User_PasswordChecker
Modified: trunk/library/classes/Gems/Util/DbLookup.php
===================================================================
--- trunk/library/classes/Gems/Util/DbLookup.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/classes/Gems/Util/DbLookup.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -280,21 +280,6 @@
return $organizations;
}
- /**
- * Returns the organization
- * @param string $url
- * @return int|null the organization
- */
- public function getOrganizationForUrl($url)
- {
- try {
- $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;
- }
- }
-
public function getRoles()
{
$roles = array();
Modified: trunk/library/classes/MUtil/Form.php
===================================================================
--- trunk/library/classes/MUtil/Form.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/classes/MUtil/Form.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -35,7 +35,7 @@
*/
/**
- *
+ *
* @package MUtil
* @subpackage Form
* @copyright Copyright (c) 2011 Erasmus MC
Modified: trunk/library/classes/MUtil/Model/FormBridge.php
===================================================================
--- trunk/library/classes/MUtil/Model/FormBridge.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/classes/MUtil/Model/FormBridge.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -107,9 +107,17 @@
}
}
+ /**
+ * Add the element to the for and apply any filters & validators
+ *
+ * @param string $name
+ * @param Zend_Form_Element $element
+ * @return Zend_Form_Element
+ */
protected function _addToForm($name, Zend_Form_Element $element)
{
$this->form->addElement($element);
+ $this->_applyFilters($name, $element);
$this->_applyValidators($name, $element);
// MUtil_Echo::r($element->getOrder(), $element->getName());
@@ -117,6 +125,41 @@
return $element;
}
+ /**
+ * Apply the filters for element $name to the element
+ *
+ * @param string $name
+ * @param Zend_Form_Element $element
+ */
+ protected function _applyFilters($name, Zend_Form_Element $element)
+ {
+ $filters = $this->model->get($name, 'filters');
+
+ if ($filter = $this->model->get($name, 'filter')) {
+ if ($filters) {
+ array_unshift($filters, $filter);
+ } else {
+ $filters = array($filter);
+ }
+ }
+
+ if ($filters) {
+ foreach ($filters as $filter) {
+ if (is_array($filter)) {
+ call_user_func_array(array($element, 'addFilter'), $filter);
+ } else {
+ $element->addFilter($filter);
+ }
+ }
+ }
+ }
+
+ /**
+ * Apply the validators for element $name to the element
+ *
+ * @param string $name
+ * @param Zend_Form_Element $element
+ */
protected function _applyValidators($name, Zend_Form_Element $element)
{
$validators = $this->model->get($name, 'validators');
@@ -505,6 +548,7 @@
}
$element = new Zend_Form_Element_Password($name, $options);
+ $this->_applyFilters($name, $element);
$this->_applyValidators($name, $element);
$this->form->addElement($element);
@@ -515,6 +559,7 @@
if (isset($repeatLabel)) {
$repeatElement = new Zend_Form_Element_Password($repeatName, $repeatOptions);
$this->form->addElement($repeatElement);
+ $this->_applyFilters($name, $repeatElement);
if ($stringlength) {
$repeatElement->addValidator('StringLength', true, $stringlength);
Modified: trunk/library/classes/MUtil/Model/Type/ConcatenatedRow.php
===================================================================
--- trunk/library/classes/MUtil/Model/Type/ConcatenatedRow.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/classes/MUtil/Model/Type/ConcatenatedRow.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -110,6 +110,13 @@
return $this;
}
+
+ /**
+ * Displays the content
+ *
+ * @param string $value
+ * @return string
+ */
public function format($value)
{
// MUtil_Echo::track($value);
Modified: trunk/library/configs/db/tables/gems__organizations.20.sql
===================================================================
--- trunk/library/configs/db/tables/gems__organizations.20.sql 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/configs/db/tables/gems__organizations.20.sql 2012-03-29 17:08:31 UTC (rev 577)
@@ -2,11 +2,13 @@
CREATE TABLE if not exists gems__organizations (
gor_id_organization bigint unsigned not null auto_increment,
- gor_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null,
- gor_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
- gor_location varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
- gor_url varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
- gor_task varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
+ gor_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null,
+ gor_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
+ gor_user_class varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'StaffUser'
+ gor_location varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
+ gor_url varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
+ gor_url_base varchar(1270) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
+ gor_task varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
-- A commy separated list of organization numbers that can look at respondents in this organization
gor_accessible_by text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
Modified: trunk/library/snippets/Organization/OrganizationEditSnippet.php
===================================================================
--- trunk/library/snippets/Organization/OrganizationEditSnippet.php 2012-03-29 14:39:03 UTC (rev 576)
+++ trunk/library/snippets/Organization/OrganizationEditSnippet.php 2012-03-29 17:08:31 UTC (rev 577)
@@ -48,6 +48,12 @@
{
/**
*
+ * @var Zend_Cache_Core
+ */
+ protected $cache;
+
+ /**
+ *
* @var Gems_Loader
*/
protected $loader;
@@ -72,7 +78,7 @@
}
//Need the first two together for validation
$bridge->addHtml('org')->b($this->_('Organization'));
- $this->addItems($bridge, 'gor_name', 'gor_id_organization', 'gor_location', 'gor_url', 'gor_active');
+ $this->addItems($bridge, 'gor_name', 'gor_id_organization', 'gor_location', 'gor_url', 'gor_url_base', 'gor_active');
$bridge->addHtml('contact')->b($this->_('Contact'));
$bridge->addHtml('contact_desc')->i($this->_('The contact details for this organization, used for emailing.'));
$this->addItems($bridge, 'gor_contact_name', 'gor_contact_email');
@@ -103,7 +109,9 @@
//Strip self
unset($allowedOrgs[$this->formData['gor_id_organization']]);
$display = join(', ', $allowedOrgs);
- $bridge->addExhibitor('allowed', 'value', $display, 'label', $this->_('Can access'));
+ if ($display) {
+ $bridge->addExhibitor('allowed', 'value', $display, 'label', $this->_('Can access'));
+ }
}
$this->addItems($bridge, 'gor_user_class');
@@ -126,8 +134,7 @@
public function afterSave($changed)
{
- $org = $this->loader->getOrganization($changed['gor_id_organization']);
- $org->invalidateCache();
+ $this->cache->clean('all', array('organization', 'organizations'));
// Make sure any changes in the allowed list are reflected.
$this->loader->getCurrentUser()->refreshAllowedOrganizations();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-03-30 09:56:17
|
Revision: 581
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=581&view=rev
Author: matijsdejong
Date: 2012-03-30 09:56:07 +0000 (Fri, 30 Mar 2012)
Log Message:
-----------
Translations updated
Removed debug code
Made MUtil_Date and Translated faster when comparing in days from today.
Modified Paths:
--------------
trunk/library/classes/Gems/Default/IndexAction.php
trunk/library/classes/Gems/Util/Translated.php
trunk/library/classes/MUtil/Date.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/IndexAction.php
===================================================================
--- trunk/library/classes/Gems/Default/IndexAction.php 2012-03-29 21:16:55 UTC (rev 580)
+++ trunk/library/classes/Gems/Default/IndexAction.php 2012-03-30 09:56:07 UTC (rev 581)
@@ -298,7 +298,6 @@
/**
* Fix current locale in cookies
*/
- MUtil_Echo::track($user->getLocale(), $this->basepath->getBasePath());
Gems_Cookies::setLocale($user->getLocale(), $this->basepath->getBasePath());
/**
Modified: trunk/library/classes/Gems/Util/Translated.php
===================================================================
--- trunk/library/classes/Gems/Util/Translated.php 2012-03-29 21:16:55 UTC (rev 580)
+++ trunk/library/classes/Gems/Util/Translated.php 2012-03-30 09:56:07 UTC (rev 581)
@@ -132,7 +132,7 @@
// TODO: Timezone seems to screw this one up
//$days = floor($dateTime / 86400) - floor(time() / 86400); // 86400 = 24*60*60
$dateTime = new MUtil_Date($dateTimeValue, Zend_Date::ISO_8601);
- $days = $dateTime->diffDays(new MUtil_Date());
+ $days = $dateTime->diffDays();
switch ($days) {
case -2:
Modified: trunk/library/classes/MUtil/Date.php
===================================================================
--- trunk/library/classes/MUtil/Date.php 2012-03-29 21:16:55 UTC (rev 580)
+++ trunk/library/classes/MUtil/Date.php 2012-03-30 09:56:07 UTC (rev 581)
@@ -61,16 +61,20 @@
* @param Zend_Locale $locale optional (not used)
* @return type
*/
- public function diffDays(Zend_Date $date, $locale = null)
+ public function diffDays(Zend_Date $date = null, $locale = null)
{
$day1 = clone $this;
- $day2 = clone $date;
$day1->setTime(0);
- $day2->setTime(0);
-
$val1 = intval($day1->getUnixTimestamp() / self::DAY_SECONDS);
- $val2 = intval($day2->getUnixTimestamp() / self::DAY_SECONDS);
+ if (null === $date) {
+ $val2 = intval(time() / self::DAY_SECONDS);
+ } else {
+ $day2 = clone $date;
+ $day2->setTime(0);
+ $val2 = intval($day2->getUnixTimestamp() / self::DAY_SECONDS);
+ }
+
return $val1 - $val2;
}
@@ -215,11 +219,11 @@
$difference = -$difference;
$ending = $translate->_("%s to go");
}
-
+
for ($j = 0; $j < 7 && $difference >= $lengths[$j]; $j++) {
$difference /= $lengths[$j];
}
-
+
$difference = round($difference);
switch ($j) {
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-29 21:16:55 UTC (rev 580)
+++ trunk/library/languages/default-en.po 2012-03-30 09:56:07 UTC (rev 581)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: Pulse EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-22 16:35+0100\n"
+"POT-Creation-Date: 2012-03-30 11:34+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:743
+#: classes/GemsEscort.php:745
#, php-format
msgid "You are logged in as %s"
msgstr "You are logged in as %s"
-#: classes/GemsEscort.php:745
+#: classes/GemsEscort.php:747
#: classes/Gems/Menu.php:248
msgid "Logoff"
msgstr "Logoff"
-#: classes/GemsEscort.php:748
+#: classes/GemsEscort.php:750
msgid "You are not logged in"
msgstr "You are not logged in"
-#: classes/GemsEscort.php:931
+#: classes/GemsEscort.php:934
#, php-format
msgid "User: %s"
msgstr "User: %s"
-#: classes/GemsEscort.php:956
+#: classes/GemsEscort.php:959
msgid "version"
msgstr "version"
-#: classes/GemsEscort.php:1387
+#: classes/GemsEscort.php:1390
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:1518
+#: classes/GemsEscort.php:1521
msgid "Please check back later."
msgstr "Please check back later."
-#: classes/GemsEscort.php:1520
-#: classes/GemsEscort.php:1524
-#: classes/GemsEscort.php:1525
+#: classes/GemsEscort.php:1523
+#: classes/GemsEscort.php:1527
+#: classes/GemsEscort.php:1528
msgid "System is in maintenance mode"
msgstr "System is in maintenance mode"
-#: classes/GemsEscort.php:1535
+#: classes/GemsEscort.php:1538
msgid "No access to site."
msgstr "No access to site."
-#: classes/GemsEscort.php:1537
-#: classes/GemsEscort.php:1579
+#: classes/GemsEscort.php:1540
+#: classes/GemsEscort.php:1582
msgid "You have no access to this site."
msgstr "You have no access to this site."
-#: classes/GemsEscort.php:1553
+#: classes/GemsEscort.php:1556
msgid "No access to page"
msgstr "No access to page"
-#: classes/GemsEscort.php:1555
+#: classes/GemsEscort.php:1558
#, 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:1565
-#: classes/GemsEscort.php:1577
+#: classes/GemsEscort.php:1568
+#: classes/GemsEscort.php:1580
msgid "You are no longer logged in."
msgstr "You are no longer logged in."
-#: classes/GemsEscort.php:1566
+#: classes/GemsEscort.php:1569
msgid "You must login to access this page."
msgstr "You must login to access this page."
-#: classes/GemsEscort.php:1710
-#: classes/GemsEscort.php:1712
+#: classes/GemsEscort.php:1713
+#: classes/GemsEscort.php:1715
#, 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:242
+#: classes/Gems/Auth.php:235
msgid "Combination of organization, username and password not found."
msgstr "Combination of organization, username and password not found."
@@ -450,11 +450,13 @@
msgstr "Trying upgrade for %s to level %s: %s"
#: classes/Gems/Controller/BrowseEditAction.php:354
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:226
#, php-format
msgid "New %s..."
msgstr "New %s..."
#: classes/Gems/Controller/BrowseEditAction.php:387
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:246
#, php-format
msgid "Delete %s"
msgstr "Delete %s"
@@ -483,6 +485,7 @@
msgstr "No %s found"
#: classes/Gems/Controller/BrowseEditAction.php:662
+#: classes/Gems/Default/ExportAction.php:234
#, php-format
msgid "No %s found."
msgstr "No %s found."
@@ -492,10 +495,14 @@
msgstr "Are you sure?"
#: classes/Gems/Controller/BrowseEditAction.php:796
+#: classes/Gems/Default/DatabaseAction.php:171
+#: classes/Gems/Default/DatabaseAction.php:484
msgid "Yes"
msgstr "Yes"
#: classes/Gems/Controller/BrowseEditAction.php:797
+#: classes/Gems/Default/DatabaseAction.php:172
+#: classes/Gems/Default/DatabaseAction.php:485
msgid "No"
msgstr "No"
@@ -1042,7 +1049,7 @@
msgstr "%s records found."
#: classes/Gems/Default/ExportAction.php:172
-#: classes/Gems/Default/IndexAction.php:220
+#: classes/Gems/Default/IndexAction.php:190
#: classes/Gems/Default/LogAction.php:197
msgid "Organization"
msgstr "Organization"
@@ -1078,88 +1085,75 @@
msgid "Administrative groups"
msgstr "Administrative groups"
-#: classes/Gems/Default/IndexAction.php:105
-msgid "Enter your token..."
-msgstr "Enter your token..."
-
-#: classes/Gems/Default/IndexAction.php:157
+#: classes/Gems/Default/IndexAction.php:142
#, php-format
msgid "Login to %s application"
msgstr "Login to %s application"
-#: classes/Gems/Default/IndexAction.php:169
-msgid "Login"
-msgstr "Login"
-
-#: classes/Gems/Default/IndexAction.php:191
+#: classes/Gems/Default/IndexAction.php:161
msgid "Back to login"
msgstr "Back to login"
-#: classes/Gems/Default/IndexAction.php:244
-msgid "Password"
-msgstr "Password"
-
-#: classes/Gems/Default/IndexAction.php:259
+#: classes/Gems/Default/IndexAction.php:212
#, php-format
msgid "Reset password for %s application"
msgstr "Reset password for %s application"
-#: classes/Gems/Default/IndexAction.php:263
+#: classes/Gems/Default/IndexAction.php:216
msgid "Reset password"
msgstr "Reset password"
-#: classes/Gems/Default/IndexAction.php:309
+#: classes/Gems/Default/IndexAction.php:262
msgid "Username"
msgstr "Username"
-#: classes/Gems/Default/IndexAction.php:351
+#: classes/Gems/Default/IndexAction.php:294
msgid "Your password must be changed."
msgstr "Your password must be changed."
-#: classes/Gems/Default/IndexAction.php:363
+#: classes/Gems/Default/IndexAction.php:306
#, php-format
msgid "Login successful, welcome %s."
msgstr "Login successful, welcome %s."
-#: classes/Gems/Default/IndexAction.php:403
+#: classes/Gems/Default/IndexAction.php:348
#, php-format
msgid "Good bye: %s."
msgstr "Good bye: %s."
-#: classes/Gems/Default/IndexAction.php:428
+#: classes/Gems/Default/IndexAction.php:373
msgid "Reset accepted, enter your new password."
msgstr "Reset accepted, enter your new password."
-#: classes/Gems/Default/IndexAction.php:432
+#: classes/Gems/Default/IndexAction.php:377
msgid "This key timed out or does not belong to this user."
msgstr "This key timed out or does not belong to this user."
-#: classes/Gems/Default/IndexAction.php:455
+#: classes/Gems/Default/IndexAction.php:380
msgid "Password reset requested"
msgstr "Password reset requested"
-#: classes/Gems/Default/IndexAction.php:456
-#, php-format
-msgid "To reset your password for %s, please click this link: %s"
-msgstr "To reset your password for %s, please click this link: %s"
+#: classes/Gems/Default/IndexAction.php:381
+msgid ""
+"To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n"
+"{reset_url}"
+msgstr ""
+"To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n"
+"{reset_url}"
-#: classes/Gems/Default/IndexAction.php:461
+#: classes/Gems/Default/IndexAction.php:386
msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail."
msgstr "We sent you an e-mail with a reset link. Click on the link in the e-mail."
-#: classes/Gems/Default/IndexAction.php:463
-msgid "Unable to send e-mail."
-msgstr "Unable to send e-mail."
-
-#: classes/Gems/Default/IndexAction.php:468
+#: classes/Gems/Default/IndexAction.php:391
msgid "No such user found or no e-mail address known or user cannot be reset."
msgstr "No such user found or no e-mail address known or user cannot be reset."
-#: classes/Gems/Default/IndexAction.php:472
+#: classes/Gems/Default/IndexAction.php:395
msgid "We received your password reset key."
msgstr "We received your password reset key."
-#: classes/Gems/Default/IndexAction.php:473
+#: classes/Gems/Default/IndexAction.php:396
msgid "Please enter the organization and username belonging to this key."
msgstr "Please enter the organization and username belonging to this key."
@@ -1236,7 +1230,6 @@
msgstr "Date"
#: classes/Gems/Default/LogAction.php:191
-#: classes/Gems/Default/LogMaintenanceAction.php:52
msgid "Action"
msgstr "Action"
@@ -1253,7 +1246,6 @@
msgstr "IP address"
#: classes/Gems/Default/LogAction.php:209
-#: classes/Gems/Default/LogMaintenanceAction.php:53
msgid "Log"
msgstr "Log"
@@ -1438,6 +1430,10 @@
msgid "User ID"
msgstr "User ID"
+#: classes/Gems/Default/MailServerAction.php:88
+msgid "Password"
+msgstr "Password"
+
#: classes/Gems/Default/MailServerAction.php:90
#: classes/Gems/Default/SourceAction.php:95
msgid "Repeat password"
@@ -1459,8 +1455,6 @@
msgstr "Email servers"
#: classes/Gems/Default/MailTemplateAction.php:76
-#: classes/Gems/Default/StaffAction.php:278
-#: classes/Gems/Default/StaffAction.php:311
msgid "(all organizations)"
msgstr "(all organizations)"
@@ -1479,7 +1473,6 @@
msgstr "You are not allowed to change your password."
#: classes/Gems/Default/OptionAction.php:94
-#: classes/Gems/Default/StaffAction.php:419
msgid "New password is active."
msgstr "New password is active."
@@ -1488,9 +1481,8 @@
msgstr "Login Name"
#: classes/Gems/Default/OptionAction.php:135
-#: classes/Gems/Default/OrganizationAction.php:129
+#: classes/Gems/Default/OrganizationAction.php:132
#: classes/Gems/Default/RespondentAction.php:175
-#: classes/Gems/Default/StaffAction.php:294
msgid "Language"
msgstr "Language"
@@ -1536,85 +1528,88 @@
msgstr "Style"
#: classes/Gems/Default/OrganizationAction.php:123
-msgid "Default url"
-msgstr "Default url"
+msgid "Default url's"
+msgstr "Default url's"
#: 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"
+msgid "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."
+msgstr "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."
-#: classes/Gems/Default/OrganizationAction.php:133
+#: classes/Gems/Default/OrganizationAction.php:136
msgid "Can the organization be used?"
msgstr "Can the organization be used?"
-#: classes/Gems/Default/OrganizationAction.php:134
+#: classes/Gems/Default/OrganizationAction.php:137
+msgid "Login"
+msgstr "Login"
+
+#: classes/Gems/Default/OrganizationAction.php:137
msgid "Can people login for this organization?"
msgstr "Can people login for this organization?"
-#: classes/Gems/Default/OrganizationAction.php:135
+#: classes/Gems/Default/OrganizationAction.php:138
msgid "Accepting"
msgstr "Accepting"
-#: classes/Gems/Default/OrganizationAction.php:135
+#: classes/Gems/Default/OrganizationAction.php:138
msgid "Can new respondents be added to the organization?"
msgstr "Can new patients be added to the organization?"
-#: classes/Gems/Default/OrganizationAction.php:136
+#: classes/Gems/Default/OrganizationAction.php:139
msgid "Does the organization have respondents?"
msgstr "Does the organization have patients?"
-#: classes/Gems/Default/OrganizationAction.php:137
+#: classes/Gems/Default/OrganizationAction.php:140
msgid "Respondent group"
msgstr "Patient group"
-#: classes/Gems/Default/OrganizationAction.php:137
+#: classes/Gems/Default/OrganizationAction.php:140
msgid "Allows respondents to login."
msgstr "Allow patients to login."
-#: classes/Gems/Default/OrganizationAction.php:141
+#: classes/Gems/Default/OrganizationAction.php:144
msgid "Greeting"
msgstr "Greeting"
-#: classes/Gems/Default/OrganizationAction.php:141
-#: classes/Gems/Default/OrganizationAction.php:142
+#: classes/Gems/Default/OrganizationAction.php:144
+#: classes/Gems/Default/OrganizationAction.php:145
msgid "For emails and token forward screen."
msgstr "For emails and token forward screen."
-#: classes/Gems/Default/OrganizationAction.php:142
+#: classes/Gems/Default/OrganizationAction.php:145
msgid "Signature"
msgstr "Signature"
-#: classes/Gems/Default/OrganizationAction.php:144
+#: classes/Gems/Default/OrganizationAction.php:147
msgid "Accessible by"
msgstr "Accessible by"
-#: classes/Gems/Default/OrganizationAction.php:144
+#: classes/Gems/Default/OrganizationAction.php:147
msgid "Checked organizations see this organizations respondents."
msgstr "Checked organizations see this organizations patients."
-#: classes/Gems/Default/OrganizationAction.php:154
+#: classes/Gems/Default/OrganizationAction.php:157
msgid "Code name"
msgstr "Code name"
-#: classes/Gems/Default/OrganizationAction.php:154
+#: classes/Gems/Default/OrganizationAction.php:157
msgid "Only for programmers."
msgstr "Only for programmers."
-#: classes/Gems/Default/OrganizationAction.php:164
+#: classes/Gems/Default/OrganizationAction.php:167
msgid "This can not be changed yet"
msgstr "This can not be changed yet"
-#: classes/Gems/Default/OrganizationAction.php:166
-#: classes/Gems/Default/StaffAction.php:119
+#: classes/Gems/Default/OrganizationAction.php:169
msgid "User Definition"
msgstr "User Definition"
-#: classes/Gems/Default/OrganizationAction.php:186
+#: classes/Gems/Default/OrganizationAction.php:189
msgid "Participating organizations"
msgstr "Participating organizations"
-#: classes/Gems/Default/OrganizationAction.php:197
+#: classes/Gems/Default/OrganizationAction.php:200
msgid "organization"
msgid_plural "organizations"
msgstr[0] "organization"
@@ -3082,16 +3077,19 @@
msgstr "Executing patchlevel %d"
#: classes/Gems/Task/Tracker/CheckTokenCompletion.php:74
+#: classes/Gems/Tracker/ChangeTracker.php:72
#, php-format
msgid "Answers changed by survey completion event for %d tokens."
msgstr "Answers changed by survey completion event for %d tokens."
#: classes/Gems/Task/Tracker/CheckTokenCompletion.php:78
+#: classes/Gems/Tracker/ChangeTracker.php:75
#, 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
+#: classes/Gems/Tracker/ChangeTracker.php:67
#, php-format
msgid "Checked %d tokens."
msgstr "Checked %d tokens."
@@ -3610,27 +3608,42 @@
msgid "may not contain numbers"
msgstr "may not contain numbers"
-#: classes/Gems/User/RadiusUserDefinition.php:178
+#: classes/Gems/User/RadiusUserDefinition.php:177
msgid "Shared secret"
msgstr "Shared secret"
-#: classes/Gems/User/User.php:843
+#: classes/Gems/User/User.php:415
+#, php-format
+msgid "Your account is temporarily blocked, please wait a minute."
+msgid_plural "Your account is temporarily blocked, please wait %d minutes."
+msgstr[0] "Your account is temporarily blocked, please wait a minute."
+msgstr[1] "Your account is temporarily blocked, please wait %d minutes."
+
+#: classes/Gems/User/User.php:450
+msgid "You are not allowed to login from this location."
+msgstr "You are not allowed to login from this location."
+
+#: classes/Gems/User/User.php:1060
+msgid "Trying to send a password reset to a user that cannot be reset."
+msgstr "Trying to send a password reset to a user that cannot be reset."
+
+#: classes/Gems/User/User.php:1087
+msgid "Unable to send e-mail."
+msgstr "Unable to send e-mail."
+
+#: classes/Gems/User/User.php:1214
msgid "Cookies must be enabled for this site."
msgstr "Cookies must be enabled for this site."
-#: classes/Gems/User/UserLoader.php:181
-#: classes/Gems/User/UserLoader.php:195
+#: classes/Gems/User/UserLoader.php:231
+#: classes/Gems/User/UserLoader.php:245
msgid "Db storage"
msgstr "Db storage"
-#: classes/Gems/User/UserLoader.php:196
+#: classes/Gems/User/UserLoader.php:246
msgid "Radius storage"
msgstr "Radius storage"
-#: classes/Gems/User/UserPasswordValidator.php:115
-msgid "Wrong password."
-msgstr "Wrong password."
-
#: classes/Gems/User/Form/ChangePasswordForm.php:166
#: classes/Gems/User/Form/ChangePasswordForm.php:222
msgid "New password"
@@ -3640,6 +3653,10 @@
msgid "Current password"
msgstr "Current password"
+#: classes/Gems/User/Form/ChangePasswordForm.php:197
+msgid "Wrong password."
+msgstr "Wrong password."
+
#: classes/Gems/User/Form/ChangePasswordForm.php:243
msgid "Password rules"
msgstr "Password rules"
@@ -3657,6 +3674,18 @@
msgid "Caps Lock seems to be on!"
msgstr "Caps Lock seems to be on!"
+#: classes/Gems/User/Form/LoginForm.php:274
+msgid "Combination of user and password not found."
+msgstr "Combination of user and password not found."
+
+#: classes/Gems/User/Form/LoginForm.php:276
+msgid "Combination of user and password not found for this organization."
+msgstr "Combination of user and password not found for this organization."
+
+#: classes/Gems/User/Form/LoginForm.php:349
+msgid "Enter your token..."
+msgstr "Enter your token..."
+
#: classes/Gems/Util/ReceptionCodeLibrary.php:100
msgid "Yes (forget answers)"
msgstr "Yes (forget answers)"
@@ -3673,6 +3702,10 @@
msgid "Stop (per respondent or track only)"
msgstr "Stop (per patient or track only)"
+#: classes/Gems/Util/TrackData.php:132
+msgid "Inactive"
+msgstr "Inactive"
+
#: classes/Gems/Util/Translated.php:96
msgid "forever"
msgstr "forever"
@@ -3727,87 +3760,87 @@
msgid "Send one mail per respondent, mark only mailed tokens as send."
msgstr "Send one mail per patient, mark only mailed tokens as send."
-#: classes/Gems/Util/Translated.php:198
+#: classes/Gems/Util/Translated.php:204
msgid "Unknown"
msgstr "Unknown"
-#: classes/Gems/Util/Translated.php:203
+#: classes/Gems/Util/Translated.php:217
msgid "mr."
msgstr "Mr."
-#: classes/Gems/Util/Translated.php:203
+#: classes/Gems/Util/Translated.php:217
msgid "mrs."
msgstr "Mrs."
-#: classes/Gems/Util/Translated.php:203
+#: classes/Gems/Util/Translated.php:217
msgid "mr./mrs."
msgstr "Mr./Mrs."
-#: classes/Gems/Util/Translated.php:208
+#: classes/Gems/Util/Translated.php:230
msgid "Mr."
msgstr "Mr."
-#: classes/Gems/Util/Translated.php:208
+#: classes/Gems/Util/Translated.php:230
msgid "Mrs."
msgstr "Mrs."
-#: classes/Gems/Util/Translated.php:208
+#: classes/Gems/Util/Translated.php:230
msgid "Mr./Mrs."
msgstr "Mr./Mrs."
-#: classes/MUtil/Date.php:213
+#: classes/MUtil/Date.php:217
#, php-format
msgid "%s ago"
msgstr "%s ago"
-#: classes/MUtil/Date.php:216
+#: classes/MUtil/Date.php:220
#, php-format
msgid "%s to go"
msgstr "%s to go"
-#: classes/MUtil/Date.php:227
+#: classes/MUtil/Date.php:231
msgid "second"
msgid_plural "seconds"
msgstr[0] "second"
msgstr[1] "seconds"
-#: classes/MUtil/Date.php:230
+#: classes/MUtil/Date.php:234
msgid "minute"
msgid_plural "minutes"
msgstr[0] "minute"
msgstr[1] "minutes"
-#: classes/MUtil/Date.php:233
+#: classes/MUtil/Date.php:237
msgid "hour"
msgid_plural "hours"
msgstr[0] "hour"
msgstr[1] "hours"
-#: classes/MUtil/Date.php:236
+#: classes/MUtil/Date.php:240
msgid "day"
msgid_plural "days"
msgstr[0] "day"
msgstr[1] "days"
-#: classes/MUtil/Date.php:239
+#: classes/MUtil/Date.php:243
msgid "week"
msgid_plural "weeks"
msgstr[0] "week"
msgstr[1] "weeks"
-#: classes/MUtil/Date.php:242
+#: classes/MUtil/Date.php:246
msgid "month"
msgid_plural "months"
msgstr[0] "month"
msgstr[1] "months"
-#: classes/MUtil/Date.php:245
+#: classes/MUtil/Date.php:249
msgid "year"
msgid_plural "years"
msgstr[0] "year"
msgstr[1] "years"
-#: classes/MUtil/Date.php:248
+#: classes/MUtil/Date.php:252
msgid "decade"
msgid_plural "decades"
msgstr[0] "decade"
@@ -3848,10 +3881,6 @@
msgid "Your account is temporarily blocked, please wait %s minutes"
msgstr "Your account is temporarily blocked, please wait %s minutes"
-#: languages/FakeTranslations.php:47
-msgid "You are not allowed to login from this location."
-msgstr "You are not allowed to login from this location."
-
#: languages/FakeTranslations.php:50
msgid "Not a valid token. The format for valid tokens is: %tokenFormat%."
msgstr "Not a valid token. The format for valid tokens is: %tokenFormat%."
@@ -3999,7 +4028,6 @@
msgstr "Deleted token %s for survey %s."
#: snippets/DeleteTrackTokenSnippet.php:286
-#: snippets/EditTrackTokenSnippet.php:174
#, php-format
msgid "%d token changed by recalculation."
msgid_plural "%d tokens changed by recalculation."
@@ -4124,26 +4152,29 @@
msgid "This organization cannot have any respondents."
msgstr "This organization cannot have any patients."
-#: snippets/Organization/OrganizationEditSnippet.php:71
+#: snippets/Organization/OrganizationEditSnippet.php:77
msgid "General"
msgstr "General"
-#: snippets/Organization/OrganizationEditSnippet.php:77
+#: snippets/Organization/OrganizationEditSnippet.php:83
msgid "The contact details for this organization, used for emailing."
msgstr "The contact details for this organization, used for emailing."
-#: snippets/Organization/OrganizationEditSnippet.php:83
+#: snippets/Organization/OrganizationEditSnippet.php:89
msgid "Email"
msgstr "Email"
-#: snippets/Organization/OrganizationEditSnippet.php:88
+#: snippets/Organization/OrganizationEditSnippet.php:94
msgid "Access"
msgstr "Access"
-#: snippets/Organization/OrganizationEditSnippet.php:106
+#: snippets/Organization/OrganizationEditSnippet.php:113
msgid "Can access"
msgstr "Can access"
+#~ msgid "To reset your password for %s, please click this link: %s"
+#~ msgstr "To reset your password for %s, please click this link: %s"
+
#~ msgid "Check %s surveys"
#~ msgstr "Check %s surveys"
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-29 21:16:55 UTC (rev 580)
+++ trunk/library/languages/default-nl.po 2012-03-30 09:56:07 UTC (rev 581)
@@ -1,4819 +1,4842 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: Pulse NL\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-29 16:34+0100\n"
-"PO-Revision-Date: \n"
-"Last-Translator: Michiel Rook <in...@to...>\n"
-"Language-Team: Erasmus MGZ <mat...@ma...>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Poedit-Language: Dutch\n"
-"X-Poedit-Country: NETHERLANDS\n"
-"X-Poedit-SourceCharset: iso-8859-1\n"
-"X-Poedit-Basepath: ../\n"
-"X-Poedit-KeywordsList: plural:1,2\n"
-"X-Poedit-SearchPath-0: .\n"
-
-#: classes/GemsEscort.php:211
-#, php-format
-msgid "Path %s not writable"
-msgstr "Path %s niet schrijfbaar"
-
-#: classes/GemsEscort.php:745
-#, php-format
-msgid "You are logged in as %s"
-msgstr "Ingelogd als %s"
-
-#: classes/GemsEscort.php:747
-msgid "Logoff"
-msgstr "Uitloggen"
-
-#: classes/GemsEscort.php:750
-msgid "You are not logged in"
-msgstr "U bent niet ingelogd"
-
-#: classes/GemsEscort.php:934
-#, php-format
-msgid "User: %s"
-msgstr "Login: %s"
-
-#: classes/GemsEscort.php:959
-msgid "version"
-msgstr "versie"
-
-#: classes/GemsEscort.php:1390
-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:1521
-msgid "Please check back later."
-msgstr "Probeer het later opnieuw."
-
-#: classes/GemsEscort.php:1523
-#: classes/GemsEscort.php:1528
-msgid "System is in maintenance mode"
-msgstr "Systeem is in onderhoudsmodus"
-
-#: classes/GemsEscort.php:1538
-msgid "No access to site."
-msgstr "Geen toegang tot website."
-
-#: classes/GemsEscort.php:1540
-msgid "You have no access to this site."
-msgstr "U heeft geen toegang tot deze website."
-
-#: classes/GemsEscort.php:1556
-msgid "No access to page"
-msgstr "Geen toegang tot pagina"
-
-#: classes/GemsEscort.php:1558
-#, 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:1568
-msgid "You are no longer logged in."
-msgstr "U bent niet meer ingelogd."
-
-#: classes/GemsEscort.php:1569
-msgid "You must login to access this page."
-msgstr "U moet ingelogd zijn voor toegang tot deze pagina."
-
-#: classes/GemsEscort.php:1713
-#, php-format
-msgid "%d survey"
-msgid_plural "%d surveys"
-msgstr[0] "%d vragenlijst"
-msgstr[1] "%d vragenlijsten"
-
-#: classes/Gems/Pdf.php:198
-#, php-format
-msgid "PDF Source File '%s' not found!"
-msgstr "PDF bron bestand %s niet gevonden!"
-
-#: classes/Gems/Pdf.php:240
-#, php-format
-msgid "Could not create '%s' directory."
-msgstr "Kon de directory '%s' niet aanmaken."
-
-#: classes/Gems/Pdf.php:283
-#, php-format
-msgid " The error message is: %s"
-msgstr "De foutmelding is: %s"
-
-#: classes/Gems/Tracker.php:761
-msgid "Checks performed"
-msgstr "Controle uitgevoerd"
-
-#: classes/Gems/Upgrades.php:76
-msgid "Syncing surveys for all sources"
-msgstr "Vragenlijsten synchroniseren voor alle bronnen."
-
-#: classes/Gems/AccessLog.php:236
-msgid "Database needs to be updated!"
-msgstr "Database dient ververst te worden!"
-
-#: classes/Gems/Html.php:154
-msgid "<< First"
-msgstr "<< Eerste"
-
-#: classes/Gems/Html.php:155
-msgid "< Previous"
-msgstr "< Terug"
-
-#: classes/Gems/Html.php:156
-msgid "Next >"
-msgstr "Verder >"
-
-#: classes/Gems/Html.php:157
-msgid "Last >>"
-msgstr "Laatste >>"
-
-#: classes/Gems/Html.php:158
-msgid " | "
-msgstr " | "
-
-#: classes/Gems/Html.php:162
-msgid "to"
-msgstr "tot"
-
-#: classes/Gems/Html.php:163
-msgid "of"
-msgstr "van"
-
-#: classes/Gems/Menu.php:139
-#, php-format
-msgid "About %s"
-msgstr "Over %s"
-
-#: classes/Gems/Menu.php:143
-msgid "Reporting bugs"
-msgstr "Meld een bug"
-
-#: classes/Gems/Menu.php:146
-msgid "Support"
-msgstr "Ondersteuning"
-
-#: classes/Gems/Menu.php:166
-msgid "Project setup"
-msgstr "Projectinfo"
-
-#: classes/Gems/Menu.php:169
-msgid "Database"
-msgstr "Database"
-
-#: classes/Gems/Menu.php:173
-msgid "Content"
-msgstr "Inhoud"
-
-#: classes/Gems/Menu.php:1...
[truncated message content] |
|
From: <gem...@li...> - 2012-03-30 12:24:23
|
Revision: 584
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=584&view=rev
Author: matijsdejong
Date: 2012-03-30 12:24:12 +0000 (Fri, 30 Mar 2012)
Log Message:
-----------
When specified the users mail contains links to the first of the Default Url's of the organization the user belongs to.
Modified Paths:
--------------
trunk/library/classes/Gems/User/Organization.php
trunk/library/classes/Gems/User/User.php
trunk/library/classes/GemsEscort.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/User/Organization.php
===================================================================
--- trunk/library/classes/Gems/User/Organization.php 2012-03-30 11:12:07 UTC (rev 583)
+++ trunk/library/classes/Gems/User/Organization.php 2012-03-30 12:24:12 UTC (rev 584)
@@ -77,6 +77,12 @@
protected $db;
/**
+ *
+ * @var Gems_Util
+ */
+ protected $util;
+
+ /**
* When true respondents of this organization may login
*
* @return boolean
@@ -184,6 +190,20 @@
}
/**
+ * Return org dependent login url
+ *
+ * @return string
+ */
+ public function getLoginUrl()
+ {
+ if ($base = $this->_get('base_url')) {
+ return $base;
+ } else {
+ return $this->util->getCurrentURI();
+ }
+ }
+
+ /**
* Array of field name => values for sending E-Mail
*
* @return array
@@ -192,6 +212,7 @@
{
$result['organization'] = $this->getName();
$result['organization_location'] = $this->_get('gor_location');
+ $result['organization_login_url'] = $this->getLoginUrl();
$result['organization_reply_name'] = $this->_get('gor_contact_name');
$result['organization_reply_to'] = $this->_get('gor_contact_email');
$result['organization_signature'] = $this->getSignature();
@@ -274,6 +295,10 @@
}
// MUtil_Echo::track($sql, $data['can_access']);
+
+ if ($baseUrls = explode(' ', $data['gor_url_base'])) {
+ $data['base_url'] = reset($baseUrls);
+ }
} else {
$data = $this->_noOrganization;
}
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-03-30 11:12:07 UTC (rev 583)
+++ trunk/library/classes/Gems/User/User.php 2012-03-30 12:24:12 UTC (rev 584)
@@ -766,7 +766,8 @@
*/
public function getMailFields($locale = null)
{
- $orgResults = $this->getBaseOrganization()->getMailFields();
+ $org = $this->getBaseOrganization();
+ $orgResults = $org->getMailFields();
$projResults = $this->project->getMailFields();
$result['bcc'] = $projResults['project_bcc'];
@@ -776,12 +777,12 @@
$result['full_name'] = trim($this->getGenderHello($locale) . ' ' . $this->getFullName());
$result['greeting'] = $this->getGreeting($locale);
$result['last_name'] = ltrim($this->_getVar('user_surname_prefix') . ' ') . $this->_getVar('user_last_name');
- $result['login_url'] = $this->util->getCurrentURI();
+ $result['login_url'] = $orgResults['organization_login_url'];
$result['name'] = $this->getFullName();
$result = $result + $orgResults + $projResults;
- $result['reset_ask'] = $this->util->getCurrentURI('index/resetpassword');
+ $result['reset_ask'] = $orgResults['organization_login_url'] . '/index/resetpassword';
$result['reply_to'] = $result['from'];
$result['to'] = $result['email'];
@@ -820,7 +821,7 @@
public function getResetPasswordMailFields($locale = null)
{
$result['reset_key'] = $this->getPasswordResetKey();
- $result['reset_url'] = $this->util->getCurrentURI('index/resetpassword/key/' . $result['reset_key']);
+ $result['reset_url'] = $this->getBaseOrganization()->getLoginUrl() . '/index/resetpassword/key/' . $result['reset_key'];
return $result + $this->getMailFields($locale);
}
@@ -1058,7 +1059,7 @@
public function sendMail($subjectTemplate, $bbBodyTemplate, $useResetFields = false, $locale = null)
{
if ($useResetFields && (! $this->canResetPassword())) {
- return $this->_('Trying to send a password reset to a user that cannot be reset.');
+ return $this->translate->_('Trying to send a password reset to a user that cannot be reset.');
}
$mail = new Gems_Mail();
Modified: trunk/library/classes/GemsEscort.php
===================================================================
--- trunk/library/classes/GemsEscort.php 2012-03-30 11:12:07 UTC (rev 583)
+++ trunk/library/classes/GemsEscort.php 2012-03-30 12:24:12 UTC (rev 584)
@@ -1658,6 +1658,8 @@
{
$locale = isset($tokenData['grs_iso_lang']) ? $tokenData['grs_iso_lang'] : $this->locale;
+ $orgResults = $this->getLoader()->getOrganization($tokenData['gor_id_organization'])->getMailFields();
+
// Prepare values
$genderHello = $this->getUtil()->getTranslated()->getGenderHello($locale);
$hello[] = $genderHello[$tokenData['grs_gender']];
@@ -1693,19 +1695,13 @@
array_shift($hello);
$result['{name}'] = implode(' ', $hello);
- $result['{organization}'] = $tokenData['gor_name'];
- $result['{organization_location}'] = $tokenData['gor_location'];
- $result['{organization_reply_name}'] = $tokenData['gor_contact_name'];
- $result['{organization_reply_to}'] = $tokenData['gor_contact_email'];
- $result['{organization_signature}'] = $tokenData['gor_signature'];
- $result['{organization_url}'] = $tokenData['gor_url'];
- $result['{organization_welcome}'] = $tokenData['gor_welcome'];
+ $result = $result + MUtil_Ra::braceKeys($orgResults, '{', '}');
$result['{round}'] = $tokenData['gto_round_description'];
- $result['{site_ask_url}'] = $this->util->getCurrentURI('ask/');
+ $result['{site_ask_url}'] = $orgResults['organization_login_url'] . '/ask/';
// Url's
- $url = $this->util->getCurrentURI('ask/forward/' . MUtil_Model::REQUEST_ID . '/' . $tokenData['gto_id_token']);
+ $url = $orgResults['organization_login_url'] . '/ask/forward/' . MUtil_Model::REQUEST_ID . '/' . $tokenData['gto_id_token'];
$url_input = $result['{site_ask_url}'] . 'index/' . MUtil_Model::REQUEST_ID . '/' . $tokenData['gto_id_token'];
$result['{survey}'] = $tokenData['gsu_survey_name'];
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-30 11:12:07 UTC (rev 583)
+++ trunk/library/languages/default-en.po 2012-03-30 12:24:12 UTC (rev 584)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: Pulse EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-30 13:10+0100\n"
+"POT-Creation-Date: 2012-03-30 14:21+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -87,8 +87,8 @@
msgid "You must login to access this page."
msgstr "You must login to access this page."
-#: classes/GemsEscort.php:1713
-#: classes/GemsEscort.php:1715
+#: classes/GemsEscort.php:1709
+#: classes/GemsEscort.php:1711
#, php-format
msgid "%d survey"
msgid_plural "%d surveys"
@@ -3623,15 +3623,15 @@
msgid "You are not allowed to login from this location."
msgstr "You are not allowed to login from this location."
-#: classes/Gems/User/User.php:1061
+#: classes/Gems/User/User.php:1062
msgid "Trying to send a password reset to a user that cannot be reset."
msgstr "Trying to send a password reset to a user that cannot be reset."
-#: classes/Gems/User/User.php:1088
+#: classes/Gems/User/User.php:1089
msgid "Unable to send e-mail."
msgstr "Unable to send e-mail."
-#: classes/Gems/User/User.php:1215
+#: classes/Gems/User/User.php:1216
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-30 11:12:07 UTC (rev 583)
+++ trunk/library/languages/default-nl.po 2012-03-30 12:24:12 UTC (rev 584)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: Pulse NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-30 13:11+0100\n"
+"POT-Creation-Date: 2012-03-30 14:21+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -87,8 +87,8 @@
msgid "You must login to access this page."
msgstr "U moet ingelogd zijn voor toegang tot deze pagina."
-#: classes/GemsEscort.php:1713
-#: classes/GemsEscort.php:1715
+#: classes/GemsEscort.php:1709
+#: classes/GemsEscort.php:1711
#, php-format
msgid "%d survey"
msgid_plural "%d surveys"
@@ -3623,15 +3623,15 @@
msgid "You are not allowed to login from this location."
msgstr "U kunt vanaf deze locatie niet inloggen."
-#: classes/Gems/User/User.php:1061
+#: classes/Gems/User/User.php:1062
msgid "Trying to send a password reset to a user that cannot be reset."
msgstr "Het wachtwoord voor deze gebruiker kan niet gewijzigd worden."
-#: classes/Gems/User/User.php:1088
+#: classes/Gems/User/User.php:1089
msgid "Unable to send e-mail."
msgstr "Verzenden e-mail mislukt."
-#: classes/Gems/User/User.php:1215
+#: classes/Gems/User/User.php:1216
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-30 20:36:51
|
Revision: 588
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=588&view=rev
Author: matijsdejong
Date: 2012-03-30 20:36:44 +0000 (Fri, 30 Mar 2012)
Log Message:
-----------
Added Title to actionLinks made from menu items
Modified Paths:
--------------
trunk/library/classes/Gems/Menu/SubMenuItem.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/Menu/SubMenuItem.php
===================================================================
--- trunk/library/classes/Gems/Menu/SubMenuItem.php 2012-03-30 14:46:53 UTC (rev 587)
+++ trunk/library/classes/Gems/Menu/SubMenuItem.php 2012-03-30 20:36:44 UTC (rev 588)
@@ -875,6 +875,9 @@
} else {
$element = MUtil_Html::create()->actionLink($href, $label);
}
+ if ($title = $this->get('title')) {
+ $element->title = $title;
+ }
// and make sure nothing shows when empty
$element->setOnEmpty(null);
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-30 14:46:53 UTC (rev 587)
+++ trunk/library/languages/default-en.po 2012-03-30 20:36:44 UTC (rev 588)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: Pulse EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-30 14:21+0100\n"
+"POT-Creation-Date: 2012-03-30 22:04+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -3975,22 +3975,22 @@
msgid "One or more IPs are illegal."
msgstr "One or more IPs are illegal."
-#: snippets/AddTracksSnippet.php:117
+#: snippets/AddTracksSnippet.php:198
+msgid "info"
+msgstr "info"
+
+#: snippets/AddTracksSnippet.php:203
+msgid "None available"
+msgstr "None available"
+
+#: snippets/AddTracksSnippet.php:218
msgid "by Respondents"
msgstr "by Patients"
-#: snippets/AddTracksSnippet.php:121
+#: snippets/AddTracksSnippet.php:221
msgid "by Staff"
msgstr "by Staff"
-#: snippets/AddTracksSnippet.php:195
-msgid "info"
-msgstr "info"
-
-#: snippets/AddTracksSnippet.php:200
-msgid "None available"
-msgstr "None available"
-
#: snippets/DeleteInSourceTrackSnippet.php:130
msgid "Edit track"
msgstr "Edit track"
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-30 14:46:53 UTC (rev 587)
+++ trunk/library/languages/default-nl.po 2012-03-30 20:36:44 UTC (rev 588)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: Pulse NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-30 14:21+0100\n"
+"POT-Creation-Date: 2012-03-30 22:04+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -3975,22 +3975,22 @@
msgid "One or more IPs are illegal."
msgstr "Een of meer IP adressen zijn incorrect."
-#: snippets/AddTracksSnippet.php:117
+#: snippets/AddTracksSnippet.php:198
+msgid "info"
+msgstr "info"
+
+#: snippets/AddTracksSnippet.php:203
+msgid "None available"
+msgstr "Niet beschikbaar"
+
+#: snippets/AddTracksSnippet.php:218
msgid "by Respondents"
msgstr "voor Patiënten"
-#: snippets/AddTracksSnippet.php:121
+#: snippets/AddTracksSnippet.php:221
msgid "by Staff"
msgstr "voor Medewerkers"
-#: snippets/AddTracksSnippet.php:195
-msgid "info"
-msgstr "info"
-
-#: snippets/AddTracksSnippet.php:200
-msgid "None available"
-msgstr "Niet beschikbaar"
-
#: snippets/DeleteInSourceTrackSnippet.php:130
msgid "Edit track"
msgstr "Bewerk traject"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-02 17:52:42
|
Revision: 591
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=591&view=rev
Author: matijsdejong
Date: 2012-04-02 17:52:30 +0000 (Mon, 02 Apr 2012)
Log Message:
-----------
Created a separate Password Reset form that can be overruled on the project level
New structure of indexAction allows for easy overruling of password display.
TODO: validation / follow up actions should be organized better.
Modified Paths:
--------------
trunk/library/classes/Gems/Default/IndexAction.php
trunk/library/classes/Gems/User/Form/LoginForm.php
trunk/library/classes/Gems/User/UserLoader.php
trunk/library/languages/default-en.mo
trunk/library/languages/default-en.po
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Added Paths:
-----------
trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php
trunk/library/classes/Gems/User/Form/ResetForm.php
trunk/library/classes/Gems/User/Validate/ResetKeyValidator.php
Modified: trunk/library/classes/Gems/Default/IndexAction.php
===================================================================
--- trunk/library/classes/Gems/Default/IndexAction.php 2012-04-01 23:54:09 UTC (rev 590)
+++ trunk/library/classes/Gems/Default/IndexAction.php 2012-04-02 17:52:30 UTC (rev 591)
@@ -55,21 +55,6 @@
protected $labelWidthFactor = null;
/**
- * @var GemsEscort
- */
- public $escort;
-
- /**
- * @var Gems_Menu
- */
- public $menu;
-
- /**
- * @var Gems_Project_ProjectSettings
- */
- public $project;
-
- /**
* 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
@@ -93,53 +78,22 @@
protected $showTokenButton = true;
/**
- * Returns a basic form for this action.
- *
- * @param $description Optional description, %s is filled with project name.
- * @return Gems_Form
- */
- protected function _getBasicForm($description = null)
- {
- Gems_Html::init();
-
- $form = new Gems_Form(array('labelWidthFactor' => $this->labelWidthFactor));
- $form->setMethod('post');
- if ($description) {
- $form->setDescription(sprintf($description, $this->project->getName()));
- }
-
- return $form;
- }
-
- /**
- * Returns an element for keeping a reset key.
- *
- * @return Zend_Form_Element_Hidden
- */
- protected function _getKeyElement()
- {
- return new Zend_Form_Element_Hidden('key');
- }
-
- /**
* Returns a login form
*
* @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_User_Form_LoginForm
*/
- protected function _getLoginForm($showToken = null, $showPasswordLost = null)
+ protected function createLoginForm($showToken = null, $showPasswordLost = null)
{
$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,
));
@@ -149,121 +103,67 @@
}
/**
- * Returns a link to the login page
+ * Gets a reset password form.
*
- * @return MUtil_Form_Element_Html
+ * @return Gems_User_Form_ResetForm
*/
- protected function _getLoginLinkElement()
+ protected function createResetForm()
{
- // Reset password
- $element = new MUtil_Form_Element_Html('resetPassword');
- $element->br();
- $element->actionLink(array('controller' => 'index', 'action' => 'login'), $this->_('Back to login'));
+ $args = MUtil_Ra::args(func_get_args(),
+ array(),
+ array(
+ 'labelWidthFactor' => $this->labelWidthFactor,
+ ));
- return $element;
- }
+ $this->initHtml();
- /**
- * Returns an element for determining / selecting the organization.
- *
- * @return Zend_Form_Element_Xhtml
- */
- protected function _getOrganizationElement()
- {
- $hidden = $this->escort instanceof Gems_Project_Organization_SingleOrganizationInterface;
- if ($hidden) {
- $org = $this->escort->getRespondentOrganization();
- } else {
- $org = $this->loader->getCurrentUser()->getCurrentOrganizationId();
- $orgs = $this->util->getDbLookup()->getOrganizationsForLogin();
- $hidden = count($orgs) < 2;
- if ($hidden) {
- $org = array_shift(array_keys($orgs));
- }
- }
-
- if ($hidden) {
- $element = new Zend_Form_Element_Hidden('organization');
- $element->setValue($org);
- } else {
- $element = new Zend_Form_Element_Select('organization');
- $element->setLabel($this->_('Organization'));
- $element->setMultiOptions($orgs);
- $element->setRequired(true);
- if ($this->organizationMaxLines > 1) {
- $element->setAttrib('size', max(count($orgs) + 1, $this->organizationMaxLines));
- }
-
- if (! $this->_request->isPost()) {
- $element->setValue($org);
- }
- }
-
- return $element;
+ return $this->loader->getUserLoader()->getResetForm($args);
}
/**
- * Gets a reset password form.
+ * Function for overruling the display of the login form.
*
- * @return Gems_Form
+ * @param Gems_User_Form_LoginForm $form
*/
- protected function _getResetForm()
+ protected function displayLoginForm(Gems_User_Form_LoginForm $form)
{
- $form = $this->_getBasicForm($this->_('Reset password for %s application'));
- $form->addElement($this->_getKeyElement());
- $form->addElement($this->_getOrganizationElement());
- $form->addElement($this->_getUserLoginElement());
- $form->addElement($this->_getSubmitButton($this->_('Reset password')));
- $form->addElement($this->_getLoginLinkElement());
-
- return $form;
+ $this->view->form = $form;
}
/**
- * Returns a link to the reset password page
+ * Function for overruling the display of the reset form.
*
- * @return MUtil_Form_Element_Html
+ * @param Gems_User_Form_ResetForm $form
+ * @param mixed $errors
*/
- protected function _getResetLinkElement()
+ protected function displayResetForm(Gems_User_Form_ResetForm $form, $errors)
{
- // Reset password
- $element = new MUtil_Form_Element_Html('resetPassword');
- $element->br();
- $element->actionLink(array('controller' => 'index', 'action' => 'resetpassword'), $this->_('Lost password'));
+ if ($form->hasResetKey()) {
+ $this->html->h3($this->_('Request password reset'));
+ $p = $this->html->pInfo($this->_('We received your password reset request. '));
- return $element;
- }
+ if ($form->getOrganizationIsVisible()) {
+ $p->append($this->_('Please enter the organization and username/e-mail address belonging to this request.'));
+ } else {
+ $p->append($this->_('Please enter the username or e-mail address belonging to this request.'));
+ }
+ } else {
+ $this->html->h3($this->_('Execute password reset'));
- /**
- * Returns a submit button.
- *
- * @param string $label
- * @return Zend_Form_Element_Submit
- */
- protected function _getSubmitButton($label)
- {
- // Submit knop
- $element = new Zend_Form_Element_Submit('button');
- $element->setLabel($label);
- $element->setAttrib('class', 'button');
+ $p = $this->html->pInfo();
+ if ($form->getOrganizationIsVisible()) {
+ $p->append($this->_('Please enter your organization and your username or e-mail address. '));
+ } else {
+ $p->append($this->_('Please enter your username or e-mail address. '));
+ }
+ $p->append($this->_('We will then send you an e-mail with a link you can use to reset your password.'));
+ }
- return $element;
- }
+ if ($errors) {
+ $this->addMessage($errors);
+ }
- /**
- * Returns a login name element.
- *
- * @return Zend_Form_Element_Text
- */
- protected function _getUserLoginElement()
- {
- // Veld inlognaam
- $element = new Zend_Form_Element_Text('userlogin');
- $element->setLabel($this->_('Username'));
- $element->setAttrib('size', 40);
- $element->setRequired(true);
-
- return $element;
+ $this->html->append($form);
}
/**
@@ -277,7 +177,7 @@
public function loginAction()
{
$request = $this->getRequest();
- $form = $this->_getLoginForm();
+ $form = $this->createLoginForm();
if ($request->isPost()) {
if ($form->isValid($request->getPost(), false)) {
@@ -334,7 +234,8 @@
$log->log('loginFail', $this->getRequest(), $msg, null, true);
} // */
}
- $this->view->form = $form;
+
+ $this->displayLoginForm($form);
}
/**
@@ -358,10 +259,11 @@
$this->view->setScriptPath(GEMS_LIBRARY_DIR . '/views/scripts' );
$request = $this->getRequest();
- $form = $this->_getResetForm();
- if ($request->isPost() && $form->isValid($request->getPost())) {
+ $errors = array();
+ $form = $this->createResetForm();
+ if ($request->isPost() && $form->isValid($request->getParams())) {
- $user = $this->loader->getUser($request->getParam('userlogin'), $request->getParam('organization'));
+ $user = $form->getUser();
If ($user->canResetPassword()) {
if ($key = $request->getParam('key')) {
@@ -373,27 +275,23 @@
$user->gotoStartPage($this->menu, $request);
return;
} else {
- $this->addMessage($this->_('This key timed out or does not belong to this user.'));
+ $errors[] = $this->_('This key timed out or does not belong to this user.');
}
} else {
$subjectTemplate = $this->_('Password reset requested');
$bbBodyTemplate = $this->_("To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n{reset_url}");
- $messages = $user->sendMail($subjectTemplate, $bbBodyTemplate, true);
- if (! $messages) {
+ $errors = $user->sendMail($subjectTemplate, $bbBodyTemplate, true);
+ if (! $errors) {
// Everything went OK!
- $messages = $this->_('We sent you an e-mail with a reset link. Click on the link in the e-mail.');
+ $errors[] = $this->_('We sent you an e-mail with a reset link. Click on the link in the e-mail.');
}
- $this->addMessage($messages);
}
} else {
- $this->addMessage($this->_('No such user found or no e-mail address known or user cannot be reset.'));
+ $errors[] = $this->_('No such user found or no e-mail address known or user cannot be reset.');
}
}
- if ($request->getParam('key')) {
- $this->addMessage($this->_('We received your password reset key.'));
- $this->addMessage($this->_('Please enter the organization and username belonging to this key.'));
- }
- $this->view->form = $form;
+
+ $this->displayResetForm($form, $errors);
}
}
Modified: trunk/library/classes/Gems/User/Form/LoginForm.php
===================================================================
--- trunk/library/classes/Gems/User/Form/LoginForm.php 2012-04-01 23:54:09 UTC (rev 590)
+++ trunk/library/classes/Gems/User/Form/LoginForm.php 2012-04-02 17:52:30 UTC (rev 591)
@@ -44,7 +44,7 @@
* @license New BSD License
* @since Class available since version 1.5
*/
-class Gems_User_Form_LoginForm extends Gems_Form_AutoLoadFormAbstract implements Gems_User_Validate_GetUserInterface
+class Gems_User_Form_LoginForm extends Gems_User_Form_OrganizationFormAbstract
{
/**
* The field name for the lost password element.
@@ -54,20 +54,6 @@
protected $_lostPasswordFieldName = 'lost_password';
/**
- * When true the organization was derived from the the url
- *
- * @var boolean
- */
- protected $_organizationFromUrl = false;
-
- /**
- * The field name for the submit element.
- *
- * @var string
- */
- protected $_submitFieldName = 'button';
-
- /**
* The field name for the token element.
*
* @var string
@@ -75,34 +61,6 @@
protected $_tokenFieldName = 'token_link';
/**
- *
- * @var Gems_User_User
- */
- protected $_user;
-
- /**
- *
- * @var Gems_Loader
- */
- protected $loader;
-
- /**
- * The field name for the organization element.
- *
- * @var string
- */
- public $organizationFieldName = 'organization';
-
- /**
- * 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;
-
- /**
* The field name for the password element.
*
* @var string
@@ -110,12 +68,6 @@
public $passwordFieldName = 'password';
/**
- *
- * @var Zend_Controller_Request_Abstract
- */
- protected $request;
-
- /**
* The default behaviour for showing a lost password button
*
* @var boolean
@@ -130,59 +82,6 @@
protected $showToken = true;
/**
- *
- * @var Zend_Translate
- */
- protected $translate;
-
- /**
- * The field name for the username element.
- *
- * @var string
- */
- public $usernameFieldName = 'userlogin';
-
- /**
- *
- * @var Zend_Util
- */
- protected $util;
-
- /**
- * Returns the organization id that should currently be used for this form.
- *
- * @return int Returns the current organization id, if any
- */
- public function getCurrentOrganizationId()
- {
- $userLoader = $this->loader->getUserLoader();
-
- // Url determines organization first.
- if ($orgId = $userLoader->getOrganizationIdByUrl()) {
- $this->_organizationFromUrl = true;
- $userLoader->getCurrentUser()->setCurrentOrganization($orgId);
- return $orgId;
- }
-
- $request = $this->getRequest();
- if ($request->isPost() && ($orgId = $request->getParam($this->organizationFieldName))) {
- return $orgId;
- }
-
- return $userLoader->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
@@ -214,47 +113,6 @@
}
/**
- * 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
@@ -284,41 +142,16 @@
}
/**
- * Return the Request object
+ * Returns the label for the submitbutton
*
- * @return Zend_Controller_Request_Abstract
+ * @return string
*/
- public function getRequest()
+ public function getSubmitButtonLabel()
{
- if (! $this->request) {
- $this->request = Zend_Controller_Front::getInstance()->getRequest();
- }
- return $this->request;
+ return $this->translate->_('Login');
}
/**
- * 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
@@ -350,58 +183,6 @@
}
/**
- * Returns a user
- *
- * @return Gems_User_User
- */
- public function getUser()
- {
- return $this->_user;
- }
-
- /**
- * 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', 40);
- $element->setRequired(true);
-
- $this->addElement($element);
- }
-
- return $element;
- }
-
- /**
- * Validate the form
- *
- * As it is better for translation utilities to set the labels etc. translated,
- * the MUtil default is to disable translation.
- *
- * However, this also disables the translation of validation messages, which we
- * cannot set translated. The MUtil form is extended so it can make this switch.
- *
- * @param array $data
- * @param boolean $disableTranslateValidators Extra switch
- * @return boolean
- */
- public function isValid($data, $disableTranslateValidators = null)
- {
- $this->_user = $this->loader->getUser($data[$this->usernameFieldName], $data[$this->organizationFieldName]);
-
- return parent::isValid($data, $disableTranslateValidators);
- }
-
- /**
* The function that determines the element load order
*
* @return Gems_User_Form_LoginForm (continuation pattern)
@@ -424,23 +205,6 @@
}
/**
- * 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()
@@ -469,14 +233,4 @@
return $this;
}
-
- /**
- * True when this form was submitted.
- *
- * @return boolean
- */
- public function wasSubmitted()
- {
- return $this->getSubmitButton()->isChecked();
- }
}
Added: trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php (rev 0)
+++ trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php 2012-04-02 17:52:30 UTC (rev 591)
@@ -0,0 +1,327 @@
+<?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: OrganizationFormAbstract.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.3
+ */
+abstract class Gems_User_Form_OrganizationFormAbstract extends Gems_Form_AutoLoadFormAbstract implements Gems_User_Validate_GetUserInterface
+{
+ /**
+ * When true the organization was derived from the the url
+ *
+ * @var boolean
+ */
+ protected $_organizationFromUrl = false;
+
+ /**
+ * The field name for the submit element.
+ *
+ * @var string
+ */
+ protected $_submitFieldName = 'button';
+
+ /**
+ *
+ * @var Gems_User_User
+ */
+ protected $_user;
+
+ /**
+ *
+ * @var Gems_Loader
+ */
+ protected $loader;
+
+ /**
+ * The field name for the organization element.
+ *
+ * @var string
+ */
+ public $organizationFieldName = 'organization';
+
+ /**
+ * 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;
+
+ /**
+ *
+ * @var Zend_Translate
+ */
+ protected $translate;
+
+ /**
+ * The field name for the username element.
+ *
+ * @var string
+ */
+ public $usernameFieldName = 'userlogin';
+
+ /**
+ *
+ * @var Zend_Util
+ */
+ protected $util;
+
+
+ /**
+ * Returns the organization id that should currently be used for this form.
+ *
+ * @return int Returns the current organization id, if any
+ */
+ public function getCurrentOrganizationId()
+ {
+ $userLoader = $this->loader->getUserLoader();
+
+ // Url determines organization first.
+ if ($orgId = $userLoader->getOrganizationIdByUrl()) {
+ $this->_organizationFromUrl = true;
+ $userLoader->getCurrentUser()->setCurrentOrganization($orgId);
+ return $orgId;
+ }
+
+ $request = $this->getRequest();
+ if ($request->isPost() && ($orgId = $request->getParam($this->organizationFieldName))) {
+ return $orgId;
+ }
+
+ return $userLoader->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 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 true when the organization element is visible to the user.
+ *
+ * @return boolean
+ */
+ public function getOrganizationIsVisible()
+ {
+ return ! $this->getOrganizationElement() instanceof Zend_Form_Element_Hidden;
+ }
+
+ /**
+ * 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.
+ *
+ * @return Zend_Form_Element_Submit
+ */
+ public function getSubmitButton()
+ {
+ $element = $this->getElement($this->_submitFieldName);
+
+ if (! $element) {
+ // Submit knop
+ $element = new Zend_Form_Element_Submit($this->_submitFieldName);
+ $element->setLabel($this->getSubmitButtonLabel());
+ $element->setAttrib('class', 'button');
+
+ $this->addElement($element);
+ }
+
+ return $element;
+ }
+
+ /**
+ * Returns the label for the submitbutton
+ *
+ * @return string
+ */
+ abstract public function getSubmitButtonLabel();
+
+ /**
+ * Returns a user
+ *
+ * @return Gems_User_User
+ */
+ public function getUser()
+ {
+ if (! $this->_user) {
+ $request = $this->getRequest();
+
+ $this->_user = $this->loader->getUser($request->getParam($this->usernameFieldName), $request->getParam($this->organizationFieldName));
+ }
+ return $this->_user;
+ }
+
+ /**
+ * 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->tr...
[truncated message content] |
|
From: <gem...@li...> - 2012-04-03 15:27:36
|
Revision: 593
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=593&view=rev
Author: matijsdejong
Date: 2012-04-03 15:27:25 +0000 (Tue, 03 Apr 2012)
Log Message:
-----------
Password reset sends a unique key that identifies the user & organization
Added user_resetkey_valid field to User.php
ImgElement can now have dirs removed
Updated translations
Modified Paths:
--------------
trunk/library/changelog.txt
trunk/library/classes/Gems/Default/IndexAction.php
trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php
trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php
trunk/library/classes/Gems/User/Organization.php
trunk/library/classes/Gems/User/RespondentUserDefinition.php
trunk/library/classes/Gems/User/StaffUserDefinition.php
trunk/library/classes/Gems/User/User.php
trunk/library/classes/Gems/User/UserLoader.php
trunk/library/classes/MUtil/Html/ImgElement.php
trunk/library/configs/db/patches.sql
trunk/library/languages/default-en.mo
trunk/library/languages/default-en.po
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Added Paths:
-----------
trunk/library/classes/Gems/User/Form/ResetRequestForm.php
trunk/library/classes/Gems/User/Validate/ResetRequestValidator.php
Removed Paths:
-------------
trunk/library/classes/Gems/User/Form/ResetForm.php
trunk/library/classes/Gems/User/Validate/ResetKeyValidator.php
Modified: trunk/library/changelog.txt
===================================================================
--- trunk/library/changelog.txt 2012-04-02 17:55:47 UTC (rev 592)
+++ trunk/library/changelog.txt 2012-04-03 15:27:25 UTC (rev 593)
@@ -4,7 +4,8 @@
Showing a list of organizations to choose during login happens except when 1) there is only one organization or 2) a url is used that is assigned to a specific organization.
Login & other password forms are now easy to customize on a per project basis.
Login and authorizaiton rules are easier to extend.
-Alll password rules are reported during reset.
+All password rules are reported during reset.
+The password reset cycle send a link that can be used to change the password straight away.
Important changes from 1.5.1 => 1.5.2
Modified: trunk/library/classes/Gems/Default/IndexAction.php
===================================================================
--- trunk/library/classes/Gems/Default/IndexAction.php 2012-04-02 17:55:47 UTC (rev 592)
+++ trunk/library/classes/Gems/Default/IndexAction.php 2012-04-03 15:27:25 UTC (rev 593)
@@ -64,6 +64,13 @@
protected $organizationMaxLines = 6;
/**
+ * When true, the rese4t form returns to the login page after sending a change request
+ *
+ * @var boolean
+ */
+ protected $returnToLoginAfterReset = true;
+
+ /**
* The default behaviour for showing a lost password button
*
* @var boolean
@@ -107,7 +114,7 @@
*
* @return Gems_User_Form_ResetForm
*/
- protected function createResetForm()
+ protected function createResetRequestForm()
{
$args = MUtil_Ra::args(func_get_args(),
array(),
@@ -117,7 +124,7 @@
$this->initHtml();
- return $this->loader->getUserLoader()->getResetForm($args);
+ return $this->loader->getUserLoader()->getResetRequestForm($args);
}
/**
@@ -127,27 +134,22 @@
*/
protected function displayLoginForm(Gems_User_Form_LoginForm $form)
{
+ $form->getUser()->setAsCurrentUser();
+
$this->view->form = $form;
}
/**
* Function for overruling the display of the reset form.
*
- * @param Gems_User_Form_ResetForm $form
+ * @param Gems_Form_AutoLoadFormAbstract $form Rset password or reset request form
* @param mixed $errors
*/
- protected function displayResetForm(Gems_User_Form_ResetForm $form, $errors)
+ protected function displayResetForm(Gems_Form_AutoLoadFormAbstract $form, $errors, Gems_User_User $user = null)
{
- if ($form->hasResetKey()) {
- $this->html->h3($this->_('Execute password reset'));
- $p = $this->html->pInfo($this->_('We received your password reset request. '));
+ if ($form instanceof Gems_User_Form_ResetRequestForm) {
+ $form->getUser()->setAsCurrentUser();
- if ($form->getOrganizationIsVisible()) {
- $p->append($this->_('Please enter the organization and username/e-mail address belonging to this request.'));
- } else {
- $p->append($this->_('Please enter the username or e-mail address belonging to this request.'));
- }
- } else {
$this->html->h3($this->_('Request password reset'));
$p = $this->html->pInfo();
@@ -157,6 +159,18 @@
$p->append($this->_('Please enter your username or e-mail address. '));
}
$p->append($this->_('We will then send you an e-mail with a link you can use to reset your password.'));
+
+ } elseif ($form instanceof Gems_User_Form_ChangePasswordForm) {
+ if ($user->hasPassword()) {
+ $this->html->h3($this->_('Execute password reset'));
+ $p = $this->html->pInfo($this->_('We received your password reset request.'));
+ } else {
+ // New user
+ $this->html->h3(sprintf($this->_('Welcome to %s'), $this->project->getName()));
+ $p = $this->html->pInfo($this->_('Welcome to this website.'));
+ }
+ $p->append(' ');
+ $p->append($this->_('Please enter your password of choice twice.'));
}
if ($errors) {
@@ -256,42 +270,71 @@
*/
public function resetpasswordAction()
{
- $this->view->setScriptPath(GEMS_LIBRARY_DIR . '/views/scripts' );
-
+ $errors = array();
+ $form = $this->createResetRequestForm();
$request = $this->getRequest();
- $errors = array();
- $form = $this->createResetForm();
- if ($request->isPost() && $form->isValid($request->getParams())) {
+ $user = null;
- $user = $form->getUser();
+ if ($key = $this->_getParam('key')) {
+ $user = $this->loader->getUserLoader()->getUserByResetKey($key);
- If ($user->canResetPassword()) {
- if ($key = $request->getParam('key')) {
- // Key has been passed by mail
- if ($user->checkPasswordResetKey($key)) {
- $user->setPasswordResetRequired(true);
- $user->setAsCurrentUser();
- $this->addMessage($this->_('Reset accepted, enter your new password.'));
- $user->gotoStartPage($this->menu, $request);
- return;
+ if ($user->hasValidResetKey()) {
+ $form = $user->getChangePasswordForm(array('askOld' => false));
+ } else {
+ if (! $request->isPost()) {
+ if ($user->hasPassword() || (! $user->isActive())) {
+ $errors[] = $this->_('Your password reset request is no longer valid, please request a new link.');
} else {
- $errors[] = $this->_('This key timed out or does not belong to this user.');
+ $errors[] = $this->_('Your password input request is no longer valid, please request a new link.');
}
- } else {
- $subjectTemplate = $this->_('Password reset requested');
- $bbBodyTemplate = $this->_("To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n{reset_url}");
+ }
- $errors = $user->sendMail($subjectTemplate, $bbBodyTemplate, true);
- if (! $errors) {
- // Everything went OK!
- $errors[] = $this->_('We sent you an e-mail with a reset link. Click on the link in the e-mail.');
+ if ($user->isActive()) {
+ $form->getUserNameElement()->setValue($user->getLoginName());
+ $form->getOrganizationElement()->setValue($user->getBaseOrganizationId());
+ }
+ }
+ }
+
+ if ($request->isPost() && $form->isValid($request->getPost())) {
+
+ if ($form instanceof Gems_User_Form_ResetRequestForm) {
+ $user = $form->getUser();
+
+ $errors = $this->sendUserResetEMail($user);
+ if (! $errors) {
+ // Everything went OK!
+ $this->addMessage($this->_('We sent you an e-mail with a reset link. Click on the link in the e-mail.'));
+
+ if ($this->returnToLoginAfterReset) {
+ $this->loader->getCurrentUser()->gotoStartPage($this->menu, $request);
}
}
- } else {
- $errors[] = $this->_('No such user found or no e-mail address known or user cannot be reset.');
+
+ } elseif ($form instanceof Gems_User_Form_ChangePasswordForm) {
+ $this->addMessage($this->_('New password is active.'));
+
+ $user->setAsCurrentUser();
+ $user->gotoStartPage($this->menu, $this->getRequest());
}
+
}
+ $form->populate($request->getParams());
- $this->displayResetForm($form, $errors);
+ $this->displayResetForm($form, $errors, $user);
}
+
+ /**
+ * Send the user an e-mail with a link for password reset
+ *
+ * @param Gems_User_User $user
+ * @return mixed string or array of Errors or null when successful.
+ */
+ public function sendUserResetEMail(Gems_User_User $user)
+ {
+ $subjectTemplate = $this->_('Password reset requested');
+ $bbBodyTemplate = $this->_("To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n{reset_url}");
+
+ return $user->sendMail($subjectTemplate, $bbBodyTemplate, true);
+ }
}
Modified: trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-04-02 17:55:47 UTC (rev 592)
+++ trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-04-03 15:27:25 UTC (rev 593)
@@ -53,7 +53,14 @@
protected $db;
/**
+ * The time period in hours a reset key is valid for this user.
*
+ * @var int
+ */
+ protected $hoursResetKeyIsValid = 24;
+
+ /**
+ *
* @var Gems_Project_ProjectSettings
*/
protected $project;
@@ -157,7 +164,7 @@
$data['gup_id_user'] = $user->getUserLoginId();
- $row = $model->loadFirst($data + array('DATE_ADD(gup_reset_requested, INTERVAL 24 HOUR) >= CURRENT_TIMESTAMP'));
+ $row = $model->loadFirst($data + array('DATE_ADD(gup_reset_requested, INTERVAL ' . $this->hoursResetKeyIsValid . ' HOUR) >= CURRENT_TIMESTAMP'));
if ($row && $row['gup_reset_key']) {
// Keep using the key.
$data['gup_reset_key'] = $row['gup_reset_key'];
@@ -166,9 +173,16 @@
}
$data['gup_reset_requested'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
- $model->save($data);
+ while (true) {
+ try {
+ $model->save($data);
- return $data['gup_reset_key'];
+ return $data['gup_reset_key'];
+
+ } catch (Zend_Db_Exception $zde) {
+ $data['gup_reset_key'] = $this->hashPassword(time() . $user->getEmailAddress());
+ }
+ }
}
/**
Modified: trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php 2012-04-02 17:55:47 UTC (rev 592)
+++ trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php 2012-04-03 15:27:25 UTC (rev 593)
@@ -165,6 +165,7 @@
if (! $element instanceof Zend_Form_Element_Hidden) {
$element = new Zend_Form_Element_Hidden($this->organizationFieldName);
+ $element->setValue($orgId);
$this->addElement($element);
}
@@ -183,16 +184,15 @@
$element->setAttrib('size', max(count($orgs) + 1, $this->organizationMaxLines));
}
$this->addElement($element);
-
+ $element->setValue($orgId);
}
- $element->setValue($orgId);
return $element;
}
/**
* Returns true when the organization element is visible to the user.
- *
+ *
* @return boolean
*/
public function getOrganizationIsVisible()
Deleted: trunk/library/classes/Gems/User/Form/ResetForm.php
===================================================================
--- trunk/library/classes/Gems/User/Form/ResetForm.php 2012-04-02 17:55:47 UTC (rev 592)
+++ trunk/library/classes/Gems/User/Form/ResetForm.php 2012-04-03 15:27:25 UTC (rev 593)
@@ -1,201 +0,0 @@
-<?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: ResetForm.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.3
- */
-class Gems_User_Form_ResetForm extends Gems_User_Form_OrganizationFormAbstract
-{
- /**
- * The field name for the login link element
- *
- * @var string
- */
- protected $_loginLinkFieldName = 'loginlink';
-
- /**
- * The field name for the reset key element.
- *
- * @var string
- */
- protected $_resetKeyFieldName = 'key';
-
- /**
- * First the password reset is requested (= false), then the reset key is passed (= true)
- *
- * @var boolean Calculated when null
- */
- protected $hasResetKey = null;
-
- /**
- * Returns an html link for the login page.
- *
- * @return MUtil_Html_AElement
- */
- public function getLoginLink()
- {
- return MUtil_Html::create('a', array('controller' => 'index', 'action' => 'login'), $this->translate->_('Back to login'), array('class' => 'actionlink'));
- }
-
- /**
- * Returns a link to the login page
- *
- * @return MUtil_Form_Element_Html
- */
- public function getLoginLinkElement()
- {
- $element = $this->getElement($this->_tokenFieldName);
-
- if (! $element) {
- // Login link
- if ($link = $this->getLoginLink()) {
- $element = new MUtil_Form_Element_Html($this->_loginLinkFieldName);
- // $element->br();
- $element->setValue($link);
-
- $this->addElement($element);
- }
-
- return $element;
- }
- }
-
- /**
- * Returns an element for keeping a reset key.
- *
- * @return Zend_Form_Element_Hidden
- */
- public function getResetKeyElement()
- {
- $element = $this->getElement($this->_resetKeyFieldName);
-
- if (! $element) {
- $element = new Zend_Form_Element_Hidden($this->_resetKeyFieldName);
-
- $this->addElement($element);
- }
-
- return $element;
- }
-
- /**
- * Returns the label for the submitbutton
- *
- * @return string
- */
- public function getSubmitButtonLabel()
- {
- if ($this->hasResetKey()) {
- return $this->translate->_('Reset password');
- } else {
- return $this->translate->_('Request password');
- }
- }
-
- /**
- * Returns/sets a login name element.
- *
- * @return Zend_Form_Element_Text
- * /
- public function getUserNameElement()
- {
- $element = $this->getElement($this->usernameFieldName);
-
- if (! $element) {
- $element = parent::getUserNameElement();
-
- $element->addValidator(new Gems_User_Validate_ResetKeyValidator($this, $this->translate, $this->_resetKeyFieldName));
- }
-
- return $element;
- }
-
- /**
- * Is the form working in reset mode or not
- *
- * @return boolean
- */
- public function hasResetKey()
- {
- if (null === $this->hasResetKey) {
- $request = $this->getRequest();
-
- $this->hasResetKey = (boolean) $request->getParam($this->_resetKeyFieldName, false);
- }
-
- return $this->hasResetKey;
- }
-
- /**
- * The function that determines the element load order
- *
- * @return Gems_User_Form_LoginForm (continuation pattern)
- */
- public function loadDefaultElements()
- {
- if ($this->hasResetKey()) {
- $this->getResetKeyElement();
- }
- $this->getOrganizationElement();
- $this->getUserNameElement();
- $this->getSubmitButton();
- $this->getLoginLinkElement();
-
- return $this;
- }
-
- /**
- * Is the form working in reset mode or not
- *
- * Enables loading of parameter through Zend_Form::__construct()
- *
- * @param boolean $hasKey
- * @return Gems_User_Form_ResetForm (continuation pattern)
- */
- public function setHasResetKey($hasKey = true)
- {
- $this->hasResetKey = $hasKey;
-
- return $this;
- }
-}
Added: trunk/library/classes/Gems/User/Form/ResetRequestForm.php
===================================================================
--- trunk/library/classes/Gems/User/Form/ResetRequestForm.php (rev 0)
+++ trunk/library/classes/Gems/User/Form/ResetRequestForm.php 2012-04-03 15:27:25 UTC (rev 593)
@@ -0,0 +1,131 @@
+<?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: ResetForm.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.3
+ */
+class Gems_User_Form_ResetRequestForm extends Gems_User_Form_OrganizationFormAbstract
+{
+ /**
+ * The field name for the login link element
+ *
+ * @var string
+ */
+ protected $_loginLinkFieldName = 'loginlink';
+
+ /**
+ * Returns an html link for the login page.
+ *
+ * @return MUtil_Html_AElement
+ */
+ public function getLoginLink()
+ {
+ return MUtil_Html::create('a', array('controller' => 'index', 'action' => 'login'), $this->translate->_('Back to login'), array('class' => 'actionlink'));
+ }
+
+ /**
+ * Returns a link to the login page
+ *
+ * @return MUtil_Form_Element_Html
+ */
+ public function getLoginLinkElement()
+ {
+ $element = $this->getElement($this->_tokenFieldName);
+
+ if (! $element) {
+ // Login link
+ if ($link = $this->getLoginLink()) {
+ $element = new MUtil_Form_Element_Html($this->_loginLinkFieldName);
+ // $element->br();
+ $element->setValue($link);
+
+ $this->addElement($element);
+ }
+
+ return $element;
+ }
+ }
+
+ /**
+ * Returns the label for the submitbutton
+ *
+ * @return string
+ */
+ public function getSubmitButtonLabel()
+ {
+ return $this->translate->_('Request reset');
+ }
+
+ /**
+ * Returns/sets a login name element.
+ *
+ * @return Zend_Form_Element_Text
+ */
+ public function getUserNameElement()
+ {
+ $element = $this->getElement($this->usernameFieldName);
+
+ if (! $element) {
+ $element = parent::getUserNameElement();
+
+ $element->addValidator(new Gems_User_Validate_ResetRequestValidator($this, $this->translate));
+ }
+
+ 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->getSubmitButton();
+ $this->getLoginLinkElement();
+
+ return $this;
+ }
+}
Modified: trunk/library/classes/Gems/User/Organization.php
===================================================================
--- trunk/library/classes/Gems/User/Organization.php 2012-04-02 17:55:47 UTC (rev 592)
+++ trunk/library/classes/Gems/User/Organization.php 2012-04-03 15:27:25 UTC (rev 593)
@@ -71,13 +71,26 @@
);
/**
+ * Required
*
+ * @var Gems_Util_BasePath
+ */
+ protected $basepath;
+
+ /**
+ *
* @var Zend_Db_Adapter_Abstract
*/
protected $db;
/**
*
+ * @var Gems_Project_ProjectSettings
+ */
+ protected $project;
+
+ /**
+ *
* @var Gems_Util
*/
protected $util;
@@ -317,6 +330,27 @@
}
/**
+ * Set this organization as teh one currently active
+ *
+ * @return Gems_User_Organization (continutation pattern)
+ */
+ public function setAsCurrentOrganization()
+ {
+ $organizationId = $this->getId();
+
+ 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($this->getStyle());
+ }
+
+ return $this;
+ }
+
+ /**
* Tell the organization there is at least one respondent attached to it.
*
* Does nothing if this is already known.
Modified: trunk/library/classes/Gems/User/RespondentUserDefinition.php
===================================================================
--- trunk/library/classes/Gems/User/RespondentUserDefinition.php 2012-04-02 17:55:47 UTC (rev 592)
+++ trunk/library/classes/Gems/User/RespondentUserDefinition.php 2012-04-03 15:27:25 UTC (rev 593)
@@ -83,7 +83,8 @@
))
->joinLeft('gems__user_passwords', 'gul_id_user = gup_id_user', array(
'user_password_reset' => 'gup_reset_required',
- ))
+ 'user_resetkey_valid' => 'CASE WHEN DATE_ADD(gup_reset_requested, INTERVAL ' . $this->hoursResetKeyIsValid . ' HOUR) >= CURRENT_TIMESTAMP THEN 1 ELSE 0 END',
+ ))
->joinLeft('gems__reception_codes', 'gr2o_reception_code = grc_id_reception_code', array())
->where('ggp_group_active = 1')
->where('grc_success = 1')
Modified: trunk/library/classes/Gems/User/StaffUserDefinition.php
===================================================================
--- trunk/library/classes/Gems/User/StaffUserDefinition.php 2012-04-02 17:55:47 UTC (rev 592)
+++ trunk/library/classes/Gems/User/StaffUserDefinition.php 2012-04-03 15:27:25 UTC (rev 593)
@@ -82,6 +82,7 @@
))
->joinLeft('gems__user_passwords', 'gul_id_user = gup_id_user', array(
'user_password_reset' => 'gup_reset_required',
+ 'user_resetkey_valid' => 'CASE WHEN DATE_ADD(gup_reset_requested, INTERVAL ' . $this->hoursResetKeyIsValid . ' HOUR) >= CURRENT_TIMESTAMP THEN 1 ELSE 0 END',
))
->where('ggp_group_active = 1')
->where('gsf_active = 1')
@@ -90,6 +91,8 @@
->where('gul_id_organization = ?')
->limit(1);
+ // MUtil_Echo::track($select->__toString());
+
return $select;
}
}
\ No newline at end of file
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-04-02 17:55:47 UTC (rev 592)
+++ trunk/library/classes/Gems/User/User.php 2012-04-03 15:27:25 UTC (rev 593)
@@ -68,13 +68,6 @@
/**
* Required
*
- * @var Gems_Util_BasePath
- */
- protected $basepath;
-
- /**
- * Required
- *
* @var Zend_Db_Adapter_Abstract
*/
protected $db;
@@ -517,7 +510,7 @@
}
}
- return (boolean) $this->acl && $this->basepath && $this->userLoader;
+ return (boolean) $this->acl && $this->userLoader;
}
/**
@@ -946,7 +939,17 @@
}
/**
+ * True when the reset key is within it's timeframe
*
+ * @return boolean
+ */
+ public function hasValidResetKey()
+ {
+ return (boolean) $this->_getVar('user_resetkey_valid');
+ }
+
+ /**
+ *
* @return boolean True when a user can log in.
*/
public function isActive()
@@ -1181,6 +1184,8 @@
}
}
+ $this->getCurrentOrganization()->setAsCurrentOrganization();
+
return $this;
}
@@ -1210,39 +1215,31 @@
$this->_setVar('user_organization_name', $organization->getName());
$this->_setVar('user_style', $organization->getStyle());
// End depreciation warning
+ }
+ if ($this->isCurrentUser()) {
+ $this->getCurrentOrganization()->setAsCurrentOrganization();
- if ($this->isCurrentUser()) {
- if (! Gems_Cookies::setOrganization($organizationId, $this->basepath->getBasePath())) {
- throw new Exception($this->translate->_('Cookies must be enabled for this site.'));
- }
+ // 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) {
- $escort = GemsEscort::getInstance();
- if ($escort instanceof Gems_Project_Layout_MultiLayoutInterface) {
- $escort->layoutSwitch($organization->getStyle());
- }
+ //Create the list of request cache keys that match an organization ID (to be extended)
+ $possibleOrgIds = array(
+ 'gr2o_id_organization',
+ 'gto_id_organization');
- // Now update the requestcache to change the oldOrgId to the new orgId
- // Don't do it when the oldOrgId doesn't match
- ...
[truncated message content] |
|
From: <gem...@li...> - 2012-04-05 12:12:51
|
Revision: 597
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=597&view=rev
Author: matijsdejong
Date: 2012-04-05 12:12:41 +0000 (Thu, 05 Apr 2012)
Log Message:
-----------
Fixed security leak that allowed login without a password
Added reset key duration to mail template fields for reset
Modified Paths:
--------------
trunk/library/classes/Gems/Default/IndexAction.php
trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php
trunk/library/classes/Gems/User/RadiusUserDefinition.php
trunk/library/classes/Gems/User/User.php
trunk/library/classes/Gems/User/UserDefinitionAbstract.php
trunk/library/classes/Gems/User/UserDefinitionInterface.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/IndexAction.php
===================================================================
--- trunk/library/classes/Gems/Default/IndexAction.php 2012-04-04 18:33:08 UTC (rev 596)
+++ trunk/library/classes/Gems/Default/IndexAction.php 2012-04-05 12:12:41 UTC (rev 597)
@@ -134,7 +134,7 @@
*/
protected function displayLoginForm(Gems_User_Form_LoginForm $form)
{
- $form->getUser()->setAsCurrentUser();
+ $this->setCurrentOrganizationTo($form->getUser());
$this->view->form = $form;
}
@@ -148,7 +148,7 @@
protected function displayResetForm(Gems_Form_AutoLoadFormAbstract $form, $errors, Gems_User_User $user = null)
{
if ($form instanceof Gems_User_Form_ResetRequestForm) {
- $form->getUser()->setAsCurrentUser();
+ $user = $form->getUser();
$this->html->h3($this->_('Request password reset'));
@@ -158,9 +158,10 @@
} else {
$p->append($this->_('Please enter your username or e-mail address. '));
}
- $p->append($this->_('We will then send you an e-mail with a link you can use to reset your password.'));
+ $this->html->p($this->_('We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice.'));
} elseif ($form instanceof Gems_User_Form_ChangePasswordForm) {
+ $form->getUser()->getCurrentOrganization()->setAsCurrentOrganization();
if ($user->hasPassword()) {
$this->html->h3($this->_('Execute password reset'));
$p = $this->html->pInfo($this->_('We received your password reset request.'));
@@ -177,6 +178,10 @@
$this->addMessage($errors);
}
+ if ($user) {
+ $this->setCurrentOrganizationTo($user);
+ }
+
$this->html->append($form);
}
@@ -333,8 +338,31 @@
public function sendUserResetEMail(Gems_User_User $user)
{
$subjectTemplate = $this->_('Password reset requested');
+ /* CANNOT BE TESTED TODAY
+ $bbBodyTemplate = $this->_("Dear {greeting},
+
+A new password was requested for your [b]{organization}[/b] site [b]{project}[/b], please click within {reset_in_hours} hours on [url={reset_url}]this link[/url] to enter the password of your choice.
+
+{organization_signature}
+
+[url={reset_url}]{reset_url}[/url]
+"); // */
$bbBodyTemplate = $this->_("To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n{reset_url}");
return $user->sendMail($subjectTemplate, $bbBodyTemplate, true);
}
+
+ /**
+ * Helper function to safely switch org during login
+ *
+ * @param Gems_User_User $user
+ */
+ protected function setCurrentOrganizationTo(Gems_User_User $user)
+ {
+ $current = $this->loader->getCurrentUser();
+
+ if ($current !== $user) {
+ $current->setCurrentOrganization($user->getCurrentOrganization());
+ }
+ }
}
Modified: trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-04-04 18:33:08 UTC (rev 596)
+++ trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-04-05 12:12:41 UTC (rev 597)
@@ -53,7 +53,7 @@
protected $db;
/**
- * The time period in hours a reset key is valid for this user.
+ * The time period in hours a reset key is valid for this definition.
*
* @var int
*/
Modified: trunk/library/classes/Gems/User/RadiusUserDefinition.php
===================================================================
--- trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-04-04 18:33:08 UTC (rev 596)
+++ trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-04-05 12:12:41 UTC (rev 597)
@@ -47,7 +47,7 @@
* @license New BSD License
* @since Class available since version 1.5
*/
-class Gems_User_RadiusUserDefinition extends Gems_User_StaffUserDefinition implements Gems_User_UserDefinitionInterface, Gems_User_UserDefinitionConfigurableInterface
+class Gems_User_RadiusUserDefinition extends Gems_User_StaffUserDefinition implements Gems_User_UserDefinitionConfigurableInterface
{
/**
* @var Gems_Model_JoinModel
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-04-04 18:33:08 UTC (rev 596)
+++ trunk/library/classes/Gems/User/User.php 2012-04-05 12:12:41 UTC (rev 597)
@@ -763,21 +763,22 @@
$orgResults = $org->getMailFields();
$projResults = $this->project->getMailFields();
- $result['bcc'] = $projResults['project_bcc'];
- $result['email'] = $this->getEmailAddress();
- $result['first_name'] = $this->_getVar('user_first_name');
- $result['from'] = $this->getFrom();
- $result['full_name'] = trim($this->getGenderHello($locale) . ' ' . $this->getFullName());
- $result['greeting'] = $this->getGreeting($locale);
- $result['last_name'] = ltrim($this->_getVar('user_surname_prefix') . ' ') . $this->_getVar('user_last_name');
- $result['login_url'] = $orgResults['organization_login_url'];
- $result['name'] = $this->getFullName();
+ $result['bcc'] = $projResults['project_bcc'];
+ $result['email'] = $this->getEmailAddress();
+ $result['first_name'] = $this->_getVar('user_first_name');
+ $result['from'] = $this->getFrom();
+ $result['full_name'] = trim($this->getGenderHello($locale) . ' ' . $this->getFullName());
+ $result['greeting'] = $this->getGreeting($locale);
+ $result['last_name'] = ltrim($this->_getVar('user_surname_prefix') . ' ') . $this->_getVar('user_last_name');
+ $result['login_url'] = $orgResults['organization_login_url'];
+ $result['name'] = $this->getFullName();
$result = $result + $orgResults + $projResults;
- $result['reset_ask'] = $orgResults['organization_login_url'] . '/index/resetpassword';
- $result['reply_to'] = $result['from'];
- $result['to'] = $result['email'];
+ $result['reset_ask'] = $orgResults['organization_login_url'] . '/index/resetpassword';
+ $result['reset_in_hours'] = $this->definition->getResetKeyDurationInHours();
+ $result['reply_to'] = $result['from'];
+ $result['to'] = $result['email'];
return $result;
}
@@ -813,8 +814,8 @@
*/
public function getResetPasswordMailFields($locale = null)
{
- $result['reset_key'] = $this->getPasswordResetKey();
- $result['reset_url'] = $this->getBaseOrganization()->getLoginUrl() . '/index/resetpassword/key/' . $result['reset_key'];
+ $result['reset_key'] = $this->getPasswordResetKey();
+ $result['reset_url'] = $this->getBaseOrganization()->getLoginUrl() . '/index/resetpassword/key/' . $result['reset_key'];
return $result + $this->getMailFields($locale);
}
@@ -1089,7 +1090,7 @@
} catch (Exception $e) {
return array(
- $this->_('Unable to send e-mail.'),
+ $this->translate->_('Unable to send e-mail.'),
$e->getMessage());
}
}
Modified: trunk/library/classes/Gems/User/UserDefinitionAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/UserDefinitionAbstract.php 2012-04-04 18:33:08 UTC (rev 596)
+++ trunk/library/classes/Gems/User/UserDefinitionAbstract.php 2012-04-05 12:12:41 UTC (rev 597)
@@ -49,6 +49,13 @@
abstract class Gems_User_UserDefinitionAbstract extends MUtil_Registry_TargetAbstract implements Gems_User_UserDefinitionInterface
{
/**
+ * The time period in hours a reset key is valid for this definition.
+ *
+ * @var int
+ */
+ protected $hoursResetKeyIsValid = 0;
+
+ /**
* Return true if a password reset key can be created.
*
* Returns the setting for the definition whan no user is passed, otherwise
@@ -100,6 +107,16 @@
}
/**
+ * Returns the number of hours a reset key remains valud
+ *
+ * @return int
+ */
+ public function getResetKeyDurationInHours()
+ {
+ return $this->hoursResetKeyIsValid;
+ }
+
+ /**
* Returns true when users using this definition are staff members.
*
* Used only when the definition does not return a user_staff field.
Modified: trunk/library/classes/Gems/User/UserDefinitionInterface.php
===================================================================
--- trunk/library/classes/Gems/User/UserDefinitionInterface.php 2012-04-04 18:33:08 UTC (rev 596)
+++ trunk/library/classes/Gems/User/UserDefinitionInterface.php 2012-04-05 12:12:41 UTC (rev 597)
@@ -94,6 +94,13 @@
public function getPasswordResetKey(Gems_User_User $user);
/**
+ * Returns the number of hours a reset key remains valud
+ *
+ * @return int
+ */
+ public function getResetKeyDurationInHours();
+
+ /**
* Returns a user object, that may be empty if the user is unknown.
*
* @param string $login_name
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-04-04 18:33:08 UTC (rev 596)
+++ trunk/library/languages/default-en.po 2012-04-05 12:12:41 UTC (rev 597)
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
-"Project-Id-Version: Pulse EN\n"
+"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-03 18:47+0100\n"
+"POT-Creation-Date: 2012-04-05 14:09+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -1097,65 +1097,65 @@
msgstr "Please enter your username or e-mail address. "
#: classes/Gems/Default/IndexAction.php:161
-msgid "We will then send you an e-mail with a link you can use to reset your password."
-msgstr "We will then send you an e-mail with a link you can use to reset your password."
+msgid "We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice."
+msgstr "We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice."
-#: classes/Gems/Default/IndexAction.php:165
+#: classes/Gems/Default/IndexAction.php:166
msgid "Execute password reset"
msgstr "Execute password reset"
-#: classes/Gems/Default/IndexAction.php:166
+#: classes/Gems/Default/IndexAction.php:167
msgid "We received your password reset request."
msgstr "We received your password reset request."
-#: classes/Gems/Default/IndexAction.php:169
+#: classes/Gems/Default/IndexAction.php:170
#, php-format
msgid "Welcome to %s"
msgstr "Welcome to %s"
-#: classes/Gems/Default/IndexAction.php:170
+#: classes/Gems/Default/IndexAction.php:171
msgid "Welcome to this website."
msgstr "Welcome to this website."
-#: classes/Gems/Default/IndexAction.php:173
+#: classes/Gems/Default/IndexAction.php:174
msgid "Please enter your password of choice twice."
msgstr "Please enter your password of choice twice."
-#: classes/Gems/Default/IndexAction.php:207
+#: classes/Gems/Default/IndexAction.php:212
msgid "Your password must be changed."
msgstr "Your password must be changed."
-#: classes/Gems/Default/IndexAction.php:219
+#: classes/Gems/Default/IndexAction.php:224
#, php-format
msgid "Login successful, welcome %s."
msgstr "Login successful, welcome %s."
-#: classes/Gems/Default/IndexAction.php:262
+#: classes/Gems/Default/IndexAction.php:267
#, php-format
msgid "Good bye: %s."
msgstr "Good bye: %s."
-#: classes/Gems/Default/IndexAction.php:286
+#: classes/Gems/Default/IndexAction.php:291
msgid "Your password reset request is no longer valid, please request a new link."
msgstr "Your password reset request is no longer valid, please request a new link."
-#: classes/Gems/Default/IndexAction.php:288
+#: classes/Gems/Default/IndexAction.php:293
msgid "Your password input request is no longer valid, please request a new link."
msgstr "Your password input request is no longer valid, please request a new link."
-#: classes/Gems/Default/IndexAction.php:307
+#: classes/Gems/Default/IndexAction.php:312
msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail."
msgstr "We sent you an e-mail with a reset link. Click on the link in the e-mail."
-#: classes/Gems/Default/IndexAction.php:315
+#: classes/Gems/Default/IndexAction.php:320
msgid "New password is active."
msgstr "New password is active."
-#: classes/Gems/Default/IndexAction.php:335
+#: classes/Gems/Default/IndexAction.php:340
msgid "Password reset requested"
msgstr "Password reset requested"
-#: classes/Gems/Default/IndexAction.php:336
+#: classes/Gems/Default/IndexAction.php:350
msgid ""
"To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n"
"{reset_url}"
@@ -3633,11 +3633,11 @@
msgid "You are not allowed to login from this location."
msgstr "You are not allowed to login from this location."
-#: classes/Gems/User/User.php:1065
+#: classes/Gems/User/User.php:1066
msgid "Trying to send a password reset to a user that cannot be reset."
msgstr "Trying to send a password reset to a user that cannot be reset."
-#: classes/Gems/User/User.php:1092
+#: classes/Gems/User/User.php:1093
msgid "Unable to send e-mail."
msgstr "Unable to send e-mail."
@@ -3810,59 +3810,59 @@
msgid "Mr./Mrs."
msgstr "Mr./Mrs."
-#: classes/MUtil/Date.php:217
+#: classes/MUtil/Date.php:219
#, php-format
msgid "%s ago"
msgstr "%s ago"
-#: classes/MUtil/Date.php:220
+#: classes/MUtil/Date.php:222
#, php-format
msgid "%s to go"
msgstr "%s to go"
-#: classes/MUtil/Date.php:231
+#: classes/MUtil/Date.php:233
msgid "second"
msgid_plural "seconds"
msgstr[0] "second"
msgstr[1] "seconds"
-#: classes/MUtil/Date.php:234
+#: classes/MUtil/Date.php:236
msgid "minute"
msgid_plural "minutes"
msgstr[0] "minute"
msgstr[1] "minutes"
-#: classes/MUtil/Date.php:237
+#: classes/MUtil/Date.php:239
msgid "hour"
msgid_plural "hours"
msgstr[0] "hour"
msgstr[1] "hours"
-#: classes/MUtil/Date.php:240
+#: classes/MUtil/Date.php:242
msgid "day"
msgid_plural "days"
msgstr[0] "day"
msgstr[1] "days"
-#: classes/MUtil/Date.php:243
+#: classes/MUtil/Date.php:245
msgid "week"
msgid_plural "weeks"
msgstr[0] "week"
msgstr[1] "weeks"
-#: classes/MUtil/Date.php:246
+#: classes/MUtil/Date.php:248
msgid "month"
msgid_plural "months"
msgstr[0] "month"
msgstr[1] "months"
-#: classes/MUtil/Date.php:249
+#: classes/MUtil/Date.php:251
msgid "year"
msgid_plural "years"
msgstr[0] "year"
msgstr[1] "years"
-#: classes/MUtil/Date.php:252
+#: classes/MUtil/Date.php:254
msgid "decade"
msgid_plural "decades"
msgstr[0] "decade"
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-04-04 18:33:08 UTC (rev 596)
+++ trunk/library/languages/default-nl.po 2012-04-05 12:12:41 UTC (rev 597)
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
-"Project-Id-Version: Pulse NL\n"
+"Project-Id-Version: GemsTracker NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-03 17:15+0100\n"
+"POT-Creation-Date: 2012-04-05 14:09+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -1097,65 +1097,65 @@
msgstr "Geef uw email adres of gebruikersnaam op. "
#: classes/Gems/Default/IndexAction.php:161
-msgid "We will then send you an e-mail with a link you can use to reset your password."
-msgstr "Daarna sturen wij een een email met een link waarmee u uw wachtwoord kan vervangen."
+msgid "We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice."
+msgstr "Vervolgens sturen wij u een email met een link. De link verwijst naar een pagina waar u een zelfgekozen wachtwoord in kan voeren."
-#: classes/Gems/Default/IndexAction.php:165
+#: classes/Gems/Default/IndexAction.php:166
msgid "Execute password reset"
msgstr "Vervang vergeten passwood"
-#: classes/Gems/Default/IndexAction.php:166
+#: classes/Gems/Default/IndexAction.php:167
msgid "We received your password reset request."
msgstr "We hebben uw verzoek voor een nieuw wachtwoord ontvangen."
-#: classes/Gems/Default/IndexAction.php:169
+#: classes/Gems/Default/IndexAction.php:170
#, php-format
msgid "Welcome to %s"
msgstr "Welkom bij %s"
-#: classes/Gems/Default/IndexAction.php:170
+#: classes/Gems/Default/IndexAction.php:171
msgid "Welcome to this website."
msgstr "Welkom op deze website."
-#: classes/Gems/Default/IndexAction.php:173
+#: classes/Gems/Default/IndexAction.php:174
msgid "Please enter your password of choice twice."
msgstr "Geef twee keer een zelfgekozen wachtwoord op."
-#: classes/Gems/Default/IndexAction.php:207
+#: classes/Gems/Default/IndexAction.php:212
msgid "Your password must be changed."
msgstr "Uw wachtwoord moet veranderd worden."
-#: classes/Gems/Default/IndexAction.php:219
+#: classes/Gems/Default/IndexAction.php:224
#, php-format
msgid "Login successful, welcome %s."
msgstr "Login in orde, welkom %s."
-#: classes/Gems/Default/IndexAction.php:262
+#: classes/Gems/Default/IndexAction.php:267
#, php-format
msgid "Good bye: %s."
msgstr "Tot ziens: %s."
-#: classes/Gems/Default/IndexAction.php:286
+#: classes/Gems/Default/IndexAction.php:291
msgid "Your password reset request is no longer valid, please request a new link."
msgstr "Uw verzoek om een nieuw wachtwoord is niet meer geldig, maar u kan hieronder een nieuwe link aanvragen."
-#: classes/Gems/Default/IndexAction.php:288
+#: classes/Gems/Default/IndexAction.php:293
msgid "Your password input request is no longer valid, please request a new link."
msgstr "Uw link om een wachtwoord in te voeren is niet meer geldig, maar u kan hieronder een nieuwe link aanvragen."
-#: classes/Gems/Default/IndexAction.php:307
+#: classes/Gems/Default/IndexAction.php:312
msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail."
msgstr "We hebben u een email met reset link gestuurd. Klik op de link in de email."
-#: classes/Gems/Default/IndexAction.php:315
+#: classes/Gems/Default/IndexAction.php:320
msgid "New password is active."
msgstr "Nieuwe wachtwoord geactiveerd."
-#: classes/Gems/Default/IndexAction.php:335
+#: classes/Gems/Default/IndexAction.php:340
msgid "Password reset requested"
msgstr "Wachtwoord reset aangevraagd"
-#: classes/Gems/Default/IndexAction.php:336
+#: classes/Gems/Default/IndexAction.php:350
msgid ""
"To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n"
"{reset_url}"
@@ -3633,11 +3633,11 @@
msgid "You are not allowed to login from this location."
msgstr "U kunt vanaf deze locatie niet inloggen."
-#: classes/Gems/User/User.php:1065
+#: classes/Gems/User/User.php:1066
msgid "Trying to send a password reset to a user that cannot be reset."
msgstr "Het wachtwoord voor deze gebruiker kan niet gewijzigd worden."
-#: classes/Gems/User/User.php:1092
+#: classes/Gems/User/User.php:1093
msgid "Unable to send e-mail."
msgstr "Verzenden email mislukt."
@@ -3810,59 +3810,59 @@
msgid "Mr./Mrs."
msgstr "De heer/Mevrouw"
-#: classes/MUtil/Date.php:217
+#: classes/MUtil/Date.php:219
#, php-format
msgid "%s ago"
msgstr "%s geleden"
-#: classes/MUtil/Date.php:220
+#: classes/MUtil/Date.php:222
#, php-format
msgid "%s to go"
msgstr "over %s"
-#: classes/MUtil/Date.php:231
+#: classes/MUtil/Date.php:233
msgid "second"
msgid_plural "seconds"
msgstr[0] "seconde"
msgstr[1] "seconden"
-#: classes/MUtil/Date.php:234
+#: classes/MUtil/Date.php:236
msgid "minute"
msgid_plural "minutes"
msgstr[0] "minuut"
msgstr[1] "minuten"
-#: classes/MUtil/Date.php:237
+#: classes/MUtil/Date.php:239
msgid "hour"
msgid_plural "hours"
msgstr[0] "uur"
msgstr[1] "uur"
-#: classes/MUtil/Date.php:240
+#: classes/MUtil/Date.php:242
msgid "day"
msgid_plural "days"
msgstr[0] "dag"
msgstr[1] "dagen"
-#: classes/MUtil/Date.php:243
+#: classes/MUtil/Date.php:245
msgid "week"
msgid_plural "weeks"
msgstr[0] "week"
msgstr[1] "weken"
-#: classes/MUtil/Date.php:246
+#: classes/MUtil/Date.php:248
msgid "month"
msgid_plural "months"
msgstr[0] "maand"
msgstr[1] "maanden"
-#: classes/MUtil/Date.php:249
+#: classes/MUtil/Date.php:251
msgid "year"
msgid_plural "years"
msgstr[0] "jaar"
msgstr[1] "jaren"
-#: classes/MUtil/Date.php:252
+#: classes/MUtil/Date.php:254
msgid "decade"
msgid_plural "decades"
msgstr[0] "decennium"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-05 14:30:05
|
Revision: 598
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=598&view=rev
Author: matijsdejong
Date: 2012-04-05 14:29:54 +0000 (Thu, 05 Apr 2012)
Log Message:
-----------
Chang password forms now can have (project definable) check questions to answer in addition to the new password
Documentation standardized and small bug fixed in DatePicker.php view helper
Modified Paths:
--------------
trunk/library/changelog.txt
trunk/library/classes/Gems/Default/IndexAction.php
trunk/library/classes/Gems/User/Form/ChangePasswordForm.php
trunk/library/classes/Gems/User/RespondentUserDefinition.php
trunk/library/classes/Gems/User/User.php
trunk/library/classes/Gems/User/UserLoader.php
trunk/library/classes/MUtil/JQuery/View/Helper/DatePicker.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/changelog.txt
===================================================================
--- trunk/library/changelog.txt 2012-04-05 12:12:41 UTC (rev 597)
+++ trunk/library/changelog.txt 2012-04-05 14:29:54 UTC (rev 598)
@@ -1,13 +1,12 @@
Important changes from 1.5.2 => 1.5.3
============================================================
-People can login using their e-amil address as user name.
-Showing a list of organizations to choose during login happens except when 1) there is only one organization or 2) a url is used that is assigned to a specific organization.
+People can login using their e-mail address as user name. This can be activated by for respondents and staff seperately, by default this is off for both.
+Showing a list of organizations to choose during login happens always except when 1) there is only one organization or 2) a url is used that is assigned to a specific organization.
Login & other password forms are now easy to customize on a per project basis.
-Login and authorizaiton rules are easier to extend.
-All password rules are reported during reset.
-The password reset cycle send a link that can be used to change the password straight away.
+Login and authorization rules are easier to extend.
+All password rules are reported on change password forms.
+The password reset cycle send a link that can be used to change the password straight away. By default the systems also asks the user to enter his/her birthday if available and username otherwise, but this can be removed / changed at the project level.
-
Important changes from 1.5.1 => 1.5.2
============================================================
Renamed project.ini setting concentRejected to consentRejected
Modified: trunk/library/classes/Gems/Default/IndexAction.php
===================================================================
--- trunk/library/classes/Gems/Default/IndexAction.php 2012-04-05 12:12:41 UTC (rev 597)
+++ trunk/library/classes/Gems/Default/IndexAction.php 2012-04-05 14:29:54 UTC (rev 598)
@@ -284,7 +284,7 @@
$user = $this->loader->getUserLoader()->getUserByResetKey($key);
if ($user->hasValidResetKey()) {
- $form = $user->getChangePasswordForm(array('askOld' => false));
+ $form = $user->getChangePasswordForm(array('askOld' => false, 'askCheck' => true));
} else {
if (! $request->isPost()) {
if ($user->hasPassword() || (! $user->isActive())) {
Modified: trunk/library/classes/Gems/User/Form/ChangePasswordForm.php
===================================================================
--- trunk/library/classes/Gems/User/Form/ChangePasswordForm.php 2012-04-05 12:12:41 UTC (rev 597)
+++ trunk/library/classes/Gems/User/Form/ChangePasswordForm.php 2012-04-05 14:29:54 UTC (rev 598)
@@ -89,6 +89,13 @@
protected $_table;
/**
+ * Should a user specific check question be asked?
+ *
+ * @var boolean
+ */
+ protected $askCheck = false;
+
+ /**
* Should the old password be requested.
*
* Calculated when null
@@ -98,6 +105,17 @@
protected $askOld = null;
/**
+ * Returns an array of elements for check fields during password reset and/or
+ * 'label name' => 'required value' pairs. vor asking extra questions before allowing
+ * a password change.
+ *
+ * Default is asking for the username but you can e.g. ask for someones birthday.
+ *
+ * @return array Of 'label name' => 'required values' or Zend_Form_Element elements
+ */
+ protected $checkFields = array();
+
+ /**
* Should the password rules be reported.
*
* @var boolean
@@ -132,6 +150,49 @@
}
/**
+ * Add user defined checkfields
+ *
+ * @return void
+ */
+ protected function addCheckFields()
+ {
+ $check = 1;
+ foreach ($this->checkFields as $label => &$value) {
+ if ($value instanceof Zend_Form_Element) {
+ $element = $value;
+ } else {
+ if ($value) {
+ $element = new Zend_Form_Element_Text('check_' . $check);
+ $element->setAllowEmpty(false);
+ $element->setLabel($label);
+
+ $validator = new Zend_Validate_Identical($value);
+ $validator->setMessage(sprintf($this->translate->_('%s is not correct.'), $label), Zend_Validate_Identical::NOT_SAME);
+ $element->addValidator($validator);
+
+ $value = $element;
+ $check++;
+ } else {
+ // Nothing to check for
+ unset($this->checkFields[$label]);
+ continue;
+ }
+ }
+ $this->addElement($element);
+ }
+ }
+
+ /**
+ * Should a user specific check question be asked?
+ *
+ * @return boolean
+ */
+ public function getAskCheck()
+ {
+ return $this->askCheck;
+ }
+
+ /**
* Should the for asking for an old password
*
* @return boolean
@@ -152,7 +213,7 @@
}
/**
- * Returns/sets a mew password element.
+ * Returns/sets a new password element.
*
* @return Zend_Form_Element_Password
*/
@@ -169,8 +230,11 @@
$element->setRequired(true);
$element->setRenderPassword(true);
$element->addValidator(new Gems_User_Validate_NewPasswordValidator($this->user));
- $element->addValidator(new MUtil_Validate_IsConfirmed($this->_repeatPasswordFieldName, $this->translate->_('Repeat password')));
+ $validator = new MUtil_Validate_IsConfirmed($this->_newPasswordFieldName, $this->translate->_('Repeat password'));
+ $validator->setMessage($this->translate->_("Must be the same as %fieldDescription%."), MUtil_Validate_IsConfirmed::NOT_SAME);
+ $element->addValidator($validator);
+
$this->addElement($element);
}
@@ -219,8 +283,11 @@
$element->setAttrib('maxlength', 20);
$element->setRequired(true);
$element->setRenderPassword(true);
- $element->addValidator(new MUtil_Validate_IsConfirmed($this->_newPasswordFieldName, $this->translate->_('New password')));
+ $validator = new MUtil_Validate_IsConfirmed($this->_newPasswordFieldName, $this->translate->_('New password'));
+ $validator->setMessage($this->translate->_("Must be the same as %fieldDescription%."), MUtil_Validate_IsConfirmed::NOT_SAME);
+ $element->addValidator($validator);
+
$this->addElement($element);
}
@@ -323,6 +390,10 @@
if ($this->getAskOld()) {
$this->getOldPasswordElement();
}
+ if ($this->getAskCheck()) {
+ $this->addCheckFields();
+ }
+
$this->getNewPasswordElement();
$this->getRepeatPasswordElement();
$this->getSubmitButton();
@@ -343,6 +414,21 @@
}
/**
+ * Should a user specific check question be asked?
+ *
+ * Enables loading of parameter through Zend_Form::__construct()
+ *
+ * @param boolean $askCheck
+ * @return Gems_User_Form_ChangePasswordForm (continuation pattern)
+ */
+ public function setAskCheck($askCheck = true)
+ {
+ $this->askCheck = $askCheck;
+
+ return $this;
+ }
+
+ /**
* Should the form ask for an old password
*
* Enables loading of parameter through Zend_Form::__construct()
@@ -358,6 +444,21 @@
}
/**
+ * Set optional user specific check question to be asked when getAskCheck() is on.
+ *
+ * Enables loading of parameter through Zend_Form::__construct()
+ *
+ * @param array $checkFields Of 'label name' => 'required values' or Zend_Form_Element elements
+ * @return Gems_User_Form_ChangePasswordForm (continuation pattern)
+ */
+ public function setCheckFields(array $checkFields)
+ {
+ $this->checkFields = $checkFields;
+
+ return $this;
+ }
+
+ /**
* Should the form report the password rules
*
* Enables loading of parameter through Zend_Form::__construct()
Modified: trunk/library/classes/Gems/User/RespondentUserDefinition.php
===================================================================
--- trunk/library/classes/Gems/User/RespondentUserDefinition.php 2012-04-05 12:12:41 UTC (rev 597)
+++ trunk/library/classes/Gems/User/RespondentUserDefinition.php 2012-04-05 14:29:54 UTC (rev 598)
@@ -73,6 +73,7 @@
'user_last_name' => 'grs_last_name',
'user_gender' => 'grs_gender',
'user_locale' => 'grs_iso_lang',
+ 'user_birthday' => 'grs_birthday',
))
->join('gems__organizations', 'gr2o_id_organization = gor_id_organization', array(
'user_group' => 'gor_respondent_group',
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-04-05 12:12:41 UTC (rev 597)
+++ trunk/library/classes/Gems/User/User.php 2012-04-05 14:29:54 UTC (rev 598)
@@ -571,7 +571,12 @@
return;
}
- return $this->userLoader->getChangePasswordForm($this, func_get_args());
+ $args = MUtil_Ra::args(func_get_args());
+ if (isset($args['askCheck']) && $args['askCheck']) {
+ $args['checkFields'] = $this->loadResetPasswordCheckFields();
+ }
+
+ return $this->userLoader->getChangePasswordForm($this, $args);
}
/**
@@ -1052,6 +1057,45 @@
}
/**
+ * Returns an array of elements for check fields during password reset and/or
+ * 'label name' => 'required value' pairs. vor asking extra questions before allowing
+ * a password change.
+ *
+ * Default is asking for the username but you can e.g. ask for someones birthday.
+ *
+ * @return array Of 'label name' => 'required values' or Zend_Form_Element elements
+ */
+ protected function loadResetPasswordCheckFields()
+ {
+ // CHECK ON SOMEONES BIRTHDAY
+ // Birthdays are usually not defined for staff but the do exist for respondents
+ if ($value = $this->_getVar('user_birthday')) {
+ $formData = Zend_Registry::get(MUtil_Model_FormBridge::REGISTRY_KEY);
+ $label = $this->translate->_('Your birthday');
+
+ $birthdayElem = new MUtil_JQuery_Form_Element_DatePicker('birthday');
+ $birthdayElem->setLabel($label);
+ if (isset($formData['date'])) {
+ $birthdayElem->setOptions($formData['date']);
+ }
+ $birthdayElem->setStorageFormat(Zend_Date::ISO_8601);
+
+ if ($format = $birthdayElem->getDateFormat()) {
+ $valueFormatted = MUtil_Date::format($value, $format, $birthdayElem->getStorageFormat());
+ } else {
+ $valueFormatted = $value;
+ }
+
+ $validator = new Zend_Validate_Identical($valueFormatted);
+ $validator->setMessage(sprintf($this->translate->_('%s is not correct.'), $label), Zend_Validate_Identical::NOT_SAME);
+ $birthdayElem->addValidator($validator);
+
+ return array($birthdayElem);
+ } // */
+ return array($this->translate->_('Username') => $this->getLoginName());
+ }
+
+ /**
* Send an e-mail to this user
*
* @param string $subjectTemplate A subject template in which {fields} are replaced
Modified: trunk/library/classes/Gems/User/UserLoader.php
===================================================================
--- trunk/library/classes/Gems/User/UserLoader.php 2012-04-05 12:12:41 UTC (rev 597)
+++ trunk/library/classes/Gems/User/UserLoader.php 2012-04-05 14:29:54 UTC (rev 598)
@@ -59,13 +59,13 @@
* When true Respondent members can use their e-mail address as login name
* @var boolean
*/
- public $allowRespondentEmailLogin = true;
+ public $allowRespondentEmailLogin = false;
/**
* When true Staff members can use their e-mail address as login name
* @var boolean
*/
- public $allowStaffEmailLogin = true;
+ public $allowStaffEmailLogin = false;
/**
*
Modified: trunk/library/classes/MUtil/JQuery/View/Helper/DatePicker.php
===================================================================
--- trunk/library/classes/MUtil/JQuery/View/Helper/DatePicker.php 2012-04-05 12:12:41 UTC (rev 597)
+++ trunk/library/classes/MUtil/JQuery/View/Helper/DatePicker.php 2012-04-05 14:29:54 UTC (rev 598)
@@ -4,7 +4,7 @@
/**
* Copyright (c) 2011, Erasmus MC
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
@@ -15,7 +15,7 @@
* * Neither the name of Erasmus MC nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -26,23 +26,24 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * @package MUtil
+ * @subpackage JQuery
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $Id$
*/
/**
- *
- * @author Matijs de Jong
- * @since 1.0
- * @version 1.1
- * @package MUtil
- * @subpackage View
+ *
+ * @package MUtil
+ * @subpackage JQuery
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.0
*/
-
-/**
- *
- * @author Matijs de Jong
- * @package MUtil
- * @subpackage View
- */
class MUtil_JQuery_View_Helper_DatePicker extends ZendX_JQuery_View_Helper_DatePicker
{
public function datePicker($id, $value = null, array $params = array(), array $attribs = array()) {
@@ -52,7 +53,7 @@
$this->jquery->addOnLoad($js);
}
- if ($format = $params['dateFormat']) {
+ if (isset($params['dateFormat']) && ($format = $params['dateFormat'])) {
//*
$js = array();
$js[] = '{';
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-04-05 12:12:41 UTC (rev 597)
+++ trunk/library/languages/default-en.po 2012-04-05 14:29:54 UTC (rev 598)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-05 14:09+0100\n"
+"POT-Creation-Date: 2012-04-05 16:25+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -3633,11 +3633,26 @@
msgid "You are not allowed to login from this location."
msgstr "You are not allowed to login from this location."
-#: classes/Gems/User/User.php:1066
+#: classes/Gems/User/User.php:1074
+msgid "Your birthday"
+msgstr "Your birthday"
+
+#: classes/Gems/User/User.php:1090
+#: classes/Gems/User/Form/ChangePasswordForm.php:169
+#, php-format
+msgid "%s is not correct."
+msgstr "%s is not correct."
+
+#: classes/Gems/User/User.php:1095
+#: classes/Gems/User/Form/OrganizationFormAbstract.php:271
+msgid "Username"
+msgstr "Username"
+
+#: classes/Gems/User/User.php:1110
msgid "Trying to send a password reset to a user that cannot be reset."
msgstr "Trying to send a password reset to a user that cannot be reset."
-#: classes/Gems/User/User.php:1093
+#: classes/Gems/User/User.php:1137
msgid "Unable to send e-mail."
msgstr "Unable to send e-mail."
@@ -3650,33 +3665,38 @@
msgid "Radius storage"
msgstr "Radius storage"
-#: classes/Gems/User/Form/ChangePasswordForm.php:166
-#: classes/Gems/User/Form/ChangePasswordForm.php:222
+#: classes/Gems/User/Form/ChangePasswordForm.php:221
+#: classes/Gems/User/Form/ChangePasswordForm.php:281
msgid "New password"
msgstr "New password"
-#: classes/Gems/User/Form/ChangePasswordForm.php:192
+#: classes/Gems/User/Form/ChangePasswordForm.php:229
+#: classes/Gems/User/Form/ChangePasswordForm.php:282
+msgid "Must be the same as %fieldDescription%."
+msgstr "Must be the same as %fieldDescription%."
+
+#: classes/Gems/User/Form/ChangePasswordForm.php:250
msgid "Current password"
msgstr "Current password"
-#: classes/Gems/User/Form/ChangePasswordForm.php:197
+#: classes/Gems/User/Form/ChangePasswordForm.php:255
msgid "Wrong password."
msgstr "Wrong password."
-#: classes/Gems/User/Form/ChangePasswordForm.php:243
+#: classes/Gems/User/Form/ChangePasswordForm.php:304
msgid "Password rules"
msgstr "Password rules"
-#: classes/Gems/User/Form/ChangePasswordForm.php:246
+#: classes/Gems/User/Form/ChangePasswordForm.php:307
#, php-format
msgid "A password %s."
msgstr "A password %s."
-#: classes/Gems/User/Form/ChangePasswordForm.php:253
+#: classes/Gems/User/Form/ChangePasswordForm.php:314
msgid "A password:"
msgstr "A password:"
-#: classes/Gems/User/Form/ChangePasswordForm.php:307
+#: classes/Gems/User/Form/ChangePasswordForm.php:368
msgid "Caps Lock seems to be on!"
msgstr "Caps Lock seems to be on!"
@@ -3692,10 +3712,6 @@
msgid "Enter your token..."
msgstr "Enter your token..."
-#: classes/Gems/User/Form/OrganizationFormAbstract.php:271
-msgid "Username"
-msgstr "Username"
-
#: classes/Gems/User/Form/ResetRequestForm.php:63
msgid "Back to login"
msgstr "Back to login"
@@ -3961,10 +3977,6 @@
msgid "%value% is too short for a %testDescription%. Should be %length% digits."
msgstr "%value% is too short for a %testDescription%. Should be %length% digits."
-#: languages/FakeTranslations.php:76
-msgid "Must be the same as %fieldDescription%."
-msgstr "Must be the same as %fieldDescription%."
-
#: languages/FakeTranslations.php:79
msgid "'%value%' is not a phone number (e.g. +12 (0)34-567 890)."
msgstr "'%value%' is not a phone number (e.g. +12 (0)34-567 890)."
@@ -4199,6 +4211,9 @@
msgid "Can access"
msgstr "Can access"
+#~ msgid "%s not correct."
+#~ msgstr "%s not correct."
+
#~ msgid ""
#~ "Please enter the organization and username/e-mail address belonging to "
#~ "this request."
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-04-05 12:12:41 UTC (rev 597)
+++ trunk/library/languages/default-nl.po 2012-04-05 14:29:54 UTC (rev 598)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-05 14:09+0100\n"
+"POT-Creation-Date: 2012-04-05 16:26+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -3633,11 +3633,26 @@
msgid "You are not allowed to login from this location."
msgstr "U kunt vanaf deze locatie niet inloggen."
-#: classes/Gems/User/User.php:1066
+#: classes/Gems/User/User.php:1074
+msgid "Your birthday"
+msgstr "Uw geboortedatum"
+
+#: classes/Gems/User/User.php:1090
+#: classes/Gems/User/Form/ChangePasswordForm.php:169
+#, php-format
+msgid "%s is not correct."
+msgstr "%s is onjuist."
+
+#: classes/Gems/User/User.php:1095
+#: classes/Gems/User/Form/OrganizationFormAbstract.php:271
+msgid "Username"
+msgstr "Gebruikersnaam"
+
+#: classes/Gems/User/User.php:1110
msgid "Trying to send a password reset to a user that cannot be reset."
msgstr "Het wachtwoord voor deze gebruiker kan niet gewijzigd worden."
-#: classes/Gems/User/User.php:1093
+#: classes/Gems/User/User.php:1137
msgid "Unable to send e-mail."
msgstr "Verzenden email mislukt."
@@ -3650,33 +3665,38 @@
msgid "Radius storage"
msgstr "Radius authenticatie"
-#: classes/Gems/User/Form/ChangePasswordForm.php:166
-#: classes/Gems/User/Form/ChangePasswordForm.php:222
+#: classes/Gems/User/Form/ChangePasswordForm.php:221
+#: classes/Gems/User/Form/ChangePasswordForm.php:281
msgid "New password"
msgstr "Nieuw wachtwoord"
-#: classes/Gems/User/Form/ChangePasswordForm.php:192
+#: classes/Gems/User/Form/ChangePasswordForm.php:229
+#: classes/Gems/User/Form/ChangePasswordForm.php:282
+msgid "Must be the same as %fieldDescription%."
+msgstr "Moet identiek zijn aan %fieldDescription%."
+
+#: classes/Gems/User/Form/ChangePasswordForm.php:250
msgid "Current password"
msgstr "Huidig wachtwoord"
-#: classes/Gems/User/Form/ChangePasswordForm.php:197
+#: classes/Gems/User/Form/ChangePasswordForm.php:255
msgid "Wrong password."
msgstr "Verkeerd wachtwoord."
-#: classes/Gems/User/Form/ChangePasswordForm.php:243
+#: classes/Gems/User/Form/ChangePasswordForm.php:304
msgid "Password rules"
msgstr "Wachtwoord regels"
-#: classes/Gems/User/Form/ChangePasswordForm.php:246
+#: classes/Gems/User/Form/ChangePasswordForm.php:307
#, php-format
msgid "A password %s."
msgstr "Een wachtwoord %s."
-#: classes/Gems/User/Form/ChangePasswordForm.php:253
+#: classes/Gems/User/Form/ChangePasswordForm.php:314
msgid "A password:"
msgstr "Een wachtwoord:"
-#: classes/Gems/User/Form/ChangePasswordForm.php:307
+#: classes/Gems/User/Form/ChangePasswordForm.php:368
msgid "Caps Lock seems to be on!"
msgstr "De Caps Lock toets lijkt aan te staan!"
@@ -3692,10 +3712,6 @@
msgid "Enter your token..."
msgstr "Voer uw kenmerk in..."
-#: classes/Gems/User/Form/OrganizationFormAbstract.php:271
-msgid "Username"
-msgstr "Gebruikersnaam"
-
#: classes/Gems/User/Form/ResetRequestForm.php:63
msgid "Back to login"
msgstr "Terug naar de login"
@@ -3961,10 +3977,6 @@
msgid "%value% is too short for a %testDescription%. Should be %length% digits."
msgstr "%value% is te kort voor een %testDescription%. Die moet %length% cijfers lang zijn."
-#: languages/FakeTranslations.php:76
-msgid "Must be the same as %fieldDescription%."
-msgstr "Moet identiek zijn aan %fieldDescription%."
-
#: languages/FakeTranslations.php:79
msgid "'%value%' is not a phone number (e.g. +12 (0)34-567 890)."
msgstr "'%value%' is geen telefoonnummer (zoals: +12 (0)34-567 890)."
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-06 10:53:35
|
Revision: 601
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=601&view=rev
Author: matijsdejong
Date: 2012-04-06 10:53:27 +0000 (Fri, 06 Apr 2012)
Log Message:
-----------
Put token ask/forward loop in snippet as preparation for solving ticket #12
Modified Paths:
--------------
trunk/library/classes/Gems/Default/AskAction.php
trunk/library/classes/Gems/Menu.php
trunk/library/classes/Gems/Project/ProjectSettings.php
trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php
trunk/library/classes/Gems/Tracker/Source/SourceInterface.php
trunk/library/classes/Gems/Tracker/Survey.php
trunk/library/classes/Gems/Tracker/Token.php
Added Paths:
-----------
trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php
trunk/library/snippets/Track/Token/
trunk/library/snippets/Track/Token/ShowFirstOpenSnippet.php
Modified: trunk/library/classes/Gems/Default/AskAction.php
===================================================================
--- trunk/library/classes/Gems/Default/AskAction.php 2012-04-05 16:40:35 UTC (rev 600)
+++ trunk/library/classes/Gems/Default/AskAction.php 2012-04-06 10:53:27 UTC (rev 601)
@@ -45,8 +45,29 @@
*/
class Gems_Default_AskAction extends Gems_Controller_Action
{
+ /**
+ *
+ * @var array Or string of snippet names, presumably Gems_Tracker_Snippets_ShowTokenLoopAbstract snippets
+ */
+ protected $forwardSnippets = 'Track_Token_ShowFirstOpenSnippet';
+
+ /**
+ * Set to true in child class for automatic creation of $this->html.
+ *
+ * To initiate the use of $this->html from the code call $this->initHtml()
+ *
+ * Overrules $useRawOutput.
+ *
+ * @see $useRawOutput
+ * @var boolean $useHtmlView
+ */
public $useHtmlView = true;
+ /**
+ * Show the user a screen with token information and a button to take at least one survey
+ *
+ * @return void
+ */
public function forwardAction()
{
$tracker = $this->loader->getTracker();
@@ -66,114 +87,21 @@
$respId = $token->getRespondentId();
$tracker->processCompletedTokens($respId, $respId);
- /***********************
- * Look for next token *
- ***********************/
- $wasAnswered = $token->isCompleted();
- if ($wasAnswered) {
- $token = $token->getNextUnansweredToken();
+ // Display token when possible
+ if ($this->html->snippet($this->forwardSnippets, 'token', $token)) {
+ return;
}
- if ($token && $token->exists) {
- $tokenId = $token->getTokenId();
-
- try {
- /***************
- * Get the url *
- ***************/
- $request = $this->getRequest();
- $params[$request->getActionKey()] = 'to-survey';
- $params[MUtil_Model::REQUEST_ID] = $token->getTokenId();
-
- $href = new MUtil_Html_HrefArrayAttribute($params);
- $href->setRouteReset(false);
- $url = $href->render($this->view);
-
- /***********************************
- * Should we stay or should we go? *
- ***********************************/
- if (! $this->_getParam('delay_cancelled')) {
- $_delay = $this->_getParam('delay');
- if (null !== $_delay) {
- $delay = $_delay;
-
- } elseif ($wasAnswered) {
- if (isset($this->project->askNextDelay)) {
- $delay = $this->project->askNextDelay;
- }
- } else {
- if (isset($this->project->askDelay)) {
- $delay = $this->project->askDelay;
- }
- }
- }
- if (isset($delay)) {
- if ($delay == 0) {
- // Redirect at once
- header('Location: ' . $url);
- exit();
- }
-
- // Let the page load after stated interval
- $this->view->headMeta()->appendHttpEquiv('Refresh', $delay . '; url=' . $url);
- }
-
- $organization = $this->loader->getOrganization($token->getOrganizationId());
-
- Gems_Html::init(); // Turn on Gems specific html like pInfo
- $this->html->h3($this->_('Token'));
- $this->html->pInfo(sprintf($this->_('Welcome %s,'), $token->getRespondentName()));
-
- if ($wasAnswered) {
- $this->html->pInfo(sprintf($this->_('Thank you for answering the survey for token %s.'), strtoupper($this->_getParam(MUtil_Model::REQUEST_ID))));
- $this->html->pInfo($this->_('Please click the button below to answer the next survey.'));
- } else {
- if ($welcome = $organization->getWelcome()) {
- $this->html->pInfo()->raw(MUtil_Markup::render($this->_($welcome), 'Bbcode', 'Html'));
- }
- $this->html->pInfo(sprintf($this->_('Please click the button below to answer the survey for token %s.'), strtoupper($tokenId)));
- }
- if (isset($delay)) {
- $this->html->pInfo(sprintf($this->plural(
- 'Wait one second to open the survey automatically or click on Cancel to stop.',
- 'Wait %d seconds to open the survey automatically or click on Cancel to stop.',
- $delay), $delay));
- }
-
- $buttonDiv = $this->html->buttonDiv(array('class' => 'centerAlign'));
- $buttonDiv->actionLink($href, $token->getSurveyName());
-
- if (isset($delay)) {
- $buttonDiv->actionLink(array('delay_cancelled' => 1), $this->_('Cancel'));
- }
-
- if ($next = $token->getTokenCountUnanswered()) {
- $this->html->pInfo(sprintf(
- $this->plural(
- 'After this survey there is one other survey we would like you to answer.',
- 'After this survey there are another %d surveys we would like you to answer.',
- $next), $next));
- }
- if ($sig = $organization->getSignature()) {
- $this->html->pInfo()->raw(MUtil_Markup::render($this->_($sig), 'Bbcode', 'Html'));
- }
- return;
-
- } catch (Gems_Tracker_Source_SurveyNotFoundException $e) {
- $this->addMessage(sprintf($this->_('The survey for token %s is no longer active.'), $tokenId));
- }
+ // Snippet had nothing to display, because of an answer
+ if ($this->getRequest()->getActionName() == 'return') {
+ $this->addMessage(sprintf($this->_('Thank you for answering. At the moment we have no further surveys for you to take.'), $tokenId));
} else {
- if ($token) {
- $this->addMessage(sprintf($this->_('The token %s does not exist.'), $this->_getParam(MUtil_Model::REQUEST_ID)));
- } elseif ($this->_getParam('action') == 'return') {
- $this->addMessage(sprintf($this->_('Thank you for answering. At the moment we have no further surveys for you to take.'), $tokenId));
- } else {
- $this->addMessage(sprintf($this->_('The survey for token %s has been answered and no further surveys are open.'), $tokenId));
- }
- // Do not enter a loop!! Reroute!
- $this->_reroute(array('controller' => 'ask', 'action' => 'token'), true);
+ $this->addMessage(sprintf($this->_('The survey for token %s has been answered and no further surveys are open.'), $tokenId));
}
+ // Do not enter a loop!! Reroute!
+ $this->_reroute(array('controller' => 'ask', 'action' => 'index'), true);
+
} else {
$this->addMessage(sprintf($this->_('The token %s does not exist (any more).'), $tokenId));
}
@@ -182,10 +110,15 @@
$this->_forward('token');
}
+ /**
+ * Ask the user for a token
+ *
+ * @return void
+ */
public function indexAction()
{
// Make sure to return to ask screen
- $this->session->return_controller = $this->getRequest()->getControllerName();
+ $this->loader->getCurrentUser()->setSurveyReturn($this->getRequest());
$tracker = $this->loader->getTracker();
$max_length = $tracker->getTokenLibrary()->getLength();
@@ -246,7 +179,6 @@
$form->populate(array(MUtil_Model::REQUEST_ID => $id));
}
- Gems_Html::init(); // Turn on Gems specific html like pInfo
$this->html->h3($form->getDescription());
$this->html[] = $form;
$this->html->pInfo($this->_('Tokens identify a survey that was assigned to you personally.') . ' ' . $this->_('Entering the token and pressing OK will open that survey.'));
@@ -319,18 +251,23 @@
if ($token = $tracker->getToken($tokenId)) {
$language = $this->locale->getLanguage();
$user = $this->loader->getCurrentUser();
- $url = $token->getUrl($language, $user->getUserId() ? $user->getUserId() : $token->getRespondentId());
- /************************
- * Optional user logout *
- ************************/
- if ($user->isLogoutOnSurvey()) {
- $user->unsetAsCurrentUser();
- }
+ try {
+ $url = $token->getUrl($language, $user->getUserId() ? $user->getUserId() : $token->getRespondentId());
- // Redirect at once
- header('Location: ' . $url);
- exit();
+ /************************
+ * Optional user logout *
+ ************************/
+ if ($user->isLogoutOnSurvey()) {
+ $user->unsetAsCurrentUser();
+ }
+
+ // Redirect at once
+ header('Location: ' . $url);
+ exit();
+ } catch (Gems_Tracker_Source_SurveyNotFoundException $e) {
+ $this->addMessage(sprintf($this->_('The survey for token %s is no longer active.'), $tokenId));
+ }
}
}
Modified: trunk/library/classes/Gems/Menu.php
===================================================================
--- trunk/library/classes/Gems/Menu.php 2012-04-05 16:40:35 UTC (rev 600)
+++ trunk/library/classes/Gems/Menu.php 2012-04-06 10:53:27 UTC (rev 601)
@@ -367,8 +367,7 @@
$tkPage->addButtonOnly($this->_('Fill in'), 'pr.ask', 'ask', 'take')
->addNamedParameters(MUtil_Model::REQUEST_ID, 'gto_id_token')
- ->setParameterFilter('can_be_taken', 1, Gems_Model::ID_TYPE, 'token')
- ->addHiddenParameter('delay', 0);
+ ->setParameterFilter('can_be_taken', 1, Gems_Model::ID_TYPE, 'token');
$tkPage->addPdfButton($this->_('Print PDF'), 'pr.token.print')
->addNamedParameters(MUtil_Model::REQUEST_ID, 'gto_id_token')
->setParameterFilter('gsu_has_pdf', 1, Gems_Model::ID_TYPE, 'token');
Modified: trunk/library/classes/Gems/Project/ProjectSettings.php
===================================================================
--- trunk/library/classes/Gems/Project/ProjectSettings.php 2012-04-05 16:40:35 UTC (rev 600)
+++ trunk/library/classes/Gems/Project/ProjectSettings.php 2012-04-06 10:53:27 UTC (rev 601)
@@ -187,6 +187,38 @@
}
/**
+ * Calculate the delay between surveys being asked for this request. Zero means forward
+ * at once, a negative value means wait forever.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @param boolean $wasAnswered When true use the ask delay
+ * @return int -1 means waiting indefinitely
+ */
+ public function getAskDelay(Zend_Controller_Request_Abstract $request, $wasAnswered)
+ {
+ if ($request->getParam('delay_cancelled', false)) {
+ return -1;
+ }
+
+ $delay = $request->getParam('delay', null);
+ if (null != $delay) {
+ return $delay;
+ }
+
+ if ($wasAnswered) {
+ if ($this->offsetExists('askNextDelay')) {
+ return $this->offsetGet('askNextDelay');
+ }
+ } else {
+ if ($this->offsetExists('askDelay')) {
+ return $this->offsetGet('askDelay');
+ }
+ }
+
+ return -1;
+ }
+
+ /**
* Returns an array with throttling settings for the ask
* controller
*
Added: trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php (rev 0)
+++ trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php 2012-04-06 10:53:27 UTC (rev 601)
@@ -0,0 +1,116 @@
+<?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 Tracker
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @version $id: ShowTokenLoopAbstract.php 203 2012-01-01t 12:51:32Z matijs $
+ */
+
+/**
+ * Basic class for creating forward loop snippets
+ *
+ * @package Gems
+ * @subpackage Tracker
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.5
+ */
+class Gems_Tracker_Snippets_ShowTokenLoopAbstract extends MUtil_Snippets_SnippetAbstract
+{
+ /**
+ * Required
+ *
+ * @var Zend_Controller_Request_Abstract
+ */
+ protected $request;
+
+ /**
+ * Required, the current token, possibly already answered
+ *
+ * @var Gems_Tracker_Token
+ */
+ protected $token;
+
+ /**
+ * Required
+ *
+ * @var Zend_View
+ */
+ protected $view;
+
+ /**
+ * Was this token already answered? Calculated from $token
+ *
+ * @var boolean
+ */
+ protected $wasAnswered;
+
+ /**
+ * 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->token instanceof Gems_Tracker_Token) {
+
+ $this->wasAnswered = $this->token->isCompleted();
+
+ return ($this->request instanceof Zend_Controller_Request_Abstract) &&
+ ($this->view instanceof Zend_View) &&
+ parent::checkRegistryRequestsAnswers();
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Get the href for a token
+ *
+ * @param Gems_Tracker_Token $token
+ * @return MUtil_Html_HrefArrayAttribute
+ */
+ protected function getTokenHref(Gems_Tracker_Token $token)
+ {
+ /***************
+ * Get the url *
+ ***************/
+ $params = array(
+ $this->request->getActionKey() => 'to-survey',
+ MUtil_Model::REQUEST_ID => $token->getTokenId(),
+ 'RouteReset' => false,
+ );
+
+ return new MUtil_Html_HrefArrayAttribute($params);
+ }
+}
Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-04-05 16:40:35 UTC (rev 600)
+++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9Database.php 2012-04-06 10:53:27 UTC (rev 601)
@@ -512,6 +512,7 @@
* @param int $surveyId Gems Survey Id
* @param string $sourceSurveyId Optional Survey Id used by source
* @return int 1 of the token was inserted or changed, 0 otherwise
+ * @throws Gems_Tracker_Source_SurveyNotFoundException
*/
public function copyTokenToSource(Gems_Tracker_Token $token, $language, $surveyId, $sourceSurveyId = null)
{
Modified: trunk/library/classes/Gems/Tracker/Source/SourceInterface.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Source/SourceInterface.php 2012-04-05 16:40:35 UTC (rev 600)
+++ trunk/library/classes/Gems/Tracker/Source/SourceInterface.php 2012-04-06 10:53:27 UTC (rev 601)
@@ -62,8 +62,8 @@
* @param int $surveyId Gems Survey Id
* @param string $sourceSurveyId Optional Survey Id used by source
* @return int 1 of the token was inserted or changed, 0 otherwise
+ * @throws Gems_Tracker_Source_SurveyNotFoundException
*/
- // public function addToSource(Gems_Tracker_Token $token, $language, $surveyId, $sourceSurveyId = null);
public function copyTokenToSource(Gems_Tracker_Token $token, $language, $surveyId, $sourceSurveyId = null);
@@ -87,7 +87,6 @@
* @param string $sourceSurveyId Optional Survey Id used by source
* @return MUtil_Date date time or null
*/
- // public function getAnswerDateTime($fieldName, $tokenId, $surveyId, array $answers = null, $sourceSurveyId = null);
public function getAnswerDateTime($fieldName, Gems_Tracker_Token $token, $surveyId, $sourceSurveyId = null);
/**
@@ -102,7 +101,6 @@
* @param string $sourceSurveyId Optional Survey Id used by source
* @return MUtil_Date date time or null
*/
- // public function getCompletionTime($tokenId, $surveyId, array $answers = null, $sourceSurveyId = null);
public function getCompletionTime(Gems_Tracker_Token $token, $surveyId, $sourceSurveyId = null);
/**
@@ -199,7 +197,6 @@
* @param string $sourceSurveyId Optional Survey Id used by source
* @return MUtil_Date date time or null
*/
- // public function getStartTime($tokenId, $surveyId, array $answers = null, $sourceSurveyId = null);
public function getStartTime(Gems_Tracker_Token $token, $surveyId, $sourceSurveyId = null);
/**
@@ -221,7 +218,6 @@
* @param string $sourceSurveyId Optional Survey Id used by source
* @return string The url to start the survey
*/
- // public function getTokenUrl($tokenId, $language, $surveyId, $sourceSurveyId);
public function getTokenUrl(Gems_Tracker_Token $token, $language, $surveyId, $sourceSurveyId);
/**
@@ -239,7 +235,6 @@
* @param string $sourceSurveyId Optional Survey Id used by source
* @return boolean
*/
- // public function inSource($tokenId, $surveyId, $sourceSurveyId = null);
public function inSource(Gems_Tracker_Token $token, $surveyId, $sourceSurveyId = null);
/**
@@ -250,7 +245,6 @@
* @param string $sourceSurveyId Optional Survey Id used by source
* @return boolean True if the token has completed
*/
- // public function isCompleted($tokenId, $surveyId, array $answers = null, $sourceSurveyId = null);
public function isCompleted(Gems_Tracker_Token $token, $surveyId, $sourceSurveyId = null);
/**
Modified: trunk/library/classes/Gems/Tracker/Survey.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Survey.php 2012-04-05 16:40:35 UTC (rev 600)
+++ trunk/library/classes/Gems/Tracker/Survey.php 2012-04-06 10:53:27 UTC (rev 601)
@@ -211,6 +211,7 @@
* @param Gems_Tracker_Token $token
* @param string $language
* @return int 1 of the token was inserted or changed, 0 otherwise
+ * @throws Gems_Tracker_Source_SurveyNotFoundException
*/
public function copyTokenToSource(Gems_Tracker_Token $token, $language)
{
Modified: trunk/library/classes/Gems/Tracker/Token.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Token.php 2012-04-05 16:40:35 UTC (rev 600)
+++ trunk/library/classes/Gems/Tracker/Token.php 2012-04-06 10:53:27 UTC (rev 601)
@@ -596,6 +596,15 @@
/**
*
+ * @return Gems_User_Organization
+ */
+ public function getOrganization()
+ {
+ return $this->loader->getOrganization($this->getOrganizationId());
+ }
+
+ /**
+ *
* @return int
*/
public function getOrganizationId()
@@ -811,7 +820,8 @@
}
/**
- * Returns the number of unanswered tokens for the person answering this token
+ * Returns the number of unanswered tokens for the person answering this token,
+ * minus this token itself
*
* @return int
*/
@@ -866,6 +876,7 @@
*
* @param string $language The language currently used by the user
* @param int $userId The id of the gems user
+ * @throws Gems_Tracker_Source_SurveyNotFoundException
*/
public function getUrl($language, $userId)
{
Property changes on: trunk/library/snippets/Track/Token
___________________________________________________________________
Added: bugtraq:url
+ http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID%
Added: bugtraq:logregex
+ #(\d+)
Added: trunk/library/snippets/Track/Token/ShowFirstOpenSnippet.php
===================================================================
--- trunk/library/snippets/Track/Token/ShowFirstOpenSnippet.php (rev 0)
+++ trunk/library/snippets/Track/Token/ShowFirstOpenSnippet.php 2012-04-06 10:53:27 UTC (rev 601)
@@ -0,0 +1,167 @@
+<?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 Snippets\Track
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @version $id: ShowFirstOpenSnippet.php 203 2012-01-01t 12:51:32Z matijs $
+ */
+
+/**
+ *
+ *
+ * @package Gems
+ * @subpackage Snippets\Track
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.5.3
+ */
+class Track_Token_ShowFirstOpenSnippet extends Gems_Tracker_Snippets_ShowTokenLoopAbstract
+{
+ /**
+ * Required
+ *
+ * @var Gems_Project_ProjectSettings
+ */
+ protected $project;
+
+ /**
+ * Optional, calculated from $token
+ *
+ * @var Gems_Tracker_Token
+ */
+ protected $showToken;
+
+ /**
+ * 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 (parent::checkRegistryRequestsAnswers()) {
+ return $this->project instanceof Gems_Project_ProjectSettings;
+ } else {
+ return false;
+ }
+ }
+ /**
+ * 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)
+ {
+ $delay = $this->project->getAskDelay($this->request, $this->wasAnswered);
+ $href = $this->getTokenHref($this->showToken);
+ $html = $this->getHtmlSequence();
+ $org = $this->showToken->getOrganization();
+ $url = $href->render($this->view);
+
+ switch ($delay) {
+ case 0:
+ // Redirect at once
+ header('Location: ' . $url);
+ exit();
+
+ case -1:
+ break;
+
+ default:
+ // Let the page load after stated interval
+ $this->view->headMeta()->appendHttpEquiv('Refresh', $delay . '; url=' . $url);
+ }
+
+ $html->h3($this->_('Token'));
+ $html->pInfo(sprintf($this->_('Welcome %s,'), $this->showToken->getRespondentName()));
+
+ if ($this->wasAnswered) {
+ $html->pInfo(sprintf($this->_('Thank you for answering the "%s" survey.'), $this->token->getSurveyName()));
+ $html->pInfo($this->_('Please click the button below to answer the next survey.'));
+ } else {
+ if ($welcome = $org->getWelcome()) {
+ $html->pInfo()->raw(MUtil_Markup::render($this->_($welcome), 'Bbcode', 'Html'));
+ }
+ $html->pInfo(sprintf($this->_('Please click the button below to answer the survey for token %s.'), strtoupper($this->showToken->getTokenId())));
+ }
+ if ($delay > 0) {
+ $html->pInfo(sprintf($this->plural(
+ 'Wait one second to open the survey automatically or click on Cancel to stop.',
+ 'Wait %d seconds to open the survey automatically or click on Cancel to stop.',
+ $delay), $delay));
+ }
+
+ $buttonDiv = $html->buttonDiv(array('class' => 'centerAlign'));
+ $buttonDiv->actionLink($href, $this->showToken->getSurveyName());
+
+ if ($delay > 0) {
+ $buttonDiv->actionLink(array('delay_cancelled' => 1), $this->_('Cancel'));
+ }
+
+ if ($next = $this->showToken->getTokenCountUnanswered()) {
+ $html->pInfo(sprintf(
+ $this->plural(
+ 'After this survey there is one other survey we would like you to answer.',
+ 'After this survey there are another %d surveys we would like you to answer.',
+ $next), $next));
+ }
+ if ($sig = $org->getSignature()) {
+ $html->pInfo()->raw(MUtil_Markup::render($this->_($sig), 'Bbcode', 'Html'));
+ }
+ return $html;
+ }
+
+ /**
+ * The place to check if the data...
[truncated message content] |
|
From: <gem...@li...> - 2012-04-08 15:05:11
|
Revision: 608
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=608&view=rev
Author: matijsdejong
Date: 2012-04-08 15:05:02 +0000 (Sun, 08 Apr 2012)
Log Message:
-----------
Added 1.5.3 upgrade function
Improved content of change password mail
OldStaff users can now perform resets
Cleaned up some code
Updated translations
Modified Paths:
--------------
trunk/library/classes/Gems/Default/IndexAction.php
trunk/library/classes/Gems/Upgrades.php
trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php
trunk/library/classes/Gems/User/OldStaffUserDefinition.php
trunk/library/classes/Gems/User/RadiusUserDefinition.php
trunk/library/classes/Gems/User/User.php
trunk/library/classes/Gems/User/UserDefinitionAbstract.php
trunk/library/classes/Gems/User/UserDefinitionInterface.php
trunk/library/classes/Gems/User/UserLoader.php
trunk/library/configs/db/patches.sql
trunk/library/configs/db/tables/gems__staff.20.sql
trunk/library/languages/default-en.mo
trunk/library/languages/default-en.po
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Modified: trunk/library/classes/Gems/Default/IndexAction.php
===================================================================
--- trunk/library/classes/Gems/Default/IndexAction.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/Default/IndexAction.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -312,6 +312,7 @@
$this->addMessage($this->_('We sent you an e-mail with a reset link. Click on the link in the e-mail.'));
if ($this->returnToLoginAfterReset) {
+ $this->setCurrentOrganizationTo($user);
$this->loader->getCurrentUser()->gotoStartPage($this->menu, $request);
}
}
@@ -339,17 +340,11 @@
public function sendUserResetEMail(Gems_User_User $user)
{
$subjectTemplate = $this->_('Password reset requested');
- /* CANNOT BE TESTED TODAY
- $bbBodyTemplate = $this->_("Dear {greeting},
-A new password was requested for your [b]{organization}[/b] site [b]{project}[/b], please click within {reset_in_hours} hours on [url={reset_url}]this link[/url] to enter the password of your choice.
+ // Multi line strings did not come through correctly in poEdit
+ $bbBodyTemplate = $this->_("Dear {greeting},\n\n\nA new password was requested for your [b]{organization}[/b] account on the [b]{project}[/b] site, please click within {reset_in_hours} hours on [url={reset_url}]this link[/url] to enter the password of your choice.\n\n\n{organization_signature}\n\n[url={reset_url}]{reset_url}[/url]\n"); // */
+ //$bbBodyTemplate = $this->_("To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n{reset_url}");
-{organization_signature}
-
-[url={reset_url}]{reset_url}[/url]
-"); // */
- $bbBodyTemplate = $this->_("To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n{reset_url}");
-
return $user->sendMail($subjectTemplate, $bbBodyTemplate, true);
}
Modified: trunk/library/classes/Gems/Upgrades.php
===================================================================
--- trunk/library/classes/Gems/Upgrades.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/Upgrades.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -55,9 +55,10 @@
//Now set the context
$this->setContext('gems');
//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');
+ $this->register('Upgrade143to15', 'Upgrade from 1.4.3 to 1.5.0');
+ $this->register('Upgrade15to151', 'Upgrade from 1.5.0 to 1.5.1');
+ $this->register('Upgrade151to152', 'Upgrade from 1.5.1 to 1.5.2');
+ $this->register('Upgrade152to153', 'Upgrade from 1.5.2 to 1.5.3');
}
@@ -92,7 +93,7 @@
public function Upgrade15to151()
{
$this->_batch->addTask('Db_ExecutePatch', 44);
-
+
return true;
}
@@ -105,4 +106,14 @@
return true;
}
+
+ /**
+ * To upgrade to 1.5.2 just execute patchlevel 46
+ */
+ public function Upgrade152to153()
+ {
+ $this->_batch->addTask('Db_ExecutePatch', 46);
+
+ return true;
+ }
}
\ No newline at end of file
Modified: trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -106,28 +106,6 @@
}
/**
- * Check whether a reset key is really linked to a user.
- *
- * @param Gems_User_User $user The user the key was created for (hopefully).
- * @param string The key
- * @return boolean
- */
- public function checkPasswordResetKey(Gems_User_User $user, $key)
- {
- $model = new MUtil_Model_TableModel('gems__user_passwords');
-
- $filter['gup_id_user'] = $user->getUserLoginId();
- $filter[] = 'DATE_ADD(gup_reset_requested, INTERVAL 24 HOUR) >= CURRENT_TIMESTAMP';
-
- $row = $model->loadFirst($filter);
- if ($row && $row['gup_reset_key']) {
- return $key == $row['gup_reset_key'];
- }
-
- return false;
- }
-
- /**
* Returns an initialized Zend_Auth_Adapter_Interface
*
* @param Gems_User_User $user
@@ -173,6 +151,7 @@
}
$data['gup_reset_requested'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
+ // Loop for case when hash is not unique
while (true) {
try {
$model->save($data);
Modified: trunk/library/classes/Gems/User/OldStaffUserDefinition.php
===================================================================
--- trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -54,12 +54,45 @@
protected $db;
/**
+ * The time period in hours a reset key is valid for this definition.
*
+ * @var int
+ */
+ protected $hoursResetKeyIsValid = 24;
+
+ /**
+ *
* @var Gems_Project_ProjectSettings
*/
protected $project;
/**
+ * Return true if a password reset key can be created.
+ *
+ * Returns the setting for the definition whan no user is passed, otherwise
+ * returns the answer for this specific user.
+ *
+ * @param Gems_User_User $user Optional, the user whose password might change
+ * @return boolean
+ */
+ public function canResetPassword(Gems_User_User $user = null)
+ {
+ if ($user) {
+ // Depends on the user.
+ if ($user->hasEmailAddress() && $user->canSetPassword()) {
+ $email = $user->getEmailAddress();
+ if (empty($email)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ } else {
+ return true;
+ }
+ }
+
+ /**
* Return true if the password can be set.
*
* Returns the setting for the definition whan no user is passed, otherwise
@@ -111,6 +144,42 @@
}
/**
+ * Return a password reset key
+ *
+ * @param Gems_User_User $user The user to create a key for.
+ * @return string
+ */
+ public function getPasswordResetKey(Gems_User_User $user)
+ {
+ $model = new MUtil_Model_TableModel('gems__staff');
+ Gems_Model::setChangeFieldsByPrefix($model, 'gsf', $user->getUserId());
+
+ $data['gsf_id_user'] = $user->getUserId();
+
+ $row = $model->loadFirst($data + array('DATE_ADD(gsf_reset_req, INTERVAL ' . $this->hoursResetKeyIsValid . ' HOUR) >= CURRENT_TIMESTAMP'));
+ if ($row && $row['gup_reset_key']) {
+ // Keep using the key.
+ $data['gsf_reset_key'] = $row['gsf_reset_key'];
+ } else {
+ $data['gsf_reset_key'] = $this->hashPassword(time() . $user->getEmailAddress());
+ }
+ $data['gsf_reset_req'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
+
+ // Loop for case when hash is not unique
+ while (true) {
+ try {
+ $model->save($data);
+
+ // Old staff keys can by recognized because they start with 'os'
+ return 'os' . $data['gsf_reset_key'];
+
+ } catch (Zend_Db_Exception $zde) {
+ $data['gsf_reset_key'] = $this->hashPassword(time() . $user->getEmailAddress());
+ }
+ }
+ }
+
+ /**
* Returns a user object, that may be empty if the user is unknown.
*
* @param string $login_name
@@ -161,7 +230,8 @@
'user_group' => 'gsf_id_primary_group',
'user_locale' => 'gsf_iso_lang',
'user_logout' => 'gsf_logout_on_survey',
- 'user_base_org_id' => 'gsf_id_organization'
+ 'user_base_org_id' => 'gsf_id_organization',
+ 'user_resetkey_valid' => 'CASE WHEN DATE_ADD(gsf_reset_req, INTERVAL ' . $this->hoursResetKeyIsValid . ' HOUR) >= CURRENT_TIMESTAMP THEN 1 ELSE 0 END',
))
->join('gems__groups', 'gsf_id_primary_group = ggp_id_group', array(
'user_role' => 'ggp_role',
Modified: trunk/library/classes/Gems/User/RadiusUserDefinition.php
===================================================================
--- trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -114,18 +114,6 @@
}
/**
- * always false as we can not reset the password
- *
- * @param Gems_User_User $user
- * @param type $key
- * @return boolean
- */
- public function checkPasswordResetKey(Gems_User_User $user, $key)
- {
- return false;
- }
-
- /**
* Returns an initialized Zend_Auth_Adapter_Interface
*
* @param Gems_User_User $user
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/User.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -486,17 +486,6 @@
}
/**
- * Check whether a reset key is really linked to this user.
- *
- * @param string The key
- * @return boolean
- */
- public function checkPasswordResetKey($key)
- {
- return $this->isActive() && $this->definition->checkPasswordResetKey($this, $key);
- }
-
- /**
* Should be called after answering the request to allow the Target
* to check if all required registry values have been set correctly.
*
@@ -1127,51 +1116,7 @@
}
/**
- * Send an e-mail to this user
*
- * @param string $subjectTemplate A subject template in which {fields} are replaced
- * @param string $bbBodyTemplate A BB Code body template in which {fields} are replaced
- * @param boolean $useResetFields When true get a reset key for this user
- * @param string $locale Optional locale
- * @return mixed String or array of warnings when something went wrong
- */
- public function sendMail($subjectTemplate, $bbBodyTemplate, $useResetFields = false, $locale = null)
- {
- if ($useResetFields && (! $this->canResetPassword())) {
- return $this->translate->_('Trying to send a password reset to a user that cannot be reset.');
- }
-
- $mail = new Gems_Mail();
- $mail->setTemplateStyle($this->getBaseOrganization()->getStyle());
- $mail->setFrom($this->getFrom());
- $mail->addTo($this->getEmailAddress(), $this->getFullName(), $this->project->getEmailBounce());
- if ($bcc = $this->project->getEmailBcc()) {
- $mail->addBcc($bcc);
- }
-
- if ($useResetFields) {
- $fields = $this->getResetPasswordMailFields($locale);
- } else {
- $fields = $this->getMailFields($locale);
- }
- $fields = MUtil_Ra::braceKeys($fields, '{', '}');
-
- $mail->setSubject(strtr($subjectTemplate, $fields));
- $mail->setBodyBBCode(strtr($bbBodyTemplate, $fields));
-
- try {
- $mail->send();
- return null;
-
- } catch (Exception $e) {
- return array(
- $this->translate->_('Unable to send e-mail.'),
- $e->getMessage());
- }
- }
-
- /**
- *
* @param string $defName Optional
* @return Gems_User_User (continuation pattern)
*/
@@ -1233,6 +1178,51 @@
}
/**
+ * Send an e-mail to this user
+ *
+ * @param string $subjectTemplate A subject template in which {fields} are replaced
+ * @param string $bbBodyTemplate A BB Code body template in which {fields} are replaced
+ * @param boolean $useResetFields When true get a reset key for this user
+ * @param string $locale Optional locale
+ * @return mixed String or array of warnings when something went wrong
+ */
+ public function sendMail($subjectTemplate, $bbBodyTemplate, $useResetFields = false, $locale = null)
+ {
+ if ($useResetFields && (! $this->canResetPassword())) {
+ return $this->translate->_('Trying to send a password reset to a user that cannot be reset.');
+ }
+
+ $mail = new Gems_Mail();
+ $mail->setTemplateStyle($this->getBaseOrganization()->getStyle());
+ $mail->setFrom($this->getFrom());
+ $mail->addTo($this->getEmailAddress(), $this->getFullName(), $this->project->getEmailBounce());
+ if ($bcc = $this->project->getEmailBcc()) {
+ $mail->addBcc($bcc);
+ }
+
+ if ($useResetFields) {
+ $fields = $this->getResetPasswordMailFields($locale);
+ } else {
+ $fields = $this->getMailFields($locale);
+ }
+ MUtil_Echo::track($fields, $bbBodyTemplate);
+ $fields = MUtil_Ra::braceKeys($fields, '{', '}');
+
+ $mail->setSubject(strtr($subjectTemplate, $fields));
+ $mail->setBodyBBCode(strtr($bbBodyTemplate, $fields));
+
+ try {
+ $mail->send();
+ return null;
+
+ } catch (Exception $e) {
+ return array(
+ $this->translate->_('Unable to send e-mail.'),
+ $e->getMessage());
+ }
+ }
+
+ /**
* Set this user as the current user.
*
* This means that the data about this user will be stored in a session.
Modified: trunk/library/classes/Gems/User/UserDefinitionAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/UserDefinitionAbstract.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/UserDefinitionAbstract.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -84,18 +84,6 @@
}
/**
- * Check whether a reset key is really linked to a user.
- *
- * @param Gems_User_User $user The user the key was created for (hopefully).
- * @param string The key
- * @return string
- */
- public function checkPasswordResetKey(Gems_User_User $user, $key)
- {
- throw new Gems_Exception_Coding(sprintf('A password reset key cannot be issued for %s users.', get_class($this)));
- }
-
- /**
* Return a password reset key
*
* @param Gems_User_User $user The user to create a key for.
Modified: trunk/library/classes/Gems/User/UserDefinitionInterface.php
===================================================================
--- trunk/library/classes/Gems/User/UserDefinitionInterface.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/UserDefinitionInterface.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -69,15 +69,6 @@
public function canSetPassword(Gems_User_User $user = null);
/**
- * Check whether a reset key is really linked to a user.
- *
- * @param Gems_User_User $user The user the key was created for (hopefully).
- * @param string The key
- * @return string
- */
- public function checkPasswordResetKey(Gems_User_User $user, $key);
-
- /**
* Returns an initialized Zend_Auth_Adapter_Interface
*
* @param Gems_User_User $user
Modified: trunk/library/classes/Gems/User/UserLoader.php
===================================================================
--- trunk/library/classes/Gems/User/UserLoader.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/UserLoader.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -438,10 +438,15 @@
}
$select = $this->db->select();
- $select->from('gems__user_passwords', array())
- ->joinLeft('gems__user_logins', 'gup_id_user = gul_id_user', array("gul_user_class", 'gul_id_organization', 'gul_login'))
- ->where('gup_reset_key = ?', $resetKey);
-
+ if ('os' == substr($resetKey, 0, 2)) {
+ // Oldstaff reset key!
+ $select->from('gems__staff', array(new Zend_Db_Expr("'" . self::USER_OLD_STAFF . "' AS user_class"), 'gsf_id_organization', 'gsf_login'))
+ ->where('gsf_reset_key = ?', substr($resetKey, 2));
+ } else {
+ $select->from('gems__user_passwords', array())
+ ->joinLeft('gems__user_logins', 'gup_id_user = gul_id_user', array("gul_user_class", 'gul_id_organization', 'gul_login'))
+ ->where('gup_reset_key = ?', $resetKey);
+ }
if ($row = $this->db->fetchRow($select, null, Zend_Db::FETCH_NUM)) {
// MUtil_Echo::track($row);
return $this->loadUser($row[0], $row[1], $row[2]);
Modified: trunk/library/configs/db/patches.sql
===================================================================
--- trunk/library/configs/db/patches.sql 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/configs/db/patches.sql 2012-04-08 15:05:02 UTC (rev 608)
@@ -391,4 +391,5 @@
ALTER TABLE gems__user_logins CHANGE gul_can_login gul_can_login boolean not null default 0;
-- PATCH: make reset keys unique so we now whose key it is
-ALTER TABLE `gems__user_passwords` ADD UNIQUE (`gup_reset_key`);
+ALTER TABLE `gems__user_passwords` ADD UNIQUE KEY (gup_reset_key);
+ALTER TABLE `gems__staff` ADD UNIQUE KEY (gsf_reset_key);
Modified: trunk/library/configs/db/tables/gems__staff.20.sql
===================================================================
--- trunk/library/configs/db/tables/gems__staff.20.sql 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/configs/db/tables/gems__staff.20.sql 2012-04-08 15:05:02 UTC (rev 608)
@@ -46,7 +46,7 @@
-- depreciated
gsf_reset_key varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
- gsf_reset_requested timestamp null,
+ gsf_reset_req timestamp null,
-- end depreciated
gsf_changed timestamp not null default current_timestamp on update current_timestamp,
@@ -55,7 +55,8 @@
gsf_created_by bigint unsigned not null,
PRIMARY KEY(gsf_id_user),
- UNIQUE KEY(gsf_login, gsf_id_organization)
+ UNIQUE KEY(gsf_login, gsf_id_organization),
+ UNIQUE KEY(gsf_reset_key)
)
ENGINE=InnoDB
AUTO_INCREMENT = 2001
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/languages/default-en.po 2012-04-08 15:05:02 UTC (rev 608)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-05 16:25+0100\n"
+"POT-Creation-Date: 2012-04-08 16:56+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -29,7 +29,7 @@
msgstr "You are logged in as %s"
#: classes/GemsEscort.php:747
-#: classes/Gems/Menu.php:248
+#: classes/Gems/Menu.php:249
msgid "Logoff"
msgstr "Logoff"
@@ -131,184 +131,184 @@
msgid "of"
msgstr "of"
-#: classes/Gems/Menu.php:139
+#: classes/Gems/Menu.php:140
#, php-format
msgid "About %s"
msgstr "About %s"
-#: classes/Gems/Menu.php:143
+#: classes/Gems/Menu.php:144
msgid "Reporting bugs"
msgstr "Reporting bugs"
-#: classes/Gems/Menu.php:146
+#: classes/Gems/Menu.php:147
msgid "Support"
msgstr "Support"
-#: classes/Gems/Menu.php:166
+#: classes/Gems/Menu.php:167
msgid "Project setup"
msgstr "Project setup"
-#: classes/Gems/Menu.php:169
+#: classes/Gems/Menu.php:170
msgid "Database"
msgstr "Database"
-#: classes/Gems/Menu.php:173
+#: classes/Gems/Menu.php:174
msgid "Content"
msgstr "Content"
-#: classes/Gems/Menu.php:176
+#: classes/Gems/Menu.php:177
msgid "Execute"
msgstr "Execute"
-#: classes/Gems/Menu.php:181
+#: classes/Gems/Menu.php:182
msgid "Patches"
msgstr "Patches"
-#: classes/Gems/Menu.php:182
+#: classes/Gems/Menu.php:183
msgid "Execute new"
msgstr "Execute new"
-#: classes/Gems/Menu.php:184
+#: classes/Gems/Menu.php:185
msgid "Refresh translateables"
msgstr "Refresh translateables"
-#: classes/Gems/Menu.php:186
+#: classes/Gems/Menu.php:187
msgid "Run SQL"
msgstr "Run SQL"
-#: classes/Gems/Menu.php:189
+#: classes/Gems/Menu.php:190
msgid "Reception codes"
msgstr "Reception codes"
-#: classes/Gems/Menu.php:192
+#: classes/Gems/Menu.php:193
msgid "Consents"
msgstr "Consents"
-#: classes/Gems/Menu.php:195
+#: classes/Gems/Menu.php:196
msgid "Roles"
msgstr "Roles"
-#: classes/Gems/Menu.php:196
-#: classes/Gems/Menu.php:345
+#: classes/Gems/Menu.php:197
+#: classes/Gems/Menu.php:346
msgid "Assigned"
msgstr "Assigned"
-#: classes/Gems/Menu.php:197
+#: classes/Gems/Menu.php:198
msgid "Privileges"
msgstr "Privileges"
-#: classes/Gems/Menu.php:200
+#: classes/Gems/Menu.php:201
msgid "Groups"
msgstr "Groups"
-#: classes/Gems/Menu.php:203
+#: classes/Gems/Menu.php:204
msgid "Organizations"
msgstr "Organizations"
-#: classes/Gems/Menu.php:206
+#: classes/Gems/Menu.php:207
msgid "Staff"
msgstr "Staff"
-#: classes/Gems/Menu.php:209
+#: classes/Gems/Menu.php:210
msgid "Logging"
msgstr "Logging"
-#: classes/Gems/Menu.php:213
+#: classes/Gems/Menu.php:214
msgid "Maintenance"
msgstr "Maintenance"
-#: classes/Gems/Menu.php:218
+#: classes/Gems/Menu.php:219
msgid "Upgrade"
msgstr "Upgrade"
-#: classes/Gems/Menu.php:219
-#: classes/Gems/Menu.php:318
+#: classes/Gems/Menu.php:220
+#: classes/Gems/Menu.php:319
msgid "Show"
msgstr "Show"
-#: classes/Gems/Menu.php:220
+#: classes/Gems/Menu.php:221
msgid "Execute all"
msgstr "Execute all"
-#: classes/Gems/Menu.php:221
+#: classes/Gems/Menu.php:222
msgid "Execute this"
msgstr "Execute this"
-#: classes/Gems/Menu.php:222
+#: classes/Gems/Menu.php:223
msgid "Execute from here"
msgstr "Execute from here"
-#: classes/Gems/Menu.php:223
+#: classes/Gems/Menu.php:224
msgid "Execute to here"
msgstr "Execute to here"
-#: classes/Gems/Menu.php:235
+#: classes/Gems/Menu.php:236
#, php-format
msgid "Stand-alone privilige: %s"
msgstr "Stand-alone privilige: %s"
-#: classes/Gems/Menu.php:242
+#: classes/Gems/Menu.php:243
msgid "Logon"
msgstr "Logon"
-#: classes/Gems/Menu.php:243
+#: classes/Gems/Menu.php:244
msgid "Lost password"
msgstr "Lost password"
-#: classes/Gems/Menu.php:244
+#: classes/Gems/Menu.php:245
msgid "Your account"
msgstr "Your account"
-#: classes/Gems/Menu.php:245
+#: classes/Gems/Menu.php:246
msgid "Activity overview"
msgstr "Activity overview"
-#: classes/Gems/Menu.php:246
+#: classes/Gems/Menu.php:247
msgid "Change password"
msgstr "Change password"
-#: classes/Gems/Menu.php:247
-#: classes/Gems/Menu.php:287
-#: classes/Gems/Menu.php:322
+#: classes/Gems/Menu.php:248
+#: classes/Gems/Menu.php:288
+#: classes/Gems/Menu.php:323
msgid "Token"
msgstr "Token"
-#: classes/Gems/Menu.php:283
+#: classes/Gems/Menu.php:284
msgid "Track"
msgstr "Track"
-#: classes/Gems/Menu.php:290
-#: classes/Gems/Menu.php:310
-#: classes/Gems/Menu.php:341
+#: classes/Gems/Menu.php:291
+#: classes/Gems/Menu.php:311
+#: classes/Gems/Menu.php:342
msgid "Add"
msgstr "Add"
-#: classes/Gems/Menu.php:294
+#: classes/Gems/Menu.php:295
#: classes/Gems/Menu.php:377
msgid "Preview"
msgstr "Preview"
-#: classes/Gems/Menu.php:301
+#: classes/Gems/Menu.php:302
msgid "Tracks"
msgstr "Tracks"
-#: classes/Gems/Menu.php:314
+#: classes/Gems/Menu.php:315
msgid "Assignments"
msgstr "Assignments"
-#: classes/Gems/Menu.php:326
+#: classes/Gems/Menu.php:327
msgid "Edit"
msgstr "Edit"
-#: classes/Gems/Menu.php:330
+#: classes/Gems/Menu.php:331
msgid "Delete"
msgstr "Delete"
-#: classes/Gems/Menu.php:335
+#: classes/Gems/Menu.php:336
msgid "Surveys"
msgstr "Surveys"
-#: classes/Gems/Menu.php:367
+#: classes/Gems/Menu.php:368
msgid "Fill in"
msgstr "Fill in"
@@ -427,11 +427,11 @@
msgid " The error message is: %s"
msgstr " The error message is: %s"
-#: classes/Gems/Tracker.php:761
+#: classes/Gems/Tracker.php:771
msgid "Checks performed"
msgstr "Checks performed"
-#: classes/Gems/Upgrades.php:76
+#: classes/Gems/Upgrades.php:77
msgid "Syncing surveys for all sources"
msgstr "Syncing surveys for all sources"
@@ -495,14 +495,14 @@
msgstr "Are you sure?"
#: classes/Gems/Controller/BrowseEditAction.php:796
-#: classes/Gems/Default/DatabaseAction.php:171
-#: classes/Gems/Default/DatabaseAction.php:484
+#: classes/Gems/Default/DatabaseAction.php:187
+#: classes/Gems/Default/DatabaseAction.php:499
msgid "Yes"
msgstr "Yes"
#: classes/Gems/Controller/BrowseEditAction.php:797
-#: classes/Gems/Default/DatabaseAction.php:172
-#: classes/Gems/Default/DatabaseAction.php:485
+#: classes/Gems/Default/DatabaseAction.php:188
+#: classes/Gems/Default/DatabaseAction.php:500
msgid "No"
msgstr "No"
@@ -544,8 +544,7 @@
msgstr "Unknown %s."
#: classes/Gems/Controller/ModelActionAbstract.php:97
-#: classes/Gems/Default/AskAction.php:150
-#: classes/Gems/Default/DatabaseAction.php:488
+#: classes/Gems/Default/DatabaseAction.php:503
msgid "Cancel"
msgstr "Cancel"
@@ -592,113 +591,58 @@
msgid "Nothing to do."
msgstr "Nothing to do."
-#: classes/Gems/Default/AskAction.php:128
+#: classes/Gems/Default/AskAction.php:84
#, php-format
-msgid "Welcome %s,"
-msgstr "Welcome %s,"
+msgid "Enter your %s token"
+msgstr "Enter your %s token"
-#: classes/Gems/Default/AskAction.php:131
-#, php-format
-msgid "Thank you for answering the survey for token %s."
-msgstr "Thank you for answering the survey for token %s."
+#: classes/Gems/Default/AskAction.php:87
+msgid "Tokens identify a survey that was assigned to you personally."
+msgstr "Tokens identify a survey that was assigned to you personally."
-#: classes/Gems/Default/AskAction.php:132
-msgid "Please click the button below to answer the next survey."
-msgstr "Please click the button below to answer the next survey."
+#: classes/Gems/Default/AskAction.php:87
+msgid "Entering the token and pressing OK will open that survey."
+msgstr "Entering the token and pressing OK will open that survey."
-#: classes/Gems/Default/AskAction.php:137
-#, php-format
-msgid "Please click the button below to answer the survey for token %s."
-msgstr "Please click the button below to answer the survey for token %s."
+#: classes/Gems/Default/AskAction.php:91
+msgid "After answering the survey you will be logged off automatically."
+msgstr "After answering the survey you will be logged off automatically."
-#: classes/Gems/Default/AskAction.php:141
-#, php-format
-msgid "Wait one second to open the survey automatically or click on Cancel to stop."
-msgid_plural "Wait %d seconds to open the survey automatically or click on Cancel to stop."
-msgstr[0] "Wait one second to open the survey automatically or click on Cancel to stop."
-msgstr[1] "Wait %d seconds to open the survey automatically or click on Cancel to stop."
+#: classes/Gems/Default/AskAction.php:96
+msgid "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive."
+msgstr "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive."
-#: classes/Gems/Default/AskAction.php:156
-#, php-format
-msgid "After this survey there is one other survey we would like you to answer."
-msgid_plural "After this survey there are another %d surveys we would like you to answer."
-msgstr[0] "After this survey there is one other survey we would like you to answer."
-msgstr[1] "After this survey there are another %d surveys we would like you to answer."
+#: classes/Gems/Default/AskAction.php:97
+msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
+msgstr "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
-#: classes/Gems/Default/AskAction.php:166
+#: classes/Gems/Default/AskAction.php:132
#, php-format
-msgid "The survey for token %s is no longer active."
-msgstr "The survey for token %s is no longer active."
-
-#: classes/Gems/Default/AskAction.php:170
-#, php-format
-msgid "The token %s does not exist."
-msgstr "The token %s does not exist."
-
-#: classes/Gems/Default/AskAction.php:172
-#, php-format
msgid "Thank you for answering. At the moment we have no further surveys for you to take."
msgstr "Thank you for answering. At the moment we have no further survey...
[truncated message content] |
|
From: <gem...@li...> - 2012-04-19 14:24:54
|
Revision: 624
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=624&view=rev
Author: matijsdejong
Date: 2012-04-19 14:24:44 +0000 (Thu, 19 Apr 2012)
Log Message:
-----------
Bug fix where tracks where shown multiple times if a user belonged to multiple organizations
Code commented out meant for 1.5.4
Modified Paths:
--------------
trunk/library/classes/Gems/Tracker/Model/RespondentTrackModel.php
trunk/library/classes/Gems/Tracker/Token.php
trunk/library/configs/db/patches.sql
trunk/library/configs/db/tables/gems__tokens.200.sql
Modified: trunk/library/classes/Gems/Tracker/Model/RespondentTrackModel.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Model/RespondentTrackModel.php 2012-04-19 10:57:42 UTC (rev 623)
+++ trunk/library/classes/Gems/Tracker/Model/RespondentTrackModel.php 2012-04-19 14:24:44 UTC (rev 624)
@@ -64,7 +64,7 @@
{
parent::__construct('surveys', 'gems__respondent2track', 'gr2t');
$this->addTable('gems__respondents', array('gr2t_id_user' => 'grs_id_user'));
- $this->addTable('gems__respondent2org', array('gr2t_id_user' => 'gr2o_id_user'));
+ $this->addTable('gems__respondent2org', array('gr2t_id_user' => 'gr2o_id_user', 'gr2t_id_organization' => 'gr2o_id_organization'));
$this->addTable('gems__tracks', array('gr2t_id_track' => 'gtr_id_track'));
$this->addTable('gems__reception_codes', array('gr2t_reception_code' => 'grc_id_reception_code'));
$this->addLeftTable('gems__staff', array('gr2t_created_by' => 'gsf_id_user'));
Modified: trunk/library/classes/Gems/Tracker/Token.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Token.php 2012-04-19 10:57:42 UTC (rev 623)
+++ trunk/library/classes/Gems/Tracker/Token.php 2012-04-19 14:24:44 UTC (rev 624)
@@ -888,7 +888,8 @@
$values['gto_start_time'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
$values['gto_in_source'] = 1;
}
- $values['gto_by'] = $userId;
+ $values['gto_by'] = $userId;
+ // 1.5.4 $values['gto_return_url'] = $_SERVER["HTTP_REFERER"];
$this->_updateToken($values, $userId);
Modified: trunk/library/configs/db/patches.sql
===================================================================
--- trunk/library/configs/db/patches.sql 2012-04-19 10:57:42 UTC (rev 623)
+++ trunk/library/configs/db/patches.sql 2012-04-19 14:24:44 UTC (rev 624)
@@ -393,3 +393,7 @@
-- PATCH: make reset keys unique so we now whose key it is
ALTER TABLE `gems__user_passwords` ADD UNIQUE KEY (gup_reset_key);
ALTER TABLE `gems__staff` ADD UNIQUE KEY (gsf_reset_key);
+
+-- GEMS VERSION: 47
+-- PATCH: Add return url to tokens
+-- ALTER TABLE gems__tokens ADD gto_return_url varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null AFTER gto_reception_code;
Modified: trunk/library/configs/db/tables/gems__tokens.200.sql
===================================================================
--- trunk/library/configs/db/tables/gems__tokens.200.sql 2012-04-19 10:57:42 UTC (rev 623)
+++ trunk/library/configs/db/tables/gems__tokens.200.sql 2012-04-19 14:24:44 UTC (rev 624)
@@ -2,17 +2,17 @@
CREATE TABLE if not exists gems__tokens (
gto_id_token varchar(9) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null,
- gto_id_respondent_track bigint unsigned not null
+ gto_id_respondent_track bigint unsigned not null
references gems__respondent2track (gr2t_id_respondent_track),
- gto_id_round bigint unsigned not null
+ gto_id_round bigint unsigned not null
references gems__rounds (gro_id_round),
-- non-changing fields calculated from previous two:
- gto_id_respondent bigint unsigned not null
+ gto_id_respondent bigint unsigned not null
references gems__respondents (grs_id_user),
- gto_id_organization bigint unsigned not null
+ gto_id_organization bigint unsigned not null
references gems__organizations (gor_id_organization),
- gto_id_track bigint unsigned not null
+ gto_id_track bigint unsigned not null
references gems__track (gtr_id_track),
-- values initially filled from gems__rounds, but that may get different values later on
@@ -25,14 +25,14 @@
-- real data
gto_valid_from datetime,
gto_valid_until datetime,
- gto_mail_sent_date date,
- gto_next_mail_date date,
+ gto_mail_sent_date date,
+ gto_next_mail_date date,
- gto_start_time datetime,
+ gto_start_time datetime,
gto_in_source boolean not null default 0,
gto_by bigint(20) unsigned NULL,
- gto_completion_time datetime,
+ gto_completion_time datetime,
gto_duration_in_sec bigint(20) unsigned NULL,
gto_followup_date date, -- depreciated
gto_result varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci',
@@ -41,6 +41,8 @@
gto_reception_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' default 'OK' not null
references gems__reception_codes (grc_id_reception_code),
+ -- gto_return_url varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null,
+
gto_changed timestamp not null default current_timestamp on update current_timestamp,
gto_changed_by bigint unsigned not null,
gto_created timestamp not null,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-23 14:13:54
|
Revision: 632
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=632&view=rev
Author: matijsdejong
Date: 2012-04-23 14:13:47 +0000 (Mon, 23 Apr 2012)
Log Message:
-----------
After survey completion the user always returns to his/her own site, regardless of later url changes.
Fixed UserLoader issue when the database does not exist
Added documentation and utility functions to Html and Html_Attributes
Modified Paths:
--------------
trunk/library/classes/Gems/Default/AskAction.php
trunk/library/classes/Gems/Tracker/Token.php
trunk/library/classes/Gems/User/UserLoader.php
trunk/library/classes/MUtil/Html/ArrayAttribute.php
trunk/library/classes/MUtil/Html/AttributeAbstract.php
trunk/library/classes/MUtil/Html/AttributeInterface.php
trunk/library/classes/MUtil/Html/UrlArrayAttribute.php
trunk/library/classes/MUtil/Html.php
trunk/library/configs/db/patches.sql
trunk/library/configs/db/tables/gems__tokens.200.sql
Modified: trunk/library/classes/Gems/Default/AskAction.php
===================================================================
--- trunk/library/classes/Gems/Default/AskAction.php 2012-04-23 12:08:39 UTC (rev 631)
+++ trunk/library/classes/Gems/Default/AskAction.php 2012-04-23 14:13:47 UTC (rev 632)
@@ -112,14 +112,15 @@
if ($tokenId = $this->_getParam(MUtil_Model::REQUEST_ID)) {
$tracker = $this->loader->getTracker();
$tokenId = $tracker->filterToken($tokenId);
+ $token = $tracker->getToken($tokenId);
- if ($token = $tracker->getToken($tokenId)) {
+ if ($token->exists) {
/****************************
* Update open tokens first *
****************************/
$respId = $token->getRespondentId();
- $tracker->processCompletedTokens($respId, $respId);
+ $tracker->processCompletedTokens($respId, $token->getChangedBy());
// Display token when possible
if ($this->html->snippet($this->forwardSnippets, 'token', $token)) {
@@ -141,7 +142,7 @@
}
}
- $this->_forward('token');
+ $this->_forward('index');
}
/**
@@ -168,31 +169,58 @@
}
/**
+ * Common handler utility to initialize tokens from parameters
+ */
+ protected function initToken()
+ {
+ $this->tracker = $this->loader->getTracker();
+ $this->tokenId = $this->tracker->filterToken($this->_getParam(MUtil_Model::REQUEST_ID));
+ $this->token = $this->tracker->getToken($this->tokenId);
+ }
+
+ /**
* The action where survey sources should return to after survey completion
*/
public function returnAction()
{
- $user = $this->loader->getCurrentUser();
+ $tracker = $this->loader->getTracker();
- if ($user->isActive() && ($parameters = $user->getSurveyReturn())) {
- $tracker = $this->loader->getTracker();
- $token = $tracker->getToken($tracker->filterToken($this->_getParam(MUtil_Model::REQUEST_ID)));
+ if ($tokenId = $this->_getParam(MUtil_Model::REQUEST_ID)) {
+ $tokenId = $tracker->filterToken($tokenId);
+ $token = $tracker->getToken($tokenId);
- // Check for completed tokens
- $this->loader->getTracker()->processCompletedTokens($token->getRespondentId(), $user->getUserId());
+ if ($url = $token->getReturnUrl()) {
+ // Check for completed tokens
+ $this->loader->getTracker()->processCompletedTokens($token->getRespondentId(), $token->getChangedBy());
- if (! $parameters) {
- // Default
- $request = $this->getRequest();
- $parameters[$request->getControllerKey()] = 'respondent';
- $parameters[$request->getActionKey()] = 'show';
- $parameters[MUtil_Model::REQUEST_ID] = $token->getPatientNumber();
+ // Redirect at once, might be another site url
+ header('Location: ' . $url);
+ exit();
}
- $this->_reroute($parameters, true);
- } else {
- $this->_forward('forward');
+ // Nor return? Check for old style user based return
+ $user = $this->loader->getCurrentUser();
+
+ if ($user->isActive() && ($parameters = $user->getSurveyReturn())) {
+
+ // Check for completed tokens
+ $this->loader->getTracker()->processCompletedTokens($token->getRespondentId(), $user->getUserId());
+
+ if (! $parameters) {
+ // Default
+ $request = $this->getRequest();
+ $parameters[$request->getControllerKey()] = 'respondent';
+ $parameters[$request->getActionKey()] = 'show';
+ $parameters[MUtil_Model::REQUEST_ID] = $token->getPatientNumber();
+ }
+
+ $this->_reroute($parameters, true);
+ return;
+ }
}
+
+ // In all other cases: the action that generates meaningfull warnings as is reachable for everyone
+ $this->_forward('forward');
}
/**
Modified: trunk/library/classes/Gems/Tracker/Token.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Token.php 2012-04-23 12:08:39 UTC (rev 631)
+++ trunk/library/classes/Gems/Tracker/Token.php 2012-04-23 14:13:47 UTC (rev 632)
@@ -272,7 +272,104 @@
return $this;
}
+
/**
+ * Retrieve a certain $key from the local cache
+ *
+ * For speeding up things the token can hold a local cache, living as long as the
+ * token object exists in memory. Sources can use this to store reusable information.
+ *
+ * To reset the cache on an update, the source can use the cacheReset method or the
+ * setCache method to update the changed value.
+ *
+ * @param string $key The key used in the cache
+ * @param mixed $defaultValue The optional default value to use when it is not present
+ * @return mixed
+ */
+ public function cacheGet($key, $defaultValue = null) {
+ if ($this->cacheHas($key)) {
+ return $this->_cache[$key];
+ } else {
+ return $defaultValue;
+ }
+ }
+
+ /**
+ * find out if a certain key is present in the cache
+ *
+ * @param string $key
+ * @return boolean
+ */
+ public function cacheHas($key) {
+ return isset($this->_cache[$key]);
+
+ }
+
+ /**
+ * Reset the local cache for this token
+ *
+ * You can pass in an optional $key parameter to reset just that key, otherwise all
+ * the cache will be reset
+ *
+ * @param string|null $key The key to reset
+ */
+ public function cacheReset($key = null) {
+ if (is_null($key)) {
+ $this->_cache = array();
+ } else {
+ unset($this->_cache[$key]);
+ }
+ }
+
+ /**
+ * Set a $key in the local cache
+ *
+ * @param string $key
+ * @param mixed $value
+ */
+ public function cacheSet($key, $value) {
+ $this->_cache[$key] = $value;
+ }
+
+ /**
+ * Returns the full url Gems should forward to after survey completion.
+ *
+ * This fix allows multiple sites with multiple url's to share a single
+ * installation.
+ *
+ * @return string
+ */
+ protected function calculateReturnUrl()
+ {
+ $currentUri = $this->util->getCurrentURI();
+
+ /*
+ // Referrer would be powerful when someone is usng multiple windows, but
+ // the loop does not always provide a correct referrer.
+ $referrer = $_SERVER["HTTP_REFERER"];
+
+ // If a referrer was specified and that referral is from the current site, then use it
+ // as it is more dependable when the user has multiple windows open on the application.
+ if ($referrer && (0 == strncasecmp($referrer, $currentUri, strlen($currentUri)))) {
+ return $referrer;
+ // MUtil_Echo::track($referrer);
+ } // */
+
+ // Use the survey return if available.
+ $surveyReturn = $this->loader->getCurrentUser()->getSurveyReturn();
+ if ($surveyReturn) {
+ // Do not show the base url as it is in $currentUri
+ $surveyReturn['NoBase'] = true;
+
+ return $currentUri . MUtil_Html::urlString($surveyReturn);
+ // MUtil_Echo::track($currentUri . MUtil_Html::urlString($surveyReturn));
+ }
+
+ // Ultimate backup solution for reutrn
+ return $currentUri . '/ask/forward/' . MUtil_Model::REQUEST_ID . '/' . urlencode($this->getTokenId());
+ }
+
+ /**
* Should be called after answering the request to allow the Target
* to check if all required registry values have been set correctly.
*
@@ -455,7 +552,18 @@
}
/**
+ * Returns the staff or respondent id of the person
+ * who last changed this token.
*
+ * @return int
+ */
+ public function getChangedBy()
+ {
+ return $this->_gemsData['gto_changed_by'];
+ }
+
+ /**
+ *
* @return MUtil_Date Completion time as a date or null
*/
public function getCompletionTime()
@@ -734,6 +842,15 @@
return $this->_gemsData['gto_id_respondent_track'];
}
+ /**
+ * The full return url for a redirect
+ *
+ * @return string
+ */
+ public function getReturnUrl()
+ {
+ return $this->_gemsData['gto_return_url'];
+ }
/**
*
@@ -889,7 +1006,7 @@
$values['gto_in_source'] = 1;
}
$values['gto_by'] = $userId;
- // 1.5.4 $values['gto_return_url'] = $_SERVER["HTTP_REFERER"];
+ $values['gto_return_url'] = $this->calculateReturnUrl();
$this->_updateToken($values, $userId);
@@ -1189,62 +1306,4 @@
return $this->_updateToken($values, $userId);
}
-
- /**
- * Retrieve a certain $key from the local cache
- *
- * For speeding up things the token can hold a local cache, living as long as the
- * token object exists in memory. Sources can use this to store reusable information.
- *
- * To reset the cache on an update, the source can use the cacheReset method or the
- * setCache method to update the changed value.
- *
- * @param string $key The key used in the cache
- * @param mixed $defaultValue The optional default value to use when it is not present
- * @return mixed
- */
- public function cacheGet($key, $defaultValue = null) {
- if ($this->cacheHas($key)) {
- return $this->_cache[$key];
- } else {
- return $defaultValue;
- }
- }
-
- /**
- * find out if a certain key is present in the cache
- *
- * @param string $key
- * @return boolean
- */
- public function cacheHas($key) {
- return isset($this->_cache[$key]);
-
- }
-
- /**
- * Reset the local cache for this token
- *
- * You can pass in an optional $key parameter to reset just that key, otherwise all
- * the cache will be reset
- *
- * @param string|null $key The key to reset
- */
- public function cacheReset($key = null) {
- if (is_null($key)) {
- $this->_cache = array();
- } else {
- unset($this->_cache[$key]);
- }
- }
-
- /**
- * Set a $key in the local cache
- *
- * @param string $key
- * @param mixed $value
- */
- public function cacheSet($key, $value) {
- $this->_cache[$key] = $value;
- }
-}
\ No newline at end of file
+}
Modified: trunk/library/classes/Gems/User/UserLoader.php
===================================================================
--- trunk/library/classes/Gems/User/UserLoader.php 2012-04-23 12:08:39 UTC (rev 631)
+++ trunk/library/classes/Gems/User/UserLoader.php 2012-04-23 14:13:47 UTC (rev 632)
@@ -357,7 +357,12 @@
}
if (! $urls) {
- $data = $this->db->fetchPairs("SELECT gor_id_organization, gor_url_base FROM gems__organizations WHERE gor_active=1 AND gor_url_base IS NOT NULL");
+ try {
+ $data = $this->db->fetchPairs("SELECT gor_id_organization, gor_url_base FROM gems__organizations WHERE gor_active=1 AND gor_url_base IS NOT NULL");
+ } catch (Zend_Db_Exception $zde) {
+ // Table might not be filled
+ $data = array();
+ }
$urls = array();
foreach ($data as $orgId => $urlsBase) {
foreach (explode(' ', $urlsBase) as $url) {
Modified: trunk/library/classes/MUtil/Html/ArrayAttribute.php
===================================================================
--- trunk/library/classes/MUtil/Html/ArrayAttribute.php 2012-04-23 12:08:39 UTC (rev 631)
+++ trunk/library/classes/MUtil/Html/ArrayAttribute.php 2012-04-23 14:13:47 UTC (rev 632)
@@ -1,41 +1,55 @@
<?php
-
-/**
- * Copyright (c) 2011, Erasmus MC
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Erasmus MC nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
/**
- * @author Matijs de Jong
- * @since 1.0
- * @version 1.1
- * @package MUtil
+ * Copyright (c) 2011, Erasmus MC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Erasmus MC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * @package MUtil
* @subpackage Html
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $Id$
*/
+/**
+ * Parent class for all array based attribute classes.
+ *
+ * Useable as is, using spaces as value separators by default.
+ *
+ * Parameter setting checks for the addition of special types,
+ * just as MUtil_Html_HtmlElement.
+ *
+ * @package MUtil
+ * @subpackage Html
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.0
+ */
+
class MUtil_Html_ArrayAttribute extends MUtil_Html_AttributeAbstract
implements ArrayAccess, Countable, IteratorAggregate
{
@@ -44,7 +58,8 @@
protected $_specialTypes;
private $_specialTypesDefault = array(
- 'setView' => 'Zend_View',
+ 'setRequest' => 'Zend_Controller_Request_Abstract',
+ 'setView' => 'Zend_View',
);
protected $_values;
Modified: trunk/library/classes/MUtil/Html/AttributeAbstract.php
===================================================================
--- trunk/library/classes/MUtil/Html/AttributeAbstract.php 2012-04-23 12:08:39 UTC (rev 631)
+++ trunk/library/classes/MUtil/Html/AttributeAbstract.php 2012-04-23 14:13:47 UTC (rev 632)
@@ -1,6 +1,5 @@
<?php
-
/**
* Copyright (c) 2011, Erasmus MC
* All rights reserved.
@@ -48,35 +47,84 @@
*/
abstract class MUtil_Html_AttributeAbstract implements MUtil_Html_AttributeInterface
{
+ /**
+ *
+ * @var type
+ */
+ public $name;
+
+ /**
+ *
+ * @var Zend_Controller_Request_Abstract
+ */
+ public $request;
+
+ /**
+ *
+ * @var Zend_View_Abstract
+ */
public $view;
- protected $_name;
-
+ /**
+ *
+ * @param string $name The name of the attribute
+ * @param mixed $value
+ */
public function __construct($name, $value = null)
{
- $this->_name = $name;
+ $this->name = $name;
if ($value) {
$this->set($value);
}
}
+ /**
+ * Returns an unescape string version of the attribute
+ *
+ * Output escaping is done elsewhere, e.g. in Zend_View_Helper_HtmlElement->_htmlAttribs()
+ *
+ * If a subclass needs the view for the right output and the view might not be set
+ * it must overrule __toString().
+ *
+ * @return string
+ */
public function __toString()
{
- // Output escaping is done in Zend_View_Helper_HtmlElement->_htmlAttribs()
- //
- // If the attribute needs the view to get the right data it must overrule __toString().
return $this->get();
}
// public function add($value);
// public function get();
+ /**
+ * Returns the attribute name
+ *
+ * @return string
+ */
public function getAttributeName()
{
- return $this->_name;
+ return $this->name;
}
+ /**
+ *
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function getRequest()
+ {
+ if (! $this->request) {
+ $front = Zend_Controller_Front::getInstance();
+ $this->request = $front->getRequest();
+ }
+
+ return $this->request;
+ }
+
+ /**
+ *
+ * @return Zend_View_Abstract
+ */
public function getView()
{
if (! $this->view) {
@@ -88,6 +136,14 @@
return $this->view;
}
+ /**
+ * Renders the element into a html string
+ *
+ * The $view is used to correctly encode and escape the output
+ *
+ * @param Zend_View_Abstract $view
+ * @return string Correctly encoded and escaped html output
+ */
public function render(Zend_View_Abstract $view)
{
$this->setView($view);
@@ -101,6 +157,21 @@
// public function set($value);
+ /**
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return MUtil_Html_AttributeAbstract (continuation pattern)
+ */
+ public function setRequest(Zend_Controller_Request_Abstract $request)
+ {
+ $this->request = $request;
+ return $this;
+ }
+
+ /**
+ *
+ * @param Zend_View_Abstract $view
+ */
public function setView(Zend_View_Abstract $view)
{
$this->view = $view;
Modified: trunk/library/classes/MUtil/Html/AttributeInterface.php
===================================================================
--- trunk/library/classes/MUtil/Html/AttributeInterface.php 2012-04-23 12:08:39 UTC (rev 631)
+++ trunk/library/classes/MUtil/Html/AttributeInterface.php 2012-04-23 14:13:47 UTC (rev 632)
@@ -1,62 +1,78 @@
<?php
-
-/**
- * Copyright (c) 2011, Erasmus MC
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Erasmus MC nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
/**
- *
- * @author Matijs de Jong
- * @since 1.0
- * @version 1.1
- * @package MUtil
+ * Copyright (c) 2011, Erasmus MC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Erasmus MC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * @package MUtil
* @subpackage Html
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $Id$
*/
/**
* Standard interface for attributes in this package.
- *
+ *
* The interface ensure the ability to not only get and set the
* value, but also the attribute name and the ability to add to
* the content in a manner as defined by the attribute itself.
- *
+ *
* E.g. adding to a class attribute usually involves seperating
* the new addition with a space.
- *
- * @author Matijs de Jong
- * @package MUtil
+ *
+ * @package MUtil
* @subpackage Html
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.0
*/
interface MUtil_Html_AttributeInterface extends MUtil_Html_HtmlInterface
{
+ /**
+ * Returns an unescape string version of the attribute
+ *
+ * Output escaping is done elsewhere, e.g. in Zend_View_Helper_HtmlElement->_htmlAttribs()
+ *
+ * @return string
+ */
public function __toString();
+
public function add($value);
public function get();
+
+ /**
+ * Returns the attribute name
+ *
+ * @return string
+ */
public function getAttributeName();
+
// inherited: public function render(Zend_View_Abstract $view);
+
public function set($value);
}
\ No newline at end of file
Modified: trunk/library/classes/MUtil/Html/UrlArrayAttribute.php
===================================================================
--- trunk/library/classes/MUtil/Html/UrlArrayAttribute.php 2012-04-23 12:08:39 UTC (rev 631)
+++ trunk/library/classes/MUtil/Html/UrlArrayAttribute.php 2012-04-23 14:13:47 UTC (rev 632)
@@ -1,6 +1,5 @@
<?php
-
/**
* Copyright (c) 2011, Erasmus MC
* All rights reserved.
@@ -26,23 +25,59 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * @package MUtil
+ * @subpackage Html
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $Id$
*/
/**
- * @author Matijs de Jong
- * @since 1.0
- * @version 1.1
- * @package MUtil
+ * An array attribute that forms url's using Zend framework routing
+ *
+ * @package MUtil
* @subpackage Html
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.0
*/
-
class MUtil_Html_UrlArrayAttribute extends MUtil_Html_ArrayAttribute
{
- protected $_request;
- protected $_routeReset;
+ /**
+ *
+ * @var boolean
+ */
+ protected $_routeReset = false;
+ /**
+ * Seperator used to separate multiple items
+ *
+ * @var string
+ */
protected $_separator = '&';
+ protected $_specialTypes = array('setRouter' => 'Zend_Controller_Router_Route');
+
+ /**
+ *
+ * @var Zend_Controller_Router_Route
+ */
+ public $router;
+
+ /**
+ * Helper function thats fills a parameter from the request if it was not
+ * already in the options array.
+ *
+ * This function ensures that e.g. the current controller is used instead
+ * of the default 'index' controller.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @param string $name
+ * @param array $options
+ */
private static function _rerouteUrlOption(Zend_Controller_Request_Abstract $request, $name, &$options)
{
if (! array_key_exists($name, $options)) {
@@ -85,7 +120,8 @@
// Make sure controllor, action, module are specified
$url_parameters = self::rerouteUrl($this->getRequest(), $url_parameters);
- return $this->getView()->url($url_parameters, null, $this->getRouteReset(), false);
+ $router = $this->getRouter();
+ return $router->assemble($url_parameters, null, $this->getRouteReset(), false);
}
return null;
@@ -96,25 +132,40 @@
return $key . '=' . $value;
}
- public function getRequest()
+ /**
+ *
+ * @return Zend_Controller_Router_Route
+ */
+ public function getRouter()
{
- if (! $this->_request) {
+ if (! $this->router) {
$front = Zend_Controller_Front::getInstance();
- $this->_request = $front->getRequest();
+ $this->router = $front->getRouter();
}
- return $this->_request;
+ return $this->router;
}
+ /**
+ * Whether or not to set route defaults with the paramter values
+ *
+ * @return type
+ */
public function getRouteReset()
{
return $this->_routeReset;
}
+ /**
+ * Is this Url an Zend Framework Mvc url or a string with parameters.
+ *
+ * @return boolean
+ */
public function isMvcUrl()
{
foreach ($this->getArray() as $key => $value) {
if (is_numeric($key)) {
+ // Contains standalone string => not Zend
return false;
}
}
@@ -122,31 +173,58 @@
return true;
}
+ /**
+ * Set the module, controller and action of an url parameter array to the current
+ * module, controller and action, except when one of these items has already been
+ * specified in the array.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @param array $options An array of parameters (optionally including e.g. controller name) for the new url
+ * @param boole...
[truncated message content] |
|
From: <gem...@li...> - 2012-04-25 14:43:42
|
Revision: 635
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=635&view=rev
Author: matijsdejong
Date: 2012-04-25 14:43:30 +0000 (Wed, 25 Apr 2012)
Log Message:
-----------
Made OnClickArrayAttribute.php easier to use for common tasks
Documented ArrayAttribute.php
Updated translations
Modified Paths:
--------------
trunk/library/classes/MUtil/Html/ArrayAttribute.php
trunk/library/classes/MUtil/Html/OnClickArrayAttribute.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
trunk/library/snippets/Track/Token/ShowFirstOpenSnippet.php
Modified: trunk/library/classes/MUtil/Html/ArrayAttribute.php
===================================================================
--- trunk/library/classes/MUtil/Html/ArrayAttribute.php 2012-04-24 14:01:21 UTC (rev 634)
+++ trunk/library/classes/MUtil/Html/ArrayAttribute.php 2012-04-25 14:43:30 UTC (rev 635)
@@ -49,14 +49,28 @@
* @license New BSD License
* @since Class available since version 1.0
*/
-
class MUtil_Html_ArrayAttribute extends MUtil_Html_AttributeAbstract
implements ArrayAccess, Countable, IteratorAggregate
{
+ /**
+ * String used to glue items together
+ *
+ * @var string
+ */
protected $_separator = ' ';
+ /**
+ * Specially treated types for a specific subclass
+ *
+ * @var array function name => class
+ */
protected $_specialTypes;
+ /**
+ * Specially treated types as used for each subclass
+ *
+ * @var array function name => class
+ */
private $_specialTypesDefault = array(
'setRequest' => 'Zend_Controller_Request_Abstract',
'setView' => 'Zend_View',
@@ -174,6 +188,16 @@
return null;
}
+ /**
+ * Function that allows subclasses to define their own
+ * mechanism for redering the key/value combination.
+ *
+ * E.g. key=value instead of just the value.
+ *
+ * @param scalar $key
+ * @param string $value Output escaped value
+ * @return string
+ */
public function getKeyValue($key, $value)
{
return $value;
Modified: trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php
===================================================================
--- trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php 2012-04-24 14:01:21 UTC (rev 634)
+++ trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php 2012-04-25 14:43:30 UTC (rev 635)
@@ -1,51 +1,107 @@
<?php
-
-/**
- * Copyright (c) 2011, Erasmus MC
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Erasmus MC nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
+
/**
- * @author Matijs de Jong
- * @since 1.0
- * @version 1.1
- * @package MUtil
+ * Copyright (c) 2011, Erasmus MC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Erasmus MC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * @package MUtil
* @subpackage Html
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $Id$
*/
+/**
+ * Default attribute for onclicks with extra functions for common tasks
+ *
+ * @package MUtil
+ * @subpackage Html
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.0
+ */
class MUtil_Html_OnClickArrayAttribute extends MUtil_Html_ArrayAttribute
{
+ /**
+ * String used to glue items together
+ *
+ * Empty string as not each array element corresponds to a single command.
+ *
+ * @var string
+ */
protected $_separator = '';
+ /**
+ * Specially treated types for a specific subclass
+ *
+ * @var array function name => class
+ */
+ protected $_specialTypes = array(
+ 'addUrl' => 'MUtil_Html_UrlArrayAttribute',
+ );
+
public function __construct($arg_array = null)
{
$args = func_get_args();
parent::__construct('onclick', $args);
}
+ /**
+ * Add a cancel bubble command
+ *
+ * @param boolean $cancelBubble
+ * @return MUtil_Html_OnClickArrayAttribute (continuation pattern)
+ */
+ public function addCancelBubble($cancelBubble = true)
+ {
+ if ($cancelBubble) {
+ $this->add("event.cancelBubble = true;");
+ } else {
+ $this->add("event.cancelBubble = false;");
+ }
+ return $this;
+ }
+
+ /**
+ * Add a url open command by specifying only the link
+ *
+ * @param mixed $href Anything, e.g. a MUtil_Html_UrlArrayAttribute that the code will transform to an url
+ * @return MUtil_Html_OnClickArrayAttribute (continuation pattern)
+ */
+ public function addUrl($href)
+ {
+ $this->add("location.href='");
+ $this->add($href);
+ $this->add("';");
+
+ return $this;
+ }
+
public static function onclickAttribute(array $commands = null)
{
return new self($commands);
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-04-24 14:01:21 UTC (rev 634)
+++ trunk/library/languages/default-en.po 2012-04-25 14:43:30 UTC (rev 635)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-12 15:06+0100\n"
+"POT-Creation-Date: 2012-04-25 16:16+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -18,77 +18,77 @@
"X-Poedit-KeywordsList: plural:1,2\n"
"X-Poedit-SearchPath-0: .\n"
-#: classes/GemsEscort.php:211
+#: classes/GemsEscort.php:212
#, php-format
msgid "Path %s not writable"
msgstr "Path %s not writable"
-#: classes/GemsEscort.php:745
+#: classes/GemsEscort.php:750
#, php-format
msgid "You are logged in as %s"
msgstr "You are logged in as %s"
-#: classes/GemsEscort.php:747
+#: classes/GemsEscort.php:752
#: classes/Gems/Menu.php:249
msgid "Logoff"
msgstr "Logoff"
-#: classes/GemsEscort.php:750
+#: classes/GemsEscort.php:755
msgid "You are not logged in"
msgstr "You are not logged in"
-#: classes/GemsEscort.php:934
+#: classes/GemsEscort.php:939
#, php-format
msgid "User: %s"
msgstr "User: %s"
-#: classes/GemsEscort.php:959
+#: classes/GemsEscort.php:964
msgid "version"
msgstr "version"
-#: classes/GemsEscort.php:1390
+#: classes/GemsEscort.php:1395
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:1521
+#: classes/GemsEscort.php:1526
msgid "Please check back later."
msgstr "Please check back later."
-#: classes/GemsEscort.php:1523
-#: classes/GemsEscort.php:1527
#: classes/GemsEscort.php:1528
+#: classes/GemsEscort.php:1532
+#: classes/GemsEscort.php:1533
msgid "System is in maintenance mode"
msgstr "System is in maintenance mode"
-#: classes/GemsEscort.php:1538
+#: classes/GemsEscort.php:1543
msgid "No access to site."
msgstr "No access to site."
-#: classes/GemsEscort.php:1540
-#: classes/GemsEscort.php:1582
+#: classes/GemsEscort.php:1545
+#: classes/GemsEscort.php:1587
msgid "You have no access to this site."
msgstr "You have no access to this site."
-#: classes/GemsEscort.php:1556
+#: classes/GemsEscort.php:1561
msgid "No access to page"
msgstr "No access to page"
-#: classes/GemsEscort.php:1558
+#: classes/GemsEscort.php:1563
#, 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:1568
-#: classes/GemsEscort.php:1580
+#: classes/GemsEscort.php:1573
+#: classes/GemsEscort.php:1585
msgid "You are no longer logged in."
msgstr "You are no longer logged in."
-#: classes/GemsEscort.php:1569
+#: classes/GemsEscort.php:1574
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:1714
+#: classes/GemsEscort.php:1716
#, php-format
msgid "%d survey"
msgid_plural "%d surveys"
@@ -99,10 +99,6 @@
msgid "Database needs to be updated!"
msgstr "Database needs to be updated!"
-#: classes/Gems/Auth.php:235
-msgid "Combination of organization, username and password not found."
-msgstr "Combination of organization, username and password not found."
-
#: classes/Gems/Html.php:154
msgid "<< First"
msgstr "<< First"
@@ -450,13 +446,11 @@
msgstr "Trying upgrade for %s to level %s: %s"
#: classes/Gems/Controller/BrowseEditAction.php:354
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:226
#, php-format
msgid "New %s..."
msgstr "New %s..."
#: classes/Gems/Controller/BrowseEditAction.php:387
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:246
#, php-format
msgid "Delete %s"
msgstr "Delete %s"
@@ -485,7 +479,6 @@
msgstr "No %s found"
#: classes/Gems/Controller/BrowseEditAction.php:673
-#: classes/Gems/Default/ExportAction.php:234
#, php-format
msgid "No %s found."
msgstr "No %s found."
@@ -495,14 +488,10 @@
msgstr "Are you sure?"
#: classes/Gems/Controller/BrowseEditAction.php:807
-#: classes/Gems/Default/DatabaseAction.php:187
-#: classes/Gems/Default/DatabaseAction.php:499
msgid "Yes"
msgstr "Yes"
#: classes/Gems/Controller/BrowseEditAction.php:808
-#: classes/Gems/Default/DatabaseAction.php:188
-#: classes/Gems/Default/DatabaseAction.php:500
msgid "No"
msgstr "No"
@@ -548,31 +537,31 @@
msgid "Cancel"
msgstr "Cancel"
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:236
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:238
#, php-format
msgid "Do you want to delete this %s?"
msgstr "Do you want to delete this %s?"
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:256
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:258
#, php-format
msgid "Edit %s..."
msgstr "Edit %s..."
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:269
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:271
msgid "No data found."
msgstr "No data found."
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:331
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:333
#, php-format
msgid "No %s found..."
msgstr "No %s found..."
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:341
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:343
#, php-format
msgid "Showing %s"
msgstr "Showing %s"
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:377
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:379
msgid "item"
msgid_plural "items"
msgstr[0] "item"
@@ -616,22 +605,22 @@
msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
msgstr "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
-#: classes/Gems/Default/AskAction.php:131
+#: classes/Gems/Default/AskAction.php:132
#, php-format
msgid "Thank you for answering. At the moment we have no further surveys for you to take."
msgstr "Thank you for answering. At the moment we have no further surveys for you to take."
-#: classes/Gems/Default/AskAction.php:133
+#: classes/Gems/Default/AskAction.php:134
#, php-format
msgid "The survey for token %s has been answered and no further surveys are open."
msgstr "The survey for token %s has been answered and no further surveys are open."
-#: classes/Gems/Default/AskAction.php:140
+#: classes/Gems/Default/AskAction.php:141
#, php-format
msgid "The token %s does not exist (any more)."
msgstr "The token %s does not exist (any more)."
-#: classes/Gems/Default/AskAction.php:241
+#: classes/Gems/Default/AskAction.php:270
#, php-format
msgid "The survey for token %s is no longer active."
msgstr "The survey for token %s is no longer active."
@@ -1196,6 +1185,7 @@
msgstr "Date"
#: classes/Gems/Default/LogAction.php:191
+#: classes/Gems/Default/LogMaintenanceAction.php:52
msgid "Action"
msgstr "Action"
@@ -1212,6 +1202,7 @@
msgstr "IP address"
#: classes/Gems/Default/LogAction.php:209
+#: classes/Gems/Default/LogMaintenanceAction.php:53
msgid "Log"
msgstr "Log"
@@ -1421,6 +1412,8 @@
msgstr "Email servers"
#: classes/Gems/Default/MailTemplateAction.php:76
+#: classes/Gems/Default/StaffAction.php:278
+#: classes/Gems/Default/StaffAction.php:311
msgid "(all organizations)"
msgstr "(all organizations)"
@@ -1445,6 +1438,7 @@
#: classes/Gems/Default/OptionAction.php:136
#: classes/Gems/Default/OrganizationAction.php:132
#: classes/Gems/Default/RespondentAction.php:175
+#: classes/Gems/Default/StaffAction.php:294
msgid "Language"
msgstr "Language"
@@ -1564,6 +1558,7 @@
msgstr "This can not be changed yet"
#: classes/Gems/Default/OrganizationAction.php:169
+#: classes/Gems/Default/StaffAction.php:119
msgid "User Definition"
msgstr "User Definition"
@@ -2095,6 +2090,10 @@
msgid "User with id %s already exists but is deleted, do you want to reactivate the account?"
msgstr "User with id %s already exists but is deleted, do you want to reactivate the account?"
+#: classes/Gems/Default/StaffAction.php:270
+msgid "Username"
+msgstr "Username"
+
#: classes/Gems/Default/StaffAction.php:285
msgid "Primary function"
msgstr "Primary function"
@@ -3610,37 +3609,32 @@
msgid "Shared secret"
msgstr "Shared secret"
-#: classes/Gems/User/User.php:408
+#: classes/Gems/User/User.php:392
#, php-format
msgid "Your account is temporarily blocked, please wait a minute."
msgid_plural "Your account is temporarily blocked, please wait %d minutes."
msgstr[0] "Your account is temporarily blocked, please wait a minute."
msgstr[1] "Your account is temporarily blocked, please wait %d minutes."
-#: classes/Gems/User/User.php:443
+#: classes/Gems/User/User.php:427
msgid "You are not allowed to login from this location."
msgstr "You are not allowed to login from this location."
-#: classes/Gems/User/User.php:1094
+#: classes/Gems/User/User.php:1078
msgid "Your birthday"
msgstr "Your birthday"
-#: classes/Gems/User/User.php:1110
+#: classes/Gems/User/User.php:1094
#: classes/Gems/User/Form/ChangePasswordForm.php:163
#, php-format
msgid "%s is not correct."
msgstr "%s is not correct."
-#: classes/Gems/User/User.php:1115
-#: classes/Gems/User/Form/OrganizationFormAbstract.php:230
-msgid "Username"
-msgstr "Username"
-
-#: classes/Gems/User/User.php:1192
+#: classes/Gems/User/User.php:1176
msgid "Trying to send a password reset to a user that cannot be reset."
msgstr "Trying to send a password reset to a user that cannot be reset."
-#: classes/Gems/User/User.php:1220
+#: classes/Gems/User/User.php:1204
msgid "Unable to send e-mail."
msgstr "Unable to send e-mail."
@@ -3998,24 +3992,19 @@
msgstr "Edit track"
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:172
-#: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:143
-#: snippets/DeleteTrackTokenSnippet.php:193
msgid "Edit token"
msgstr "Edit token"
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:225
-#: snippets/DeleteTrackTokenSnippet.php:245
#, php-format
msgid "Redo of token %s."
msgstr "Redo of token %s."
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:228
-#: snippets/DeleteTrackTokenSnippet.php:248
msgid "Old comment:"
msgstr "Old comment:"
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:249
-#: snippets/DeleteTrackTokenSnippet.php:269
#, php-format
msgid "Created replacement token %2$s for token %1$s."
msgstr "Created replacement token %2$s for token %1$s."
@@ -4042,6 +4031,7 @@
msgstr "Lists choices changed."
#: snippets/EditSingleSurveyTokenSnippet.php:132
+#: snippets/ShowSingleSurveyTokenSnippet.php:150
msgid "Show survey"
msgstr "Show survey"
@@ -4092,7 +4082,6 @@
msgstr "Selected surveys"
#: snippets/ShowSingleSurveyTokenSnippet.php:76
-#: snippets/ShowTrackTokenSnippet.php:77
msgid "Actions"
msgstr "Actions"
@@ -4179,39 +4168,42 @@
msgid "Can access"
msgstr "Can access"
-#: snippets/Track/Token/ShowFirstOpenSnippet.php:110
+#: snippets/Track/Token/ShowFirstOpenSnippet.php:111
#, php-format
msgid "Welcome %s,"
msgstr "Welcome %s,"
-#: snippets/Track/Token/ShowFirstOpenSnippet.php:113
+#: snippets/Track/Token/ShowFirstOpenSnippet.php:114
#, php-format
msgid "Thank you for answering the \"%s\" survey."
msgstr "Thank you for answering the \"%s\" survey."
-#: snippets/Track/Token/ShowFirstOpenSnippet.php:114
+#: snippets/Track/Token/ShowFirstOpenSnippet.php:115
msgid "Please click the button below to answer the next survey."
msgstr "Please click the button below to answer the next survey."
-#: snippets/Track/Token/ShowFirstOpenSnippet.php:119
+#: snippets/Track/Token/ShowFirstOpenSnippet.php:120
#, php-format
msgid "Please click the button below to answer the survey for token %s."
msgstr "Please click the button below to answer the survey for token %s."
-#: snippets/Track/Token/ShowFirstOpenSnippet.php:123
+#: snippets/Track/Token/ShowFirstOpenSnippet.php:124
#, php-format
msgid "Wait one second to open the survey automatically or click on Cancel to stop."
msgid_plural "Wait %d seconds to open the survey automatically or click on Cancel to stop."
msgstr[0] "Wait one second to open the survey automatically or click on Cancel to stop."
msgstr[1] "Wait %d seconds to open the survey automatically or click on Cancel to stop."
-#: snippets/Track/Token/ShowFirstOpenSnippet.php:138
+#: snippets/Track/Token/ShowFirstOpenSnippet.php:139
#, php-format
msgid "After this survey there is one other survey we would like you to answer."
msgid_plural "After this survey there are another %d surveys we would like you to answer."
msgstr[0] "After this survey there is one other survey we would like you to answer."
msgstr[1] "After this survey there are another %d surveys we would like you to answer."
+#~ msgid "Combination of organization, username and password not found."
+#~ msgstr "Combination of organization, username and password not found."
+
#~ msgid "Dear {greeting},"
#~ msgstr "Dear {greeting},"
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-04-24 14:01:21 UTC (rev 634)
+++ trunk/library/languages/default-nl.po 2012-04-25 14:43:30 UTC (rev 635)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-12 15:06+0100\n"
+"POT-Creation-Date: 2012-04-25 16:16+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -18,77 +18,77 @@
"X-Poedit-KeywordsList: plural:1,2\n"
"X-Poedit-SearchPath-0: .\n"
-#: classes/GemsEscort.php:211
+#: classes/GemsEscort.php:212
#, php-format
msgid "Path %s not writable"
msgstr "Path %s niet schrijfbaar"
-#: classes/GemsEscort.php:745
+#: classes/GemsEscort.php:750
#, php-format
msgid "You are logged in as %s"
msgstr "Ingelogd als %s"
-#: classes/GemsEscort.php:747
+#: classes/GemsEscort.php:752
#: classes/Gems/Menu.php:249
msgid "Logoff"
msgstr "Uitloggen"
-#: classes/GemsEscort.php:750
+#: classes/GemsEscort.php:755
msgid "You are not logged in"
msgstr "U bent niet ingelogd"
-#: classes/GemsEscort.php:934
+#: classes/GemsEscort.php:939
#, php-format
msgid "User: %s"
msgstr "Login: %s"
-#: classes/GemsEscort.php:959
+#: classes/GemsEscort.php:964
msgid "version"
msgstr "versie"
-#: classes/GemsEscort.php:1390
+#: classes/GemsEscort.php:1395
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:1521
+#: classes/GemsEscort.php:1526
msgid "Please check back later."
msgstr "Probeer het later opnieuw."
-#: classes/GemsEscort.php:1523
-#: classes/GemsEscort.php:1527
#: classes/GemsEscort.php:1528
+#: classes/GemsEscort.php:1532
+#: classes/GemsEscort.php:1533
msgid "System is in maintenance mode"
msgstr "Systeem is in onderhoudsmodus"
-#: classes/GemsEscort.php:1538
+#: classes/GemsEscort.php:1543
msgid "No access to site."
msgstr "Geen toegang tot website."
-#: classes/GemsEscort.php:1540
-#: classes/GemsEscort.php:1582
+#: classes/GemsEscort.php:1545
+#: classes/GemsEscort.php:1587
msgid "You have no access to this site."
msgstr "U heeft geen toegang tot deze website."
-#: classes/GemsEscort.php:1556
+#: classes/GemsEscort.php:1561
msgid "No access to page"
msgstr "Geen toegang tot pagina"
-#: classes/GemsEscort.php:1558
+#: classes/GemsEscort.php:1563
#, 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:1568
-#: classes/GemsEscort.php:1580
+#: classes/GemsEscort.php:1573
+#: classes/GemsEscort.php:1585
msgid "You are no longer logged in."
msgstr "U bent niet meer ingelogd."
-#: classes/GemsEscort.php:1569
+#: classes/GemsEscort.php:1574
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:1714
+#: classes/GemsEscort.php:1716
#, php-format
msgid "%d survey"
msgid_plural "%d surveys"
@@ -99,10 +99,6 @@
msgid "Database needs to be updated!"
msgstr "Database dient ververst te worden!"
-#: classes/Gems/Auth.php:235
-msgid "Combination of organization, username and password not found."
-msgstr "Combinatie van organisatie, gebruikersnaam en wachtwoord niet gevonden."
-
#: classes/Gems/Html.php:154
msgid "<< First"
msgstr "<< Eerste"
@@ -450,13 +446,11 @@
msgstr "Probeert upgrade voor %s naar niveau %s: %s"
#: classes/Gems/Controller/BrowseEditAction.php:354
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:226
#, php-format
msgid "New %s..."
msgstr "Nieuwe %s..."
#: classes/Gems/Controller/BrowseEditAction.php:387
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:246
#, php-format
msgid "Delete %s"
msgstr "Verwijder %s"
@@ -485,7 +479,6 @@
msgstr "Geen %s gevonden"
#: classes/Gems/Controller/BrowseEditAction.php:673
-#: classes/Gems/Default/ExportAction.php:234
#, php-format
msgid "No %s found."
msgstr "Geen %s gevonden."
@@ -495,14 +488,10 @@
msgstr "Weet u het zeker?"
#: classes/Gems/Controller/BrowseEditAction.php:807
-#: classes/Gems/Default/DatabaseAction.php:187
-#: classes/Gems/Default/DatabaseAction.php:499
msgid "Yes"
msgstr "Ja"
#: classes/Gems/Controller/BrowseEditAction.php:808
-#: classes/Gems/Default/DatabaseAction.php:188
-#: classes/Gems/Default/DatabaseAction.php:500
msgid "No"
msgstr "Nee"
@@ -548,31 +537,31 @@
msgid "Cancel"
msgstr "Annuleren"
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:236
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:238
#, php-format
msgid "Do you want to delete this %s?"
msgstr "Weet u zeker dat deze %s verwijderd moet worden?"
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:256
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:258
#, php-format
msgid "Edit %s..."
msgstr "Bewerk %s..."
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:269
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:271
msgid "No data found."
msgstr "Geen gegevens gevonden."
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:331
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:333
#, php-format
msgid "No %s found..."
msgstr "Geen %s gevonden..."
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:341
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:343
#, php-format
msgid "Showing %s"
msgstr "Toon %s"
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:377
+#: classes/Gems/Controller/ModelSnippetActionAbstract.php:379
msgid "item"
msgid_plural "items"
msgstr[0] "item"
@@ -616,22 +605,22 @@
msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
msgstr "Er wordt geen verschil gemaakt tussen het getal nul en de letter O en ook niet tussen het getal één en de letter L."
-#: classes/Gems/Default/AskAction.php:131
+#: classes/Gems/Default/AskAction.php:132
#, php-format
msgid "Thank you for answering. At the moment we have no further surveys for you to take."
msgstr "Dank u voor uw antwoorden. Op dit moment hebben we geen vragenlijsten meer voor u."
-#: classes/Gems/Default/AskAction.php:133
+#: classes/Gems/Default/AskAction.php:134
#, php-format
msgid "The survey for token %s has been answered and no further surveys are open."
msgstr "De vragenlijst met het kenmerk %s is beantwoord en er staan verder geen vragenlijsten open."
-#: classes/Gems/Default/AskAction.php:140
+#: classes/Gems/Default/AskAction.php:141
#, php-format
msgid "The token %s does not exist (any more)."
msgstr "Het kenmerk %s bestaat niet (meer)."
-#: classes/Gems/Default/AskAction.php:241
+#: classes/Gems/Default/AskAction.php:270
#, php-format
msgid "The survey for token %s is no longer active."
msgstr "De vragenlijst voor kenmerk %s is niet meer in gebruik."
@@ -1196,6 +1185,7 @@
msgstr "Datum"
#: classes/Gems/Default/LogAction.php:191
+#: classes/Gems/Default/LogMaintenanceAction.php:52
msgid "Action"
msgstr "Actie"
@@ -1212,6 +1202,7 @@
msgstr "IP adres"
#: classes/Gems/Default/LogAction.php:209
+#: classes/Gems/Default/LogMaintenanceAction.php:53
msgid "Log"
msgstr "Logboek"
@@ -1421,6 +1412,8 @@
msgstr "Email servers"
#: classes/Gems/Default/MailTemplateAction.php:76
+#: classes/Gems/Default/StaffAction.php:278
+#: classes/Gems/Default/StaffAction.php:311
msgid "(all organizations)"
msgstr "(alle organisaties)"
@@ -1445,6 +1438,7 @@
#: classes/Gems/Default/OptionAction.php:136
#: classes/Gems/Default/OrganizationAction.php:132
#: classes/Gems/Default/RespondentAction.php:175
+#: classes/Gems/Default/StaffAction.php:294
msgid "Language"
msgstr "Taal"
@@ -1564,6 +1558,7 @@
msgstr "Dit kan nog niet gewijzigd worden"
#: classes/Gems/Default/OrganizationAction.php:169
+#: classes/Gems/Default/StaffAction.php:119
msgid "User Definition"
msgstr "User Definition"
@@ -2095,6 +2090,10 @@
msgid "User with id %s already exists but is deleted, do you want to reactivate the account?"
msgstr "Gebruiker met inlognaam %s bestaat al maar is verwijderd, wilt u het account opnieuw activeren?"
+#: classes/Gems/Default/StaffAction.php:270
+msgid "Username"
+msgstr "Gebruikersnaam"
+
#: classes/Gems/...
[truncated message content] |
|
From: <gem...@li...> - 2012-04-26 11:36:48
|
Revision: 638
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=638&view=rev
Author: matijsdejong
Date: 2012-04-26 11:36:37 +0000 (Thu, 26 Apr 2012)
Log Message:
-----------
Bugfixes for Organization.php and OnClickArrayAttribute.php
Fix for #12 screen where patients return
Modified Paths:
--------------
trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php
trunk/library/classes/Gems/User/Organization.php
trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php
trunk/library/languages/default-en.mo
trunk/library/languages/default-en.po
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Added Paths:
-----------
trunk/library/snippets/Track/Token/ShowAllOpenSnippet.php
Modified: trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php 2012-04-26 09:10:32 UTC (rev 637)
+++ trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php 2012-04-26 11:36:37 UTC (rev 638)
@@ -47,6 +47,12 @@
class Gems_Tracker_Snippets_ShowTokenLoopAbstract extends MUtil_Snippets_SnippetAbstract
{
/**
+ * General date format
+ * @var string
+ */
+ protected $dateFormat = 'd MMMM yyyy';
+
+ /**
* Required
*
* @var Zend_Controller_Request_Abstract
@@ -95,6 +101,70 @@
}
/**
+ * Formats an completion date for this display
+ *
+ * @param MUtil_Date $dateTime
+ * @return string
+ */
+ public function formatCompletion(MUtil_Date $dateTime)
+ {
+ $days = abs($dateTime->diffDays());
+
+ switch ($days) {
+ case 0:
+ return $this->_('We have received your answers today. Thank you!');
+
+ case 1:
+ return $this->_('We have received your answers yesterday. Thank you!');
+
+ case 2:
+ return $this->_('We have received your answers 2 days ago. Thank you.');
+
+ default:
+ if ($days <= 14) {
+ return sprintf($this->_('We have received your answers %d days ago. Thank you.'), $days);
+ }
+ return sprintf($this->_('We have received your answers on %s. '), $dateTime->toString($this->dateFormat));
+ }
+ }
+
+ /**
+ * Formats an until date for this display
+ *
+ * @param MUtil_Date $dateTime
+ * @return string
+ */
+ public function formatUntil(MUtil_Date $dateTime = null)
+ {
+ if (null === $dateTime) {
+ return $this->_('This survey has no set time limit.');
+ }
+
+ $days = $dateTime->diffDays();
+
+ switch ($days) {
+ case 0:
+ return array(MUtil_Html::create('strong', $this->_('Warning!!!')), ' ', $this->_('This survey must be answered today!'));
+
+ case 1:
+ return array(MUtil_Html::create('strong', $this->_('Warning!!')), ' ', $this->_('This survey must be answered tomorrow!'));
+
+ case 2:
+ return $this->_('Warning! This survey must be answered over 2 days!');
+
+ default:
+ if (abs($days) <= 14) {
+ if ($days >= 0) {
+ return sprintf($this->_('This survey must be answered in %d days.'), $days);
+ } else {
+ return $this->_('This survey can no longer be answered.');
+ }
+ }
+ return sprintf($this->_('This survey can be answered until %s.'), $dateTime->toString($this->dateFormat));
+ }
+ }
+
+ /**
* Get the href for a token
*
* @param Gems_Tracker_Token $token
Modified: trunk/library/classes/Gems/User/Organization.php
===================================================================
--- trunk/library/classes/Gems/User/Organization.php 2012-04-26 09:10:32 UTC (rev 637)
+++ trunk/library/classes/Gems/User/Organization.php 2012-04-26 11:36:37 UTC (rev 638)
@@ -340,7 +340,7 @@
$organizationId = $this->getId();
if (! Gems_Cookies::setOrganization($organizationId, $this->basepath->getBasePath())) {
- throw new Exception($this->translate->_('Cookies must be enabled for this site.'));
+ throw new Exception('Cookies must be enabled for this site.');
}
$escort = GemsEscort::getInstance();
Modified: trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php
===================================================================
--- trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php 2012-04-26 09:10:32 UTC (rev 637)
+++ trunk/library/classes/MUtil/Html/OnClickArrayAttribute.php 2012-04-26 11:36:37 UTC (rev 638)
@@ -95,9 +95,14 @@
*/
public function addUrl($href)
{
- $this->add("location.href='");
- $this->add($href);
- $this->add("';");
+ $last = is_array($this->_values) ? end($this->_values) : null;
+ if (false === strpos($last, 'location.href')) {
+ $this->_values[] = "location.href='";
+ $this->_values[] = $href;
+ $this->_values[] = "';";
+ } else {
+ $this->_values[] = $href;
+ }
return $this;
}
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-04-26 09:10:32 UTC (rev 637)
+++ trunk/library/languages/default-en.po 2012-04-26 11:36:37 UTC (rev 638)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-25 16:16+0100\n"
+"POT-Creation-Date: 2012-04-26 13:30+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -3375,6 +3375,66 @@
msgid "Next >"
msgstr "Next >"
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:115
+msgid "We have received your answers today. Thank you!"
+msgstr "We have received your answers today. Thank you!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:118
+msgid "We have received your answers yesterday. Thank you!"
+msgstr "We have received your answers yesterday. Thank you!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:121
+msgid "We have received your answers 2 days ago. Thank you."
+msgstr "We have received your answers 2 days ago. Thank you."
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:125
+#, php-format
+msgid "We have received your answers %d days ago. Thank you."
+msgstr "We have received your answers %d days ago. Thank you."
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:127
+#, php-format
+msgid "We have received your answers on %s. "
+msgstr "We have received your answers on %s. "
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:140
+msgid "This survey has no set time limit."
+msgstr "This survey has no set time limit."
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:147
+msgid "Warning!!!"
+msgstr "Warning!!!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:147
+msgid "This survey must be answered today!"
+msgstr "This survey must be answered today!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:150
+msgid "Warning!!"
+msgstr "Warning!!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:150
+msgid "This survey must be answered tomorrow!"
+msgstr "This survey must be answered tomorrow!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:153
+msgid "Warning! This survey must be answered over 2 days!"
+msgstr "Warning! This survey must be answered over 2 days!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:158
+#, php-format
+msgid "This survey must be answered in %d days."
+msgstr "This survey must be answered in %d days."
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:160
+msgid "This survey can no longer be answered."
+msgstr "This survey can no longer be answered."
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:163
+#, php-format
+msgid "This survey can be answered until %s."
+msgstr "This survey can be answered until %s."
+
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:376
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1156
#, php-format
@@ -3545,10 +3605,6 @@
msgid "Unknown token."
msgstr "Unknown token."
-#: classes/Gems/User/Organization.php:342
-msgid "Cookies must be enabled for this site."
-msgstr "Cookies must be enabled for this site."
-
#: classes/Gems/User/PasswordChecker.php:95
#, php-format
msgid "should contain at least one uppercase character"
@@ -3992,19 +4048,24 @@
msgstr "Edit track"
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:172
+#: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:143
+#: snippets/DeleteTrackTokenSnippet.php:193
msgid "Edit token"
msgstr "Edit token"
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:225
+#: snippets/DeleteTrackTokenSnippet.php:245
#, php-format
msgid "Redo of token %s."
msgstr "Redo of token %s."
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:228
+#: snippets/DeleteTrackTokenSnippet.php:248
msgid "Old comment:"
msgstr "Old comment:"
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:249
+#: snippets/DeleteTrackTokenSnippet.php:269
#, php-format
msgid "Created replacement token %2$s for token %1$s."
msgstr "Created replacement token %2$s for token %1$s."
@@ -4031,7 +4092,6 @@
msgstr "Lists choices changed."
#: snippets/EditSingleSurveyTokenSnippet.php:132
-#: snippets/ShowSingleSurveyTokenSnippet.php:150
msgid "Show survey"
msgstr "Show survey"
@@ -4082,6 +4142,7 @@
msgstr "Selected surveys"
#: snippets/ShowSingleSurveyTokenSnippet.php:76
+#: snippets/ShowTrackTokenSnippet.php:77
msgid "Actions"
msgstr "Actions"
@@ -4168,16 +4229,42 @@
msgid "Can access"
msgstr "Can access"
+#: snippets/Track/Token/ShowAllOpenSnippet.php:89
#: snippets/Track/Token/ShowFirstOpenSnippet.php:111
#, php-format
msgid "Welcome %s,"
msgstr "Welcome %s,"
+#: snippets/Track/Token/ShowAllOpenSnippet.php:94
#: snippets/Track/Token/ShowFirstOpenSnippet.php:114
#, php-format
msgid "Thank you for answering the \"%s\" survey."
msgstr "Thank you for answering the \"%s\" survey."
+#: snippets/Track/Token/ShowAllOpenSnippet.php:152
+#, php-format
+msgid " (%s)"
+msgstr " (%s)"
+
+#: snippets/Track/Token/ShowAllOpenSnippet.php:160
+#, php-format
+msgid "Round: %s"
+msgstr "Round: %s"
+
+#: snippets/Track/Token/ShowAllOpenSnippet.php:188
+msgid "Please answer the open survey."
+msgid_plural "Please answer the open surveys."
+msgstr[0] "Please answer the open survey."
+msgstr[1] "Please answer the open surveys."
+
+#: snippets/Track/Token/ShowAllOpenSnippet.php:190
+msgid "Thank you for answering all open surveys."
+msgstr "Thank you for answering all open surveys."
+
+#: snippets/Track/Token/ShowAllOpenSnippet.php:193
+msgid "There are no surveys to show for this token."
+msgstr "There are no surveys to show for this token."
+
#: snippets/Track/Token/ShowFirstOpenSnippet.php:115
msgid "Please click the button below to answer the next survey."
msgstr "Please click the button below to answer the next survey."
@@ -4201,6 +4288,9 @@
msgstr[0] "After this survey there is one other survey we would like you to answer."
msgstr[1] "After this survey there are another %d surveys we would like you to answer."
+#~ msgid "Cookies must be enabled for this site."
+#~ msgstr "Cookies must be enabled for this site."
+
#~ msgid "Combination of organization, username and password not found."
#~ msgstr "Combination of organization, username and password not found."
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-04-26 09:10:32 UTC (rev 637)
+++ trunk/library/languages/default-nl.po 2012-04-26 11:36:37 UTC (rev 638)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-25 16:16+0100\n"
+"POT-Creation-Date: 2012-04-26 13:31+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -3375,6 +3375,66 @@
msgid "Next >"
msgstr "Verder >"
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:115
+msgid "We have received your answers today. Thank you!"
+msgstr "We hebben uw vragenlijst vandaag ingevuld ontvangen. Dank u wel!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:118
+msgid "We have received your answers yesterday. Thank you!"
+msgstr "We hebben uw vragenlijst gisteren ingevuld ontvangen. Dank u wel!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:121
+msgid "We have received your answers 2 days ago. Thank you."
+msgstr "We hebben uw vragenlijst eergisteren ingevuld ontvangen. Dank u wel."
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:125
+#, php-format
+msgid "We have received your answers %d days ago. Thank you."
+msgstr "We hebben uw vragenlijst %d dagen geleden ingevuld ontvangen. Dank u wel."
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:127
+#, php-format
+msgid "We have received your answers on %s. "
+msgstr "We hebben uw vragenlijst op %s ingevuld ontvangen."
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:140
+msgid "This survey has no set time limit."
+msgstr "Deze vragenlijst heeft geen eindtijd."
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:147
+msgid "Warning!!!"
+msgstr "Let op!!!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:147
+msgid "This survey must be answered today!"
+msgstr "Deze vragenlijst moet vandaag ingevuld zijn!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:150
+msgid "Warning!!"
+msgstr "Let op!!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:150
+msgid "This survey must be answered tomorrow!"
+msgstr "Deze vragenlijst moet morgen ingevuld zijn!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:153
+msgid "Warning! This survey must be answered over 2 days!"
+msgstr "Let op! Deze vragenlijst moet overmorgen ingevuld zijn!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:158
+#, php-format
+msgid "This survey must be answered in %d days."
+msgstr "Deze vragenlijst moet binnen %d dagen ingevuld zijn!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:160
+msgid "This survey can no longer be answered."
+msgstr "Deze vragenlijst kan niet langer worden ingevuld!"
+
+#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:163
+#, php-format
+msgid "This survey can be answered until %s."
+msgstr "Deze vragenlijst moet ingevuld worden voor %s."
+
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:376
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1156
#, php-format
@@ -3545,10 +3605,6 @@
msgid "Unknown token."
msgstr "Onbekend kenmerk."
-#: classes/Gems/User/Organization.php:342
-msgid "Cookies must be enabled for this site."
-msgstr "Zonder cookies heeft u geen toegang tot deze site."
-
#: classes/Gems/User/PasswordChecker.php:95
#, php-format
msgid "should contain at least one uppercase character"
@@ -3992,19 +4048,24 @@
msgstr "Bewerk traject"
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:172
+#: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:143
+#: snippets/DeleteTrackTokenSnippet.php:193
msgid "Edit token"
msgstr "Kenmerk bewerken"
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:225
+#: snippets/DeleteTrackTokenSnippet.php:245
#, php-format
msgid "Redo of token %s."
msgstr "Herkansing voor kenmerk %s."
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:228
+#: snippets/DeleteTrackTokenSnippet.php:248
msgid "Old comment:"
msgstr "Oude opmerkingen"
#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:249
+#: snippets/DeleteTrackTokenSnippet.php:269
#, php-format
msgid "Created replacement token %2$s for token %1$s."
msgstr "Kenmerk %s is vervangen door het nieuwe kenmerk %s."
@@ -4031,7 +4092,6 @@
msgstr "Keuzelijst is veranderd."
#: snippets/EditSingleSurveyTokenSnippet.php:132
-#: snippets/ShowSingleSurveyTokenSnippet.php:150
msgid "Show survey"
msgstr "Toon vragenlijst"
@@ -4082,6 +4142,7 @@
msgstr "Geselecteerde vragenlijsten"
#: snippets/ShowSingleSurveyTokenSnippet.php:76
+#: snippets/ShowTrackTokenSnippet.php:77
msgid "Actions"
msgstr "Acties"
@@ -4168,16 +4229,42 @@
msgid "Can access"
msgstr "Toegang tot"
+#: snippets/Track/Token/ShowAllOpenSnippet.php:89
#: snippets/Track/Token/ShowFirstOpenSnippet.php:111
#, php-format
msgid "Welcome %s,"
msgstr "Welkom %s,"
+#: snippets/Track/Token/ShowAllOpenSnippet.php:94
#: snippets/Track/Token/ShowFirstOpenSnippet.php:114
#, php-format
msgid "Thank you for answering the \"%s\" survey."
msgstr "Dank u voor het invullen van de \"%s\" vragenlijst."
+#: snippets/Track/Token/ShowAllOpenSnippet.php:152
+#, php-format
+msgid " (%s)"
+msgstr " (%s)"
+
+#: snippets/Track/Token/ShowAllOpenSnippet.php:160
+#, php-format
+msgid "Round: %s"
+msgstr "Ronde: %s"
+
+#: snippets/Track/Token/ShowAllOpenSnippet.php:188
+msgid "Please answer the open survey."
+msgid_plural "Please answer the open surveys."
+msgstr[0] "Wij verzoeken u de openstaande vragenlijst nu in te vullen."
+msgstr[1] "Wij verzoeken u de openstaande vragenlijsten nu in te vullen."
+
+#: snippets/Track/Token/ShowAllOpenSnippet.php:190
+msgid "Thank you for answering all open surveys."
+msgstr "Dank u voor het beantwoorden van alle openstaande vragenlijsten."
+
+#: snippets/Track/Token/ShowAllOpenSnippet.php:193
+msgid "There are no surveys to show for this token."
+msgstr "U heeft geen open vragenlijsten voor dit kenmerk."
+
#: snippets/Track/Token/ShowFirstOpenSnippet.php:115
msgid "Please click the button below to answer the next survey."
msgstr "Klik op de onderstaande knop om de volgende vragenlijst in te vullen."
@@ -4201,6 +4288,9 @@
msgstr[0] "Na deze vragenlijst hebben we nog één andere vragenlijst voor u."
msgstr[1] "Na deze vragenlijst hebben we nog %d andere vragenlijsten voor u."
+#~ msgid "Cookies must be enabled for this site."
+#~ msgstr "Zonder cookies heeft u geen toegang tot deze site."
+
#~ msgid "Combination of organization, username and password not found."
#~ msgstr ""
#~ "Combinatie van organisatie, gebruikersnaam en wachtwoord niet gevonden."
Added: trunk/library/snippets/Track/Token/ShowAllOpenSnippet.php
===================================================================
--- trunk/library/snippets/Track/Token/ShowAllOpenSnippet.php (rev 0)
+++ trunk/library/snippets/Track/Token/ShowAllOpenSnippet.php 2012-04-26 11:36:37 UTC (rev 638)
@@ -0,0 +1,203 @@
+<?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 Tracker\Snippets
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @version $id: ShowAllOpenSnippet.php 203 2012-01-01t 12:51:32Z matijs $
+ */
+
+/**
+ *
+ *
+ * @package Gems
+ * @subpackage Tracker\Snippets
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.5.4
+ */
+class Track_Token_ShowAllOpenSnippet extends Gems_Tracker_Snippets_ShowTokenLoopAbstract
+{
+ /**
+ *
+ * @var Zend_Db_Adapter_Abstract
+ */
+ protected $db;
+
+ /**
+ *
+ * @var Gems_Loader
+ */
+ protected $loader;
+
+ /**
+ * Show completed surveys answered in last X hours
+ *
+ * @var int
+ */
+ protected $lookbackInHours = 24;
+
+ /**
+ *
+ * @var Gems_Util
+ */
+ protected $util;
+
+ /**
+ * 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)
+ {
+ $html = $this->getHtmlSequence();
+ $org = $this->token->getOrganization();
+ $tracker = $this->loader->getTracker();
+
+ $html->h3($this->_('Token'));
+ $p = $html->pInfo(sprintf($this->_('Welcome %s,'), $this->token->getRespondentName()));
+ $p->br();
+ $p->br();
+
+ if ($this->wasAnswered) {
+ $html->pInfo(sprintf($this->_('Thank you for answering the "%s" survey.'), $this->token->getSurveyName()));
+ // $html->pInfo($this->_('Please click the button below to answer the next survey.'));
+ } else {
+ if ($welcome = $org->getWelcome()) {
+ $html->pInfo()->raw(MUtil_Markup::render($this->_($welcome), 'Bbcode', 'Html'));
+ }
+ // $html->pInfo(sprintf($this->_('Please click the button below to answer the survey for token %s.'), strtoupper($this->token->getTokenId())));
+ }
+
+ // Only valid or answerd in the last
+ $where = "(gto_completion_time IS NULL AND gto_valid_from <= CURRENT_TIMESTAMP AND (gto_valid_until IS NULL OR gto_valid_until >= CURRENT_TIMESTAMP))";
+
+ // Do we always look back
+ if ($this->lookbackInHours) {
+ $where .= $this->db->quoteInto("OR DATE_ADD(gto_completion_time, INTERVAL ? HOUR) >= CURRENT_TIMESTAMP", $this->lookbackInHours, Zend_Db::INT_TYPE);
+ }
+
+ // We always look back from the entered token
+ if ($this->token->isCompleted()) {
+ $filterTime = $this->token->getCompletionTime();
+ $filterTime->subHour(1);
+ $where .= $this->db->quoteInto(" OR gto_completion_time >= ?", $filterTime->toString('yyyy-MM-dd HH:mm:ss'));
+ }
+
+ // Get the tokens
+ $select = $tracker->getTokenSelect();
+ $select->andReceptionCodes()
+ ->andRespondentTracks()
+ ->andRounds()
+ ->andSurveys()
+ ->andTracks()
+ ->forGroupId($this->token->getSurvey()->getGroupId())
+ ->forRespondent($this->token->getRespondentId(), $this->token->getOrganizationId())
+ ->onlySucces()
+ ->forWhere($where)
+ ->order('gtr_track_type')
+ ->order('gtr_track_name')
+ ->order('gr2t_track_info')
+ ->order('gto_valid_until')
+ ->order('gto_valid_from');
+
+ if ($tokens = $select->fetchAll()) {
+ $currentToken = $this->token->isCompleted() ? false : $this->token->getTokenId();
+ $lastRound = false;
+ $lastTrack = false;
+ $open = 0;
+ $pStart = $html->pInfo();
+
+ foreach ($tokens as $row) {
+ if (('T' == $row['gtr_track_type']) && ($row['gtr_track_name'] !== $lastTrack)) {
+ $lastTrack = $row['gtr_track_name'];
+
+ $div = $html->div();
+ $div->class = 'askTrack';
+ $div->append($this->_('Track'));
+ $div->append(' ');
+ $div->strong($row['gtr_track_name']);
+ if ($row['gr2t_track_info']) {
+ $div->small(sprintf($this->_(' (%s)'), $row['gr2t_track_info']));
+ }
+ }
+
+ if ($row['gto_round_description'] && ($row['gto_round_description'] !== $lastRound)) {
+ $lastRound = $row['gto_round_description'];
+ $div = $html->div();
+ $div->class = 'askRound';
+ $div->append(sprintf($this->_('Round: %s'), $row['gto_round_description']));
+ $div->br();
+ }
+ $token = $tracker->getToken($row);
+
+ $div = $html->div();
+ $div->class = 'askSurvey';
+ if ($token->isCompleted()) {
+ $div->actionDisabled($token->getSurveyName());
+ $div->append(' ');
+ $div->append($this->formatCompletion($token->getCompletionTime()));
+
+ } else {
+ $open++;
+
+ $a = $div->actionLink($this->getTokenHref($token), $token->getSurveyName());
+ $div->append(' ');
+ $div->append($this->formatUntil($token->getValidUntil()));
+
+ if (false === $currentToken) {
+ $currentToken = $token->getTokenId();
+ }
+ if ($token->getTokenId() == $currentToken) {
+ $a->appendAttrib('class', 'currentRow');
+ }
+ }
+ }
+ if ($open) {
+ $pStart->append($this->plural('Please answer the open survey.', 'Please answer the open surveys.', $open));
+ } else {
+ $html->pInfo($this->_('Thank you for answering all open surveys.'));
+ }
+ } else {
+ $html->pInfo($this->_('There are no surveys to show for this token.'));
+ }
+
+ if ($sig = $org->getSignature()) {
+ $p = $html->pInfo();
+ $p->br();
+ $p->raw(MUtil_Markup::render($this->_($sig), 'Bbcode', 'Html'));
+ }
+ return $html;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-05-01 14:30:35
|
Revision: 649
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=649&view=rev
Author: mennodekker
Date: 2012-05-01 14:30:29 +0000 (Tue, 01 May 2012)
Log Message:
-----------
fixed error where project user could not login when db not yet created
Modified Paths:
--------------
trunk/library/classes/Gems/User/ProjectUserDefinition.php
trunk/library/classes/Gems/User/UserLoader.php
trunk/library/configs/db/tables/gems__organizations.20.sql
Modified: trunk/library/classes/Gems/User/ProjectUserDefinition.php
===================================================================
--- trunk/library/classes/Gems/User/ProjectUserDefinition.php 2012-05-01 12:17:24 UTC (rev 648)
+++ trunk/library/classes/Gems/User/ProjectUserDefinition.php 2012-05-01 14:30:29 UTC (rev 649)
@@ -74,6 +74,14 @@
*/
public function getUserData($login_name, $organization)
{
+ try {
+ $orgs = $this->db->fetchPairs("SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active = 1 ORDER BY gor_name");
+ natsort($orgs);
+ } catch (Zend_Db_Exception $zde) {
+ // Table might not exist, so do something failsafe
+ $orgs = array($organization => 'create db first');
+ }
+
return array(
'user_id' => 1,
'user_login' => $login_name,
@@ -84,6 +92,7 @@
'user_base_org_id' => $organization,
'user_allowed_ip_ranges' => $this->project->getSuperAdminIPRanges(),
'user_blockable' => false,
+ '__allowedOrgs' => $orgs
);
}
}
\ No newline at end of file
Modified: trunk/library/classes/Gems/User/UserLoader.php
===================================================================
--- trunk/library/classes/Gems/User/UserLoader.php 2012-05-01 12:17:24 UTC (rev 648)
+++ trunk/library/classes/Gems/User/UserLoader.php 2012-05-01 14:30:29 UTC (rev 649)
@@ -487,12 +487,14 @@
*/
protected function getUserClass($login_name, $organization)
{
+ //First check for project user, as this one can run without a db
+ if ($this->isProjectUser($login_name)) {
+ return $this->loadUser(self::USER_PROJECT, $organization, $login_name);
+ }
+
if ((null == $login_name) || (null == $organization)) {
return $this->loadUser(self::USER_NOLOGIN, $organization, $login_name);
}
- if ($this->isProjectUser($login_name)) {
- return $this->loadUser(self::USER_PROJECT, $organization, $login_name);
- }
try {
$select = $this->getUserClassSelect($login_name, $organization);
Modified: trunk/library/configs/db/tables/gems__organizations.20.sql
===================================================================
--- trunk/library/configs/db/tables/gems__organizations.20.sql 2012-05-01 12:17:24 UTC (rev 648)
+++ trunk/library/configs/db/tables/gems__organizations.20.sql 2012-05-01 14:30:29 UTC (rev 649)
@@ -4,7 +4,7 @@
gor_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null,
gor_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
- gor_user_class varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'StaffUser'
+ gor_user_class varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'StaffUser',
gor_location varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
gor_url varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
gor_url_base varchar(1270) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
@@ -25,7 +25,7 @@
gor_has_login boolean not null default 1,
gor_has_respondents boolean not null default 0,
gor_add_respondents boolean not null default 1,
- gor_respondent_group bigint unsigned references gems__groups (ggp_id_group) null,
+ gor_respondent_group bigint unsigned null references gems__groups (ggp_id_group),
gor_active boolean not null default 1,
gor_changed timestamp not null default current_timestamp on update current_timestamp,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-05-15 08:49:28
|
Revision: 682
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=682&view=rev
Author: mennodekker
Date: 2012-05-15 08:49:17 +0000 (Tue, 15 May 2012)
Log Message:
-----------
Defined some roles for researcher (only for new projects) + fixed bug where login redirect to a container would result in an error
Modified Paths:
--------------
trunk/library/classes/Gems/User/User.php
trunk/library/configs/db/tables/gems__roles.20.sql
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-05-15 08:11:18 UTC (rev 681)
+++ trunk/library/classes/Gems/User/User.php 2012-05-15 08:49:17 UTC (rev 682)
@@ -937,11 +937,21 @@
if ($menuItem) {
// Prevent redirecting to the current page.
if (! ($menuItem->is('controller', $request->getControllerName()) && $menuItem->is('action', $request->getActionName()))) {
- //Probably a debug statement so commented out MD20120308
- //echo $menuItem->get('label') . '<br/>';
+ if (!$menuItem->has('controller')) {
+ //This is a container, try to find first active child
+ $item = $menuItem;
+ foreach ($item->sortByOrder()->getChildren() as $menuItem) {
+ if ($menuItem->isAllowed() && $menuItem->has('controller')) {
+ break;
+ }
+ $menuItem = null;
+ }
+ }
- $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
- $redirector->gotoRoute($menuItem->toRouteUrl($request), null, true);
+ if ($menuItem) {
+ $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
+ $redirector->gotoRoute($menuItem->toRouteUrl($request), null, true);
+ }
}
}
Modified: trunk/library/configs/db/tables/gems__roles.20.sql
===================================================================
--- trunk/library/configs/db/tables/gems__roles.20.sql 2012-05-15 08:11:18 UTC (rev 681)
+++ trunk/library/configs/db/tables/gems__roles.20.sql 2012-05-15 08:49:17 UTC (rev 682)
@@ -31,6 +31,6 @@
('security','security','','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1),
('staff','staff','pr.option.edit,pr.option.password,pr.plan,pr.plan.overview,pr.plan.token,pr.project,pr.project.questions,pr.respondent.create,pr.respondent.edit,pr.respondent.who,pr.setup,pr.staff,pr.survey,pr.survey.create,pr.token,pr.token.answers,pr.token.delete,pr.token.edit,pr.token.mail,pr.token.print,pr.track,pr.track.create,pr.track.delete,pr.track.edit,pr.respondent.reportdeath','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1),
('physician','physician','','staff', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1),
- ('researcher','researcher','pr.invitation,pr.result,pr.islogin','', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1),
+ ('researcher','researcher','pr.project-information.changelog,pr.contact,pr.export,pr.plan.token,pr.plan.respondent,pr.plan.overview,pr.option.password,pr.option.edit,pr.organization-switch,pr.islogin','', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1),
('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.mail.log,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1),
('super','super','pr.consent.delete,pr.country,pr.country.create,pr.country.delete,pr.country.edit,pr.database,pr.database.create,pr.database.delete,pr.database.edit,pr.database.execute,pr.database.patches,pr.group.create,pr.group.edit,pr.language,pr.mail.server,pr.mail.server.create,pr.mail.server.delete,pr.mail.server.edit,pr.organization.create,pr.organization.edit,pr.plan.choose-org,pr.plan.mail-as-application,pr.reception.delete,pr.role.create,pr.role.edit,pr.source.create,pr.source.edit,pr.source.synchronize,pr.source.synchronize-all,pr.staff.edit.all,pr.survey-maintenance.edit,pr.track-maintenance.create,pr.track-maintenance.edit,pr.maintenance','admin', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-05-18 13:56:54
|
Revision: 689
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=689&view=rev
Author: michieltcs
Date: 2012-05-18 13:56:46 +0000 (Fri, 18 May 2012)
Log Message:
-----------
Parse the version of the newly uploaded PDF, throw an error if > 1.4
Modified Paths:
--------------
trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Modified: trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php
===================================================================
--- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-05-18 11:48:24 UTC (rev 688)
+++ trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-05-18 13:56:46 UTC (rev 689)
@@ -242,12 +242,23 @@
}
// Set the value of the field in the database.
+ $data['gsu_survey_pdf'] = null;
$new_name = $data['gsu_id_survey'] . '.pdf';
- if (file_exists($form->new_pdf->getDestination() . DIRECTORY_SEPARATOR . $new_name)) {
+ $pdfSource = $form->new_pdf->getDestination() . DIRECTORY_SEPARATOR . $new_name;
+
+ if (file_exists($pdfSource)) {
+ $objFactory = Zend_Pdf_ElementFactory::createFactory(1);
+ $parser = new Zend_Pdf_Parser($pdfSource, $objFactory, true);
+ $version = $parser->getPDFVersion();
+
+ if (version_compare($version, '1.4', '>')) {
+ $this->addMessage(sprintf($this->_('Unsupported PDF version %s - only versions 1.0 - 1.4 are supported.'), $version));
+ return false;
+ }
+
$data['gsu_survey_pdf'] = $new_name;
- } else {
- $data['gsu_survey_pdf'] = null;
}
+
$data['gtr_track_class'] = 'SingleSurveyEngine';
// feature request #200
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-05-18 11:48:24 UTC (rev 688)
+++ trunk/library/languages/default-nl.po 2012-05-18 13:56:46 UTC (rev 689)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-05-18 13:45+0100\n"
+"POT-Creation-Date: 2012-05-18 15:55+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Michiel Rook <in...@to...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -2305,59 +2305,64 @@
msgid "At the moment this survey can only be assigned to respondents as part of an existing track."
msgstr "Op dit moment kan deze vragenlijst alleen aan patiënten toegewezen als onderdeel van een traject."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:259
+#: classes/Gems/Default/SurveyMaintenanceAction.php:255
+#, php-format
+msgid "Unsupported PDF version %s - only versions 1.0 - 1.4 are supported."
+msgstr "Deze PDF heeft een versie (%s) die niet ondersteund wordt, slechts versies 1.0-1.4 worden ondersteund."
+
+#: classes/Gems/Default/SurveyMaintenanceAction.php:270
msgid "Survey should be assigned to a group before making it active."
msgstr "Vragenlijst moet aan een groep toegewezen worden voordat deze actief kan worden gemaakt."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:276
+#: classes/Gems/Default/SurveyMaintenanceAction.php:287
#, php-format
msgid "Checking survey results for the %s survey."
msgstr "Controle op vragenlijstresultaten voor de vragenlijst '%s'."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:288
+#: classes/Gems/Default/SurveyMaintenanceAction.php:299
msgid "Checking survey results for all surveys."
msgstr "Controle op vragenlijstresultaten voor alle vragenlijsten."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:352
+#: classes/Gems/Default/SurveyMaintenanceAction.php:363
msgid "Source"
msgstr "Bron"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:353
+#: classes/Gems/Default/SurveyMaintenanceAction.php:364
msgid "Status in source"
msgstr "Status in bron"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:356
+#: classes/Gems/Default/SurveyMaintenanceAction.php:367
msgid "Active in source"
msgstr "Actief in bron"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:357
+#: classes/Gems/Default/SurveyMaintenanceAction.php:368
#, php-format
msgid "Active in %s"
msgstr "Actief in %s"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:364
+#: classes/Gems/Default/SurveyMaintenanceAction.php:375
msgid "Single"
msgstr "Los"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:368
+#: classes/Gems/Default/SurveyMaintenanceAction.php:379
msgid "Group"
msgstr "Groep"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:397
+#: classes/Gems/Default/SurveyMaintenanceAction.php:408
#, php-format
msgid "%d times in track."
msgstr "%d keer in traject."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:399
+#: classes/Gems/Default/SurveyMaintenanceAction.php:410
#, php-format
msgid "%d times in %d track(s)."
msgstr "%d keer in %d traject(en)."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:403
+#: classes/Gems/Default/SurveyMaintenanceAction.php:414
msgid "Not used in track."
msgstr "Niet in traject gebruikt."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:405
+#: classes/Gems/Default/SurveyMaintenanceAction.php:416
msgid "Not used in tracks."
msgstr "Niet in trajecten gebruikt."
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-05-29 15:19:17
|
Revision: 703
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=703&view=rev
Author: michieltcs
Date: 2012-05-29 15:19:06 +0000 (Tue, 29 May 2012)
Log Message:
-----------
Add maximum number of reminders to mail job configuration
Modified Paths:
--------------
trunk/library/classes/Gems/Default/CronAction.php
trunk/library/classes/Gems/Default/MailJobAction.php
trunk/library/classes/Gems/Email/TemplateMailer.php
trunk/library/configs/db/patches.sql
Modified: trunk/library/classes/Gems/Default/CronAction.php
===================================================================
--- trunk/library/classes/Gems/Default/CronAction.php 2012-05-29 14:55:54 UTC (rev 702)
+++ trunk/library/classes/Gems/Default/CronAction.php 2012-05-29 15:19:06 UTC (rev 703)
@@ -182,6 +182,7 @@
$filter = $this->defaultFilter;
if ($job['gmj_filter_mode'] == 'R') {
$filter[] = 'gto_mail_sent_date <= DATE_SUB(CURRENT_DATE, INTERVAL ' . $job['gmj_filter_days_between'] . ' DAY)';
+ $filter[] = 'gto_mail_sent_num < ' . $job['gmj_filter_max_reminders'];
} else {
$filter['gto_mail_sent_date'] = NULL;
}
Modified: trunk/library/classes/Gems/Default/MailJobAction.php
===================================================================
--- trunk/library/classes/Gems/Default/MailJobAction.php 2012-05-29 14:55:54 UTC (rev 702)
+++ trunk/library/classes/Gems/Default/MailJobAction.php 2012-05-29 15:19:06 UTC (rev 703)
@@ -92,6 +92,7 @@
$model->set('gmj_process_method', 'label', $this->_('Processing Method'), 'default', 'O', 'multiOptions', $translated->getBulkMailProcessOptions());
$model->set('gmj_filter_mode', 'label', $this->_('Filter for'), 'multiOptions', $unselected + $this->getBulkMailFilterOptions());
$model->set('gmj_filter_days_between', 'label', $this->_('Days between reminders'), 'validators[]', 'Digits');
+ $model->set('gmj_filter_max_reminders','label', $this->_('Maximum number of reminders'), 'validators[]', 'Digits');
if ($detailed) {
$model->set('gmj_id_organization', 'label', $this->_('Organization'), 'multiOptions', $empty + $dbLookup->getOrganizations());
Modified: trunk/library/classes/Gems/Email/TemplateMailer.php
===================================================================
--- trunk/library/classes/Gems/Email/TemplateMailer.php 2012-05-29 14:55:54 UTC (rev 702)
+++ trunk/library/classes/Gems/Email/TemplateMailer.php 2012-05-29 15:19:06 UTC (rev 703)
@@ -507,6 +507,7 @@
$db = $this->escort->db;
$uid = $this->escort->getCurrentUserId();
+ $tdata['gto_mail_sent_num'] = new Zend_Db_Expr('gto_mail_sent_num + 1');
$tdata['gto_mail_sent_date'] = $this->_mailDate;
$db->update('gems__tokens', $tdata, $db->quoteInto('gto_id_token = ?', $tokenData['gto_id_token']));
Modified: trunk/library/configs/db/patches.sql
===================================================================
--- trunk/library/configs/db/patches.sql 2012-05-29 14:55:54 UTC (rev 702)
+++ trunk/library/configs/db/patches.sql 2012-05-29 15:19:06 UTC (rev 703)
@@ -400,4 +400,10 @@
ALTER TABLE `gems__organizations` ADD `gor_allowed_ip_ranges` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER `gor_respondent_group`;
--PATCH: organization code no longer needs to be unique
-ALTER TABLE `gems__organizations` DROP INDEX `gor_code` , ADD INDEX `gor_code` ( `gor_code` );
\ No newline at end of file
+ALTER TABLE `gems__organizations` DROP INDEX `gor_code` , ADD INDEX `gor_code` ( `gor_code` );
+
+-- PATCH: Add number of reminders sent to tokens
+ALTER TABLE `gems__tokens` ADD `gto_mail_sent_num` INT(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `gto_mail_sent_date`;
+
+-- PATCH: Add column to store maximum number of reminders (default is 3) to mail jobs
+ALTER TABLE `gems__mail_jobs` ADD `gmj_filter_max_reminders` INT(11) UNSIGNED NOT NULL DEFAULT 3 AFTER `gmj_filter_days_between`;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-05-31 08:11:12
|
Revision: 712
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=712&view=rev
Author: michieltcs
Date: 2012-05-31 08:11:00 +0000 (Thu, 31 May 2012)
Log Message:
-----------
Escape command & arguments, update translations
Modified Paths:
--------------
trunk/library/classes/Gems/Default/RespondentExportAction.php
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Modified: trunk/library/classes/Gems/Default/RespondentExportAction.php
===================================================================
--- trunk/library/classes/Gems/Default/RespondentExportAction.php 2012-05-30 14:16:07 UTC (rev 711)
+++ trunk/library/classes/Gems/Default/RespondentExportAction.php 2012-05-31 08:11:00 UTC (rev 712)
@@ -111,10 +111,11 @@
file_put_contents($tempInputFilename, $content);
- $lastLine = exec($this->_wkhtmltopdfLocation . ' ' . $tempInputFilename . ' ' . $tempOutputFilename, $outputLines, $return);
+ $lastLine = exec(escapeshellcmd($this->_wkhtmltopdfLocation) . ' ' . escapeshellarg($tempInputFilename)
+ . ' ' . escapeshellarg($tempOutputFilename), $outputLines, $return);
if ($return > 0) {
- throw new Exception("Unable to run PDF conversion: {$lastLine}");
+ throw new Exception(sprintf($this->_('Unable to run PDF conversion: "%s"'), $lastLine));
}
$pdfContents = file_get_contents($tempOutputFilename);
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-05-30 14:16:07 UTC (rev 711)
+++ trunk/library/languages/default-nl.po 2012-05-31 08:11:00 UTC (rev 712)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-05-30 16:11+0100\n"
+"POT-Creation-Date: 2012-05-31 10:10+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Michiel Rook <in...@to...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -1559,117 +1559,117 @@
msgid "Excel export"
msgstr "Excel export"
-#: classes/Gems/Menu/MenuAbstract.php:247
+#: classes/Gems/Menu/MenuAbstract.php:250
msgid "Activity log"
msgstr "Activiteit"
-#: classes/Gems/Menu/MenuAbstract.php:253
+#: classes/Gems/Menu/MenuAbstract.php:256
msgid "Automatic mail"
msgstr "Automatische mail"
-#: classes/Gems/Menu/MenuAbstract.php:254
+#: classes/Gems/Menu/MenuAbstract.php:257
msgid "Turn Automatic Mail Jobs OFF"
msgstr "Automatische mail opdrachten UITzetten"
-#: classes/Gems/Menu/MenuAbstract.php:255
+#: classes/Gems/Menu/MenuAbstract.php:258
msgid "Run"
msgstr "Uitvoeren"
-#: classes/Gems/Menu/MenuAbstract.php:258
+#: classes/Gems/Menu/MenuAbstract.php:261
msgid "Servers"
msgstr "Servers"
-#: classes/Gems/Menu/MenuAbstract.php:262
+#: classes/Gems/Menu/MenuAbstract.php:265
msgid "Templates"
msgstr "Sjablonen"
-#: classes/Gems/Menu/MenuAbstract.php:294
+#: classes/Gems/Menu/MenuAbstract.php:297
msgid "By period"
msgstr "Per periode"
-#: classes/Gems/Menu/MenuAbstract.php:295
+#: classes/Gems/Menu/MenuAbstract.php:298
msgid "By token"
msgstr "Per kenmerk"
-#: classes/Gems/Menu/MenuAbstract.php:296
+#: classes/Gems/Menu/MenuAbstract.php:299
msgid "By respondent"
msgstr "Per patiënt"
-#: classes/Gems/Menu/MenuAbstract.php:300
+#: classes/Gems/Menu/MenuAbstract.php:303
msgid "Bulk mail"
msgstr "Bulk mail"
-#: classes/Gems/Menu/MenuAbstract.php:318
+#: classes/Gems/Menu/MenuAbstract.php:321
msgid "Errors"
msgstr "Foutmeldingen"
-#: classes/Gems/Menu/MenuAbstract.php:319
+#: classes/Gems/Menu/MenuAbstract.php:322
msgid "PHP"
msgstr "PHP"
-#: classes/Gems/Menu/MenuAbstract.php:321
+#: classes/Gems/Menu/MenuAbstract.php:324
msgid "Session"
msgstr "Sessie"
-#: classes/Gems/Menu/MenuAbstract.php:322
+#: classes/Gems/Menu/MenuAbstract.php:325
msgid "Maintenance mode"
msgstr "Onderhoudsmodus"
-#: classes/Gems/Menu/MenuAbstract.php:323
+#: classes/Gems/Menu/MenuAbstract.php:326
msgid "Clean cache"
msgstr "Cache opruimen"
-#: classes/Gems/Menu/MenuAbstract.php:390
+#: classes/Gems/Menu/MenuAbstract.php:393
msgid "Reset password"
msgstr "Reset wachtwoord"
-#: classes/Gems/Menu/MenuAbstract.php:415
+#: classes/Gems/Menu/MenuAbstract.php:418
msgid "Survey Sources"
msgstr "Bronnen"
-#: classes/Gems/Menu/MenuAbstract.php:416
+#: classes/Gems/Menu/MenuAbstract.php:419
msgid "Check status"
msgstr "Status controle"
-#: classes/Gems/Menu/MenuAbstract.php:417
+#: classes/Gems/Menu/MenuAbstract.php:420
msgid "Synchronize surveys"
msgstr "Synchroniseer vragenlijsten"
-#: classes/Gems/Menu/MenuAbstract.php:418
-#: classes/Gems/Menu/MenuAbstract.php:430
+#: classes/Gems/Menu/MenuAbstract.php:421
+#: classes/Gems/Menu/MenuAbstract.php:433
msgid "Check answers"
msgstr "Antwoord controle"
-#: classes/Gems/Menu/MenuAbstract.php:419
+#: classes/Gems/Menu/MenuAbstract.php:422
msgid "Check attributes"
msgstr "Controleer attributen"
-#: classes/Gems/Menu/MenuAbstract.php:420
+#: classes/Gems/Menu/MenuAbstract.php:423
msgid "Synchronize all surveys"
msgstr "Synchroniseer alle vragenlijsten"
-#: classes/Gems/Menu/MenuAbstract.php:421
-#: classes/Gems/Menu/MenuAbstract.php:431
+#: classes/Gems/Menu/MenuAbstract.php:424
+#: classes/Gems/Menu/MenuAbstract.php:434
msgid "Check all answers"
msgstr "Controleer alle antwoorden"
-#: classes/Gems/Menu/MenuAbstract.php:427
+#: classes/Gems/Menu/MenuAbstract.php:430
msgid "PDF"
msgstr "PDF"
-#: classes/Gems/Menu/MenuAbstract.php:439
+#: classes/Gems/Menu/MenuAbstract.php:442
msgid "Fields"
msgstr "Velden"
-#: classes/Gems/Menu/MenuAbstract.php:446
+#: classes/Gems/Menu/MenuAbstract.php:449
msgid "Rounds"
msgstr "Rondes"
-#: classes/Gems/Menu/MenuAbstract.php:461
+#: classes/Gems/Menu/MenuAbstract.php:464
msgid "Check assignments"
msgstr "Controleer toewijzingen"
-#: classes/Gems/Menu/MenuAbstract.php:464
+#: classes/Gems/Menu/MenuAbstract.php:467
msgid "Check all assignments"
msgstr "Controleer alle toewijzingen"
@@ -2043,7 +2043,7 @@
#: classes/Gems/Default/GroupAction.php:89
#: classes/Gems/Default/LogAction.php:201
-#: classes/Gems/Default/RoleAction.php:257
+#: classes/Gems/Default/RoleAction.php:238
msgid "Role"
msgstr "Rol"
@@ -2120,31 +2120,36 @@
msgid "Export"
msgstr "Exporteer"
-#: classes/Gems/Default/RespondentExportAction.php:204
+#: classes/Gems/Default/RespondentExportAction.php:118
+#, php-format
+msgid "Unable to run PDF conversion: \"%s\""
+msgstr "Kan PDF conversie niet starten: \"%s\""
+
+#: classes/Gems/Default/RespondentExportAction.php:205
msgid "Track information"
msgstr "Traject informatie"
-#: classes/Gems/Default/RespondentExportAction.php:243
+#: classes/Gems/Default/RespondentExportAction.php:244
msgid "Respondent information"
msgstr "Patiënt informatie"
-#: classes/Gems/Default/RespondentExportAction.php:270
+#: classes/Gems/Default/RespondentExportAction.php:271
msgid "Respondent report"
msgstr "Patiënt rapportage"
-#: classes/Gems/Default/RespondentExportAction.php:274
+#: classes/Gems/Default/RespondentExportAction.php:275
msgid "Report information"
msgstr "Informatie over rapportage"
-#: classes/Gems/Default/RespondentExportAction.php:275
+#: classes/Gems/Default/RespondentExportAction.php:276
msgid "Generated by"
msgstr "Aangemaakt door"
-#: classes/Gems/Default/RespondentExportAction.php:277
+#: classes/Gems/Default/RespondentExportAction.php:278
msgid "Generated on"
msgstr "Aangemaakt op"
-#: classes/Gems/Default/RespondentExportAction.php:318
+#: classes/Gems/Default/RespondentExportAction.php:319
msgid "Export respondent"
msgstr "Exporteer patiënt"
@@ -2590,48 +2595,52 @@
msgid "The survey for token %s is no longer active."
msgstr "De vragenlijst voor kenmerk %s is niet meer in gebruik."
-#: classes/Gems/Default/RoleAction.php:175
+#: classes/Gems/Default/RoleAction.php:94
+#: classes/Gems/Default/RoleAction.php:242
+msgid "Inherited"
+msgstr "Overerfd"
+
+#: classes/Gems/Default/RoleAction.php:156
msgid "Illegal name"
msgstr "Naam niet toegestaan"
-#: classes/Gems/Default/RoleAction.php:199
-#: classes/Gems/Default/RoleAction.php:258
+#: classes/Gems/Default/RoleAction.php:180
+#: classes/Gems/Default/RoleAction.php:239
msgid "Parents"
msgstr "Afgeleid van"
-#: classes/Gems/Default/RoleAction.php:214
+#: classes/Gems/Default/RoleAction.php:195
msgid "Editing `master` is not allowed"
msgstr "Het wijzigen van `master` is niet toegestaan"
-#: classes/Gems/Default/RoleAction.php:232
+#: classes/Gems/Default/RoleAction.php:213
msgid "role"
msgid_plural "roles"
msgstr[0] "Rol"
msgstr[1] "Rollen"
-#: classes/Gems/Default/RoleAction.php:237
+#: classes/Gems/Default/RoleAction.php:218
msgid "Administrative roles"
msgstr "Beheer rollen en rechten"
-#: classes/Gems/Default/RoleAction.php:259
-#: classes/Gems/Default/RoleAction.php:275
+#: classes/Gems/Default/RoleAction.php:240
+#: classes/Gems/Default/RoleAction.php:258
msgid "Allowed"
msgstr "Toegestaan"
-#: classes/Gems/Default/RoleAction.php:260
-#: classes/Gems/Default/RoleAction.php:276
-msgid "Denied"
-msgstr "Geweigerd"
-
-#: classes/Gems/Default/RoleAction.php:264
+#: classes/Gems/Default/RoleAction.php:247
msgid "Project role overview"
msgstr "Project rollen"
-#: classes/Gems/Default/RoleAction.php:274
+#: classes/Gems/Default/RoleAction.php:257
msgid "Privilege"
msgstr "Privilége"
-#: classes/Gems/Default/RoleAction.php:280
+#: classes/Gems/Default/RoleAction.php:259
+msgid "Denied"
+msgstr "Geweigerd"
+
+#: classes/Gems/Default/RoleAction.php:263
msgid "Project privileges"
msgstr "Project priviléges"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-05-31 14:29:17
|
Revision: 721
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=721&view=rev
Author: matijsdejong
Date: 2012-05-31 14:29:05 +0000 (Thu, 31 May 2012)
Log Message:
-----------
Corrections of some spelling mistakes
Modified Paths:
--------------
trunk/library/classes/MUtil/Snippets/SnippetAbstract.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/MUtil/Snippets/SnippetAbstract.php
===================================================================
--- trunk/library/classes/MUtil/Snippets/SnippetAbstract.php 2012-05-31 13:55:24 UTC (rev 720)
+++ trunk/library/classes/MUtil/Snippets/SnippetAbstract.php 2012-05-31 14:29:05 UTC (rev 721)
@@ -37,7 +37,7 @@
/**
* An abstract class for building snippets. Sub classes should override at least
- * getHtmlOutput(0 or render() to generate output.
+ * getHtmlOutput() or render() to generate output.
*
* This class add's to the interface helper variables and functions for:
* - attribute use: $this->attributes, $this->class & applyHtmlAttributes()
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-05-31 13:55:24 UTC (rev 720)
+++ trunk/library/languages/default-en.po 2012-05-31 14:29:05 UTC (rev 721)
@@ -2,9 +2,9 @@
msgstr ""
"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-05-07 11:24+0100\n"
+"POT-Creation-Date: 2012-05-31 16:28+0100\n"
"PO-Revision-Date: \n"
-"Last-Translator: Menno Dekker <men...@er...>\n"
+"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -23,72 +23,72 @@
msgid "Path %s not writable"
msgstr "Path %s not writable"
-#: classes/GemsEscort.php:752
+#: classes/GemsEscort.php:756
#, php-format
msgid "You are logged in as %s"
msgstr "You are logged in as %s"
-#: classes/GemsEscort.php:754
+#: classes/GemsEscort.php:758
#: classes/Gems/Menu.php:249
msgid "Logoff"
msgstr "Logoff"
-#: classes/GemsEscort.php:757
+#: classes/GemsEscort.php:761
msgid "You are not logged in"
msgstr "You are not logged in"
-#: classes/GemsEscort.php:941
+#: classes/GemsEscort.php:945
#, php-format
msgid "User: %s"
msgstr "User: %s"
-#: classes/GemsEscort.php:966
+#: classes/GemsEscort.php:970
msgid "version"
msgstr "version"
-#: classes/GemsEscort.php:1397
+#: classes/GemsEscort.php:1412
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:1528
+#: classes/GemsEscort.php:1543
msgid "Please check back later."
msgstr "Please check back later."
-#: classes/GemsEscort.php:1530
-#: classes/GemsEscort.php:1534
-#: classes/GemsEscort.php:1535
+#: classes/GemsEscort.php:1545
+#: classes/GemsEscort.php:1549
+#: classes/GemsEscort.php:1550
msgid "System is in maintenance mode"
msgstr "System is in maintenance mode"
-#: classes/GemsEscort.php:1545
+#: classes/GemsEscort.php:1560
msgid "No access to site."
msgstr "No access to site."
-#: classes/GemsEscort.php:1547
-#: classes/GemsEscort.php:1589
+#: classes/GemsEscort.php:1562
+#: classes/GemsEscort.php:1605
msgid "You have no access to this site."
msgstr "You have no access to this site."
-#: classes/GemsEscort.php:1563
+#: classes/GemsEscort.php:1578
msgid "No access to page"
msgstr "No access to page"
-#: classes/GemsEscort.php:1565
+#: classes/GemsEscort.php:1580
#, 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:1575
-#: classes/GemsEscort.php:1587
+#: classes/GemsEscort.php:1590
+#: classes/GemsEscort.php:1603
msgid "You are no longer logged in."
msgstr "You are no longer logged in."
-#: classes/GemsEscort.php:1576
+#: classes/GemsEscort.php:1591
msgid "You must login to access this page."
msgstr "You must login to access this page."
-#: classes/GemsEscort.php:1716
-#: classes/GemsEscort.php:1718
+#: classes/GemsEscort.php:1732
+#: classes/GemsEscort.php:1734
#, php-format
msgid "%d survey"
msgid_plural "%d surveys"
@@ -185,7 +185,7 @@
msgstr "Roles"
#: classes/Gems/Menu.php:197
-#: classes/Gems/Menu.php:346
+#: classes/Gems/Menu.php:347
msgid "Assigned"
msgstr "Assigned"
@@ -218,7 +218,7 @@
msgstr "Upgrade"
#: classes/Gems/Menu.php:220
-#: classes/Gems/Menu.php:319
+#: classes/Gems/Menu.php:320
msgid "Show"
msgstr "Show"
@@ -264,147 +264,147 @@
msgstr "Change password"
#: classes/Gems/Menu.php:248
-#: classes/Gems/Menu.php:288
-#: classes/Gems/Menu.php:323
+#: classes/Gems/Menu.php:289
+#: classes/Gems/Menu.php:324
msgid "Token"
msgstr "Token"
-#: classes/Gems/Menu.php:284
+#: classes/Gems/Menu.php:285
msgid "Track"
msgstr "Track"
-#: classes/Gems/Menu.php:291
-#: classes/Gems/Menu.php:311
-#: classes/Gems/Menu.php:342
+#: classes/Gems/Menu.php:292
+#: classes/Gems/Menu.php:312
+#: classes/Gems/Menu.php:343
msgid "Add"
msgstr "Add"
-#: classes/Gems/Menu.php:295
-#: classes/Gems/Menu.php:377
+#: classes/Gems/Menu.php:296
+#: classes/Gems/Menu.php:378
msgid "Preview"
msgstr "Preview"
-#: classes/Gems/Menu.php:302
+#: classes/Gems/Menu.php:303
msgid "Tracks"
msgstr "Tracks"
-#: classes/Gems/Menu.php:315
+#: classes/Gems/Menu.php:316
msgid "Assignments"
msgstr "Assignments"
-#: classes/Gems/Menu.php:327
+#: classes/Gems/Menu.php:328
msgid "Edit"
msgstr "Edit"
-#: classes/Gems/Menu.php:331
+#: classes/Gems/Menu.php:332
msgid "Delete"
msgstr "Delete"
-#: classes/Gems/Menu.php:336
+#: classes/Gems/Menu.php:337
msgid "Surveys"
msgstr "Surveys"
-#: classes/Gems/Menu.php:368
+#: classes/Gems/Menu.php:369
msgid "Fill in"
msgstr "Fill in"
-#: classes/Gems/Menu.php:371
+#: classes/Gems/Menu.php:372
msgid "Print PDF"
msgstr "Print PDF"
-#: classes/Gems/Menu.php:374
+#: classes/Gems/Menu.php:375
msgid "E-Mail now!"
msgstr "E-Mail now!"
-#: classes/Gems/Menu.php:380
+#: classes/Gems/Menu.php:381
msgid "Answers"
msgstr "Answers"
-#: classes/Gems/Menu.php:530
+#: classes/Gems/Menu.php:531
msgid "Respondents"
msgstr "Patients"
-#: classes/Gems/Menu.php:538
+#: classes/Gems/Menu.php:539
msgid "Overview"
msgstr "Overview"
-#: classes/Gems/Menu.php:545
+#: classes/Gems/Menu.php:546
msgid "Project"
msgstr "Project"
-#: classes/Gems/Menu.php:548
+#: classes/Gems/Menu.php:549
msgid "Setup"
msgstr "Setup"
-#: classes/Gems/Menu.php:551
+#: classes/Gems/Menu.php:552
msgid "Mail"
msgstr "Mail"
-#: classes/Gems/Menu.php:554
+#: classes/Gems/Menu.php:555
msgid "Track Builder"
msgstr "Track Builder"
-#: classes/Gems/Menu.php:563
+#: classes/Gems/Menu.php:567
msgid "Contact"
msgstr "Contact"
-#: classes/Gems/Menu.php:576
+#: classes/Gems/Menu.php:580
msgid "Changelog"
msgstr "Changelog"
-#: classes/Gems/Model.php:205
+#: classes/Gems/Model.php:230
msgid "Respondent nr"
msgstr "Patient nr"
-#: classes/Gems/Model.php:206
+#: classes/Gems/Model.php:231
msgid "Opened"
msgstr "Opened"
-#: classes/Gems/Model.php:207
+#: classes/Gems/Model.php:232
msgid "Consent"
msgstr "Consent"
-#: classes/Gems/Model.php:209
+#: classes/Gems/Model.php:234
msgid "E-Mail"
msgstr "E-Mail"
-#: classes/Gems/Model.php:214
+#: classes/Gems/Model.php:239
msgid "Gender"
msgstr "Gender"
-#: classes/Gems/Model.php:215
+#: classes/Gems/Model.php:240
msgid "First name"
msgstr "First name"
-#: classes/Gems/Model.php:216
+#: classes/Gems/Model.php:241
msgid "Surname prefix"
msgstr "Surname prefix"
-#: classes/Gems/Model.php:217
+#: classes/Gems/Model.php:242
msgid "Last name"
msgstr "Last name"
-#: classes/Gems/Model.php:219
+#: classes/Gems/Model.php:244
msgid "Name"
msgstr "Name"
-#: classes/Gems/Model.php:222
+#: classes/Gems/Model.php:247
msgid "Street"
msgstr "Street"
-#: classes/Gems/Model.php:223
+#: classes/Gems/Model.php:248
msgid "Zipcode"
msgstr "Zipcode"
-#: classes/Gems/Model.php:224
+#: classes/Gems/Model.php:249
msgid "City"
msgstr "City"
-#: classes/Gems/Model.php:226
+#: classes/Gems/Model.php:251
msgid "Phone"
msgstr "Phone"
-#: classes/Gems/Model.php:228
+#: classes/Gems/Model.php:253
msgid "Birthday"
msgstr "Birthday"
@@ -442,13 +442,11 @@
msgstr "Trying upgrade for %s to level %s: %s"
#: classes/Gems/Controller/BrowseEditAction.php:354
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:228
#, php-format
msgid "New %s..."
msgstr "New %s..."
#: classes/Gems/Controller/BrowseEditAction.php:387
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:248
#, php-format
msgid "Delete %s"
msgstr "Delete %s"
@@ -464,7 +462,6 @@
msgstr "Edit %s %s"
#: classes/Gems/Controller/BrowseEditAction.php:410
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:258
#, php-format
msgid "Edit %s"
msgstr "Edit %s"
@@ -483,7 +480,6 @@
msgstr "No %s found"
#: classes/Gems/Controller/BrowseEditAction.php:679
-#: classes/Gems/Default/ExportAction.php:234
#, php-format
msgid "No %s found."
msgstr "No %s found."
@@ -493,14 +489,10 @@
msgstr "Are you sure?"
#: classes/Gems/Controller/BrowseEditAction.php:813
-#: classes/Gems/Default/DatabaseAction.php:187
-#: classes/Gems/Default/DatabaseAction.php:499
msgid "Yes"
msgstr "Yes"
#: classes/Gems/Controller/BrowseEditAction.php:814
-#: classes/Gems/Default/DatabaseAction.php:188
-#: classes/Gems/Default/DatabaseAction.php:500
msgid "No"
msgstr "No"
@@ -693,11 +685,11 @@
msgid "Cron jobs turned off."
msgstr "Cron jobs turned off."
-#: classes/Gems/Default/CronAction.php:221
+#: classes/Gems/Default/CronAction.php:222
msgid "No mails sent."
msgstr "No mails sent."
-#: classes/Gems/Default/CronAction.php:224
+#: classes/Gems/Default/CronAction.php:225
msgid "On this test system all mail will be delivered to the from address."
msgstr "On this test system all mail will be delivered to the from address."
@@ -1060,41 +1052,41 @@
msgid "Please enter your password of choice twice."
msgstr "Please enter your password of choice twice."
-#: classes/Gems/Default/IndexAction.php:217
+#: classes/Gems/Default/IndexAction.php:218
msgid "Your password must be changed."
msgstr "Your password must be changed."
-#: classes/Gems/Default/IndexAction.php:232
+#: classes/Gems/Default/IndexAction.php:233
#, php-format
msgid "Login successful, welcome %s."
msgstr "Login successful, welcome %s."
-#: classes/Gems/Default/IndexAction.php:272
+#: classes/Gems/Default/IndexAction.php:273
#, php-format
msgid "Good bye: %s."
msgstr "Good bye: %s."
-#: classes/Gems/Default/IndexAction.php:295
+#: classes/Gems/Default/IndexAction.php:296
msgid "Your password reset request is no longer valid, please request a new link."
msgstr "Your password reset request is no longer valid, please request a new link."
-#: classes/Gems/Default/IndexAction.php:297
+#: classes/Gems/Default/IndexAction.php:298
msgid "Your password input request is no longer valid, please request a new link."
msgstr "Your password input request is no longer valid, please request a new link."
-#: classes/Gems/Default/IndexAction.php:316
+#: classes/Gems/Default/IndexAction.php:317
msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail."
msgstr "We sent you an e-mail with a reset link. Click on the link in the e-mail."
-#: classes/Gems/Default/IndexAction.php:325
+#: classes/Gems/Default/IndexAction.php:326
msgid "New password is active."
msgstr "New password is active."
-#: classes/Gems/Default/IndexAction.php:346
+#: classes/Gems/Default/IndexAction.php:347
msgid "Password reset requested"
msgstr "Password reset requested"
-#: classes/Gems/Default/IndexAction.php:349
+#: classes/Gems/Default/IndexAction.php:350
msgid ""
"Dear {greeting},\n"
"\n"
@@ -1189,6 +1181,7 @@
msgstr "Date"
#: classes/Gems/Default/LogAction.php:191
+#: classes/Gems/Default/LogMaintenanceAction.php:52
msgid "Action"
msgstr "Action"
@@ -1205,6 +1198,7 @@
msgstr "IP address"
#: classes/Gems/Default/LogAction.php:209
+#: classes/Gems/Default/LogMaintenanceAction.php:53
msgid "Log"
msgstr "Log"
@@ -1266,51 +1260,55 @@
msgid "Days between reminders"
msgstr "Days between reminders"
-#: classes/Gems/Default/MailJobAction.php:113
+#: classes/Gems/Default/MailJobAction.php:95
+msgid "Maximum number of reminders"
+msgstr "Maximum number of reminders"
+
+#: classes/Gems/Default/MailJobAction.php:114
msgid "First mail"
msgstr "First mail"
-#: classes/Gems/Default/MailJobAction.php:114
+#: classes/Gems/Default/MailJobAction.php:115
msgid "Reminder"
msgstr "Reminder"
-#: classes/Gems/Default/MailJobAction.php:125
+#: classes/Gems/Default/MailJobAction.php:126
msgid "Use organizational from address"
msgstr "Use organizational from address"
-#: classes/Gems/Default/MailJobAction.php:128
+#: classes/Gems/Default/MailJobAction.php:129
#, php-format
msgid "Use site %s address"
msgstr "Use site %s address"
-#: classes/Gems/Default/MailJobAction.php:131
+#: classes/Gems/Default/MailJobAction.php:132
msgid "Use the 'By staff member' address"
msgstr "Use the 'By staff member' address"
-#: classes/Gems/Default/MailJobAction.php:132
+#: classes/Gems/Default/MailJobAction.php:133
msgid "Other"
msgstr "Other"
-#: classes/Gems/Default/MailJobAction.php:144
+#: classes/Gems/Default/MailJobAction.php:145
msgid "Automatic mail jobs"
msgstr "Automatic mail jobs"
-#: classes/Gems/Default/MailJobAction.php:155
+#: classes/Gems/Default/MailJobAction.php:156
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
+#: classes/Gems/Default/MailJobAction.php:166
#, 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:169
+#: classes/Gems/Default/MailJobAction.php:170
msgid "Turn Automatic Mail Jobs ON"
msgstr "Turn Automatic Mail Jobs ON"
-#: classes/Gems/Default/MailJobAction.php:175
+#: classes/Gems/Default/MailJobAction.php:176
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."
@@ -1905,6 +1903,83 @@
msgid "Please settle the informed consent form for this respondent."
msgstr "Please settle the informed consent form for this patient."
+#: classes/Gems/Default/RespondentExportAction.php:74
+msgid "Respondent number"
+msgstr "Patient number"
+
+#: classes/Gems/Default/RespondentExportAction.php:78
+msgid "Group surveys"
+msgstr "Group surveys"
+
+#: classes/Gems/Default/RespondentExportAction.php:87
+msgid "Output format"
+msgstr "Output format"
+
+#: classes/Gems/Default/RespondentExportAction.php:92
+msgid "Export"
+msgstr "Export"
+
+#: classes/Gems/Default/RespondentExportAction.php:124
+#, php-format
+msgid "Unable to run PDF conversion: \"%s\""
+msgstr "Unable to run PDF conversion: \"%s\""
+
+#: classes/Gems/Default/RespondentExportAction.php:149
+msgid "Round"
+msgstr "Round"
+
+#: classes/Gems/Default/RespondentExportAction.php:151
+msgid "Completed"
+msgstr "Completed"
+
+#: classes/Gems/Default/RespondentExportAction.php:156
+msgid "Single Survey"
+msgstr "Single Survey"
+
+#: classes/Gems/Default/RespondentExportAction.php:197
+msgid "Enter the particulars concerning the assignment to this respondent."
+msgstr "Enter the particulars concerning the assignment to this patient."
+
+#: classes/Gems/Default/RespondentExportAction.php:198
+msgid "Assigned by"
+msgstr "Assigned by"
+
+#: classes/Gems/Default/RespondentExportAction.php:199
+msgid "Start"
+msgstr "Start"
+
+#: classes/Gems/Default/RespondentExportAction.php:203
+msgid "Comment"
+msgstr "Comment"
+
+#: classes/Gems/Default/RespondentExportAction.php:211
+msgid "Track information"
+msgstr "Track information"
+
+#: classes/Gems/Default/RespondentExportAction.php:255
+msgid "Respondent information"
+msgstr "Patient information"
+
+#: classes/Gems/Default/RespondentExportAction.php:282
+msgid "Respondent report"
+msgstr "Respondent report"
+
+#: classes/Gems/Default/RespondentExportAction.php:286
+msgid "Report information"
+msgstr "Report information"
+
+#: classes/Gems/Default/RespondentExportAction.php:287
+msgid "Generated by"
+msgstr "Generated by"
+
+#: classes/Gems/Default/RespondentExportAction.php:289
+msgid "Generated on"
+msgstr "Generated on"
+
+#: classes/Gems/Default/RespondentExportAction.php:330
+msgid "Export respondent"
+msgstr "Export respondent"
+
#: classes/Gems/Default/RespondentPlanAction.php:67
msgid "Show respondent"
msgstr "Show patient"
@@ -1925,48 +2000,52 @@
msgid "Respondent planning"
msgstr "Patient planning"
-#: classes/Gems/Default/RoleAction.php:175
+#: classes/Gems/Default/RoleAction.php:94
+#: classes/Gems/Default/RoleAction.php:242
+msgid "Inherited"
+msgstr "Inherited"
+
+#: classes/Gems/Default/RoleAction.php:156
msgid "Illegal name"
msgstr "Illegal name"
-#: classes/Gems/Default/RoleAction.php:199
-#: classes/Gems/Default/RoleAction.php:258
+#: classes/Gems/Default/RoleAction.php:180
+#: classes/Gems/Default/RoleAction.php:239
msgid "Parents"
msgstr "Parents"
-#: classes/Gems/Default/RoleAction.php:214
+#: classes/Gems/Default/RoleAction.php:195
msgid "Editing `master` is not allowed"
msgstr "Editing `master` is not allowed"
-#: classes/Gems/Default/RoleAction.php:232
+#: classes/Gems/Default/RoleAction.php:213
msgid "role"
msgid_plural "roles"
msgstr[0] "role"
msgstr[1] "roles"
-#: classes/Gems/Default/RoleAction.php:237
+#: classes/Gems/Default/RoleAction.php:218
msgid "Administrative roles"
msgstr "Administrative roles"
-#: classes/Gems/Default/RoleAction.php:259
-#: classes/Gems/Default/RoleAction.php:275
+#: classes/Gems/Default/RoleAction.php:240
+#: classes/Gems/Default/RoleAction.php:258
msgid "Allowed"
msgstr "Allowed"
-#: classes/Gems/Default/RoleAction.php:260
-#: classes/Gems/Default/RoleAction.php:276
-msgid "Denied"
-msgstr "Denied"
-
-#: classes/Gems/Default/RoleAction.php:264
+#: classes/Gems/Default/RoleAction.php:247
msgid "Project role overview"
msgstr "Project role overview"
-#: classes/Gems/Default/RoleAction.php:274
+#: classes/Gems/Default/RoleAction.php:257
msgid "Privilege"
msgstr "Privilege"
-#: classes/Gems/Default/RoleAction.php:280
+#: classes/Gems/Default/RoleAction.php:259
+msgid "Denied"
+msgstr "Denied"
+
+#: classes/Gems/Default/RoleAction.php:263
msgid "Project privileges"
msgstr "Project privileges"
@@ -2067,55 +2146,55 @@
msgid "Synchronize all sources."
msgstr "Synchronize all sources."
-#: classes/Gems/Default/StaffAction.php:158
+#: classes/Gems/Default/StaffAction.php:164
msgid "Unsupported User Definition"
msgstr "Unsupported User Definition"
-#: classes/Gems/Default/StaffAction.php:187
+#: classes/Gems/Default/StaffAction.php:193
msgid "Users can only login when this box is checked."
msgstr "Users can only login when this box is checked."
-#: classes/Gems/Default/StaffAction.php:188
+#: classes/Gems/Default/StaffAction.php:194
msgid "If checked the user will logoff when answering a survey."
msgstr "If checked the user will logoff when answering a survey."
-#: classes/Gems/Default/StaffAction.php:205
+#: classes/Gems/Default/StaffAction.php:211
msgid "You are not allowed to edit this staff member."
msgstr "You are not allowed to edit this staff member."
-#: classes/Gems/Default/StaffAction.php:262
+#: classes/Gems/Default/StaffAction.php:268
#, php-format
msgid "User with id %s already exists but is deleted, do you want to reactivate the account?"
msgstr "User with id %s already exists but is deleted, do you want to reactivate the account?"
-#: classes/Gems/Default/StaffAction.php:303
+#: classes/Gems/Default/StaffAction.php:309
msgid "Username"
msgstr "Username"
-#: classes/Gems/Default/StaffAction.php:318
+#: classes/Gems/Default/StaffAction.php:324
msgid "Primary function"
msgstr "Primary function"
-#: classes/Gems/Default/StaffAction.php:328
+#: classes/Gems/Default/StaffAction.php:334
msgid "Can login"
msgstr "Can login"
-#: classes/Gems/Default/StaffAction.php:329
+#: classes/Gems/Default/StaffAction.php:335
msgid "Logout on survey"
msgstr "Logout on survey"
-#: classes/Gems/Default/StaffAction.php:404
+#: classes/Gems/Default/StaffAction.php:410
msgid "staff member"
msgid_plural "staff members"
msgstr[0] "staff member"
msgstr[1] "staff members"
-#: classes/Gems/Default/StaffAction.php:436
+#: classes/Gems/Default/StaffAction.php:442
#, php-format
msgid "Reset password for: %s"
msgstr "Reset password for: %s"
-#: classes/Gems/Default/StaffAction.php:439
+#: classes/Gems/Default/StaffAction.php:445
msgid "You are not allowed to change this password."
msgstr "You are not allowed to change this password."
@@ -2159,7 +2238,7 @@
msgid "Show surveys"
msgstr "Show surveys"
-#: classes/Gems/Default/SurveyAction.php:208
+#: classes/Gems/Default/SurveyAction.php:212
msgid "Assigned surveys"
msgstr "Assigned surveys"
@@ -2183,83 +2262,83 @@
msgid "Upload new PDF"
msgstr "Upload new PDF"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:135
+#: classes/Gems/Default/SurveyMaintenanceAction.php:136
msgid "Usage"
msgstr "Usage"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:150
+#: classes/Gems/Default/SurveyMaintenanceAction.php:151
msgid "Single Survey Assignment"
msgstr "Single Survey Assignment"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:195
+#: classes/Gems/Default/SurveyMaintenanceAction.php:196
msgid "Assignable since"
msgstr "Assignable since"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:196
+#: classes/Gems/Default/SurveyMaintenanceAction.php:197
msgid "Assignable until"
msgstr "Assignable until"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:202
+#: classes/Gems/Default/SurveyMaintenanceAction.php:203
msgid "Create Single Survey"
msgstr "Create Single Survey"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:206
+#: classes/Gems/Default/SurveyMaintenanceAction.php:207
msgid "At the moment this survey can only be assigned to respondents as part of an existing track."
msgstr "At the moment this survey can only be assigned to paitents as part of an existing track."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:259
+#: classes/Gems/Default/SurveyMaintenanceAction.php:262
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:276
+#: classes/Gems/Default/SurveyMaintenanceAction.php:279
#, php-format
msgid "Checking survey results for the %s survey."
msgstr "Checking survey results for the %s survey."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:288
+#: classes/Gems/Default/SurveyMaintenanceAction.php:291
msgid "Checking survey results for all surveys."
msgstr "Checking survey results for all surveys."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:345
+#: classes/Gems/Default/SurveyMaintenanceAction.php:348
msgid "OK"
msgstr "OK"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:352
+#: classes/Gems/Default/SurveyMaintenanceAction.php:355
msgid "Source"
msgstr "Source"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:353
+#: classes/Gems/Default/SurveyMaintenanceAction.php:356
msgid "Status in source"
msgstr "Status in source"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:356
+#: classes/Gems/Default/SurveyMaintenanceAction.php:359
msgid "Active in source"
msgstr "Active in source"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:357
+#: classes/Gems/Default/SurveyMaintenanceAction.php:360
#, php-format
msgid "Active in %s"
msgstr "Active in %s"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:364
+#: classes/Gems/Default/SurveyMaintenanceAction.php:367
msgid "Single"
msgstr "Single"
-#: classes/Gems/Default/SurveyMaintenanceAction.php:397
+#: classes/Gems/Default/SurveyMaintenanceAction.php:400
#, php-format
msgid "%d times in track."
msgstr "%d times in track."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:399
+#: classes/Gems/Default/SurveyMaintenanceAction.php:402
#, php-format
msgid "%d times in %d track(s)."
msgstr "%d times in %d track(s)."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:403
+#: classes/Gems/Default/SurveyMaintenanceAction.php:406
msgid "Not used in track."
msgstr "Not used in track."
-#: classes/Gems/Default/SurveyMaintenanceAction.php:405
+#: classes/Gems/Default/SurveyMaintenanceAction.php:408
msgid "Not used in tracks."
msgstr "Not used in tracks."
@@ -2369,10 +2448,6 @@
msgid "Token planning"
msgstr "Token planning"
-#: classes/Gems/Default/TrackAction.php:121
-msgid "Respondent number"
-msgstr "Patient number"
-
#: classes/Gems/Default/TrackAction.php:122
msgid "Respondent name"
msgstr "Patient name"
@@ -2452,38 +2527,22 @@
msgid "Adding the %s track to respondent %s"
msgstr "Adding the %s track to patient %s"
-#: classes/Gems/Default/TrackActionAbstract.php:209
-msgid "Enter the particulars concerning the assignment to this respondent."
-msgstr "Enter the particulars concerning the assignment to this patient."
-
-#: classes/Gems/Default/TrackActionAbstract.php:210
-msgid "Assigned by"
-msgstr "Assigned by"
-
-#: classes/Gems/Default/TrackActionAbstract.php:211
-msgid "Start"
-msgstr "Start"
-
-#: classes/Gems/Default/TrackActionAbstract.php:215
-msgid "Comment"
-msgstr "Comment"
-
-#: classes/Gems/Default/TrackActionAbstract.php:302
+#: classes/Gems/Default/TrackActionAbstract.php:303
#, php-format
msgid "Email %s %s"
msgstr "Email %s %s"
-#: classes/Gems/Default/TrackActionAbstract.php:308
+#: classes/Gems/Default/TrackActionAbstract.php:309
#, php-format
msgid "%s %s not found."
msgstr "%s %s not found."
-#: classes/Gems/Default/TrackActionAbstract.php:492
+#: classes/Gems/Default/TrackActionAbstract.php:493
#, php-format
msgid "Overview of %s track for respondent %s"
msgstr "Overview of %s track for patient %s"
-#: classes/Gems/Default/TrackActionAbstract.php:496
+#: classes/Gems/Default/TrackActionAbstract.php:497
msgid "This track is currently not assigned to this respondent."
msgstr "This track is currently not assigned to this patient."
@@ -2707,10 +2766,6 @@
msgid "Survey cannot be taken at this moment."
msgstr "Survey cannot be taken at this moment."
-#: classes/Gems/Email/OneMailForm.php:55
-msgid "Round"
-msgstr "Round"
-
#: classes/Gems/Email/OneMailForm.php:58
msgid "Last contact"
msgstr "Last contact"
@@ -2763,97 +2818,97 @@
msgid "Some help for this export"
msgstr "Some help for this export"
-#: classes/Gems/Menu/MenuAbstract.php:247
+#: classes/Gems/Menu/MenuAbstract.php:250
msgid "Activity log"
msgstr "Activity Log"
-#: classes/Gems/Menu/MenuAbstract.php:253
+#: classes/Gems/Menu/MenuAbstract.php:256
msgid "Automatic mail"
msgstr "Automatic mail"
-#: classes/Gems/Menu/MenuAbstract.php:254
+#: classes/Gems/Menu/MenuAbstract.php:257
msgid "Turn Automatic Mail Jobs OFF"
msgstr "Turn Automatic Mail Jobs OFF"
-#: classes/Gems/Menu/MenuAbstract.php:258
+#: classes/Gems/Menu/MenuAbstract.php:261
msgid "Servers"
msgstr "Servers"
-#: classes/Gems/Menu/MenuAbstract.php:262
+#: classes/Gems/Menu/MenuAbstract.php:265
msgid "Templates"
msgstr "Templates"
-#: classes/Gems/Menu/MenuAbstract.php:294
+#: classes/Gems/Menu/MenuAbstract.php:297
msgid "By period"
msgstr "By period"
-#: classes/Gems/Menu/MenuAbstract.php:295
+#: classes/Gems/Menu/MenuAbstract.php:298
msgid "By token"
msgstr "By token"
-#: classes/Gems/Menu/MenuAbstract.php:296
+#: classes/Gems/Menu/MenuAbstract.php:299
msgid "By respondent"
msgstr "By patient"
-#: classes/Gems/Menu/MenuAbstract.php:300
+#: classes/Gems/Menu/MenuAbstract.php:303
msgid "Bulk mail"
msgstr "Bulk mail"
-#: classes/Gems/Menu/MenuAbstract.php:318
+#: classes/Gems/Menu/MenuAbstract.php:321
msgid "Errors"
msgstr "Errors"
-#: classes/Gems/Menu/MenuAbstract.php:319
+#: classes/Gems/Menu/MenuAbstract.php:322
msgid "PHP"
msgstr "PHP"
-#: classes/Gems/Menu/MenuAbstract.php:322
+#: classes/Gems/Menu/MenuAbstract.php:325
msgid "Maintenance mode"
msgstr "Maintenance mode"
-#: classes/Gems/Menu/MenuAbstract.php:323
+#: classes/Gems/Menu/MenuAbstract.php:326
msgid "Clean cache"
msgstr "Clean cache"
-#: classes/Gems/Menu/MenuAbstract.php:390
+#: classes/Gems/Menu/MenuAbstract.php:393
msgid "Reset password"
msgstr "Reset password"
-#: classes/Gems/Menu/MenuAbstract.php:416
+#: classes/Gems/Menu/MenuAbstract.php:419
msgid "Check status"
msgstr "Check status"
-#: classes/Gems/Menu/MenuAbstract.php:417
+#: classes/Gems/Menu/MenuAbstract.php:420
msgid "Synchronize surveys"
msgstr "Synchronize surveys"
-#: classes/Gems/Menu/MenuAbstract.php:418
-#: classes/Gems/Menu/MenuAbstract.php:430
+#: classes/Gems/Menu/MenuAbstract.php:421
+#: classes/Gems/Menu/MenuAbstract.php:433
msgid "Check answers"
msgstr "Check answers"
-#: classes/Gems/Menu/MenuAbstract.php:419
+#: classes/Gems/Menu/MenuAbstract.php:422
msgid "Check attributes"
msgstr "Check attributes"
-#: classes/Gems/Menu/MenuAbstract.php:420
+#: classes/Gems/Menu/MenuAbstract.php:423
msgid "Synchronize all surveys"
msgstr "Synchronize all surveys"
-#: classes/Gems/Menu/MenuAbstract.php:421
-#: classes/Gems/Menu/MenuAbstract.php:431
+#: classes/Gems/Menu/MenuAbstract.php:424
+#: classes/Gems/Menu/MenuAbstract.php:434
msgid "Check all answers"
msgstr "Check all answers"
-#: classes/Gems/Menu/MenuAbstract.php:427
+#: classes/Gems/Me...
[truncated message content] |
|
From: <gem...@li...> - 2012-05-31 20:30:58
|
Revision: 725
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=725&view=rev
Author: michieltcs
Date: 2012-05-31 20:30:49 +0000 (Thu, 31 May 2012)
Log Message:
-----------
Update menu titles/translations
Modified Paths:
--------------
trunk/library/classes/Gems/Menu.php
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Modified: trunk/library/classes/Gems/Menu.php
===================================================================
--- trunk/library/classes/Gems/Menu.php 2012-05-31 20:11:35 UTC (rev 724)
+++ trunk/library/classes/Gems/Menu.php 2012-05-31 20:30:49 UTC (rev 725)
@@ -277,7 +277,7 @@
*/
$page->addEditAction('pr.respondent.edit')->addNamedParameters(MUtil_Model::REQUEST_ID, 'gr2o_patient_nr');
- $page->addAction('Export', 'pr.export-html', 'export')->addNamedParameters(MUtil_Model::REQUEST_ID, 'gr2o_patient_nr');
+ $page->addAction($this->_('Export'), 'pr.export-html', 'export')->addNamedParameters(MUtil_Model::REQUEST_ID, 'gr2o_patient_nr');
if ($this->escort instanceof Gems_Project_Tracks_SingleTrackInterface) {
@@ -558,7 +558,7 @@
$this->addContainer('Export data', 'pr.export', array('controller'=>'export', 'action'=>'index'));
// EXPORT TO HTML
- $this->addContainer('Export respondent to html', 'pr.export-html', array('controller' => 'respondent-export', 'action'=>'index'));
+ $this->addContainer($this->_('Export respondent'), 'pr.export-html', array('controller' => 'respondent-export', 'action'=>'index'));
// OTHER ITEMS
$this->addLogonOffToken();
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-05-31 20:11:35 UTC (rev 724)
+++ trunk/library/languages/default-nl.po 2012-05-31 20:30:49 UTC (rev 725)
@@ -1,5084 +1,5061 @@
-msgid ""
-msgstr ""
-"Project-Id-Version: GemsTracker NL\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-05-31 16:28+0100\n"
-"PO-Revision-Date: \n"
-"Last-Translator: Matijs de Jong <mj...@ma...>\n"
-"Language-Team: Erasmus MGZ <mat...@ma...>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: \n"
-"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Poedit-Language: Dutch\n"
-"X-Poedit-Country: NETHERLANDS\n"
-"X-Poedit-SourceCharset: iso-8859-1\n"
-"X-Poedit-Basepath: ../\n"
-"X-Poedit-KeywordsList: plural:1,2\n"
-"X-Poedit-SearchPath-0: .\n"
-
-#: classes/GemsEscort.php:214
-#, php-format
-msgid "Path %s not writable"
-msgstr "Path %s niet schrijfbaar"
-
-#: classes/GemsEscort.php:756
-#, php-format
-msgid "You are logged in as %s"
-msgstr "Ingelogd als %s"
-
-#: classes/GemsEscort.php:758
-#: classes/Gems/Menu.php:249
-msgid "Logoff"
-msgstr "Uitloggen"
-
-#: classes/GemsEscort.php:761
-msgid "You are not logged in"
-msgstr "U bent niet ingelogd"
-
-#: classes/GemsEscort.php:945
-#, php-format
-msgid "User: %s"
-msgstr "Login: %s"
-
-#: classes/GemsEscort.php:970
-msgid "version"
-msgstr "versie"
-
-#: classes/GemsEscort.php:1412
-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:1543
-msgid "Please check back later."
-msgstr "Probeer het later opnieuw."
-
-#: classes/GemsEscort.php:1545
-#: classes/GemsEscort.php:1549
-#: classes/GemsEscort.php:1550
-msgid "System is in maintenance mode"
-msgstr "Systeem is in onderhoudsmodus"
-
-#: classes/GemsEscort.php:1560
-msgid "No access to site."
-msgstr "Geen toegang tot website."
-
-#: classes/GemsEscort.php:1562
-#: classes/GemsEscort.php:1605
-msgid "You have no access to this site."
-msgstr "U heeft geen toegang tot deze website."
-
-#: classes/GemsEscort.php:1578
-msgid "No access to page"
-msgstr "Geen toegang tot pagina"
-
-#: classes/GemsEscort.php:1580
-#, 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:1590
-#: classes/GemsEscort.php:1603
-msgid "You are no longer logged in."
-msgstr "U bent niet meer ingelogd."
-
-#: classes/GemsEscort.php:1591
-msgid "You must login to access this page."
-msgstr "U moet ingelogd zijn voor toegang tot deze pagina."
-
-#: classes/GemsEscort.php:1732
-#: classes/GemsEscort.php:1734
-#, php-format
-msgid "%d survey"
-msgid_plural "%d surveys"
-msgstr[0] "%d vragenlijst"
-msgstr[1] "%d vragenlijsten"
-
-#: classes/Gems/AccessLog.php:236
-msgid "Database needs to be updated!"
-msgstr "Database dient ververst te worden!"
-
-#: classes/Gems/Html.php:154
-msgid "<< First"
-msgstr "<< Eerste"
-
-#: classes/Gems/Html.php:155
-msgid "< Previous"
-msgstr "< Terug"
-
-#: classes/Gems/Html.php:156
-msgid "Next >"
-msgstr "Verder >"
-
-#: classes/Gems/Html.php:157
-msgid "Last >>"
-msgstr "Laatste >>"
-
-#: classes/Gems/Html.php:158
-msgid " | "
-msgstr " | "
-
-#: classes/Gems/Html.php:162
-msgid "to"
-msgstr "tot"
-
-#: classes/Gems/Html.php:163
-msgid "of"
-msgstr "van"
-
-#: classes/Gems/Menu.php:140
-#, php-format
-msgid "About %s"
-msgstr "Over %s"
-
-#: classes/Gems/Menu.php:144
-msgid "Reporting bugs"
-msgstr "Meld een bug"
-
-#: classes/Gems/Menu.php:147
-msgid "Support"
-msgstr "Ondersteuning"
-
-#: classes/Gems/Menu.php:167
-msgid "Project setup"
-msgstr "Projectinfo"
-
-#: classes/Gems/Menu.php:170
-msgid "Database"
-msgstr "Database"
-
-#: classes/Gems/Menu.php:174
-msgid "Content"
-msgstr "Inhoud"
-
-#: classes/Gems/Menu.php:177
-msgid "Execute"
-msgstr "Uitvoeren"
-
-#: classes/Gems/Menu.php:182
-msgid "Patches"
-msgstr "Patches"
-
-#: classes/Gems/Menu.php:183
-msgid "Execute new"
-msgstr "Nieuwe aanmaken"
-
-#: classes/Gems/Menu.php:185
-msgid "Refresh translateables"
-msgstr "Ververs vertaalbaren"
-
-#: classes/Gems/Menu.php:187
-msgid "Run SQL"
-msgstr "SQL uitvoeren"
-
-#: classes/Gems/Menu.php:190
-msgid "Reception codes"
-msgstr "Ontvangst codes"
-
-#: classes/Gems/Menu.php:193
-msgid "Consents"
-msgstr "Toestemmingen"
-
-#: classes/Gems/Menu.php:196
-msgid "Roles"
-msgstr "Rollen"
-
-#: classes/Gems/Menu.php:197
-#: classes/Gems/Menu.php:347
-msgid "Assigned"
-msgstr "Toegewezen"
-
-#: classes/Gems/Menu.php:198
-msgid "Privileges"
-msgstr "Priviléges"
-
-#: classes/Gems/Menu.php:201
-msgid "Groups"
-msgstr "Groepen"
-
-#: classes/Gems/Menu.php:204
-msgid "Organizations"
-msgstr "Organisaties"
-
-#: classes/Gems/Menu.php:207
-msgid "Staff"
-msgstr "Medewerkers"
-
-#: classes/Gems/Menu.php:210
-msgid "Logging"
-msgstr "Logboek"
-
-#: classes/Gems/Menu.php:214
-msgid "Maintenance"
-msgstr "Onderhoud"
-
-#: classes/Gems/Menu.php:219
-msgid "Upgrade"
-msgstr "Upgrade"
-
-#: classes/Gems/Menu.php:220
-#: classes/Gems/Menu.php:320
-msgid "Show"
-msgstr "Toon"
-
-#: classes/Gems/Menu.php:221
-msgid "Execute all"
-msgstr "Alles uitvoeren"
-
-#: classes/Gems/Menu.php:222
-msgid "Execute this"
-msgstr "Dit uitvoeren"
-
-#: classes/Gems/Menu.php:223
-msgid "Execute from here"
-msgstr "Uitvoeren vanaf hier"
-
-#: classes/Gems/Menu.php:224
-msgid "Execute to here"
-msgstr "Uitvoeren tot hier"
-
-#: classes/Gems/Menu.php:236
-#, php-format
-msgid "Stand-alone privilige: %s"
-msgstr "Zelfstandig privilege: %s"
-
-#: classes/Gems/Menu.php:243
-msgid "Logon"
-msgstr "Login"
-
-#: classes/Gems/Menu.php:244
-msgid "Lost password"
-msgstr "Wachtwoord vergeten"
-
-#: classes/Gems/Menu.php:245
-msgid "Your account"
-msgstr "Uw account"
-
-#: classes/Gems/Menu.php:246
-msgid "Activity overview"
-msgstr "Activiteiten overzicht"
-
-#: classes/Gems/Menu.php:247
-msgid "Change password"
-msgstr "Uw wachtwoord"
-
-#: classes/Gems/Menu.php:248
-#: classes/Gems/Menu.php:289
-#: classes/Gems/Menu.php:324
-msgid "Token"
-msgstr "Kenmerk"
-
-#: classes/Gems/Menu.php:285
-msgid "Track"
-msgstr "Traject"
-
-#: classes/Gems/Menu.php:292
-#: classes/Gems/Menu.php:312
-#: classes/Gems/Menu.php:343
-msgid "Add"
-msgstr "Voeg toe"
-
-#: classes/Gems/Menu.php:296
-#: classes/Gems/Menu.php:378
-msgid "Preview"
-msgstr "Preview"
-
-#: classes/Gems/Menu.php:303
-msgid "Tracks"
-msgstr "Trajecten"
-
-#: classes/Gems/Menu.php:316
-msgid "Assignments"
-msgstr "Toewijzingen"
-
-#: classes/Gems/Menu.php:328
-msgid "Edit"
-msgstr "Wijzig"
-
-#: classes/Gems/Menu.php:332
-msgid "Delete"
-msgstr "Verwijder"
-
-#: classes/Gems/Menu.php:337
-msgid "Surveys"
-msgstr "Vragenlijsten"
-
-#: classes/Gems/Menu.php:369
-msgid "Fill in"
-msgstr "Vul in"
-
-#: classes/Gems/Menu.php:372
-msgid "Print PDF"
-msgstr "Print PDF"
-
-#: classes/Gems/Menu.php:375
-msgid "E-Mail now!"
-msgstr "Email nu!"
-
-#: classes/Gems/Menu.php:381
-msgid "Answers"
-msgstr "Antwoorden"
-
-#: classes/Gems/Menu.php:531
-msgid "Respondents"
-msgstr "Patiënten"
-
-#: classes/Gems/Menu.php:539
-msgid "Overview"
-msgstr "Overzicht"
-
-#: classes/Gems/Menu.php:546
-msgid "Project"
-msgstr "Project"
-
-#: classes/Gems/Menu.php:549
-msgid "Setup"
-msgstr "Beheer"
-
-#: classes/Gems/Menu.php:552
-msgid "Mail"
-msgstr "Email"
-
-#: classes/Gems/Menu.php:555
-msgid "Track Builder"
-msgstr "Traject bouwer"
-
-#: classes/Gems/Menu.php:567
-msgid "Contact"
-msgstr "Contact"
-
-#: classes/Gems/Menu.php:580
-msgid "Changelog"
-msgstr "Changelog"
-
-#: classes/Gems/Model.php:230
-msgid "Respondent nr"
-msgstr "Patiënt nr"
-
-#: classes/Gems/Model.php:231
-msgid "Opened"
-msgstr "Bekeken op"
-
-#: classes/Gems/Model.php:232
-msgid "Consent"
-msgstr "Toestemming"
-
-#: classes/Gems/Model.php:234
-msgid "E-Mail"
-msgstr "Email"
-
-#: classes/Gems/Model.php:239
-msgid "Gender"
-msgstr "Geslacht"
-
-#: classes/Gems/Model.php:240
-msgid "First name"
-msgstr "Voornaam"
-
-#: classes/Gems/Model.php:241
-msgid "Surname prefix"
-msgstr "Tussenvoegsel"
-
-#: classes/Gems/Model.php:242
-msgid "Last name"
-msgstr "Achternaam"
-
-#: classes/Gems/Model.php:244
-msgid "Name"
-msgstr "Naam"
-
-#: classes/Gems/Model.php:247
-msgid "Street"
-msgstr "Straat"
-
-#: classes/Gems/Model.php:248
-msgid "Zipcode"
-msgstr "Postcode"
-
-#: classes/Gems/Model.php:249
-msgid "City"
-msgstr "Woonplaats"
-
-#: classes/Gems/Model.php:251
-msgid "Phone"
-msgstr "Telefoon"
-
-#: classes/Gems/Model.php:253
-msgid "Birthday"
-msgstr "Geboren op"
-
-#: classes/Gems/Pdf.php:198
-#, php-format
-msgid "PDF Source File '%s' not found!"
-msgstr "PDF bron bestand %s niet gevonden!"
-
-#: classes/Gems/Pdf.php:240
-#, php-format
-msgid "Could not create '%s' directory."
-msgstr "Kon de directory '%s' niet aanmaken."
-
-#: classes/Gems/Pdf.php:283
-#, php-format
-msgid " The error message is: %s"
-msgstr "De foutmelding is: %s"
-
-#: classes/Gems/Upgrades.php:77
-msgid "Syncing surveys for all sources"
-msgstr "Vragenlijsten synchroniseren voor alle bronnen."
-
-#: classes/Gems/UpgradesAbstract.php:154
-msgid "Already at max. level."
-msgstr "Al op het hoogste niveau."
-
-#: classes/Gems/UpgradesAbstract.php:161
-#, php-format
-msgid "Trying upgrade for %s from level %s to level %s"
-msgstr "Probeert upgrade voor %s van niveau %s naar niveau %s uit te voeren"
-
-#: classes/Gems/UpgradesAbstract.php:169
-#, php-format
-msgid "Trying upgrade for %s to level %s: %s"
-msgstr "Probeert upgrade voor %s naar niveau %s: %s"
-
-#: classes/Gems/Controller/BrowseEditAction.php:354
-#, php-format
-msgid "New %s..."
-msgstr "Nieuwe %s..."
-
-#: classes/Gems/Controller/BrowseEditAction.php:387
-#, php-format
-msgid "Delete %s"
-msgstr "Verwijder %s"
-
-#: classes/Gems/Controller/BrowseEditAction.php:391
-#, php-format
-msgid "%2$u %1$s deleted"
-msgstr "%2$u %1$s verwijderd"
-
-#: classes/Gems/Controller/BrowseEditAction.php:408
-#, php-format
-msgid "Edit %s %s"
-msgstr "Bewerk %s %s"
-
-#: classes/Gems/Controller/BrowseEditAction.php:410
-#, php-format
-msgid "Edit %s"
-msgstr "Bewerk %s"
-
-#: classes/Gems/Controller/BrowseEditAction.php:508
-msgid "Free search text"
-msgstr "Vrije zoek tekst"
-
-#: classes/Gems/Controller/BrowseEditAction.php:579
-msgid "Search"
-msgstr "Zoeken"
-
-#: classes/Gems/Controller/BrowseEditAction.php:595
-#, php-format
-msgid "No %s found"
-msgstr "Geen %s gevonden"
-
-#: classes/Gems/Controller/BrowseEditAction.php:679
-#, php-format
-msgid "No %s found."
-msgstr "Geen %s gevonden."
-
-#: classes/Gems/Controller/BrowseEditAction.php:797
-msgid "Are you sure?"
-msgstr "Weet u het zeker?"
-
-#: classes/Gems/Controller/BrowseEditAction.php:813
-msgid "Yes"
-msgstr "Ja"
-
-#: classes/Gems/Controller/BrowseEditAction.php:814
-msgid "No"
-msgstr "Nee"
-
-#: classes/Gems/Controller/BrowseEditAction.php:867
-#, php-format
-msgid "Unknown %s requested"
-msgstr "Onjuist %s verzoek"
-
-#: classes/Gems/Controller/BrowseEditAction.php:890
-#, php-format
-msgid "New %1$s..."
-msgstr "Nieuwe %1$s..."
-
-#: classes/Gems/Controller/BrowseEditAction.php:898
-msgid "Save"
-msgstr "Opslaan"
-
-#: classes/Gems/Controller/BrowseEditAction.php:934
-#, php-format
-msgid "%2$u %1$s saved"
-msgstr "%2$u %1$s opgeslagen"
-
-#: classes/Gems/Controller/BrowseEditAction.php:937
-msgid "No changes to save."
-msgstr "Geen verandering om op te slaan."
-
-#: classes/Gems/Controller/BrowseEditAction.php:946
-msgid "Input error! No changes saved!"
-msgstr "Invoer fout! Veranderingen niet opgeslagen!"
-
-#: classes/Gems/Controller/BrowseEditAction.php:974
-#, php-format
-msgid "Show %s"
-msgstr "Toon %s"
-
-#: classes/Gems/Controller/BrowseEditAction.php:981
-#, php-format
-msgid "Unknown %s."
-msgstr "%s is onbekend."
-
-#: classes/Gems/Controller/ModelActionAbstract.php:97
-#: classes/Gems/Default/DatabaseAction.php:503
-msgid "Cancel"
-msgstr "Annuleren"
-
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:238
-#, php-format
-msgid "Do you want to delete this %s?"
-msgstr "Weet u zeker dat deze %s verwijderd moet worden?"
-
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:271
-msgid "No data found."
-msgstr "Geen gegevens gevonden."
-
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:333
-#, php-format
-msgid "No %s found..."
-msgstr "Geen %s gevonden..."
-
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:343
-#, php-format
-msgid "Showing %s"
-msgstr "Toon %s"
-
-#: classes/Gems/Controller/ModelSnippetActionAbstract.php:379
-msgid "item"
-msgid_plural "items"
-msgstr[0] "item"
-msgstr[1] "items"
-
-#: classes/Gems/Controller/Action/Helper/BatchRunner.php:65
-msgid "Prepare recheck"
-msgstr "Hercontrole voorbereiden"
-
-#: classes/Gems/Controller/Action/Helper/BatchRunner.php:68
-#, php-format
-msgid "Start %s jobs"
-msgstr "Start %s opdrachten"
-
-#: classes/Gems/Controller/Action/Helper/BatchRunner.php:71
-msgid "Nothing to do."
-msgstr "Niets te doen."
-
-#: classes/Gems/Default/AskAction.php:88
-#, php-format
-msgid "Enter your %s token"
-msgstr "Voer uw %s kenmerk in"
-
-#: classes/Gems/Default/AskAction.php:91
-msgid "Tokens identify a survey that was assigned to you personally."
-msgstr "Elk kenmerk verwijst naar een specifiek aan u toegekende vragenlijst."
-
-#: classes/Gems/Default/AskAction.php:91
-msgid "Entering the token and pressing OK will open that survey."
-msgstr "Vul uw kenmerk in en druk op OK om die vragenlijst te openen."
-
-#: classes/Gems/Default/AskAction.php:95
-msgid "After answering the survey you will be logged off automatically."
-msgstr "Na het invullen wordt u automatisch uitgelogd."
-
-#: classes/Gems/Default/AskAction.php:100
-msgid "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive."
-msgstr "Een kenmerk bestaat uit twee groepen van vier cijfers en letters met een (niet verplicht) streepje ertussen. Hoofdletters of gewone letters maakt niets uit."
-
-#: classes/Gems/Default/AskAction.php:101
-msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
-msgstr "Er wordt geen verschil gemaakt tussen het getal nul en de letter O en ook niet tussen het getal één en de letter L."
-
-#: classes/Gems/Default/AskAction.php:136
-#, php-format
-msgid "Thank you for answering. At the moment we have no further surveys for you to take."
-msgstr "Dank u voor uw antwoorden. Op dit moment hebben we geen vragenlijsten meer voor u."
-
-#: classes/Gems/Default/AskAction.php:138
-#, php-format
-msgid "The survey for token %s has been answered and no further surveys are open."
-msgstr "De vragenlijst met het kenmerk %s is beantwoord en er staan verder geen vragenlijsten open."
-
-#: classes/Gems/Default/AskAction.php:145
-#, php-format
-msgid "The token %s does not exist (any more)."
-msgstr "Het kenmerk %s bestaat niet (meer)."
-
-#: classes/Gems/Default/AskAction.php:273
-#, php-format
-msgid "The survey for token %s is no longer active."
-msgstr "De vragenlijst voor kenmerk %s is niet meer in gebruik."
-
-#: classes/Gems/Default/ConsentAction.php:68
-#: classes/Gems/Default/GroupAction.php:88
-msgid "Description"
-msgstr "Omschrijving"
-
-#: classes/Gems/Default/ConsentAction.php:70
-#: classes/Gems/Default/DatabaseAction.php:139
-msgid "Order"
-msgstr "Volgorde"
-
-#: classes/Gems/Default/ConsentAction.php:71
-msgid "Determines order of presentation in interface."
-msgstr "Bepaald de presentatie volgorde."
-
-#: classes/Gems/Default/ConsentAction.php:73
-msgid "Consent code"
-msgstr "Consent code"
-
-#: classes/Gems/Default/ConsentAction.php:75
-msgid "Internal code, not visible to users, copied with the token information to the source."
-msgstr "Interne code, niet zichtbaar voor gebruikers maar wordt met de token informatie aan de bron doorgegeven."
-
-#: classes/Gems/Default/ConsentAction.php:92
-msgid "respondent consent"
-msgid_plural "respondent consents"
-msgstr[0] "patiënt toestemming"
-msgstr[1] "patiënt toestemmingen"
-
-#: classes/Gems/Default/ConsentAction.php:97
-msgid "Respondent consents"
-msgstr "Patiënt toestemming"
-
-#: classes/Gems/Default/ContactAction.php:71
-#, php-format
-msgid "%s is a web application."
-msgstr "%s is een web applicatie."
-
-#: classes/Gems/Default/ContactAction.php:76
-#, php-format
-msgid "The %s project is run by: "
-msgstr "%s is een project van: "
-
-#: classes/Gems/Default/ContactAction.php:82
-#, php-format
-msgid "%s is a collaboration of these organizations:"
-msgstr "Deze organisaties werken samen voor het %s project:"
-
-#: classes/Gems/Default/ContactAction.php:103
-#, php-format
-msgid "The %s project"
-msgstr "Het %s project"
-
-#: classes/Gems/Default/ContactAction.php:106
-msgid "Information on this application"
-msgstr "Information over deze website"
-
-#: classes/Gems/Default/ContactAction.php:107
-msgid "Links concerning this web application:"
-msgstr "Links met informatie over deze website:"
-
-#: classes/Gems/Default/CronAction.php:148
-msgid "Cron jobs turned off."
-msgstr "Cron opdrachten uitgezet."
-
-#: classes/Gems/Default/CronAction.php:222
-msgid "No mails sent."
-msgstr "Geen mail verzonden."
-
-#: classes/Gems/Default/CronAction.php:225
-msgid "On this test system all mail will be delivered to the from address."
-msgstr "Op dit test systeem worden alle emails gestuurd naar het \"van\" adres."
-
-#: classes/Gems/Default/DatabaseAction.php:75
-msgid "Cache cleaned"
-msgstr "Cache opgeschoond"
-
-#: classes/Gems/Default/DatabaseAction.php:105
-#, php-format
-msgid "No rows in %s."
-msgstr "Geen gegevens in %s."
-
-#: classes/Gems/Default/DatabaseAction.php:134
-msgid "Type"
-msgstr "Type"
-
-#: classes/Gems/Default/DatabaseAction.php:138
-msgid "Group"
-msgstr "Groep"
-
-#: classes/Gems/Default/DatabaseAction.php:140
-msgid "Location"
-msgstr "Locatie"
-
-#: classes/Gems/Default/DatabaseAction.php:143
-msgid "Status"
-msgstr "Status"
-
-#: classes/Gems/Default/DatabaseAction.php:146
-msgid "Script"
-msgstr "Script"
-
-#: classes/Gems/Default/DatabaseAction.php:148
-#: classes/Gems/Default/DatabaseAction.php:293
-#: classes/Gems/Default/DatabaseAction.php:340
-msgid "Changed on"
-msgstr "Veranderd op"
-
-#: classes/Gems/Default/DatabaseAction.php:167
-msgid "This database object does not exist. You cannot delete it."
-msgstr "Dit database object bestaat. Het kan dus ook niet verwijderd worden."
-
-#: classes/Gems/Default/DatabaseAction.php:172
-#, php-format
-msgid "Drop %s"
-msgstr "Verwijder %s"
-
-#: classes/Gems/Default/DatabaseAction.php:180
-#, php-format
-msgid "There are %d rows in the table."
-msgstr "Er zijn %d rijen in deze tabel."
-
-#: classes/Gems/Default/DatabaseAction.php:182
-#, php-format
-msgid "Drop table with %d rows"
-msgstr "Tabel met %d rijen aan data verwijderen"
-
-#: classes/Gems/Default/DatabaseAction.php:183
-msgid "Are you really sure?"
-msgstr "Weet u het heel erg zeker?"
-
-#: classes/Gems/Default/DatabaseAction.php:199
-#, php-format
-msgid "%1$s %2$s dropped"
-msgstr "%1$s %2$s verwijderd"
-
-#: classes/Gems/Default/DatabaseAction.php:205
-msgid " during statement "
-msgstr " tijdens het commando "
-
-#: classes/Gems/Default/DatabaseAction.php:216
-#, php-format
-msgid "%s no longer exists in the database."
-msgstr "%s bestaat niet meer in de database."
-
-#: classes/Gems/Default/DatabaseAction.php:219
-#, php-format
-msgid "%s does not yet exist in the database."
-msgstr "%s bestaat nog niet in de database."
-
-#: classes/Gems/Default/DatabaseAction.php:222
-#, php-format
-msgid "%s object does exist."
-msgstr "%s object bestaat."
-
-#: classes/Gems/Default/DatabaseAction.php:240
-msgid "Object is not a table."
-msgstr "Niet een tabel object."
-
-#: classes/Gems/Default/DatabaseAction.php:264
-msgid "Structure"
-msgstr "Structuur"
-
-#: classes/Gems/Default/DatabaseAction.php:273
-msgid "database object"
-msgid_plural "database objects"
-msgstr[0] "database object"
-msgstr[1] "database objects"
-
-#: classes/Gems/Default/DatabaseAction.php:278
-msgid "Database object overview"
-msgstr "Database object overzicht"
-
-#: classes/Gems/Default/DatabaseAction.php:287
-#: classes/Gems/Default/DatabaseAction.php:333
-msgid "Level"
-msgstr "Niveau"
-
-#: classes/Gems/Default/DatabaseAction.php:288
-#: classes/Gems/Default/DatabaseAction.php:334
-msgid "Subtype"
-msgstr "Subtype"
-
-#: classes/Gems/Default/DatabaseAction.php:290
-msgid "To be executed"
-msgstr "Uit te voeren"
-
-#: classes/Gems/Default/DatabaseAction.php:291
-#: classes/Gems/Default/DatabaseAction.php:337
-msgid "Executed"
-msgstr "Uitgevoerd"
-
-#: classes/Gems/Default/DatabaseAction.php:292
-#: classes/Gems/Default/DatabaseAction.php:338
-msgid "Finished"
-msgstr "Afgerond"
-
-#: classes/Gems/Default/DatabaseAction.php:296
-msgid "Create the patch table!"
-msgstr "De patch tabel bestaat nog niet!"
-
-#: classes/Gems/Default/DatabaseAction.php:298
-#, php-format
-msgid "%d new or changed patch(es)."
-msgstr "%d nieuwe of veranderde patch(es)."
-
-#: classes/Gems/Default/DatabaseAction.php:303
-msgid "Gems build"
-msgstr "Gems bouwnummer"
-
-#: classes/Gems/Default/DatabaseAction.php:304
-msgid "Database build"
-msgstr "Database versie"
-
-#: classes/Gems/Default/DatabaseAction.php:306
-msgid "Execute level"
-msgstr "Uit te voeren versie"
-
-#: classes/Gems/Default/DatabaseAction.php:310
-msgid "Ignore finished"
-msgstr "Afgeronde patches overslaan"
-
-#: classes/Gems/Default/DatabaseAction.php:311
-msgid "Ignore executed"
-msgstr "Uitgevoerde patches overslaan"
-
-#: classes/Gems/Default/DatabaseAction.php:312
-msgid "Show patches"
-msgstr "Toon patches"
-
-#: classes/Gems/Default/DatabaseAction.php:326
-#, php-format
-msgid "%d patch(es) executed."
-msgstr "%d patch(es) uitgevoerd."
-
-#: classes/Gems/Default/DatabaseAction.php:332
-msgid "Patch"
-msgstr "Patch"
-
-#: classes/Gems/Default/DatabaseAction.php:336
-msgid "Query"
-msgstr "Query"
-
-#: classes/Gems/Default/DatabaseAction.php:339
-msgid "Result"
-msgstr "Resultaat"
-
-#: classes/Gems/Default/DatabaseAction.php:364
-msgid "Patch maintenance"
-msgstr "Patch onderhoud"
-
-#: classes/Gems/Default/DatabaseAction.php:368
-msgid "Patch overview"
-msgstr "Patch overzicht"
-
-#: classes/Gems/Default/DatabaseAction.php:430
-msgid "This database object does not exist. You cannot create it."
-msgstr "Dit database object bestaat niet en kan ook niet aangemaakt worden."
-
-#: classes/Gems/Default/DatabaseAction.php:436
-msgid "This database object has no script. You cannot execute it."
-msgstr "Dit database object heeft geen script. Het kan dus ook niet uitgevoerd worden."
-
-#: classes/Gems/Default/DatabaseAction.php:447
-#, php-format
-msgid "Run %s"
-msgstr "Voer %s script uit"
-
-#: classes/Gems/Default/DatabaseAction.php:468
-#, php-format
-msgid "Starting %d object creation scripts."
-msgstr "Aanvang %d object aanmaak scripts."
-
-#: classes/Gems/Default/DatabaseAction.php:474
-#, php-format
-msgid "Finished %s creation script for object %d of %d"
-msgstr "Klaar %s met aanmaak script voor object %d van %d"
-
-#: classes/Gems/Default/DatabaseAction.php:479
-msgid "All objects exist. Nothing was executed."
-msgstr "Alle objects bestaan. Niets was uitgevoerd."
-
-#: classes/Gems/Default/DatabaseAction.php:486
-msgid "Create not-existing database objects"
-msgstr "Aanmaak van database objecten die nog niet bestaan"
-
-#: classes/Gems/Default/DatabaseAction.php:488
-#, php-format
-msgid "One database object does not exist."
-msgid_plural "These %d database objects do not exist."
-msgstr[0] "Één object bestaat nog niet in de database."
-msgstr[1] "%d objecten bestaan nog niet in de database."
-
-#: classes/Gems/Default/DatabaseAction.php:489
-msgid "Are you sure you want to create it?"
-msgid_plural "Are you sure you want to create them all?"
-msgstr[0] "Weet u zeker dat u dit wil aanmaken?"
-msgstr[1] "Weet u zeker dat u deze allemaal wil aanmaken?"
-
-#: classes/Gems/Default/DatabaseAction.php:502
-msgid "All database objects exist. There is nothing to create."
-msgstr "Alle database objecten bestaan. Er valt niets te maken."
-
-#: classes/Gems/Default/DatabaseAction.php:515
-msgid "Separate multiple commands with semicolons (;)."
-msgstr "Scheidt meerdere commando's met punt-comma's (;)."
-
-#: classes/Gems/Default/DatabaseAction.php:522
-msgid "Run"
-msgstr "Uitvoeren"
-
-#: classes/Gems/Default/DatabaseAction.php:531
-msgid "raw"
-msgstr "rauw"
-
-#: classes/Gems/Default/DatabaseAction.php:541
-#, php-format
-msgid "Result set %s."
-msgstr "Resultaat %s."
-
-#: classes/Gems/Default/DatabaseAction.php:564
-msgid "Execute raw SQL"
-msgstr "SQL direct uitvoeren"
-
-#: classes/Gems/Default/DatabaseAction.php:567
-msgid "Result sets"
-msgstr "Resultaten"
-
-#: classes/Gems/Default/DatabaseAction.php:592
-msgid "This database object does not exist. You cannot view it."
-msgstr "Dit database object bestaat. Het kan dus ook niet bekeken worden."
-
-#: classes/Gems/Default/DatabaseAction.php:597
-#, php-format
-msgid "The data in table %s"
-msgstr "De gegevens in tabel %s"
-
-#: classes/Gems/Default/DatabaseAction.php:598
-#, php-format
-msgid "Contents of %s %s"
-msgstr "De inhoud van %s %s"
-
-#: classes/Gems/Default/ExportAction.php:69
-msgid "Data"
-msgstr "Data"
-
-#: classes/Gems/Default/ExportAction.php:74
-msgid "Export data"
-msgstr "Exporteer gegevens"
-
-#: classes/Gems/Default/ExportAction.php:153
-msgid "Survey"
-msgstr "Vragenlijst"
-
-#: classes/Gems/Default/ExportAction.php:168
-#, php-format
-msgid "%s records found."
-msgstr "%s records gevonden."
-
-#: classes/Gems/Default/ExportAction.php:172
-#: classes/Gems/Default/LogAction.php:197
-msgid "Organization"
-msgstr "Organisatie"
-
-#: classes/Gems/Default/ExportAction.php:181
-msgid "Export to"
-msgstr "Exporteer naar"
-
-#: classes/Gems/Default/GroupAction.php:89
-#: classes/Gems/Default/LogAction.php:201
-msgid "Role"
-msgstr "Rol"
-
-#: classes/Gems/Default/GroupAction.php:92
-msgid "Active"
-msgstr "Actief"
-
-#: classes/Gems/Default/GroupAction.php:97
-msgid "Allowed IP Ranges"
-msgstr "Toegestane IP adres reeksen"
-
-#: classes/Gems/Default/GroupAction.php:98
-msgid "Separate with | example: 10.0.0.0-10.0.0.255 (subnet masks are not supported)"
-msgstr "Scheiden met | voorbeeld: 10.0.0.0-10.0.0.255 (subnet masks worden niet ondersteund)"
-
-#: classes/Gems/Default/GroupAction.php:108
-msgid "group"
-msgid_plural "groups"
-msgstr[0] "groep"
-msgstr[1] "groepen"
-
-#: classes/Gems/Default/GroupAction.php:113
-msgid "Administrative groups"
-msgstr "Beheer groepen"
-
-#: classes/Gems/Default/IndexAction.php:157
-msgid "Request password reset"
-msgstr "Wachtwoord vergeten?"
-
-#: classes/Gems/Default/IndexAction.php:161
-msgid "Please enter your organization and your username or e-mail address. "
-msgstr "Geef uw organisatie en uw email adres of de gebruikersnaam op. "
-
-#: classes/Gems/Default/IndexAction.php:163
-msgid "Please enter your username or e-mail address. "
-msgstr "Geef uw email adres of gebruikersnaam op. "
-
-#: classes/Gems/Default/IndexAction.php:165
-msgid "We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice."
-msgstr "Vervolgens sturen wij u een email met een link. De link verwijst naar een pagina waar u een zelfgekozen wachtwoord in kan voeren."
-
-#: classes/Gems/Default/IndexAction.php:171
-msgid "Execute password reset"
-msgstr "Vervang vergeten passwood"
-
-#: classes/Gems/Default/IndexAction.php:172
-msgid "We received your password reset request."
-msgstr "We hebben uw verzoek voor een nieuw wachtwoord ontvangen."
-
-#: classes/Gems/Default/IndexAction.php:175
-#, php-format
-msgid "Welcome to %s"
-msgstr "Welkom bij %s"
-
-#: classes/Gems/Default/IndexAction.php:176
-msgid "Welcome to this website."
-msgstr "Welkom op deze website."
-
-#: classes/Gems/Default/IndexAction.php:179
-msgid "Please enter your password of choice twice."
-msgstr "Geef twee keer een zelfgekozen wachtwoord op."
-
-#: classes/Gems/Default/IndexAction.php:218
-msgid "Your password must be changed."
-msgstr "Uw wachtwoord moet veranderd worden."
-
-#: classes/Gems/Default/IndexAction.php:233
-#, php-format
-msgid "Login successful, welcome %s."
-msgstr "Login in orde, welkom %s."
-
-#: classes/Gems/Default/IndexAction.php:273
...
[truncated message content] |