You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
(70) |
Nov
(164) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(52) |
Feb
(77) |
Mar
(70) |
Apr
(58) |
May
(81) |
Jun
(74) |
Jul
(87) |
Aug
(30) |
Sep
(45) |
Oct
(37) |
Nov
(51) |
Dec
(31) |
2013 |
Jan
(47) |
Feb
(29) |
Mar
(40) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gem...@li...> - 2012-01-30 10:04:36
|
Revision: 430 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=430&view=rev Author: mennodekker Date: 2012-01-30 10:04:25 +0000 (Mon, 30 Jan 2012) Log Message: ----------- Hopefully final fix to formbridge allowed options (added showLabels for displaygroups) Modified Paths: -------------- branches/1.5.x/library/classes/MUtil/Model/FormBridge.php Modified: branches/1.5.x/library/classes/MUtil/Model/FormBridge.php =================================================================== --- branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-01-30 09:13:30 UTC (rev 429) +++ branches/1.5.x/library/classes/MUtil/Model/FormBridge.php 2012-01-30 10:04:25 UTC (rev 430) @@ -85,7 +85,7 @@ self::AUTO_OPTIONS => array('elementClass', 'multiOptions'), self::CHECK_OPTIONS => array('checkedValue', 'uncheckedValue'), self::DATE_OPTIONS => array('dateFormat', 'storageFormat'), - self::DISPLAY_OPTIONS => array('accesskey', 'autoInsertNotEmptyValidator', 'class', 'disabled', 'description', 'escape', 'label', 'onclick', 'readonly', 'required', 'tabindex', 'value'), + self::DISPLAY_OPTIONS => array('accesskey', 'autoInsertNotEmptyValidator', 'class', 'disabled', 'description', 'escape', 'label', 'onclick', 'readonly', 'required', 'tabindex', 'value', 'showLabels'), self::EXHIBIT_OPTIONS => array('formatFunction'), self::FILE_OPTIONS => array('accept', 'count', 'destination', 'valueDisabled'), self::GROUP_OPTIONS => array('elements', 'legend', 'separator'), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-30 09:13:41
|
Revision: 429 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=429&view=rev Author: mennodekker Date: 2012-01-30 09:13:30 +0000 (Mon, 30 Jan 2012) Log Message: ----------- Fix for big batches running out of memory during initialization: load one row at a time and only include the gto_id_token we need and skip the rest Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Tracker.php Modified: branches/1.5.x/library/classes/Gems/Tracker.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker.php 2012-01-27 15:28:44 UTC (rev 428) +++ branches/1.5.x/library/classes/Gems/Tracker.php 2012-01-30 09:13:30 UTC (rev 429) @@ -842,9 +842,9 @@ $batch = $this->_loadClass('Batch_ProcessTokensBatch', true, array($batch_id)); if (! $batch->isLoaded()) { - $tokenRows = $tokenSelect->fetchAll(); - - foreach ($tokenRows as $tokenData) { + $statement = $tokenSelect->getSelect()->query(); + //Process one row at a time to prevent out of memory errors for really big resultsets + while ($tokenData = $statement->fetch()) { $batch->addToken($tokenData['gto_id_token'], $userId); } } @@ -898,16 +898,16 @@ public function recalculateTokensBatch($batch_id, $userId = null, $cond = null) { $userId = $this->_checkUserId($userId); - $tokenSelect = $this->getTokenSelect(); - $tokenSelect->andReceptionCodes() - ->andRespondents() - ->andRespondentOrganizations() - ->andConsents(); + $tokenSelect = $this->getTokenSelect(array('gto_id_token')); + $tokenSelect->andReceptionCodes(array()) + ->andRespondents(array()) + ->andRespondentOrganizations(array()) + ->andConsents(array()); if ($cond) { $tokenSelect->forWhere($cond); } //Only select surveys that are active in the source (so we can recalculate inactive in Gems) - $tokenSelect->andSurveys(); + $tokenSelect->andSurveys(array()); $tokenSelect->forWhere('gsu_surveyor_active = 1'); self::$verbose = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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-26 13:52:38
|
Revision: 427 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=427&view=rev Author: mennodekker Date: 2012-01-26 13:52:27 +0000 (Thu, 26 Jan 2012) Log Message: ----------- Tagging first release candidate Added Paths: ----------- tags/1.5.0-RC1/ Property changes on: tags/1.5.0-RC1 ___________________________________________________________________ Added: svn:ignore + nbproject Added: svn:mergeinfo + /branches/1.5.0-pulse:306-342,344,346 /tags/1.5.0beta1:305 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-26 13:50:32
|
Revision: 426 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=426&view=rev Author: mennodekker Date: 2012-01-26 13:50:22 +0000 (Thu, 26 Jan 2012) Log Message: ----------- starting branch for coming 1.5.x releases so trunk can move to 1.6 if desired Added Paths: ----------- branches/1.5.x/ Property changes on: branches/1.5.x ___________________________________________________________________ Added: svn:ignore + nbproject Added: svn:mergeinfo + /branches/1.5.0-pulse:306-342,344,346 /tags/1.5.0beta1:305 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-26 13:45:53
|
Revision: 425 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=425&view=rev Author: mennodekker Date: 2012-01-26 13:45:44 +0000 (Thu, 26 Jan 2012) Log Message: ----------- Added missing option 'value' to the allowedoptions, fixing empty Html elements Added a description to the allowed ip ranges in groep edit Modified Paths: -------------- trunk/library/classes/Gems/Default/GroupAction.php trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/Gems/Default/GroupAction.php =================================================================== --- trunk/library/classes/Gems/Default/GroupAction.php 2012-01-26 11:47:39 UTC (rev 424) +++ trunk/library/classes/Gems/Default/GroupAction.php 2012-01-26 13:45:44 UTC (rev 425) @@ -93,7 +93,10 @@ $model->set('ggp_staff_members', 'label', $this->_('Staff'), 'multiOptions', $yesNo); $model->set('ggp_respondent_members', 'label', $this->_('Respondents'), 'multiOptions', $yesNo); - $model->set('ggp_allowed_ip_ranges', 'label', $this->_('Allowed IP Ranges')); + $model->set('ggp_allowed_ip_ranges', + 'label', $this->_('Allowed IP Ranges'), + 'description', $this->_('Separate with | example: 10.0.0.0-10.0.0.255 (subnet masks are not supported)') + ); Gems_Model::setChangeFieldsByPrefix($model, 'ggp'); Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-26 11:47:39 UTC (rev 424) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-26 13:45:44 UTC (rev 425) @@ -85,7 +85,7 @@ self::AUTO_OPTIONS => array('elementClass', 'multiOptions'), self::CHECK_OPTIONS => array('checkedValue', 'uncheckedValue'), self::DATE_OPTIONS => array('dateFormat', 'storageFormat'), - self::DISPLAY_OPTIONS => array('accesskey', 'autoInsertNotEmptyValidator', 'class', 'disabled', 'description', 'escape', 'label', 'onclick', 'readonly', 'required', 'tabindex'), + self::DISPLAY_OPTIONS => array('accesskey', 'autoInsertNotEmptyValidator', 'class', 'disabled', 'description', 'escape', 'label', 'onclick', 'readonly', 'required', 'tabindex', 'value'), self::EXHIBIT_OPTIONS => array('formatFunction'), self::FILE_OPTIONS => array('accept', 'count', 'destination', 'valueDisabled'), self::GROUP_OPTIONS => array('elements', 'legend', 'separator'), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-26 11:47:48
|
Revision: 424 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=424&view=rev Author: mennodekker Date: 2012-01-26 11:47:39 +0000 (Thu, 26 Jan 2012) Log Message: ----------- Fix for too many options present in UserDefinition config fields (organisation edit) BE CAREFUL: might cause trouble with options not explicitly allowed in the formbridge. use MUtil_Model::verbose = true to see what is stripped Modified Paths: -------------- trunk/library/classes/Gems/User/RadiusUserDefinition.php trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/Gems/User/RadiusUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-01-26 08:47:09 UTC (rev 423) +++ trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-01-26 11:47:39 UTC (rev 424) @@ -76,6 +76,7 @@ $bridge->getTab('access'); foreach ($model->getItemNames() as $name) { if ($label = $model->get($name, 'label')) { + //We supply all options from the model as the bridge doesn't know about this model $element = $bridge->add($name, $model->get($name)); } else { $element = $bridge->addHidden($name); Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-26 08:47:09 UTC (rev 423) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-26 11:47:39 UTC (rev 424) @@ -82,7 +82,7 @@ // First list html attributes, then Zend attributes, lastly own attributes private $_allowedOptions = array( - self::AUTO_OPTIONS => array('elementClass'), + self::AUTO_OPTIONS => array('elementClass', 'multiOptions'), self::CHECK_OPTIONS => array('checkedValue', 'uncheckedValue'), self::DATE_OPTIONS => array('dateFormat', 'storageFormat'), self::DISPLAY_OPTIONS => array('accesskey', 'autoInsertNotEmptyValidator', 'class', 'disabled', 'description', 'escape', 'label', 'onclick', 'readonly', 'required', 'tabindex'), @@ -90,7 +90,7 @@ self::FILE_OPTIONS => array('accept', 'count', 'destination', 'valueDisabled'), self::GROUP_OPTIONS => array('elements', 'legend', 'separator'), self::JQUERY_OPTIONS => array('jQueryParams'), - self::MULTI_OPTIONS => array('disable', 'multiOptions', 'onchange', 'separator', 'size'), + self::MULTI_OPTIONS => array('disable', 'multiOptions', 'onchange', 'separator', 'size', 'disableTranslator'), self::PASSWORD_OPTIONS => array('repeatLabel'), self::TAB_OPTIONS => array('value'), self::TEXT_OPTIONS => array('maxlength', 'minlength', 'onchange', 'onfocus', 'onselect', 'size'), @@ -159,17 +159,20 @@ return isset($stringlength) ? $stringlength : null; } + /** + * Returns the options from the allowedoptions array, using the supplied options first and trying + * to find the missing ones in the model. + * + * @param string $name + * @param array $options + * @param array $allowedOptionKeys_array + * @return array + */ private function _mergeOptions($name, array $options, $allowedOptionKeys_array) { - //If not explicitly set, use the form value for translatorDisabled, since we - //create the element outside the form scope and later add it - if (!isset($options['disableTranslator'])) { - $options['disableTranslator'] = $this->form->translatorIsDisabled(); - } - $args = func_get_args(); $allowedOptionsKeys = MUtil_Ra::args($args, 2); - + $allowedOptions = array(); foreach ($allowedOptionsKeys as $allowedOptionsKey) { if (is_array($allowedOptionsKey)) { @@ -183,6 +186,12 @@ } } + //If not explicitly set, use the form value for translatorDisabled, since we + //create the element outside the form scope and later add it + if (!isset($options['disableTranslator']) && array_search('disableTranslator', $allowedOptions) !== false) { + $options['disableTranslator'] = $this->form->translatorIsDisabled(); + } + // Move options to model. if (isset($options['validator'])) { $this->model->set($name, 'validators[]', $options['validator']); @@ -192,6 +201,16 @@ if ($allowedOptions) { // 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 + if (MUtil_Model::$verbose) { + $strippedKeys = array_keys(array_diff_key($options, array_flip($allowedOptions))); + if (!empty($strippedKeys)) { + MUtil_Echo::r($strippedKeys, 'stripped from options for ' . $name); + } + } + $options = array_intersect_key($options, array_flip($allowedOptions)); + foreach ($allowedOptions as $key => $option) { if (array_key_exists($option, $options)) { unset($allowedOptions[$key]); @@ -201,7 +220,7 @@ if ($allowedOptions) { // MUtil_Echo::r($allowedOptions); $result = $this->model->get($name, $allowedOptions); - return $result + $options; + return (array) $result + (array) $options; } } @@ -224,8 +243,7 @@ $options = func_get_args(); $options = MUtil_Ra::pairs($options, 1); - $options = $this->_mergeOptions($name, $options, - self::AUTO_OPTIONS, self::CHECK_OPTIONS, self::DISPLAY_OPTIONS, self::GROUP_OPTIONS, self::MULTI_OPTIONS, self::TAB_OPTIONS, self::TEXT_OPTIONS, self::TEXTAREA_OPTIONS); + $options = $this->_mergeOptions($name, $options, self::AUTO_OPTIONS); if (isset($options['elementClass'])) { $method = 'add' . $options['elementClass']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-26 08:47:15
|
Revision: 423 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=423&view=rev Author: mennodekker Date: 2012-01-26 08:47:09 +0000 (Thu, 26 Jan 2012) Log Message: ----------- prevent cache clashes on apc Modified Paths: -------------- trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-01-25 14:33:44 UTC (rev 422) +++ trunk/library/classes/GemsEscort.php 2012-01-26 08:47:09 UTC (rev 423) @@ -147,13 +147,17 @@ */ protected function _initCache() { - $cache = null; - $exists = false; + $cache = null; + $exists = false; + $cachePrefix = GEMS_PROJECT_NAME . '_'; + // Check if APC extension is loaded if( extension_loaded('apc') ) { $cacheBackend = 'Apc'; $cacheBackendOptions = array(); + //Add path to the prefix as APC is a SHARED cache + $cachePrefix .= md5(APPLICATION_PATH); $exists = true; } else { $cacheBackend = 'File'; @@ -175,7 +179,7 @@ * not support automatic cleaning. */ $cacheFrontendOptions = array('automatic_serialization' => true, - 'cache_id_prefix' => GEMS_PROJECT_NAME . '_', + 'cache_id_prefix' => $cachePrefix, 'automatic_cleaning_factor' => 0); $cache = Zend_Cache::factory('Core', $cacheBackend, $cacheFrontendOptions, $cacheBackendOptions); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-25 14:33:53
|
Revision: 422 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=422&view=rev Author: mennodekker Date: 2012-01-25 14:33:44 +0000 (Wed, 25 Jan 2012) Log Message: ----------- Fix to prevent change of userclass while editing of users with a UserDefinition that is not yet or no longer supported like the OldStaffUSerDefinition Modified Paths: -------------- trunk/library/classes/Gems/Default/StaffAction.php Modified: trunk/library/classes/Gems/Default/StaffAction.php =================================================================== --- trunk/library/classes/Gems/Default/StaffAction.php 2012-01-24 15:02:13 UTC (rev 421) +++ trunk/library/classes/Gems/Default/StaffAction.php 2012-01-25 14:33:44 UTC (rev 422) @@ -129,6 +129,14 @@ //@@TODO: Think of a better way to allow multiple methods per organization if ($this->escort->hasPrivilege('pr.staff.edit.all')) { $model->set('gul_user_class', 'label', $this->_('User Definition')); + + //Make sure old or experimental userdefinitions don't have to be changed to something that is + //allowed at the moment. For example the oldStaffUser can stay when editing a user. + $options = $model->get('gul_user_class', 'multiOptions'); + if (!array_key_exists($data['gul_user_class'], $options)) { + $options[$data['gul_user_class']] = $this->_('Unsupported UserDefinition'); + $model->set('gul_user_class', 'multiOptions', $options); + } $bridge->add('gul_user_class'); } else { $bridge->addHidden('gul_user_class'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-24 15:02:19
|
Revision: 421 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=421&view=rev Author: mennodekker Date: 2012-01-24 15:02:13 +0000 (Tue, 24 Jan 2012) Log Message: ----------- Fix for orgId=0 on login with only one org Modified Paths: -------------- trunk/library/classes/Gems/Default/IndexAction.php Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2012-01-24 14:23:03 UTC (rev 420) +++ trunk/library/classes/Gems/Default/IndexAction.php 2012-01-24 15:02:13 UTC (rev 421) @@ -190,6 +190,9 @@ $org = $this->loader->getCurrentUser()->getCurrentOrganizationId(); $orgs = $this->util->getDbLookup()->getOrganizationsForLogin(); $hidden = count($orgs) < 2; + if ($hidden) { + $org = array_shift(array_keys($orgs)); + } } if ($hidden) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-24 14:23:14
|
Revision: 420 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=420&view=rev Author: mennodekker Date: 2012-01-24 14:23:03 +0000 (Tue, 24 Jan 2012) Log Message: ----------- Some more deprecated and redirects in Token due to new ReceptionCode object Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Token.php Modified: trunk/library/classes/Gems/Tracker/Token.php =================================================================== --- trunk/library/classes/Gems/Tracker/Token.php 2012-01-24 13:45:19 UTC (rev 419) +++ trunk/library/classes/Gems/Tracker/Token.php 2012-01-24 14:23:03 UTC (rev 420) @@ -978,16 +978,18 @@ /** * - * @deprecated Use the ReceptionCode->hadRedoCode + * @deprecated Use the ReceptionCode->hasRedoCode * @return boolean */ public function hasRedoCode() { - if (! isset($this->_gemsData['grc_redo_survey'])) { + return $this->getReceptionCode()->hasRedoCode(); + /*if (! isset($this->_gemsData['grc_redo_survey'])) { $this->_ensureReceptionCode(); } return (boolean) $this->_gemsData['grc_redo_survey']; + */ } /** @@ -998,24 +1000,31 @@ */ public function hasRedoCopyCode() { + return $this->getReceptionCode()->hasRedoCopyCode(); + /* if (! isset($this->_gemsData['grc_redo_survey'])) { $this->_ensureReceptionCode(); } return Gems_Util_ReceptionCodeLibrary::REDO_COPY == $this->_gemsData['grc_redo_survey']; + */ } /** * + * @deprecated Use the ReceptionCode->isSuccess * @return boolean */ public function hasSuccesCode() { + return $this->getReceptionCode()->isSuccess(); + /* if (! isset($this->_gemsData['grc_success'])) { $this->_ensureReceptionCode(); } return $this->_gemsData['grc_success']; + */ } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-24 13:45:30
|
Revision: 419 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=419&view=rev Author: mennodekker Date: 2012-01-24 13:45:19 +0000 (Tue, 24 Jan 2012) Log Message: ----------- Fixed inconsistency with token->getReceptionCode and added __toString to ReceptionCode object for backward compatibility Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Token.php trunk/library/classes/Gems/Util/ReceptionCode.php Modified: trunk/library/classes/Gems/Tracker/Token.php =================================================================== --- trunk/library/classes/Gems/Tracker/Token.php 2012-01-24 11:49:23 UTC (rev 418) +++ trunk/library/classes/Gems/Tracker/Token.php 2012-01-24 13:45:19 UTC (rev 419) @@ -670,12 +670,13 @@ } /** + * Return the Gems_Util_ReceptionCode object * - * @return string reception code + * @return Gems_Util_ReceptionCode reception code */ public function getReceptionCode() { - return $this->_gemsData['gto_reception_code']; + return $this->util->getReceptionCode($this->_gemsData['gto_reception_code']); } /** Modified: trunk/library/classes/Gems/Util/ReceptionCode.php =================================================================== --- trunk/library/classes/Gems/Util/ReceptionCode.php 2012-01-24 11:49:23 UTC (rev 418) +++ trunk/library/classes/Gems/Util/ReceptionCode.php 2012-01-24 13:45:19 UTC (rev 419) @@ -59,6 +59,16 @@ protected $db; /** + * Compatibility mode, for use with logical operators returns this->getCode() + * + * @return string + */ + public function __toString() + { + return $this->getCode(); + } + + /** * Returns the complete record. * * @return array This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-24 11:49:35
|
Revision: 418 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=418&view=rev Author: mennodekker Date: 2012-01-24 11:49:23 +0000 (Tue, 24 Jan 2012) Log Message: ----------- updated translations Modified Paths: -------------- trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2012-01-24 09:27:34 UTC (rev 417) +++ trunk/library/languages/default-en.po 2012-01-24 11:49:23 UTC (rev 418) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-12-20 12:12+0100\n" +"POT-Creation-Date: 2012-01-24 12:42+0100\n" "PO-Revision-Date: \n" "Last-Translator: Menno Dekker <men...@er...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -36,40 +36,40 @@ 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:1476 +#: classes/GemsEscort.php:1479 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1478 -#: classes/GemsEscort.php:1482 -#: classes/GemsEscort.php:1483 +#: classes/GemsEscort.php:1481 +#: classes/GemsEscort.php:1485 +#: classes/GemsEscort.php:1486 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1493 +#: classes/GemsEscort.php:1496 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1495 -#: classes/GemsEscort.php:1537 +#: classes/GemsEscort.php:1498 +#: classes/GemsEscort.php:1540 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1511 +#: classes/GemsEscort.php:1514 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1513 +#: classes/GemsEscort.php:1516 #, 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:1523 -#: classes/GemsEscort.php:1535 +#: classes/GemsEscort.php:1526 +#: classes/GemsEscort.php:1538 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1524 +#: classes/GemsEscort.php:1527 msgid "You must login to access this page." msgstr "You must login to access this page." @@ -338,59 +338,59 @@ msgid "Changelog" msgstr "Changelog" -#: classes/Gems/Model.php:200 +#: classes/Gems/Model.php:205 msgid "Respondent nr" msgstr "Patient nr" -#: classes/Gems/Model.php:201 +#: classes/Gems/Model.php:206 msgid "Opened" msgstr "Opened" -#: classes/Gems/Model.php:202 +#: classes/Gems/Model.php:207 msgid "Consent" msgstr "Consent" -#: classes/Gems/Model.php:204 +#: classes/Gems/Model.php:209 msgid "E-Mail" msgstr "E-Mail" -#: classes/Gems/Model.php:209 +#: classes/Gems/Model.php:214 msgid "Gender" msgstr "Gender" -#: classes/Gems/Model.php:210 +#: classes/Gems/Model.php:215 msgid "First name" msgstr "First name" -#: classes/Gems/Model.php:211 +#: classes/Gems/Model.php:216 msgid "Surname prefix" msgstr "Surname prefix" -#: classes/Gems/Model.php:212 +#: classes/Gems/Model.php:217 msgid "Last name" msgstr "Last name" -#: classes/Gems/Model.php:214 +#: classes/Gems/Model.php:219 msgid "Name" msgstr "Name" -#: classes/Gems/Model.php:217 +#: classes/Gems/Model.php:222 msgid "Street" msgstr "Street" -#: classes/Gems/Model.php:218 +#: classes/Gems/Model.php:223 msgid "Zipcode" msgstr "Zipcode" -#: classes/Gems/Model.php:219 +#: classes/Gems/Model.php:224 msgid "City" msgstr "City" -#: classes/Gems/Model.php:221 +#: classes/Gems/Model.php:226 msgid "Phone" msgstr "Phone" -#: classes/Gems/Model.php:223 +#: classes/Gems/Model.php:228 msgid "Birthday" msgstr "Birthday" @@ -431,94 +431,89 @@ msgid "Cache cleaned" msgstr "Cache cleaned" -#: classes/Gems/Controller/BrowseEditAction.php:349 +#: classes/Gems/Controller/BrowseEditAction.php:346 #, php-format msgid "New %s..." msgstr "New %s..." -#: classes/Gems/Controller/BrowseEditAction.php:382 +#: classes/Gems/Controller/BrowseEditAction.php:378 #, php-format msgid "Delete %s" msgstr "Delete %s" -#: classes/Gems/Controller/BrowseEditAction.php:386 +#: classes/Gems/Controller/BrowseEditAction.php:382 #, php-format msgid "%2$u %1$s deleted" msgstr "%2$u %1$s deleted" -#: classes/Gems/Controller/BrowseEditAction.php:400 +#: classes/Gems/Controller/BrowseEditAction.php:396 #, php-format msgid "Edit %s" msgstr "Edit %s" -#: classes/Gems/Controller/BrowseEditAction.php:497 +#: classes/Gems/Controller/BrowseEditAction.php:493 msgid "Free search text" msgstr "Free search text" -#: classes/Gems/Controller/BrowseEditAction.php:568 +#: classes/Gems/Controller/BrowseEditAction.php:564 msgid "Search" msgstr "Search" -#: classes/Gems/Controller/BrowseEditAction.php:584 +#: classes/Gems/Controller/BrowseEditAction.php:580 #, php-format msgid "No %s found" msgstr "No %s found" -#: classes/Gems/Controller/BrowseEditAction.php:657 -#: classes/Gems/Default/ExportAction.php:234 +#: classes/Gems/Controller/BrowseEditAction.php:653 #, php-format msgid "No %s found." msgstr "No %s found." -#: classes/Gems/Controller/BrowseEditAction.php:772 +#: classes/Gems/Controller/BrowseEditAction.php:768 msgid "Are you sure?" msgstr "Are you sure?" -#: classes/Gems/Controller/BrowseEditAction.php:788 -#: classes/Gems/Default/DatabaseAction.php:218 -#: classes/Gems/Default/DatabaseAction.php:528 +#: classes/Gems/Controller/BrowseEditAction.php:784 msgid "Yes" msgstr "Yes" -#: classes/Gems/Controller/BrowseEditAction.php:789 -#: classes/Gems/Default/DatabaseAction.php:219 -#: classes/Gems/Default/DatabaseAction.php:529 +#: classes/Gems/Controller/BrowseEditAction.php:785 msgid "No" msgstr "No" -#: classes/Gems/Controller/BrowseEditAction.php:842 +#: classes/Gems/Controller/BrowseEditAction.php:838 #, php-format msgid "Unknown %s requested" msgstr "Unknown %s requested" -#: classes/Gems/Controller/BrowseEditAction.php:865 +#: classes/Gems/Controller/BrowseEditAction.php:861 #, php-format msgid "New %1$s..." msgstr "New %1$s..." -#: classes/Gems/Controller/BrowseEditAction.php:873 +#: classes/Gems/Controller/BrowseEditAction.php:869 msgid "Save" msgstr "Save" -#: classes/Gems/Controller/BrowseEditAction.php:909 +#: classes/Gems/Controller/BrowseEditAction.php:905 #, php-format msgid "%2$u %1$s saved" msgstr "%2$u %1$s saved" -#: classes/Gems/Controller/BrowseEditAction.php:912 +#: classes/Gems/Controller/BrowseEditAction.php:908 msgid "No changes to save." msgstr "No changes to save." -#: classes/Gems/Controller/BrowseEditAction.php:921 +#: classes/Gems/Controller/BrowseEditAction.php:917 msgid "Input error! No changes saved!" msgstr "Input error! No changes saved!" -#: classes/Gems/Controller/BrowseEditAction.php:949 +#: classes/Gems/Controller/BrowseEditAction.php:945 #, php-format msgid "Show %s" msgstr "Show %s" -#: classes/Gems/Controller/BrowseEditAction.php:956 +#: classes/Gems/Controller/BrowseEditAction.php:952 #, php-format msgid "Unknown %s." msgstr "Unknown %s." @@ -697,11 +692,11 @@ msgid "Cron jobs turned off." msgstr "Cron jobs turned off." -#: classes/Gems/Default/CronAction.php:218 +#: classes/Gems/Default/CronAction.php:221 msgid "No mails sent." msgstr "No mails sent." -#: classes/Gems/Default/CronAction.php:221 +#: classes/Gems/Default/CronAction.php:224 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." @@ -1018,6 +1013,7 @@ msgstr "Export data" #: classes/Gems/Default/ExportAction.php:153 +#: classes/Gems/Default/MailJobAction.php:121 msgid "Survey" msgstr "Survey" @@ -1028,6 +1024,8 @@ #: classes/Gems/Default/ExportAction.php:172 #: classes/Gems/Default/IndexAction.php:200 +#: classes/Gems/Default/LogAction.php:197 +#: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organization" @@ -1036,11 +1034,12 @@ msgstr "Export to" #: classes/Gems/Default/GroupAction.php:89 -#: classes/Gems/Default/LogAction.php:170 +#: classes/Gems/Default/LogAction.php:201 msgid "Role" msgstr "Role" #: classes/Gems/Default/GroupAction.php:92 +#: classes/Gems/Default/MailJobAction.php:104 msgid "Active" msgstr "Active" @@ -1155,76 +1154,84 @@ msgid "Invalid language setting." msgstr "Invalid language setting." -#: classes/Gems/Default/LogAction.php:61 +#: classes/Gems/Default/LogAction.php:78 msgid "from" msgstr "from" -#: classes/Gems/Default/LogAction.php:66 +#: classes/Gems/Default/LogAction.php:83 msgid "until" msgstr "until" -#: classes/Gems/Default/LogAction.php:72 +#: classes/Gems/Default/LogAction.php:89 msgid "days" msgstr "days" -#: classes/Gems/Default/LogAction.php:73 +#: classes/Gems/Default/LogAction.php:90 msgid "weeks" msgstr "weeks" -#: classes/Gems/Default/LogAction.php:74 +#: classes/Gems/Default/LogAction.php:91 msgid "months" msgstr "months" -#: classes/Gems/Default/LogAction.php:75 +#: classes/Gems/Default/LogAction.php:92 msgid "years" msgstr "years" -#: classes/Gems/Default/LogAction.php:96 +#: classes/Gems/Default/LogAction.php:113 +msgid "Organization:" +msgstr "Organization:" + +#: classes/Gems/Default/LogAction.php:115 +msgid "All organizations" +msgstr "All organizations" + +#: classes/Gems/Default/LogAction.php:117 msgid "Staff:" msgstr "Staff:" -#: classes/Gems/Default/LogAction.php:100 +#: classes/Gems/Default/LogAction.php:124 msgid "All staff" msgstr "All staff" -#: classes/Gems/Default/LogAction.php:102 +#: classes/Gems/Default/LogAction.php:127 msgid "Patient:" msgstr "Patient:" -#: classes/Gems/Default/LogAction.php:106 +#: classes/Gems/Default/LogAction.php:134 msgid "All patients" msgstr "All patients" -#: classes/Gems/Default/LogAction.php:109 +#: classes/Gems/Default/LogAction.php:136 msgid "Action:" msgstr "Action:" -#: classes/Gems/Default/LogAction.php:112 +#: classes/Gems/Default/LogAction.php:139 msgid "All actions" msgstr "All actions" -#: classes/Gems/Default/LogAction.php:163 +#: classes/Gems/Default/LogAction.php:190 msgid "Date" msgstr "Date" -#: classes/Gems/Default/LogAction.php:164 +#: classes/Gems/Default/LogAction.php:191 #: classes/Gems/Default/LogMaintenanceAction.php:52 msgid "Action" msgstr "Action" -#: classes/Gems/Default/LogAction.php:165 +#: classes/Gems/Default/LogAction.php:192 msgid "Message" msgstr "Message" -#: classes/Gems/Default/LogAction.php:167 +#: classes/Gems/Default/LogAction.php:198 msgid "Respondent" msgstr "Patient" -#: classes/Gems/Default/LogAction.php:171 +#: classes/Gems/Default/LogAction.php:202 msgid "IP address" msgstr "IP address" -#: classes/Gems/Default/LogAction.php:178 +#: classes/Gems/Default/LogAction.php:209 #: classes/Gems/Default/LogMaintenanceAction.php:53 msgid "Log" msgstr "Log" @@ -1254,7 +1261,6 @@ msgstr "New automatic mail job..." #: classes/Gems/Default/MailJobAction.php:100 -#: classes/Gems/Default/MailLogAction.php:116 msgid "Template" msgstr "Template" @@ -1370,7 +1376,7 @@ msgstr "From address" #: classes/Gems/Default/MailLogAction.php:113 -#: classes/Gems/Default/MailTemplateAction.php:61 +#: classes/Gems/Default/MailTemplateAction.php:62 msgid "Subject" msgstr "Subject" @@ -1426,7 +1432,7 @@ #: classes/Gems/Default/OptionAction.php:113 #: classes/Gems/Default/OptionAction.php:118 #: classes/Gems/Default/SourceAction.php:95 -#: classes/Gems/Default/StaffAction.php:144 +#: classes/Gems/Default/StaffAction.php:153 msgid "Repeat password" msgstr "Repeat password" @@ -1446,19 +1452,19 @@ msgid "Email servers" msgstr "Email servers" -#: classes/Gems/Default/MailTemplateAction.php:75 -#: classes/Gems/Default/StaffAction.php:212 -#: classes/Gems/Default/StaffAction.php:245 +#: classes/Gems/Default/MailTemplateAction.php:76 +#: classes/Gems/Default/StaffAction.php:298 +#: classes/Gems/Default/StaffAction.php:331 msgid "(all organizations)" msgstr "(all organizations)" -#: classes/Gems/Default/MailTemplateAction.php:94 +#: classes/Gems/Default/MailTemplateAction.php:95 msgid "email template" msgid_plural "email templates" msgstr[0] "email template" msgstr[1] "email templates" -#: classes/Gems/Default/MailTemplateAction.php:99 +#: classes/Gems/Default/MailTemplateAction.php:100 msgid "Email templates" msgstr "Email templates" @@ -1490,7 +1496,7 @@ #: classes/Gems/Default/OptionAction.php:188 #: classes/Gems/Default/OrganizationAction.php:139 #: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:228 +#: classes/Gems/Default/StaffAction.php:314 msgid "Language" msgstr "Language" @@ -1616,6 +1622,7 @@ msgstr "This can not be changed yet" #: classes/Gems/Default/OrganizationAction.php:175 +#: classes/Gems/Default/StaffAction.php:131 msgid "User Definition" msgstr "User Definition" @@ -1637,6 +1644,7 @@ #: 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" @@ -1759,16 +1767,19 @@ 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" @@ -1796,6 +1807,7 @@ 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." @@ -1975,6 +1987,7 @@ 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" @@ -2067,100 +2080,125 @@ msgid "Database Password" msgstr "Database Password" -#: classes/Gems/Default/SourceAction.php:111 +#: classes/Gems/Default/SourceAction.php:116 #, php-format msgid "Checking survey results for %s source." msgstr "Checking survey results for %s source." -#: classes/Gems/Default/SourceAction.php:143 +#: classes/Gems/Default/SourceAction.php:121 +#: classes/Gems/Default/SourceAction.php:145 +msgid "Prepare recheck" +msgstr "Prepare recheck" + +#: classes/Gems/Default/SourceAction.php:125 +#: classes/Gems/Default/SourceAction.php:149 +#, php-format +msgid "Check %s tokens" +msgstr "Check %s tokens" + +#: classes/Gems/Default/SourceAction.php:128 +#: classes/Gems/Default/SourceAction.php:152 +msgid "No tokens to check." +msgstr "No tokens to check." + +#: classes/Gems/Default/SourceAction.php:141 +msgid "Checking survey results for all sources." +msgstr "Checking survey results for all sources." + +#: classes/Gems/Default/SourceAction.php:175 msgid "Source Url" msgstr "Source Url" -#: classes/Gems/Default/SourceAction.php:145 +#: classes/Gems/Default/SourceAction.php:177 msgid "Adaptor class" msgstr "Adaptor class" -#: classes/Gems/Default/SourceAction.php:147 +#: classes/Gems/Default/SourceAction.php:179 msgid "Database Server" msgstr "Database Server" -#: classes/Gems/Default/SourceAction.php:149 +#: classes/Gems/Default/SourceAction.php:181 msgid "Database host" msgstr "Database host" -#: classes/Gems/Default/SourceAction.php:153 +#: classes/Gems/Default/SourceAction.php:185 msgid "Table prefix" msgstr "Table prefix" -#: classes/Gems/Default/SourceAction.php:157 +#: classes/Gems/Default/SourceAction.php:189 msgid "Last check" msgstr "Last check" -#: classes/Gems/Default/SourceAction.php:190 +#: classes/Gems/Default/SourceAction.php:222 msgid "source" msgid_plural "sources" msgstr[0] "source" msgstr[1] "sources" -#: classes/Gems/Default/SourceAction.php:195 +#: classes/Gems/Default/SourceAction.php:227 msgid "Survey Sources" msgstr "Survey Sources" -#: classes/Gems/Default/SourceAction.php:203 +#: classes/Gems/Default/SourceAction.php:235 msgid "This installation is active." msgstr "This installation is active." -#: classes/Gems/Default/SourceAction.php:205 +#: classes/Gems/Default/SourceAction.php:237 msgid "Inactive installation." msgstr "Inactive installation." -#: classes/Gems/Default/SourceAction.php:218 -#: classes/Gems/Default/SourceAction.php:237 +#: classes/Gems/Default/SourceAction.php:250 +#: classes/Gems/Default/SourceAction.php:269 msgid "No changes." msgstr "No changes." -#: classes/Gems/Default/SourceAction.php:233 +#: classes/Gems/Default/SourceAction.php:265 #, php-format msgid "Synchronization of source %s:" msgstr "Synchronization of source %s:" -#: classes/Gems/Default/SourceAction.php:244 +#: classes/Gems/Default/SourceAction.php:276 msgid "Synchronize all sources of surveys" msgstr "Synchronize all sources of surveys" -#: classes/Gems/Default/SourceAction.php:245 +#: classes/Gems/Default/SourceAction.php:277 msgid "Synchronization will update the status of all surveys imported into this project to the status at the sources." msgstr "Synchronization will update the status of all surveys imported into this project to the status at the sources." -#: classes/Gems/Default/SourceAction.php:258 +#: classes/Gems/Default/SourceAction.php:318 msgid "Are you sure you want to synchronize all survey sources?" msgstr "Are you sure you want to synchronize all survey sources?" -#: classes/Gems/Default/StaffAction.php:162 +#: classes/Gems/Default/StaffAction.php:171 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:163 +#: classes/Gems/Default/StaffAction.php:172 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:183 +#: classes/Gems/Default/StaffAction.php:192 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:219 +#: classes/Gems/Default/StaffAction.php:249 +#, 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 msgid "Primary function" msgstr "Primary function" -#: classes/Gems/Default/StaffAction.php:229 +#: classes/Gems/Default/StaffAction.php:315 msgid "Can login" msgstr "Can login" -#: classes/Gems/Default/StaffAction.php:230 +#: classes/Gems/Default/StaffAction.php:316 msgid "Logout on survey" msgstr "Logout on survey" -#: classes/Gems/Default/StaffAction.php:305 +#: classes/Gems/Default/StaffAction.php:391 msgid "staff member" msgid_plural "staff members" msgstr[0] "staff member" @@ -2258,47 +2296,51 @@ msgid "Survey should be assigned to a group before making it active." msgstr "Survey should be assigned to a group before making it active." -#: classes/Gems/Default/SurveyMaintenanceAction.php:272 +#: classes/Gems/Default/SurveyMaintenanceAction.php:277 #, php-format msgid "Checking survey results for the %s survey." msgstr "Checking survey results for the %s survey." -#: classes/Gems/Default/SurveyMaintenanceAction.php:347 +#: classes/Gems/Default/SurveyMaintenanceAction.php:302 +msgid "Checking survey results for all surveys." +msgstr "Checking survey results for all surveys." + +#: classes/Gems/Default/SurveyMaintenanceAction.php:379 msgid "Source" msgstr "Source" -#: classes/Gems/Default/SurveyMaintenanceAction.php:348 +#: classes/Gems/Default/SurveyMaintenanceAction.php:380 msgid "Status in source" msgstr "Status in source" -#: classes/Gems/Default/SurveyMaintenanceAction.php:351 +#: classes/Gems/Default/SurveyMaintenanceAction.php:383 msgid "Active in source" msgstr "Active in source" -#: classes/Gems/Default/SurveyMaintenanceAction.php:352 +#: classes/Gems/Default/SurveyMaintenanceAction.php:384 #, php-format msgid "Active in %s" msgstr "Active in %s" -#: classes/Gems/Default/SurveyMaintenanceAction.php:359 +#: classes/Gems/Default/SurveyMaintenanceAction.php:391 msgid "Single" msgstr "Single" -#: classes/Gems/Default/SurveyMaintenanceAction.php:392 +#: classes/Gems/Default/SurveyMaintenanceAction.php:424 #, php-format msgid "%d times in track." msgstr "%d times in track." -#: classes/Gems/Default/SurveyMaintenanceAction.php:394 +#: classes/Gems/Default/SurveyMaintenanceAction.php:426 #, php-format msgid "%d times in %d track(s)." msgstr "%d times in %d track(s)." -#: classes/Gems/Default/SurveyMaintenanceAction.php:398 +#: classes/Gems/Default/SurveyMaintenanceAction.php:430 msgid "Not used in track." msgstr "Not used in track." -#: classes/Gems/Default/SurveyMaintenanceAction.php:400 +#: classes/Gems/Default/SurveyMaintenanceAction.php:432 msgid "Not used in tracks." msgstr "Not used in tracks." @@ -2892,15 +2934,15 @@ msgid "Check all assignments" msgstr "Check all assignments" -#: classes/Gems/Menu/SubMenuItem.php:373 +#: classes/Gems/Menu/SubMenuItem.php:380 msgid "New" msgstr "New" -#: classes/Gems/Menu/SubMenuItem.php:427 +#: classes/Gems/Menu/SubMenuItem.php:434 msgid "Export the current data set to Excel" msgstr "Export the current data set to Excel" -#: classes/Gems/Menu/SubMenuItem.php:431 +#: classes/Gems/Menu/SubMenuItem.php:438 msgid "Excel export" msgstr "Excel export" @@ -3033,51 +3075,61 @@ msgstr "Answered surveys" #: classes/Gems/Tracker/ChangeTracker.php:64 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:110 #, php-format msgid "Checked %d tracks." msgstr "Checked %d tracks." #: classes/Gems/Tracker/ChangeTracker.php:67 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:113 #, php-format msgid "Checked %d tokens." msgstr "Checked %d tokens." #: classes/Gems/Tracker/ChangeTracker.php:72 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:118 #, php-format msgid "Answers changed by survey completion event for %d tokens." msgstr "Answers changed by survey completion event for %d tokens." #: classes/Gems/Tracker/ChangeTracker.php:75 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:121 #, php-format msgid "Results and timing changed for %d tokens." msgstr "Results and timing changed for %d tokens." #: classes/Gems/Tracker/ChangeTracker.php:78 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:124 #, php-format msgid "%d token round completion events caused changed to %d tokens." msgstr "%d token round completion events caused changed to %d tokens." #: classes/Gems/Tracker/ChangeTracker.php:81 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:127 #, php-format msgid "%2$d token date changes in %1$d tracks." msgstr "%2$d token date changes in %1$d tracks." #: classes/Gems/Tracker/ChangeTracker.php:84 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:130 #, php-format msgid "Round changes propagated to %d tokens." msgstr "Round changes propagated to %d tokens." #: classes/Gems/Tracker/ChangeTracker.php:87 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:133 #, php-format msgid "%d tokens deleted by round changes." msgstr "%d tokens deleted by round changes." #: classes/Gems/Tracker/ChangeTracker.php:90 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:136 #, php-format msgid "%d tokens created to by round changes." msgstr "%d tokens created to by round changes." #: classes/Gems/Tracker/ChangeTracker.php:93 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:139 msgid "No tokens were changed." msgstr "No tokens were changed." @@ -3477,15 +3529,23 @@ msgstr[0] "A password should contain at least one number." msgstr[1] "A password should contain at least %d numbers." -#: classes/Gems/User/User.php:767 +#: classes/Gems/User/RadiusUserDefinition.php:174 +msgid "Shared secret" +msgstr "Shared secret" + +#: classes/Gems/User/User.php:782 msgid "Cookies must be enabled for this site." msgstr "Cookies must be enabled for this site." -#: classes/Gems/User/UserLoader.php:141 -#: classes/Gems/User/UserLoader.php:155 +#: classes/Gems/User/UserLoader.php:142 +#: classes/Gems/User/UserLoader.php:156 msgid "Db storage" msgstr "Db storage" +#: classes/Gems/User/UserLoader.php:157 +msgid "Radius storage" +msgstr "Radius storage" + #: classes/Gems/User/UserPasswordValidator.php:115 msgid "Wrong password." msgstr "Wrong password." @@ -3646,15 +3706,15 @@ msgstr[0] "decade" msgstr[1] "decades" -#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:210 +#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:211 msgid "No changes to save!" msgstr "No changes to save!" -#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:401 +#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:403 msgid "Unknown edit data requested" msgstr "Unknown edit data requested" -#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:424 +#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:426 #, php-format msgid "Input error! Changes to %s not saved!" msgstr "Input error! Changes to %s not saved!" @@ -3832,7 +3892,6 @@ msgstr "Deleted token %s for survey %s." #: snippets/DeleteTrackTokenSnippet.php:286 -#: snippets/EditTrackTokenSnippet.php:174 #, php-format msgid "%d token changed by recalculation." msgid_plural "%d tokens changed by recalculation." @@ -3844,6 +3903,7 @@ msgstr "Lists choices changed." #: snippets/EditSingleSurveyTokenSnippet.php:132 +#: snippets/ShowSingleSurveyTokenSnippet.php:150 msgid "Show survey" msgstr "Show survey" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2012-01-24 09:27:34 UTC (rev 417) +++ trunk/library/languages/default-nl.po 2012-01-24 11:49:23 UTC (rev 418) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-12-20 12:13+0100\n" +"POT-Creation-Date: 2012-01-24 12:43+0100\n" "PO-Revision-Date: \n" "Last-Translator: Menno Dekker <men...@er...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -36,40 +36,40 @@ 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:1476 +#: classes/GemsEscort.php:1479 msgid "Please check back later." msgstr "Probeer het later opnieuw." -#: classes/GemsEscort.php:1478 -#: classes/GemsEscort.php:1482 -#: classes/GemsEscort.php:1483 +#: classes/GemsEscort.php:1481 +#: classes/GemsEscort.php:1485 +#: classes/GemsEscort.php:1486 msgid "System is in maintenance mode" msgstr "Systeem is in onderhoudsmodus" -#: classes/GemsEscort.php:1493 +#: classes/GemsEscort.php:1496 msgid "No access to site." msgstr "Geen toegang tot website." -#: classes/GemsEscort.php:1495 -#: classes/GemsEscort.php:1537 +#: classes/GemsEscort.php:1498 +#: classes/GemsEscort.php:1540 msgid "You have no access to this site." msgstr "U heeft geen toegang tot deze website." -#: classes/GemsEscort.php:1511 +#: classes/GemsEscort.php:1514 msgid "No access to page" msgstr "Geen toegang tot pagina" -#: classes/GemsEscort.php:1513 +#: classes/GemsEscort.php:1516 #, 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:1523 -#: classes/GemsEscort.php:1535 +#: classes/GemsEscort.php:1526 +#: classes/GemsEscort.php:1538 msgid "You are no longer logged in." msgstr "U bent niet meer ingelogd." -#: classes/GemsEscort.php:1524 +#: classes/GemsEscort.php:1527 msgid "You must login to access this page." msgstr "U moet ingelogd zijn voor toegang tot deze pagina." @@ -338,59 +338,59 @@ msgid "Changelog" msgstr "Changelog" -#: classes/Gems/Model.php:200 +#: classes/Gems/Model.php:205 msgid "Respondent nr" msgstr "Patiënt nr" -#: classes/Gems/Model.php:201 +#: classes/Gems/Model.php:206 msgid "Opened" msgstr "Bekeken" -#: classes/Gems/Model.php:202 +#: classes/Gems/Model.php:207 msgid "Consent" msgstr "Toestemming" -#: classes/Gems/Model.php:204 +#: classes/Gems/Model.php:209 msgid "E-Mail" msgstr "Email" -#: classes/Gems/Model.php:209 +#: classes/Gems/Model.php:214 msgid "Gender" msgstr "Geslacht" -#: classes/Gems/Model.php:210 +#: classes/Gems/Model.php:215 msgid "First name" msgstr "Voornaam" -#: classes/Gems/Model.php:211 +#: classes/Gems/Model.php:216 msgid "Surname prefix" msgstr "Tussenvoegsel" -#: classes/Gems/Model.php:212 +#: classes/Gems/Model.php:217 msgid "Last name" msgstr "Achternaam" -#: classes/Gems/Model.php:214 +#: classes/Gems/Model.php:219 msgid "Name" msgstr "Naam" -#: classes/Gems/Model.php:217 +#: classes/Gems/Model.php:222 msgid "Street" msgstr "Straat" -#: classes/Gems/Model.php:218 +#: classes/Gems/Model.php:223 msgid "Zipcode" msgstr "Postcode" -#: classes/Gems/Model.php:219 +#: classes/Gems/Model.php:224 msgid "City" msgstr "Stad" -#: classes/Gems/Model.php:221 +#: classes/Gems/Model.php:226 msgid "Phone" msgstr "Telefoon" -#: classes/Gems/Model.php:223 +#: classes/Gems/Model.php:228 msgid "Birthday" msgstr "Geboren op" @@ -431,94 +431,89 @@ msgid "Cache cleaned" msgstr "Cache opgeschoond" -#: classes/Gems/Controller/BrowseEditAction.php:349 +#: classes/Gems/Controller/BrowseEditAction.php:346 #, php-format msgid "New %s..." msgstr "Nieuw %s..." -#: classes/Gems/Controller/BrowseEditAction.php:382 +#: classes/Gems/Controller/BrowseEditAction.php:378 #, php-format msgid "Delete %s" msgstr "Verwijder %s" -#: classes/Gems/Controller/BrowseEditAction.php:386 +#: classes/Gems/Controller/BrowseEditAction.php:382 #, php-format msgid "%2$u %1$s deleted" msgstr "%2$u %1$s verwijderd" -#: classes/Gems/Controller/BrowseEditAction.php:400 +#: classes/Gems/Controller/BrowseEditAction.php:396 #, php-format msgid "Edit %s" msgstr "Bewerk %s" -#: classes/Gems/Controller/BrowseEditAction.php:497 +#: classes/Gems/Controller/BrowseEditAction.php:493 msgid "Free search text" msgstr "Vrije zoek tekst" -#: classes/Gems/Controller/BrowseEditAction.php:568 +#: classes/Gems/Controller/BrowseEditAction.php:564 msgid "Search" msgstr "Zoeken" -#: classes/Gems/Controller/BrowseEditAction.php:584 +#: classes/Gems/Controller/BrowseEditAction.php:580 #, php-format msgid "No %s found" msgstr "Geen %s gevonden" -#: classes/Gems/Controller/BrowseEditAction.php:657 -#: classes/Gems/Default/ExportAction.php:234 +#: classes/Gems/Controller/BrowseEditAction.php:653 #, php-format msgid "No %s found." msgstr "Geen %s gevonden." -#: classes/Gems/Controller/BrowseEditAction.php:772 +#: classes/Gems/Controller/BrowseEditAction.php:768 msgid "Are you sure?" msgstr "Weet u het zeker?" -#: classes/Gems/Controller/BrowseEditAction.php:788 -#: classes/Gems/Default/DatabaseAction.php:218 -#: classes/Gems/Default/DatabaseAction.php:528 +#: classes/Gems/Controller/BrowseEditAction.php:784 msgid "Yes" msgstr "Ja" -#: classes/Gems/Controller/BrowseEditAction.php:789 -#: classes/Gems/Default/DatabaseAction.php:219 -#: classes/Gems/Default/DatabaseAction.php:529 +#: classes/Gems/Controller/BrowseEditAction.php:785 msgid "No" msgstr "Nee" -#: classes/Gems/Controller/BrowseEditAction.php:842 +#: classes/Gems/Controller/BrowseEditAction.php:838 #, php-format msgid "Unknown %s requested" msgstr "Onjuist %s verzoek" -#: classes/Gems/Controller/BrowseEditAction.php:865 +#: classes/Gems/Controller/BrowseEditAction.php:861 #, php-format msgid "New %1$s..." msgstr "Nieuwe %1$s..." -#: classes/Gems/Controller/BrowseEditAction.php:873 +#: classes/Gems/Controller/BrowseEditAction.php:869 msgid "Save" msgstr "Opslaan" -#: classes/Gems/Controller/BrowseEditAction.php:909 +#: classes/Gems/Controller/BrowseEditAction.php:905 #, php-format msgid "%2$u %1$s saved" msgstr "%2$u %1$s opgeslagen" -#: classes/Gems/Controller/BrowseEditAction.php:912 +#: classes/Gems/Controller/BrowseEditAction.php:908 msgid "No changes to save." msgstr "Geen verandering om op te slaan." -#: classes/Gems/Controller/BrowseEditAction.php:921 +#: classes/Gems/Controller/BrowseEditAction.php:917 msgid "Input error! No changes saved!" msgstr "Invoer fout! Veranderingen niet opgeslagen!" -#: classes/Gems/Controller/BrowseEditAction.php:949 +#: classes/Gems/Controller/BrowseEditAction.php:945 #, php-format msgid "Show %s" msgstr "Toon %s" -#: classes/Gems/Controller/BrowseEditAction.php:956 +#: classes/Gems/Controller/BrowseEditAction.php:952 #, php-format msgid "Unknown %s." msgstr "%s is onbekend." @@ -697,11 +692,11 @@ msgid "Cron jobs turned off." msgstr "Cron opdrachten uitgezet." -#: classes/Gems/Default/CronAction.php:218 +#: classes/Gems/Default/CronAction.php:221 msgid "No mails sent." msgstr "Geen mail verzonden." -#: classes/Gems/Default/CronAction.php:221 +#: classes/Gems/Default/CronAction.php:224 msgid "On this test system all mail will be delivered to the from address." msgstr "Op dit test systeem worden alle emails gestuurd naar het \"van\" adres." @@ -1018,6 +1013,7 @@ msgstr "Exporteer gegevens" #: classes/Gems/Default/ExportAction.php:153 +#: classes/Gems/Default/MailJobAction.php:121 msgid "Survey" msgstr "Vragenlijst" @@ -1028,6 +1024,8 @@ #: classes/Gems/Default/ExportAction.php:172 #: classes/Gems/Default/IndexAction.php:200 +#: classes/Gems/Default/LogAction.php:197 +#: classes/Gems/Default/MailJobAction.php:119 msgid "Organization" msgstr "Organisatie" @@ -1036,11 +1034,12 @@ msgstr "Exporteer naar" #: classes/Gems/Default/GroupAction.php:89 -#: classes/Gems/Default/LogAction.php:170 +#: classes/Gems/Default/LogAction.php:201 msgid "Role" msgstr "Rol" #: classes/Gems/Default/GroupAction.php:92 +#: classes/Gems/Default/MailJobAction.php:104 msgid "Active" msgstr "Actief" @@ -1155,76 +1154,84 @@ msgid "Invalid language setting." msgstr "Ongeldige taal instelling." -#: classes/Gems/Default/LogAction.php:61 +#: classes/Gems/Default/LogAction.php:78 msgid "from" msgstr "vanaf" -#: classes/Gems/Default/LogAction.php:66 +#: classes/Gems/Default/LogAction.php:83 msgid "until" msgstr "tot" -#: classes/Gems/Default/LogAction.php:72 +#: classes/Gems/Default/LogAction.php:89 msgid "days" msgstr "dagen" -#: classes/Gems/Default/LogAction.php:73 +#: classes/Gems/Default/LogAction.php:90 msgid "weeks" msgstr "weken" -#: classes/Gems/Default/LogAction.php:74 +#: classes/Gems/Default/LogAction.php:91 msgid "months" msgstr "maanden" -#: classes/Gems/Default/LogAction.php:75 +#: classes/Gems/Default/LogAction.php:92 msgid "years" msgstr "jaren" -#: classes/Gems/Default/LogAction.php:96 +#: classes/Gems/Default/LogAction.php:113 +msgid "Organization:" +msgstr "Organisatie:" + +#: classes/Gems/Default/LogAction.php:115 +msgid "All organizations" +msgstr "Alle organisaties" + +#: classes/Gems/Default/LogAction.php:117 msgid "Staff:" msgstr "Medewerkers:" -#: classes/Gems/Default/LogAction.php:100 +#: classes/Gems/Default/LogAction.php:124 msgid "All staff" msgstr "Alle medewerkers" -#: classes/Gems/Default/LogAction.php:102 +#: classes/Gems/Default/LogAction.php:127 msgid "Patient:" msgstr "Patiënt:" -#: classes/Gems/Default/LogAction.php:106 +#: classes/Gems/Default/LogAction.php:134 msgid "All patients" msgstr "Alle patiënten" -#: classes/Gems/Default/LogAction.php:109 +#: classes/Gems/Default/LogAction.php:136 msgid "Action:" msgstr "Actie:" -#: classes/Gems/Default/LogAction.php:112 +#: classes/Gems/Default/LogAction.php:139 msgid "All actions" msgstr "Alle acties" -#: classes/Gems/Default/LogAction.php:163 +#: classes/Gems/Default/LogAction.php:190 msgid "Date" msgstr "Datum" -#: classes/Gems/Default/LogAction.php:164 +#: classes/Gems/Default/LogAction.php:191 #: classes/Gems/Default/LogMaintenanceAction.php:52 msgid "Action" msgstr "Actie" -#: classes/Gems/Default/LogAction.php:165 +#: classes/Gems/Default/LogAction.php:192 msgid "Message" msgstr "Bericht" -#: classes/Gems/Default/LogAction.php:167 +#: classes/Gems/Default/LogAction.php:198 msgid "Respondent" msgstr "Patiënt" -#: classes/Gems/Default/LogAction.php:171 +#: classes/Gems/Default/LogAction.php:202 msgid "IP address" msgstr "IP adres" -#: classes/Gems/Default/LogAction.php:178 +#: classes/Gems/Default/LogAction.php:209 #: classes/Gems/Default/LogMaintenanceAction.php:53 msgid "Log" msgstr "Logboek" @@ -1254,7 +1261,6 @@ msgstr "Nieuwe automatische mail opdracht..." #: classes/Gems/Default/MailJobAction.php:100 -#: classes/Gems/Default/MailLogAction.php:116 msgid "Template" msgstr "Sjabloon" @@ -1370,7 +1376,7 @@ msgstr "Adres van" #: classes/Gems/Default/MailLogAction.php:113 -#: classes/Gems/Default/MailTemplateAction.php:61 +#: classes/Gems/Default/MailTemplateAction.php:62 msgid "Subject" msgstr "Onderwerp" @@ -1426,7 +1432,7 @@ #: classes/Gems/Default/OptionAction.php:113 #: classes/Gems/Default/OptionAction.php:118 #: classes/Gems/Default/SourceAction.php:95 -#: classes/Gems/Default/StaffAction.php:144 +#: classes/Gems/Default/StaffAction.php:153 msgid "Repeat password" msgstr "Herhaal wachtwoord" @@ -1446,19 +1452,19 @@ msgid "Email servers" msgstr "Email servers" -#: classes/Gems/Default/MailTemplateAction.php:75 -#: classes/Gems/Default/StaffAction.php:212 -#: classes/Gems/Default/StaffAction.php:245 +#: classes/Gems/Default/MailTemplateAction.php:76 +#: classes/Gems/Default/StaffAction.php:298 +#: classes/Gems/Default/StaffAction.php:331 msgid "(all organizations)" msgstr "(alle organisaties)" -#: classes/Gems/Default/MailTemplateAction.php:94 +#: classes/Gems/Default/MailTemplateAction.php:95 msgid "email template" msgid_plural "email templates" msgstr[0] "email sjabloon" msgstr[1] "email sjablonen" -#: classes/Gems/Default/MailTemplateAction.php:99 +#: classes/Gems/Default/MailTemplateAction.php:100 msgid "Email templates" msgstr "Email sjabloon" @@ -1490,7 +1496,7 @@ #: classes/Gems/Default/OptionAction.php:188 #: classes/Gems/Default/OrganizationAction.php:139 #: classes/Gems/Default/RespondentAction.php:173 -#: classes/Gems/Default/StaffAction.php:228 +#: classes/Gems/Default/StaffAction.php:314 msgid "Language" msgstr "Taal" @@ -1616,6 +1622,7 @@ msgstr "Dit kan nog niet gewijzigd worden" #: classes/Gems/Default/OrganizationAction.php:175 +#: classes/Gems/Default/StaffAction.php:131 msgid "User Definition" msgstr "User Definition" @@ -1637,6 +1644,7 @@ #: classes/Gems/Default/OverviewPlanAction.php:115 #: classes/Gems/Default/ProjectSurveysAction.php:88 +#: classes/Gems/Default/SurveyAction.php:203 msgid "survey" msgid_plural "surveys" msgstr[0] "vragenlijst" @@ -1759,16 +1767,19 @@ msgstr "Sessie" #: classes/Gems/Default/ProjectSurveysAction.php:68 +#: classes/Gems/Default/SurveyAction.php:192 msgid "By" msgstr "Door" #: classes/Gems/Default/ProjectSurveysAction.php:69 #: classes/Gems/Default/ProjectTracksAction.php:67 +#: classes/Gems/Default/SurveyAction.php:193 msgid "From" msgstr "Van" #: classes/Gems/Default/ProjectSurveysAction.php:70 #: classes/Gems/Default/ProjectTracksAction.php:68 +#: classes/Gems/Default/SurveyAction.php:195 msgid "Until" msgstr "Tot" @@ -1796,6 +1807,7 @@ msgstr "Vragen in vragenlijsten %s" #: classes/Gems/Default/ProjectTracksAction.php:118 +#: classes/Gems/Default/SurveyAction.php:85 #, php-format msgid "Survey %s does not exist." msgstr "Vragenlijst %s bestaat niet." @@ -1975,6 +1987,7 @@ msgstr "A.u.b. het informed consent formulier doornemen met deze patiënt" #: classes/Gems/Default/RespondentPlanAction.php:67 +#: classes/Gems/Default/SurveyAction.php:171 msgid "Show respondent" msgstr "Toon patiënt" @@ -2067,100 +2080,125 @@ msgid "Database Password" msgstr "Database wachtwoord" -#: classes/Gems/Default/SourceAction.php:111 +#: classes/Gems/Default/SourceAction.php:116 #, php-format msgid "Checking survey results for %s source." msgstr "Controle vragenlijstresultaten voor %s bron." -#: classes/Gems/Default/SourceAction.php:143 +#: classes/Gems/Default/SourceAction.php:121 +#: classes/Gems/Default/SourceAction.php:145 +msgid "Prepare recheck" +msgstr "Hercontrole voorbereiden" + +#: classes/Gems/Default/SourceAction.php:125 +#: classes/Gems/Default/SourceAction.php:149 +#, php-format +msgid "Check %s tokens" +msgstr "Controleer %s kenmerken" + +#: classes/Gems/Default/SourceAction.php:128 +#: classes/Gems/Default/SourceAction.php:152 +msgid "No tokens to check." +msgstr "Geen kenmerken te controleren." + +#: classes/Gems/Default/SourceAction.php:141 +msgid "Checking survey results for all sources." +msgstr "Controle vragenlijstresultaten voor alle bronnen." + +#: classes/Gems/Default/SourceAction.php:175 msgid "Source Url" msgstr "Bron Url" -#: classes/Gems/Default/SourceAction.php:145 +#: classes/Gems/Default/SourceAction.php:177 msgid "Adaptor class" msgstr "Adaptor klasse" -#: classes/Gems/Default/SourceAction.php:147 +#: classes/Gems/Default/SourceAction.php:179 msgid "Database Server" msgstr "Database Server" -#: classes/Gems/Default/SourceAction.php:149 +#: classes/Gems/Default/SourceAction.php:181 msgid "Database host" msgstr "Database machine" -#: classes/Gems/Default/SourceAction.php:153 +#: classes/Gems/Default/SourceAction.php:185 msgid "Table prefix" msgstr "Voorvoegsel tabel" -#: classes/Gems/Default/SourceAction.php:157 +#: classes/Gems/Default/SourceAction.php:189 msgid "Last check" msgstr "Laatste controle" -#: classes/Gems/Default/SourceAction.php:190 +#: classes/Gems/Default/SourceAction.php:222 msgid "source" msgid_plural "sources" msgstr[0] "bron" msgstr[1] "bronnen" -#: classes/Gems/Default/SourceAction.php:195 +#: classes/Gems/Default/SourceAction.php:227 msgid "Survey Sources" msgstr "Bronnen" -#: classes/Gems/Default/SourceAction.php:203 +#: classes/Gems/Default/SourceAction.php:235 msgid "This installation is active." msgstr "Deze installatie is actief" -#: classes/Gems/Default/SourceAction.php:205 +#: classes/Gems/Default/SourceAction.php:237 msgid "Inactive installation." msgstr "Deze installatie is inactief" -#: classes/Gems/Default/SourceAction.php:218 -#: classes/Gems/Default/SourceAction.php:237 +#: classes/Gems/Default/SourceAction.php:250 +#: classes/Gems/Default/SourceAction.php:269 msgid "No changes." msgstr "Geen veranderingen" -#: classes/Gems/Default/SourceAction.php:233 +#: classes/Gems/Default/SourceAction.php:265 #, php-format msgid "Synchronization of source %s:" msgstr "Synchronisatie van %s bron:" -#: classes/Gems/Default/SourceAction.php:244 +#: classes/Gems/Default/SourceAction.php:276 msgid "Synchronize all sources of surveys" msgstr "Synchronizeer alle vragenlijsten bronnen" -#: classes/Gems/Default/SourceAction.php:245 +#: classes/Gems/Default/SourceAction.php:277 msgid "Synchronization will update the status of all surveys imported into this project to the status at the sources." msgstr "Synchronisatie zal de status van alle vragenlijsten in dit project aanpassen aan de status van de bron." -#: classes/Gems/Default/SourceAction.php:258 +#: classes/Gems/Default/SourceAction.php:318 msgid "Are you sure you want to synchronize all survey sources?" msgstr "Weet je zeker dat je alle bronnen wil synchroniseren?" -#: classes/Gems/Default/StaffAction.php:162 +#: classes/Gems/Default/StaffAction.php:171 msgid "Users can only login when this box is checked." msgstr "Gebruikers kunnen alleen inloggen als dit is aangevinkt." -#: classes/Gems/Default/StaffAction.php:163 +#: classes/Gems/Default/StaffAction.php:172 msgid "If checked the user will logoff when answering a survey." msgstr "Indien actief, dan logt de gebruiker uit voor het beantwoorden van een vragenlijst." -#: classes/Gems/Default/StaffAction.php:183 +#: classes/Gems/Default/StaffAction.php:192 msgid "You are not allowed to edit this staff member." msgstr "U mag deze medewerker niet wijzigen." -#: classes/Gems/Default/StaffAction.php:219 +#: classes/Gems/Default/StaffAction.php:249 +#, php-format +msgid "User with id %s already exists but is deleted, do you want to reactivate the account?" +msgstr "Gebruiker met inlognaam %s bestaat al maar is verwijderd, wilt u het account opnieuw activeren?" + +#: classes/Gems/Default/StaffAction.php:305 msgid "Primary function" msgstr "Primaire functie" -#: classes/Gems/Default/StaffAction.php:229 +#: classes/Gems/Default/StaffAction.php:315 msgid "Can login" msgstr "Kan inloggen" -#: classes/Gems/Default/StaffAction.php:230 +#: classes/Gems/Default/StaffAction.php:316 msgid "Logout on survey" msgstr "Logout bij beantwoorden vragenlijst" -#: classes/Gems/Default/StaffAction.php:305 +#: classes/Gems/Default/StaffAction.php:391 msgid "staff member" msgid_plural "staff members" msgstr[0] "medewerker" @@ -2258,47 +2296,51 @@ msgid "Survey should be assigned to a group before making it active." msgstr "Vragenlijst moet aan een groep toegewezen worden voordat deze actief kan worden gemaakt." -#: classes/Gems/Default/SurveyMaintenanceAction.php:272 +#: classes/Gems/Default/SurveyMaintenanceAction.php:277 #, php-format msgid "Checking survey results for the %s survey." msgstr "Controle op vragenlijstresultaten voor de vragenlijst '%s'." -#: classes/Gems/Default/SurveyMaintenanceAction.php:347 +#: classes/Gems/Default/SurveyMaintenanceAction.php:302 +msgid "Checking survey results for all surveys." +msgstr "Controle op vragenlijstresultaten voor alle vragenlijsten." + +#: classes/Gems/Default/SurveyMaintenanceAction.php:379 msgid "Source" msgstr "Bron" -#: classes/Gems/Default/SurveyMaintenanceAction.php:348 +#: classes/Gems/Default/SurveyMaintenanceAction.php:380 msgid "Status in source" msgstr "Status in bron" -#: classes/Gems/Default/SurveyMaintenanceAction.php:351 +#: classes/Gems/Default/SurveyMaintenanceAction.php:383 msgid "Active in source" msgstr "Actief in bron" -#: classes/Gems/Default/SurveyMaintenanceAction.php:352 +#: classes/Gems/Default/SurveyMaintenanceAction.php:384 #, php-format msgid "Active in %s" msgstr "Actief in %s" -#: classes/Gems/Default/SurveyMaintenanceAction.php:359 +#: classes/Gems/Default/SurveyMaintenanceAction.php:391 msgid "Single" msgstr "Los" -#: classes/Gems/Default/SurveyMaintenanceAction.php:392 +#: classes/Gems/Default/SurveyMaintenanceAction.php:424 #, php-format msgid "%d times in track." msgstr "%d keer in traject." -#: classes/Gems/Default/SurveyMaintenanceAction.php:394 +#: classes/Gems/Default/SurveyMaintenanceAction.php:426 #, php-format msgid "%d times in %d track(s)." msgstr "%d keer in %d traject(en)." -#: classes/Gems/Default/SurveyMaintenanceAction.php:398 +#: classes/Gems/Default/SurveyMaintenanceAction.php:430 msgid "Not used in track." msgstr "Niet in traject gebruikt." -#: classes/Gems/Default/SurveyMaintenanceAction.php:400 +#: classes/Gems/Default/SurveyMaintenanceAction.php:432 msgid "Not used in tracks." msgstr "Niet in trajecten gebruikt." @@ -2892,15 +2934,15 @@ msgid "Check all assignments" msgstr "Controleer alle toewijzingen" -#: classes/Gems/Menu/SubMenuItem.php:373 +#: classes/Gems/Menu/SubMenuItem.php:380 msgid "New" msgstr "Nieuw" -#: classes/Gems/Menu/SubMenuItem.php:427 +#: classes/Gems/Menu/SubMenuItem.php:434 msgid "Export the current data set to Excel" msgstr "Exporteer de huidige gegevens naar Excel" -#: classes/Gems/Menu/SubMenuItem.php:431 +#: classes/Gems/Menu/SubMenuItem.php:438 msgid "Excel export" msgstr "Excel export" @@ -3033,51 +3075,61 @@ msgstr "Beantwoorde vragenlijsten" #: classes/Gems/Tracker/ChangeTracker.php:64 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:110 #, php-format msgid "Checked %d tracks." msgstr "%d trajecten gecontroleerd." #: classes/Gems/Tracker/ChangeTracker.php:67 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:113 #, php-format msgid "Checked %d tokens." msgstr "%d kenmerken gecontroleerd." #: classes/Gems/Tracker/ChangeTracker.php:72 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:118 #, php-format msgid "Answers changed by survey completion event for %d tokens." msgstr "Bij %d kenmerken zijn de antwoorden aangepast door vragenlijst afrondingscode." #: classes/Gems/Tracker/ChangeTracker.php:75 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:121 #, php-format msgid "Results and timing changed for %d tokens." msgstr "Bij %d kenmerken zijn de resultaten en/of de tijdstippen aangepast." #: classes/Gems/Tracker/ChangeTracker.php:78 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:124 #, php-format msgid "%d token round completion events caused changed to %d tokens." msgstr "%2$d kenmerken zijn aangepast vanwege %1$d ronde voltooiingen." #: classes/Gems/Tracker/ChangeTracker.php:81 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:127 #, php-format msgid "%2$d token date changes in %1$d tracks." msgstr "De datum van %2$d kenmerken is aangepast in %1$d trajecten." #: classes/Gems/Tracker/ChangeTracker.php:84 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:130 #, php-format msgid "Round changes propagated to %d tokens." msgstr "%d kenmerken veranderd door ronde aanpassingen." #: classes/Gems/Tracker/ChangeTracker.php:87 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:133 #, php-format msgid "%d tokens deleted by round changes." msgstr "Vanwege ronde aanpassingen zijn %d kenmerken verwijderd." #: classes/Gems/Tracker/ChangeTracker.php:90 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:136 #, php-format msgid "%d tokens created to by round changes." msgstr "Vanwege ronde aanpassingen zijn nieuwe %d kenmerken gecreëerd." #: classes/Gems/Tracker/ChangeTracker.php:93 +#: classes/Gems/Tracker/Batch/ProcessTokensBatch.php:139 msgid "No tokens were changed." msgstr "Geen kenmerken veranderd." @@ -3477,15 +3529,23 @@ msgstr[0] "Het wachtwoord moet minstens een getal bevatten." msgstr[1] "Het wachtwoord moet minstens %d getallen bevatten." -#: classes/Gems/User/User.php:767 +#: classes/Gems/User/RadiusUserDefinition.php:174 +msgid "Shared secret" +msgstr "Shared secret" + +#: classes/Gems/User/User.php:782 msgid "Cookies must be enabled for this site." msgstr "Zonder cookies heeft u geen toegang tot deze site." -#: classes/Gems/User/UserLoader.php:141 -#: classes/Gems/User/UserLoader.php:155 +#: classes/Gems/User/UserLoader.php:142 +#: classes/Gems/User/UserLoader.php:156 msgid "Db storage" msgstr "Database opslag" +#: classes/Gems/User/UserLoader.php:157 +msgid "Radius storage" +msgstr "Radius authenticatie" + #: classes/Gems/User/UserPasswordValidator.php:115 msgid "Wrong password." msgstr "Verkeerd wachtwoord." @@ -3646,15 +3706,15 @@ msgstr[0] "decennium" msgstr[1] "decennia" -#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:210 +#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:211 msgid "No changes to save!" msgstr "Geen verandering om op te slaan!" -#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:401 +#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:403 msgid "Unknown edit data requested" msgstr "Onjuist gegevens bewerkingsverzoek" -#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:424 +#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:426 #, php-format msgid "Input error! Changes to %s not saved!" msgstr "Invoer fout! Veranderingen aan %s niet opgeslagen!" @@ -3832,7 +3892,6 @@ msgstr "Kenmerk %s voor vragenlijsten %s is verwijderd." #: snippets/DeleteTrackTokenSnippet.php:286 -#: snippets/EditTrackTokenSnippet.php:174 #, php-format msgid "%d token changed by recalculation." msgid_plural "%d tokens changed by recalculation." @@ -3844,6 +3903,7 @@ msgstr "Keuzelijst is veranderd." #: snippets/EditSingleSurveyTokenSnippet.php:132 +#: snippets/ShowSingleSurveyTokenSnippet.php:150 msgid "Show survey" msgstr "Toon vragenlijst" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-24 09:27:45
|
Revision: 417 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=417&view=rev Author: mennodekker Date: 2012-01-24 09:27:34 +0000 (Tue, 24 Jan 2012) Log Message: ----------- Fix for eventcalculation integer detection and another method tested Modified Paths: -------------- trunk/library/classes/Gems/Event/EventCalculations.php trunk/test/classes/Gems/Event/Gems_Event_EventCalculationsTest.php Modified: trunk/library/classes/Gems/Event/EventCalculations.php =================================================================== --- trunk/library/classes/Gems/Event/EventCalculations.php 2012-01-23 15:27:41 UTC (rev 416) +++ trunk/library/classes/Gems/Event/EventCalculations.php 2012-01-24 09:27:34 UTC (rev 417) @@ -95,7 +95,7 @@ * @param mixed $fieldNames An array of those names that should be used or a string that should occur in all names that have to be selected. * @return float */ - protected function averageInt(array $tokenAnswers, $fieldNames) + public function averageInt(array $tokenAnswers, $fieldNames) { if (is_string($fieldNames)) { $fieldNames = $this->_arrayFindName($tokenAnswers, $fieldNames); @@ -104,7 +104,7 @@ $count = 0; $sum = 0; foreach ($fieldNames as $name) { - if (isset($tokenAnswers[$name]) && is_int(intval($tokenAnswers[$name]))) { + if (isset($tokenAnswers[$name]) && (is_int($tokenAnswers[$name]) || (string) intval($tokenAnswers[$name]) === $tokenAnswers[$name])) { $count++; $sum += intval($tokenAnswers[$name]); } @@ -214,8 +214,8 @@ $sum = 0; foreach ($fieldNames as $name) { - if (isset($tokenAnswers[$name]) && intval($tokenAnswers[$name])== $tokenAnswers[$name]) { - $sum += $tokenAnswers[$name]; + if (isset($tokenAnswers[$name]) && (is_int($tokenAnswers[$name]) || (string) intval($tokenAnswers[$name]) === $tokenAnswers[$name])) { + $sum += intval($tokenAnswers[$name]); } } return $sum; Modified: trunk/test/classes/Gems/Event/Gems_Event_EventCalculationsTest.php =================================================================== --- trunk/test/classes/Gems/Event/Gems_Event_EventCalculationsTest.php 2012-01-23 15:27:41 UTC (rev 416) +++ trunk/test/classes/Gems/Event/Gems_Event_EventCalculationsTest.php 2012-01-24 09:27:34 UTC (rev 417) @@ -20,6 +20,29 @@ $this->object = new Gems_Event_EventCalculations(); } + public function testAverageInt() { + $tokenAnswers = array( + 'fld_1' => 1, + 'fld_2' => '2', + 'fld_3' => 1.5, //not integer + 'fld_4' => 'a', //not integer + 'fld_5' => 1.4, //not integer + 'fld_6' => 1.6, //not integer + '1_fld_7' => 6, //for fieldname test + '1_fld_8' => -1, //for fieldname test + 'notme' => 2 //for fieldname test + ); + + //Initial check (1+2 / 2) + $this->assertEquals(1.5, $this->object->averageInt($tokenAnswers, array('fld_1', 'fld_2'))); + + //Check if non-int will be left out (1+2 / 2) + $this->assertEquals(1.5, $this->object->averageInt($tokenAnswers, array('fld_1', 'fld_2', 'fld_3', 'fld_4'))); + + //Supply a string to test if the right fields get added (1+2+6-1 / 4) + $this->assertEquals(2, $this->object->averageInt($tokenAnswers, 'fld')); + } + public function testReverseCode1() { $this->assertEquals(10, $this->object->reverseCode(1, 1, 10)); $this->assertEquals(9, $this->object->reverseCode(2, 1, 10)); @@ -32,12 +55,14 @@ public function testSumInt() { $tokenAnswers = array( - 'fld_1'=>1, - 'fld_2'=>'2', - 'fld_3'=>1.5, //not integer - 'fld_4'=>'a', //not integer - 'fld_5'=>1.4, //not integer - 'fld_6'=>1.6 //not integer + 'fld_1' => 1, + 'fld_2' => '2', + 'fld_3' => 1.5, //not integer + 'fld_4' => 'a', //not integer + 'fld_5' => 1.4, //not integer + 'fld_6' => 1.6, //not integer + '1_fld_7' => 2, //for fieldname test + 'notme' => 2 //for fieldname test ); //Initial check @@ -46,9 +71,13 @@ //Check if non-int will be left out $this->assertEquals(3, $this->object->sumInt($tokenAnswers, array('fld_1', 'fld_2', 'fld_3'))); $this->assertEquals(3, $this->object->sumInt($tokenAnswers, array('fld_1', 'fld_2', 'fld_4'))); + //Make sure there are no rounding issues $this->assertEquals(3, $this->object->sumInt($tokenAnswers, array('fld_1', 'fld_2', 'fld_5'))); $this->assertEquals(3, $this->object->sumInt($tokenAnswers, array('fld_1', 'fld_2', 'fld_6'))); + + //Supply a string to test if the right fields get added + $this->assertEquals(5, $this->object->sumInt($tokenAnswers, 'fld')); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-23 15:27:47
|
Revision: 416 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=416&view=rev Author: mennodekker Date: 2012-01-23 15:27:41 +0000 (Mon, 23 Jan 2012) Log Message: ----------- Fix for event calculation helper 'sumInt' and a testcase (all event calculation helper methods should be made public to be testable) Modified Paths: -------------- trunk/library/classes/Gems/Event/EventCalculations.php trunk/test/classes/Gems/Event/Gems_Event_EventCalculationsTest.php Modified: trunk/library/classes/Gems/Event/EventCalculations.php =================================================================== --- trunk/library/classes/Gems/Event/EventCalculations.php 2012-01-23 11:04:04 UTC (rev 415) +++ trunk/library/classes/Gems/Event/EventCalculations.php 2012-01-23 15:27:41 UTC (rev 416) @@ -106,7 +106,7 @@ foreach ($fieldNames as $name) { if (isset($tokenAnswers[$name]) && is_int(intval($tokenAnswers[$name]))) { $count++; - $sum += $tokenAnswers[$name]; + $sum += intval($tokenAnswers[$name]); } } return $count ? $sum / $count : null; @@ -206,7 +206,7 @@ * @param mixed $fieldNames An array of those names that should be used or a string that should occur in all names that have to be selected. * @return int */ - protected function sumInt(array $tokenAnswers, $fieldNames) + public function sumInt(array $tokenAnswers, $fieldNames) { if (is_string($fieldNames)) { $fieldNames = $this->_arrayFindName($tokenAnswers, $fieldNames); @@ -214,7 +214,7 @@ $sum = 0; foreach ($fieldNames as $name) { - if (isset($tokenAnswers[$name]) && is_int(intval($tokenAnswers[$name]))) { + if (isset($tokenAnswers[$name]) && intval($tokenAnswers[$name])== $tokenAnswers[$name]) { $sum += $tokenAnswers[$name]; } } Modified: trunk/test/classes/Gems/Event/Gems_Event_EventCalculationsTest.php =================================================================== --- trunk/test/classes/Gems/Event/Gems_Event_EventCalculationsTest.php 2012-01-23 11:04:04 UTC (rev 415) +++ trunk/test/classes/Gems/Event/Gems_Event_EventCalculationsTest.php 2012-01-23 15:27:41 UTC (rev 416) @@ -30,6 +30,27 @@ $this->assertEquals(0, $this->object->reverseCode(5, 0, 5)); } + public function testSumInt() { + $tokenAnswers = array( + 'fld_1'=>1, + 'fld_2'=>'2', + 'fld_3'=>1.5, //not integer + 'fld_4'=>'a', //not integer + 'fld_5'=>1.4, //not integer + 'fld_6'=>1.6 //not integer + ); + + //Initial check + $this->assertEquals(3, $this->object->sumInt($tokenAnswers, array('fld_1', 'fld_2'))); + + //Check if non-int will be left out + $this->assertEquals(3, $this->object->sumInt($tokenAnswers, array('fld_1', 'fld_2', 'fld_3'))); + $this->assertEquals(3, $this->object->sumInt($tokenAnswers, array('fld_1', 'fld_2', 'fld_4'))); + //Make sure there are no rounding issues + $this->assertEquals(3, $this->object->sumInt($tokenAnswers, array('fld_1', 'fld_2', 'fld_5'))); + $this->assertEquals(3, $this->object->sumInt($tokenAnswers, array('fld_1', 'fld_2', 'fld_6'))); + } + /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-23 11:04:10
|
Revision: 415 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=415&view=rev Author: mennodekker Date: 2012-01-23 11:04:04 +0000 (Mon, 23 Jan 2012) Log Message: ----------- Saving on session storage and fixing incompatibility between tracker and token in selection of data that caused problems on deleted respondents Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Token.php trunk/library/classes/Gems/Tracker.php Modified: trunk/library/classes/Gems/Tracker/Token.php =================================================================== --- trunk/library/classes/Gems/Tracker/Token.php 2012-01-23 08:33:00 UTC (rev 414) +++ trunk/library/classes/Gems/Tracker/Token.php 2012-01-23 11:04:04 UTC (rev 415) @@ -1052,7 +1052,7 @@ if (is_array($gemsData)) { $this->_gemsData = $gemsData + $this->_gemsData; } else { - $tokenSelect = $this->tracker->getTokenSelect(true); + $tokenSelect = $this->tracker->getTokenSelect(); $tokenSelect ->andReceptionCodes() Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2012-01-23 08:33:00 UTC (rev 414) +++ trunk/library/classes/Gems/Tracker.php 2012-01-23 11:04:04 UTC (rev 415) @@ -845,7 +845,7 @@ $tokenRows = $tokenSelect->fetchAll(); foreach ($tokenRows as $tokenData) { - $batch->addToken($tokenData, $userId); + $batch->addToken($tokenData['gto_id_token'], $userId); } } @@ -867,7 +867,10 @@ { $userId = $this->_checkUserId($userId); $tokenSelect = $this->getTokenSelect(); - $tokenSelect->andReceptionCodes(); + $tokenSelect->andReceptionCodes() + ->andRespondents() + ->andRespondentOrganizations() + ->andConsents(); if ($cond) { $tokenSelect->forWhere($cond); } @@ -896,7 +899,10 @@ { $userId = $this->_checkUserId($userId); $tokenSelect = $this->getTokenSelect(); - $tokenSelect->andReceptionCodes(); + $tokenSelect->andReceptionCodes() + ->andRespondents() + ->andRespondentOrganizations() + ->andConsents(); if ($cond) { $tokenSelect->forWhere($cond); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-23 08:33:06
|
Revision: 414 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=414&view=rev Author: mennodekker Date: 2012-01-23 08:33:00 +0000 (Mon, 23 Jan 2012) Log Message: ----------- Fixed missing 'password' element while the 'repeat password' element was visible (introduced in [394]) Modified Paths: -------------- trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-20 17:06:04 UTC (rev 413) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-23 08:33:00 UTC (rev 414) @@ -477,6 +477,7 @@ $element = new Zend_Form_Element_Password($name, $options); $this->_applyValidators($name, $element); + $this->form->addElement($element); if ($stringlength) { $element->addValidator('StringLength', true, $stringlength); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-20 17:06:15
|
Revision: 413 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=413&view=rev Author: matijsdejong Date: 2012-01-20 17:06:04 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Applied progressBar (#45) for all source checks. Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php trunk/library/classes/Gems/Tracker/TrackerInterface.php trunk/library/classes/Gems/Tracker.php trunk/library/classes/MUtil/Batch/BatchAbstract.php Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2012-01-19 17:17:39 UTC (rev 412) +++ trunk/library/classes/Gems/Default/SourceAction.php 2012-01-20 17:06:04 UTC (rev 413) @@ -107,20 +107,52 @@ $sourceId = $this->getSourceId(); $where = $this->db->quoteInto('gto_id_survey IN (SELECT gsu_id_survey FROM gems__surveys WHERE gsu_id_source = ?)', $sourceId); - $this->addMessage(sprintf($this->_( - 'Checking survey results for %s source.'), + $batch = $this->loader->getTracker()->recalculateTokensBatch('sourceCheck' . $sourceId, $this->loader->getCurrentUser()->getUserId(), $where); + + if ($batch->run($this->getRequest())) { + exit; + } else { + $this->html->h3( + sprintf($this->_('Checking survey results for %s source.'), $this->db->fetchOne("SELECT gso_source_name FROM gems__sources WHERE gso_id_source = ?", $sourceId))); - $this->addMessage($this->loader->getTracker()->recalculateTokens($this->session->user_id, $where)); - - $this->afterSaveRoute($this->getRequest()); + if ($batch->isFinished()) { + $this->addMessage($batch->getMessages(true)); + $this->html->pInfo($batch->getRestartButton($this->_('Prepare recheck'), array('class' => 'actionlink'))); + } else { + if ($batch->count()) { + // Batch is loaded by Tracker + $this->html->pInfo($batch->getStartButton(sprintf($this->_('Check %s tokens'), $batch->count()))); + $this->html->append($batch->getPanel($this->view, '0%')); + } else { + $this->html->pInfo($this->_('No tokens to check.')); + } + } + } } public function checkAllAction() { - $this->addMessage($this->loader->getTracker()->recalculateTokens($this->session->user_id)); + $batch = $this->loader->getTracker()->recalculateTokensBatch('surveyCheckAll', $this->loader->getCurrentUser()->getUserId()); - $this->afterSaveRoute($this->getRequest()); + if ($batch->run($this->getRequest())) { + exit; + } else { + $this->html->h3($this->_('Checking survey results for all sources.')); + + if ($batch->isFinished()) { + $this->addMessage($batch->getMessages(true)); + $this->html->pInfo($batch->getRestartButton($this->_('Prepare recheck'), array('class' => 'actionlink'))); + } else { + if ($batch->count()) { + // Batch is loaded by Tracker + $this->html->pInfo($batch->getStartButton(sprintf($this->_('Check %s tokens'), $batch->count()))); + $this->html->append($batch->getPanel($this->view, '0%')); + } else { + $this->html->pInfo($this->_('No tokens to check.')); + } + } + } } /** @@ -258,18 +290,19 @@ } else { // Populate the batch (from scratch). $batch->reset(); - if (true) { + if (! true) { $batch->addWaitsMs(400, 20); $batch->addWaits(2, 1, 'Har har'); $batch->addWaitsMs(20, 50); } else { - $batch->addWaits(4, 2); - $batch->addWaits(2, 1); - $batch->addWaitsLater(15, 1); - $batch->addWait(4, 'That took some time!'); - $batch->addWait(4, 'So we see the message. :)'); - $batch->addWaitsLater(1, 2); - $batch->addWaits(4); + $batch->addWaits(1440, 10); + //$batch->addWaits(4, 2); + //$batch->addWaits(2, 1); + //$batch->addWaitsLater(15, 1); + //$batch->addWait(4, 'That took some time!'); + //$batch->addWait(4, 'So we see the message. :)'); + //$batch->addWaitsLater(1, 2); + //$batch->addWaits(4); } $this->html->pInfo($batch->getStartButton($this->_('Start synchronization'))); $this->html->append($batch->getPanel($this->view, '0%')); Modified: trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-01-19 17:17:39 UTC (rev 412) +++ trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-01-20 17:06:04 UTC (rev 413) @@ -268,7 +268,7 @@ $surveyId = $this->_getParam(MUtil_Model::REQUEST_ID); $where = $this->db->quoteInto('gto_id_survey = ?', $surveyId); - $batch = $this->loader->getTracker()->recalculateTokensBatch($this->loader->getCurrentUser()->getUserId(), $where); + $batch = $this->loader->getTracker()->recalculateTokensBatch('surveyCheck' . $surveyId, $this->loader->getCurrentUser()->getUserId(), $where); if ($batch->run($this->getRequest())) { exit; @@ -294,7 +294,7 @@ public function checkAllAction() { - $batch = $this->loader->getTracker()->recalculateTokensBatch($this->loader->getCurrentUser()->getUserId()); + $batch = $this->loader->getTracker()->recalculateTokensBatch('surveyCheckAll', $this->loader->getCurrentUser()->getUserId()); if ($batch->run($this->getRequest())) { exit; Modified: trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php =================================================================== --- trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php 2012-01-19 17:17:39 UTC (rev 412) +++ trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php 2012-01-20 17:06:04 UTC (rev 413) @@ -134,7 +134,7 @@ } if ($this->getCounter('createdTokens')) { $messages[] = sprintf($this->translate->_('%d tokens created to by round changes.'), $this->getCounter('createdTokens')); - } + } } else { $messages[] = $this->translate->_('No tokens were changed.'); } Modified: trunk/library/classes/Gems/Tracker/TrackerInterface.php =================================================================== --- trunk/library/classes/Gems/Tracker/TrackerInterface.php 2012-01-19 17:17:39 UTC (rev 412) +++ trunk/library/classes/Gems/Tracker/TrackerInterface.php 2012-01-20 17:06:04 UTC (rev 413) @@ -295,10 +295,10 @@ * * Does not reflect changes to tracks or rounds. * - * @param Zend_Translate $t + * @param string $batch_id A unique identifier for the current batch * @param int $userId Id of the user who takes the action (for logging) * @param string $cond * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes */ - public function recalculateTokensBatch($userId = null, $cond = null); + public function recalculateTokensBatch($batch_id, $userId = null, $cond = null); } Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2012-01-19 17:17:39 UTC (rev 412) +++ trunk/library/classes/Gems/Tracker.php 2012-01-20 17:06:04 UTC (rev 413) @@ -830,15 +830,16 @@ * * Does not reflect changes to tracks or rounds. * + * @param string $batch_id A unique identifier for the current batch * @param Gems_Tracker_Token_TokenSelect Select statements selecting tokens * @param int $userId Id of the user who takes the action (for logging) * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes */ - protected function processTokensBatch(Gems_Tracker_Token_TokenSelect $tokenSelect, $userId) + protected function processTokensBatch($batch_id, Gems_Tracker_Token_TokenSelect $tokenSelect, $userId) { $where = implode(' ', $tokenSelect->getSelect()->getPart(Zend_Db_Select::WHERE)); - $batch = $this->_loadClass('Batch_ProcessTokensBatch', true); //, array($where, $this)); + $batch = $this->_loadClass('Batch_ProcessTokensBatch', true, array($batch_id)); if (! $batch->isLoaded()) { $tokenRows = $tokenSelect->fetchAll(); @@ -886,12 +887,12 @@ * * Does not reflect changes to tracks or rounds. * - * @param Zend_Translate $t - * @param int $userId Id of the user who takes the action (for logging) + * @param string $batch_id A unique identifier for the current batch + * @param int $userId Id of the user who takes the action (for logging) * @param string $cond * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes */ - public function recalculateTokensBatch($userId = null, $cond = null) + public function recalculateTokensBatch($batch_id, $userId = null, $cond = null) { $userId = $this->_checkUserId($userId); $tokenSelect = $this->getTokenSelect(); @@ -904,6 +905,6 @@ $tokenSelect->forWhere('gsu_surveyor_active = 1'); self::$verbose = true; - return $this->processTokensBatch($tokenSelect, $userId); + return $this->processTokensBatch($batch_id, $tokenSelect, $userId); } } Modified: trunk/library/classes/MUtil/Batch/BatchAbstract.php =================================================================== --- trunk/library/classes/MUtil/Batch/BatchAbstract.php 2012-01-19 17:17:39 UTC (rev 412) +++ trunk/library/classes/MUtil/Batch/BatchAbstract.php 2012-01-20 17:06:04 UTC (rev 413) @@ -420,6 +420,16 @@ } /** + * Get the current progress percentage + * + * @return float + */ + public function getProgressPercentage() + { + return round($this->_session->processed / (count($this->_session->commands) + $this->_session->processed) * 100, 2); + } + + /** * Returns a button that can be clicked to restart the progress bar. * * @param mixed $arg_array MUtil_Ra::args() arguments to populate link with @@ -548,10 +558,8 @@ // error_log('Cur: ' . microtime(true) . ' report is '. (microtime(true) > $reportRun ? 'true' : 'false')); if (microtime(true) > $reportRun) { // Communicate progress - $percent = round($this->_session->processed / (count($this->_session->commands) + $this->_session->processed) * 100, 2); + $bar->update($this->getProgressPercentage(), end($this->_session->messages)); - $bar->update($percent, end($this->_session->messages)); - // INFO: When using PULL $bar->update() should exit the program, // but just let us make sure. if ($isPull) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-19 17:17:51
|
Revision: 412 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=412&view=rev Author: matijsdejong Date: 2012-01-19 17:17:39 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Batch processing works (#35) and is implemented for SurveyMaintenanceAction.php checks. Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php trunk/library/classes/Gems/Tracker/TrackerInterface.php trunk/library/classes/Gems/Tracker.php trunk/library/classes/MUtil/Batch/BatchAbstract.php trunk/library/classes/MUtil/Batch/BatchPull.js trunk/library/classes/MUtil/Batch/BatchPush.js trunk/library/classes/MUtil/Batch/WaitBatch.php trunk/library/classes/MUtil/ProgressBar/Adapter/JsPush.php Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/Gems/Default/SourceAction.php 2012-01-19 17:17:39 UTC (rev 412) @@ -246,77 +246,34 @@ /* $batch = new MUtil_Batch_WaitBatch(); - $batch->method = MUtil_Batch_BatchAbstract::PUSH; - if ($batch->isLoaded()) { - if ($batch->isFinished()) { - if (! $batch->showReport($this->getRequest())) { - $batch->reset(); - } - } else { - if ($batch->hasStarted($this->getRequest())) { - $batch->runAll(); - exit; - } - } - } else { - $batch->addWaits(4, 2); - $batch->addWaitsLater(15, 1); - $batch->addWaits(1, 1); - $batch->addWaitsLater(1, 2); - $batch->addWaits(4); - } - if ($batch->showReport($this->getRequest())) { - $this->addMessage($batch->getReport()); - $batch->reset(); - $this->html->pInfo()->actionLink(array($batch->progressParameterName => null), $this->_('Restart')); - } else { - $this->html->append($batch->getPanel($this->view)); - } - // */ - /* - // $batch = new Gems_Tracker_Batch_SynchronizeSourceBatch(); - // $batch->method = 'Push'; - if (! $batch->isLoaded()) { - foreach ($data as $row) { - $batch->addSource($row['gso_id_source'], $row['gso_source_name']); - } - } + // $batch->setMethodPush(5); + // $batch->autoStart = true; + // $batch->minimalStepDurationMs = 2000; if ($batch->run($this->getRequest())) { - if ($batch->isReady()) { - $this->addMessage($batch->getMessages()); - $this->afterSaveRoute($this->getRequest()); - } + exit; } else { - $this->html[] = $batch->getPanel(); - } - // */ - /* - $progress = $this->html->progress('0%'); - $progress->method = 'Push'; - // $progress = $this->html->progress(); - if ($progress->run($this->getRequest())) { - - // IIS 7: %windir%\System32\inetsrv\config\applicationHost.config - // ../handlers/add name="PHP_via_FastCGI" - // ../handlers/add name="CGI-exe" - // add attribute responseBufferLimit="1024" - - for ($i = 50; $i < 100; $i += 1) { - if ($i < 20) { - $text = 'Just beginning'; - } else if ($i < 50) { - $text = 'A bit done'; - } else if ($i < 80) { - $text = 'Getting closer'; + if ($batch->isFinished()) { + $this->addMessage($batch->getMessages(true)); + $this->html->pInfo($batch->getRestartButton($this->_('Prepare restart'), array('class' => 'actionlink'))); + } else { + // Populate the batch (from scratch). + $batch->reset(); + if (true) { + $batch->addWaitsMs(400, 20); + $batch->addWaits(2, 1, 'Har har'); + $batch->addWaitsMs(20, 50); } else { - $text = 'Nearly done'; + $batch->addWaits(4, 2); + $batch->addWaits(2, 1); + $batch->addWaitsLater(15, 1); + $batch->addWait(4, 'That took some time!'); + $batch->addWait(4, 'So we see the message. :)'); + $batch->addWaitsLater(1, 2); + $batch->addWaits(4); } - // IIS? - // echo str_repeat(' ',1024*3); - $progress->update($i, ' ' . $text); - sleep(1); + $this->html->pInfo($batch->getStartButton($this->_('Start synchronization'))); + $this->html->append($batch->getPanel($this->view, '0%')); } - $progress->finish(); } // */ if ($data) { Modified: trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-01-19 17:17:39 UTC (rev 412) @@ -268,42 +268,52 @@ $surveyId = $this->_getParam(MUtil_Model::REQUEST_ID); $where = $this->db->quoteInto('gto_id_survey = ?', $surveyId); - /* $batch = $this->loader->getTracker()->recalculateTokensBatch($this->loader->getCurrentUser()->getUserId(), $where); - if ($batch->hasStarted($this->getRequest())) { - // TODO + if ($batch->run($this->getRequest())) { + exit; } else { $this->html->h3( sprintf($this->_('Checking survey results for the %s survey.'), $this->db->fetchOne("SELECT gsu_survey_name FROM gems__surveys WHERE gsu_id_survey = ?", $surveyId))); - if ($batch->isLoaded()) { - $this->html->pInfo(sprintf($this->_('Running check for %s tokens...'), $batch->count())); - $this->html->append($batch->getPanel()); + if ($batch->isFinished()) { + $this->addMessage($batch->getMessages(true)); + $this->html->pInfo($batch->getRestartButton($this->_('Prepare recheck'), array('class' => 'actionlink'))); } else { - $this->html->pInfo($this->_('No tokens to check.')); + if ($batch->count()) { + // Batch is loaded by Tracker + $this->html->pInfo($batch->getStartButton(sprintf($this->_('Check %s tokens'), $batch->count()))); + $this->html->append($batch->getPanel($this->view, '0%')); + } else { + $this->html->pInfo($this->_('No tokens to check.')); + } } } - // */ - - //* - $this->addMessage(sprintf($this->_( - 'Checking survey results for the %s survey.'), - $this->db->fetchOne("SELECT gsu_survey_name FROM gems__surveys WHERE gsu_id_survey = ?", $surveyId))); - - $this->addMessage($this->loader->getTracker()->recalculateTokens($this->session->user_id, $where)); - - $this->afterSaveRoute($this->getRequest()); - - // */ } public function checkAllAction() { - $this->addMessage($this->loader->getTracker()->recalculateTokens($this->session->user_id)); + $batch = $this->loader->getTracker()->recalculateTokensBatch($this->loader->getCurrentUser()->getUserId()); - $this->afterSaveRoute($this->getRequest()); + if ($batch->run($this->getRequest())) { + exit; + } else { + $this->html->h3($this->_('Checking survey results for all surveys.')); + + if ($batch->isFinished()) { + $this->addMessage($batch->getMessages(true)); + $this->html->pInfo($batch->getRestartButton($this->_('Prepare recheck'), array('class' => 'actionlink'))); + } else { + if ($batch->count()) { + // Batch is loaded by Tracker + $this->html->pInfo($batch->getStartButton(sprintf($this->_('Check %s tokens'), $batch->count()))); + $this->html->append($batch->getPanel($this->view, '0%')); + } else { + $this->html->pInfo($this->_('No tokens to check.')); + } + } + } } /** Modified: trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php =================================================================== --- trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php 2012-01-19 17:17:39 UTC (rev 412) @@ -50,15 +50,14 @@ * * @var Gems_Tracker */ - public $tracker; + protected $tracker; - public function __construct($where, Gems_Tracker $tracker) - { - parent::__construct(__CLASS__ . '::' . $where); + /** + * + * @var Zend_Translate + */ + protected $translate; - $this->tracker = $tracker; - } - public function addToken($tokenData, $userId) { if (is_array($tokenData)) { @@ -71,7 +70,7 @@ } // MUtil_Echo::track($tokenData); - $this->setStep('checkTokenCompletion', 'tokchk-' . $tokenId, $tokenData); + $this->setStep('checkTokenCompletion', 'tokchk-' . $tokenId, $tokenData, $userId); return $this; } @@ -105,6 +104,68 @@ } } + public function getCounterMessages() + { + if ($this->getCounter('checkedRespondentTracks')) { + $messages[] = sprintf($this->translate->_('Checked %d tracks.'), $this->getCounter('checkedRespondentTracks')); + } + if ($this->getCounter('checkedTokens') || (! $this->getCounter('checkedRespondentTracks'))) { + $messages[] = sprintf($this->translate->_('Checked %d tokens.'), $this->getCounter('checkedTokens')); + } + + if ($this->hasChanged()) { + if ($this->getCounter('surveyCompletionChanges')) { + $messages[] = sprintf($this->translate->_('Answers changed by survey completion event for %d tokens.'), $this->getCounter('surveyCompletionChanges')); + } + if ($this->getCounter('resultDataChanges')) { + $messages[] = sprintf($this->translate->_('Results and timing changed for %d tokens.'), $this->getCounter('resultDataChanges')); + } + if ($this->getCounter('roundCompletionChanges')) { + $messages[] = sprintf($this->translate->_('%d token round completion events caused changed to %d tokens.'), $this->getCounter('roundCompletionCauses'), $this->getCounter('roundCompletionChanges')); + } + if ($this->getCounter('tokenDateChanges')) { + $messages[] = sprintf($this->translate->_('%2$d token date changes in %1$d tracks.'), $this->getCounter('tokenDateCauses'), $this->getCounter('tokenDateChanges')); + } + if ($this->getCounter('roundChangeUpdates')) { + $messages[] = sprintf($this->translate->_('Round changes propagated to %d tokens.'), $this->getCounter('roundChangeUpdates')); + } + if ($this->getCounter('deletedTokens')) { + $messages[] = sprintf($this->translate->_('%d tokens deleted by round changes.'), $this->getCounter('deletedTokens')); + } + if ($this->getCounter('createdTokens')) { + $messages[] = sprintf($this->translate->_('%d tokens created to by round changes.'), $this->getCounter('createdTokens')); + } + } else { + $messages[] = $this->translate->_('No tokens were changed.'); + } + + return $messages; + } + + /** + * String of messages from the batch + * + * Do not forget to reset() the batch if you're done with it after + * displaying the report. + * + * @param boolean $reset When true the batch is reset afterwards + * @return array + */ + public function getMessages($reset = false) + { + return array_merge($this->getCounterMessages(), parent::getMessages($reset)); + } + + public function hasChanged() + { + return $this->getCounter('resultDataChanges') || + $this->getCounter('surveyCompletionChanges') || + $this->getCounter('roundCompletionChanges') || + $this->getCounter('tokenDateCauses') || + $this->getCounter('roundChangeUpdates') || + $this->getCounter('createdTokens'); + } + protected function processTokenCompletion($tokenData, $userId) { $token = $this->tracker->getToken($tokenData); @@ -118,7 +179,7 @@ } $trackId = $respTrack->getRespondentTrackId(); - $this->setStep('checkTrackTokens', 'chktrck-' . $trackId, $trackId, $userid); + $this->setStep('checkTrackTokens', 'chktrck-' . $trackId, $trackId, $userId); } } } Modified: trunk/library/classes/Gems/Tracker/TrackerInterface.php =================================================================== --- trunk/library/classes/Gems/Tracker/TrackerInterface.php 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/Gems/Tracker/TrackerInterface.php 2012-01-19 17:17:39 UTC (rev 412) @@ -288,4 +288,17 @@ * @return array of translated messages */ public function recalculateTokens($userId = null, $cond = null); + + /** + * Recalculates all token dates, timing and results + * and outputs text messages. + * + * Does not reflect changes to tracks or rounds. + * + * @param Zend_Translate $t + * @param int $userId Id of the user who takes the action (for logging) + * @param string $cond + * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes + */ + public function recalculateTokensBatch($userId = null, $cond = null); } Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/Gems/Tracker.php 2012-01-19 17:17:39 UTC (rev 412) @@ -838,7 +838,7 @@ { $where = implode(' ', $tokenSelect->getSelect()->getPart(Zend_Db_Select::WHERE)); - $batch = new Gems_Tracker_Batch_ProcessTokensBatch($where, $this); + $batch = $this->_loadClass('Batch_ProcessTokensBatch', true); //, array($where, $this)); if (! $batch->isLoaded()) { $tokenRows = $tokenSelect->fetchAll(); Modified: trunk/library/classes/MUtil/Batch/BatchAbstract.php =================================================================== --- trunk/library/classes/MUtil/Batch/BatchAbstract.php 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/MUtil/Batch/BatchAbstract.php 2012-01-19 17:17:39 UTC (rev 412) @@ -46,11 +46,15 @@ * Each step in the sequence consists of a method name of the child object * and any number of scalar variables and array's containing scalar variables. * + * See MUtil_Batch_WaitBatch for example usage. + * * A nice future extension would be to separate the storage engine used so we * could use e.g. Zend_Queue as an alternative for storing the command stack. * However, as this package needs more state info than available in Zend_Queue * we would need an extra extension for that. * + * @see MUtil_Batch_WaitBatch + * * @package MUtil * @subpackage Batch * @copyright Copyright (c) 2012 Erasmus MC @@ -94,17 +98,40 @@ * * @var boolean */ - public $autoStart = true; + public $autoStart = false; /** - * The mode to use for the panel: push or pull + * The number of bytes to pad during push communication in Kilobytes. * + * This is needed as many servers need extra output passing to avoid buffering. + * + * Also this allows you to keep the server buffer high while using this JsPush. + * + * @var int + */ + public $extraPushPaddingKb = 0; + + /** + * The mode to use for the panel: PUSH or PULL + * * @var string */ - public $method = self::PULL; + protected $method = self::PULL; /** + * The minimal time used between send progress reports. * + * This enables quicker processing as multiple steps can be taken in a single + * run(), without the run taking too long to answer. + * + * Set to 0 to report back on each step. + * + * @var int + */ + public $minimalStepDurationMs = 1000; + + /** + * * @var Zend_ProgressBar */ protected $progressBar; @@ -230,66 +257,108 @@ */ protected function addToCounter($name, $add = 1) { - if (! isset($this->session->counters[$name])) { - $this->session->counters[$name] = 0; + if (! isset($this->_session->counters[$name])) { + $this->_session->counters[$name] = 0; } - $this->session->counters[$name] += $add; + $this->_session->counters[$name] += $add; - return $this->session->counters[$name]; + return $this->_session->counters[$name]; } - /** - * Count the number of commands + /** + * The number of commands in this batch (both processed + * and unprocessed). * - * @return int The custom count as an integer. - */ - public function count() + * @return int + */ + public function count() { - return count($this->_session->commands); + return count($this->_session->commands) + $this->_session->processed; } /** - * Returns the prefix used for the function names to avoid naming clashes. + * Return the value of a named counter * + * @param string $name + * @return integer + */ + public function getCounter($name) + { + MUtil_Echo::track($this->_session->counters); + if (isset($this->_session->counters[$name])) { + return $this->_session->counters[$name]; + } + + return 0; + } + + /** + * Returns the prefix used for the function names for the PUSH method to avoid naming clashes. + * + * Set automatically to get_class($this) . '_' $this->_id . '_', use different name + * in case of name clashes. + * + * @see setFunctionPrefix() + * * @return string */ - public function getFunctionPrefix() + protected function getFunctionPrefix() { if (! $this->_functionPrefix) { - $this->setFunctionPrefix(__CLASS__ . '_' . $this->_id . '_'); + $this->setFunctionPrefix(get_class($this) . '_' . $this->_id . '_'); } return (string) $this->_functionPrefix; } /** - * Return + * String of messages from the batch + * + * Do not forget to reset() the batch if you're done with it after + * displaying the report. + * + * @param boolean $reset When true the batch is reset afterwards + * @return array + */ + public function getMessages($reset = false) + { + $messages = $this->_session->messages; + + if ($reset) { + $this->reset(); + } + + return $messages; + } + + /** + * Return a progress panel object, set up to be used by + * this batch. + * + * @param Zend_View_Abstract $view + * @param mixed $arg_array MUtil_Ra::args() arguments to populate progress bar with * @return MUtil_Html_ProgressPanel */ - public function getPanel(Zend_View_Abstract $view) + public function getPanel(Zend_View_Abstract $view, $arg_array = null) { + $args = func_get_args(); + ZendX_JQuery::enableView($view); - if ($this->isFinished()) { - $content = '100%'; - } else { - $content = '100%'; - } + $urlFinish = $view->url(array($this->progressParameterName => $this->progressParameterReportValue)); + $urlRun = $view->url(array($this->progressParameterName => $this->progressParameterRunValue)); - $panel = new MUtil_Html_ProgressPanel('0%'); - + $panel = new MUtil_Html_ProgressPanel($args); $panel->id = $this->_id; - $panel->method = $this->method; $js = new MUtil_Html_Code_JavaScript(dirname(__FILE__) . '/Batch' . $this->method . '.js'); $js->setInHeader(false); // Set the fields, in case they where not set earlier $js->setDefault('__AUTOSTART__', $this->autoStart ? 'true' : 'false'); - $js->setDefault('{ID}', $this->_id); - $js->setDefault('{TEXT_TAG}', $panel->getDefaultChildTag()); - $js->setDefault('{TEXT_CLASS}', $panel->progressTextClass); - $js->setDefault('{URL_FINISH}', addcslashes($view->url(array($this->progressParameterName => $this->progressParameterReportValue)), "/")); - $js->setDefault('{URL_START}', addcslashes($view->url(array($this->progressParameterName => $this->progressParameterRunValue)), "/")); + $js->setDefault('{PANEL_ID}', '#' . $this->_id); + $js->setDefault('{TEXT_ID}', $panel->getDefaultChildTag() . '.' . $panel->progressTextClass); + $js->setDefault('{URL_FINISH}', addcslashes($urlFinish, "/")); + $js->setDefault('{URL_START_RUN}', addcslashes($urlRun, "/")); $js->setDefault('FUNCTION_PREFIX_', $this->getFunctionPrefix()); $panel->append($js); @@ -298,61 +367,111 @@ } /** + * The Zend ProgressBar handles the communication through + * an adapter interface. * * @return Zend_ProgressBar */ public function getProgressBar() { if (! $this->progressBar instanceof Zend_ProgressBar) { - $this->setProgressBar(new Zend_ProgressBar($this->getProgressBarAdapter(), 0, 100)); + $this->setProgressBar(new Zend_ProgressBar($this->getProgressBarAdapter(), 0, 100, $this->_session->getNamespace() . '_pb')); } return $this->progressBar; } /** + * The communication adapter for the ProgressBar. * * @return Zend_ProgressBar_Adapter */ public function getProgressBarAdapter() { - if (! $this->progressBarAdapter instanceof Zend_ProgressBar_Adapter) { - if ($this->method == self::PULL) { + // Does the current adapter accord with the method? + if ($this->progressBarAdapter instanceof Zend_ProgressBar_Adapter) { + if ($this->isPull()) { + if (! $this->progressBarAdapter instanceof Zend_ProgressBar_Adapter_JsPull) { + $this->progressBarAdapter = null; + } + } else { + if (! $this->progressBarAdapter instanceof Zend_ProgressBar_Adapter_JsPush) { + $this->progressBarAdapter = null; + } + } + } else { + $this->progressBarAdapter = null; + } + + // Create when needed + if ($this->progressBarAdapter === null) { + if ($this->isPull()) { $this->setProgressBarAdapter(new Zend_ProgressBar_Adapter_JsPull()); } else { $this->setProgressBarAdapter(new MUtil_ProgressBar_Adapter_JsPush()); - $this->progressBarAdapter->extraPaddingKb = 3; } } + // Check for extra padding + if ($this->progressBarAdapter instanceof MUtil_ProgressBar_Adapter_JsPush) { + $this->progressBarAdapter->extraPaddingKb = $this->extraPushPaddingKb; + } + return $this->progressBarAdapter; } - public function getReport() + /** + * Returns a button that can be clicked to restart the progress bar. + * + * @param mixed $arg_array MUtil_Ra::args() arguments to populate link with + * @return MUtil_Html_HtmlElement + */ + public function getRestartButton($args_array = 'Restart') { - $messages = $this->_session->messages; + $args = MUtil_Ra::args(func_get_args()); + $args['onclick'] = new MUtil_Html_OnClickArrayAttribute( + new MUtil_Html_Raw('if (! this.disabled) {location.href = "'), + new MUtil_Html_HrefArrayAttribute(array($this->progressParameterName => null)), + new MUtil_Html_Raw('";} this.disabled = true; event.cancelBubble=true;')); - return $messages; + return new MUtil_Html_HtmlElement('button', $args); } /** - * Returns true when the parameters passed mean the program has started. + * Returns a link that can be clicked to restart the progress bar. * - * @param Zend_Controller_Request_Abstract $request - * @return boolean + * @param mixed $arg_array MUtil_Ra::args() arguments to populate link with + * @return MUtil_Html_AElement */ - public function hasStarted(Zend_Controller_Request_Abstract $request) + public function getRestartLink($args_array = 'Restart') { - return $request->getParam($this->progressParameterName) === $this->progressParameterRunValue; + $args = MUtil_Ra::args(func_get_args()); + $args['href'] = array($this->progressParameterName => null); + + return new MUtil_Html_AElement($args); } /** - * Return true after commands all have been ran and there was at least one command to run. + * Returns a button that can be clicked to start the progress bar. * + * @param mixed $arg_array MUtil_Ra::args() arguments to populate link with + * @return MUtil_Html_HtmlElement + */ + public function getStartButton($args_array = 'Start') + { + $args = MUtil_Ra::args(func_get_args()); + $args['onclick'] = 'if (! this.disabled) {' . $this->getFunctionPrefix() . 'Start();} this.disabled = true; event.cancelBubble=true;'; + + return new MUtil_Html_HtmlElement('button', $args); + } + + /** + * Return true after commands all have been ran. + * * @return boolean */ public function isFinished() { - return (0 == $this->count()) && ($this->_session->processed > 0); + return $this->_session->finished; } /** @@ -362,18 +481,102 @@ */ public function isLoaded() { - return $this->count() || $this->_session->processed; + return $this->_session->commands || $this->_session->processed; } + /** + * Does the batch use the PULL method for communication. + * + * @return boolean + */ + public function isPull() + { + return $this->method === self::PULL; + } + + /** + * Does the batch use the PUSH method for communication. + * + * @return boolean + */ + public function isPush() + { + return $this->method === self::PUSH; + } + + /** + * Reset and empty the session storage + * + * @return MUtil_Batch_BatchAbstract (continuation pattern) + */ public function reset() { $this->_session->commands = array(); $this->_session->counters = array(); $this->_session->count = 0; + $this->_session->finished = false; $this->_session->messages = array(); $this->_session->processed = 0; + + return $this; } + /** + * Run as much code as possible, but do report back. + * + * Returns true if any output was communicated, i.e. the "normal" + * page should not be displayed. + * + * @param Zend_Controller_Request_Abstract $request + * @return boolean + */ + public function run(Zend_Controller_Request_Abstract $request) + { + // Is there something to run? + if ($this->isFinished() || (! $this->isLoaded())) { + return false; + } + + // Check for run url + if ($request->getParam($this->progressParameterName) === $this->progressParameterRunValue) { + $bar = $this->getProgressBar(); + + $isPull = $this->isPull(); + $reportRun = microtime(true) + ($this->minimalStepDurationMs / 1000); + // error_log('Rep: ' . $reportRun); + while ($this->step()) { + // error_log('Cur: ' . microtime(true) . ' report is '. (microtime(true) > $reportRun ? 'true' : 'false')); + if (microtime(true) > $reportRun) { + // Communicate progress + $percent = round($this->_session->processed / (count($this->_session->commands) + $this->_session->processed) * 100, 2); + + $bar->update($percent, end($this->_session->messages)); + + // INFO: When using PULL $bar->update() should exit the program, + // but just let us make sure. + if ($isPull) { + return true; + } + } + } + if (! $this->_session->commands) { + $this->_session->finished = true; + $bar->finish(); + } + + // There is progressBar output + return true; + } else { + // No ProgressBar output + return false; + } + } + + /** + * Run the whole batch at once, without communicating with a progress bar. + * + * @return int Number of steps taken + */ public function runAll() { while ($this->step()); @@ -382,9 +585,9 @@ } /** - * Name prefix for functions. + * Name prefix for PUSH functions. * - * Set automatically to __CLASS___, use different name + * Set automatically to get_class($this) . '_' $this->_id . '_', use different name * in case of name clashes. * * @param string $prefix @@ -411,7 +614,81 @@ } /** + * Sets the communication method for progress reporting. * + * @param string $method One of the constants of this object + * @return MUtil_Batch_BatchAbstract (continuation pattern) + */ + public function setMethod($method) + { + switch ($method) { + case self::PULL: + case self::PUSH: + $this->method = $method; + return $this; + + default: + throw new MUtil_Batch_BatchException("Invalid batch usage method '$method'."); + } + } + + /** + * Set the communication method used by this batch to PULL. + * + * This is the most stable method as it works independently of + * server settings. Therefore it is the default method. + * + * @return MUtil_Batch_BatchAbstract (continuation pattern) + */ + public function setMethodPull() + { + $this->setMethod(self::PULL); + + return $this; + } + + /** + * Set the communication method used by this batch to PUSH. + * + * I.e. the start page opens an iFrame, the url of the iFrame calls the + * batch with the RUN parameter and the process returns JavaScript tags + * that handle the progress reporting. + * + * This is a very fast and resource inexpensive method for batch processing + * but it is only suitable for short running processes as servers tend to + * cut off http calls that take more than some fixed period of time to run - + * even when those processes keep returning data. + * + * Another problem with this method is buffering, i.e. the tendency of servers + * to wait sending data back until a process has been completed or enough data + * has been send. + * + * E.g. on IIS 7 you have to adjust the file %windir%\System32\inetsrv\config\applicationHost.config + * and add the attribute responseBufferLimit="1024" twice, both to + * ../handlers/add name="PHP_via_FastCGI" and to ../handlers/add name="CGI-exe". + * + * Still the above works only partially, IIS tends to wait longer before sending the + * first batch of data. The trick is to add extra spaces to the output until the + * threshold is reached. This is done by specifying the $extraPaddingKb parameter. + * Just increase it until it works. + * + * @param int $extraPaddingKb + * @return MUtil_Batch_BatchAbstract (continuation pattern) + */ + public function setMethodPush($extraPaddingKb = null) + { + $this->setMethod(self::PUSH); + if ((null !== $extraPaddingKb) && is_numeric($extraPaddingKb)) { + $this->extraPushPaddingKb = $extraPaddingKb; + } + + return $this; + } + + /** + * The Zend ProgressBar handles the communication through + * an adapter interface. + * * @param Zend_ProgressBar $progressBar * @return MUtil_Html_ProgressPanel (continuation pattern) */ @@ -422,6 +699,7 @@ } /** + * The communication adapter for the ProgressBar. * * @param Zend_ProgressBar_Adapter_Interface $adapter * @return MUtil_Html_ProgressPanel (continuation pattern) @@ -458,40 +736,20 @@ } /** - * Returns true when the parameters passed mean the program has started. + * Progress a single step on the command stack * - * @param Zend_Controller_Request_Abstract $request * @return boolean */ - public function showReport(Zend_Controller_Request_Abstract $request) + protected function step() { - return $request->getParam($this->progressParameterName) === $this->progressParameterReportValue; - } - - /** - * Workhorse function that does all the real work. - * - * @return int - */ - public function step() - { - $bar = $this->getProgressBar(); - if (isset($this->_session->commands) && $this->_session->commands) { $command = array_shift($this->_session->commands); $this->_session->processed++; call_user_func_array(array($this, $command['method']), $command['parameters']); - - $percent = round($this->_session->processed / ($this->count() + $this->_session->processed) * 100, 2); - - $bar->update($percent, end($this->_session->messages)); return true; } else { - $bar->finish(); - return false; } - return count($this->_session->commands) > 0; } } Modified: trunk/library/classes/MUtil/Batch/BatchPull.js =================================================================== --- trunk/library/classes/MUtil/Batch/BatchPull.js 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/MUtil/Batch/BatchPull.js 2012-01-19 17:17:39 UTC (rev 412) @@ -5,82 +5,101 @@ // default options options: { - autoStart: false, - // target: the element whose content is replaced - timeout: 2000 - // url: the request url + // finishUrl: the request url + // panelId: text id:, + // runUrl: the request url + // targetId: search for the element whose content is replaced + timeout: 60000 }, _init: function() { - if (this.options.autoStart) { - this.start(); + this.progressTarget = jQuery(this.options.panelId); + if (this.progressTarget.length) { + this.textTarget = this.progressTarget.find(this.options.targetId); + // this.textTarget = this.find(this.options.targetId); + + if (this.textTarget.length) { + this.start(); + } else { + alert('Did not find the text element: "' + this.options.targetId + '" in element id: "' + this.options.panelId + '".'); + } + } else { + alert('Did not find the panel id: "' + this.options.panelId + '".'); } }, complete: function (request, status) { this.request = null; - - // Check for changes - // - if the input field was changed since the last request - // filter() will search on the new value - // - if the input field has not changed, then no new request - // is made. - // this.start(); }, - error: function (request, status) { - console.log(status); - /* if (request.status === 401) { - location.href = location.href; - } // */ + error: function (request, status, error) { + alert('Communication error: ' + status); }, + progressTarget: null, + start: function() { if (this.request == null) { - if (this.options.url) { + if (this.options.runUrl) { var self = this; this.request = jQuery.ajax({ - url: this.options.url, + url: this.options.runUrl, type: "GET", dataType: "json", // data: postData, - error: function(request, status, error) {self.error(request, status);}, + error: function(request, status, error) {self.error(request, status, error);}, complete: function(request, status) {self.complete(request, status);}, success: function(data, status, request) {self.success(data, status, request);} }); - + } else { + alert("No runUrl specified."); } } }, success: function (data, status, request) { - // console.log(stringdata); - // data = jQuery.parseJSON(stringdata); - console.log(data); + // console.log(data); + if (data.finished) { + data.percent = 100; + data.text = false; + } + // For some reason the next two lines are both needed for the code to work + this.progressTarget.progressbar("option", "value", data.percent); + this.progressTarget.progressbar({value: data.percent}); + text = data.percent + '%'; if (data.text) { - text = text + data.text; + text = text + ' ' + data.text; } - jQuery(this.options.target).html(text); + this.textTarget.html(text); + + if (data.finished) { + if (this.options.finishUrl.length > 0) { + location.href = this.options.finishUrl; + } + } else { + this.request = null; + this.start(); + } }, + textTarget: null, + request: null }); -jQuery(document).ready(function() { - jQuery("#{ID}").pullProgressPanel({"url":"{URL_START}","autoStart":__AUTOSTART__,"target":"#{ID} {TEXT_TAG}.{TEXT_CLASS}"}); -}); - -function FUNCTION_PREFIX_Finish() +function FUNCTION_PREFIX_Start() { - main = jQuery("#{ID}"); - main.progressbar( "option", "value", 100); + jQuery("{PANEL_ID}").pullProgressPanel({ + "finishUrl": "{URL_FINISH}", + "panelId": "{PANEL_ID}", + "runUrl": "{URL_START_RUN}", + "targetId": "{TEXT_ID}" + }); +} - inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); - if (inner) { - inner.empty(); - inner.append('100% Done!'); - } +if (__AUTOSTART__) { + jQuery().ready(FUNCTION_PREFIX_Start()); } Modified: trunk/library/classes/MUtil/Batch/BatchPush.js =================================================================== --- trunk/library/classes/MUtil/Batch/BatchPush.js 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/MUtil/Batch/BatchPush.js 2012-01-19 17:17:39 UTC (rev 412) @@ -3,18 +3,18 @@ { var iFrame = document.createElement('iframe'); iFrame.setAttribute('style', 'position: absolute; left: -100px; top: -100px; width: 10px; height: 10px; overflow: hidden;'); - // iFrame.setAttribute('style', 'position: absolute; left: 0px; top: 0px; width: 100px; height: 100px; overflow: hidden;'); document.getElementsByTagName('body')[0].appendChild(iFrame); - iFrame.src = '{URL_START}'; + iFrame.src = '{URL_START_RUN}'; } function FUNCTION_PREFIX_Update(data) { - main = jQuery("#{ID}"); - main.progressbar( "option", "value", data.percent); + main = jQuery("{PANEL_ID}"); + // For some reason the next two lines are both needed for the code to work + main.progressbar("option", "value", data.percent); main.progressbar({value: data.percent}); - inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); + inner = main.find('{TEXT_ID}'); if (inner) { text = data.percent + '%'; if (data.text) { @@ -26,10 +26,12 @@ function FUNCTION_PREFIX_Finish() { - main = jQuery("#{ID}"); - main.progressbar( "option", "value", 100); + main = jQuery("{PANEL_ID}"); + // For some reason the next two lines are both needed for the code to work + main.progressbar("option", "value", 100); + main.progressbar({value: 100}); - inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); + inner = main.find('{TEXT_ID}'); if (inner) { inner.empty(); inner.append('100% Done!'); @@ -41,7 +43,6 @@ } } - if (__AUTOSTART__) { jQuery().ready(FUNCTION_PREFIX_Start()); } \ No newline at end of file Modified: trunk/library/classes/MUtil/Batch/WaitBatch.php =================================================================== --- trunk/library/classes/MUtil/Batch/WaitBatch.php 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/MUtil/Batch/WaitBatch.php 2012-01-19 17:17:39 UTC (rev 412) @@ -36,8 +36,65 @@ */ /** + * This a an example / test implementation of MUtil_Batch_BatchAbstract. * + * It does nothing but wait, but allows you to test the workings of the + * batch processing in general and the use of a progress panel in general. * + * PULL usage example ($this->view must be a Zend_View) with a nice start button: + * <code> + * $batch = new MUtil_Batch_WaitBatch(); + * if ($batch->run($this->getRequest())) { + * exit; + * } else { + * $html = new MUtil_Html_Sequence(); + * if ($batch->isFinished()) { + * $html->ol($batch->getMessages(true)); + * $html->a(array($batch->progressParameterName => null), 'Restart'); + * } else { + * // Populate the batch (from scratch). + * $batch->reset(); + * $batch->addWaits(4, 2); + * $batch->addWaits(2, 1); + * $batch->addWaitsLater(15, 1); + * $batch->addWait(4, 'That took some time!'); + * $batch->addWait(4, 'So we see the message. :)'); + * $batch->addWaitsLater(1, 2); + * $batch->addWaits(4); + * + * $html->append($batch->getPanel($this->view, $batch->getStartButton('Nice start'))); + * } + * echo $html->render($this->view); + * } + * </code> + * + * PUSH usage example that starts automatically: + * <code> + * $batch = new MUtil_Batch_WaitBatch(); + * $batch->setMethodPush(5); + * $batch->autoStart = true; + * $batch->minimalStepDurationMs = 200; + * + * if ($batch->run($this->getRequest())) { + * exit; + * } else { + * $html = new MUtil_Html_Sequence(); + * if ($batch->isFinished()) { + * $html->ul($batch->getMessages(true)); + * $html->a(array($batch->progressParameterName => null), 'Restart'); + * } else { + * // Populate the batch (from scratch). + * $batch->reset(); + * $batch->addWaitsMs(400, 20); + * $batch->addWaits(2, 1, 'Har har'); + * $batch->addWaitsMs(20, 50); + * + * $html->append($batch->getPanel($this->view)); + * } + * echo $html->render($this->view); + * } + * </code> + * * @package MUtil * @subpackage Batch * @copyright Copyright (c) 2011 Erasmus MC @@ -46,37 +103,156 @@ */ class MUtil_Batch_WaitBatch extends MUtil_Batch_BatchAbstract { - public function addWait($seconds = 1) + /** + * The minimal time used between send progress reports. + * + * This enables quicker processing as multiple steps can be taken in a single + * run(), without the run taking too long to answer. + * + * Set to 0 to report back on each step. + * + * @var int + */ + public $minimalStepDurationMs = 100; + + /** + * Add one second wait command to the command stack. + * + * @param int $seconds + * @param text $message Optional, otherwise the message is the time of wait + * @return MUtil_Batch_WaitBatch (continuation pattern) + */ + public function addWait($seconds = 1, $message = null) { - $this->addStep('waitFor', $seconds); + $this->addStep('waitFor', $seconds, $message); return $this; } - public function addWaits($times, $seconds = 1) + /** + * Add one microsecond wait command to the command stack. + * + * @param int $microsSeconds + * @param text $message Optional, otherwise the message is the time of wait + * @return MUtil_Batch_WaitBatch (continuation pattern) + */ + public function addWaitMs($microsSeconds = 100, $message = null) { + $this->addStep('waitForMs', $microsSeconds, $message); + + return $this; + } + + /** + * Add multiple second wait commands to the command stack. + * + * @param int $times + * @param int $seconds + * @param text $message Optional, otherwise the message is the time of wait + * @return MUtil_Batch_WaitBatch (continuation pattern) + */ + public function addWaits($times, $seconds = 1, $message = null) + { for ($i = 0; $i < $times; $i++) { - $this->addStep('waitFor', $seconds); + $this->addStep('waitFor', $seconds, $message); } return $this; } - public function addWaitsLater($times, $seconds = 1) + /** + * Add multiple microsecond wait commands to the command stack. + * + * @param int $times + * @param int $microsSeconds + * @param text $message Optional, otherwise the message is the time of wait + * @return MUtil_Batch_WaitBatch (continuation pattern) + */ + public function addWaitsMs($times, $microsSeconds = 100, $message = null) { - $this->addStep('addWaits', $times, $seconds); + for ($i = 0; $i < $times; $i++) { + $this->addStep('waitForMs', $microsSeconds, $message); + } return $this; } - public function waitFor($seconds) + /** + * Testing purposes only, this code adds wait commands to the + * command stack during running. + * + * The result is that you may see the percentage done actually + * decrease instead of increase. + * + * @param int $times + * @param int $seconds + * @param text $message Optional, otherwise the message is the time of wait + * @return MUtil_Batch_WaitBatch (continuation pattern) + */ + public function addWaitsLater($times, $seconds = 1, $message = null) { + $this->addStep('addWaits', $times, $seconds, $message); + + return $this; + } + + /** + * Testing purposes only, this code adds wait commands to the + * command stack during running. + * + * The result is that you may see the percentage done actually + * decrease instead of increase. + * + * @param int $times + * @param int $microsSeconds + * @param text $message Optional, otherwise the message is the time of wait + * @return MUtil_Batch_WaitBatch (continuation pattern) + */ + public function addWaitsMsLater($times, $microsSeconds = 100, $message = null) + { + $this->addStep('addWaitsMs', $times, $microsSeconds, $message); + + return $this; + } + + /** + * A step method that just waits for a number of seconds. + * + * @param int $seconds + * @param string $message + */ + protected function waitFor($seconds, $message) + { sleep($seconds); - if ($seconds == 1) { - $this->addMessage("Waited for 1 second."); - } else { - $this->addMessage(sprintf("Waited for %d seconds.", $seconds)); + if (! $message) { + if ($seconds == 1) { + $message = "Waited for 1 second."; + } else { + $message = sprintf("Waited for %d seconds.", $seconds); + } } + $this->addMessage($message); } + + /** + * A step method that just waits for a number of microseconds. + * + * @param int $microsSeconds + * @param string $message + */ + protected function waitForMs($microsSeconds, $message) + { + usleep($microsSeconds); + + if (! $message) { + if ($microsSeconds == 1) { + $message = "Waited for 1 micro second."; + } else { + $message = sprintf("Waited for %.3f seconds.", $microsSeconds / 1000); + } + } + + $this->addMessage($message); + } } Modified: trunk/library/classes/MUtil/ProgressBar/Adapter/JsPush.php =================================================================== --- trunk/library/classes/MUtil/ProgressBar/Adapter/JsPush.php 2012-01-18 15:47:17 UTC (rev 411) +++ trunk/library/classes/MUtil/ProgressBar/Adapter/JsPush.php 2012-01-19 17:17:39 UTC (rev 412) @@ -47,7 +47,7 @@ class MUtil_ProgressBar_Adapter_JsPush extends Zend_ProgressBar_Adapter_JsPush { /** - * The number of bytes to padd in Kilobytes + * The number of bytes to pad in Kilobytes * * This is needed as many servers need extra output passing to avoid buffering. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-18 15:47:26
|
Revision: 411 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=411&view=rev Author: mennodekker Date: 2012-01-18 15:47:17 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Fixed #46: Deleted staff can be reactivated when duplicate login is found on creation Modified Paths: -------------- trunk/library/classes/Gems/Default/StaffAction.php Modified: trunk/library/classes/Gems/Default/StaffAction.php =================================================================== --- trunk/library/classes/Gems/Default/StaffAction.php 2012-01-18 12:28:40 UTC (rev 410) +++ trunk/library/classes/Gems/Default/StaffAction.php 2012-01-18 15:47:17 UTC (rev 411) @@ -194,6 +194,83 @@ } /** + * Modified createAction to allow reactivation of deleted users + * + * When the gsf_login had the 'recordFound' error, we check if the user is deactivated. + * If so present the user and ask to confirm reactivation, otherwise show the erroneous form. + * + * When activated, we reroute to the edit action after reactivation (gsf_active => 1 and gul_can_login => 1) + * + * Uses $this->getModel() + * $this->addFormElements() + */ + public function createAction() + { + $this->html->h3(sprintf($this->_('New %s...'), $this->getTopic())); + + $confirmed = $this->getRequest()->getParam('confirmed'); + $id = $this->getRequest()->getParam('id'); + if (!is_null($confirmed)) { + if ($confirmed == true && intval($id) > 0) { + $id = intval($id); + $model = $this->getModel(); + $model->setFilter(array('gsf_id_user' => $id)); + $result = $model->loadFirst(); + if ($result) { + if ($result['gsf_active'] == 0 || $result['gul_can_login'] == 0) { + $result['gsf_active'] = 1; + $result['gul_can_login'] = 1; + $model->save($result); + $this->_reroute(array('action' => 'edit', 'id' => $id), true); + } + } + } + //Not confirmed or id invalid redirect to index + $this->_reroute(array('action' => 'index'), true); + } + + if ($form = $this->processForm()) { + if ($element = $form->getElement('gsf_login')) { + $errors = $element->getErrors(); + if (array_search('recordFound', $errors) !== false) { + //We have a duplicate login! + $model = $this->getModel(); + $model->setFilter(array( + 'gsf_login' => $form->getValue('gsf_login'), + 'gsf_id_organization' => $form->getValue('gsf_id_organization') + )); + $result = $model->load(); + + if (count($result) == 1) { + $result = array_shift($result); //Get the first (only) row + if ($result['gsf_active'] == 0 || $result['gul_can_login'] == 0) { + //Ok we try to add an inactive user... + //now ask if this is the one we would like to reactivate? + $question = sprintf($this->_('User with id %s already exists but is deleted, do you want to reactivate the account?'), $result['gsf_login']); + + $repeater = $model->loadRepeatable(); + $table = $this->getShowTable(); + $table->caption($question); + $table->setRepeater($repeater); + + $footer = $table->tfrow($question, ' ', array('class' => 'centerAlign')); + $footer->actionLink(array('confirmed' => true, 'id' => $result['gsf_id_user']), $this->_('Yes')); + $footer->actionLink(array('confirmed' => 0), $this->_('No')); + + $this->html[] = $table; + $this->html->buttonDiv($this->createMenuLinks()); + return; + } else { + //User is active... this is a real duplicate so continue the flow + } + } + } + } + $this->html[] = $form; + } + } + + /** * Creates a model for getModel(). Called only for each new $action. * * The parameters allow you to easily adapt the model to the current action. The $detailed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-18 12:28:48
|
Revision: 410 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=410&view=rev Author: matijsdejong Date: 2012-01-18 12:28:40 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Pull batch processing works (#45). Push is required though plus some code cleanup needed. Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php trunk/library/classes/MUtil/Batch/BatchAbstract.php trunk/library/classes/MUtil/Html/ProgressPanel.php Added Paths: ----------- trunk/library/classes/MUtil/Batch/BatchPull.js trunk/library/classes/MUtil/Batch/BatchPush.js trunk/library/classes/MUtil/Batch/WaitBatch.php trunk/library/classes/MUtil/ProgressBar/ trunk/library/classes/MUtil/ProgressBar/Adapter/ trunk/library/classes/MUtil/ProgressBar/Adapter/JsPush.php Removed Paths: ------------- trunk/library/classes/MUtil/Html/ProgressPanelPull.js trunk/library/classes/MUtil/Html/ProgressPanelPush.js Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2012-01-17 21:08:06 UTC (rev 409) +++ trunk/library/classes/Gems/Default/SourceAction.php 2012-01-18 12:28:40 UTC (rev 410) @@ -243,8 +243,38 @@ $this->html->h3($this->_('Synchronize all sources of surveys')); $this->html->pInfo($this->_('Synchronization will update the status of all surveys imported into this project to the status at the sources.')); + /* - $batch = new Gems_Tracker_Batch_SynchronizeSourceBatch(); + $batch = new MUtil_Batch_WaitBatch(); + $batch->method = MUtil_Batch_BatchAbstract::PUSH; + if ($batch->isLoaded()) { + if ($batch->isFinished()) { + if (! $batch->showReport($this->getRequest())) { + $batch->reset(); + } + } else { + if ($batch->hasStarted($this->getRequest())) { + $batch->runAll(); + exit; + } + } + } else { + $batch->addWaits(4, 2); + $batch->addWaitsLater(15, 1); + $batch->addWaits(1, 1); + $batch->addWaitsLater(1, 2); + $batch->addWaits(4); + } + if ($batch->showReport($this->getRequest())) { + $this->addMessage($batch->getReport()); + $batch->reset(); + $this->html->pInfo()->actionLink(array($batch->progressParameterName => null), $this->_('Restart')); + } else { + $this->html->append($batch->getPanel($this->view)); + } + // */ + /* + // $batch = new Gems_Tracker_Batch_SynchronizeSourceBatch(); // $batch->method = 'Push'; if (! $batch->isLoaded()) { foreach ($data as $row) { Modified: trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php =================================================================== --- trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php 2012-01-17 21:08:06 UTC (rev 409) +++ trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php 2012-01-18 12:28:40 UTC (rev 410) @@ -1,7 +1,7 @@ <?php /** - * Copyright (c) 2011, Erasmus MC + * Copyright (c) 2012, Erasmus MC * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,7 +30,7 @@ * @package Gems * @subpackage Tracker * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC + * @copyright Copyright (c) 2012 Erasmus MC * @license New BSD License * @version $Id$ */ @@ -40,7 +40,7 @@ * * @package Gems * @subpackage Tracker - * @copyright Copyright (c) 2011 Erasmus MC + * @copyright Copyright (c) 2012 Erasmus MC * @license New BSD License * @since Class available since version 1.5 */ @@ -70,8 +70,10 @@ $tokenId = $tokenData; } - MUtil_Echo::track($tokenData); - $this->addStep('checkTokenCompletion', 'tokchk-' . $tokenId, $tokenData); + // MUtil_Echo::track($tokenData); + $this->setStep('checkTokenCompletion', 'tokchk-' . $tokenId, $tokenData); + + return $this; } protected function checkTrackTokens($respTrackData, $userId) @@ -99,7 +101,7 @@ } if ($token->isCompleted()) { - $this->addStep('processTokenCompletion', 'tokproc-' . $token->getTokenId(), $tokenData, $userId); + $this->setStep('processTokenCompletion', 'tokproc-' . $token->getTokenId(), $tokenData, $userId); } } @@ -116,7 +118,7 @@ } $trackId = $respTrack->getRespondentTrackId(); - $this->addStep('checkTrackTokens', 'chktrck-' . $trackId, $trackId, $userid); + $this->setStep('checkTrackTokens', 'chktrck-' . $trackId, $trackId, $userid); } } } Modified: trunk/library/classes/MUtil/Batch/BatchAbstract.php =================================================================== --- trunk/library/classes/MUtil/Batch/BatchAbstract.php 2012-01-17 21:08:06 UTC (rev 409) +++ trunk/library/classes/MUtil/Batch/BatchAbstract.php 2012-01-18 12:28:40 UTC (rev 410) @@ -1,7 +1,7 @@ <?php /** - * Copyright (c) 2011, Erasmus MC + * Copyright (c) 2012, Erasmus MC * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,17 +30,30 @@ * @package MUtil * @subpackage Batch * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC + * @copyright Copyright (c) 2012 Erasmus MC * @license New BSD License - * @version $Id$ + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ */ /** + * The Batch package is for the sequential processing of commands which may + * take to long to execute in a single request. * + * To use this package just sub class this class, write methods that run + * the code to be execute and then write the code that add's those functions + * to be executed. * + * Each step in the sequence consists of a method name of the child object + * and any number of scalar variables and array's containing scalar variables. + * + * A nice future extension would be to separate the storage engine used so we + * could use e.g. Zend_Queue as an alternative for storing the command stack. + * However, as this package needs more state info than available in Zend_Queue + * we would need an extra extension for that. + * * @package MUtil * @subpackage Batch - * @copyright Copyright (c) 2011 Erasmus MC + * @copyright Copyright (c) 2012 Erasmus MC * @license New BSD License * @since Class available since version 1.5 */ @@ -50,33 +63,132 @@ const PUSH = 'Push'; /** + * Name to prefix the functions, to avoid naming clashes. * + * @var string Default is the classname with an extra underscore + */ + protected $_functionPrefix; + + /** + * An id unique for this session. + * + * @var string Unique id + */ + private $_id; + + /** + * Stack to keep existing id's. + * + * @var array + */ + private static $_idStack = array(); + + /** + * * @var Zend_Session_Namespace */ private $_session; /** + * When true the progressbar should start immediately. When false the user has to perform an action. * - * @param string $name The name of this batch, defaults to classname + * @var boolean */ - public function __construct($name = null) + public $autoStart = true; + + /** + * The mode to use for the panel: push or pull + * + * @var string + */ + public $method = self::PULL; + + /** + * + * @var Zend_ProgressBar + */ + protected $progressBar; + + /** + * + * @var Zend_ProgressBar_Adapter + */ + protected $progressBarAdapter; + + /** + * The name of the parameter used for progress panel signals + * + * @var string + */ + public $progressParameterName = 'progress'; + + /** + * The value required for the progress panel to report and reset + * + * @var string + */ + public $progressParameterReportValue = 'report'; + + /** + * The value required for the progress panel to start running + * + * @var string + */ + public $progressParameterRunValue = 'run'; + + /** + * + * @param string $id A unique name identifying this batch + */ + public function __construct($id = null) { - if (null === $name) { - $name = get_class($this); + if (null === $id) { + $id = 'batchId' . (1 + count(self::$_idStack)); } + foreach (self::$_idStack as $existingId) { + if ($existingId == $id) { + throw new MUtil_Batch_BatchException("Duplicate batch id created: $id"); + } + } + self::$_idStack[] = $id; + $this->_id = $id; - $this->_initSession($name); + $this->_initSession($id); } - private function _initSession($name) + /** + * Checks parameters and returns a command array. + * + * @param string $method + * @param array $params + * @return array A command array + */ + private function _checkParams($method, array $params) { - $this->_session = new Zend_Session_Namespace($name); + if (! method_exists($this, $method)) { + throw new MUtil_Batch_BatchException("Invalid batch method: '$method'."); + } + if (! MUtil_Ra::isScalar($params)) { + throw new MUtil_Batch_BatchException("Non scalar batch parameter for method: '$method'."); + } + $command['method'] = $method; + $command['parameters'] = $params; + + return $command; + } + + /** + * Initialize persistent storage + * + * @param string $name The id of this batch + */ + private function _initSession($id) + { + $this->_session = new Zend_Session_Namespace(get_class($this) . '_' . $id); + if (! isset($this->_session->commands)) { - $this->_session->commands = array(); - $this->_session->counters = array(); - $this->_session->count = 0; - $this->_session->processed = 0; + $this->reset(); } } @@ -84,29 +196,38 @@ * Add an execution step to the command stack. * * @param string $method Name of a method of this object - * @param mixed $id A unique id to prevent double adding of something to do * @param mixed $param1 Scalar or array with scalars, as many parameters as needed allowed * @return MUtil_Batch_BatchAbstract */ - protected function addStep($method, $id, $param1 = null) + protected function addStep($method, $param1 = null) { - $params = array_slice(func_get_args(), 2); + $params = array_slice(func_get_args(), 1); - if (! method_exists($this, $method)) { - throw new MUtil_Batch_BatchException("Invalid batch method: '$method'."); - } - if (! MUtil_Ra::isScalar($params)) { - throw new MUtil_Batch_BatchException("Non scalar batch parameter for method: '$method'."); - } + $this->_session->commands[] = $this->_checkParams($method, $params); - $command['method'] = $method; - $command['parameters'] = $params; + return $this; + } - $this->_session->commands[$id] = $command; + /** + * Add a message to the message stack. + * + * @param string $text A message to the user + * @return MUtil_Batch_BatchAbstract (continuation pattern) + */ + protected function addMessage($text) + { + $this->_session->messages[] = $text; return $this; } + /** + * Increment a named counter + * + * @param string $name + * @param integer $add + * @return integer + */ protected function addToCounter($name, $add = 1) { if (! isset($this->session->counters[$name])) { @@ -127,14 +248,101 @@ return count($this->_session->commands); } - public function getPanel() + /** + * Returns the prefix used for the function names to avoid naming clashes. + * + * @return string + */ + public function getFunctionPrefix() { - return new MUtil_Html_ProgressPanel('0%'); + if (! $this->_functionPrefix) { + $this->setFunctionPrefix(__CLASS__ . '_' . $this->_id . '_'); + } + + return (string) $this->_functionPrefix; } + /** + * Return + * @return MUtil_Html_ProgressPanel + */ + public function getPanel(Zend_View_Abstract $view) + { + ZendX_JQuery::enableView($view); + + if ($this->isFinished()) { + $content = '100%'; + } else { + $content = '100%'; + } + + $panel = new MUtil_Html_ProgressPanel('0%'); + + $panel->id = $this->_id; + $panel->method = $this->method; + + $js = new MUtil_Html_Code_JavaScript(dirname(__FILE__) . '/Batch' . $this->method . '.js'); + $js->setInHeader(false); + // Set the fields, in case they where not set earlier + $js->setDefault('__AUTOSTART__', $this->autoStart ? 'true' : 'false'); + $js->setDefault('{ID}', $this->_id); + $js->setDefault('{TEXT_TAG}', $panel->getDefaultChildTag()); + $js->setDefault('{TEXT_CLASS}', $panel->progressTextClass); + $js->setDefault('{URL_FINISH}', addcslashes($view->url(array($this->progressParameterName => $this->progressParameterReportValue)), "/")); + $js->setDefault('{URL_START}', addcslashes($view->url(array($this->progressParameterName => $this->progressParameterRunValue)), "/")); + $js->setDefault('FUNCTION_PREFIX_', $this->getFunctionPrefix()); + + $panel->append($js); + + return $panel; + } + + /** + * + * @return Zend_ProgressBar + */ + public function getProgressBar() + { + if (! $this->progressBar instanceof Zend_ProgressBar) { + $this->setProgressBar(new Zend_ProgressBar($this->getProgressBarAdapter(), 0, 100)); + } + return $this->progressBar; + } + + /** + * + * @return Zend_ProgressBar_Adapter + */ + public function getProgressBarAdapter() + { + if (! $this->progressBarAdapter instanceof Zend_ProgressBar_Adapter) { + if ($this->method == self::PULL) { + $this->setProgressBarAdapter(new Zend_ProgressBar_Adapter_JsPull()); + } else { + $this->setProgressBarAdapter(new MUtil_ProgressBar_Adapter_JsPush()); + $this->progressBarAdapter->extraPaddingKb = 3; + } + } + + return $this->progressBarAdapter; + } + + public function getReport() + { + $messages = $this->_session->messages; + + return $messages; + } + + /** + * Returns true when the parameters passed mean the program has started. + * + * @param Zend_Controller_Request_Abstract $request + * @return boolean + */ public function hasStarted(Zend_Controller_Request_Abstract $request) { - return false; + return $request->getParam($this->progressParameterName) === $this->progressParameterRunValue; } /** @@ -144,7 +352,7 @@ */ public function isFinished() { - return (0 == $this->_session->count()) && ($this->_session->processed > 0); + return (0 == $this->count()) && ($this->_session->processed > 0); } /** @@ -157,6 +365,15 @@ return $this->count() || $this->_session->processed; } + public function reset() + { + $this->_session->commands = array(); + $this->_session->counters = array(); + $this->_session->count = 0; + $this->_session->messages = array(); + $this->_session->processed = 0; + } + public function runAll() { while ($this->step()); @@ -164,15 +381,117 @@ return $this->_session->processed; } + /** + * Name prefix for functions. + * + * Set automatically to __CLASS___, use different name + * in case of name clashes. + * + * @param string $prefix + * @return MUtil_Html_ProgressPanel (continuation pattern) + */ + public function setFunctionPrefix($prefix) + { + $this->_functionPrefix = $prefix; + return $this; + } + + /** + * Add/set a message on the message stack with a specific id. + * + * @param scalar $id + * @param string $text A message to the user + * @return MUtil_Batch_BatchAbstract (continuation pattern) + */ + protected function setMessage($id, $text) + { + $this->_session->messages[$id] = $text; + + return $this; + } + + /** + * + * @param Zend_ProgressBar $progressBar + * @return MUtil_Html_ProgressPanel (continuation pattern) + */ + public function setProgressBar(Zend_ProgressBar $progressBar) + { + $this->progressBar = $progressBar; + return $this; + } + + /** + * + * @param Zend_ProgressBar_Adapter_Interface $adapter + * @return MUtil_Html_ProgressPanel (continuation pattern) + */ + public function setProgressBarAdapter(Zend_ProgressBar_Adapter $adapter) + { + if ($adapter instanceof Zend_ProgressBar_Adapter_JsPush) { + $prefix = $this->getFunctionPrefix(); + + // Set the fields, in case they where not set earlier + $adapter->setUpdateMethodName($prefix . 'Update'); + $adapter->setFinishMethodName($prefix . 'Finish'); + } + + $this->progressBarAdapter = $adapter; + return $this; + } + + /** + * Add an execution step to the command stack. + * + * @param string $method Name of a method of this object + * @param mixed $id A unique id to prevent double adding of something to do + * @param mixed $param1 Scalar or array with scalars, as many parameters as needed allowed + * @return MUtil_Batch_BatchAbstract + */ + protected function setStep($method, $id, $param1 = null) + { + $params = array_slice(func_get_args(), 2); + + $this->_session->commands[$id] = $this->_checkParams($method, $params); + + return $this; + } + + /** + * Returns true when the parameters passed mean the program has started. + * + * @param Zend_Controller_Request_Abstract $request + * @return boolean + */ + public function showReport(Zend_Controller_Request_Abstract $request) + { + return $request->getParam($this->progressParameterName) === $this->progressParameterReportValue; + } + + /** + * Workhorse function that does all the real work. + * + * @return int + */ public function step() { + $bar = $this->getProgressBar(); + if (isset($this->_session->commands) && $this->_session->commands) { $command = array_shift($this->_session->commands); $this->_session->processed++; call_user_func_array(array($this, $command['method']), $command['parameters']); + + $percent = round($this->_session->processed / ($this->count() + $this->_session->processed) * 100, 2); + + $bar->update($percent, end($this->_session->messages)); + return true; + } else { + $bar->finish(); + + return false; } - return count($this->_session->commands) > 0; } } Added: trunk/library/classes/MUtil/Batch/BatchPull.js =================================================================== --- trunk/library/classes/MUtil/Batch/BatchPull.js (rev 0) +++ trunk/library/classes/MUtil/Batch/BatchPull.js 2012-01-18 12:28:40 UTC (rev 410) @@ -0,0 +1,86 @@ + + +// Creating the widget +jQuery.widget("ui.pullProgressPanel", { + + // default options + options: { + autoStart: false, + // target: the element whose content is replaced + timeout: 2000 + // url: the request url + }, + + _init: function() { + if (this.options.autoStart) { + this.start(); + } + }, + + complete: function (request, status) { + this.request = null; + + // Check for changes + // - if the input field was changed since the last request + // filter() will search on the new value + // - if the input field has not changed, then no new request + // is made. + // this.start(); + }, + + error: function (request, status) { + console.log(status); + /* if (request.status === 401) { + location.href = location.href; + } // */ + }, + + start: function() { + if (this.request == null) { + if (this.options.url) { + var self = this; + this.request = jQuery.ajax({ + url: this.options.url, + type: "GET", + dataType: "json", + // data: postData, + error: function(request, status, error) {self.error(request, status);}, + complete: function(request, status) {self.complete(request, status);}, + success: function(data, status, request) {self.success(data, status, request);} + }); + + } + } + }, + + success: function (data, status, request) { + // console.log(stringdata); + // data = jQuery.parseJSON(stringdata); + console.log(data); + + text = data.percent + '%'; + if (data.text) { + text = text + data.text; + } + + jQuery(this.options.target).html(text); + }, + + request: null +}); + +jQuery(document).ready(function() { + jQuery("#{ID}").pullProgressPanel({"url":"{URL_START}","autoStart":__AUTOSTART__,"target":"#{ID} {TEXT_TAG}.{TEXT_CLASS}"}); +}); + +function FUNCTION_PREFIX_Finish() +{ + main = jQuery("#{ID}"); + main.progressbar( "option", "value", 100); + + inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); + if (inner) { + inner.empty(); + inner.append('100% Done!'); + } +} Added: trunk/library/classes/MUtil/Batch/BatchPush.js =================================================================== --- trunk/library/classes/MUtil/Batch/BatchPush.js (rev 0) +++ trunk/library/classes/MUtil/Batch/BatchPush.js 2012-01-18 12:28:40 UTC (rev 410) @@ -0,0 +1,47 @@ + +function FUNCTION_PREFIX_Start() +{ + var iFrame = document.createElement('iframe'); + iFrame.setAttribute('style', 'position: absolute; left: -100px; top: -100px; width: 10px; height: 10px; overflow: hidden;'); + // iFrame.setAttribute('style', 'position: absolute; left: 0px; top: 0px; width: 100px; height: 100px; overflow: hidden;'); + document.getElementsByTagName('body')[0].appendChild(iFrame); + iFrame.src = '{URL_START}'; +} + +function FUNCTION_PREFIX_Update(data) +{ + main = jQuery("#{ID}"); + main.progressbar( "option", "value", data.percent); + main.progressbar({value: data.percent}); + + inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); + if (inner) { + text = data.percent + '%'; + if (data.text) { + text = text + ' ' + data.text; + } + inner.html(text); + } +} + +function FUNCTION_PREFIX_Finish() +{ + main = jQuery("#{ID}"); + main.progressbar( "option", "value", 100); + + inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); + if (inner) { + inner.empty(); + inner.append('100% Done!'); + } + + url = '{URL_FINISH}'; + if (url.length > 0) { + location.href = url; + } +} + + +if (__AUTOSTART__) { + jQuery().ready(FUNCTION_PREFIX_Start()); +} \ No newline at end of file Added: trunk/library/classes/MUtil/Batch/WaitBatch.php =================================================================== --- trunk/library/classes/MUtil/Batch/WaitBatch.php (rev 0) +++ trunk/library/classes/MUtil/Batch/WaitBatch.php 2012-01-18 12:28:40 UTC (rev 410) @@ -0,0 +1,82 @@ +<?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 MUtil + * @subpackage Batch + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2012-07-07 12:51:32Z matijs $ + */ + +/** + * + * + * @package MUtil + * @subpackage Batch + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class MUtil_Batch_WaitBatch extends MUtil_Batch_BatchAbstract +{ + public function addWait($seconds = 1) + { + $this->addStep('waitFor', $seconds); + + return $this; + } + + public function addWaits($times, $seconds = 1) + { + for ($i = 0; $i < $times; $i++) { + $this->addStep('waitFor', $seconds); + } + + return $this; + } + + public function addWaitsLater($times, $seconds = 1) + { + $this->addStep('addWaits', $times, $seconds); + + return $this; + } + + public function waitFor($seconds) + { + sleep($seconds); + + if ($seconds == 1) { + $this->addMessage("Waited for 1 second."); + } else { + $this->addMessage(sprintf("Waited for %d seconds.", $seconds)); + } + } +} Modified: trunk/library/classes/MUtil/Html/ProgressPanel.php =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanel.php 2012-01-17 21:08:06 UTC (rev 409) +++ trunk/library/classes/MUtil/Html/ProgressPanel.php 2012-01-18 12:28:40 UTC (rev 410) @@ -46,8 +46,6 @@ */ class MUtil_Html_ProgressPanel extends MUtil_Html_HtmlElement { - const CODE = "MUtil_Html_ProgressPanel_Code"; - /** * For some elements (e.g. table and tbody) the logical thing to do when content * is added that does not have an $_allowedChildTags is to add that content to @@ -83,13 +81,6 @@ ); /** - * When true the progressbar should start immediately. When false the user has to perform an action. - * - * @var boolean - */ - protected $_autoStart = true; - - /** * When content must contain certain element types only the default child tag contains * the tagname of the element that is created to contain the content. * @@ -104,13 +95,6 @@ protected $_defaultChildTag = 'div'; /** - * Name to prefix the functions, to avoid naming clashes. - * - * @var string Default is the classname with an extra underscore - */ - protected $_functionPrefix; - - /** * Usually no text is appended before an element, but for certain elements we choose * to add a "\n" newline character instead, to keep the output readable in source * view. @@ -120,54 +104,6 @@ protected $_prependString = "\n"; /** - * - * @var Zend_ProgressBar - */ - protected $_progressBar; - - /** - * - * @var Zend_ProgressBar_Adapter - */ - protected $_progressBarAdapter; - - /** - * Extra array with special types for subclasses. - * - * When an object of one of the key types is used, then use - * the class method defined as the value. - * - * @see $_specialTypesDefault - * - * @var array Of 'class or interfacename' => 'class method' of null - */ - protected $_specialTypes = array( - 'Zend_ProgressBar' => 'setProgressBar', - 'Zend_ProgressBar_Adapter' => 'setProgressBarAdapter', - ); - - /** - * The mode to use for the panel: push or pull - * - * @var string - */ - public $method = 'Pull'; - - /** - * The name of the parameter used for progress panel signals - * - * @var string - */ - public $progressParameterName = 'progress'; - - /** - * The value required for the progress panel to start running - * - * @var string - */ - public $progressParameterRunValue = 'run'; - - /** * Class name of inner element that displays text * * @var string @@ -187,82 +123,20 @@ } /** - * Update the progess panel + * Returns the tag name for the default child. * - * @return MUtil_Html_ProgressPanel (continuation pattern) - */ - public function finish() - { - $bar = $this->getProgressBar(); - $bar->finish(); - - return $this; - } - /** - * Returns the JavaScript object associated with this object. + * Exposed as needed by some classes using this class. * - * WARNING: calling this object sets it's position in the order the - * objects are rendered. If you use MUtil_Lazy objects, make sure they - * have the correct value when rendering. + * @see MUtil_Batch_BatchAbstract * - * @return MUtil_Html_Code_JavaScript - */ - public function getCode() - { - if (! isset($this->_content[self::CODE])) { - $js = new MUtil_Html_Code_JavaScript(dirname(__FILE__) . '/ProgressPanel' . $this->method . '.js'); - $js->setInHeader(false); - - $this->_content[self::CODE] = $js; - } - - return $this->_content[self::CODE]; - } - - /** - * Returns the prefix used for the function names to avoid naming clashes. - * * @return string */ - public function getFunctionPrefix() + public function getDefaultChildTag() { - if (! $this->_functionPrefix) { - $this->setFunctionPrefix(__CLASS__ . '_' . $this->getAttrib('id'). '_'); - } - - return (string) $this->_functionPrefix; + return $this->_defaultChildTag; } /** - * - * @return Zend_ProgressBar - */ - public function getProgressBar() - { - if (! $this->_progressBar instanceof Zend_ProgressBar) { - $this->setProgressBar(new Zend_ProgressBar($this->getProgressBarAdapter(), 0, 100)); - } - return $this->_progressBar; - } - - /** - * - * @return Zend_ProgressBar_Adapter - */ - public function getProgressBarAdapter() - { - if (! $this->_progressBarAdapter instanceof Zend_ProgressBar_Adapter) { - if ($this->method == 'Pull') { - $this->setProgressBarAdapter(new Zend_ProgressBar_Adapter_JsPull()); - } else { - $this->setProgressBarAdapter(new Zend_ProgressBar_Adapter_JsPush()); - } - } - - return $this->_progressBarAdapter; - } - - /** * Creates a 'div' progress panel * * @param mixed $arg_array A MUtil_Ra::args data collection. @@ -275,7 +149,7 @@ } /** - * Function to allow overloading of tag rendering only + * Function to allow overloading of tag rendering only * * Renders the element tag with it's content into a html string * @@ -286,19 +160,6 @@ */ protected function renderElement(Zend_View_Abstract $view) { - ZendX_JQuery::enableView($view); - - if ($this->getProgressBarAdapter() instanceof Zend_ProgressBar_Adapter) { - $js = $this->getCode(); - - // Set the fields, in case they where not set earlier - $js->setDefault('__AUTOSTART__', $this->_autoStart ? 'true' : 'false'); - $js->setDefault('{ID}', $this->getAttrib('id')); - $js->setDefault('{TEXT_TAG}', $this->_defaultChildTag); - $js->setDefault('{TEXT_CLASS}', $this->progressTextClass); - $js->setDefault('{URL}', addcslashes($view->url(array($this->progressParameterName => $this->progressParameterRunValue)), "/")); - } - if ($this->_lastChild) { $this->_lastChild->class = $this->progressTextClass; @@ -316,77 +177,4 @@ return parent::renderElement($view); } - - /** - * Checks whether the progress panel should be running - * - * @param Zend_Controller_Request_Abstract $request - * @return boolean - */ - public function run(Zend_Controller_Request_Abstract $request) - { - return $request->getParam($this->progressParameterName) === $this->progressParameterRunValue; - } - - /** - * Name prefix for functions. - * - * Set automatically to __CLASS___, use different name - * in case of name clashes. - * - * @param string $prefix - * @return MUtil_Html_ProgressPanel (continuation pattern) - */ - public function setFunctionPrefix($prefix) - { - $this->_functionPrefix = $prefix; - return $this; - } - - /** - * - * @param Zend_ProgressBar $progressBar - * @return MUtil_Html_ProgressPanel (continuation pattern) - */ - public function setProgressBar(Zend_ProgressBar $progressBar) - { - $this->_progressBar = $progressBar; - return $this; - } - - /** - * - * @param Zend_ProgressBar_Adapter_Interface $adapter - * @return MUtil_Html_ProgressPanel (continuation pattern) - */ - public function setProgressBarAdapter(Zend_ProgressBar_Adapter $adapter) - { - if ($adapter instanceof Zend_ProgressBar_Adapter_JsPush) { - $js = $this->getCode(); - $prefix = $this->getFunctionPrefix(); - - // Set the fields, in case they where not set earlier - $js->setDefault('FUNCTION_PREFIX_', $prefix); - $adapter->setUpdateMethodName($prefix . 'Update'); - $adapter->setFinishMethodName($prefix . 'Finish'); - } - - $this->_progressBarAdapter = $adapter; - return $this; - } - - /** - * Update the progess panel - * - * @param int $value - * @param string $text - * @return MUtil_Html_ProgressPanel (continuation pattern) - */ - public function update($value, $text = null) - { - $bar = $this->getProgressBar(); - $bar->update($value, $text); - - return $this; - } } Deleted: trunk/library/classes/MUtil/Html/ProgressPanelPull.js =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanelPull.js 2012-01-17 21:08:06 UTC (rev 409) +++ trunk/library/classes/MUtil/Html/ProgressPanelPull.js 2012-01-18 12:28:40 UTC (rev 410) @@ -1,86 +0,0 @@ - - -// Creating the widget -jQuery.widget("ui.pullProgressPanel", { - - // default options - options: { - autoStart: false, - // target: the element whose content is replaced - timeout: 2000 - // url: the request url - }, - - _init: function() { - if (this.options.autoStart) { - this.start(); - } - }, - - complete: function (request, status) { - this.request = null; - - // Check for changes - // - if the input field was changed since the last request - // filter() will search on the new value - // - if the input field has not changed, then no new request - // is made. - // this.start(); - }, - - error: function (request, status) { - console.log(status); - /* if (request.status === 401) { - location.href = location.href; - } // */ - }, - - start: function() { - if (this.request == null) { - if (this.options.url) { - var self = this; - this.request = jQuery.ajax({ - url: this.options.url, - type: "GET", - dataType: "json", - // data: postData, - error: function(request, status, error) {self.error(request, status);}, - complete: function(request, status) {self.complete(request, status);}, - success: function(data, status, request) {self.success(data, status, request);} - }); - - } - } - }, - - success: function (data, status, request) { - // console.log(stringdata); - // data = jQuery.parseJSON(stringdata); - console.log(data); - - text = data.percent + '%'; - if (data.text) { - text = text + data.text; - } - - jQuery(this.options.target).html(text); - }, - - request: null -}); - -jQuery(document).ready(function() { - jQuery("#{ID}").pullProgressPanel({"url":"{URL}","autoStart":__AUTOSTART__,"target":"#{ID} {TEXT_TAG}.{TEXT_CLASS}"}); -}); - -function FUNCTION_PREFIX_Finish() -{ - main = jQuery("#{ID}"); - main.progressbar( "option", "value", 100); - - inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); - if (inner) { - inner.empty(); - inner.append('100% Done!'); - } -} Deleted: trunk/library/classes/MUtil/Html/ProgressPanelPush.js =================================================================== --- trunk/library/classes/MUtil/Html/ProgressPanelPush.js 2012-01-17 21:08:06 UTC (rev 409) +++ trunk/library/classes/MUtil/Html/ProgressPanelPush.js 2012-01-18 12:28:40 UTC (rev 410) @@ -1,46 +0,0 @@ - -function FUNCTION_PREFIX_Start() -{ - var iFrame = document.createElement('iframe'); - iFrame.setAttribute('style', 'position: absolute; left: -100px; top: -100px; width: 10px; height: 10px; overflow: hidden;'); - // iFrame.setAttribute('style', 'position: absolute; left: 0px; top: 0px; width: 100px; height: 100px; overflow: hidden;'); - document.getElementsByTagName('body')[0].appendChild(iFrame); - iFrame.src = '{URL}'; -} - -function FUNCTION_PREFIX_Update(data) -{ - main = jQuery("#{ID}"); - main.progressbar( "option", "value", data.percent); - main.progressbar({ - value: data.percent - }); - - inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); - if (inner) { - text = data.percent + '%'; - if (data.text) { - text = text + data.text; - } - inner.html(text); - } -} - -function FUNCTION_PREFIX_Finish() -{ - main = jQuery("#{ID}"); - main.progressbar( "option", "value", 100); - - inner = main.find('{TEXT_TAG}.{TEXT_CLASS}'); - if (inner) { - inner.empty(); - inner.append('100% Done!'); - } -} - - -if (__AUTOSTART__) { - // jQuery().ready(FUNCTION_PREFIX_Update({percent: 20, text: 'Hi'})); - // jQuery().ready(FUNCTION_PREFIX_Update({percent: 20, text: ''})); - jQuery().ready(FUNCTION_PREFIX_Start()); -} \ No newline at end of file Property changes on: trunk/library/classes/MUtil/ProgressBar ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:logregex + #(\d+) Property changes on: trunk/library/classes/MUtil/ProgressBar/Adapter ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:logregex + #(\d+) Added: trunk/library/classes/MUtil/ProgressBar/Adapter/JsPush.php =================================================================== --- trunk/library/classes/MUtil/ProgressBar/Adapter/JsPush.php (rev 0) +++ trunk/library/classes/MUtil/ProgressBar/Adapter/JsPush.php 2012-01-18 12:28:40 UTC (rev 410) @@ -0,0 +1,75 @@ +<?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 ProgressBar + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $Id: JsPush.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * + * + * @package MUtil + * @subpackage ProgressBar + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class MUtil_ProgressBar_Adapter_JsPush extends Zend_ProgressBar_Adapter_JsPush +{ + /** + * The number of bytes to padd in Kilobytes + * + * This is needed as many servers need extra output passing to avoid buffering. + * + * Also this allows you to keep the server buffer high while using this JsPush. + * + * @var int + */ + public $extraPaddingKb = 0; + + /** + * Outputs given data the user agent. + * + * This split-off is required for unit-testing. + * + * @param string $data + * @return void + */ + protected function _outputData($data) + { + if ($this->extraPaddingKb) { + $data .= str_repeat(' ', 1024 * $this->extraPaddingKb); + } + return parent::_outputData($data); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-17 21:08:12
|
Revision: 409 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=409&view=rev Author: michieltcs Date: 2012-01-17 21:08:06 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Sort on gmt_subject by default Modified Paths: -------------- trunk/library/classes/Gems/Default/MailTemplateAction.php Modified: trunk/library/classes/Gems/Default/MailTemplateAction.php =================================================================== --- trunk/library/classes/Gems/Default/MailTemplateAction.php 2012-01-17 08:36:49 UTC (rev 408) +++ trunk/library/classes/Gems/Default/MailTemplateAction.php 2012-01-17 21:08:06 UTC (rev 409) @@ -58,6 +58,7 @@ public function createModel($detailed, $action) { $model = new MUtil_Model_TableModel('gems__mail_templates'); + $model->addSort(array('gmt_subject' => SORT_ASC)); $model->set('gmt_subject', 'label', $this->_('Subject')); if ($detailed) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-17 08:36:55
|
Revision: 408 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=408&view=rev Author: michieltcs Date: 2012-01-17 08:36:49 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Add additional hash to session id to prevent possible clashes Modified Paths: -------------- trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-01-12 17:30:32 UTC (rev 407) +++ trunk/library/classes/GemsEscort.php 2012-01-17 08:36:49 UTC (rev 408) @@ -90,7 +90,7 @@ $firebug = $application->getOption('firebug'); $this->_startFirebird = $firebug['log']; - $sessionOptions['name'] = GEMS_PROJECT_NAME_UC . 'SESSID'; + $sessionOptions['name'] = GEMS_PROJECT_NAME_UC . '_' . md5(APPLICATION_PATH) . '_SESSID'; $sessionOptions['cookie_path'] = strtr(dirname($_SERVER['SCRIPT_NAME']), '\\', '/'); Zend_Session::start($sessionOptions); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-12 17:30:39
|
Revision: 407 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=407&view=rev Author: matijsdejong Date: 2012-01-12 17:30:32 +0000 (Thu, 12 Jan 2012) Log Message: ----------- Added concept of scalar array to MUtil_Ra Moved to special Batch class Modified Paths: -------------- trunk/library/classes/Gems/Default/SourceAction.php trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php trunk/library/classes/Gems/Tracker/TrackerInterface.php trunk/library/classes/Gems/Tracker.php trunk/library/classes/MUtil/Html/HtmlException.php trunk/library/classes/MUtil/Ra.php Added Paths: ----------- trunk/library/classes/Gems/Tracker/Batch/ trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php trunk/library/classes/Gems/Tracker/Batch/SynchronizeSourceBatch.php trunk/library/classes/MUtil/Batch/ trunk/library/classes/MUtil/Batch/BatchAbstract.php trunk/library/classes/MUtil/Batch/BatchException.php trunk/library/classes/MUtil/Queue/ trunk/library/classes/MUtil/Queue/Adapter/ trunk/library/classes/MUtil/Queue/Adapter/DbPrefixed.php Modified: trunk/library/classes/Gems/Default/SourceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SourceAction.php 2012-01-12 12:00:47 UTC (rev 406) +++ trunk/library/classes/Gems/Default/SourceAction.php 2012-01-12 17:30:32 UTC (rev 407) @@ -244,7 +244,25 @@ $this->html->h3($this->_('Synchronize all sources of surveys')); $this->html->pInfo($this->_('Synchronization will update the status of all surveys imported into this project to the status at the sources.')); /* + $batch = new Gems_Tracker_Batch_SynchronizeSourceBatch(); + // $batch->method = 'Push'; + if (! $batch->isLoaded()) { + foreach ($data as $row) { + $batch->addSource($row['gso_id_source'], $row['gso_source_name']); + } + } + if ($batch->run($this->getRequest())) { + if ($batch->isReady()) { + $this->addMessage($batch->getMessages()); + $this->afterSaveRoute($this->getRequest()); + } + } else { + $this->html[] = $batch->getPanel(); + } + // */ + /* $progress = $this->html->progress('0%'); + $progress->method = 'Push'; // $progress = $this->html->progress(); if ($progress->run($this->getRequest())) { @@ -253,7 +271,7 @@ // ../handlers/add name="CGI-exe" // add attribute responseBufferLimit="1024" - for ($i = 50; $i < 100; $i += 10) { + for ($i = 50; $i < 100; $i += 1) { if ($i < 20) { $text = 'Just beginning'; } else if ($i < 50) { Modified: trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-01-12 12:00:47 UTC (rev 406) +++ trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2012-01-12 17:30:32 UTC (rev 407) @@ -268,6 +268,26 @@ $surveyId = $this->_getParam(MUtil_Model::REQUEST_ID); $where = $this->db->quoteInto('gto_id_survey = ?', $surveyId); + /* + $batch = $this->loader->getTracker()->recalculateTokensBatch($this->loader->getCurrentUser()->getUserId(), $where); + + if ($batch->hasStarted($this->getRequest())) { + // TODO + } else { + $this->html->h3( + sprintf($this->_('Checking survey results for the %s survey.'), + $this->db->fetchOne("SELECT gsu_survey_name FROM gems__surveys WHERE gsu_id_survey = ?", $surveyId))); + + if ($batch->isLoaded()) { + $this->html->pInfo(sprintf($this->_('Running check for %s tokens...'), $batch->count())); + $this->html->append($batch->getPanel()); + } else { + $this->html->pInfo($this->_('No tokens to check.')); + } + } + // */ + + //* $this->addMessage(sprintf($this->_( 'Checking survey results for the %s survey.'), $this->db->fetchOne("SELECT gsu_survey_name FROM gems__surveys WHERE gsu_id_survey = ?", $surveyId))); @@ -275,6 +295,8 @@ $this->addMessage($this->loader->getTracker()->recalculateTokens($this->session->user_id, $where)); $this->afterSaveRoute($this->getRequest()); + + // */ } public function checkAllAction() Property changes on: trunk/library/classes/Gems/Tracker/Batch ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:logregex + #(\d+) Added: trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php =================================================================== --- trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php (rev 0) +++ trunk/library/classes/Gems/Tracker/Batch/ProcessTokensBatch.php 2012-01-12 17:30:32 UTC (rev 407) @@ -0,0 +1,122 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Tracker_Batch_ProcessTokensBatch extends MUtil_Batch_BatchAbstract +{ + /** + * + * @var Gems_Tracker + */ + public $tracker; + + public function __construct($where, Gems_Tracker $tracker) + { + parent::__construct(__CLASS__ . '::' . $where); + + $this->tracker = $tracker; + } + + public function addToken($tokenData, $userId) + { + if (is_array($tokenData)) { + if (!isset($tokenData['gto_id_token'])) { + throw new Gems_Exception_Coding('$tokenData array should atleast have a key "gto_id_token" containing the requested token'); + } + $tokenId = $tokenData['gto_id_token']; + } else { + $tokenId = $tokenData; + } + + MUtil_Echo::track($tokenData); + $this->addStep('checkTokenCompletion', 'tokchk-' . $tokenId, $tokenData); + } + + protected function checkTrackTokens($respTrackData, $userId) + { + $respTrack = $this->tracker->getRespondentTrack($respTrackData); + + if ($result = $respTrack->checkTrackTokens($userId)) { + $this->addToCounter('tokenDateCauses'); + $this->addToCounter('tokenDateChanges', $result); + } + } + + protected function checkTokenCompletion($tokenData, $userId) + { + $this->addToCounter('checkedTokens'); + $token = $this->tracker->getToken($tokenData); + + if ($result = $token->checkTokenCompletion($userId)) { + if ($result & Gems_Tracker_Token::COMPLETION_DATACHANGE) { + $this->addToCounter('resultDataChanges'); + } + if ($result & Gems_Tracker_Token::COMPLETION_EVENTCHANGE) { + $this->addToCounter('surveyCompletionChanges'); + } + } + + if ($token->isCompleted()) { + $this->addStep('processTokenCompletion', 'tokproc-' . $token->getTokenId(), $tokenData, $userId); + } + } + + protected function processTokenCompletion($tokenData, $userId) + { + $token = $this->tracker->getToken($tokenData); + + if ($token->isCompleted()) { + $respTrack = $token->getRespondentTrack(); + + if ($result = $respTrack->handleRoundCompletion($token, $userId)) { + $this->addToCounter('roundCompletionCauses'); + $this->addToCounter('roundCompletionChanges', $result); + } + + $trackId = $respTrack->getRespondentTrackId(); + $this->addStep('checkTrackTokens', 'chktrck-' . $trackId, $trackId, $userid); + } + } +} Added: trunk/library/classes/Gems/Tracker/Batch/SynchronizeSourceBatch.php =================================================================== --- trunk/library/classes/Gems/Tracker/Batch/SynchronizeSourceBatch.php (rev 0) +++ trunk/library/classes/Gems/Tracker/Batch/SynchronizeSourceBatch.php 2012-01-12 17:30:32 UTC (rev 407) @@ -0,0 +1,61 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Tracker_Batch_SynchronizeSourceBatch extends MUtil_Batch_BatchAbstract +{ + /** + * Construct as standard batch + */ + public function __construct() + { + parent::__construct(__CLASS__); + } + + public function addSource($sourceId, $sourceName) + { + + } +} Modified: trunk/library/classes/Gems/Tracker/TrackerInterface.php =================================================================== --- trunk/library/classes/Gems/Tracker/TrackerInterface.php 2012-01-12 12:00:47 UTC (rev 406) +++ trunk/library/classes/Gems/Tracker/TrackerInterface.php 2012-01-12 17:30:32 UTC (rev 407) @@ -54,7 +54,7 @@ * extension) and TokenValidator. * * Other functions are general utility functions, e.g. checkTrackRounds(), createToken(), - * preocessCompletedTokens() and recalculateTokens(). + * processCompletedTokens() and recalculateTokens(). * * @package Gems * @subpackage Tracker Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2012-01-12 12:00:47 UTC (rev 406) +++ trunk/library/classes/Gems/Tracker.php 2012-01-12 17:30:32 UTC (rev 407) @@ -48,7 +48,7 @@ * extension) and TokenValidator. * * Other functions are general utility functions, e.g. checkTrackRounds(), createToken(), - * preocessCompletedTokens() and recalculateTokens(). + * processCompletedTokens() and recalculateTokens(). * * @package Gems * @subpackage Tracker @@ -822,6 +822,36 @@ } /** + * Checks the token table to see if there are any answered surveys to be processed + * + * If the survey was started (and the token was forwarded to limesurvey) we need to check + * if is was completed. If so, we might want to check the track the survey is in to enable + * or disable future rounds + * + * Does not reflect changes to tracks or rounds. + * + * @param Gems_Tracker_Token_TokenSelect Select statements selecting tokens + * @param int $userId Id of the user who takes the action (for logging) + * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes + */ + protected function processTokensBatch(Gems_Tracker_Token_TokenSelect $tokenSelect, $userId) + { + $where = implode(' ', $tokenSelect->getSelect()->getPart(Zend_Db_Select::WHERE)); + + $batch = new Gems_Tracker_Batch_ProcessTokensBatch($where, $this); + + if (! $batch->isLoaded()) { + $tokenRows = $tokenSelect->fetchAll(); + + foreach ($tokenRows as $tokenData) { + $batch->addToken($tokenData, $userId); + } + } + + return $batch; + } + + /** * Recalculates all token dates, timing and results * and outputs text messages. * @@ -849,4 +879,31 @@ return $changes->getMessages($this->translate); } + + /** + * Recalculates all token dates, timing and results + * and outputs text messages. + * + * Does not reflect changes to tracks or rounds. + * + * @param Zend_Translate $t + * @param int $userId Id of the user who takes the action (for logging) + * @param string $cond + * @return Gems_Tracker_Batch_ProcessTokensBatch A batch to process the changes + */ + public function recalculateTokensBatch($userId = null, $cond = null) + { + $userId = $this->_checkUserId($userId); + $tokenSelect = $this->getTokenSelect(); + $tokenSelect->andReceptionCodes(); + if ($cond) { + $tokenSelect->forWhere($cond); + } + //Only select surveys that are active in the source (so we can recalculate inactive in Gems) + $tokenSelect->andSurveys(); + $tokenSelect->forWhere('gsu_surveyor_active = 1'); + + self::$verbose = true; + return $this->processTokensBatch($tokenSelect, $userId); + } } Property changes on: trunk/library/classes/MUtil/Batch ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:logregex + #(\d+) Added: trunk/library/classes/MUtil/Batch/BatchAbstract.php =================================================================== --- trunk/library/classes/MUtil/Batch/BatchAbstract.php (rev 0) +++ trunk/library/classes/MUtil/Batch/BatchAbstract.php 2012-01-12 17:30:32 UTC (rev 407) @@ -0,0 +1,178 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage Batch + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * + * @package MUtil + * @subpackage Batch + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +abstract class MUtil_Batch_BatchAbstract extends MUtil_Registry_TargetAbstract implements Countable +{ + const PULL = 'Pull'; + const PUSH = 'Push'; + + /** + * + * @var Zend_Session_Namespace + */ + private $_session; + + /** + * + * @param string $name The name of this batch, defaults to classname + */ + public function __construct($name = null) + { + if (null === $name) { + $name = get_class($this); + } + + $this->_initSession($name); + } + + private function _initSession($name) + { + $this->_session = new Zend_Session_Namespace($name); + + if (! isset($this->_session->commands)) { + $this->_session->commands = array(); + $this->_session->counters = array(); + $this->_session->count = 0; + $this->_session->processed = 0; + } + } + + /** + * Add an execution step to the command stack. + * + * @param string $method Name of a method of this object + * @param mixed $id A unique id to prevent double adding of something to do + * @param mixed $param1 Scalar or array with scalars, as many parameters as needed allowed + * @return MUtil_Batch_BatchAbstract + */ + protected function addStep($method, $id, $param1 = null) + { + $params = array_slice(func_get_args(), 2); + + if (! method_exists($this, $method)) { + throw new MUtil_Batch_BatchException("Invalid batch method: '$method'."); + } + if (! MUtil_Ra::isScalar($params)) { + throw new MUtil_Batch_BatchException("Non scalar batch parameter for method: '$method'."); + } + + $command['method'] = $method; + $command['parameters'] = $params; + + $this->_session->commands[$id] = $command; + + return $this; + } + + protected function addToCounter($name, $add = 1) + { + if (! isset($this->session->counters[$name])) { + $this->session->counters[$name] = 0; + } + $this->session->counters[$name] += $add; + + return $this->session->counters[$name]; + } + + /** + * Count the number of commands + * + * @return int The custom count as an integer. + */ + public function count() + { + return count($this->_session->commands); + } + + public function getPanel() + { + return new MUtil_Html_ProgressPanel('0%'); + } + + public function hasStarted(Zend_Controller_Request_Abstract $request) + { + return false; + } + + /** + * Return true after commands all have been ran and there was at least one command to run. + * + * @return boolean + */ + public function isFinished() + { + return (0 == $this->_session->count()) && ($this->_session->processed > 0); + } + + /** + * Return true when at least one command has been loaded. + * + * @return boolean + */ + public function isLoaded() + { + return $this->count() || $this->_session->processed; + } + + public function runAll() + { + while ($this->step()); + + return $this->_session->processed; + } + + public function step() + { + if (isset($this->_session->commands) && $this->_session->commands) { + $command = array_shift($this->_session->commands); + $this->_session->processed++; + + call_user_func_array(array($this, $command['method']), $command['parameters']); + } + + return count($this->_session->commands) > 0; + } +} Added: trunk/library/classes/MUtil/Batch/BatchException.php =================================================================== --- trunk/library/classes/MUtil/Batch/BatchException.php (rev 0) +++ trunk/library/classes/MUtil/Batch/BatchException.php 2012-01-12 17:30:32 UTC (rev 407) @@ -0,0 +1,48 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage Batch + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * + * + * @package MUtil + * @subpackage Batch + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class MUtil_Batch_BatchException extends Zend_Exception +{ } Modified: trunk/library/classes/MUtil/Html/HtmlException.php =================================================================== --- trunk/library/classes/MUtil/Html/HtmlException.php 2012-01-12 12:00:47 UTC (rev 406) +++ trunk/library/classes/MUtil/Html/HtmlException.php 2012-01-12 17:30:32 UTC (rev 407) @@ -1,40 +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. - */ - /** - * @author Matijs de Jong - * @since 1.0 - * @version 1.1 - * @package MUtil + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil * @subpackage Html + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ -class MUtil_Html_HtmlException extends Exception +/** + * + * + * @package MUtil + * @subpackage Html + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 + */ + +class MUtil_Html_HtmlException extends Zend_Exception { } \ No newline at end of file Property changes on: trunk/library/classes/MUtil/Queue ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:logregex + #(\d+) Property changes on: trunk/library/classes/MUtil/Queue/Adapter ___________________________________________________________________ Added: bugtraq:url + http://survey.erasmusmc.nl/support/mantis/view.php?id=%BUGID% Added: bugtraq:logregex + #(\d+) Added: trunk/library/classes/MUtil/Queue/Adapter/DbPrefixed.php =================================================================== --- trunk/library/classes/MUtil/Queue/Adapter/DbPrefixed.php (rev 0) +++ trunk/library/classes/MUtil/Queue/Adapter/DbPrefixed.php 2012-01-12 17:30:32 UTC (rev 407) @@ -0,0 +1,67 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage Queue + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: mjong$ + */ + +/** + * + * + * @package MUtil + * @subpackage Queue + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class MUtil_Queue_Adapter_DbPrefixed extends Zend_Queue_Adapter_Db +{ + /** + * Constructor + * + * @param array|Zend_Config $options + * @param Zend_Queue|null $queue + * @return void + */ + public function __construct($options, Zend_Queue $queue = null) + { + parent::__construct($options, $queue); + + if (isset($this->_options['prefix'])) { + $prefix = $this->_options['prefix']; + + $this->_queueTable->setOptions(array(Zend_Db_Table_Abstract::NAME => $prefix . $this->_queueTable->info(Zend_Db_Table_Abstract::NAME))); + $this->_messageTable->setOptions(array(Zend_Db_Table_Abstract::NAME => $prefix . $this->_messageTable->info(Zend_Db_Table_Abstract::NAME))); + } + } +} Modified: trunk/library/classes/MUtil/Ra.php =================================================================== --- trunk/library/classes/MUtil/Ra.php 2012-01-12 12:00:47 UTC (rev 406) +++ trunk/library/classes/MUtil/Ra.php 2012-01-12 17:30:32 UTC (rev 407) @@ -404,6 +404,12 @@ return self::$_toArrayConverter; } + /** + * Returns true if the $object either is an array or can be converted to an array. + * + * @param mixed $object + * @return boolean + */ public static function is($object) { if (is_array($object)) { @@ -414,6 +420,33 @@ } /** + * Test whether the value is scalar or an array containing + * scalars or scalar arrays. + * + * @param mixed $value + * @return boolean + */ + public static function isScalar($value) + { + if (null === $value) { + return true; + + } + + if (is_array($value)) { + foreach($value as $sub_value) { + if (! self::isScalar($sub_value)) { + return false; + } + } + return true; + + } + + return is_scalar($value); + } + + /** * A function that transforms an array in the form key1, value1, key2, value2 into array(key1 => value1, key2 => value2). * * When the $args array contains only a single sub array, then this value is assumed to be the return value. This allows This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-01-12 12:00:58
|
Revision: 406 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=406&view=rev Author: matijsdejong Date: 2012-01-12 12:00:47 +0000 (Thu, 12 Jan 2012) Log Message: ----------- Extension + cleanup of code after fex 401 Modified Paths: -------------- trunk/library/classes/Gems/Tracker/RespondentTrack.php Modified: trunk/library/classes/Gems/Tracker/RespondentTrack.php =================================================================== --- trunk/library/classes/Gems/Tracker/RespondentTrack.php 2012-01-11 15:18:41 UTC (rev 405) +++ trunk/library/classes/Gems/Tracker/RespondentTrack.php 2012-01-12 12:00:47 UTC (rev 406) @@ -459,13 +459,11 @@ public function getFirstToken() { if (! $this->_firstToken) { - if ($this->_tokens) { - $this->_firstToken = reset($this->_tokens); - } else { + if (! $this->_tokens) { //No cache yet, but we might need all tokens later - $tokens = $this->getTokens(); - $this->_firstToken = reset($tokens); + $this->getTokens(); } + $this->_firstToken = reset($this->_tokens); } return $this->_firstToken; @@ -526,16 +524,13 @@ /** * Returns all the tokens in this track * + * @param boolean $refresh When true, always reload * @return array of Gems_Tracker_Token */ public function getTokens($refresh = false) { - if (! $this->_tokens || true === $refresh) { - if (true === $refresh) { - unset($this->_tokens); - unset($this->_activeTokens); - //Next line will cause errors later on when we refresh the tokens, getFirstToken() will then throw an error - //unset($this->_firstToken); + if (! $this->_tokens || $refresh) { + if ($refresh) { $this->_firstToken = null; } $this->_tokens = array(); @@ -686,7 +681,7 @@ // Reload reception code values $this->_ensureReceptionCode($code->getAllData()); } - + // Stopcodes have a different logic. if ($code->isStopCode()) { // Cascade stop to tokens This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |