From: <gem...@li...> - 2012-01-27 15:28:55
|
Revision: 428 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=428&view=rev Author: mennodekker Date: 2012-01-27 15:28:44 +0000 (Fri, 27 Jan 2012) Log Message: ----------- Minor fixes for upgrade: execute patchlevel 43, fixing table layout for radius config Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Upgrades.php branches/1.5.x/library/configs/db/patches.sql branches/1.5.x/library/configs/db/tables/gems__radius_config.999.sql Modified: branches/1.5.x/library/classes/Gems/Upgrades.php =================================================================== --- branches/1.5.x/library/classes/Gems/Upgrades.php 2012-01-26 13:52:27 UTC (rev 427) +++ branches/1.5.x/library/classes/Gems/Upgrades.php 2012-01-27 15:28:44 UTC (rev 428) @@ -66,6 +66,8 @@ public function Upgrade143to15() { $this->patcher->executePatch(42); + $this->patcher->executePatch(43); + //Also create new tables or do so in patches... $this->invalidateCache(); Modified: branches/1.5.x/library/configs/db/patches.sql =================================================================== --- branches/1.5.x/library/configs/db/patches.sql 2012-01-26 13:52:27 UTC (rev 427) +++ branches/1.5.x/library/configs/db/patches.sql 2012-01-27 15:28:44 UTC (rev 428) @@ -364,3 +364,4 @@ -- PATCH: Default userdefinition per organization ALTER TABLE gems__organizations ADD `gor_user_class` VARCHAR( 30 ) NOT NULL DEFAULT 'StaffUser' AFTER `gor_code`; +ALTER TABLE `gems__radius_config` CHANGE `grcfg_ip` `grcfg_ip` VARCHAR( 39 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL \ No newline at end of file Modified: branches/1.5.x/library/configs/db/tables/gems__radius_config.999.sql =================================================================== --- branches/1.5.x/library/configs/db/tables/gems__radius_config.999.sql 2012-01-26 13:52:27 UTC (rev 427) +++ branches/1.5.x/library/configs/db/tables/gems__radius_config.999.sql 2012-01-27 15:28:44 UTC (rev 428) @@ -1,8 +1,8 @@ CREATE TABLE IF NOT EXISTS `gems__radius_config` ( `grcfg_id` bigint(11) NOT NULL auto_increment, `grcfg_id_organization` bigint(11) NOT NULL, - `grcfg_ip` varchar(39) collate utf8_unicode_ci NOT NULL, + `grcfg_ip` varchar(39) collate utf8_unicode_ci default NULL, `grcfg_port` int(5) default NULL, `grcfg_secret` varchar(32) collate utf8_unicode_ci default NULL, PRIMARY KEY (`grcfg_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-31 08:50:54
|
Revision: 434 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=434&view=rev Author: mennodekker Date: 2012-01-31 08:50:45 +0000 (Tue, 31 Jan 2012) Log Message: ----------- Fxing 'save' button in last tab error Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php branches/1.5.x/library/layouts/scripts/gemsnew.phtml Modified: branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php =================================================================== --- branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php 2012-01-30 15:39:44 UTC (rev 433) +++ branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php 2012-01-31 08:50:45 UTC (rev 434) @@ -292,7 +292,7 @@ */ public function beforeFormDisplay ($form, $isNew) { - if ($this->useTabbedForms) { + if ($this->useTabbedForms || $form instanceof Gems_Form_TableForm) { /* Not needed anymore @@TODO: Remove when proven, as there is a set tab //Create the tabs tried in $form->render() but somehow that is never reached if ($form instanceof Gems_TabForm) { @@ -304,10 +304,13 @@ $element = new MUtil_Form_Element_Html('formLinks'); $element->setValue($links); $element->setOrder(999); - $form->resetContext(); + if ($form instanceof Gems_TabForm) { + $form->resetContext(); + } $form->addElement($element); + $form->addDisplayGroup(array('formLinks'), 'form_buttons'); } - } else { + } else { $table = new MUtil_Html_TableElement(array('class' => 'formTable')); $table->setAsFormLayout($form, true, true); $table['tbody'][0][0]->class = 'label'; // Is only one row with formLayout, so all in output fields get class. @@ -359,6 +362,7 @@ $form = new Gems_TabForm($options); } else { $form = parent::createForm($options); + //$form = new Gems_Form_TableForm($options); } return $form; @@ -713,6 +717,9 @@ $data = $newData + $data; } + if ($form instanceof Gems_TabForm) { + $form->resetContext(); + } return $form; } Modified: branches/1.5.x/library/layouts/scripts/gemsnew.phtml =================================================================== --- branches/1.5.x/library/layouts/scripts/gemsnew.phtml 2012-01-30 15:39:44 UTC (rev 433) +++ branches/1.5.x/library/layouts/scripts/gemsnew.phtml 2012-01-31 08:50:45 UTC (rev 434) @@ -9,6 +9,12 @@ // Check if jQuery library is needed if ($this->jQuery) { echo $this->jQuery(); + //Error message for when jQuery can not be loaded + /*echo "<script> + if (typeof jQuery == 'undefined') { + document.writeln('<div class=\"errors\">The site requires external JavaScript from another domain, which is blocked or failed to load.</div>'); + } + </script>";*/ } // Check if dojo library is needed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-31 11:38:32
|
Revision: 438 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=438&view=rev Author: mennodekker Date: 2012-01-31 11:38:20 +0000 (Tue, 31 Jan 2012) Log Message: ----------- Various doc fixes Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Auth/Adapter/Callback.php branches/1.5.x/library/classes/Gems/Communication/RespondentWriter.php branches/1.5.x/library/classes/Gems/Form/TableForm.php branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php branches/1.5.x/library/classes/Gems/TabForm.php branches/1.5.x/library/snippets/Generic/AutosearchForm.php branches/1.5.x/library/snippets/Generic/CurrentButtonRow.php branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php branches/1.5.x/library/snippets/Generic/ModelItemTableSnippet.php branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php branches/1.5.x/library/snippets/Generic/ModelTabFormSnippet.php branches/1.5.x/library/snippets/Generic/ModelTableSnippet.php Modified: branches/1.5.x/library/classes/Gems/Auth/Adapter/Callback.php =================================================================== --- branches/1.5.x/library/classes/Gems/Auth/Adapter/Callback.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/classes/Gems/Auth/Adapter/Callback.php 2012-01-31 11:38:20 UTC (rev 438) @@ -43,8 +43,25 @@ */ class Gems_Auth_Adapter_Callback implements Zend_Auth_Adapter_Interface { + /** + * The callback to use + * + * @var callback + */ private $_callback; + + /** + * The identity to check + * + * @var string + */ private $_identity; + + /** + * The optional parameters to pass to the callback + * + * @var array + */ private $_params; /** @@ -54,9 +71,9 @@ * return true or false and in that case this adapter will wrap the result * in a Zend_Auth_Result * - * @param type $callback A valid callback - * @param type $identity The identity to use - * @param type $params Array of parameters needed for the callback + * @param callback $callback A valid callback + * @param string $identity The identity to use + * @param array $params Array of parameters needed for the callback */ public function __construct($callback, $identity, $params) { Modified: branches/1.5.x/library/classes/Gems/Communication/RespondentWriter.php =================================================================== --- branches/1.5.x/library/classes/Gems/Communication/RespondentWriter.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/classes/Gems/Communication/RespondentWriter.php 2012-01-31 11:38:20 UTC (rev 438) @@ -41,9 +41,11 @@ interface Gems_Communication_RespondentWriter { /** - * Writes the respondent + * Writes the respondent, creating a new one or updating the existing record + * * @param Gems_Communication_RespondentContainer $respondent - * @return int The internal id of the created/updated respondent + * @param int $userId + * @return boolean True if a new respondent was added, false if one was updated * @throws Gems_Communication_Exception */ public function writeRespondent(Gems_Communication_RespondentContainer $respondent, &$userId); Modified: branches/1.5.x/library/classes/Gems/Form/TableForm.php =================================================================== --- branches/1.5.x/library/classes/Gems/Form/TableForm.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/classes/Gems/Form/TableForm.php 2012-01-31 11:38:20 UTC (rev 438) @@ -28,7 +28,7 @@ * Short description of file * * @package Gems - * @subpackage + * @subpackage Form * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @version $Id$ Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php =================================================================== --- branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2012-01-31 11:38:20 UTC (rev 438) @@ -167,8 +167,9 @@ } /** + * Retrieve the header title to display * - * @return string The header title to display + * @return string */ protected function getTitle() { Modified: branches/1.5.x/library/classes/Gems/TabForm.php =================================================================== --- branches/1.5.x/library/classes/Gems/TabForm.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/classes/Gems/TabForm.php 2012-01-31 11:38:20 UTC (rev 438) @@ -33,6 +33,8 @@ */ /** + * Creates a form using tab-layout where each tab is a subform + * * @package Gems * @subpackage Form * @copyright Copyright (c) 2011 Erasmus MC @@ -41,6 +43,8 @@ class Gems_TabForm extends Gems_Form { /** + * Holds the last tab we added information to + * * @var Gems_Form_TabSubForm */ private $currentTab = null; @@ -168,7 +172,7 @@ /** * Retrieve a named tab (subform) and set the active tab to this one * - * @param type $name + * @param string $name * @return Gems_Form_TabSubForm */ public function getTab($name) @@ -316,6 +320,11 @@ $jquery->addOnLoad($js); } + /** + * Load the default decorators + * + * @return void + */ public function loadDefaultDecorators() { if ($this->loadDefaultDecoratorsIsDisabled()) { return; @@ -335,6 +344,8 @@ } /** + * Reset the currentTab to be the main form again + * * As addElement and addDisplayGroup provide a fluent way of working with subforms * we need to provide a method to skip back to the main form again. */ @@ -342,6 +353,11 @@ $this->currentTab = null; } + /** + * Select a tab by it's numerical index + * + * @param int $tabIdx + */ public function selectTab($tabIdx) { $this->getElement('tab')->setValue($tabIdx); $this->setAttrib('selected', $tabIdx); Modified: branches/1.5.x/library/snippets/Generic/AutosearchForm.php =================================================================== --- branches/1.5.x/library/snippets/Generic/AutosearchForm.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/snippets/Generic/AutosearchForm.php 2012-01-31 11:38:20 UTC (rev 438) @@ -29,7 +29,7 @@ * Short description of file * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -42,7 +42,7 @@ * Long description for class (if any)... * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4.2 Modified: branches/1.5.x/library/snippets/Generic/CurrentButtonRow.php =================================================================== --- branches/1.5.x/library/snippets/Generic/CurrentButtonRow.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/snippets/Generic/CurrentButtonRow.php 2012-01-31 11:38:20 UTC (rev 438) @@ -29,7 +29,7 @@ * Short description of file * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -42,7 +42,7 @@ * Long description for class (if any)... * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4.2 Modified: branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php 2012-01-31 11:38:20 UTC (rev 438) @@ -28,7 +28,7 @@ * * * @package MUtil - * @subpackage Snippets + * @subpackage Snippets\Generic * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -41,7 +41,7 @@ * Usage snippet for Gems_Snippets_ModelTableSnippetGeneric * * @package MUtil - * @subpackage Snippets + * @subpackage Snippets\Generic * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4 Modified: branches/1.5.x/library/snippets/Generic/ModelItemTableSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Generic/ModelItemTableSnippet.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/snippets/Generic/ModelItemTableSnippet.php 2012-01-31 11:38:20 UTC (rev 438) @@ -28,7 +28,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -40,7 +40,7 @@ * the model set through the $model snippet parameter. * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4.4 Modified: branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php 2012-01-31 11:38:20 UTC (rev 438) @@ -40,7 +40,7 @@ * the model set through the $model snippet parameter. * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4.4 Modified: branches/1.5.x/library/snippets/Generic/ModelTabFormSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Generic/ModelTabFormSnippet.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/snippets/Generic/ModelTabFormSnippet.php 2012-01-31 11:38:20 UTC (rev 438) @@ -26,7 +26,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -39,7 +39,7 @@ * Usage snippet for Gems_Snippets_ModelTabFormSnippetGeneric * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.5 Modified: branches/1.5.x/library/snippets/Generic/ModelTableSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Generic/ModelTableSnippet.php 2012-01-31 10:53:47 UTC (rev 437) +++ branches/1.5.x/library/snippets/Generic/ModelTableSnippet.php 2012-01-31 11:38:20 UTC (rev 438) @@ -28,7 +28,7 @@ * * * @package MUtil - * @subpackage Snippets + * @subpackage Snippets\Generic * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -42,7 +42,7 @@ * Usage snippet for Gems_Snippets_ModelTableSnippetGeneric * * @package MUtil - * @subpackage Snippets + * @subpackage Snippets\Generic * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-31 11:46:23
|
Revision: 439 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=439&view=rev Author: mennodekker Date: 2012-01-31 11:46:11 +0000 (Tue, 31 Jan 2012) Log Message: ----------- Various doc fixes Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetGeneric.php branches/1.5.x/library/classes/Gems/Snippets/ModelItemYesNoDeleteSnippetGeneric.php branches/1.5.x/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php branches/1.5.x/library/snippets/Mail/Log/MailLogBrowseSnippet.php branches/1.5.x/library/snippets/Organization/ChooseOrganizationSnippet.php branches/1.5.x/library/snippets/Organization/OrganizationEditSnippet.php branches/1.5.x/library/snippets/Organization/OrganizationTableSnippet.php branches/1.5.x/library/snippets/Respondent/MultiOrganizationTab.php branches/1.5.x/library/snippets/Track/AvailableTracksSnippets.php Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php =================================================================== --- branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/classes/Gems/Snippets/ModelFormSnippetGeneric.php 2012-01-31 11:46:11 UTC (rev 439) @@ -27,7 +27,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * - * @package MUtil + * @package Gems * @subpackage Snippets * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC @@ -44,7 +44,7 @@ * their naming conventions, but exists only to make it simple to extend this class * for a specific implementation. * - * @package MUtil + * @package Gems * @subpackage Snippets * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetGeneric.php =================================================================== --- branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetGeneric.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/classes/Gems/Snippets/ModelItemTableSnippetGeneric.php 2012-01-31 11:46:11 UTC (rev 439) @@ -27,7 +27,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * - * @package MUtil + * @package Gems * @subpackage Snippets * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC @@ -45,7 +45,7 @@ * their naming conventions, but exists only to make it simple to extend this class * for a specific implementation. * - * @package MUtil + * @package Gems * @subpackage Snippets * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelItemYesNoDeleteSnippetGeneric.php =================================================================== --- branches/1.5.x/library/classes/Gems/Snippets/ModelItemYesNoDeleteSnippetGeneric.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/classes/Gems/Snippets/ModelItemYesNoDeleteSnippetGeneric.php 2012-01-31 11:46:11 UTC (rev 439) @@ -27,7 +27,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * - * @package MUtil + * @package Gems * @subpackage Snippets * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC @@ -46,7 +46,7 @@ * their naming conventions, but exists only to make it simple to extend this class * for a specific implementation. * - * @package MUtil + * @package Gems * @subpackage Snippets * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License Modified: branches/1.5.x/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php =================================================================== --- branches/1.5.x/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/classes/Gems/Snippets/ModelTableSnippetGeneric.php 2012-01-31 11:46:11 UTC (rev 439) @@ -27,7 +27,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * - * @package MUtil + * @package Gems * @subpackage Snippets * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC @@ -45,7 +45,7 @@ * their naming conventions, but exists only to make it simple to extend this class * for a specific implementation. * - * @package MUtil + * @package Gems * @subpackage Snippets * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License Modified: branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/snippets/Generic/ModelFormSnippet.php 2012-01-31 11:46:11 UTC (rev 439) @@ -27,7 +27,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * - * @package MUtil + * @package Gems * @subpackage Snippets\Generic * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC @@ -40,7 +40,7 @@ * * Usage snippet for Gems_Snippets_ModelTableSnippetGeneric * - * @package MUtil + * @package Gems * @subpackage Snippets\Generic * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License Modified: branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/snippets/Generic/ModelItemYesNoDeleteSnippet.php 2012-01-31 11:46:11 UTC (rev 439) @@ -28,7 +28,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Generic * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License Modified: branches/1.5.x/library/snippets/Mail/Log/MailLogBrowseSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Mail/Log/MailLogBrowseSnippet.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/snippets/Mail/Log/MailLogBrowseSnippet.php 2012-01-31 11:46:11 UTC (rev 439) @@ -28,7 +28,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Mail\Log * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -40,7 +40,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Mail\Log * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4.4 Modified: branches/1.5.x/library/snippets/Organization/ChooseOrganizationSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Organization/ChooseOrganizationSnippet.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/snippets/Organization/ChooseOrganizationSnippet.php 2012-01-31 11:46:11 UTC (rev 439) @@ -28,7 +28,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Organization * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -39,7 +39,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Organization * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.5 Modified: branches/1.5.x/library/snippets/Organization/OrganizationEditSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/snippets/Organization/OrganizationEditSnippet.php 2012-01-31 11:46:11 UTC (rev 439) @@ -28,7 +28,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Organization * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -39,7 +39,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Organization * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.5 Modified: branches/1.5.x/library/snippets/Organization/OrganizationTableSnippet.php =================================================================== --- branches/1.5.x/library/snippets/Organization/OrganizationTableSnippet.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/snippets/Organization/OrganizationTableSnippet.php 2012-01-31 11:46:11 UTC (rev 439) @@ -28,7 +28,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Organization * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -39,7 +39,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Organization * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.5 Modified: branches/1.5.x/library/snippets/Respondent/MultiOrganizationTab.php =================================================================== --- branches/1.5.x/library/snippets/Respondent/MultiOrganizationTab.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/snippets/Respondent/MultiOrganizationTab.php 2012-01-31 11:46:11 UTC (rev 439) @@ -28,7 +28,7 @@ * * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Respondent * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -39,7 +39,7 @@ * Displays tabs for multiple organizations. * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Respondent * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.5 Modified: branches/1.5.x/library/snippets/Track/AvailableTracksSnippets.php =================================================================== --- branches/1.5.x/library/snippets/Track/AvailableTracksSnippets.php 2012-01-31 11:38:20 UTC (rev 438) +++ branches/1.5.x/library/snippets/Track/AvailableTracksSnippets.php 2012-01-31 11:46:11 UTC (rev 439) @@ -29,7 +29,7 @@ * Short description of file * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Track * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License @@ -42,7 +42,7 @@ * Long description for class (if any)... * * @package Gems - * @subpackage Snippets + * @subpackage Snippets\Track * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-31 15:36:10
|
Revision: 441 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=441&view=rev Author: matijsdejong Date: 2012-01-31 15:35:59 +0000 (Tue, 31 Jan 2012) Log Message: ----------- Added 'default organization' for login to single organization projects ModelSnippetActionAbstract.php pages now also show menu position in the document title Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Controller/ModelActionAbstract.php branches/1.5.x/library/classes/Gems/Controller/ModelSnippetActionAbstract.php branches/1.5.x/library/classes/Gems/Default/OrganizationAction.php branches/1.5.x/library/classes/Gems/Menu.php branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php branches/1.5.x/library/classes/Gems/User/UserLoader.php branches/1.5.x/library/snippets/ShowTrackTokenSnippet.php Modified: branches/1.5.x/library/classes/Gems/Controller/ModelActionAbstract.php =================================================================== --- branches/1.5.x/library/classes/Gems/Controller/ModelActionAbstract.php 2012-01-31 12:30:08 UTC (rev 440) +++ branches/1.5.x/library/classes/Gems/Controller/ModelActionAbstract.php 2012-01-31 15:35:59 UTC (rev 441) @@ -147,13 +147,30 @@ } } + /** + * Return the current request ID, if any. + * + * Overrule this function if the last item in the page title + * should be something other than te value of + * MUtil_Model::REQUEST_ID. + * + * @return mixed + */ public function getInstanceId() { - if ($id = $this->request->getParam(MUtil_Model::REQUEST_ID)) { + if ($id = $this->_getParam(MUtil_Model::REQUEST_ID)) { return $id; } } + /** + * Returns the current html/head/title for this page. + * + * If the title is an array the seperator concatenates the parts. + * + * @param string $separator + * @return string + */ public function getTitle($separator = null) { if ($title_set = parent::getTitle($separator)) { Modified: branches/1.5.x/library/classes/Gems/Controller/ModelSnippetActionAbstract.php =================================================================== --- branches/1.5.x/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-01-31 12:30:08 UTC (rev 440) +++ branches/1.5.x/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-01-31 15:35:59 UTC (rev 441) @@ -208,6 +208,47 @@ } /** + * Return the current request ID, if any. + * + * Overrule this function if the last item in the page title + * should be something other than te value of + * MUtil_Model::REQUEST_ID. + * + * @return mixed + */ + public function getInstanceId() + { + if ($id = $this->_getParam(MUtil_Model::REQUEST_ID)) { + return $id; + } + } + + /** + * Returns the current html/head/title for this page. + * + * If the title is an array the seperator concatenates the parts. + * + * @param string $separator + * @return string + */ + public function getTitle($separator = null) + { + if ($title_set = parent::getTitle($separator)) { + return $title_set; + } + + $title = array(); + foreach($this->menu->getActivePath($this->getRequest()) as $menuItem) { + $title[] = $menuItem->get('label'); + } + if ($id = $this->getInstanceId()) { + $title[] = $id; + } + + return implode($separator, $title); + } + + /** * Intializes the html component. * * @param boolean $reset Throws away any existing html output when true Modified: branches/1.5.x/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- branches/1.5.x/library/classes/Gems/Default/OrganizationAction.php 2012-01-31 12:30:08 UTC (rev 440) +++ branches/1.5.x/library/classes/Gems/Default/OrganizationAction.php 2012-01-31 15:35:59 UTC (rev 441) @@ -166,7 +166,8 @@ if($model->has('gor_user_class')) { $definitions = $this->loader->getUserLoader()->getAvailableStaffDefinitions(); //Use first element as default - $default = array_shift(array_keys($definitions)); + $tmp = array_keys($definitions); + $default = array_shift($tmp); $model->set('gor_user_class', 'default', $default); if (count($definitions)>1) { if ($action !== 'create') { Modified: branches/1.5.x/library/classes/Gems/Menu.php =================================================================== --- branches/1.5.x/library/classes/Gems/Menu.php 2012-01-31 12:30:08 UTC (rev 440) +++ branches/1.5.x/library/classes/Gems/Menu.php 2012-01-31 15:35:59 UTC (rev 441) @@ -282,7 +282,7 @@ $trType = 'T'; $subPage = $page->addPage($this->_('Track'), 'pr.track', 'track', 'show-track') ->addNamedParameters(MUtil_Model::REQUEST_ID, 'gr2o_patient_nr') - ->addHiddenParameter(Gems_Model::TRACK_ID, $this->escort->getTrackId(), 'gtr_track_type', 'T'); + ->addHiddenParameter(Gems_Model::TRACK_ID, $this->escort->getTrackId(), 'gtr_track_type', $trType); $tkPages[$trType] = $subPage->addAction($this->_('Token'), 'pr.token', 'show') ->addNamedParameters(MUtil_Model::REQUEST_ID, 'gto_id_token') Modified: branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php 2012-01-31 12:30:08 UTC (rev 440) +++ branches/1.5.x/library/classes/Gems/Project/ProjectSettings.php 2012-01-31 15:35:59 UTC (rev 441) @@ -225,6 +225,24 @@ } /** + * Returns an (optional) default organization from the project settings + * + * @return int Organization number or -1 when not set + */ + public function getDefaultOrganization() + { + if ($this->offsetExists('organization')) { + $orgs = $this->offsetGet('organization'); + + if (isset($orgs['default'])) { + return $orgs['default']; + } + } + + return -1; + } + + /** * Returns the public name of this project. * @return string */ Modified: branches/1.5.x/library/classes/Gems/User/UserLoader.php =================================================================== --- branches/1.5.x/library/classes/Gems/User/UserLoader.php 2012-01-31 12:30:08 UTC (rev 440) +++ branches/1.5.x/library/classes/Gems/User/UserLoader.php 2012-01-31 15:35:59 UTC (rev 441) @@ -321,6 +321,23 @@ $row = $this->db->fetchRow($sql, $params, Zend_Db::FETCH_NUM); } + if ((! $row) && ($organization == $this->project->getDefaultOrganization())) { + // Check for the current organization being the default one + // + // For optimization do set the allowed organizations + // Try to get see if this is another allowed organization for this user + $sql = "SELECT CONCAT(gul_user_class, 'Definition'), gul_id_organization + FROM gems__user_logins INNER JOIN gems__organizations ON gor_id_organization != gul_id_organization + WHERE gor_active = 1 AND + gul_can_login = 1 AND + gul_login = ? + LIMIT 1"; + + // MUtil_Echo::track($sql, $login_name); + + $row = $this->db->fetchRow($sql, $login_name, Zend_Db::FETCH_NUM); + } + if ($row) { // MUtil_Echo::track($row); return $row; @@ -338,7 +355,20 @@ gems__organizations ON gsf_id_organization = gor_id_organization WHERE gor_active = 1 AND gsf_active = 1 AND gsf_login = ? AND gsf_id_organization = ?"; - if ($user_id = $this->db->fetchOne($sql, array($login_name, $organization))) { + $user_id = $this->db->fetchOne($sql, $params); + + if ((! $user_id) && ($organization == $this->project->getDefaultOrganization())) { + $sql = "SELECT gsf_id_user + FROM gems__staff INNER JOIN + gems__organizations ON gsf_id_organization = gor_id_organization + WHERE gor_active = 1 AND gsf_active = 1 AND gsf_login = ?"; + + // MUtil_Echo::track($sql, $login_name); + + $user_id = $this->db->fetchOne($sql, $login_name); + } + + if ($user_id) { // Move user to new staff. $values['gul_login'] = $login_name; $values['gul_id_organization'] = $organization; Modified: branches/1.5.x/library/snippets/ShowTrackTokenSnippet.php =================================================================== --- branches/1.5.x/library/snippets/ShowTrackTokenSnippet.php 2012-01-31 12:30:08 UTC (rev 440) +++ branches/1.5.x/library/snippets/ShowTrackTokenSnippet.php 2012-01-31 15:35:59 UTC (rev 441) @@ -72,7 +72,7 @@ $bridge->addItem('gto_id_token', null, array('colspan' => 1.5)); $buttons = $links->getActionLinks(true, 'ask', 'take', 'pdf', 'show', $controller, 'questions', $controller, 'answer'); - if ($buttons) { + if (count($buttons)) { $bridge->tr(); $bridge->tdh($this->_('Actions')); $bridge->td($buttons, array('colspan' => 2, 'skiprowclass' => true)); @@ -144,8 +144,11 @@ ->addByController('respondent', 'show', $this->_('Show respondent')) ->addByController('track', 'index', $this->_('Show tracks')) ->addCurrentSiblings() + ->addCurrentChildren() ->showDisabled(); + MUtil_Echo::track($links->count()); + return $links; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-02-02 14:48:33
|
Revision: 446 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=446&view=rev Author: matijsdejong Date: 2012-02-02 14:48:27 +0000 (Thu, 02 Feb 2012) Log Message: ----------- Fixes + small extensions Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php branches/1.5.x/library/snippets/EditTrackSnippet.php Modified: branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php 2012-02-02 14:47:15 UTC (rev 445) +++ branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php 2012-02-02 14:48:27 UTC (rev 446) @@ -201,7 +201,7 @@ /** * Makes sure the respondent data is part of the $this->_respTrackData */ - private function _ensureRespondentData() + protected function _ensureRespondentData() { if (! isset($this->_respTrackData['grs_id_user'], $this->_respTrackData['gr2o_id_user'], $this->_respTrackData['gco_code'])) { $sql = "SELECT * @@ -452,6 +452,16 @@ } /** + * Returns the description of this track as stored in the fields. + * + * @return string + */ + public function getFieldsInfo() + { + return $this->_respTrackData['gr2t_track_info']; + } + + /** * Returns the first token in this track * * @return Gems_Tracker_Token Modified: branches/1.5.x/library/snippets/EditTrackSnippet.php =================================================================== --- branches/1.5.x/library/snippets/EditTrackSnippet.php 2012-02-02 14:47:15 UTC (rev 445) +++ branches/1.5.x/library/snippets/EditTrackSnippet.php 2012-02-02 14:48:27 UTC (rev 446) @@ -153,7 +153,6 @@ } if ($refresh) { - Gems_Tracker::$verbose; // Perform a refresh from the database, to avoid date trouble $this->respondentTrack->refresh(); $this->respondentTrack->checkTrackTokens($this->userId); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-02-05 16:22:32
|
Revision: 449 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=449&view=rev Author: matijsdejong Date: 2012-02-05 16:22:26 +0000 (Sun, 05 Feb 2012) Log Message: ----------- RespondentTokenSnippet filters on the current organization AddTracksSnippet and AnswerModelSnippetGeneric parts can be turned on or off Extra Lazy concat function Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php branches/1.5.x/library/classes/MUtil/Lazy.php branches/1.5.x/library/snippets/AddTracksSnippet.php branches/1.5.x/library/snippets/RespondentTokenSnippet.php Modified: branches/1.5.x/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2012-02-02 17:01:28 UTC (rev 448) +++ branches/1.5.x/library/classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php 2012-02-05 16:22:26 UTC (rev 449) @@ -90,6 +90,13 @@ protected $showButtons = true; /** + * Switch to put the display of the headers on or off + * + * @var boolean + */ + protected $showHeaders = true; + + /** * Switch to put the display of the current token as select to true or false. * * @var boolean @@ -204,14 +211,16 @@ if ($this->tokenId) { if ($this->token->exists) { - $htmlDiv->h3(sprintf($this->_('%s answers for patient number %s'), $this->token->getSurveyName(), $this->token->getPatientNumber())); + if ($this->showHeaders) { + $htmlDiv->h3(sprintf($this->_('%s answers for patient number %s'), $this->token->getSurveyName(), $this->token->getPatientNumber())); - $htmlDiv->pInfo(sprintf( - $this->_('Answers for token %s, patient number %s: %s.'), - strtoupper($this->tokenId), - $this->token->getPatientNumber(), - $this->token->getRespondentName())) - ->appendAttrib('class', 'noprint'); + $htmlDiv->pInfo(sprintf( + $this->_('Answers for token %s, patient number %s: %s.'), + strtoupper($this->tokenId), + $this->token->getPatientNumber(), + $this->token->getRespondentName())) + ->appendAttrib('class', 'noprint'); + } $table = parent::getHtmlOutput($view); $table->setPivot(true, 2, 1); Modified: branches/1.5.x/library/classes/MUtil/Lazy.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Lazy.php 2012-02-02 17:01:28 UTC (rev 448) +++ branches/1.5.x/library/classes/MUtil/Lazy.php 2012-02-05 16:22:26 UTC (rev 449) @@ -73,6 +73,20 @@ return new MUtil_Lazy_Call($lambda, array($opLeft, $opRight)); } + /** + * The arguments are flattened lazily into one single array + * and then joined together without separator. + * + * @param mixed $arg_array + * @return MUtil_Lazy_Call + */ + public static function concat($arg_array = null) + { + $args = func_get_args(); + + return new MUtil_Lazy_Call('implode', array('', new MUtil_Lazy_Call('MUtil_Ra::flatten', $args))); + } + public static function first($args_array) { $args = func_get_args(); Modified: branches/1.5.x/library/snippets/AddTracksSnippet.php =================================================================== --- branches/1.5.x/library/snippets/AddTracksSnippet.php 2012-02-02 17:01:28 UTC (rev 448) +++ branches/1.5.x/library/snippets/AddTracksSnippet.php 2012-02-05 16:22:26 UTC (rev 449) @@ -84,6 +84,28 @@ */ public $session; + /** + * Switch to set display of respondent dropdown on or off + * + * @var boolean + */ + public $showForRespondents = true; + + /** + * Switch to set display of staff dropdown on or off + * + * @var boolean + */ + public $showForStaff = true; + + + /** + * Switch to set display of track dropdown on or off + * + * @var boolean + */ + public $showForTracks = true; + protected function _getTracks($trackType, $pageRef) { switch ($trackType) { @@ -193,6 +215,10 @@ */ public function getHtmlOutput(Zend_View_Abstract $view) { + if (! $this->escort) { + $this->escort = GemsEscort::getInstance(); + } + if ($this->escort instanceof Gems_Project_Tracks_MultiTracksInterface || $this->escort instanceof Gems_Project_Tracks_StandAloneSurveysInterface) { @@ -200,12 +226,16 @@ $addToLists = MUtil_Html::create()->div(array('class' => 'tooldock')); $addToLists->strong($this->_('Add')); - if ($this->escort instanceof Gems_Project_Tracks_MultiTracksInterface) { + if ($this->showForTracks && ($this->escort instanceof Gems_Project_Tracks_MultiTracksInterface)) { $addToLists[] = $this->_getTracks('T', $pageRef); } if ($this->escort instanceof Gems_Project_Tracks_StandAloneSurveysInterface) { - $addToLists[] = $this->_getTracks('S', $pageRef); - $addToLists[] = $this->_getTracks('M', $pageRef); + if ($this->showForRespondents) { + $addToLists[] = $this->_getTracks('S', $pageRef); + } + if ($this->showForStaff) { + $addToLists[] = $this->_getTracks('M', $pageRef); + } } return $addToLists; Modified: branches/1.5.x/library/snippets/RespondentTokenSnippet.php =================================================================== --- branches/1.5.x/library/snippets/RespondentTokenSnippet.php 2012-02-02 17:01:28 UTC (rev 448) +++ branches/1.5.x/library/snippets/RespondentTokenSnippet.php 2012-02-05 16:22:26 UTC (rev 449) @@ -186,7 +186,8 @@ */ protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) { - $filter['gto_id_respondent'] = $this->respondentData['grs_id_user']; + $filter['gto_id_respondent'] = $this->respondentData['grs_id_user']; + $filter['gto_id_organization'] = $this->respondentData['gr2o_id_organization']; $filter[] = 'gr2t_reception_code IN (SELECT grc_id_reception_code FROM gems__reception_codes WHERE grc_success = 1)'; $filter['grc_success'] = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-02-06 12:39:32
|
Revision: 451 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=451&view=rev Author: matijsdejong Date: 2012-02-06 12:39:20 +0000 (Mon, 06 Feb 2012) Log Message: ----------- Extended HtmlElement with getFirst() and getLast() for ease of manipulation. VerticalTableBridge.php no longer adds an empty row to the end of the table EditTrackEnigineSnippet now has a parent object for ease of inheritance Added documentation Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Default/TrackAction.php branches/1.5.x/library/classes/Gems/Default/TrackActionAbstract.php branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php branches/1.5.x/library/classes/MUtil/Html/HtmlElement.php branches/1.5.x/library/classes/MUtil/Html/TBodyElement.php branches/1.5.x/library/classes/MUtil/Lazy.php branches/1.5.x/library/classes/MUtil/Model/FormBridge.php branches/1.5.x/library/classes/MUtil/Model/VerticalTableBridge.php branches/1.5.x/library/snippets/EditTrackEngineSnippet.php Added Paths: ----------- branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php Modified: branches/1.5.x/library/classes/Gems/Default/TrackAction.php =================================================================== --- branches/1.5.x/library/classes/Gems/Default/TrackAction.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/classes/Gems/Default/TrackAction.php 2012-02-06 12:39:20 UTC (rev 451) @@ -71,8 +71,9 @@ protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) { $bridge->gr2t_id_respondent_track; //For show and edit button - $bridge->tr()->appendAttrib('class', $bridge->row_class); + $bridge->tbody()->getFirst(true)->appendAttrib('class', $bridge->row_class); + // Add edit button if allowed, otherwise show, again if allowed if ($menuItem = $this->findAllowedMenuItem('show-track')) { $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); @@ -461,6 +462,9 @@ } } + /** + * Show information on a single track assigned to a respondent + */ public function showTrackAction() { $request = $this->getRequest(); Modified: branches/1.5.x/library/classes/Gems/Default/TrackActionAbstract.php =================================================================== --- branches/1.5.x/library/classes/Gems/Default/TrackActionAbstract.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/classes/Gems/Default/TrackActionAbstract.php 2012-02-06 12:39:20 UTC (rev 451) @@ -203,6 +203,7 @@ { $model = $this->loader->getTracker()->getRespondentTrackModel(); + $model->resetOrder(); $model->set('gtr_track_name', 'label', $this->_('Track')); $model->set('gr2t_track_info', 'label', $this->_('Description'), 'description', $this->_('Enter the particulars concerning the assignment to this respondent.')); Modified: branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php =================================================================== --- branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/classes/Gems/Default/TrackMaintenanceAction.php 2012-02-06 12:39:20 UTC (rev 451) @@ -61,13 +61,16 @@ */ protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) { - if ($this->getRequest()->getActionName() == 'index') { + $request = $this->getRequest(); + + if ($request->getActionName() == 'index') { if ($menuItem = $this->findAllowedMenuItem('show')) { $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); } - if ($menuItem = $this->findAllowedMenuItem('edit')) { - $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); - } + + $menuItem = $this->findAllowedMenuItem('edit'); + } else { + $menuItem = null; } foreach($model->getItemsOrdered() as $name) { @@ -75,6 +78,10 @@ $bridge->addSortable($name, $label); } } + + if ($menuItem) { + $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); + } } /** Modified: branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php 2012-02-06 12:39:20 UTC (rev 451) @@ -110,6 +110,8 @@ $this->set('gtr_active', 'label', $this->translate->_('Active'), 'multiOptions', $translated->getYesNo()); $this->set('gtr_date_start', 'label', $this->translate->_('From'), 'dateFormat', $translated->dateFormatString, 'formatFunction', $translated->formatDate); $this->set('gtr_date_until', 'label', $this->translate->_('Use until'), 'dateFormat', $translated->dateFormatString, 'formatFunction', $translated->formatDateForever); + + return $this; } /** Added: branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php (rev 0) +++ branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php 2012-02-06 12:39:20 UTC (rev 451) @@ -0,0 +1,304 @@ +<?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: EditTrackEngineSnippetGeneric.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Basic snippet for editing track engines instances + * + * @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_EditTrackEngineSnippetGeneric extends Gems_Snippets_ModelFormSnippetAbstract +{ + /** + * + * @var string Field for storing the old track class + */ + protected $_oldClassName = 'old__gtr_track_class'; + + /** + * + * @var Zend_Db_Adapter_Abstract + */ + protected $db; + + /** + * Required + * + * @var Gems_Loader + */ + protected $loader; + + /** + * Optional, required when creating or $trackId should be set + * + * @var Gems_Tracker_Engine_TrackEngineInterface + */ + protected $trackEngine; + + /** + * Optional, required when creating or $engine should be set + * + * @var int Track Id + */ + protected $trackId; + + /** + * @var Gems_Util + */ + protected $util; + + /** + * Adds elements from the model to the bridge that creates the form. + * + * Overrule this function to add different elements to the browse table, without + * having to recode the core table building code. + * + * @param MUtil_Model_FormBridge $bridge + * @param MUtil_Model_ModelAbstract $model + */ + protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) + { + if (! $this->createData) { + $bridge->addHidden('gtr_id_track'); + } + $bridge->addText('gtr_track_name', 'size', 30, 'minlength', 4, 'validator', $model->createUniqueValidator('gtr_track_name')); + + // gtr_track_class + if ($this->trackEngine) { + $options = $model->get('gtr_track_class', 'multiOptions'); + $alternatives = $this->trackEngine->getConversionTargets($options); + if (count($alternatives) > 1) { + $options = $alternatives; + + $bridge->addHidden($this->_oldClassName); + + if (! isset($this->formData[$this->_oldClassName])) { + $this->formData[$this->_oldClassName] = $this->formData['gtr_track_class']; + } + + $classEdit = true; + } else { + $classEdit = false; + } + } else { + $tracker = $this->loader->getTracker(); + $options = $tracker->getTrackEngineList(true, true); + $classEdit = true; + } + $model->set('gtr_track_class', 'multiOptions', $options, 'escape', false); + if ($classEdit) { + $bridge->addRadio( 'gtr_track_class'); + } else { + $bridge->addExhibitor('gtr_track_class'); + } + + $bridge->addDate('gtr_date_start'); + $bridge->addDate('gtr_date_until'); + if (! $this->createData) { + $bridge->addCheckbox('gtr_active'); + } + $bridge->addMultiCheckbox('gtr_organizations', 'label', $this->_('Organizations'), 'multiOptions', $this->util->getDbLookup()->getOrganizations(), 'required', true); + } + + /** + * Should be called after answering the request to allow the Target + * to check if all required registry values have been set correctly. + * + * @return boolean False if required are missing. + */ + public function checkRegistryRequestsAnswers() + { + return $this->db && $this->loader && parent::checkRegistryRequestsAnswers(); + } + + /** + * Creates the model + * + * @return MUtil_Model_ModelAbstract + */ + protected function createModel() + { + $model = $this->loader->getTracker()->getTrackModel(); + $model->applyFormatting(true); + + return $model; + } + + /** + * + * @return Gems_Menu_MenuList + * / + protected function getMenuList() + { + $links = $this->menu->getMenuList(); + $links->addParameterSources($this->request, $this->menu->getParameterSource()); + + $links->addByController('track', 'show-track', $this->_('Show track')) + ->addByController('track', 'index', $this->_('Show tracks')) + ->addByController('respondent', 'show', $this->_('Show respondent')); + + return $links; + } // */ + + /** + * Helper function to allow generalized statements about the items in the model to used specific item names. + * + * @param int $count + * @return $string + */ + public function getTopic($count = 1) + { + return $this->plural('track', 'tracks', $count); + } + + /** + * + * @return string The header title to display + */ + protected function getTitle() + { + if ($this->createData) { + return $this->_('Add new track'); + } else { + return parent::getTitle(); + } + } + + /** + * 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() + { + if ($this->trackEngine && (! $this->trackId)) { + $this->trackId = $this->trackEngine->getTrackId(); + } + + if ($this->trackId) { + // We are updating + $this->createData = false; + + // Try to get $this->trackEngine filled + if (! $this->trackEngine) { + // Set the engine used + $this->trackEngine = $this->loader->getTracker()->getTrackEngine($this->trackId); + } + + } else { + // We are inserting + $this->createData = true; + $this->saveLabel = $this->_($this->_('Add new track')); + } + + return parent::hasHtmlOutput(); + } + + /** + * Hook that loads the form data from $_POST or the model + * + * Or from whatever other source you specify here. + */ + protected function loadFormData() + { + parent::loadFormData(); + + // feature request #200 + if (isset($this->formData['gtr_organizations']) && (! is_array($this->formData['gtr_organizations']))) { + $this->formData['gtr_organizations'] = explode('|', trim($this->formData['gtr_organizations'], '|')); + } + } + + /** + * Hook containing the actual save code. + * + * Call's afterSave() for user interaction. + * + * @see afterSave() + */ + protected function saveData() + { + // feature request #200 + if (isset($this->formData['gtr_organizations']) && is_array($this->formData['gtr_organizations'])) { + $this->formData['gtr_organizations'] = '|' . implode('|', $this->formData['gtr_organizations']) . '|'; + } + if ($this->trackEngine) { + $this->formData['gtr_survey_rounds'] = $this->trackEngine->calculateRoundCount(); + } else { + $this->formData['gtr_survey_rounds'] = 0; + } + + parent::saveData(); + + // Check for creation + if ($this->createData) { + if (isset($this->formData['gtr_id_track'])) { + $this->trackId = $this->formData['gtr_id_track']; + } + } elseif ($this->trackEngine && + isset($this->formData[$this->_oldClassName], $this->formData['gtr_track_class']) && + $this->formData[$this->_oldClassName] != $this->formData['gtr_track_class']) { + + // Track conversion + $this->trackEngine->convertTo($this->formData['gtr_track_class']); + } + } + + /** + * Set what to do when the form is 'finished'. + * + * @return EditTrackEngineSnippet (continuation pattern) + */ + protected function setAfterSaveRoute() + { + // Default is just go to the index + if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) { + $this->afterSaveRouteUrl = array($this->request->getActionKey() => $this->routeAction, MUtil_Model::REQUEST_ID => $this->trackId); + } + + return $this; + } +} Modified: branches/1.5.x/library/classes/MUtil/Html/HtmlElement.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Html/HtmlElement.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/classes/MUtil/Html/HtmlElement.php 2012-02-06 12:39:20 UTC (rev 451) @@ -646,6 +646,18 @@ } } + /** + * Make sure a default child tag element exists. + */ + protected function _ensureDefaultTag() + { + if ($this->_defaultChildTag && (! $this->_content)) { + $value = MUtil_Html::create($this->_defaultChildTag); + $this->_lastChild = $value; + $this->_content[] = $value; + } + } + private function _notAllowedChild($element) { if ($this->_allowedChildTags) { @@ -858,11 +870,43 @@ return $this->_defaultChildTag; } + /** + * Get the first child element. + * + * @param boolean $create A default child tag is created if the element does not exist and has a default child tag + * @return MUtil_Html_HtmlElement or another MUtil_Html_HtmlInterface element + */ + public function getFirst($create = false) + { + if ($create && (! $this->_content)) { + $this->_ensureDefaultTag(); + } + if ($this->_content) { + return reset($this->_content); + } + } + public function getIterator() { return new ArrayIterator($this->_content); } + /** + * Get the last child element. + * + * @param boolean $create A default child tag is created if the element does not exist + * @return MUtil_Html_HtmlElement or another MUtil_Html_HtmlInterface element + */ + public function getLast($create = false) + { + if ($create && (! $this->_content)) { + $this->_ensureDefaultTag(); + } + if ($this->_content) { + return end($this->_content); + } + } + public function getOnEmpty() { if (! $this->_onEmptyContent) { Modified: branches/1.5.x/library/classes/MUtil/Html/TBodyElement.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Html/TBodyElement.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/classes/MUtil/Html/TBodyElement.php 2012-02-06 12:39:20 UTC (rev 451) @@ -89,6 +89,18 @@ } /** + * Make sure a default child tag element exists. + * + * Overruled because of the extra actions in $this->tr() + */ + protected function _ensureDefaultTag() + { + if ($this->_defaultChildTag && (! $this->_content)) { + $this->tr(); + } + } + + /** * Returns the cell or a MUtil_MultiWrapper containing cells that occupy the column position, taking colspan and other functions into account. * * @param int $col The numeric column position, starting at 0; @@ -241,28 +253,7 @@ return $this; } - public function tr($arg_array = null) - { - $args = func_get_args(); - // Set default child tag first and het because otherwise - // the children are created first and the default child tag - // is set afterwards. - if (! array_key_exists('DefaultChildTag', $args)) { - array_unshift($args, array('DefaultChildTag' => $this->getDefaultRowChildTag())); - } - - $tr = MUtil_Html::createArray('tr', $args); - - $this[] = $tr; - - if ((! isset($tr->class)) && ($class = $this->getDefaultRowClass())) { - $tr->class = $class; - } - - return $tr; - } - /** * Static helper function for creation, used by @see MUtil_Html_Creator. * @@ -298,4 +289,32 @@ $args = func_get_args(); return new self(__FUNCTION__, array('DefaultRowChildTag' => 'th'), $args); } + + /** + * Add a row with a class and the correct type of default child tag to this element + * + * @param mixed $arg_array MUtil::args() values + * @return MUtil_Html_TrElement + */ + public function tr($arg_array = null) + { + $args = func_get_args(); + + // Set default child tag first and het because otherwise + // the children are created first and the default child tag + // is set afterwards. + if (! array_key_exists('DefaultChildTag', $args)) { + array_unshift($args, array('DefaultChildTag' => $this->getDefaultRowChildTag())); + } + + $tr = MUtil_Html::createArray('tr', $args); + + $this[] = $tr; + + if ((! isset($tr->class)) && ($class = $this->getDefaultRowClass())) { + $tr->class = $class; + } + + return $tr; + } } \ No newline at end of file Modified: branches/1.5.x/library/classes/MUtil/Lazy.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Lazy.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/classes/MUtil/Lazy.php 2012-02-06 12:39:20 UTC (rev 451) @@ -100,11 +100,27 @@ return $result; } + /** + * Lazy if statement + * + * @param mixed $if The value tested during raise + * @param mixed $then The value after raise when $if is true + * @param mixed $else The value after raise when $if is false + * @return MUtil_Lazy_Call + */ public static function iff($if, $then, $else = null) { return new MUtil_Lazy_Call(array($if, 'if'), array($then, $else)); } + /** + * Lazy if statement + * + * @param mixed $if The value tested during raise + * @param mixed $then The value after raise when $if is true + * @param mixed $else The value after raise when $if is false + * @return MUtil_Lazy_Call + */ public static function iif($if, $then, $else = null) { return new MUtil_Lazy_Call(array($if, 'if'), array($then, $else)); Modified: branches/1.5.x/library/classes/MUtil/Model/FormBridge.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-02-06 12:39:20 UTC (rev 451) @@ -172,7 +172,7 @@ { $args = func_get_args(); $allowedOptionsKeys = MUtil_Ra::args($args, 2); - + $allowedOptions = array(); foreach ($allowedOptionsKeys as $allowedOptionsKey) { if (is_array($allowedOptionsKey)) { @@ -202,7 +202,7 @@ // Remove options already filled. Using simple array addition // might trigger a lot of lazy calculations that are not needed. - //First strip the options that are not allowed + //First strip the options that are not allowed if (MUtil_Model::$verbose) { $strippedKeys = array_keys(array_diff_key($options, array_flip($allowedOptions))); if (!empty($strippedKeys)) { @@ -283,6 +283,13 @@ return $this->_addToForm($name, $element); } + /** + * Add a ZendX date picker to the form + * + * @param string $name Name of element + * @param mixed $arrayOrKey1 MUtil_Ra::pairs() name => value array + * @return ZendX_JQuery_Form_Element_ColorPicker + */ public function addDate($name, $arrayOrKey1 = null, $value1 = null, $key2 = null, $value2 = null) { $options = func_get_args(); Modified: branches/1.5.x/library/classes/MUtil/Model/VerticalTableBridge.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Model/VerticalTableBridge.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/classes/MUtil/Model/VerticalTableBridge.php 2012-02-06 12:39:20 UTC (rev 451) @@ -215,10 +215,6 @@ $this->table->td(); $this->currentColumn++; } - - // Reset row - $this->table->tr(); - $this->currentColumn = 0; } } Modified: branches/1.5.x/library/snippets/EditTrackEngineSnippet.php =================================================================== --- branches/1.5.x/library/snippets/EditTrackEngineSnippet.php 2012-02-06 10:32:06 UTC (rev 450) +++ branches/1.5.x/library/snippets/EditTrackEngineSnippet.php 2012-02-06 12:39:20 UTC (rev 451) @@ -36,7 +36,7 @@ */ /** - * Snippet for editing track engines instances + * Default snippet for editing track engines instances * * @package Gems * @subpackage Snippets @@ -44,261 +44,6 @@ * @license New BSD License * @since Class available since version 1.4 */ -class EditTrackEngineSnippet extends Gems_Snippets_ModelFormSnippetAbstract +class EditTrackEngineSnippet extends Gems_Tracker_Snippets_EditTrackEngineSnippetGeneric { - /** - * - * @var string Field for storing the old track class - */ - protected $_oldClassName = 'old__gtr_track_class'; - - /** - * - * @var Zend_Db_Adapter_Abstract - */ - protected $db; - - /** - * Required - * - * @var Gems_Loader - */ - protected $loader; - - /** - * Optional, required when creating or $trackId should be set - * - * @var Gems_Tracker_Engine_TrackEngineInterface - */ - protected $trackEngine; - - /** - * Optional, required when creating or $engine should be set - * - * @var int Track Id - */ - protected $trackId; - - /** - * @var Gems_Util - */ - protected $util; - - /** - * Adds elements from the model to the bridge that creates the form. - * - * Overrule this function to add different elements to the browse table, without - * having to recode the core table building code. - * - * @param MUtil_Model_FormBridge $bridge - * @param MUtil_Model_ModelAbstract $model - */ - protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) - { - if (! $this->createData) { - $bridge->addHidden('gtr_id_track'); - } - $bridge->addText('gtr_track_name', 'size', 30, 'minlength', 4, 'validator', $model->createUniqueValidator('gtr_track_name')); - - // gtr_track_class - if ($this->trackEngine) { - $options = $model->get('gtr_track_class', 'multiOptions'); - $alternatives = $this->trackEngine->getConversionTargets($options); - if (count($alternatives) > 1) { - $options = $alternatives; - - $bridge->addHidden($this->_oldClassName); - - if (! isset($this->formData[$this->_oldClassName])) { - $this->formData[$this->_oldClassName] = $this->formData['gtr_track_class']; - } - - $classEdit = true; - } else { - $classEdit = false; - } - } else { - $tracker = $this->loader->getTracker(); - $options = $tracker->getTrackEngineList(true, true); - $classEdit = true; - } - $model->set('gtr_track_class', 'multiOptions', $options, 'escape', false); - if ($classEdit) { - $bridge->addRadio( 'gtr_track_class'); - } else { - $bridge->addExhibitor('gtr_track_class'); - } - - $bridge->addDate('gtr_date_start'); - $bridge->addDate('gtr_date_until'); - if (! $this->createData) { - $bridge->addCheckbox('gtr_active'); - } - $bridge->addMultiCheckbox('gtr_organizations', 'label', $this->_('Organizations'), 'multiOptions', $this->util->getDbLookup()->getOrganizations(), 'required', true); - } - - /** - * Should be called after answering the request to allow the Target - * to check if all required registry values have been set correctly. - * - * @return boolean False if required are missing. - */ - public function checkRegistryRequestsAnswers() - { - return $this->db && $this->loader && parent::checkRegistryRequestsAnswers(); - } - - /** - * Creates the model - * - * @return MUtil_Model_ModelAbstract - */ - protected function createModel() - { - $model = $this->loader->getTracker()->getTrackModel(); - $model->applyFormatting(true); - - return $model; - } - - /** - * - * @return Gems_Menu_MenuList - * / - protected function getMenuList() - { - $links = $this->menu->getMenuList(); - $links->addParameterSources($this->request, $this->menu->getParameterSource()); - - $links->addByController('track', 'show-track', $this->_('Show track')) - ->addByController('track', 'index', $this->_('Show tracks')) - ->addByController('respondent', 'show', $this->_('Show respondent')); - - return $links; - } // */ - - /** - * Helper function to allow generalized statements about the items in the model to used specific item names. - * - * @param int $count - * @return $string - */ - public function getTopic($count = 1) - { - return $this->plural('track', 'tracks', $count); - } - - /** - * - * @return string The header title to display - */ - protected function getTitle() - { - if ($this->createData) { - return $this->_('Add new track'); - } else { - return parent::getTitle(); - } - } - - /** - * 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() - { - if ($this->trackEngine && (! $this->trackId)) { - $this->trackId = $this->trackEngine->getTrackId(); - } - - if ($this->trackId) { - // We are updating - $this->createData = false; - - // Try to get $this->trackEngine filled - if (! $this->trackEngine) { - // Set the engine used - $this->trackEngine = $this->loader->getTracker()->getTrackEngine($this->trackId); - } - - } else { - // We are inserting - $this->createData = true; - $this->saveLabel = $this->_($this->_('Add new track')); - } - - return parent::hasHtmlOutput(); - } - - /** - * Hook that loads the form data from $_POST or the model - * - * Or from whatever other source you specify here. - */ - protected function loadFormData() - { - parent::loadFormData(); - - // feature request #200 - if (isset($this->formData['gtr_organizations']) && (! is_array($this->formData['gtr_organizations']))) { - $this->formData['gtr_organizations'] = explode('|', trim($this->formData['gtr_organizations'], '|')); - } - } - - /** - * Hook containing the actual save code. - * - * Call's afterSave() for user interaction. - * - * @see afterSave() - */ - protected function saveData() - { - // feature request #200 - if (isset($this->formData['gtr_organizations']) && is_array($this->formData['gtr_organizations'])) { - $this->formData['gtr_organizations'] = '|' . implode('|', $this->formData['gtr_organizations']) . '|'; - } - if ($this->trackEngine) { - $this->formData['gtr_survey_rounds'] = $this->trackEngine->calculateRoundCount(); - } else { - $this->formData['gtr_survey_rounds'] = 0; - } - - parent::saveData(); - - // Check for creation - if ($this->createData) { - if (isset($this->formData['gtr_id_track'])) { - $this->trackId = $this->formData['gtr_id_track']; - } - } elseif ($this->trackEngine && - isset($this->formData[$this->_oldClassName], $this->formData['gtr_track_class']) && - $this->formData[$this->_oldClassName] != $this->formData['gtr_track_class']) { - - // Track conversion - $this->trackEngine->convertTo($this->formData['gtr_track_class']); - } - } - - /** - * Set what to do when the form is 'finished'. - * - * @return EditTrackEngineSnippet (continuation pattern) - */ - protected function setAfterSaveRoute() - { - // Default is just go to the index - if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) { - $this->afterSaveRouteUrl = array($this->request->getActionKey() => $this->routeAction, MUtil_Model::REQUEST_ID => $this->trackId); - } - - return $this; - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-02-08 12:24:44
|
Revision: 462 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=462&view=rev Author: matijsdejong Date: 2012-02-08 12:24:32 +0000 (Wed, 08 Feb 2012) Log Message: ----------- Standard button use for BrowseEditAction.php Added Icons for track rounds Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php branches/1.5.x/library/classes/Gems/Html.php branches/1.5.x/library/classes/Gems/Snippets/TokenModelSnippetAbstract.php branches/1.5.x/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php branches/1.5.x/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php branches/1.5.x/library/classes/Gems/Tracker/Model/StandardTokenModel.php branches/1.5.x/library/classes/MUtil/Model/FormBridge.php branches/1.5.x/library/configs/db/patches.sql branches/1.5.x/library/configs/db/tables/gems__rounds.40.sql branches/1.5.x/library/snippets/RespondentTokenSnippet.php branches/1.5.x/library/snippets/ShowRoundStepSnippet.php branches/1.5.x/library/snippets/TrackSurveyOverviewSnippet.php branches/1.5.x/library/snippets/TrackTokenOverviewSnippet.php Added Paths: ----------- branches/1.5.x/library/classes/MUtil/Form/Element/Multiselect.php branches/1.5.x/library/classes/MUtil/Form/Element/Select.php branches/1.5.x/library/classes/MUtil/View/Helper/FormSelectHtml.php Modified: branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php =================================================================== --- branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/classes/Gems/Controller/BrowseEditAction.php 2012-02-08 12:24:32 UTC (rev 462) @@ -186,11 +186,16 @@ protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) { // Add edit button if allowed, otherwise show, again if allowed - if ($menuItem = $this->findAllowedMenuItem('edit', 'show')) { + if ($menuItem = $this->findAllowedMenuItem('show')) { $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); } parent::addBrowseTableColumns($bridge, $model); + + // Add edit button if allowed, otherwise show, again if allowed + if ($menuItem = $this->findAllowedMenuItem('edit')) { + $bridge->addItemLink($menuItem->toActionLinkLower($this->getRequest(), $bridge)); + } } /** @@ -959,7 +964,12 @@ $table->setOnEmpty(sprintf($this->_('Unknown %s.'), $this->getTopic(1))); $table->setRepeater($repeater); $table->tfrow($this->createMenuLinks($this->menuShowIncludeLevel), array('class' => 'centerAlign')); + + if ($menuItem = $this->findAllowedMenuItem('edit')) { + $table->tbody()->onclick = array('location.href=\'', $menuItem->toHRefAttribute($this->getRequest()), '\';'); + } + $this->html[] = $table; } } Modified: branches/1.5.x/library/classes/Gems/Html.php =================================================================== --- branches/1.5.x/library/classes/Gems/Html.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/classes/Gems/Html.php 2012-02-08 12:24:32 UTC (rev 462) @@ -1,49 +1,49 @@ <?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. - */ - + /** - * File description of Gems_Html + * Copyright (c) 2011, Erasmus MC + * All rights reserved. * - * @author Matijs de Jong <mj...@ma...> - * @since 1.0 - * @version 1.4 - * @package Gems + * 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 Html + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** - * Class description of Gems_Html + * Gems specific Html elements and settings * - * @author Matijs de Jong <mj...@ma...> - * @package Gems + * @package Gems * @subpackage Html + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 */ class Gems_Html { @@ -87,6 +87,7 @@ // Set the image directories MUtil_Html_ImgElement::addImageDir('gems/images'); + MUtil_Html_ImgElement::addImageDir('gems/icons'); $escort = GemsEscort::getInstance(); if (isset($escort->project->imagedir)) { MUtil_Html_ImgElement::addImageDir($escort->project->imagedir); @@ -146,7 +147,7 @@ } else { $args['class'] = new MUtil_Html_ClassArrayAttribute('browselink'); } - + // MUtil_Echo::r($args); $pager = new MUtil_Html_PagePanel($panel_args); Modified: branches/1.5.x/library/classes/Gems/Snippets/TokenModelSnippetAbstract.php =================================================================== --- branches/1.5.x/library/classes/Gems/Snippets/TokenModelSnippetAbstract.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/classes/Gems/Snippets/TokenModelSnippetAbstract.php 2012-02-08 12:24:32 UTC (rev 462) @@ -54,6 +54,26 @@ */ public $loader; + protected function addTokenLinks(MUtil_Model_TableBridge $bridge) + { + $title = MUtil_Html::create()->strong($this->_('+')); + + $showLinks[] = $this->createMenuLink($bridge, 'track', 'show', $title); + $showLinks[] = $this->createMenuLink($bridge, 'survey', 'show', $title); + + // Remove nulls + $showLinks = array_filter($showLinks); + + if ($showLinks) { + foreach ($showLinks as $showLink) { + if ($showLink) { + $showLink->title = array($this->_('Token'), $bridge->gto_id_token->strtoupper()); + } + } + } + $bridge->addItemLink($showLinks); + } + /** * Creates the model * @@ -71,10 +91,12 @@ 'calc_valid_from', 'gto_valid_from'); $model->addColumn( - 'CASE WHEN gto_completion_time IS NULL THEN gto_id_token ELSE NULL END', + 'CASE WHEN gto_completion_time IS NULL AND grc_success = 1 AND gto_valid_from <= CURRENT_TIMESTAMP AND gto_completion_time IS NULL AND (gto_valid_until IS NULL OR gto_valid_until >= CURRENT_TIMESTAMP) THEN gto_id_token ELSE NULL END', 'calc_id_token', 'gto_id_token'); - + $model->addColumn( + 'CASE WHEN gto_completion_time IS NULL AND grc_success = 1 AND gto_valid_from <= CURRENT_TIMESTAMP AND gto_completion_time IS NULL AND gto_valid_until < CURRENT_TIMESTAMP THEN 1 ELSE 0 END', + 'was_missed'); return $model; } Modified: branches/1.5.x/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2012-02-08 12:24:32 UTC (rev 462) @@ -438,6 +438,7 @@ $model->set('gro_id_survey'); $model->set('gro_round_description'); $model->set('gro_id_order'); + $model->set('gro_icon_file'); // Calculate valid from $model->set('valid_after', 'elementClass', 'html', 'label', ' ', 'value', MUTil_Html::create()->h4($this->_('Valid from calculation'))); Modified: branches/1.5.x/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2012-02-08 12:24:32 UTC (rev 462) @@ -112,6 +112,12 @@ protected $util; /** + * + * @var Zend_View + */ + protected $view; + + /** * Copy from Zend_Translate_Adapter * * Translates the given string @@ -191,6 +197,27 @@ } /** + * Returns a list of available icons under 'htdocs/pulse/icons' + * @return string[] + */ + protected function _getAvailableIcons() + { + $icons = array(); + $iterator = new DirectoryIterator(realpath(GEMS_WEB_DIR . '/gems/icons')); + + foreach ($iterator as $fileinfo) { + if ($fileinfo->isFile()) { + // $icons[$fileinfo->getFilename()] = $fileinfo->getFilename(); + $filename = $fileinfo->getFilename(); + $url = $this->view->baseUrl() . MUtil_Html_ImgElement::getImageDir($filename); + $icons[$fileinfo->getFilename()] = MUtil_Html::create('span', $filename, array('style' => 'background: transparent url(' . $url . $filename . ') center right no-repeat; padding-right: 20px;')); + } + } + + return $icons; + } + + /** * Update the track, both in the database and in memory. * * @param array $values The values that this token should be set to @@ -707,17 +734,29 @@ } $model->set('gro_id_survey', 'label', $this->_('Survey'), 'multiOptions', $this->util->getTrackData()->getAllSurveysAndDescriptions()); + $model->set('gro_icon_file', 'label', $this->_('Icon')); $model->set('gro_id_order', 'label', $this->_('Order'), 'default', 10, 'validators[]', $model->createUniqueValidator(array('gro_id_order', 'gro_id_track'))); $model->set('gro_round_description', 'label', $this->_('Description'), 'size', '30'); //, 'minlength', 4, 'required', true); $model->set('gro_changed_event', 'label', $this->_('After change'), 'multiOptions', $this->events->listRoundChangedEvents()); $model->set('gro_active', 'label', $this->_('Active'), 'multiOptions', $this->util->getTranslated()->getYesNo(), 'elementClass', 'checkbox'); - if ($action == 'create') { - $this->_ensureRounds(); + switch ($action) { + case 'create': + $this->_ensureRounds(); - if ($this->_rounds && ($round = end($this->_rounds))) { - $model->set('gro_id_order', 'default', $round['gro_id_order'] + 10); - } + if ($this->_rounds && ($round = end($this->_rounds))) { + $model->set('gro_id_order', 'default', $round['gro_id_order'] + 10); + } + // Intentional fall through + // break; + case 'edit': + $model->set('gro_icon_file', 'multiOptions', $this->util->getTranslated()->getEmptyDropdownArray() + $this->_getAvailableIcons()); + break; + + default: + $model->set('gro_icon_file', 'formatFunction', array('MUtil_Html_ImgElement', 'imgFile')); + break; + } return $model; Modified: branches/1.5.x/library/classes/Gems/Tracker/Model/StandardTokenModel.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/Model/StandardTokenModel.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/classes/Gems/Tracker/Model/StandardTokenModel.php 2012-02-08 12:24:32 UTC (rev 462) @@ -167,10 +167,16 @@ } //If we are allowed to see who filled out a survey, modify the model accordingly - if (GemsEscort::getInstance()->hasPrivilege('pr.respondent.who')) { + $escort = GemsEscort::getInstance(); + if ($escort->hasPrivilege('pr.respondent.who')) { $this->addLeftTable('gems__staff', array('gto_by' => 'gems__staff_2.gsf_id_user')); $this->addColumn('CASE WHEN gems__staff_2.gsf_id_user IS NULL THEN ggp_name ELSE COALESCE(CONCAT_WS(" ", CONCAT(COALESCE(gems__staff_2.gsf_last_name,"-"),","), gems__staff_2.gsf_first_name, gems__staff_2.gsf_surname_prefix)) END', 'ggp_name'); } + if ($escort->hasPrivilege('pr.respondent.result')) { + $this->addColumn('gto_result', 'calc_result', 'gto_result'); + } else { + $this->addColumn('NULL', 'calc_result', 'gto_result'); + } $this->useTokenAsKey(); } Added: branches/1.5.x/library/classes/MUtil/Form/Element/Multiselect.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Form/Element/Multiselect.php (rev 0) +++ branches/1.5.x/library/classes/MUtil/Form/Element/Multiselect.php 2012-02-08 12:24:32 UTC (rev 462) @@ -0,0 +1,54 @@ +<?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 MUtil + * @subpackage Form + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: MultiselectRaw.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Add Html labels to standard parent + * + * @package MUtil + * @subpackage Form + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class MUtil_Form_Element_Multiselect extends Zend_Form_Element_Multiselect +{ + /** + * Use formSelect view helper by default + * @var string + */ + public $helper = 'formSelectHtml'; +} Added: branches/1.5.x/library/classes/MUtil/Form/Element/Select.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Form/Element/Select.php (rev 0) +++ branches/1.5.x/library/classes/MUtil/Form/Element/Select.php 2012-02-08 12:24:32 UTC (rev 462) @@ -0,0 +1,54 @@ +<?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 MUtil + * @subpackage Form + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: Select.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Add Html labels to standard parent + * + * @package MUtil + * @subpackage Form + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class MUtil_Form_Element_Select extends Zend_Form_Element_Select +{ + /** + * Use formSelect view helper by default + * @var string + */ + public $helper = 'formSelectHtml'; +} Modified: branches/1.5.x/library/classes/MUtil/Model/FormBridge.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-02-08 12:24:32 UTC (rev 462) @@ -553,7 +553,7 @@ $options = $this->_mergeOptions($name, $options, self::DISPLAY_OPTIONS, self::MULTI_OPTIONS); - $element = new Zend_Form_Element_Select($name, $options); + $element = new MUtil_Form_Element_Select($name, $options); return $this->_addToForm($name, $element); } @@ -603,7 +603,7 @@ $options = $this->_mergeOptions($name, $options, self::DISPLAY_OPTIONS, self::MULTI_OPTIONS); - $element = new Zend_Form_Element_Multiselect($name, $options); + $element = new MUtil_Form_Element_Multiselect($name, $options); return $this->_addToForm($name, $element); } Added: branches/1.5.x/library/classes/MUtil/View/Helper/FormSelectHtml.php =================================================================== --- branches/1.5.x/library/classes/MUtil/View/Helper/FormSelectHtml.php (rev 0) +++ branches/1.5.x/library/classes/MUtil/View/Helper/FormSelectHtml.php 2012-02-08 12:24:32 UTC (rev 462) @@ -0,0 +1,132 @@ +<?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 MUtil + * @subpackage View + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: FormSelectHtml.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * + * + * @package MUtil + * @subpackage View + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class MUtil_View_Helper_FormSelectHtml extends Zend_View_Helper_FormSelect +{ + /** + * Builds the actual <option> tag + * + * @param string $value Options Value + * @param string $label Options Label + * @param array $selected The option value(s) to mark as 'selected' + * @param array|bool $disable Whether the select is disabled, or individual options are + * @return string Option Tag XHTML + */ + protected function _build($value, $label, $selected, $disable) + { + if (is_bool($disable)) { + $disable = array(); + } + + $opt = '<option' + . ' value="' . $this->view->escape($value) . '"'; + + if ($label instanceof MUtil_Html_HtmlElement) { + // Element not allowed, get parts that are allowed + foreach (array('class', 'dir', 'id', 'label', 'lang', 'style', 'title') as $attr) { + if (isset($label->$attr)) { + $opt .= ' ' . $attr . '="' . $this->view->escape($label->$attr) . '"'; + } + } + + // Now get the content + $renderer = MUtil_Html::getRenderer(); + $content = ''; + foreach ($label->getIterator() as $part) { + $content .= $renderer->renderAny($this->view, $part); + } + + } elseif ($label instanceof MUtil_Html_HtmlInterface) { + $content = $label->render($this->view); + } else { + $content = $this->view->escape($label); + $opt .= ' label="' . $this->view->escape($label) . '"'; + + } + + // selected? + if (in_array((string) $value, $selected)) { + $opt .= ' selected="selected"'; + } + + // disabled? + if (in_array($value, $disable)) { + $opt .= ' disabled="disabled"'; + } + + $opt .= '>' . $content . "</option>"; + + return $opt; + } + /** + * Generates 'select' list of options. + * + * @access public + * + * @param string|array $name If a string, the element name. If an + * array, all other parameters are ignored, and the array elements + * are extracted in place of added parameters. + * + * @param mixed $value The option value to mark as 'selected'; if an + * array, will mark all values in the array as 'selected' (used for + * multiple-select elements). + * + * @param array|string $attribs Attributes added to the 'select' tag. + * + * @param array $options An array of key-value pairs where the array + * key is the radio value, and the array value is the radio text. + * + * @param string $listsep When disabled, use this list separator string + * between list values. + * + * @return string The select tag and options XHTML. + */ + public function formSelectHtml($name, $value = null, $attribs = null, + $options = null, $listsep = "<br />\n") + { + return parent::formSelect($name, $value, $attribs, $options, $listsep); + } +} Modified: branches/1.5.x/library/configs/db/patches.sql =================================================================== --- branches/1.5.x/library/configs/db/patches.sql 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/configs/db/patches.sql 2012-02-08 12:24:32 UTC (rev 462) @@ -364,4 +364,7 @@ -- PATCH: Default userdefinition per organization ALTER TABLE gems__organizations ADD `gor_user_class` VARCHAR( 30 ) NOT NULL DEFAULT 'StaffUser' AFTER `gor_code`; -ALTER TABLE `gems__radius_config` CHANGE `grcfg_ip` `grcfg_ip` VARCHAR( 39 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL \ No newline at end of file +ALTER TABLE `gems__radius_config` CHANGE `grcfg_ip` `grcfg_ip` VARCHAR( 39 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL + +-- PATCH: Add icon field to rounds +ALTER TABLE `gems__rounds` ADD gro_icon_file VARCHAR(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER `gro_round_description`; Modified: branches/1.5.x/library/configs/db/tables/gems__rounds.40.sql =================================================================== --- branches/1.5.x/library/configs/db/tables/gems__rounds.40.sql 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/configs/db/tables/gems__rounds.40.sql 2012-02-08 12:24:32 UTC (rev 462) @@ -12,6 +12,7 @@ gro_survey_name varchar(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, gro_round_description varchar(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gro_icon_file VARCHAR(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, gro_changed_event varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, -- depreciated Modified: branches/1.5.x/library/snippets/RespondentTokenSnippet.php =================================================================== --- branches/1.5.x/library/snippets/RespondentTokenSnippet.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/snippets/RespondentTokenSnippet.php 2012-02-08 12:24:32 UTC (rev 462) @@ -104,6 +104,8 @@ $roundDescription[] = $HTML->if($bridge->calc_round_description, $HTML->small(' [', $bridge->calc_round_description, ']')); $roundDescription[] = $HTML->small(' [', $bridge->createSortLink('calc_round_description'), ']'); + $roundIcon[] = MUtil_Lazy::iif($bridge->gro_icon_file, MUtil_Html::create('img', array('src' => $bridge->gro_icon_file, 'class' => 'icon'))); + if ($menuItem = $this->findMenuItem('track', 'show-track')) { $href = $menuItem->toHRefAttribute($this->request, $bridge); $track1 = $HTML->if($bridge->calc_track_name, $HTML->a($href, $bridge->calc_track_name)); @@ -120,7 +122,7 @@ // $bridge->colgroup(array('span' => 3, 'width' => '9em')); $bridge->addMultiSort($track); - $bridge->addMultiSort('gsu_survey_name', $roundDescription); + $bridge->addMultiSort('gsu_survey_name', $roundDescription, $roundIcon); $bridge->addSortable('ggp_name'); $bridge->addSortable('calc_used_date', null, $HTML->if($bridge->is_completed, 'disabled date', 'enabled date')); $bridge->addSortable('gto_changed'); @@ -135,10 +137,6 @@ $bridge->useRowHref = false; - $title = $HTML->strong($this->_('+')); - - $showLinks[] = $this->createMenuLink($bridge, 'track', 'show', $title); - $showLinks[] = $this->createMenuLink($bridge, 'survey', 'show', $title); $actionLinks[] = $this->createMenuLink($bridge, 'track', 'answer'); $actionLinks[] = $this->createMenuLink($bridge, 'survey', 'answer'); $actionLinks[] = array( @@ -149,18 +147,13 @@ // MUtil_Lazy::comp($bridge->val1, '==', $bridge->val2)->if($bridge->val3, 'broehaha'); // Remove nulls - $showLinks = array_filter($showLinks); $actionLinks = array_filter($actionLinks); - if ($showLinks || $actionLinks) { - foreach ($showLinks as $showLink) { - if ($showLink) { - $showLink->title = array($this->_('Token'), $bridge->gto_id_token->strtoupper()); - } - } + if ($actionLinks) { $bridge->addItemLink($actionLinks); - $bridge->addItemLink($showLinks); } + + $this->addTokenLinks($bridge); } /** Modified: branches/1.5.x/library/snippets/ShowRoundStepSnippet.php =================================================================== --- branches/1.5.x/library/snippets/ShowRoundStepSnippet.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/snippets/ShowRoundStepSnippet.php 2012-02-08 12:24:32 UTC (rev 462) @@ -94,6 +94,7 @@ $bridge->addItem('gro_id_survey'); $bridge->addItem('gro_round_description'); $bridge->addItem('gro_id_order'); + $bridge->addItem('gro_icon_file'); $bridge->addItem($model->get('valid_after', 'value')); $this->_addIf(array('grp_valid_after_source', 'grp_valid_after_id', 'grp_valid_after_field'), $bridge, $model); @@ -109,6 +110,13 @@ $bridge->addItem('gro_active'); $bridge->addItem('gro_changed_event'); + + $menuItem = $this->menu->find(array( + $this->request->getControllerKey() => $this->request->getControllerName(), + $this->request->getActionKey() => 'edit')); + if ($menuItem) { + $bridge->tbody()->onclick = array('location.href=\'', $menuItem->toHRefAttribute($this->request), '\';'); + } } /** Modified: branches/1.5.x/library/snippets/TrackSurveyOverviewSnippet.php =================================================================== --- branches/1.5.x/library/snippets/TrackSurveyOverviewSnippet.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/snippets/TrackSurveyOverviewSnippet.php 2012-02-08 12:24:32 UTC (rev 462) @@ -105,7 +105,10 @@ $table->addColumn($link->toActionLinkLower($trackRepeater)); } - $table->addColumn($trackRepeater->gsu_survey_name, $this->_('Survey')); + $surveyName[] = $trackRepeater->gsu_survey_name; + $surveyName[] = MUtil_Lazy::iif($trackRepeater->gro_icon_file, MUtil_Html::create('img', array('src' => $trackRepeater->gro_icon_file, 'class' => 'icon'))); + + $table->addColumn($surveyName, $this->_('Survey')); $table->addColumn($trackRepeater->gro_round_description, $this->_('Details')); $table->addColumn($trackRepeater->ggp_name, $this->_('By')); $table->addColumn($trackRepeater->gsu_survey_description->call(array(__CLASS__, 'oneLine')), @@ -116,7 +119,7 @@ private function getRepeater($trackId) { $sql = " - SELECT gro_id_round, gro_id_track, gro_round_description, gro_valid_after, gro_valid_for, gro_used_date, gro_active, + SELECT gro_id_round, gro_id_track, gro_round_description, gro_icon_file, gro_valid_after, gro_valid_for, gro_used_date, gro_active, gsu_id_survey, gsu_survey_name, gsu_survey_description, gsu_survey_pdf, gsu_active, ggp_name FROM gems__rounds LEFT JOIN gems__surveys ON gro_id_survey = gsu_id_survey Modified: branches/1.5.x/library/snippets/TrackTokenOverviewSnippet.php =================================================================== --- branches/1.5.x/library/snippets/TrackTokenOverviewSnippet.php 2012-02-08 12:15:39 UTC (rev 461) +++ branches/1.5.x/library/snippets/TrackTokenOverviewSnippet.php 2012-02-08 12:24:32 UTC (rev 462) @@ -103,7 +103,8 @@ $showLinks = array_filter($showLinks); // Columns - $bridge->addSortable('gsu_survey_name'); + $bridge->addSortable('gsu_survey_name') + ->append(MUtil_Lazy::iif($bridge->gro_icon_file, MUtil_Html::create('img', array('src' => $bridge->gro_icon_file, 'class' => 'icon')))); $bridge->addSortable('gto_round_description'); $bridge->addSortable('ggp_name'); $bridge->addSortable('gto_valid_from', null, 'date'); @@ -133,7 +134,6 @@ } $bridge->addItemLink($showLinks); } - } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-02-08 17:52:17
|
Revision: 465 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=465&view=rev Author: matijsdejong Date: 2012-02-08 17:52:07 +0000 (Wed, 08 Feb 2012) Log Message: ----------- Small corrections Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Tracker.php branches/1.5.x/library/languages/default-nl.po Modified: branches/1.5.x/library/classes/Gems/Tracker.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker.php 2012-02-08 12:30:31 UTC (rev 464) +++ branches/1.5.x/library/classes/Gems/Tracker.php 2012-02-08 17:52:07 UTC (rev 465) @@ -168,7 +168,7 @@ */ private function _checkUserId($userId = null) { if (empty($userId)) { - $userId = $this->session->user_id; + $userId = isset($this->session->user_id) ? $this->session->user_id : 0; } return $userId; } Modified: branches/1.5.x/library/languages/default-nl.po =================================================================== --- branches/1.5.x/library/languages/default-nl.po 2012-02-08 12:30:31 UTC (rev 464) +++ branches/1.5.x/library/languages/default-nl.po 2012-02-08 17:52:07 UTC (rev 465) @@ -384,7 +384,7 @@ #: classes/Gems/Model.php:224 msgid "City" -msgstr "Stad" +msgstr "Woonplaats" #: classes/Gems/Model.php:226 msgid "Phone" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-02-09 11:46:33
|
Revision: 466 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=466&view=rev Author: matijsdejong Date: 2012-02-09 11:46:23 +0000 (Thu, 09 Feb 2012) Log Message: ----------- Version numbers update to 1.5.1 Track fields with code names added to mail template variables New _layoutLogin moved to GemsEscort Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Default/MailJobAction.php branches/1.5.x/library/classes/Gems/Versions.php branches/1.5.x/library/classes/GemsEscort.php branches/1.5.x/library/classes/MUtil/Version.php branches/1.5.x/library/configs/db/patches.sql Modified: branches/1.5.x/library/classes/Gems/Default/MailJobAction.php =================================================================== --- branches/1.5.x/library/classes/Gems/Default/MailJobAction.php 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/classes/Gems/Default/MailJobAction.php 2012-02-09 11:46:23 UTC (rev 466) @@ -111,7 +111,7 @@ $model->set('gmj_from_fixed', 'label', $this->_('From other'), 'description', sprintf($this->_("Only when '%s' is '%s'."), $model->get('gmj_from_method', 'label'), end($fromMethods))); } - $model->set('gmj_process_method', 'label', $this->_('Processing Method'), 'multiOptions', $unselected + $translated->getBulkMailProcessOptions()); + $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'); Modified: branches/1.5.x/library/classes/Gems/Versions.php =================================================================== --- branches/1.5.x/library/classes/Gems/Versions.php 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/classes/Gems/Versions.php 2012-02-09 11:46:23 UTC (rev 466) @@ -43,12 +43,12 @@ { public final function getBuild() { - return 43; + return 44; } public final function getGemsVersion() { - return '1.5'; + return '1.5.1'; } public function getProjectVersion() Modified: branches/1.5.x/library/classes/GemsEscort.php =================================================================== --- branches/1.5.x/library/classes/GemsEscort.php 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/classes/GemsEscort.php 2012-02-09 11:46:23 UTC (rev 466) @@ -719,12 +719,42 @@ } /** + * Display either a link to the login screen or displays the name of the current user + * and a logoff link. + * * Function called if specified in the Project.ini layoutPrepare section before * the layout is drawn, but after the rest of the program has run it's course. * * @return mixed If null nothing is set, otherwise the name of * the function is used as Zend_View variable name. */ + protected function _layoutLogin(array $args = null) + { + $user = $this->getLoader()->getCurrentUser(); + + $div = MUtil_Html::create('div', array('id' => 'login'), $args); + + $p = $div->p(); + if ($user->isActive()) { + $p->append(sprintf($this->_('You are logged in as %s'), $user->getFullName())); + $item = $this->menu->findFirst(array($this->request->getControllerKey() => 'index', $this->request->getActionKey() => 'logoff')); + $p->a($item->toHRefAttribute(), $this->_('Logoff'), array('class' => 'logout')); + } else { + $item = $this->menu->findFirst(array($this->request->getControllerKey() => 'index', $this->request->getActionKey() => 'login')); + $p->a($item->toHRefAttribute(), $this->_('You are not logged in'), array('class' => 'logout')); + } + $item->set('visible', false); + + return $div; + } + + /** + * Function called if specified in the Project.ini layoutPrepare section before + * the layout is drawn, but after the rest of the program has run it's course. + * + * @return mixed If null nothing is set, otherwise the name of + * the function is used as Zend_View variable name. + */ protected function _layoutMessages(array $args = null) { // Do not trust $messenger being set in the view, @@ -1609,6 +1639,13 @@ return $this; } + /** + * Returns an array of {field_names} => values for this token for + * use in an e-mail tamplate. + * + * @param array $tokenData + * @return array + */ public function tokenMailFields(array $tokenData) { $locale = isset($tokenData['grs_iso_lang']) ? $tokenData['grs_iso_lang'] : $this->locale; @@ -1668,6 +1705,19 @@ $result['{track}'] = $tokenData['gtr_track_name']; + $join = $this->db->quoteInto('gtf_id_field = gr2t2f_id_field AND gr2t2f_id_respondent_track = ?', $tokenData['gto_id_respondent_track']); + $select = $this->db->select(); + $select->from('gems__track_fields', array(new Zend_Db_Expr("CONCAT('{track.', gtf_field_code, '}')"))) + ->joinLeft('gems__respondent2track2field', $join, array('gr2t2f_value')) + ->distinct() + ->where('gtf_field_code IS NOT NULL') + ->order('gtf_field_code'); + $codes = $this->db->fetchPairs($select); + + $result = $result + $codes; + // MUtil_Echo::track($codes); + + return $result; } } Modified: branches/1.5.x/library/classes/MUtil/Version.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Version.php 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/classes/MUtil/Version.php 2012-02-09 11:46:23 UTC (rev 466) @@ -34,7 +34,7 @@ { const MAJOR = 1; const MINOR = 0; - const BUILD = 30; + const BUILD = 31; public static function get() { Modified: branches/1.5.x/library/configs/db/patches.sql =================================================================== --- branches/1.5.x/library/configs/db/patches.sql 2012-02-08 17:52:07 UTC (rev 465) +++ branches/1.5.x/library/configs/db/patches.sql 2012-02-09 11:46:23 UTC (rev 466) @@ -366,5 +366,6 @@ ALTER TABLE gems__organizations ADD `gor_user_class` VARCHAR( 30 ) NOT NULL DEFAULT 'StaffUser' AFTER `gor_code`; ALTER TABLE `gems__radius_config` CHANGE `grcfg_ip` `grcfg_ip` VARCHAR( 39 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL +-- GEMS VERSION: 44 -- PATCH: Add icon field to rounds ALTER TABLE `gems__rounds` ADD gro_icon_file VARCHAR(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER `gro_round_description`; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-02-14 10:21:09
|
Revision: 470 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=470&view=rev Author: mennodekker Date: 2012-02-14 10:20:56 +0000 (Tue, 14 Feb 2012) Log Message: ----------- updated translations Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Upgrades.php branches/1.5.x/library/languages/default-en.mo branches/1.5.x/library/languages/default-en.po branches/1.5.x/library/languages/default-nl.mo branches/1.5.x/library/languages/default-nl.po Modified: branches/1.5.x/library/classes/Gems/Upgrades.php =================================================================== --- branches/1.5.x/library/classes/Gems/Upgrades.php 2012-02-13 15:44:10 UTC (rev 469) +++ branches/1.5.x/library/classes/Gems/Upgrades.php 2012-02-14 10:20:56 UTC (rev 470) @@ -66,9 +66,9 @@ */ public function Upgrade143to15() { - $this->addMessage($this->_('Executing patchlevel 42')); + $this->addMessage(sprintf($this->_('Executing patchlevel %d'),42)); $this->patcher->executePatch(42); - $this->addMessage($this->_('Executing patchlevel 43')); + $this->addMessage(sprintf($this->_('Executing patchlevel %d'),43)); $this->patcher->executePatch(43); $this->invalidateCache(); Modified: branches/1.5.x/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: branches/1.5.x/library/languages/default-en.po =================================================================== --- branches/1.5.x/library/languages/default-en.po 2012-02-13 15:44:10 UTC (rev 469) +++ branches/1.5.x/library/languages/default-en.po 2012-02-14 10:20:56 UTC (rev 470) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-01-24 12:42+0100\n" +"POT-Creation-Date: 2012-02-14 10:57+0100\n" "PO-Revision-Date: \n" "Last-Translator: Menno Dekker <men...@er...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -18,58 +18,72 @@ "X-Poedit-KeywordsList: plural:1,2\n" "X-Poedit-SearchPath-0: .\n" -#: classes/GemsEscort.php:207 +#: classes/GemsEscort.php:211 #, php-format msgid "Path %s not writable" msgstr "Path %s not writable" -#: classes/GemsEscort.php:893 +#: classes/GemsEscort.php:739 #, php-format +msgid "You are logged in as %s" +msgstr "You are logged in as %s" + +#: classes/GemsEscort.php:741 +#: classes/Gems/Menu.php:248 +msgid "Logoff" +msgstr "Logoff" + +#: classes/GemsEscort.php:744 +msgid "You are not logged in" +msgstr "You are not logged in" + +#: classes/GemsEscort.php:927 +#, php-format msgid "User: %s" msgstr "User: %s" -#: classes/GemsEscort.php:918 +#: classes/GemsEscort.php:952 msgid "version" msgstr "version" -#: classes/GemsEscort.php:1349 +#: classes/GemsEscort.php:1383 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:1479 +#: classes/GemsEscort.php:1513 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1481 -#: classes/GemsEscort.php:1485 -#: classes/GemsEscort.php:1486 +#: classes/GemsEscort.php:1515 +#: classes/GemsEscort.php:1519 +#: classes/GemsEscort.php:1520 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1496 +#: classes/GemsEscort.php:1530 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1498 -#: classes/GemsEscort.php:1540 +#: classes/GemsEscort.php:1532 +#: classes/GemsEscort.php:1574 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1514 +#: classes/GemsEscort.php:1548 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1516 +#: classes/GemsEscort.php:1550 #, 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:1526 -#: classes/GemsEscort.php:1538 +#: classes/GemsEscort.php:1560 +#: classes/GemsEscort.php:1572 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1527 +#: classes/GemsEscort.php:1561 msgid "You must login to access this page." msgstr "You must login to access this page." @@ -81,31 +95,31 @@ msgid "Combination of organization, username and password not found." msgstr "Combination of organization, username and password not found." -#: classes/Gems/Html.php:154 +#: classes/Gems/Html.php:155 msgid "<< First" msgstr "<< First" -#: classes/Gems/Html.php:155 +#: classes/Gems/Html.php:156 msgid "< Previous" msgstr "< Previous" -#: classes/Gems/Html.php:156 +#: classes/Gems/Html.php:157 msgid "Next >" msgstr "Next >" -#: classes/Gems/Html.php:157 +#: classes/Gems/Html.php:158 msgid "Last >>" msgstr "Last >>" -#: classes/Gems/Html.php:158 +#: classes/Gems/Html.php:159 msgid " | " msgstr " | " -#: classes/Gems/Html.php:162 +#: classes/Gems/Html.php:163 msgid "to" msgstr "to" -#: classes/Gems/Html.php:163 +#: classes/Gems/Html.php:164 msgid "of" msgstr "of" @@ -251,10 +265,6 @@ msgid "Token" msgstr "Token" -#: classes/Gems/Menu.php:248 -msgid "Logoff" -msgstr "Logoff" - #: classes/Gems/Menu.php:283 msgid "Track" msgstr "Track" @@ -413,114 +423,138 @@ msgid "Checks performed" msgstr "Checks performed" -#: classes/Gems/UpgradesAbstract.php:164 +#: classes/Gems/Upgrades.php:69 +#: classes/Gems/Upgrades.php:71 +#, php-format +msgid "Executing patchlevel %d" +msgstr "Executing patchlevel %d" + +#: classes/Gems/Upgrades.php:76 +msgid "Creating new tables" +msgstr "Creating new tables" + +#: classes/Gems/Upgrades.php:81 +msgid "Syncing surveys for all sources" +msgstr "Syncing surveys for all sources" + +#: classes/Gems/UpgradesAbstract.php:175 +#, php-format +msgid "Finished %s creation script for object %d of %d" +msgstr "Finished %s creation script for object %d of %d" + +#: classes/Gems/UpgradesAbstract.php:206 msgid "Already at max. level." msgstr "Already at max. level." -#: classes/Gems/UpgradesAbstract.php:171 +#: classes/Gems/UpgradesAbstract.php:213 #, php-format msgid "Trying upgrade for %s from level %s to level %s" msgstr "Trying upgrade for %s from level %s to level %s" -#: classes/Gems/UpgradesAbstract.php:179 +#: classes/Gems/UpgradesAbstract.php:221 #, php-format msgid "Trying upgrade for %s to level %s: %s" msgstr "Trying upgrade for %s to level %s: %s" -#: classes/Gems/UpgradesAbstract.php:337 +#: classes/Gems/UpgradesAbstract.php:379 msgid "Cache cleaned" msgstr "Cache cleaned" -#: classes/Gems/Controller/BrowseEditAction.php:346 +#: classes/Gems/Controller/BrowseEditAction.php:352 #, php-format msgid "New %s..." msgstr "New %s..." -#: classes/Gems/Controller/BrowseEditAction.php:378 +#: classes/Gems/Controller/BrowseEditAction.php:385 #, php-format msgid "Delete %s" msgstr "Delete %s" -#: classes/Gems/Controller/BrowseEditAction.php:382 +#: classes/Gems/Controller/BrowseEditAction.php:389 #, php-format msgid "%2$u %1$s deleted" msgstr "%2$u %1$s deleted" -#: classes/Gems/Controller/BrowseEditAction.php:396 +#: classes/Gems/Controller/BrowseEditAction.php:403 #, php-format msgid "Edit %s" msgstr "Edit %s" -#: classes/Gems/Controller/BrowseEditAction.php:493 +#: classes/Gems/Controller/BrowseEditAction.php:500 msgid "Free search text" msgstr "Free search text" -#: classes/Gems/Controller/BrowseEditAction.php:564 +#: classes/Gems/Controller/BrowseEditAction.php:571 msgid "Search" msgstr "Search" -#: classes/Gems/Controller/BrowseEditAction.php:580 +#: classes/Gems/Controller/BrowseEditAction.php:587 #, php-format msgid "No %s found" msgstr "No %s found" -#: classes/Gems/Controller/BrowseEditAction.php:653 +#: classes/Gems/Controller/BrowseEditAction.php:660 +#: classes/Gems/Default/ExportAction.php:234 #, php-format msgid "No %s found." msgstr "No %s found." -#: classes/Gems/Controller/BrowseEditAction.php:768 +#: classes/Gems/Controller/BrowseEditAction.php:778 msgid "Are you sure?" msgstr "Are you sure?" -#: classes/Gems/Controller/BrowseEditAction.php:784 +#: classes/Gems/Controller/BrowseEditAction.php:794 +#: classes/Gems/Default/DatabaseAction.php:171 +#: classes/Gems/Default/DatabaseAction.php:483 msgid "Yes" msgstr "Yes" -#: classes/Gems/Controller/BrowseEditAction.php:785 +#: classes/Gems/Controller/BrowseEditAction.php:795 +#: classes/Gems/Default/DatabaseAction.php:172 +#: classes/Gems/Default/DatabaseAction.php:484 msgid "No" msgstr "No" -#: classes/Gems/Controller/BrowseEditAction.php:838 +#: classes/Gems/Controller/BrowseEditAction.php:848 #, php-format msgid "Unknown %s requested" msgstr "Unknown %s requested" -#: classes/Gems/Controller/BrowseEditAction.php:861 +#: classes/Gems/Controller/BrowseEditAction.php:871 #, php-format msgid "New %1$s..." msgstr "New %1$s..." -#: classes/Gems/Controller/BrowseEditAction.php:869 +#: classes/Gems/Controller/BrowseEditAction.php:879 msgid "Save" msgstr "Save" -#: classes/Gems/Controller/BrowseEditAction.php:905 +#: classes/Gems/Controller/BrowseEditAction.php:915 #, php-format msgid "%2$u %1$s saved" msgstr "%2$u %1$s saved" -#: classes/Gems/Controller/BrowseEditAction.php:908 +#: classes/Gems/Controller/BrowseEditAction.php:918 msgid "No changes to save." msgstr "No changes to save." -#: classes/Gems/Controller/BrowseEditAction.php:917 +#: classes/Gems/Controller/BrowseEditAction.php:927 msgid "Input error! No changes saved!" msgstr "Input error! No changes saved!" -#: classes/Gems/Controller/BrowseEditAction.php:945 +#: classes/Gems/Controller/BrowseEditAction.php:955 #, php-format msgid "Show %s" msgstr "Show %s" -#: classes/Gems/Controller/BrowseEditAction.php:952 +#: classes/Gems/Controller/BrowseEditAction.php:962 #, php-format msgid "Unknown %s." msgstr "Unknown %s." #: classes/Gems/Controller/ModelActionAbstract.php:97 #: classes/Gems/Default/AskAction.php:150 -#: classes/Gems/Default/DatabaseAction.php:532 +#: classes/Gems/Default/DatabaseAction.php:487 msgid "Cancel" msgstr "Cancel" @@ -634,7 +668,7 @@ msgstr "Description" #: classes/Gems/Default/ConsentAction.php:70 -#: classes/Gems/Default/DatabaseAction.php:167 +#: classes/Gems/Default/DatabaseAction.php:123 msgid "Order" msgstr "Order" @@ -700,306 +734,260 @@ 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." -#: classes/Gems/Default/DatabaseAction.php:64 -#, php-format -msgid "Executed %2$s creation script %1$s:" -msgstr "Executed %2$s creation script %1$s:" - -#: classes/Gems/Default/DatabaseAction.php:74 -#, php-format -msgid "%d record(s) returned as result set %d in step %d of %d." -msgstr "%d record(s) returned as result set %d in step %d of %d." - -#: classes/Gems/Default/DatabaseAction.php:78 -#, php-format -msgid "%d record(s) updated in step %d of %d." -msgstr "%d record(s) updated in step %d of %d." - -#: classes/Gems/Default/DatabaseAction.php:81 -#, php-format -msgid "Script ran step %d of %d succesfully." -msgstr "Script ran step %d of %d succesfully." - -#: classes/Gems/Default/DatabaseAction.php:84 -msgid " in step " -msgstr " in step " - #: classes/Gems/Default/DatabaseAction.php:89 #, php-format -msgid "No script for %1$s." -msgstr "No script for %1$s." - -#: classes/Gems/Default/DatabaseAction.php:133 -#, php-format msgid "No rows in %s." msgstr "No rows in %s." -#: classes/Gems/Default/DatabaseAction.php:162 +#: classes/Gems/Default/DatabaseAction.php:118 msgid "Type" msgstr "Type" -#: classes/Gems/Default/DatabaseAction.php:166 +#: classes/Gems/Default/DatabaseAction.php:122 msgid "Group" msgstr "Group" -#: classes/Gems/Default/DatabaseAction.php:168 +#: classes/Gems/Default/DatabaseAction.php:124 msgid "Location" msgstr "Location" -#: classes/Gems/Default/DatabaseAction.php:171 +#: classes/Gems/Default/DatabaseAction.php:127 msgid "Status" msgstr "Status" -#: classes/Gems/Default/DatabaseAction.php:172 -msgid "created" -msgstr "created" - -#: classes/Gems/Default/DatabaseAction.php:173 -msgid "not created" -msgstr "not created" - -#: classes/Gems/Default/DatabaseAction.php:174 -msgid "unknown" -msgstr "unknown" - -#: classes/Gems/Default/DatabaseAction.php:177 +#: classes/Gems/Default/DatabaseAction.php:130 msgid "Script" msgstr "Script" -#: classes/Gems/Default/DatabaseAction.php:179 +#: classes/Gems/Default/DatabaseAction.php:132 msgid "Changed on" msgstr "Changed on" -#: classes/Gems/Default/DatabaseAction.php:198 +#: classes/Gems/Default/DatabaseAction.php:151 msgid "This database object does not exist. You cannot delete it." msgstr "This database object does not exist. You cannot delete it." -#: classes/Gems/Default/DatabaseAction.php:203 +#: classes/Gems/Default/DatabaseAction.php:156 #, php-format msgid "Drop %s" msgstr "Drop %s" -#: classes/Gems/Default/DatabaseAction.php:211 +#: classes/Gems/Default/DatabaseAction.php:164 #, php-format msgid "There are %d rows in the table." msgstr "There are %d rows in the table." -#: classes/Gems/Default/DatabaseAction.php:213 +#: classes/Gems/Default/DatabaseAction.php:166 #, php-format msgid "Drop table with %d rows" msgstr "Drop table with %d rows" -#: classes/Gems/Default/DatabaseAction.php:214 +#: classes/Gems/Default/DatabaseAction.php:167 msgid "Are you really sure?" msgstr "Are you really sure?" -#: classes/Gems/Default/DatabaseAction.php:230 +#: classes/Gems/Default/DatabaseAction.php:183 #, php-format msgid "%1$s %2$s dropped" msgstr "%1$s %2$s dropped" -#: classes/Gems/Default/DatabaseAction.php:235 +#: classes/Gems/Default/DatabaseAction.php:188 msgid " during statement " msgstr " during statement " -#: classes/Gems/Default/DatabaseAction.php:246 +#: classes/Gems/Default/DatabaseAction.php:199 #, php-format msgid "%s no longer exists in the database." msgstr "%s no longer exists in the database." -#: classes/Gems/Default/DatabaseAction.php:249 +#: classes/Gems/Default/DatabaseAction.php:202 #, php-format msgid "%s does not yet exist in the database." msgstr "%s does not yet exist in the database." -#: classes/Gems/Default/DatabaseAction.php:252 +#: classes/Gems/Default/DatabaseAction.php:205 #, php-format msgid "%s object does exist." msgstr "%s object does exist." -#: classes/Gems/Default/DatabaseAction.php:270 +#: classes/Gems/Default/DatabaseAction.php:223 msgid "Object is not a table." msgstr "Object is not a table." -#: classes/Gems/Default/DatabaseAction.php:293 +#: classes/Gems/Default/DatabaseAction.php:246 msgid "Structure" msgstr "Structure" -#: classes/Gems/Default/DatabaseAction.php:302 +#: classes/Gems/Default/DatabaseAction.php:255 msgid "database object" msgid_plural "database objects" msgstr[0] "database object" msgstr[1] "database objects" -#: classes/Gems/Default/DatabaseAction.php:307 +#: classes/Gems/Default/DatabaseAction.php:260 msgid "Database object overview" msgstr "Database object overview" -#: classes/Gems/Default/DatabaseAction.php:316 -#: classes/Gems/Default/DatabaseAction.php:368 +#: classes/Gems/Default/DatabaseAction.php:269 +#: classes/Gems/Default/DatabaseAction.php:321 msgid "Level" msgstr "Level" -#: classes/Gems/Default/DatabaseAction.php:317 -#: classes/Gems/Default/DatabaseAction.php:369 +#: classes/Gems/Default/DatabaseAction.php:270 +#: classes/Gems/Default/DatabaseAction.php:322 msgid "Subtype" msgstr "Subtype" -#: classes/Gems/Default/DatabaseAction.php:319 +#: classes/Gems/Default/DatabaseAction.php:272 msgid "To be executed" msgstr "To be executed" -#: classes/Gems/Default/DatabaseAction.php:320 -#: classes/Gems/Default/DatabaseAction.php:372 +#: classes/Gems/Default/DatabaseAction.php:273 +#: classes/Gems/Default/DatabaseAction.php:325 msgid "Executed" msgstr "Executed" -#: classes/Gems/Default/DatabaseAction.php:321 -#: classes/Gems/Default/DatabaseAction.php:373 +#: classes/Gems/Default/DatabaseAction.php:274 +#: classes/Gems/Default/DatabaseAction.php:326 msgid "Finished" msgstr "Finished" -#: classes/Gems/Default/DatabaseAction.php:324 +#: classes/Gems/Default/DatabaseAction.php:277 msgid "Create the patch table!" msgstr "Create the patch table!" -#: classes/Gems/Default/DatabaseAction.php:326 +#: classes/Gems/Default/DatabaseAction.php:279 #, php-format msgid "%d new or changed patch(es)." msgstr "%d new or changed patch(es)." -#: classes/Gems/Default/DatabaseAction.php:331 +#: classes/Gems/Default/DatabaseAction.php:284 msgid "Gems build" msgstr "Gems build" -#: classes/Gems/Default/DatabaseAction.php:332 +#: classes/Gems/Default/DatabaseAction.php:285 msgid "Database build" msgstr "Database build" -#: classes/Gems/Default/DatabaseAction.php:334 +#: classes/Gems/Default/DatabaseAction.php:287 msgid "Execute level" msgstr "Execute level" -#: classes/Gems/Default/DatabaseAction.php:338 +#: classes/Gems/Default/DatabaseAction.php:291 msgid "Ignore finished" msgstr "Ignore finished" -#: classes/Gems/Default/DatabaseAction.php:339 +#: classes/Gems/Default/DatabaseAction.php:292 msgid "Ignore executed" msgstr "Ignore executed" -#: classes/Gems/Default/DatabaseAction.php:340 +#: classes/Gems/Default/DatabaseAction.php:293 msgid "Show patches" msgstr "Show patches" -#: classes/Gems/Default/DatabaseAction.php:354 +#: classes/Gems/Default/DatabaseAction.php:307 #, php-format msgid "%d patch(es) executed." msgstr "%d patch(es) executed." -#: classes/Gems/Default/DatabaseAction.php:367 +#: classes/Gems/Default/DatabaseAction.php:320 msgid "Patch" msgstr "Patch" -#: classes/Gems/Default/DatabaseAction.php:371 +#: classes/Gems/Default/DatabaseAction.php:324 msgid "Query" msgstr "Query" -#: classes/Gems/Default/DatabaseAction.php:374 +#: classes/Gems/Default/DatabaseAction.php:327 msgid "Result" msgstr "Result" -#: classes/Gems/Default/DatabaseAction.php:398 +#: classes/Gems/Default/DatabaseAction.php:351 msgid "Patch maintenance" msgstr "Patch maintenance" -#: classes/Gems/Default/DatabaseAction.php:402 +#: classes/Gems/Default/DatabaseAction.php:355 msgid "Patch overview" msgstr "Patch overview" -#: classes/Gems/Default/DatabaseAction.php:464 +#: classes/Gems/Default/DatabaseAction.php:417 msgid "This database object does not exist. You cannot create it." msgstr "This database object does not exist. You cannot create it." -#: classes/Gems/Default/DatabaseAction.php:470 +#: classes/Gems/Default/DatabaseAction.php:423 msgid "This database object has no script. You cannot execute it." msgstr "This database object has no script. You cannot execute it." -#: classes/Gems/Default/DatabaseAction.php:481 +#: classes/Gems/Default/DatabaseAction.php:434 #, php-format msgid "Run %s" msgstr "Run %s" -#: classes/Gems/Default/DatabaseAction.php:500 +#: classes/Gems/Default/DatabaseAction.php:454 #, php-format msgid "Starting %d object creation scripts." msgstr "Starting %d object creation scripts." -#: classes/Gems/Default/DatabaseAction.php:505 -#, php-format -msgid "Finished %s creation script for object %d of %d" -msgstr "Finished %s creation script for object %d of %d" - -#: classes/Gems/Default/DatabaseAction.php:509 +#: classes/Gems/Default/DatabaseAction.php:464 msgid "All objects exist. Nothing was executed." msgstr "All objects exist. Nothing was executed." -#: classes/Gems/Default/DatabaseAction.php:515 +#: classes/Gems/Default/DatabaseAction.php:470 msgid "Create not-existing database objects" msgstr "Create not-existing database objects" -#: classes/Gems/Default/DatabaseAction.php:517 +#: classes/Gems/Default/DatabaseAction.php:472 #, php-format msgid "One database object does not exist." msgid_plural "These %d database objects do not exist." msgstr[0] "One database object does not exist." msgstr[1] "These %d database objects do not exist." -#: classes/Gems/Default/DatabaseAction.php:518 +#: classes/Gems/Default/DatabaseAction.php:473 msgid "Are you sure you want to create it?" msgid_plural "Are you sure you want to create them all?" msgstr[0] "Are you sure you want to create it?" msgstr[1] "Are you sure you want to create them all?" -#: classes/Gems/Default/DatabaseAction.php:531 +#: classes/Gems/Default/DatabaseAction.php:486 msgid "All database objects exist. There is nothing to create." msgstr "All database objects exist. There is nothing to create." -#: classes/Gems/Default/DatabaseAction.php:544 +#: classes/Gems/Default/DatabaseAction.php:499 msgid "Separate multiple commands with semicolons (;)." msgstr "Separate multiple commands with semicolons (;)." -#: classes/Gems/Default/DatabaseAction.php:551 +#: classes/Gems/Default/DatabaseAction.php:506 msgid "Run" msgstr "Run" -#: classes/Gems/Default/DatabaseAction.php:560 +#: classes/Gems/Default/DatabaseAction.php:515 msgid "raw" msgstr "raw" -#: classes/Gems/Default/DatabaseAction.php:569 +#: classes/Gems/Default/DatabaseAction.php:525 #, php-format msgid "Result set %s." msgstr "Result set %s." -#: classes/Gems/Default/DatabaseAction.php:592 +#: classes/Gems/Default/DatabaseAction.php:548 msgid "Execute raw SQL" msgstr "Execute raw SQL" -#: classes/Gems/Default/DatabaseAction.php:595 +#: classes/Gems/Default/DatabaseAction.php:551 msgid "Result sets" msgstr "Result sets" -#: classes/Gems/Default/DatabaseAction.php:620 +#: classes/Gems/Default/DatabaseAction.php:576 msgid "This database object does not exist. You cannot view it." msgstr "This database object does not exist. You cannot view it." -#: classes/Gems/Default/DatabaseAction.php:625 +#: classes/Gems/Default/DatabaseAction.php:581 #, php-format msgid "The data in table %s" msgstr "The data in table %s" -#: classes/Gems/Default/DatabaseAction.php:626 +#: classes/Gems/Default/DatabaseAction.php:582 #, php-format msgid "Contents of %s %s" msgstr "Contents of %s %s" @@ -1013,7 +1001,6 @@ msgstr "Export data" #: classes/Gems/Default/ExportAction.php:153 -#: classes/Gems/Default/MailJobAction.php:121 msgid "Survey" msgstr "Survey" @@ -1023,9 +1010,8 @@ msgstr "%s records found." #: classes/Gems/Default/ExportAction.php:172 -#: classes/Gems/Default/IndexAction.php:200 +#: classes/Gems/Default/IndexAction.php:203 #: classes/Gems/Default/LogAction.php:197 -#: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organization" @@ -1039,21 +1025,24 @@ msgstr "Role" #: classes/Gems/Default/GroupAction.php:92 -#: classes/Gems/Default/MailJobAction.php:104 msgid "Active" msgstr "Active" -#: classes/Gems/Default/GroupAction.php:96 +#: classes/Gems/Default/GroupAction.php:97 msgid "Allowed IP Ranges" msgstr "Allowed IP Ranges" -#: classes/Gems/Default/GroupAction.php:105 +#: classes/Gems/Default/GroupAction.php:98 +msgid "Separate with | example: 10.0.0.0-10.0.0.255 (subnet masks are not supported)" +msgstr "Separate with | example: 10.0.0.0-10.0.0.255 (subnet masks are not supported)" + +#: classes/Gems/Default/GroupAction.php:108 msgid "group" msgid_plural "groups" msgstr[0] "group" msgstr[1] "groups" -#: classes/Gems/Default/GroupAction.php:110 +#: classes/Gems/Default/GroupAction.php:113 msgid "Administrative groups" msgstr "Administrative groups" @@ -1074,71 +1063,71 @@ msgid "Back to login" msgstr "Back to login" -#: classes/Gems/Default/IndexAction.php:224 +#: classes/Gems/Default/IndexAction.php:227 msgid "Password" msgstr "Password" -#: classes/Gems/Default/IndexAction.php:239 +#: classes/Gems/Default/IndexAction.php:242 #, php-format msgid "Reset password for %s application" msgstr "Reset password for %s application" -#: classes/Gems/Default/IndexAction.php:243 +#: classes/Gems/Default/IndexAction.php:246 msgid "Reset password" msgstr "Reset password" -#: classes/Gems/Default/IndexAction.php:289 +#: classes/Gems/Default/IndexAction.php:292 msgid "Username" msgstr "Username" -#: classes/Gems/Default/IndexAction.php:355 +#: classes/Gems/Default/IndexAction.php:358 msgid "Your password must be changed." msgstr "Your password must be changed." -#: classes/Gems/Default/IndexAction.php:367 +#: classes/Gems/Default/IndexAction.php:370 #, php-format msgid "Login successful, welcome %s." msgstr "Login successful, welcome %s." -#: classes/Gems/Default/IndexAction.php:407 +#: classes/Gems/Default/IndexAction.php:410 #, php-format msgid "Good bye: %s." msgstr "Good bye: %s." -#: classes/Gems/Default/IndexAction.php:432 +#: classes/Gems/Default/IndexAction.php:435 msgid "Reset accepted, enter your new password." msgstr "Reset accepted, enter your new password." -#: classes/Gems/Default/IndexAction.php:436 +#: classes/Gems/Default/IndexAction.php:439 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:459 +#: classes/Gems/Default/IndexAction.php:462 msgid "Password reset requested" msgstr "Password reset requested" -#: classes/Gems/Default/IndexAction.php:460 +#: classes/Gems/Default/IndexAction.php:463 #, 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:465 +#: classes/Gems/Default/IndexAction.php:468 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:467 +#: classes/Gems/Default/IndexAction.php:470 msgid "Unable to send e-mail." msgstr "Unable to send e-mail." -#: classes/Gems/Default/IndexAction.php:472 +#: classes/Gems/Default/IndexAction.php:475 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:476 +#: classes/Gems/Default/IndexAction.php:479 msgid "We received your password reset key." msgstr "We received your password reset key." -#: classes/Gems/Default/IndexAction.php:477 +#: classes/Gems/Default/IndexAction.php:480 msgid "Please enter the organization and username belonging to this key." msgstr "Please enter the organization and username belonging to this key." @@ -1261,6 +1250,7 @@ msgstr "New automatic mail job..." #: classes/Gems/Default/MailJobAction.php:100 +#: classes/Gems/Default/MailLogAction.php:116 msgid "Template" msgstr "Template" @@ -1432,7 +1422,7 @@ #: classes/Gems/Default/OptionAction.php:113 #: classes/Gems/Default/OptionAction.php:118 #: classes/Gems/Default/SourceAction.php:95 -#: classes/Gems/Default/StaffAction.php:153 +#: classes/Gems/Default/StaffAction.php:161 msgid "Repeat password" msgstr "Repeat password" @@ -1453,8 +1443,8 @@ msgstr "Email servers" #: classes/Gems/Default/MailTemplateAction.php:76 -#: classes/Gems/Default/StaffAction.php:298 -#: classes/Gems/Default/StaffAction.php:331 +#: classes/Gems/Default/StaffAction.php:303 +#: classes/Gems/Default/StaffAction.php:336 msgid "(all organizations)" msgstr "(all organizations)" @@ -1496,7 +1486,7 @@ #: classes/Gems/Default/OptionAction.php:188 #: classes/Gems/Default/OrganizationAction.php:139 #: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:314 +#: classes/Gems/Default/StaffAction.php:319 msgid "Language" msgstr "Language" @@ -1617,34 +1607,33 @@ msgid "Only for programmers." msgstr "Only for programmers." -#: classes/Gems/Default/OrganizationAction.php:173 +#: classes/Gems/Default/OrganizationAction.php:174 msgid "This can not be changed yet" msgstr "This can not be changed yet" -#: classes/Gems/Default/OrganizationAction.php:175 +#: classes/Gems/Default/OrganizationAction.php:176 #: classes/Gems/Default/StaffAction.php:131 msgid "User Definition" msgstr "User Definition" -#: classes/Gems/Default/OrganizationAction.php:193 +#: classes/Gems/Default/OrganizationAction.php:194 msgid "Delete organization" msgstr "Delete organization" -#: classes/Gems/Default/OrganizationAction.php:203 +#: classes/Gems/Default/OrganizationAction.php:204 msgid "Edit organization" msgstr "Edit organization" -#: classes/Gems/Default/OrganizationAction.php:213 +#: classes/Gems/Default/OrganizationAction.php:214 msgid "Participating organizations" msgstr "Participating organizations" -#: classes/Gems/Default/OrganizationAction.php:223 +#: classes/Gems/Default/OrganizationAction.php:224 msgid "Show organization" msgstr "Show organization" #: classes/Gems/Default/OverviewPlanAction.php:115 #: classes/Gems/Default/ProjectSurveysAction.php:88 -#: classes/Gems/Default/SurveyAction.php:203 msgid "survey" msgid_plural "surveys" msgstr[0] "survey" @@ -1767,19 +1756,16 @@ msgstr "Session" #: classes/Gems/Default/ProjectSurveysAction.php:68 -#: classes/Gems/Default/SurveyAction.php:192 msgid "By" msgstr "By" #: classes/Gems/Default/ProjectSurveysAction.php:69 #: classes/Gems/Default/ProjectTracksAction.php:67 -#: classes/Gems/Default/SurveyAction.php:193 msgid "From" msgstr "From" #: classes/Gems/Default/ProjectSurveysAction.php:70 #: classes/Gems/Default/ProjectTracksAction.php:68 -#: classes/Gems/Default/SurveyAction.php:195 msgid "Until" msgstr "Until" @@ -1807,7 +1793,6 @@ msgstr "Questions in survey %s" #: classes/Gems/Default/ProjectTracksAction.php:118 -#: classes/Gems/Default/SurveyAction.php:85 #, php-format msgid "Survey %s does not exist." msgstr "Survey %s does not exist." @@ -1949,45 +1934,40 @@ msgstr "Comments" #: classes/Gems/Default/RespondentAction.php:205 -msgid "Physician" -msgstr "Physician" - -#: classes/Gems/Default/RespondentAction.php:206 msgid "Treatment" msgstr "Treatment" -#: classes/Gems/Default/RespondentAction.php:234 +#: classes/Gems/Default/RespondentAction.php:233 msgid "Rejection code" msgstr "Rejection code" -#: classes/Gems/Default/RespondentAction.php:241 +#: classes/Gems/Default/RespondentAction.php:240 msgid "Delete respondent" msgstr "Delete patient" -#: classes/Gems/Default/RespondentAction.php:273 +#: classes/Gems/Default/RespondentAction.php:272 msgid "Respondent deleted." msgstr "Patient deleted" -#: classes/Gems/Default/RespondentAction.php:277 +#: classes/Gems/Default/RespondentAction.php:276 msgid "Respondent tracks stopped." msgstr "Patient tracks stopped." -#: classes/Gems/Default/RespondentAction.php:281 +#: classes/Gems/Default/RespondentAction.php:280 msgid "Choose a reception code to delete." msgstr "Choose a reception code to delete." -#: classes/Gems/Default/RespondentAction.php:325 +#: classes/Gems/Default/RespondentAction.php:324 msgid "respondent" msgid_plural "respondents" msgstr[0] "patient" msgstr[1] "patients" -#: classes/Gems/Default/RespondentAction.php:395 +#: classes/Gems/Default/RespondentAction.php:394 msgid "Please settle the informed consent form for this respondent." msgstr "Please settle the informed consent form for this patient." #: classes/Gems/Default/RespondentPlanAction.php:67 -#: classes/Gems/Default/SurveyAction.php:171 msgid "Show respondent" msgstr "Show patient" @@ -2169,36 +2149,40 @@ msgid "Are you sure you want to synchronize all survey sources?" msgstr "Are you sure you want to synchronize all survey sources?" -#: classes/Gems/Default/StaffAction.php:171 +#: classes/Gems/Default/StaffAction.php:137 +msgid "Unsupported UserDefinition" +msgstr "Unsupported UserDefinition" + +#: classes/Gems/Default/StaffAction.php:179 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:172 +#: classes/Gems/Default/StaffAction.php:180 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:192 +#: classes/Gems/Default/StaffAction.php:197 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:249 +#: classes/Gems/Default/StaffAction.php:254 #, 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:305 +#: classes/Gems/Default/StaffAction.php:310 msgid "Primary function" msgstr "Primary function" -#: classes/Gems/Default/StaffAction.php:315 +#: classes/Gems/Default/StaffAction.php:320 msgid "Can login" msgstr "Can login" -#: classes/Gems/Default/StaffAction.php:316 +#: classes/Gems/Default/StaffAction.php:321 msgid "Logout on survey" msgstr "Logout on survey" -#: classes/Gems/Default/StaffAction.php:391 +#: classes/Gems/Default/StaffAction.php:396 msgid "staff member" msgid_plural "staff members" msgstr[0] "staff member" @@ -2440,7 +2424,7 @@ msgstr "+" #: classes/Gems/Default/TokenPlanAction.php:483 -#: classes/Gems/Default/TrackAction.php:449 +#: classes/Gems/Default/TrackAction.php:450 msgid "token" msgid_plural "tokens" msgstr[0] "token" @@ -2450,68 +2434,68 @@ msgid "Token planning" msgstr "Token planning" -#: classes/Gems/Default/TrackAction.php:120 +#: classes/Gems/Default/TrackAction.php:121 msgid "Respondent number" msgstr "Patient number" -#: classes/Gems/Default/TrackAction.php:121 +#: classes/Gems/Default/TrackAction.php:122 msgid "Respondent name" msgstr "Patient name" -#: classes/Gems/Default/TrackAction.php:171 +#: classes/Gems/Default/TrackAction.php:172 #, php-format msgid "Assignments of this track to %s" msgstr "Assignments of this track to %s" -#: classes/Gems/Default/TrackAction.php:268 -#: classes/Gems/Default/TrackAction.php:281 +#: classes/Gems/Default/TrackAction.php:269 +#: classes/Gems/Default/TrackAction.php:282 msgid "Show tracks" msgstr "Show tracks" -#: classes/Gems/Default/TrackAction.php:273 +#: classes/Gems/Default/TrackAction.php:274 msgid "Show token" msgstr "Show token" -#: classes/Gems/Default/TrackAction.php:366 +#: classes/Gems/Default/TrackAction.php:367 msgid "Track deleted!" msgstr "Track deleted!" -#: classes/Gems/Default/TrackAction.php:386 +#: classes/Gems/Default/TrackAction.php:387 msgid "Track was already deleted." msgstr "Track was already deleted." -#: classes/Gems/Default/TrackAction.php:394 +#: classes/Gems/Default/TrackAction.php:395 #, php-format msgid "Delete %s!" msgstr "Delete %s!" -#: classes/Gems/Default/TrackAction.php:398 +#: classes/Gems/Default/TrackAction.php:399 #, php-format msgid "Watch out! You cannot undo a %s deletion!" msgstr "Watch out! You cannot undo a %s deletion!" -#: classes/Gems/Default/TrackAction.php:409 +#: classes/Gems/Default/TrackAction.php:410 msgid "Do you want to delete this track?" msgstr "Do you want to delete this track?" -#: classes/Gems/Default/TrackAction.php:411 +#: classes/Gems/Default/TrackAction.php:412 msgid "Delete track" msgstr "Delete track" -#: classes/Gems/Default/TrackAction.php:460 +#: classes/Gems/Default/TrackAction.php:461 msgid "Assigned tracks" msgstr "Assigned tracks" -#: classes/Gems/Default/TrackAction.php:482 +#: classes/Gems/Default/TrackAction.php:486 #, php-format msgid "%s track for respondent nr %s" msgstr "%s track for patient nr %s" -#: classes/Gems/Default/TrackAction.php:538 +#: classes/Gems/Default/TrackAction.php:542 msgid "Add track" msgstr "Add track" -#: classes/Gems/Default/TrackAction.php:539 +#: classes/Gems/Default/TrackAction.php:543 msgid "This respondent does not yet have an active track. Add one here." msgstr "This paitent does not yet have an active track. Add one here." @@ -2533,38 +2517,38 @@ msgid "Adding the %s track to respondent %s" msgstr "Adding the %s track to patient %s" -#: classes/Gems/Default/TrackActionAbstract.php:208 +#: 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:209 +#: classes/Gems/Default/TrackActionAbstract.php:210 msgid "Assigned by" msgstr "Assigned by" -#: classes/Gems/Default/TrackActionAbstract.php:210 +#: classes/Gems/Default/TrackActionAbstract.php:211 msgid "Start" msgstr "Start" -#: classes/Gems/Default/TrackActionAbstract.php:214 +#: classes/Gems/Default/TrackActionAbstract.php:215 msgid "Comment" msgstr "Comment" -#: classes/Gems/Default/TrackActionAbstract.php:301 +#: classes/Gems/Default/TrackActionAbstract.php:302 #, php-format msgid "Email %s %s" msgstr "Email %s %s" -#: classes/Gems/Default/TrackActionAbstract.php:307 +#: classes/Gems/Default/TrackActionAbstract.php:308 #, php-format msgid "%s %s not found." msgstr "%s %s not found." -#: classes/Gems/Default/TrackActionAbstract.php:487 +#: classes/Gems/Default/TrackActionAbstract.php:488 #, php-format msgid "Overview of %s track for respondent %s" msgstr "Overview of %s track for patient %s" -#: classes/Gems/Default/TrackActionAbstract.php:491 +#: classes/Gems/Default/TrackActionAbstract.php:492 msgid "This track is currently not assigned to this respondent." msgstr "This track is currently not assigned to this patient." @@ -2601,12 +2585,12 @@ msgstr "Code Name" #: classes/Gems/Default/TrackFieldsAction.php:121 -#: classes/Gems/Default/TrackMaintenanceAction.php:211 +#: classes/Gems/Default/TrackMaintenanceAction.php:224 msgid "Values" msgstr "Values" #: classes/Gems/Default/TrackFieldsAction.php:123 -#: classes/Gems/Default/TrackMaintenanceAction.php:213 +#: classes/Gems/Default/TrackMaintenanceAction.php:226 msgid "Required" msgstr "Required" @@ -2624,31 +2608,31 @@ msgid "Fields" msgstr "Fields" -#: classes/Gems/Default/TrackMaintenanceAction.php:149 +#: classes/Gems/Default/TrackMaintenanceAction.php:162 msgid "This may take a while!" msgstr "This may take a while!" -#: classes/Gems/Default/TrackMaintenanceAction.php:150 +#: classes/Gems/Default/TrackMaintenanceAction.php:163 msgid "Check all tracks" msgstr "Check all tracks" -#: classes/Gems/Default/TrackMaintenanceAction.php:151 +#: classes/Gems/Default/TrackMaintenanceAction.php:164 msgid "Checking all tracks will update all existing rounds to the current surveys in the tracks instead of those in use when the track was created." msgstr "Checking all tracks will update all existing rounds to the current surveys in the tracks instead of those in use when the track was created." -#: classes/Gems/Default/TrackMaintenanceAction.php:152 +#: classes/Gems/Default/TrackMaintenanceAction.php:165 msgid "Completed tracks will not be changed. No new tokens will be created when later tokens were completed." msgstr "Completed tracks will not be changed. No new tokens will be created when later tokens were completed." -#: classes/Gems/Default/TrackMaintenanceAction.php:266 +#: classes/Gems/Default/TrackMaintenanceAction.php:279 msgid "fields" msgstr "fields" -#: classes/Gems/Default/TrackMaintenanceAction.php:267 +#: classes/Gems/Default/TrackMaintenanceAction.php:280 msgid "rounds" msgstr "rounds" -#: classes/Gems/Default/TrackMaintenanceAction.php:304 +#: classes/Gems/Default/TrackMaintenanceAction.php:306 #, php-format msgid "%s in track" msgstr "%s in track" @@ -2946,6 +2930,47 @@ msgid "Excel export" msgstr "Excel export" +#: classes/Gems/Model/DbaModel.php:97 +msgid "created" +msgstr "created" + +#: classes/Gems/Model/DbaModel.php:98 +msgid "not created" +msgstr "not created" + +#: classes/Gems/Model/DbaModel.php:99 +msgid "unknown" +msgstr "unknown" + +#: classes/Gems/Model/DbaModel.php:420 +#, php-format +msgid "Executed %2$s creation script %1$s:" +msgstr "Executed %2$s creation script %1$s:" + +#: classes/Gems/Model/DbaModel.php:430 +#, php-format +msgid "%d record(s) returned as result set %d in step %d of %d." +msgstr "%d record(s) returned as result set %d in step %d of %d." + +#: classes/Gems/Model/DbaModel.php:434 +#, php-format +msgid "%d record(s) updated in step %d of %d." +msgstr "%d record(s) updated in step %d of %d." + +#: classes/Gems/Model/DbaModel.php:437 +#, php-format +msgid "Script ran step %d of %d succesfully." +msgstr "Script ran step %d of %d succesfully." + +#: classes/Gems/Model/DbaModel.php:440 +msgid " in step " +msgstr " in step " + +#: classes/Gems/Model/DbaModel.php:445 +#, php-format +msgid "No script for %1$s." +msgstr "No script for %1$s." + #: classes/Gems/Selector/DateSelectorAbstract.php:309 msgid "<<" msgstr "<<" @@ -3166,141 +3191,145 @@ msgid "This track type does not allow the creation of new rounds." msgstr "This track type does not allow the creation of new rounds." -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:365 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:370 msgid "Track start" msgstr "Track start" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:366 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:371 msgid "Track end" msgstr "Track end" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:382 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:387 msgid "Start time" msgstr "Start time" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:383 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:388 msgid "Completion time" msgstr "Completion time" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:398 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:403 msgid "Minutes" msgstr "Minutes" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:399 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:404 msgid "Hours" msgstr "Hours" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:400 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:405 msgid "Days" msgstr "Days" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:401 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:406 msgid "Weeks" msgstr "Weeks" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:402 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:407 msgid "Months" msgstr "Months" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:403 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:408 msgid "Quarters" msgstr "Quarters" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:404 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:409 msgid "Years" msgstr "Years" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:438 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:444 msgid "Valid from calculation" msgstr "Valid from calculation" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:439 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:447 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:445 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:453 msgid "Date source" msgstr "Date source" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:440 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:448 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:446 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:454 msgid "Round used" msgstr "Round used" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:441 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:449 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:447 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:455 msgid "Date used" msgstr "Date used" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:442 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:450 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:448 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:456 msgid "Add to date" msgstr "Add to date" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:443 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:451 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:449 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:457 msgid "Add to date unit" msgstr "Add to date unit" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:446 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:452 msgid "Valid for calculation" msgstr "Valid for calculation" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:480 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:486 msgid "Does not expire" msgstr "Does not expire" -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:483 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:489 msgid "Use an answer from a survey." msgstr "Use an answer from a survey." -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:484 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:490 msgid "Use a standard token date." msgstr "Use a standard token date." -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:486 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:492 msgid "Use a track level date." msgstr "Use a track level date." -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:418 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:445 #, php-format msgid "%s track engines cannot be converted to %s track engines." msgstr "%s track engines cannot be converted to %s track engines." -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:661 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:688 #, php-format msgid "%d: %s - %s" msgstr "%d: %s - %s" -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:664 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:667 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:691 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:694 #, php-format msgid "%d: %s" msgstr "%d: %s" -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:670 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:697 #, php-format msgid "%s - %s" msgstr "%s - %s" -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:712 +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:737 +msgid "Icon" +msgstr "Icon" + +#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:740 msgid "After change" msgstr "After change" -#: classes/Gems/Tracker/Model/StandardTokenModel.php:209 +#: classes/Gems/Tracker/Model/StandardTokenModel.php:215 msgid "Measure(d) on" msgstr "Measure(d) on" -#: classes/Gems/Tracker/Model/StandardTokenModel.php:212 +#: classes/Gems/Tracker/Model/StandardTokenModel.php:218 msgid "Completed" msgstr "Completed" -#: classes/Gems/Tracker/Model/StandardTokenModel.php:213 +#: classes/Gems/Tracker/Model/StandardTokenModel.php:219 msgid "Duration in seconds" msgstr "Duration in seconds" -#: classes/Gems/Tracker/Model/StandardTokenModel.php:214 +#: classes/Gems/Tracker/Model/StandardTokenModel.php:220 msgid "Score" msgstr "Score" -#: classes/Gems/Tracker/Model/StandardTokenModel.php:223 +#: classes/Gems/Tracker/Model/StandardTokenModel.php:229 msgid "Assigned to" msgstr "Assigned to" @@ -3312,38 +3341,38 @@ msgid "Use until" msgstr "Use until" -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:138 +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:145 msgid "Question" msgstr "Question" -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:207 +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:215 #, php-format msgid "%s answers for patient number %s" msgstr "%s answers for patient number %s" -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:210 +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:218 #, php-format msgid "Answers for token %s, patient number %s: %s." msgstr "Answers for token %s, patient number %s: %s." -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:223 +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:232 #: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:124 #: classes/Gems/Tracker/Snippets/ShowTokenSnippetAbstract.php:164 #, php-format msgid "Token %s not found." msgstr "Token %s not found." -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:227 +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:236 #: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:128 #: classes/Gems/Tracker/Snippets/ShowTokenSnippetAbstract.php:168 msgid "No token specified." msgstr "No token specified." -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:232 +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:241 msgid "Close" msgstr "Close" -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:233 +#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:242 msgid "Print" msgstr "Print" @@ -3351,6 +3380,11 @@ msgid "Add new round" msgstr "Add new round" +#: classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php:198 +#: classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php:234 +msgid "Add new track" +msgstr "Add new track" + #: classes/Gems/Tracker/Snippets/ShowRoundSnippetAbstract.php:132 #, php-format msgid "%s round" @@ -3529,7 +3563,7 @@ msgstr[0] "A password should contain at least one number." msgstr[1] "A password should contain at least %d numbers." -#: classes/Gems/User/RadiusUserDefinition.php:174 +#: classes/Gems/User/RadiusUserDefinition.php:175 msgid "Shared secret" msgstr "Shared secret" @@ -3839,19 +3873,19 @@ msgid "One or more IPs are illegal." msgstr "One or more IPs are illegal." -#: snippets/AddTracksSnippet.php:95 +#: snippets/AddTracksSnippet.php:117 msgid "by Respondents" msgstr "by Patients" -#: snippets/AddTracksSnippet.php:99 +#: snippets/AddTracksSnippet.php:121 msgid "by Staff" msgstr "by Staff" -#: snippets/AddTracksSnippet.php:173 +#: snippets/AddTracksSnippet.php:195 msgid "info" msgstr "info" -#: snippets/AddTracksSnippet.php:178 +#: snippets/AddTracksSnippet.php:200 msgid "None available" msgstr "None available" @@ -3892,6 +3926,7 @@ 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." @@ -3903,15 +3938,9 @@ msgstr "Lists choices changed." #: snippets/EditSingleSurveyTokenSnippet.php:132 -#: snippets/ShowSingleSurveyTokenSnippet.php:150 msgid "Show survey" msgstr "Show survey" -#: snippets/EditTrackEngineSnippet.php:198 -#: snippets/EditTrackEngineSnippet.php:234 -msgid "Add new track" -msgstr "Add new track" - #: snippets/EditTrackTokenSnippet.php:129 msgid "Recalculate track" msgstr "Recalculate track" @@ -3981,7 +4010,7 @@ msgid "Surveys in %s track" msgstr "Surveys in %s track" -#: snippets/TrackSurveyOverviewSnippet.php:109 +#: snippets/TrackSurveyOverviewSnippet.php:112 msgid "Details" msgstr "Details" @@ -4046,6 +4075,9 @@ msgid "The Pulse software was made possible thanks to support from " msgstr "The Pulse software was made possible thanks to support from " +#~ msgid "Physician" +#~ msgstr "Physician" + #~ msgid "Track deleted." #~ msgstr "Track deleted." @@ -4273,9 +4305,6 @@ #~ msgid "Left" #~ msgstr "Left" -#~ msgid "Creation date" -#~ msgstr "Creation date" - #~ msgid "Created by" #~ msgstr "Created by" Modified: branches/1.5.x/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: branches/1.5.x/library/languages/default-nl.po =================================================================== --- branches/1.5.x/library/languages/default-nl.po 2012-02-13 15:44:10 UTC (rev 469) +++ branches/1.5.x/library/languages/default-nl.po 2012-02-14 10:20:56 UTC (rev 470) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-01-24 12:43+0100\n" +"POT-Creation-Date: 2012-02-14 10:56+0100\n" "PO-Revision-Date: \n" "Last-Translator: Menno Dekker <men...@er...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -18,58 +18,72 @@ "X-Poedit-KeywordsList: plural:1,2\n" "X-Poedit-SearchPath-0: .\n" -#: classes/GemsEscort.php:207 +#: classes/GemsEscort.php:211 #, php-format msgid "Path %s not writable" msgstr "Path %s niet schrijfbaar" -#: classes/GemsEscort.php:893 +#: classes/GemsEscort.php:739 #, php-format +msgid "You are logged in as %s" +msgstr "Ingelogd als %s" + +#: classes/GemsEscort.php:741 +#: classes/Gems/Menu.php:248 +msgid "Logoff" +msgstr "Uitloggen" + +#: classes/GemsEscort.php:744 +msgid "You are not logged in" +msgstr "U bent niet ingelogd" + +#: classes/GemsEscort.php:927 +#, php-format msgid "User: %s" msgstr "Login: %s" -#: classes/GemsEscort.php:918 +#: classes/GemsEscort.php:952 msgid "version" msgstr "versie" -#: classes/GemsEscort.php:1349 +#: classes/GemsEscort.php:1383 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:1479 +#: classes/GemsEscort.php:1513 msgid "Please check back later." msgstr "Probeer het later opnieuw." -#: classes/GemsEscort.php:1481 -#: classes/GemsEscort.php:1485 -#: classes/GemsEscort.php:1486 +#: classes/GemsEscort.php:1515 +#: classes/GemsEscort.php:1519 +#: classes/GemsEscort.php:1520 msgid "System is in maintenance mode" msgstr "Systeem is in onderhoudsmodus" -#: classes/GemsEscort.php:1496 +#: classes/GemsEscort.php:1530 msgid "No access to site." msgstr "Geen toegang tot website." -#: classes/GemsEscort.php:1498 -#: classes/GemsEscort.php:1540 +#: classes/GemsEscort.php:1532 +#: classes/GemsEscort.php:1574 msgid "You have no access to this site." msgstr "U heeft geen toegang tot deze website." -#: classes/GemsEscort.php:1514 +#: classes/GemsEscort.php:1548 msgid "No access to page" msgstr "Geen toegang tot pagina" -#: classes/GemsEscort.php:1516 +#: classes/GemsEscort.php:1550 #, 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:1526 -#: classes/GemsEscort.php:1538 +#: classes/GemsEscort.php:1560 +#: classes/GemsEscort.php:1572 msgid "You are no longer logged in." msgstr "U bent niet meer ingelogd." -#: classes/GemsEscort.php:1527 +#: classes/GemsEscort.php:1561 msgid "You must login to access this page." msgstr "U moet ingelogd zijn voor toegang tot deze pagina." @@ -81,31 +95,31 @@ msgid "Combination of organization, username and password not found." msgstr "Combinatie van organisatie, gebruikersnaam en wachtwoord niet gevonden." -#: classes/Gems/Html.php:154 +#: classes/Gems/Html.php:155 msgid "<< First" msgstr "<< Eerste" -#: classes/Gems/Html.php:155 +#: classes/Gems/Html.php:156 msgid "< Previous" msgstr "< Terug" -#: classes/Gems/Html.php:156 +#: classes/Gems/Html.php:157 msgid "Next >" msgstr "Verder >" -#: classes/Gems/Html.php:157 +#: classes/Gems/Html.php:158 msgid "Last >>" msgstr "Laatste >>" -#: classes/Gems/Html.php:158 +#: classes/Gems/Html.php:159 msgid " | " msgstr " | " -#: classes/Gems/Html.php:162 +#: classes/Gems/Html.php:163 msgid "to" msgstr "tot" -#: classes/Gems/Html.php:163 +#: classes/Gems/Html.php:164 msgid "of" msgstr "van" @@ -251,10 +265,6 @@ msgid "Token" msgstr "Kenmerk" -#: classes/Gems/Menu.php:248 -msgid "Logoff" -msgstr "Uitloggen" - #: classes/Gems/Menu.php:283 msgid "Track" msgstr "Traject" @@ -413,114 +423,138 @@ msgid "Checks performed" msgstr "Controle uitgevoerd" -#: classes/Gems/UpgradesAbstract.php:164 +#: classes/Gems/Upgrades.php:69 +#: classes/Gems/Upgrades.php:71 +#, php-format +msgid "Executing patchlevel %d" +msgstr "Uitvoeren patchlevel %d" + +#: classes/Gems/Upgrades.php:76 +msgid "Creating new tables" +msgstr "aanmaken nieuwe tabellen" + +#: classes/Gems/Upgrades.php:81 +msgid "Syncing surveys for all sources" +msgstr "Vragenlijsten synchroniseren voor alle bronnen." + +#: classes/Gems/UpgradesAbstract.php:175 +#, 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/UpgradesAbstract.php:206 msgid "Already at max. level." msgstr "Al op het hoogste niveau." -#: classes/Gems/UpgradesAbstract.php:171 +#: classes/Gems/UpgradesAbstract.php:213 #, php-format msgid "Trying upgrade for %s from level %s to level %s" msgstr "Probeert upgrade voor %s van niveau %s naar niveau %s uit te voeren" -#: classes/Gems/UpgradesAbstract.php:179 +#: classes/Gems/UpgradesAbstract.php:221 #, php-format msgid "Trying upgrade for %s to level %s: %s" msgstr "Probeert upgrade voor %s naar niveau %s: %s" -#: classes/Gems/UpgradesAbstract.php:337 +#: classes/Gems/UpgradesAbstract.php:379 msgid "Cache cleaned" msgstr "Cache opgeschoond" -#: classes/Gems/Controller/BrowseEditAction.php:346 +#: classes/Gems/Controller/BrowseEditAction.php:352 #, php-format msgid "New %s..." msgstr "Nieuw %s..." -#: classes/Gems/Controller/BrowseEditAction.php:378 +#: classes/Gems/Controller/BrowseEditAction.php:385 #, php-format msgid "Delete %s" msgstr "Verwijder %s" -#: classes/Gems/Controller/BrowseEditAction.php:382 +#: classes/Gems/Controller/BrowseEditAction.php:389 #, php-format msgid "%2$u %1$s deleted" msgstr "%2$u %1$s verwijderd" -#: classes/Gems/Controller/BrowseEditAction.php:396 +#: classes/Gems/Controller/BrowseEditAction.php:403 #, php-format msgid "Edit %s" msgstr "Bewerk %s" -#: classes/Gems/Controller/BrowseEditAction.php:493 +#: classes/Gems/Controller/BrowseEditAction.php:500 msgid "Free search text" msgstr "Vrije zoek tekst" -#: classes/Gems/Controller/BrowseEditAction.php:564 +#: classes/Gems/Controller/BrowseEditAction.php:571 msgid "Search" msgstr "Zoeken" -#: classes/Gems/Controller/BrowseEditAction.php:580 +#: classes/Gems/Controller/BrowseEditAction.php:587 #, php-format msgid "No %s found" msgstr "Geen %s gevonden" -#: classes/Gems/Controller/BrowseEditAction.php:653 +#: classes/Gems/Controller/BrowseEditAction.php:660 +#: classes/Gems/Default/ExportAction.php:234 #, php-format msgid "No %s found." msgstr "Geen %s gevonden." -#: classes/Gems/Controller/BrowseEditAction.php:768 +#: classes/Gems/Controller/BrowseEditAction.php:778 msgid "Are you sure?" msgstr "Weet u het zeker?" -#: classes/Gems/Controller/BrowseEditAction.php:784 +#: classes/Gems/Controller/BrowseEditAction.php:794 +#: classes/Gems/Default/DatabaseAction.php:171 +#: classes/Gems/Default/DatabaseAction.php:483 msgid "Yes" msgstr "Ja" -#: classes/Gems/Controller/BrowseEditAction.php:785 +#: classes/Gems/Controller/BrowseEditAction.php:795 +#: classes/Gems/Default/DatabaseAction.php:172 +#: classes/Gems/Default/DatabaseAction.php:484 msgid "No" msgstr "Nee" -#: classes/Gems/Controller/BrowseEditAction.php:838 +#: classes/Gems/Controller/BrowseEditAction.php:848 #, php-format msgid "Unknown %s requested" msgstr "Onjuist %s verzoek" -#: classes/Gems/Controller/BrowseEditAction.php:861 +#: classes/Gems/Controller/BrowseEditAction.php:871 #, php-format msgid "New %1$s..." msgstr "Nieuwe %1$s..." -#: classes/Gems/Controller/BrowseEditAction.php:869 +#: classes/Gems/Controller/BrowseEditAction.php:879 msgid "Save" msgstr "Opslaan" -#: classes/Gems/Controller/BrowseEditAction.php:905 +#: classes/Gems/Controller/BrowseEditAction.php:915 #, php-format msgid "%2$u %1$s saved" msgstr "%2$u %1$s opgeslagen" -#: classes/Gems/Controller/BrowseEditAction.php:908 +#: classes/Gems/Controller/BrowseEditAction.php:918 msgid "No changes to save." msgstr "Geen verandering om op te slaan." -#: classes/Gems/Controller/BrowseEditAction.php:917 +#: classes/Gems/Controller/BrowseEditAction.php:927 msgid "Input error! No changes saved!" msgstr "Invoer fout! Veranderingen niet opgeslagen!" -#: classes/Gems/Controller/BrowseEditAction.php:945 +#: classes/Gems/Controller/BrowseEditAction.php:955 #, php-format msgid "Show %s" m... [truncated message content] |
From: <gem...@li...> - 2012-02-15 12:43:09
|
Revision: 476 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=476&view=rev Author: mennodekker Date: 2012-02-15 12:42:58 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Introducing TrackCompletedEvent Modified Paths: -------------- branches/1.5.x/library/changelog.txt branches/1.5.x/library/classes/Gems/Events.php branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php branches/1.5.x/library/configs/db/patches.sql Added Paths: ----------- branches/1.5.x/library/classes/Gems/Event/TrackCompletedEventInterface.php Modified: branches/1.5.x/library/changelog.txt =================================================================== --- branches/1.5.x/library/changelog.txt 2012-02-15 11:29:55 UTC (rev 475) +++ branches/1.5.x/library/changelog.txt 2012-02-15 12:42:58 UTC (rev 476) @@ -1,3 +1,7 @@ +Important changes from 1.5.0 => 1.5.1 +============================================================ +New event introduced: TrackCompletedEvent + Important changes from 1.4.3 => 1.5 ============================================================ Passwords should be set with a project.ini->salt. Salt is now a required project setting! Added: branches/1.5.x/library/classes/Gems/Event/TrackCompletedEventInterface.php =================================================================== --- branches/1.5.x/library/classes/Gems/Event/TrackCompletedEventInterface.php (rev 0) +++ branches/1.5.x/library/classes/Gems/Event/TrackCompletedEventInterface.php 2012-02-15 12:42:58 UTC (rev 476) @@ -0,0 +1,59 @@ +<?php +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @package Gems + * @subpackage Event + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 215 2011-07-12 08:52:54Z michiel $ + */ + +/** + * Track completed event interface + * + * Run on completion of an event + * + * @package Gems + * @subpackage Event + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5.1 + */ +class Gems_Event_TrackCompletedEventInterface extends Gems_Event_EventInterface +{ + /** + * Process the data and return the answers that should be changed. + * + * Storing the changed $values is handled by the calling function. + * + * @param Gems_Tracker_RespondentTrack $track Gems repsondent track object + * @param array $values The values to update the track with, before they were saved + * @param int $userId The current userId + * @return void + */ + public function processTrackCompletion(Gems_Tracker_RespondentTrack $track, &$values, $userId); +} Modified: branches/1.5.x/library/classes/Gems/Events.php =================================================================== --- branches/1.5.x/library/classes/Gems/Events.php 2012-02-15 11:29:55 UTC (rev 475) +++ branches/1.5.x/library/classes/Gems/Events.php 2012-02-15 12:42:58 UTC (rev 476) @@ -48,6 +48,7 @@ { const EVENTS_DIR = 'events'; + const TRACK_COMPLETION_EVENT = 'track/completed'; const ROUND_CHANGED_EVENT = 'round/changed'; const SURVEY_BEFORE_ANSWERING_EVENT = 'survey/beforeanswering'; const SURVEY_COMPLETION_EVENT = 'survey/completed'; @@ -61,6 +62,7 @@ * @var array containing eventType => eventClass for all event classes */ protected $_eventClasses = array( + self::TRACK_COMPLETION_EVENT => 'Gems_Event_TrackCompletedEventInterface', self::ROUND_CHANGED_EVENT => 'Gems_Event_RoundChangedEventInterface', self::SURVEY_BEFORE_ANSWERING_EVENT => 'Gems_Event_SurveyBeforeAnsweringEventInterface', self::SURVEY_COMPLETION_EVENT => 'Gems_Event_SurveyCompletedEventInterface', @@ -174,35 +176,44 @@ /** * - * @param string $eventName - * @return Gems_Event_RoundChangedEventInterface + * @return Gems_Event_SurveyCompletedEventInterface */ - public function loadRoundChangedEvent($eventName) + public function listSurveyBeforeAnsweringEvents() { - return $this->_loadEvent($eventName, self::ROUND_CHANGED_EVENT); + return $this->_listEvents(self::SURVEY_BEFORE_ANSWERING_EVENT); } /** * * @return Gems_Event_SurveyCompletedEventInterface */ - public function listSurveyBeforeAnsweringEvents() + public function listSurveyCompletionEvents() { - return $this->_listEvents(self::SURVEY_BEFORE_ANSWERING_EVENT); + return $this->_listEvents(self::SURVEY_COMPLETION_EVENT); } /** * - * @return Gems_Event_SurveyCompletedEventInterface + * @return Gems_Event_TrackCompletedEventInterface */ - public function listSurveyCompletionEvents() + public function listTrackCompletionEvents() { - return $this->_listEvents(self::SURVEY_COMPLETION_EVENT); + return $this->_listEvents(self::TRACK_COMPLETION_EVENT); } /** * * @param string $eventName + * @return Gems_Event_RoundChangedEventInterface + */ + public function loadRoundChangedEvent($eventName) + { + return $this->_loadEvent($eventName, self::ROUND_CHANGED_EVENT); + } + + /** + * + * @param string $eventName * @return Gems_Event_SurveyBeforeAnsweringEventInterface */ public function loadSurveyBeforeAnsweringEvent($eventName) @@ -219,4 +230,14 @@ { return $this->_loadEvent($eventName, self::SURVEY_COMPLETION_EVENT); } + + /** + * + * @param string $eventName + * @return Gems_Event_TrackCompletedEventInterface + */ + public function loadTrackCompletionEvent($evetName) + { + return $this->_loadEvent($eventName, self::TRACK_COMPLETION_EVENT); + } } Modified: branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php 2012-02-15 11:29:55 UTC (rev 475) +++ branches/1.5.x/library/classes/Gems/Tracker/Model/TrackModel.php 2012-02-15 12:42:58 UTC (rev 476) @@ -48,7 +48,18 @@ class Gems_Tracker_Model_TrackModel extends MUtil_Model_TableModel implements MUtil_Registry_TargetInterface { /** - * + * Holds the trackData in array with key trackId, for internal caching use only + * + * @var array + */ + protected $_trackData = array(); + + /** + * @var Gems_Loader + */ + protected $loader; + + /** * @var Gems_Tracker */ protected $tracker; @@ -111,6 +122,12 @@ $this->set('gtr_date_start', 'label', $this->translate->_('From'), 'dateFormat', $translated->dateFormatString, 'formatFunction', $translated->formatDate); $this->set('gtr_date_until', 'label', $this->translate->_('Use until'), 'dateFormat', $translated->dateFormatString, 'formatFunction', $translated->formatDateForever); + if ($detailed) { + $this->setIfExists('gtr_completed_event', + 'label', $this->translate->_('Track completion event'), + 'multiOptions', $this->loader->getEvents()->listTrackCompletionEvents()); + } + return $this; } @@ -147,4 +164,31 @@ { return array_filter(array_keys(get_object_vars($this)), array($this, 'filterRequestNames')); } + + /** + * Get the TrackCompletedEvent for the given trackId + * + * @param int $trackId + * @return Gems_Event_TrackCompletedEventInterface|null + */ + public function getTrackCompletionEvent($trackId) + { + static $trackData = array(); + + if (array_key_exists($trackId, $trackData)) { + $track = $trackData[$trackId]; + } else { + if ($track = $this->loadFirst(array('gtr_id_track' => $trackId))) { + $trackData[$trackId] = $track; + } else { + $track = array(); + } + } + + if (array_key_exists('gtr_completed_event', $track)) { + if (!empty($track['gtr_completed_event'])) { + return $track['gtr_completed_event']; + } + } + } } Modified: branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php 2012-02-15 11:29:55 UTC (rev 475) +++ branches/1.5.x/library/classes/Gems/Tracker/RespondentTrack.php 2012-02-15 12:42:58 UTC (rev 476) @@ -126,7 +126,7 @@ */ public function _checkTrackCount($userId) { - $sqlCount = 'SELECT COUNT(*) AS count, COALESCE(SUM(CASE WHEN gto_completion_time IS NULL THEN 0 ELSE 1 END), 0) AS completed + $sqlCount = 'SELECT COUNT(*) AS count, SUM(CASE WHEN gto_completion_time IS NULL THEN 0 ELSE 1 END) AS completed FROM gems__tokens JOIN gems__reception_codes ON gto_reception_code = grc_id_reception_code AND grc_success = 1 WHERE gto_id_respondent_track = ?'; @@ -142,6 +142,9 @@ ->onlySucces(); $values['gr2t_end_date'] = $tokenSelect->fetchOne(); + + //Handle TrackCompletionEvent + $this->handleTrackCompletion($values, $userId); } else { $values['gr2t_end_date'] = null; } @@ -623,7 +626,25 @@ } /** + * Find out if there are track completion events and delegate to the event if needed * + * @param array $values + * @param int $userId + */ + public function handleTrackCompletion(&$values, $userId) { + // Process any events + $trackEngine = $this->getTrackEngine(); + + //to be backward compatible, first check if the engine has a + if (is_callable(array($trackEngine, 'getTrackCompletionEvent'))) { + if ($event = $this->tracker->getTrackModel()->getTrackCompletionEvent($this->getTrackId())) { + $event->processTrackCompletion($this, $values, $userId); + } + } + } + + /** + * * @return boolean */ public function hasSuccesCode() Modified: branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php 2012-02-15 11:29:55 UTC (rev 475) +++ branches/1.5.x/library/classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php 2012-02-15 12:42:58 UTC (rev 476) @@ -134,6 +134,9 @@ if (! $this->createData) { $bridge->addCheckbox('gtr_active'); } + if ($model->has('gtr_completed_event')) { + $bridge->add('gtr_completed_event'); + } $bridge->addMultiCheckbox('gtr_organizations', 'label', $this->_('Organizations'), 'multiOptions', $this->util->getDbLookup()->getOrganizations(), 'required', true); } Modified: branches/1.5.x/library/configs/db/patches.sql =================================================================== --- branches/1.5.x/library/configs/db/patches.sql 2012-02-15 11:29:55 UTC (rev 475) +++ branches/1.5.x/library/configs/db/patches.sql 2012-02-15 12:42:58 UTC (rev 476) @@ -369,3 +369,9 @@ -- GEMS VERSION: 44 -- PATCH: Add icon field to rounds ALTER TABLE `gems__rounds` ADD gro_icon_file VARCHAR(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER `gro_round_description`; + +-- PATCH: Add index for receptioncode to token table +ALTER TABLE `gems__tokens` ADD INDEX ( `gto_reception_code` ) + +-- PATCH: Add track completion event +ALTER TABLE `gems__tracks` ADD gtr_completed_event varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' AFTER gtr_track_class; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |