From: <gem...@li...> - 2012-11-08 16:10:59
|
Revision: 1007 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1007&view=rev Author: matijsdejong Date: 2012-11-08 16:10:47 +0000 (Thu, 08 Nov 2012) Log Message: ----------- Started caching in DbLookup.php DatabaseModelAbstract: switched from many OR to single IN() and allowed column expressions to be searched on fieldlist instead Many indeces for speeding up the database Modified Paths: -------------- trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/Gems/Model.php trunk/library/classes/Gems/Util/DbLookup.php trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__respondent2org.50.sql trunk/library/configs/db/tables/gems__respondent2track.40.sql trunk/library/configs/db/tables/gems__surveys.30.sql trunk/library/configs/db/tables/gems__tokens.200.sql trunk/library/configs/db/tables/gems__tracks.30.sql Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2012-11-08 16:10:47 UTC (rev 1007) @@ -483,7 +483,7 @@ $this->openedRespondent($data['gr2o_patient_nr'], $data['gr2o_id_organization'], $data['grs_id_user']); // Check for completed tokens - if ($this->loader->getTracker()->processCompletedTokens($data['grs_id_user'], $this->session->user_id)) { + if ($this->loader->getTracker()->processCompletedTokens($data['grs_id_user'], $this->session->user_id, $data['gr2o_id_organization'])) { //As data might have changed due to token events... reload $data = $model->applyRequest($this->getRequest(), true)->loadFirst(); } Modified: trunk/library/classes/Gems/Model.php =================================================================== --- trunk/library/classes/Gems/Model.php 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/classes/Gems/Model.php 2012-11-08 16:10:47 UTC (rev 1007) @@ -222,7 +222,8 @@ $model->setIfExists('grs_last_name', 'label', $this->translate->_('Last name')); } $model->set('name', 'label', $this->translate->_('Name'), - 'column_expression', "CONCAT(COALESCE(CONCAT(grs_last_name, ', '), '-, '), COALESCE(CONCAT(grs_first_name, ' '), ''), COALESCE(grs_surname_prefix, ''))"); + 'column_expression', "CONCAT(COALESCE(CONCAT(grs_last_name, ', '), '-, '), COALESCE(CONCAT(grs_first_name, ' '), ''), COALESCE(grs_surname_prefix, ''))", + 'fieldlist', array('grs_last_name', 'grs_first_name', 'grs_surname_prefix')); $model->setIfExists('grs_address_1', 'label', $this->translate->_('Street')); $model->setIfExists('grs_zipcode', 'label', $this->translate->_('Zipcode')); Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/classes/Gems/Util/DbLookup.php 2012-11-08 16:10:47 UTC (rev 1007) @@ -53,6 +53,12 @@ /** * + * @var Zend_Cache_Core + */ + protected $cache; + + /** + * * @var Zend_Db_Adapter_Abstract */ protected $db; @@ -376,19 +382,29 @@ /** * Return key/value pairs of all staff members, currently active or not * - * @staticvar array $data * @return array */ public function getStaff() { - static $data; + $cacheId = __CLASS__ . '_' . __FUNCTION__; - if (! $data) { - $data = $this->db->fetchPairs("SELECT gsf_id_user, CONCAT(COALESCE(gsf_last_name, '-'), ', ', COALESCE(gsf_first_name, ''), COALESCE(CONCAT(' ', gsf_surname_prefix), '')) - FROM gems__staff ORDER BY gsf_last_name, gsf_first_name, gsf_surname_prefix"); + if ($results = $this->cache->load($cacheId)) { + return $results; } - return $data; + $select = "SELECT gsf_id_user, + CONCAT( + COALESCE(gsf_last_name, '-'), + ', ', + COALESCE(gsf_first_name, ''), + COALESCE(CONCAT(' ', gsf_surname_prefix), '') + ) + FROM gems__staff + ORDER BY gsf_last_name, gsf_first_name, gsf_surname_prefix"; + + $results = $this->db->fetchPairs($select); + $this->cache->save($results, $cacheId, array('staff')); + return $results; } public function getStaffGroups() Modified: trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2012-11-08 16:10:47 UTC (rev 1007) @@ -722,12 +722,19 @@ // MUtil_Echo::track($key, $value, $filter, stripos($value, $filter)); if (stripos($value, $filter) !== false) { if (null === $key) { - $wheres[] = $sqlField . ' IS NULL'; + $wheres[1] = $sqlField . ' IS NULL'; } else { - $wheres[] = $sqlField . ' = ' . $adapter->quote($key); + $wheres[0][] = $adapter->quote($key); } } } + if (isset($wheres[0])) { + if (count($wheres[0]) == 1) { + $wheres[0] = $sqlField . ' = ' . $wheres[0][0]; + } else { + $wheres[0] = $sqlField . ' IN (' . implode(', ', $wheres[0]) . ')'; + } + } return $wheres; } @@ -761,7 +768,13 @@ foreach ($this->getItemsUsed() as $name) { if ($this->get($name, 'label')) { if ($expression = $this->get($name, 'column_expression')) { - $fields[$name] = $expression; + if ($fieldList = $this->get($name, 'fieldlist')) { + foreach ((array) $fieldList as $field) { + $fields[$field] = $adapter->quoteIdentifier($field); + } + } else { + $fields[$name] = $expression; + } } else { $fields[$name] = $adapter->quoteIdentifier($name); } Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/configs/db/patches.sql 2012-11-08 16:10:47 UTC (rev 1007) @@ -441,3 +441,22 @@ ALTER TABLE `gems__tracks` CHANGE gtr_completed_event gtr_completed_event varchar(128) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null; -- GEMS VERSION: 50 +-- PATCH: Speedup respondent screen +ALTER TABLE gems__respondent2org + ADD INDEX (gr2o_id_organization), + ADD INDEX (gr2o_opened_by), + ADD INDEX (gr2o_changed_by); + +ALTER TABLE gems__respondent2track + ADD INDEX (gr2t_id_track), + ADD INDEX (gr2t_id_user), + ADD INDEX (gr2t_id_organization), + ADD INDEX (gr2t_start_date); + +ALTER TABLE `gems__tokens` ADD INDEX (gto_id_organization); +ALTER TABLE `gems__tokens` ADD INDEX (gto_id_respondent); + +ALTER TABLE gems__surveys ADD INDEX (gsu_surveyor_active); + +ALTER TABLE gems__tracks ADD INDEX (gtr_track_type), ADD INDEX (gtr_track_class); + Modified: trunk/library/configs/db/tables/gems__respondent2org.50.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondent2org.50.sql 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/configs/db/tables/gems__respondent2org.50.sql 2012-11-08 16:10:47 UTC (rev 1007) @@ -27,8 +27,11 @@ PRIMARY KEY (gr2o_patient_nr, gr2o_id_organization), UNIQUE KEY (gr2o_id_user, gr2o_id_organization), + INDEX (gr2o_id_organization), INDEX (gr2o_opened), - INDEX (gr2o_reception_code) + INDEX (gr2o_reception_code) + INDEX (gr2o_opened_by), + INDEX (gr2o_changed_by) ) ENGINE=InnoDB CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; Modified: trunk/library/configs/db/tables/gems__respondent2track.40.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondent2track.40.sql 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/configs/db/tables/gems__respondent2track.40.sql 2012-11-08 16:10:47 UTC (rev 1007) @@ -25,7 +25,11 @@ gr2t_created timestamp not null, gr2t_created_by bigint unsigned not null, - PRIMARY KEY (gr2t_id_respondent_track) + PRIMARY KEY (gr2t_id_respondent_track), + INDEX (gr2t_id_track), + INDEX (gr2t_id_user), + INDEX (gr2t_start_date), + INDEX (gr2t_id_organization) ) ENGINE=InnoDB auto_increment = 100000 Modified: trunk/library/configs/db/tables/gems__surveys.30.sql =================================================================== --- trunk/library/configs/db/tables/gems__surveys.30.sql 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/configs/db/tables/gems__surveys.30.sql 2012-11-08 16:10:47 UTC (rev 1007) @@ -47,6 +47,7 @@ PRIMARY KEY(gsu_id_survey), INDEX (gsu_active), + INDEX (gsu_surveyor_active), INDEX (gsu_code) ) ENGINE=InnoDB Modified: trunk/library/configs/db/tables/gems__tokens.200.sql =================================================================== --- trunk/library/configs/db/tables/gems__tokens.200.sql 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/configs/db/tables/gems__tokens.200.sql 2012-11-08 16:10:47 UTC (rev 1007) @@ -50,6 +50,8 @@ gto_created_by bigint unsigned not null, PRIMARY KEY (gto_id_token), + INDEX (gto_id_organization); + INDEX (gto_id_respondent); INDEX (gto_id_survey), INDEX (gto_id_track), INDEX (gto_id_round), Modified: trunk/library/configs/db/tables/gems__tracks.30.sql =================================================================== --- trunk/library/configs/db/tables/gems__tracks.30.sql 2012-11-08 13:25:32 UTC (rev 1006) +++ trunk/library/configs/db/tables/gems__tracks.30.sql 2012-11-08 16:10:47 UTC (rev 1007) @@ -30,7 +30,9 @@ PRIMARY KEY (gtr_id_track), INDEX (gtr_track_name), - INDEX (gtr_active) + INDEX (gtr_active), + INDEX (gtr_track_type), + INDEX (gtr_track_class) ) ENGINE=InnoDB auto_increment = 7000 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-11-22 12:13:24
|
Revision: 1034 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1034&view=rev Author: matijsdejong Date: 2012-11-22 12:13:14 +0000 (Thu, 22 Nov 2012) Log Message: ----------- Fix for #578 database patch level JoinModel now accepts more complex join statements Modified Paths: -------------- trunk/library/classes/MUtil/Model/JoinModel.php trunk/library/configs/db/tables/gems__patch_levels.10.sql Modified: trunk/library/classes/MUtil/Model/JoinModel.php =================================================================== --- trunk/library/classes/MUtil/Model/JoinModel.php 2012-11-22 12:13:08 UTC (rev 1033) +++ trunk/library/classes/MUtil/Model/JoinModel.php 2012-11-22 12:13:14 UTC (rev 1034) @@ -117,9 +117,15 @@ $table_name = $this->_getTableName($table); $adapter = $table->getAdapter(); + $joinSql = array(); foreach ($joinFields as $source => $target) { - $this->_joinFields[$source] = $target; - $joinSql[] = $adapter->quoteIdentifier($source) . ' = ' . $adapter->quoteIdentifier($target); + if (is_numeric($source)) { + // A join expression other than equality is used + $joinSql[] = $target; + } else { + $this->_joinFields[$source] = $target; + $joinSql[] = $adapter->quoteIdentifier($source) . ' = ' . $adapter->quoteIdentifier($target); + } } $this->_select->$join($table_name, implode(' ' . Zend_Db_Select::SQL_AND . ' ', $joinSql), array()); Modified: trunk/library/configs/db/tables/gems__patch_levels.10.sql =================================================================== --- trunk/library/configs/db/tables/gems__patch_levels.10.sql 2012-11-22 12:13:08 UTC (rev 1033) +++ trunk/library/configs/db/tables/gems__patch_levels.10.sql 2012-11-22 12:13:14 UTC (rev 1034) @@ -11,4 +11,4 @@ INSERT INTO gems__patch_levels (gpl_level, gpl_created) VALUES - (48, CURRENT_TIMESTAMP); + (50, CURRENT_TIMESTAMP); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-11-22 17:29:56
|
Revision: 1038 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1038&view=rev Author: matijsdejong Date: 2012-11-22 17:29:49 +0000 (Thu, 22 Nov 2012) Log Message: ----------- Removed last uses of GEMS_PROJECT_PATH Fixed bug occurring during tests Modified Paths: -------------- trunk/library/classes/Gems/Default/ProjectInformationAction.php trunk/library/classes/Gems/Events.php trunk/library/classes/GemsEscort.php trunk/library/pre_bootstrap.php Modified: trunk/library/classes/Gems/Default/ProjectInformationAction.php =================================================================== --- trunk/library/classes/Gems/Default/ProjectInformationAction.php 2012-11-22 15:59:49 UTC (rev 1037) +++ trunk/library/classes/Gems/Default/ProjectInformationAction.php 2012-11-22 17:29:49 UTC (rev 1038) @@ -138,7 +138,6 @@ $data[$this->_('Gems project')] = GEMS_PROJECT_NAME; $data[$this->_('Gems web directory')] = GEMS_ROOT_DIR; $data[$this->_('Gems code directory')] = GEMS_LIBRARY_DIR; - $data[$this->_('Gems project path')] = GEMS_PROJECT_PATH; $data[$this->_('MUtil version')] = MUtil_Version::get(); $data[$this->_('Zend version')] = Zend_Version::VERSION; $data[$this->_('Application environment')] = APPLICATION_ENV; Modified: trunk/library/classes/Gems/Events.php =================================================================== --- trunk/library/classes/Gems/Events.php 2012-11-22 15:59:49 UTC (rev 1037) +++ trunk/library/classes/Gems/Events.php 2012-11-22 17:29:49 UTC (rev 1038) @@ -110,7 +110,7 @@ $prefix = $name . '_' . self::EVENTS_DIR . '_' . $eventClass . '_'; $paths[$prefix] = $dir . '/' . $name . '/' . self::EVENTS_DIR . '/' . $eventType; } - $paths[''] = GEMS_PROJECT_PATH . '/' . strtolower(self::EVENTS_DIR . 's/' . $eventType); + $paths[''] = APPLICATION_PATH . '/' . strtolower(self::EVENTS_DIR . 's/' . $eventType); // MUtil_Echo::track($paths); return $paths; @@ -290,7 +290,7 @@ { return $this->_loadEvent($eventName, self::SURVEY_DISPLAY_EVENT); } - + /** * * @param string $eventName Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-11-22 15:59:49 UTC (rev 1037) +++ trunk/library/classes/GemsEscort.php 2012-11-22 17:29:49 UTC (rev 1038) @@ -39,8 +39,6 @@ // $autoloader->registerNamespace has not yet run!! include_once('MUtil/Application/Escort.php'); -// mb_internal_encoding('UTF-8'); - /** * Project Application Core code * @@ -588,9 +586,11 @@ ); // tooltip $contactDiv->a($menuItem->toHRefAttribute(), $menuItem->get('label')); - $ul = $menuItem->toUl(); - $ul->class = 'dropdownContent tooltip'; - $contactDiv->append($ul); + // List may be empty + if ($ul = $menuItem->toUl()) { + $ul->class = 'dropdownContent tooltip'; + $contactDiv->append($ul); + } return $contactDiv; } @@ -1731,7 +1731,7 @@ $front = $this->frontController; $controllerFileName = $front->getDispatcher()->getControllerClass($request) . '.php'; - // MUtil_Echo::r(GEMS_PROJECT_PATH . '/controllers/' . $controllerFileName); + // MUtil_Echo::r(APPLICATION_PATH . '/controllers/' . $controllerFileName); // Set to project path if that controller exists // TODO: Dirs & modules combineren. Modified: trunk/library/pre_bootstrap.php =================================================================== --- trunk/library/pre_bootstrap.php 2012-11-22 15:59:49 UTC (rev 1037) +++ trunk/library/pre_bootstrap.php 2012-11-22 17:29:49 UTC (rev 1038) @@ -55,7 +55,7 @@ defined('APPLICATION_PATH') || define('APPLICATION_PATH', GEMS_ROOT_DIR . '/application'); /** - * Compatibility + * Compatibility, remove in 1.6 */ define('GEMS_PROJECT_PATH', APPLICATION_PATH); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-11-29 14:16:39
|
Revision: 1050 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1050&view=rev Author: matijsdejong Date: 2012-11-29 14:16:28 +0000 (Thu, 29 Nov 2012) Log Message: ----------- Updated changelog.txt Modified Paths: -------------- trunk/library/changelog.txt trunk/library/classes/MUtil/Version.php Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2012-11-29 14:04:39 UTC (rev 1049) +++ trunk/library/changelog.txt 2012-11-29 14:16:28 UTC (rev 1050) @@ -1,3 +1,14 @@ +Important changes from 1.5.6 => 1.5.7 +============================================================ +In LimeSurvey tokenanswerpersistence must be set to true for all surveys +Token/ask now always sets itself to the language of the token user +Added Answer display events for selecting more or less tokens +Increased some small buttons for mobile use +Many small bugs fixed and display improvements made +Implemented many speed optimizations in both database access and code speed +New DEMO application environment +Simplefied writing project level unit test + Important changes from 1.5.5 => 1.5.6 ============================================================ Transparent lessCss compiling was added. When you add a .less file GemsTracker will take care of compiling it to css. If you need to force a recompile, add the ?compilecss parameter to your url. Modified: trunk/library/classes/MUtil/Version.php =================================================================== --- trunk/library/classes/MUtil/Version.php 2012-11-29 14:04:39 UTC (rev 1049) +++ trunk/library/classes/MUtil/Version.php 2012-11-29 14:16:28 UTC (rev 1050) @@ -48,7 +48,7 @@ { const MAJOR = 1; const MINOR = 1; - const BUILD = 34; + const BUILD = 35; public static function get() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-12-13 14:42:49
|
Revision: 1060 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1060&view=rev Author: matijsdejong Date: 2012-12-13 14:42:39 +0000 (Thu, 13 Dec 2012) Log Message: ----------- Fix for #535: password request can only be done from allowed addresses and when user is not blocked Added logging to password reset actionLink(s) Clarified reset password button in staff overview Modified Paths: -------------- trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Default/StaffAction.php trunk/library/classes/Gems/User/User.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2012-12-13 13:13:53 UTC (rev 1059) +++ trunk/library/classes/Gems/Default/IndexAction.php 2012-12-13 14:42:39 UTC (rev 1060) @@ -326,6 +326,7 @@ { $errors = array(); $form = $this->createResetRequestForm(); + $logger = Gems_AccessLog::getLog($this->db); $request = $this->getRequest(); if ($key = $this->_getParam('key')) { @@ -333,8 +334,43 @@ if ($user->hasValidResetKey()) { $form = $user->getChangePasswordForm(array('askOld' => false, 'askCheck' => true, 'labelWidthFactor' => $this->labelWidthFactor)); + + $result = $user->authenticate(null, false); + if (! $result->isValid()) { + $this->addMessage($result->getMessages()); + $this->addMessage($this->_('For that reason you cannot reset your password.')); + return; + } + + if (! $request->isPost()) { + $logger->log( + "index.resetpassword.clicked", + $request, + sprintf("User %s opened valid reset link.", $user->getLoginName()), + $user->getUserId(), + true + ); + } } else { if (! $request->isPost()) { + if ($user->getLoginName()) { + $logger->log( + "index.resetpassword.old", + $request, + sprintf("User %s used old reset key.", $user->getLoginName()), + $user->getUserId(), + true + ); + } else { + $logger->log( + "index.resetpassword.false", + $request, + sprintf("Someone used a non existent reset key.", $user->getLoginName()), + $user->getUserId(), + true + ); + } + if ($user->hasPassword() || (! $user->isActive())) { $errors[] = $this->_('Your password reset request is no longer valid, please request a new link.'); } else { @@ -354,11 +390,42 @@ if ($form instanceof Gems_User_Form_ResetRequestForm) { $user = $form->getUser(); + $result = $user->authenticate(null, false); + if (! $result->isValid()) { + $this->addMessage($result->getMessages()); + $this->addMessage($this->_('For that reason you cannot request a password reset.')); + return; + } + $errors = $this->sendUserResetEMail($user); - if (! $errors) { + if ($errors) { + $logger->log( + "index.resetpassword.request.error", + $request, + sprintf( + "User %s requested reset password but got %d error(s). %s", + $form->getUserNameElement()->getValue(), + count($errors), + implode(' ', $errors) + ), + $user->getUserId(), + true + ); + + } else { // Everything went OK! - $this->addMessage($this->_('We sent you an e-mail with a reset link. Click on the link in the e-mail.')); + $this->addMessage($this->_( + 'We sent you an e-mail with a reset link. Click on the link in the e-mail.' + )); + $logger->log( + "index.resetpassword.request", + $request, + sprintf("User %s requested reset password.", $form->getUserNameElement()->getValue()), + $user->getUserId(), + true + ); + if ($this->returnToLoginAfterReset) { $this->setCurrentOrganizationTo($user); $this->loader->getCurrentUser()->gotoStartPage($this->menu, $request); @@ -370,7 +437,20 @@ // User set before this form was initiated $user->setAsCurrentUser(); + + /** + * Log the login + */ + $logger->log( + "index.loginreset", + $request, + "User logged in through reset password.", + $user->getUserId(), + true + ); + $user->gotoStartPage($this->menu, $this->getRequest()); + return; } } Modified: trunk/library/classes/Gems/Default/StaffAction.php =================================================================== --- trunk/library/classes/Gems/Default/StaffAction.php 2012-12-13 13:13:53 UTC (rev 1059) +++ trunk/library/classes/Gems/Default/StaffAction.php 2012-12-13 14:42:39 UTC (rev 1060) @@ -119,7 +119,7 @@ } // Add reset button if allowed if ($menuItem = $this->findAllowedMenuItem('reset')) { - $bridge->addItemLink($menuItem->toActionLink($this->getRequest(), $bridge, $this->_('reset'))); + $bridge->addItemLink($menuItem->toActionLink($this->getRequest(), $bridge, $this->_('password'))); } } Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2012-12-13 13:13:53 UTC (rev 1059) +++ trunk/library/classes/Gems/User/User.php 2012-12-13 14:42:39 UTC (rev 1060) @@ -331,11 +331,12 @@ * Authenticate a users credentials using the submitted form * * @param string $password The password to test + * @param boolean $testPassword Set to false to test the non-password checks only * @return Zend_Auth_Result */ - public function authenticate($password) + public function authenticate($password, $testPassword = true) { - $auths = $this->loadAuthorizers($password); + $auths = $this->loadAuthorizers($password, $testPassword); $lastAuthorizer = null; foreach ($auths as $lastAuthorizer => $result) { @@ -1146,9 +1147,10 @@ * is boolean, string or array it is converted into a Zend_Auth_Result. * * @param string $password + * @param boolean $testPassword Set to false to test on the non-password checks only * @return array Of Callable|Zend_Auth_Adapter_Interface|Zend_Auth_Result|boolean|string|array */ - protected function loadAuthorizers($password) + protected function loadAuthorizers($password, $testPassword = true) { if ($this->isBlockable()) { $auths['block'] = array($this, 'authorizeBlock'); @@ -1160,10 +1162,12 @@ // group ip restriction $auths['ip'] = array($this, 'authorizeIp'); - if ($this->isActive()) { - $auths['pwd'] = $this->definition->getAuthAdapter($this, $password); - } else { - $auths['pwd'] = false; + if ($testPassword) { + if ($this->isActive()) { + $auths['pwd'] = $this->definition->getAuthAdapter($this, $password); + } else { + $auths['pwd'] = false; + } } return $auths; Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2012-12-13 13:13:53 UTC (rev 1059) +++ trunk/library/languages/default-en.po 2012-12-13 14:42:39 UTC (rev 1060) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-29 12:04+0100\n" +"POT-Creation-Date: 2012-12-13 15:39+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -380,7 +380,7 @@ #: classes/Gems/Menu.php:578 classes/Gems/Default/GroupAction.php:122 #: classes/Gems/Default/OrganizationAction.php:154 -#: classes/Gems/Default/RespondentAction.php:470 +#: classes/Gems/Default/RespondentAction.php:462 msgid "Respondents" msgstr "Patients" @@ -404,7 +404,7 @@ msgid "Mail" msgstr "Mail" -#: classes/Gems/Menu.php:608 classes/Gems/Default/RespondentAction.php:364 +#: classes/Gems/Menu.php:608 classes/Gems/Default/RespondentAction.php:356 #: classes/Gems/Default/RespondentExportAction.php:60 msgid "Export respondent" msgstr "Export respondent" @@ -526,11 +526,11 @@ msgid "Unable to run PDF conversion (%s): \"%s\"" msgstr "Unable to run PDF conversion (%s): \"%s\"" -#: classes/Gems/Upgrades.php:90 +#: classes/Gems/Upgrades.php:91 msgid "Syncing surveys for all sources" msgstr "Syncing surveys for all sources" -#: classes/Gems/Upgrades.php:150 classes/Gems/Upgrades.php:162 +#: classes/Gems/Upgrades.php:151 classes/Gems/Upgrades.php:163 msgid "Make sure to read the changelog as it contains important instructions" msgstr "Make sure to read the changelog as it contains important instructions" @@ -649,9 +649,9 @@ msgstr "No" #: classes/Gems/Controller/BrowseEditAction.php:875 -#: classes/Gems/Default/RespondentAction.php:254 -#: classes/Gems/Default/RespondentAction.php:347 -#: classes/Gems/Default/RespondentAction.php:540 +#: classes/Gems/Default/RespondentAction.php:246 +#: classes/Gems/Default/RespondentAction.php:339 +#: classes/Gems/Default/RespondentAction.php:515 #: classes/Gems/Default/TrackAction.php:554 #, php-format msgid "Unknown %s requested" @@ -681,7 +681,7 @@ msgstr "No changes to save." #: classes/Gems/Controller/BrowseEditAction.php:954 -#: classes/Gems/Default/RespondentAction.php:315 +#: classes/Gems/Default/RespondentAction.php:307 msgid "Input error! No changes saved!" msgstr "Input error! No changes saved!" @@ -1330,35 +1330,43 @@ msgid "Good bye: %s." msgstr "Good bye: %s." -#: classes/Gems/Default/IndexAction.php:339 +#: classes/Gems/Default/IndexAction.php:341 +msgid "For that reason you cannot reset your password." +msgstr "For that reason you cannot reset your password." + +#: classes/Gems/Default/IndexAction.php:375 msgid "" "Your password reset request is no longer valid, please request a new link." msgstr "" "Your password reset request is no longer valid, please request a new link." -#: classes/Gems/Default/IndexAction.php:341 +#: classes/Gems/Default/IndexAction.php:377 msgid "" "Your password input request is no longer valid, please request a new link." msgstr "" "Your password input request is no longer valid, please request a new link." -#: classes/Gems/Default/IndexAction.php:360 +#: classes/Gems/Default/IndexAction.php:396 +msgid "For that reason you cannot request a password reset." +msgstr "For that reason you cannot request a password reset." + +#: classes/Gems/Default/IndexAction.php:418 msgid "" "We sent you an e-mail with a reset link. Click on the link in the e-mail." msgstr "" "We sent you an e-mail with a reset link. Click on the link in the e-mail." -#: classes/Gems/Default/IndexAction.php:369 +#: classes/Gems/Default/IndexAction.php:436 #: classes/Gems/Default/OptionAction.php:94 #: classes/Gems/Default/StaffAction.php:510 msgid "New password is active." msgstr "New password is active." -#: classes/Gems/Default/IndexAction.php:390 +#: classes/Gems/Default/IndexAction.php:470 msgid "Password reset requested" msgstr "Password reset requested" -#: classes/Gems/Default/IndexAction.php:393 +#: classes/Gems/Default/IndexAction.php:473 msgid "" "Dear {greeting},\n" "\n" @@ -1721,7 +1729,7 @@ msgstr "Email servers" #: classes/Gems/Default/MailTemplateAction.php:76 -#: classes/Gems/Default/RespondentAction.php:394 +#: classes/Gems/Default/RespondentAction.php:386 #: classes/Gems/Default/StaffAction.php:335 #: classes/Gems/Default/StaffAction.php:405 msgid "(all organizations)" @@ -1747,7 +1755,7 @@ #: classes/Gems/Default/OptionAction.php:136 #: classes/Gems/Default/OrganizationAction.php:147 -#: classes/Gems/Default/RespondentAction.php:203 +#: classes/Gems/Default/RespondentAction.php:195 #: classes/Gems/Default/StaffAction.php:351 msgid "Language" msgstr "Language" @@ -2151,69 +2159,69 @@ msgstr[0] "reception code" msgstr[1] "reception codes" -#: classes/Gems/Default/RespondentAction.php:135 +#: classes/Gems/Default/RespondentAction.php:127 #, php-format msgid "Random Example BSN: %s" msgstr "Random Example BSN: %s" -#: classes/Gems/Default/RespondentAction.php:137 +#: classes/Gems/Default/RespondentAction.php:129 msgid "Enter a 9-digit SSN number." msgstr "Enter a 9-digit BSN number." -#: classes/Gems/Default/RespondentAction.php:151 +#: classes/Gems/Default/RespondentAction.php:143 msgid "Identification" msgstr "Identification" -#: classes/Gems/Default/RespondentAction.php:162 +#: classes/Gems/Default/RespondentAction.php:154 msgid "SSN" msgstr "BSN" -#: classes/Gems/Default/RespondentAction.php:166 +#: classes/Gems/Default/RespondentAction.php:158 msgid "Patient number" msgstr "Patient number" -#: classes/Gems/Default/RespondentAction.php:175 +#: classes/Gems/Default/RespondentAction.php:167 msgid "Medical data" msgstr "Medical data" -#: classes/Gems/Default/RespondentAction.php:182 +#: classes/Gems/Default/RespondentAction.php:174 msgid "DBC's, etc..." msgstr "DBC's, etc..." -#: classes/Gems/Default/RespondentAction.php:185 +#: classes/Gems/Default/RespondentAction.php:177 msgid "Contact information" msgstr "Contact information" -#: classes/Gems/Default/RespondentAction.php:190 +#: classes/Gems/Default/RespondentAction.php:182 msgid "Respondent has no e-mail" msgstr "Patient has no e-mail" -#: classes/Gems/Default/RespondentAction.php:191 +#: classes/Gems/Default/RespondentAction.php:183 msgid "With housenumber" msgstr "With housenumber" -#: classes/Gems/Default/RespondentAction.php:198 +#: classes/Gems/Default/RespondentAction.php:190 msgid "Country" msgstr "Country" -#: classes/Gems/Default/RespondentAction.php:202 +#: classes/Gems/Default/RespondentAction.php:194 msgid "Settings" msgstr "Settings" -#: classes/Gems/Default/RespondentAction.php:204 +#: classes/Gems/Default/RespondentAction.php:196 msgid "Has the respondent signed the informed consent letter?" msgstr "Has the patient signed the informed consent letter?" -#: classes/Gems/Default/RespondentAction.php:236 +#: classes/Gems/Default/RespondentAction.php:228 #: classes/Gems/Tracker/Model/StandardTokenModel.php:203 msgid "Comments" msgstr "Comments" -#: classes/Gems/Default/RespondentAction.php:237 +#: classes/Gems/Default/RespondentAction.php:229 msgid "Treatment" msgstr "Treatment" -#: classes/Gems/Default/RespondentAction.php:265 +#: classes/Gems/Default/RespondentAction.php:257 #: classes/Gems/Default/TrackAction.php:132 #: classes/Gems/Default/TrackAction.php:482 #: classes/Gems/Tracker/Model/StandardTokenModel.php:212 @@ -2222,30 +2230,30 @@ msgid "Rejection code" msgstr "Rejection code" -#: classes/Gems/Default/RespondentAction.php:272 +#: classes/Gems/Default/RespondentAction.php:264 msgid "Delete respondent" msgstr "Delete patient" -#: classes/Gems/Default/RespondentAction.php:304 +#: classes/Gems/Default/RespondentAction.php:296 msgid "Respondent deleted." msgstr "Patient deleted" -#: classes/Gems/Default/RespondentAction.php:308 +#: classes/Gems/Default/RespondentAction.php:300 msgid "Respondent tracks stopped." msgstr "Patient tracks stopped." -#: classes/Gems/Default/RespondentAction.php:312 +#: classes/Gems/Default/RespondentAction.php:304 #: classes/Gems/Default/TrackAction.php:405 msgid "Choose a reception code to delete." msgstr "Choose a reception code to delete." -#: classes/Gems/Default/RespondentAction.php:465 +#: classes/Gems/Default/RespondentAction.php:457 msgid "respondent" msgid_plural "respondents" msgstr[0] "patient" msgstr[1] "patients" -#: classes/Gems/Default/RespondentAction.php:557 +#: classes/Gems/Default/RespondentAction.php:532 msgid "Please settle the informed consent form for this respondent." msgstr "Please settle the informed consent form for this patient." @@ -2515,8 +2523,8 @@ msgstr "Synchronize all sources." #: classes/Gems/Default/StaffAction.php:122 -msgid "reset" -msgstr "reset" +msgid "password" +msgstr "password" #: classes/Gems/Default/StaffAction.php:164 msgid "Unsupported User Definition" @@ -2543,7 +2551,7 @@ "User with id %s already exists but is deleted, do you want to reactivate the " "account?" -#: classes/Gems/Default/StaffAction.php:327 classes/Gems/User/User.php:1208 +#: classes/Gems/Default/StaffAction.php:327 classes/Gems/User/User.php:1212 #: classes/Gems/User/Form/OrganizationFormAbstract.php:232 msgid "Username" msgstr "Username" @@ -4471,33 +4479,33 @@ msgid "Shared secret" msgstr "Shared secret" -#: classes/Gems/User/User.php:407 +#: classes/Gems/User/User.php:408 #, php-format msgid "Your account is temporarily blocked, please wait a minute." msgid_plural "Your account is temporarily blocked, please wait %d minutes." msgstr[0] "Your account is temporarily blocked, please wait a minute." msgstr[1] "Your account is temporarily blocked, please wait %d minutes." -#: classes/Gems/User/User.php:446 classes/Gems/User/User.php:473 +#: classes/Gems/User/User.php:447 classes/Gems/User/User.php:474 #: languages/FakeTranslations.php:47 msgid "You are not allowed to login from this location." msgstr "You are not allowed to login from this location." -#: classes/Gems/User/User.php:1187 +#: classes/Gems/User/User.php:1191 msgid "Your birthday" msgstr "Your birthday" -#: classes/Gems/User/User.php:1203 +#: classes/Gems/User/User.php:1207 #: classes/Gems/User/Form/ChangePasswordForm.php:163 #, php-format msgid "%s is not correct." msgstr "%s is not correct." -#: classes/Gems/User/User.php:1288 +#: classes/Gems/User/User.php:1292 msgid "Trying to send a password reset to a user that cannot be reset." msgstr "Trying to send a password reset to a user that cannot be reset." -#: classes/Gems/User/User.php:1316 +#: classes/Gems/User/User.php:1320 msgid "Unable to send e-mail." msgstr "Unable to send e-mail." @@ -5176,6 +5184,9 @@ msgstr[1] "" "After this survey there are another %d surveys we would like you to answer." +#~ msgid "reset" +#~ msgstr "reset" + #~ msgid "Show all stand alone surveys for this type" #~ msgstr "Show all stand alone surveys for this type" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2012-12-13 13:13:53 UTC (rev 1059) +++ trunk/library/languages/default-nl.po 2012-12-13 14:42:39 UTC (rev 1060) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-29 12:04+0100\n" +"POT-Creation-Date: 2012-12-13 15:38+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -380,7 +380,7 @@ #: classes/Gems/Menu.php:578 classes/Gems/Default/GroupAction.php:122 #: classes/Gems/Default/OrganizationAction.php:154 -#: classes/Gems/Default/RespondentAction.php:470 +#: classes/Gems/Default/RespondentAction.php:462 msgid "Respondents" msgstr "Patiënten" @@ -404,7 +404,7 @@ msgid "Mail" msgstr "Email" -#: classes/Gems/Menu.php:608 classes/Gems/Default/RespondentAction.php:364 +#: classes/Gems/Menu.php:608 classes/Gems/Default/RespondentAction.php:356 #: classes/Gems/Default/RespondentExportAction.php:60 msgid "Export respondent" msgstr "Exporteer patiënt" @@ -526,11 +526,11 @@ msgid "Unable to run PDF conversion (%s): \"%s\"" msgstr "Kan PDF conversie (%s) niet starten: \"%s\"" -#: classes/Gems/Upgrades.php:90 +#: classes/Gems/Upgrades.php:91 msgid "Syncing surveys for all sources" msgstr "Vragenlijsten synchroniseren voor alle bronnen." -#: classes/Gems/Upgrades.php:150 classes/Gems/Upgrades.php:162 +#: classes/Gems/Upgrades.php:151 classes/Gems/Upgrades.php:163 msgid "Make sure to read the changelog as it contains important instructions" msgstr "Lees de wijzigingen, er kunnen belangrijke aanwijzingen in staan" @@ -649,9 +649,9 @@ msgstr "Nee" #: classes/Gems/Controller/BrowseEditAction.php:875 -#: classes/Gems/Default/RespondentAction.php:254 -#: classes/Gems/Default/RespondentAction.php:347 -#: classes/Gems/Default/RespondentAction.php:540 +#: classes/Gems/Default/RespondentAction.php:246 +#: classes/Gems/Default/RespondentAction.php:339 +#: classes/Gems/Default/RespondentAction.php:515 #: classes/Gems/Default/TrackAction.php:554 #, php-format msgid "Unknown %s requested" @@ -681,7 +681,7 @@ msgstr "Geen verandering om op te slaan." #: classes/Gems/Controller/BrowseEditAction.php:954 -#: classes/Gems/Default/RespondentAction.php:315 +#: classes/Gems/Default/RespondentAction.php:307 msgid "Input error! No changes saved!" msgstr "Invoer fout! Veranderingen niet opgeslagen!" @@ -1336,37 +1336,45 @@ msgid "Good bye: %s." msgstr "Tot ziens: %s." -#: classes/Gems/Default/IndexAction.php:339 +#: classes/Gems/Default/IndexAction.php:341 +msgid "For that reason you cannot reset your password." +msgstr "Om die reden kunt u uw wachtwoord niet wijzigen." + +#: classes/Gems/Default/IndexAction.php:375 msgid "" "Your password reset request is no longer valid, please request a new link." msgstr "" "Uw verzoek om een nieuw wachtwoord is niet meer geldig, maar u kan hieronder " "een nieuwe link aanvragen." -#: classes/Gems/Default/IndexAction.php:341 +#: classes/Gems/Default/IndexAction.php:377 msgid "" "Your password input request is no longer valid, please request a new link." msgstr "" "Uw link om een wachtwoord in te voeren is niet meer geldig, maar u kan " "hieronder een nieuwe link aanvragen." -#: classes/Gems/Default/IndexAction.php:360 +#: classes/Gems/Default/IndexAction.php:396 +msgid "For that reason you cannot request a password reset." +msgstr "Om die reden kunt u geen wachtwoord wijziging aanvragen." + +#: classes/Gems/Default/IndexAction.php:418 msgid "" "We sent you an e-mail with a reset link. Click on the link in the e-mail." msgstr "" "We hebben u een email met reset link gestuurd. Klik op de link in de email." -#: classes/Gems/Default/IndexAction.php:369 +#: classes/Gems/Default/IndexAction.php:436 #: classes/Gems/Default/OptionAction.php:94 #: classes/Gems/Default/StaffAction.php:510 msgid "New password is active." msgstr "Nieuwe wachtwoord geactiveerd." -#: classes/Gems/Default/IndexAction.php:390 +#: classes/Gems/Default/IndexAction.php:470 msgid "Password reset requested" -msgstr "Wachtwoord reset aangevraagd" +msgstr "Wachtwoord wijziging aangevraagd" -#: classes/Gems/Default/IndexAction.php:393 +#: classes/Gems/Default/IndexAction.php:473 msgid "" "Dear {greeting},\n" "\n" @@ -1730,7 +1738,7 @@ msgstr "Email servers" #: classes/Gems/Default/MailTemplateAction.php:76 -#: classes/Gems/Default/RespondentAction.php:394 +#: classes/Gems/Default/RespondentAction.php:386 #: classes/Gems/Default/StaffAction.php:335 #: classes/Gems/Default/StaffAction.php:405 msgid "(all organizations)" @@ -1756,7 +1764,7 @@ #: classes/Gems/Default/OptionAction.php:136 #: classes/Gems/Default/OrganizationAction.php:147 -#: classes/Gems/Default/RespondentAction.php:203 +#: classes/Gems/Default/RespondentAction.php:195 #: classes/Gems/Default/StaffAction.php:351 msgid "Language" msgstr "Taal" @@ -2162,69 +2170,69 @@ msgstr[0] "Ontvangst code" msgstr[1] "Ontvangst code" -#: classes/Gems/Default/RespondentAction.php:135 +#: classes/Gems/Default/RespondentAction.php:127 #, php-format msgid "Random Example BSN: %s" msgstr "Willekeurig voorbeeld BSN: %s" -#: classes/Gems/Default/RespondentAction.php:137 +#: classes/Gems/Default/RespondentAction.php:129 msgid "Enter a 9-digit SSN number." msgstr "Voer een BSN nummer van 9 cijfers in." -#: classes/Gems/Default/RespondentAction.php:151 +#: classes/Gems/Default/RespondentAction.php:143 msgid "Identification" msgstr "Identificatie" -#: classes/Gems/Default/RespondentAction.php:162 +#: classes/Gems/Default/RespondentAction.php:154 msgid "SSN" msgstr "SSN" -#: classes/Gems/Default/RespondentAction.php:166 +#: classes/Gems/Default/RespondentAction.php:158 msgid "Patient number" msgstr "Patiënt nummer" -#: classes/Gems/Default/RespondentAction.php:175 +#: classes/Gems/Default/RespondentAction.php:167 msgid "Medical data" msgstr "Medische gegevens" -#: classes/Gems/Default/RespondentAction.php:182 +#: classes/Gems/Default/RespondentAction.php:174 msgid "DBC's, etc..." msgstr "DBC's, etc..." -#: classes/Gems/Default/RespondentAction.php:185 +#: classes/Gems/Default/RespondentAction.php:177 msgid "Contact information" msgstr "Contact informatie" -#: classes/Gems/Default/RespondentAction.php:190 +#: classes/Gems/Default/RespondentAction.php:182 msgid "Respondent has no e-mail" msgstr "Patiënt zonder email" -#: classes/Gems/Default/RespondentAction.php:191 +#: classes/Gems/Default/RespondentAction.php:183 msgid "With housenumber" msgstr "Met huisnummer" -#: classes/Gems/Default/RespondentAction.php:198 +#: classes/Gems/Default/RespondentAction.php:190 msgid "Country" msgstr "Land" -#: classes/Gems/Default/RespondentAction.php:202 +#: classes/Gems/Default/RespondentAction.php:194 msgid "Settings" msgstr "Instellingen" -#: classes/Gems/Default/RespondentAction.php:204 +#: classes/Gems/Default/RespondentAction.php:196 msgid "Has the respondent signed the informed consent letter?" msgstr "Heeft de patiënt het \"informed consent\" formulier ondertekend?" -#: classes/Gems/Default/RespondentAction.php:236 +#: classes/Gems/Default/RespondentAction.php:228 #: classes/Gems/Tracker/Model/StandardTokenModel.php:203 msgid "Comments" msgstr "Opmerkingen" -#: classes/Gems/Default/RespondentAction.php:237 +#: classes/Gems/Default/RespondentAction.php:229 msgid "Treatment" msgstr "Behandeling" -#: classes/Gems/Default/RespondentAction.php:265 +#: classes/Gems/Default/RespondentAction.php:257 #: classes/Gems/Default/TrackAction.php:132 #: classes/Gems/Default/TrackAction.php:482 #: classes/Gems/Tracker/Model/StandardTokenModel.php:212 @@ -2233,30 +2241,30 @@ msgid "Rejection code" msgstr "Afkeuringscode" -#: classes/Gems/Default/RespondentAction.php:272 +#: classes/Gems/Default/RespondentAction.php:264 msgid "Delete respondent" msgstr "Verwijder patiënt" -#: classes/Gems/Default/RespondentAction.php:304 +#: classes/Gems/Default/RespondentAction.php:296 msgid "Respondent deleted." msgstr "Patiënt verwijderd" -#: classes/Gems/Default/RespondentAction.php:308 +#: classes/Gems/Default/RespondentAction.php:300 msgid "Respondent tracks stopped." msgstr "Trajecten van patiënt zijn gestopt." -#: classes/Gems/Default/RespondentAction.php:312 +#: classes/Gems/Default/RespondentAction.php:304 #: classes/Gems/Default/TrackAction.php:405 msgid "Choose a reception code to delete." msgstr "Kies een ontvangst code om te verwijderen." -#: classes/Gems/Default/RespondentAction.php:465 +#: classes/Gems/Default/RespondentAction.php:457 msgid "respondent" msgid_plural "respondents" msgstr[0] "patiënt" msgstr[1] "patiënten" -#: classes/Gems/Default/RespondentAction.php:557 +#: classes/Gems/Default/RespondentAction.php:532 msgid "Please settle the informed consent form for this respondent." msgstr "A.u.b. het informed consent formulier doornemen met deze patiënt" @@ -2529,8 +2537,8 @@ msgstr "Synchroniseer alle bronnen." #: classes/Gems/Default/StaffAction.php:122 -msgid "reset" -msgstr "herstellen" +msgid "password" +msgstr "wachtwoord" #: classes/Gems/Default/StaffAction.php:164 msgid "Unsupported User Definition" @@ -2559,7 +2567,7 @@ "Gebruiker met inlognaam %s bestaat al maar is verwijderd, wilt u het account " "opnieuw activeren?" -#: classes/Gems/Default/StaffAction.php:327 classes/Gems/User/User.php:1208 +#: classes/Gems/Default/StaffAction.php:327 classes/Gems/User/User.php:1212 #: classes/Gems/User/Form/OrganizationFormAbstract.php:232 msgid "Username" msgstr "Gebruikersnaam" @@ -3600,7 +3608,7 @@ #: classes/Gems/Menu/MenuAbstract.php:421 msgid "Reset password" -msgstr "Reset wachtwoord" +msgstr "Wijzig wachtwoord" #: classes/Gems/Menu/MenuAbstract.php:448 msgid "Check status" @@ -4511,7 +4519,7 @@ msgid "Shared secret" msgstr "Shared secret" -#: classes/Gems/User/User.php:407 +#: classes/Gems/User/User.php:408 #, php-format msgid "Your account is temporarily blocked, please wait a minute." msgid_plural "Your account is temporarily blocked, please wait %d minutes." @@ -4520,26 +4528,26 @@ msgstr[1] "" "Uw account is tijdelijk geblokkeerd. U kunt over %d minuten opnieuw inloggen." -#: classes/Gems/User/User.php:446 classes/Gems/User/User.php:473 +#: classes/Gems/User/User.php:447 classes/Gems/User/User.php:474 #: languages/FakeTranslations.php:47 msgid "You are not allowed to login from this location." msgstr "U kunt vanaf deze locatie niet inloggen." -#: classes/Gems/User/User.php:1187 +#: classes/Gems/User/User.php:1191 msgid "Your birthday" msgstr "Uw geboortedatum" -#: classes/Gems/User/User.php:1203 +#: classes/Gems/User/User.php:1207 #: classes/Gems/User/Form/ChangePasswordForm.php:163 #, php-format msgid "%s is not correct." msgstr "%s is onjuist." -#: classes/Gems/User/User.php:1288 +#: classes/Gems/User/User.php:1292 msgid "Trying to send a password reset to a user that cannot be reset." msgstr "Het wachtwoord voor deze gebruiker kan niet gewijzigd worden." -#: classes/Gems/User/User.php:1316 +#: classes/Gems/User/User.php:1320 msgid "Unable to send e-mail." msgstr "Verzenden email mislukt." @@ -5232,6 +5240,9 @@ msgstr[0] "Na deze vragenlijst hebben we nog één andere vragenlijst voor u." msgstr[1] "Na deze vragenlijst hebben we nog %d andere vragenlijsten voor u." +#~ msgid "reset" +#~ msgstr "herstellen" + #~ msgid "Show all stand alone surveys for this type" #~ msgstr "Toon alle antwoorden voor deze losse vragenlijst" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-12-13 17:02:28
|
Revision: 1062 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1062&view=rev Author: matijsdejong Date: 2012-12-13 17:02:21 +0000 (Thu, 13 Dec 2012) Log Message: ----------- Slightly more polite phrasing used Modified Paths: -------------- trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php 2012-12-13 14:55:27 UTC (rev 1061) +++ trunk/library/classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php 2012-12-13 17:02:21 UTC (rev 1062) @@ -164,23 +164,32 @@ switch ($days) { case 0: - return array(MUtil_Html::create('strong', $this->_('Warning!!!')), ' ', $this->_('Survey must be answered today!')); + return array( + MUtil_Html::create('strong', $this->_('Warning!!!')), + ' ', + $this->_('This survey must be answered today!') + ); case 1: - return array(MUtil_Html::create('strong', $this->_('Warning!!')), ' ', $this->_('Survey must be answered tomorrow!')); + return array( + MUtil_Html::create('strong', $this->_('Warning!!')), + ' ', + $this->_('This survey can only be answered until tomorrow!') + ); case 2: - return $this->_('Warning! Survey must be answered over 2 days!'); + return $this->_('Warning! This survey can only be answered for another 2 days!'); default: - if (abs($days) <= 14) { - if ($days >= 0) { - return sprintf($this->_('Survey must be answered in %d days.'), $days); - } else { - return $this->_('Survey can no longer be answered.'); - } + if ($days <= 14) { + return sprintf($this->_('Please answer this survey within %d days.'), $days); } - return sprintf($this->_('Survey can be answered until %s.'), $dateTime->toString($this->dateFormat)); + + if ($days <= 0) { + return $this->_('This survey can no longer be answered.'); + } + + return sprintf($this->_('Please answer this survey before %s.'), $dateTime->toString($this->dateFormat)); } } Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2012-12-13 14:55:27 UTC (rev 1061) +++ trunk/library/languages/default-en.po 2012-12-13 17:02:21 UTC (rev 1062) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-12-13 15:39+0100\n" +"POT-Creation-Date: 2012-12-13 17:56+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -4203,39 +4203,39 @@ msgid "Survey has no time limit." msgstr "Survey has no time limit." -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:167 +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:168 msgid "Warning!!!" msgstr "Warning!!!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:167 -msgid "Survey must be answered today!" -msgstr "Survey must be answered today!" +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:170 +msgid "This survey must be answered today!" +msgstr "This survey must be answered today!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:170 +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:175 msgid "Warning!!" msgstr "Warning!!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:170 -msgid "Survey must be answered tomorrow!" -msgstr "Survey must be answered tomorrow!" +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:177 +msgid "This survey can only be answered until tomorrow!" +msgstr "This survey can only be answered until tomorrow!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:173 -msgid "Warning! Survey must be answered over 2 days!" -msgstr "Warning! Survey must be answered over 2 days!" +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:181 +msgid "Warning! This survey can only be answered for another 2 days!" +msgstr "Warning! This survey can only be answered for another 2 days!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:178 +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:185 #, php-format -msgid "Survey must be answered in %d days." -msgstr "Survey must be answered in %d days." +msgid "Please answer this survey within %d days." +msgstr "Please answer this survey within %d days." -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:180 -msgid "Survey can no longer be answered." -msgstr "Survey can no longer be answered." +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:189 +msgid "This survey can no longer be answered." +msgstr "This survey can no longer be answered." -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:183 +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:192 #, php-format -msgid "Survey can be answered until %s." -msgstr "Survey can be answered until %s." +msgid "Please answer this survey before %s." +msgstr "Please answer this survey before %s." #: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:376 #: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1173 @@ -5184,6 +5184,15 @@ msgstr[1] "" "After this survey there are another %d surveys we would like you to answer." +#~ msgid "Survey can be answered until %s." +#~ msgstr "Survey can be answered until %s." + +#~ msgid "Survey must be answered tomorrow!" +#~ msgstr "Survey must be answered tomorrow!" + +#~ msgid "Survey must be answered in %d days." +#~ msgstr "Survey must be answered in %d days." + #~ msgid "reset" #~ msgstr "reset" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2012-12-13 14:55:27 UTC (rev 1061) +++ trunk/library/languages/default-nl.po 2012-12-13 17:02:21 UTC (rev 1062) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-12-13 15:38+0100\n" +"POT-Creation-Date: 2012-12-13 17:55+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -4236,39 +4236,39 @@ msgid "Survey has no time limit." msgstr "Vragenlijst zonder eindtijd." -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:167 +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:168 msgid "Warning!!!" msgstr "Let op!!!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:167 -msgid "Survey must be answered today!" -msgstr "Vragenlijst moet vandaag ingevuld zijn!" +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:170 +msgid "This survey must be answered today!" +msgstr "Deze vragenlijst kan alleen vandaag nog ingevuld worden!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:170 +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:175 msgid "Warning!!" msgstr "Let op!!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:170 -msgid "Survey must be answered tomorrow!" -msgstr "Vragenlijst moet morgen ingevuld zijn!" +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:177 +msgid "This survey can only be answered until tomorrow!" +msgstr "Deze vragenlijst kan slechts tot morgen ingevuld worden!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:173 -msgid "Warning! Survey must be answered over 2 days!" -msgstr "Let op! Vragenlijst moet overmorgen ingevuld zijn!" +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:181 +msgid "Warning! This survey can only be answered for another 2 days!" +msgstr "Let op! Deze vragenlijst kan slechts tot overmorgen ingevuld worden!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:178 +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:185 #, php-format -msgid "Survey must be answered in %d days." -msgstr "Vragenlijst moet binnen %d dagen ingevuld zijn!" +msgid "Please answer this survey within %d days." +msgstr "Wij verzoeken u deze vragenlijst binnen %d dagen in te vullen." -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:180 -msgid "Survey can no longer be answered." -msgstr "Vragenlijst kan niet langer worden ingevuld!" +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:189 +msgid "This survey can no longer be answered." +msgstr "Deze vragenlijst kan niet langer worden ingevuld!" -#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:183 +#: classes/Gems/Tracker/Snippets/ShowTokenLoopAbstract.php:192 #, php-format -msgid "Survey can be answered until %s." -msgstr "Moet ingevuld worden voor %s." +msgid "Please answer this survey before %s." +msgstr "Wij verzoeken u deze vragenlijst voor %s in te vullen." #: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:376 #: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1173 @@ -5240,6 +5240,15 @@ msgstr[0] "Na deze vragenlijst hebben we nog één andere vragenlijst voor u." msgstr[1] "Na deze vragenlijst hebben we nog %d andere vragenlijsten voor u." +#~ msgid "Survey can be answered until %s." +#~ msgstr "Moet ingevuld worden voor %s." + +#~ msgid "Survey must be answered tomorrow!" +#~ msgstr "Vragenlijst moet morgen ingevuld zijn!" + +#~ msgid "Survey must be answered in %d days." +#~ msgstr "Vragenlijst moet binnen %d dagen ingevuld zijn!" + #~ msgid "reset" #~ msgstr "herstellen" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-01-04 16:20:30
|
Revision: 1088 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1088&view=rev Author: matijsdejong Date: 2013-01-04 16:20:22 +0000 (Fri, 04 Jan 2013) Log Message: ----------- Snippets should not use translate functions before call to afterRegistry() CachedLoader is now default loader Modified Paths: -------------- trunk/library/classes/Gems/Form/AutoLoadFormAbstract.php trunk/library/classes/Gems/Loader/LoaderAbstract.php trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php trunk/library/classes/Gems/Task/Db/CreateNewTable.php trunk/library/classes/Gems/Task/Db/CreateNewTables.php trunk/library/classes/GemsEscort.php trunk/library/classes/MUtil/Loader/CachedLoader.php trunk/library/classes/MUtil/Registry/Source.php trunk/library/snippets/AddTracksSnippet.php Modified: trunk/library/classes/Gems/Form/AutoLoadFormAbstract.php =================================================================== --- trunk/library/classes/Gems/Form/AutoLoadFormAbstract.php 2013-01-03 17:23:59 UTC (rev 1087) +++ trunk/library/classes/Gems/Form/AutoLoadFormAbstract.php 2013-01-04 16:20:22 UTC (rev 1088) @@ -67,18 +67,18 @@ protected $translate; /** - * Should be called after answering the request to allow the Target - * to check if all required registry values have been set correctly. + * Called after the check that all required registry values + * have been set correctly has run. * - * @return boolean False if required values are missing. + * @return void */ - public function checkRegistryRequestsAnswers() + public function afterRegistry() { + parent::afterRegistry(); + if ($this->loadDefault) { $this->loadDefaultElements(); } - - return true; } /** Modified: trunk/library/classes/Gems/Loader/LoaderAbstract.php =================================================================== --- trunk/library/classes/Gems/Loader/LoaderAbstract.php 2013-01-03 17:23:59 UTC (rev 1087) +++ trunk/library/classes/Gems/Loader/LoaderAbstract.php 2013-01-04 16:20:22 UTC (rev 1088) @@ -84,6 +84,12 @@ private $_loaded = array(); /** + * + * @var MUtil_Loader_CachedLoader + */ + private $_loader; + + /** * Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for. * * @var string $cascade An optional subdirectory where this subclass always loads from. @@ -108,6 +114,9 @@ } $this->_dirs = $newdirs; } + $this->_loader = MUtil_Loader_CachedLoader::getInstance(); + + if (MUtil_Registry_Source::$verbose) { MUtil_Echo::r($this->_dirs, '$this->_dirs in ' . get_class($this) . '->' . __FUNCTION__ . '():'); } @@ -162,8 +171,6 @@ $cname = trim(str_replace('/', '_', ucfirst($name)), '_'); $cfile = str_replace('_', '/', $cname) . '.php'; - // MUtil_Loader_CachedLoader::getInstance(GEMS_ROOT_DIR . '\var\cache'); - $found = false; /** @@ -187,18 +194,44 @@ $paths = array($paths); } foreach ($paths as $path) { + //* + $className = $prefix . $cname; + + if ($this->_loader->loadClass($className, $path . $fprefix . '/' . $cfile)) { + if (is_subclass_of($className, __CLASS__)) { + $create = true; + $arguments = array($this->_containers[0], $this->_dirs); + + } elseif (is_subclass_of($className, 'MUtil_Registry_TargetInterface')) { + $create = true; + } + + + if ($create) { + $obj = $this->_loader->createClass($className, $arguments); + } else { + $obj = new MUtil_Lazy_StaticCall($className); + } + + $found = true; + $this->_loaded[$cname] = get_class($obj); + break 2; + } // */ + + /* if ($obj = $this->_loadClassPath($path . $fprefix . '/' . $cfile, $prefix . $cname, $create, $arguments)) { $found = true; $this->_loaded[$cname] = get_class($obj); break 2; - } + } // */ } } } if ($found) { if ($obj instanceof MUtil_Registry_TargetInterface) { - if ((!$this->applySource($obj)) && parent::$verbose) { + // error_log(get_class($obj)); + if ((! $this->applySource($obj)) && parent::$verbose) { MUtil_Echo::track("Source apply to object of type $name failed."); } } Modified: trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php 2013-01-03 17:23:59 UTC (rev 1087) +++ trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php 2013-01-04 16:20:22 UTC (rev 1088) @@ -120,13 +120,15 @@ } /** - * Should be called after answering the request to allow the Target - * to check if all required registry values have been set correctly. + * Called after the check that all required registry values + * have been set correctly has run. * - * @return boolean False if required are missing. + * @return void */ - public function checkRegistryRequestsAnswers() + public function afterRegistry() { + parent::afterRegistry(); + if ($this->util && (! $this->requestCache)) { $this->requestCache = $this->util->getRequestCache(); } @@ -134,8 +136,6 @@ // Do not store searchButtonId $this->requestCache->removeParams($this->searchButtonId); } - - return parent::checkRegistryRequestsAnswers(); } /** Modified: trunk/library/classes/Gems/Task/Db/CreateNewTable.php =================================================================== --- trunk/library/classes/Gems/Task/Db/CreateNewTable.php 2013-01-03 17:23:59 UTC (rev 1087) +++ trunk/library/classes/Gems/Task/Db/CreateNewTable.php 2013-01-04 16:20:22 UTC (rev 1088) @@ -68,7 +68,7 @@ public function execute($tableData = array()) { $this->_batch->addToCounter('createTableStep'); - + $result = $this->dbaModel->runScript($tableData); $result[] = sprintf($this->translate->_('Finished %s creation script for object %d of %d'), $this->translate->_(strtolower($tableData['type'])), $this->_batch->getCounter('createTableStep'), $this->_batch->getCounter('NewTableCount')) . '<br/>'; @@ -87,7 +87,8 @@ * * @return boolean */ - public function checkRegistryRequestsAnswers() { + public function checkRegistryRequestsAnswers() + { $this->escort = GemsEscort::getInstance(); //Load the dbaModel Modified: trunk/library/classes/Gems/Task/Db/CreateNewTables.php =================================================================== --- trunk/library/classes/Gems/Task/Db/CreateNewTables.php 2013-01-03 17:23:59 UTC (rev 1087) +++ trunk/library/classes/Gems/Task/Db/CreateNewTables.php 2013-01-04 16:20:22 UTC (rev 1088) @@ -79,7 +79,8 @@ * * @return boolean */ - public function checkRegistryRequestsAnswers() { + public function checkRegistryRequestsAnswers() + { $this->escort = GemsEscort::getInstance(); //Load the dbaModel Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2013-01-03 17:23:59 UTC (rev 1087) +++ trunk/library/classes/GemsEscort.php 2013-01-04 16:20:22 UTC (rev 1088) @@ -38,6 +38,7 @@ // $autoloader->registerNamespace has not yet run!! include_once('MUtil/Application/Escort.php'); +include_once('MUtil/Loader/CachedLoader.php'); /** * Project Application Core code @@ -94,6 +95,10 @@ { parent::__construct($application); + $autoloader = Zend_Loader_Autoloader::getInstance(); + $cachedloader = MUtil_Loader_CachedLoader::getInstance(GEMS_ROOT_DIR . '\var\cache'); + $autoloader->setDefaultAutoloader(array($cachedloader, 'loadClassByPaths')); + self::$_instanceOfSelf = $this; $firebug = $application->getOption('firebug'); @@ -534,7 +539,7 @@ * Add ZFDebug info to the page output. * * @return void - * / + */ protected function _initZFDebug() { // if ((APPLICATION_ENV === 'development') && Modified: trunk/library/classes/MUtil/Loader/CachedLoader.php =================================================================== --- trunk/library/classes/MUtil/Loader/CachedLoader.php 2013-01-03 17:23:59 UTC (rev 1087) +++ trunk/library/classes/MUtil/Loader/CachedLoader.php 2013-01-04 16:20:22 UTC (rev 1088) @@ -65,7 +65,14 @@ protected $_cacheFile = 'cached.loader.mutil.php'; /** + * An array containg include dir pathNames * + * @var array + */ + protected $_includeDirs; + + /** + * * @param string $dir */ protected function __construct($dir = null) @@ -94,52 +101,164 @@ $this->_loadCache(); } + + $this->_loadIncludePath(); // MUtil_Echo::track($this->_cacheFile, $this->_cacheDir, file_exists($this->_cacheDir)); } /** - * Append a new found file to the cache + * Check for file existence and append status to the cache * - * @param string $class The name of the class to load * @param mixed $file String path to file or false if does not exist + * @return boolean True if the file exists */ - protected function _appendToCache($class, $file) + protected function _checkFile($file) { - $this->_cacheArray[$class] = $file; + if (array_key_exists($file, $this->_cacheArray)) { + return $this->_cacheArray[$file]; + } + // MUtil_Echo::track($file); + $this->_cacheArray[$file] = file_exists($file); + if (! file_exists($this->_cacheFile)) { $this->_saveCache(); } else { - if (false === $file) { - $content = "\$this->_cacheArray['$class'] = false;\n"; + if (false === $this->_cacheArray[$file]) { + $content = "\$this->_cacheArray['$file'] = false;\n"; } else { - $content = "\$this->_cacheArray['$class'] = '$file';\n"; + $content = "\$this->_cacheArray['$file'] = true;\n"; } file_put_contents($this->_cacheFile, $content, FILE_APPEND | LOCK_EX ); } + + return $this->_cacheArray[$file]; } + /** + * Loads the class from file with a check on changes to the include path + */ protected function _loadCache() { include $this->_cacheFile; + + // Include path has changed + if (!isset($include) || (get_include_path() != $include)) { + $this->_cacheArray = array(); + } } + /** + * Initialize the _includeDirs variable + */ + protected function _loadIncludePath() + { + $dirs = Zend_Loader::explodeIncludePath(); + + foreach ($dirs as $dir) { + if (('.' != $dir) && is_dir($dir)) { + $this->_includeDirs[] = realpath($dir) . DIRECTORY_SEPARATOR; +; + } + } + } + + /** + * Save the cache to file + */ protected function _saveCache() { - $content = "<?php\n"; + $content = "<?php\n\n"; + $content .= "\$include = '" . get_include_path() . "';\n\n"; - foreach ($this->_cacheArray as $class => $file) { + foreach ($this->_cacheArray as $file => $exists) { if (false === $file) { - $content .= "\$this->_cacheArray['$class'] = false;\n"; + $content .= "\$this->_cacheArray['$file'] = false;\n"; } else { - $content .= "\$this->_cacheArray['$class'] = '$file';\n"; + $content .= "\$this->_cacheArray['$file'] = true;\n"; } } file_put_contents($this->_cacheFile, $content, LOCK_EX); } /** + * Create a new instance of a class * + * @param string $className The name of the class + * @param array $arguments Class initialization arguments. + * @return boolean True if the class exists. + */ + public function createClass($className, array $arguments) + { + switch (count($arguments)) { + case 0: + return new $className(); + + case 1: + return new $className( + $arguments[0] + ); + + case 2: + return new $className( + $arguments[0], $arguments[1] + ); + + case 3: + return new $className( + $arguments[0], $arguments[1], $arguments[2] + ); + + case 4: + return new $className( + $arguments[0], $arguments[1], $arguments[2], $arguments[3] + ); + + case 5: + return new $className( + $arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4] + ); + + case 6: + return new $className( + $arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], + $arguments[5] + ); + + case 7: + return new $className( + $arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], + $arguments[5], $arguments[6] + ); + + case 8: + return new $className( + $arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], + $arguments[5], $arguments[6], $arguments[7] + ); + + case 9: + return new $className( + $arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], + $arguments[5], $arguments[6], $arguments[7], $arguments[8] + ); + + case 10: + return new $className( + $arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], + $arguments[5], $arguments[6], $arguments[7], $arguments[8], $arguments[9] + ); + + default: + throw new Zend_Exception( + __CLASS__ . '->' . __FUNCTION__ . ' cannot create class with ' . + count($arguments) . ' parameters.' + ); + } + } + + /** + * * @static MUtil_Loader_CachedLoader $instance * @param stirng $dir * @return MUtil_Loader_CachedLoader @@ -155,11 +274,123 @@ return $instance;; } - protected function isClass($className, $paths) + /** + * Include a file with cached existence check + * + * @param string $file The full path to the file + */ + public function includeFile($file) { - // Zend_Loader::standardiseFile($file) - //if (file_exists($path . $className)) { + if ($this->_checkFile($file)) { + $result = include $file; -// /} + return $result ? $result : true; + } + + return false; } + + /** + * Load a class, but do not create it + * + * @param string $className The name of the class + * @param string $file The full path to the file + * @return boolean True if the class exists. + */ + public function loadClass($className, $file) + { + if (class_exists($className, false) || interface_exists($className, false)) { + return true; + } + + if ($this->includeFile($file)) { + if (class_exists($className, false) || interface_exists($className, false)) { + return true; + } + + throw new Zend_Exception("The file '$file' does not contain the class '$class'."); + } + + return false; + } + + /** + * Loads a class from a PHP file. The filename must be formatted + * as "$class.php". + * + * If $dirs is a string or an array, it will search the directories + * in the order supplied, and attempt to load the first matching file. + * + * If $dirs is null, it will split the class name at underscores to + * generate a path hierarchy (e.g., "Zend_Example_Class" will map + * to "Zend/Example/Class.php"). + * + * If the file was not found in the $dirs, or if no $dirs were specified, + * it will attempt to load it from PHP's include_path. + * + * @param string $class - The full class name of a Zend component. + * @param string|array $dirs - OPTIONAL Either a path or an array of paths + * to search. + * @return void + * @throws Zend_Exception + */ + public function loadClassByPaths($class, $dirs = null) + { + if (class_exists($class, false) || interface_exists($class, false)) { + return; + } + + if ((null !== $dirs) && !is_string($dirs) && !is_array($dirs)) { + require_once 'Zend/Exception.php'; + throw new Zend_Exception('Directory argument must be a string or an array'); + } + + $className = ltrim($class, '\\'); + $file = ''; + $namespace = ''; + if ($lastNsPos = strripos($className, '\\')) { + $namespace = substr($className, 0, $lastNsPos); + $className = substr($className, $lastNsPos + 1); + $file = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; + } + $file .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; + + if (null === $dirs) { + $dirs = $this->_includeDirs; + } else { + $dirs = array_merge($dirs, $this->_includeDirs); + } + + foreach ($dirs as $dir) { + // error_log($dir . $file); + if ($this->includeFile($dir . $file)) { + break; + } + } + /* + if (!empty($dirs)) { + // use the autodiscovered path + $dirPath = dirname($file); + if (is_string($dirs)) { + $dirs = explode(PATH_SEPARATOR, $dirs); + } + foreach ($dirs as $key => $dir) { + if ($dir == '.') { + $dirs[$key] = $dirPath; + } else { + $dir = rtrim($dir, '\\/'); + $dirs[$key] = $dir . DIRECTORY_SEPARATOR . $dirPath; + } + } + $file = basename($file); + self::loadFile($file, $dirs, true); + } else { + self::loadFile($file, null, true); + } // */ + + if (!class_exists($class, false) && !interface_exists($class, false)) { + require_once 'Zend/Exception.php'; + throw new Zend_Exception("File \"$file\" does not exist or class \"$class\" was not found in the file"); + } + } } Modified: trunk/library/classes/MUtil/Registry/Source.php =================================================================== --- trunk/library/classes/MUtil/Registry/Source.php 2013-01-03 17:23:59 UTC (rev 1087) +++ trunk/library/classes/MUtil/Registry/Source.php 2013-01-04 16:20:22 UTC (rev 1088) @@ -144,13 +144,12 @@ } // */ } } - if ($target->checkRegistryRequestsAnswers()) { - $target->afterRegistry(); - return true; - } else { - return false; - } + $result = $target->checkRegistryRequestsAnswers(); + + $target->afterRegistry(); + + return $result; } /** Modified: trunk/library/snippets/AddTracksSnippet.php =================================================================== --- trunk/library/snippets/AddTracksSnippet.php 2013-01-03 17:23:59 UTC (rev 1087) +++ trunk/library/snippets/AddTracksSnippet.php 2013-01-04 16:20:22 UTC (rev 1088) @@ -219,13 +219,15 @@ } /** - * Should be called after answering the request to allow the Target - * to check if all required registry values have been set correctly. + * Called after the check that all required registry values + * have been set correctly has run. * - * @return boolean False if required are missing. + * @return void */ - public function checkRegistryRequestsAnswers() + public function afterRegistry() { + parent::afterRegistry(); + if ($this->showForRespondents && is_bool($this->showForRespondents)) { $this->showForRespondents = $this->_('by Respondents'); } @@ -238,8 +240,6 @@ if ($this->showTitle && is_bool($this->showTitle)) { $this->showTitle = $this->_('Add'); } - - return parent::checkRegistryRequestsAnswers(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-01-09 17:31:00
|
Revision: 1091 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1091&view=rev Author: matijsdejong Date: 2013-01-09 17:30:52 +0000 (Wed, 09 Jan 2013) Log Message: ----------- Made Renderer and Echo __PHP_Incomplete_Class proof Added documentation and disableOnLoad to ModelAbstract Switched ZFDebug to jQuery 1.8.3 Made CachedLoader that does not seem to speed things up Prepared switch to using pluginloader for LoaderAbstract and removing $GEMS_DIR from pre_bootstrap.php Modified Paths: -------------- trunk/library/classes/Gems/Loader/LoaderAbstract.php trunk/library/classes/GemsEscort.php trunk/library/classes/MUtil/Echo.php trunk/library/classes/MUtil/Html/Renderer.php trunk/library/classes/MUtil/Loader/CachedLoader.php trunk/library/classes/MUtil/Model/ModelAbstract.php trunk/library/classes/ZFDebug/Controller/Plugin/Debug.php trunk/library/pre_bootstrap.php Modified: trunk/library/classes/Gems/Loader/LoaderAbstract.php =================================================================== --- trunk/library/classes/Gems/Loader/LoaderAbstract.php 2013-01-07 16:04:05 UTC (rev 1090) +++ trunk/library/classes/Gems/Loader/LoaderAbstract.php 2013-01-09 17:30:52 UTC (rev 1091) @@ -85,7 +85,7 @@ /** * - * @var MUtil_Loader_CachedLoader + * @var Zend_Loader_PluginLoader_Interface */ private $_loader; @@ -107,16 +107,24 @@ $this->_dirs = $dirs; - // Set the directories to the used cascade pattern if ($this->cascade) { foreach ($dirs as $prefix => $path) { $newdirs[$prefix . '_' . $this->cascade] = $path; + // $newdirs[$prefix . '_' . $this->cascade] = $path . '/' . str_replace('_', '/', $this->cascade); } $this->_dirs = $newdirs; } - $this->_loader = MUtil_Loader_CachedLoader::getInstance(); + //$this->_loader = new Zend_Loader_PluginLoader($this->_dirs); + //* + // Set the directories to the used cascade pattern + $this->_loader = new Zend_Loader_PluginLoader(); + foreach (array_reverse($this->_dirs) as $prefix => $path) { + $this->_loader->addPrefixPath($prefix, $path . '/' . str_replace('_', '/', $prefix)); + } + // */ + if (MUtil_Registry_Source::$verbose) { MUtil_Echo::r($this->_dirs, '$this->_dirs in ' . get_class($this) . '->' . __FUNCTION__ . '():'); } @@ -166,6 +174,55 @@ */ protected function _loadClass($name, $create = false, array $arguments = array()) { + /* + $className = $this->_loader->load($name); + + // MUtil_Echo::track($className); + + if (is_subclass_of($className, __CLASS__)) { + $create = true; + // error_log($className); + $arguments = array($this->_containers[0], $this->_dirs); + + } elseif (is_subclass_of($className, 'MUtil_Registry_TargetInterface')) { + $create = true; + } + + if ($create) { + switch (count($arguments)) { + case 0: + $obj = new $className(); + break; + + case 1: + $obj = new $className($arguments[0]); + break; + + case 2: + $obj = new $className($arguments[0], $arguments[1]); + break; + + case 3: + $obj = new $className($arguments[0], $arguments[1], $arguments[2]); + break; + + default: + throw new Gems_Exception_Coding(__CLASS__ . '->' . __FUNCTION__ . ' cannot create class with ' . count($arguments) . ' parameters.'); + } + } else { + $obj = new MUtil_Lazy_StaticCall($className); + } + + if ($obj instanceof MUtil_Registry_TargetInterface) { + // error_log(get_class($obj)); + if ((! $this->applySource($obj)) && parent::$verbose) { + MUtil_Echo::track("Source apply to object of type $name failed."); + } + } + + return $obj; + // */ + // echo $name . ($create ? ' create' : ' not created') . "<br/>\n"; $cname = trim(str_replace('/', '_', ucfirst($name)), '_'); @@ -194,7 +251,7 @@ $paths = array($paths); } foreach ($paths as $path) { - //* + /* $className = $prefix . $cname; if ($this->_loader->loadClass($className, $path . $fprefix . '/' . $cfile)) { @@ -218,8 +275,9 @@ break 2; } // */ - /* + //* if ($obj = $this->_loadClassPath($path . $fprefix . '/' . $cfile, $prefix . $cname, $create, $arguments)) { + MUtil_Echo::track($prefix . $cname); $found = true; $this->_loaded[$cname] = get_class($obj); break 2; Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2013-01-07 16:04:05 UTC (rev 1090) +++ trunk/library/classes/GemsEscort.php 2013-01-09 17:30:52 UTC (rev 1091) @@ -95,10 +95,6 @@ { parent::__construct($application); - $autoloader = Zend_Loader_Autoloader::getInstance(); - $cachedloader = MUtil_Loader_CachedLoader::getInstance(GEMS_ROOT_DIR . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'cache'); - $autoloader->setDefaultAutoloader(array($cachedloader, 'loadClassByPaths')); - self::$_instanceOfSelf = $this; $firebug = $application->getOption('firebug'); @@ -315,6 +311,23 @@ protected function _initLoader() { global $GEMS_DIRS; + + /* + $dirs = $this->getOption('loaderDirs'); + + if (! $dirs) { + + $dirs = array(); + + foreach ($GEMS_DIRS as $prefix => $dir) { + $dirs[$prefix] = $dir . '/' . str_replace('_', '/', $prefix); + } + } + + MUtil_Echo::track($dirs); + + return $this->createProjectClass('Loader', $this->getContainer(), array_reverse($dirs)); + // */ return $this->createProjectClass('Loader', $this->getContainer(), $GEMS_DIRS); } @@ -555,7 +568,8 @@ 'Memory', 'Time', 'Registry', - 'Exception') + 'Exception'), + // 'jquery_path' => not yet initialized ); # Instantiate the database adapter and setup the plugin. Modified: trunk/library/classes/MUtil/Echo.php =================================================================== --- trunk/library/classes/MUtil/Echo.php 2013-01-07 16:04:05 UTC (rev 1090) +++ trunk/library/classes/MUtil/Echo.php 2013-01-09 17:30:52 UTC (rev 1091) @@ -154,7 +154,7 @@ { $session = self::getSession(); - if (is_array($var) || is_object($var)) { + if (is_array($var) || is_object($var) || ($var instanceof __PHP_Incomplete_Class)) { ob_start(); var_dump($var); $content = ob_get_clean(); Modified: trunk/library/classes/MUtil/Html/Renderer.php =================================================================== --- trunk/library/classes/MUtil/Html/Renderer.php 2013-01-07 16:04:05 UTC (rev 1090) +++ trunk/library/classes/MUtil/Html/Renderer.php 2013-01-09 17:30:52 UTC (rev 1091) @@ -196,6 +196,11 @@ // $new_content = 'WARNING: Object of type ' . get_class($content) . ' cannot be converted to string.'; throw new MUtil_Html_HtmlException('WARNING: Object of type ' . get_class($content) . ' cannot be converted to string.'); } + + } elseif ($content instanceof __PHP_Incomplete_Class) { + MUtil_Echo::track($content); + return ''; + } else { $new_content = (string) $content; } Modified: trunk/library/classes/MUtil/Loader/CachedLoader.php =================================================================== --- trunk/library/classes/MUtil/Loader/CachedLoader.php 2013-01-07 16:04:05 UTC (rev 1090) +++ trunk/library/classes/MUtil/Loader/CachedLoader.php 2013-01-09 17:30:52 UTC (rev 1091) @@ -50,26 +50,45 @@ * * @var array */ - protected $_cacheArray = array(); + private $_cacheClassArray = array(); /** * + * @var array + */ + // private $_cacheFileArray = array(); + + /** + * + * @var boolean + */ + private $_cacheChanged = false; + + /** + * Unix timestamp cahce file load time + * + * @var int + */ + private $_cacheLoadTime; + + /** + * * @var string */ - protected $_cacheDir = null; + private $_cacheDir = null; /** * * @var string */ - protected $_cacheFile = 'cached.loader.mutil.php'; + private $_cacheFile = 'cached.loader.mutil.php'; /** * An array containg include dir pathNames * * @var array */ - protected $_includeDirs; + private $_includeDirs; /** * @@ -93,7 +112,10 @@ } if (! file_exists($this->_cacheFile)) { - $this->_saveCache(); + $this->_cacheChanged = true; + $this->_cacheLoadTime = 0; + + // $this->_saveCache(); } else { if (! is_writable($this->_cacheFile)) { throw new Zend_Exception(sprintf('Cache file %s not writeable.', $this->_cacheFile)); @@ -107,6 +129,14 @@ } /** + * Make sure the changes ot the cache are saved. + */ + public function __destruct() + { + $this->_saveCache(); + } + + /** * Check for file existence and append status to the cache * * @param mixed $file String path to file or false if does not exist @@ -114,25 +144,18 @@ */ protected function _checkFile($file) { - if (array_key_exists($file, $this->_cacheArray)) { - return $this->_cacheArray[$file]; + return file_exists($file); + /* + if (array_key_exists($file, $this->_cacheFileArray)) { + return $this->_cacheFileArray[$file]; } // MUtil_Echo::track($file); - $this->_cacheArray[$file] = file_exists($file); + $this->_cacheFileArray[$file] = file_exists($file); + $this->_cacheChanged = true; - if (! file_exists($this->_cacheFile)) { - $this->_saveCache(); - } else { - if (false === $this->_cacheArray[$file]) { - $content = "\$this->_cacheArray['$file'] = false;\n"; - } else { - $content = "\$this->_cacheArray['$file'] = true;\n"; - } - file_put_contents($this->_cacheFile, $content, FILE_APPEND | LOCK_EX ); - } - - return $this->_cacheArray[$file]; + return $this->_cacheFileArray[$file]; + // */ } /** @@ -142,10 +165,16 @@ { include $this->_cacheFile; - // Include path has changed - if (!isset($include) || (get_include_path() != $include)) { - $this->_cacheArray = array(); + // if (isset($cacheArray, $fileArray, $include) && (get_include_path() != $include)) { + if (isset($cacheArray, $include) && (get_include_path() != $include)) { + $this->_cacheClassArray = $classArray; + // $this->_cacheFileArray = $fileArray; + $this->_cacheLoadTime = filemtime($this->_cacheFile); } + + $this->_cacheClassArray = array(); + // $this->_cacheFileArray = array(); + $this->_cacheChanged = true; } /** @@ -164,20 +193,50 @@ } /** - * Save the cache to file + * Save the cache to file (if changed) */ protected function _saveCache() { - $content = "<?php\n\n"; - $content .= "\$include = '" . get_include_path() . "';\n\n"; + // MUtil_Echo::track(filemtime($this->_cacheFile), $this->_cacheLoadTime, $this->_cacheChanged); + if (file_exists($this->_cacheFile)) { + if ((! $this->_cacheChanged) && (filemtime($this->_cacheFile) >= $this->_cacheLoadTime)) { + return; + } + } + /* + MUtil_Echo::r('Saving load cache (from previous call)'); - foreach ($this->_cacheArray as $file => $exists) { - if (false === $file) { - $content .= "\$this->_cacheArray['$file'] = false;\n"; + include $this->_cacheFile; + + MUtil_Echo::r(array_diff(array_keys($this->_cacheClassArray), array_keys($classArray))); + // */ + + $content = "<?php\n"; + $content .= "\$include = '" . get_include_path() . "';\n"; + + ksort($this->_cacheClassArray); + + $content .= "\$classArray = array(\n"; + foreach ($this->_cacheClassArray as $class => $file) { + $content .= "'$class' => '$file',\n"; + } + $content .= ");\n"; + + /* + ksort($this->_cacheFileArray); + + $content .= "\$fileArray = array(\n"; + + foreach ($this->_cacheFileArray as $file => $exists) { + if (false === $exists) { + $content .= "'$file' => false,\n"; } else { - $content .= "\$this->_cacheArray['$file'] = true;\n"; + $content .= "'$file' => true,\n"; } } + $content .= ");"; + // */ + file_put_contents($this->_cacheFile, $content, LOCK_EX); } @@ -269,6 +328,10 @@ if (! $instance) { $instance = new self($dir); + + if (is_subclass_of('Zend_Loader', 'MUtil_Loader_LoaderMarkerInterface')) { + Zend_Loader::setCachedLoader($instance); + } } return $instance;; @@ -281,7 +344,7 @@ */ public function includeFile($file) { - if ($this->_checkFile($file)) { + if (file_exists($file)) { $result = include $file; return $result ? $result : true; @@ -299,18 +362,35 @@ */ public function loadClass($className, $file) { + if (isset($this->_cacheClassArray[$className])) { + if ($this->_cacheClassArray[$className]) { + $this->includeFile($this->_cacheClassArray[$className]); + + return true; + } else { + // return false; + } + } + if (class_exists($className, false) || interface_exists($className, false)) { return true; } if ($this->includeFile($file)) { if (class_exists($className, false) || interface_exists($className, false)) { + $this->_cacheClassArray[$className] = $file; + $this->_cacheChanged = true; return true; } throw new Zend_Exception("The file '$file' does not contain the class '$class'."); } + if (! isset($this->_cacheClassArray[$className])) { + $this->_cacheClassArray[$className] = ''; + $this->_cacheChanged = true; + } + return false; } @@ -355,38 +435,26 @@ } $file .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; - if (null === $dirs) { - $dirs = $this->_includeDirs; + if (isset($this->_cacheClassArray[$class])) { + if ($this->_cacheClassArray[$class]) { + $this->includeFile($this->_cacheClassArray[$class]); + } } else { - $dirs = array_merge($dirs, $this->_includeDirs); - } + if (null === $dirs) { + $dirs = $this->_includeDirs; + } else { + $dirs = array_merge($dirs, $this->_includeDirs); + } - foreach ($dirs as $dir) { - // error_log($dir . $file); - if ($this->includeFile($dir . $file)) { - break; + foreach ($dirs as $dir) { + // error_log($dir . $file); + if ($this->includeFile($dir . $file)) { + $this->_cacheClassArray[$class] = $dir . $file; + $this->_cacheChanged = true; + break; + } } } - /* - if (!empty($dirs)) { - // use the autodiscovered path - $dirPath = dirname($file); - if (is_string($dirs)) { - $dirs = explode(PATH_SEPARATOR, $dirs); - } - foreach ($dirs as $key => $dir) { - if ($dir == '.') { - $dirs[$key] = $dirPath; - } else { - $dir = rtrim($dir, '\\/'); - $dirs[$key] = $dir . DIRECTORY_SEPARATOR . $dirPath; - } - } - $file = basename($file); - self::loadFile($file, $dirs, true); - } else { - self::loadFile($file, null, true); - } // */ if (!class_exists($class, false) && !interface_exists($class, false)) { require_once 'Zend/Exception.php'; Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-01-07 16:04:05 UTC (rev 1090) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-01-09 17:30:52 UTC (rev 1091) @@ -390,6 +390,13 @@ return $this; } + /** + * Delete all, one or some values for a certain field name. + * + * @param string $name Field name + * @param string|array|null $arrayOrKey1 Null or the name of a single attribute or an array of attribute names + * @param string $key2 Optional a second attribute name. + */ public function del($name, $arrayOrKey1 = null, $key2 = null) { if (func_num_args() == 1) { @@ -406,6 +413,18 @@ } /** + * Disable tyhe onload settings. This is sometimes needed for speed/ + * + * @return MUtil_Model_ModelAbstract (continuation pattern) + */ + public function disableOnLoad() + { + $this->setMeta(self::LOAD_TRANSFORMER, false); + + return $this; + } + + /** * Delete items from the model * * @param mixed $filter True to use the stored filter, array to specify a different filter Modified: trunk/library/classes/ZFDebug/Controller/Plugin/Debug.php =================================================================== --- trunk/library/classes/ZFDebug/Controller/Plugin/Debug.php 2013-01-07 16:04:05 UTC (rev 1090) +++ trunk/library/classes/ZFDebug/Controller/Plugin/Debug.php 2013-01-09 17:30:52 UTC (rev 1091) @@ -3,7 +3,7 @@ /** * Copyright (c) 2011, Erasmus MC * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -14,7 +14,7 @@ * * Neither the name of Erasmus MC nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -65,10 +65,10 @@ 'Time' => null, 'Memory' => null), 'z-index' => 255, - 'jquery_path' => 'https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', + 'jquery_path' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', 'image_path' => null ); - + /** * Standard plugins * @@ -107,7 +107,7 @@ $this->setOptions($options); } - + /** * Creating ZF Version Tab always shown */ @@ -122,7 +122,7 @@ */ $this->_loadPlugins(); } - + /** * Sets options of the Debug Bar * @@ -142,7 +142,7 @@ if (isset($options['image_path'])) { $this->_options['image_path'] = $options['image_path']; } - + if (isset($options['plugins'])) { $this->_options['plugins'] = $options['plugins']; } @@ -183,7 +183,7 @@ } return $this; } - + /** * Get a registered plugin in the Debug Bar * @@ -198,7 +198,7 @@ } return false; } - + /** * Defined by Zend_Controller_Plugin_Abstract */ @@ -440,7 +440,7 @@ jQuery.noConflict(); ZFDebugCollapsed(); }; - + function ZFDebugCollapsed() { if ('.$collapsed.' == 1) { ZFDebugPanel(); @@ -448,7 +448,7 @@ return jQuery("#ZFDebug_debug").css("left", "-"+parseInt(jQuery("#ZFDebug_debug").outerWidth()-jQuery("#ZFDebug_toggler").outerWidth()+1)+"px"); } } - + function ZFDebugPanel(name) { jQuery(".ZFDebug_panel").each(function(i){ if(jQuery(this).css("display") == "block") { Modified: trunk/library/pre_bootstrap.php =================================================================== --- trunk/library/pre_bootstrap.php 2013-01-07 16:04:05 UTC (rev 1090) +++ trunk/library/pre_bootstrap.php 2013-01-09 17:30:52 UTC (rev 1091) @@ -67,21 +67,24 @@ 'Gems' => GEMS_LIBRARY_DIR . '/classes' ); -// Zend_Application: loads the autoloader -require_once 'Zend/Application.php'; +// Set up autoload +require_once 'Zend/Loader/AutoLoader.php'; +$autoloader = Zend_Loader_Autoloader::getInstance(); +$autoloader->registerNamespace('MUtil_'); +$autoloader->registerNamespace('Gems_'); +$autoloader->registerNamespace(GEMS_PROJECT_NAME_UC . '_'); +// Start using cached Loader +// require_once 'MUtil/Loader/CachedLoader.php'; +// $cachedloader = MUtil_Loader_CachedLoader::getInstance(GEMS_ROOT_DIR . '\var\cache'); +// $autoloader->setDefaultAutoloader(array($cachedloader, 'loadClassByPaths')); + // Create application, bootstrap, and run $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); -// Set up autoload (included by Zend_Application). -$autoloader = Zend_Loader_Autoloader::getInstance(); -$autoloader->registerNamespace('MUtil_'); -$autoloader->registerNamespace('Gems_'); -$autoloader->registerNamespace(GEMS_PROJECT_NAME_UC . '_'); - // MUtil_Model::$verbose = true; $application->bootstrap() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-01-16 18:46:23
|
Revision: 1108 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1108&view=rev Author: matijsdejong Date: 2013-01-16 18:46:11 +0000 (Wed, 16 Jan 2013) Log Message: ----------- SelectModel now has some minimal intelligence as to contents New Summary controller for tracks Modified Paths: -------------- trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php trunk/library/classes/MUtil/Model/ModelAbstract.php trunk/library/classes/MUtil/Model/SelectModel.php trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php trunk/library/configs/db/patches.sql trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Added Paths: ----------- trunk/library/classes/Gems/Default/SummaryAction.php trunk/library/classes/Gems/Snippets/Tracker/Summary/ trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php trunk/library/classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php trunk/library/controllers/SummaryController.php Copied: trunk/library/classes/Gems/Default/SummaryAction.php (from rev 1107, trunk/library/classes/Gems/Default/ComplianceAction.php) =================================================================== --- trunk/library/classes/Gems/Default/SummaryAction.php (rev 0) +++ trunk/library/classes/Gems/Default/SummaryAction.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -0,0 +1,192 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: ComplianceAction.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.6 + */ +class Gems_Default_SummaryAction extends Gems_Controller_ModelSnippetActionAbstract +{ + /** + * The parameters used for the autofilter action. + * + * When the value is a function name of that object, then that functions is executed + * with the array key as single parameter and the return value is set as the used value + * - unless the key is an integer in which case the code is executed but the return value + * is not stored. + * + * @var array Mixed key => value array for snippet initialization + */ + protected $autofilterParameters = array('browse' => false); + + /** + * The snippets used for the autofilter action. + * + * @var mixed String or array of snippets name + */ + protected $autofilterSnippets = 'Tracker_Summary_SummaryTableSnippet'; + + /** + * + * @var Zend_Db_Adapter_Abstract + */ + public $db; + + /** + * The snippets used for the index action, before those in autofilter + * + * @var mixed String or array of snippets name + */ + protected $indexStartSnippets = array('Generic_ContentTitleSnippet', 'Tracker_Summary_SummarySearchFormSnippet'); + + /** + * 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 + * parameter was added, because the most common use of action is a split between detailed + * and summarized actions. + * + * @param boolean $detailed True when the current action is not in $summarizedActions. + * @param string $action The current action. + * @return MUtil_Model_ModelAbstract + */ + public function createModel($detailed, $action) + { + $select = $this->db->select(); + + $fields['answered'] = new Zend_Db_Expr("SUM( + CASE + WHEN grc_success = 1 AND gto_completion_time IS NOT NULL + THEN 1 ELSE 0 END + )"); + $fields['missed'] = new Zend_Db_Expr('SUM( + CASE + WHEN grc_success = 1 AND gto_completion_time IS NULL AND gto_valid_until < CURRENT_TIMESTAMP + THEN 1 ELSE 0 END + )'); + $fields['open'] = new Zend_Db_Expr('SUM( + CASE + WHEN grc_success = 1 AND gto_completion_time IS NULL AND + gto_valid_from <= CURRENT_TIMESTAMP AND + (gto_valid_until >= CURRENT_TIMESTAMP OR gto_valid_until IS NULL) + THEN 1 ELSE 0 END + )'); + $fields['future'] = new Zend_Db_Expr('SUM( + CASE + WHEN grc_success = 1 AND gto_completion_time IS NULL AND gto_valid_from > CURRENT_TIMESTAMP + THEN 1 ELSE 0 END + )'); + $fields['unknown'] = new Zend_Db_Expr('SUM( + CASE + WHEN grc_success = 1 AND gto_completion_time IS NULL AND gto_valid_from IS NULL + THEN 1 ELSE 0 END + )'); + $fields['is'] = new Zend_Db_Expr("'='"); + $fields['success'] = new Zend_Db_Expr('SUM( + CASE + WHEN grc_success = 1 + THEN 1 ELSE 0 END + )'); + $fields['removed'] = new Zend_Db_Expr('SUM( + CASE + WHEN grc_success = 0 + THEN 1 ELSE 0 END + )'); + + $select = $this->db->select(); + $select->from('gems__tokens', $fields) + ->joinInner('gems__reception_codes', 'gto_reception_code = grc_id_reception_code', array()) + ->joinInner('gems__rounds', 'gto_id_round = gro_id_round', + array('gro_round_description', 'gro_id_survey')) + ->joinInner('gems__surveys', 'gro_id_survey = gsu_id_survey', + array('gsu_survey_name', 'gsu_id_primary_group')) + ->group(array('gro_round_description', 'gro_id_order', 'gsu_survey_name', 'gsu_id_primary_group')) + ->order('gto_round_order'); + + // MUtil_Model::$verbose = true; + $model = new MUtil_Model_SelectModel($select, 'summary'); + + // Make sure of filter for these fields + $model->set('gto_id_track'); + $model->set('gto_id_organization'); + $model->set('gsu_id_primary_group'); + + $model->resetOrder(); + $model->set('gro_round_description', 'label', $this->_('Round')); + $model->set('gsu_survey_name', 'label', $this->_('Survey')); + $model->set('gsu_id_primary_group', 'label', $this->_('Filler'), + 'multiOptions', $this->util->getDbLookup()->getGroups()); + + $model->set('answered', 'label', $this->_('Answered'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('missed', 'label', $this->_('Missed'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('open', 'label', $this->_('Open'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('future', 'label', $this->_('Future'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('unknown', 'label', $this->_('Unknown'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + // $model->set('is', 'label', ' ', 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('success', 'label', $this->_('Success'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('removed', 'label', $this->_('Removed'), 'tdClass', 'deleted centerAlign', + 'thClass', 'centerAlign'); + + return $model; + } + + /** + * Helper function to get the title for the index action. + * + * @return $string + */ + public function getIndexTitle() + { + return $this->_('Summary'); + } + + /** + * Helper function to allow generalized statements about the items in the model. + * + * @param int $count + * @return $string + */ + public function getTopic($count = 1) + { + return $this->plural('token', 'tokens', $count); + } +} Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2013-01-16 12:56:22 UTC (rev 1107) +++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -322,8 +322,10 @@ { $infoPage = $this->addContainer($label); - $infoPage->addPage($this->_('Compliance'), 'pr.plan.compliance', 'compliance', 'index') + $infoPage->addPage($this->_('Track Summary'), 'pr.plan.summary', 'summary', 'index') ->addAutofilterAction(); + $infoPage->addPage($this->_('Track Compliance'), 'pr.plan.compliance', 'compliance', 'index') + ->addAutofilterAction(); $plans[] = $infoPage->addPage($this->_('By period'), 'pr.plan.overview', 'overview-plan', 'index'); $plans[] = $infoPage->addPage($this->_('By token'), 'pr.plan.token', 'token-plan', 'index'); Modified: trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php 2013-01-16 12:56:22 UTC (rev 1107) +++ trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -44,7 +44,7 @@ * @license New BSD License * @since Class available since version 1.5 */ -class Gems_Snippets_Tracker_Compliance_ComplianceSearchFormSnippet extends Gems_Snippets_AutosearchFormSnippet +class Gems_Snippets_Tracker_Compliance_ComplianceSearchFormSnippet extends Gems_Snippets_AutosearchFormSnippet { /** * Returns a text element for autosearch. Can be overruled. @@ -61,7 +61,7 @@ $this->util->getTrackData()->getAllTracks(), $this->_('(select a track)')); - $elements[] = $this->_createSelectElement('gr2o_id_organization', + $elements[] = $this->_createSelectElement('gr2t_id_organization', $this->util->getDbLookup()->getOrganizationsWithRespondents(), $this->_('(all organizations)')); Modified: trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php 2013-01-16 12:56:22 UTC (rev 1107) +++ trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -93,8 +93,6 @@ END "); - // $labels = $model->getCol('label'); - $select = $this->db->select(); $select->from('gems__tokens', array('gto_id_respondent_track', 'gto_id_round', 'status' => $status)) ->joinInner('gems__reception_codes', 'gto_reception_code = grc_id_reception_code', array()) @@ -107,10 +105,6 @@ $newModel = new MUtil_Model_SelectModel($select, 'tok'); $newModel->setKeys(array('gto_id_respondent_track')); - // $model->addLeftTable('gems__tokens', array('gr2t_id_track' => 'gto_id_track')); - // $model->addLeftTable('gems__reception_codes', array('gto_reception_code' => 'grc_id_reception_code')); - // $model->addFilter(array('grc_success' => 1)); - // $newModel = $model; $transformer = new MUtil_Model_Transform_CrossTabTransformer(); $transformer->setCrosstabFields('gto_id_round', 'status'); @@ -118,7 +112,6 @@ foreach ($data as $row) { $name = 'col_' . $row['gro_id_round']; $transformer->set($name, 'label', $row['gro_id_order'], 'description', $row['gro_round_description']); - // break; } $newModel->addTransformer($transformer); @@ -132,8 +125,6 @@ $model->set('gr2t_start_date'); $model->addTransformer($joinTrans); return $model; - - return $newModel; } /** Copied: trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php (from rev 1107, trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php) =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php (rev 0) +++ trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -0,0 +1,84 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: ComplianceSearchFormSnippet.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Snippets_Tracker_Summary_SummarySearchFormSnippet extends Gems_Snippets_AutosearchFormSnippet +{ + /** + * Returns a text element for autosearch. Can be overruled. + * + * The form / html elements to search on. Elements can be grouped by inserting null's between them. + * That creates a distinct group of elements + * + * @param array $data The $form field values (can be usefull, but no need to set them) + * @return array Of Zend_Form_Element's or static tekst to add to the html or null for group breaks. + */ + protected function getAutoSearchElements(array $data) + { + $elements[] = $this->_createSelectElement('gto_id_track', + $this->util->getTrackData()->getAllTracks(), + $this->_('(select a track)')); + + $elements[] = $this->_createSelectElement('gto_id_organization', + $this->util->getDbLookup()->getOrganizationsWithRespondents(), + $this->_('(all organizations)')); + + $elements[] = null; + + $sql = "SELECT DISTINCT ggp_id_group, ggp_name + FROM gems__groups INNER JOIN gems__surveys ON ggp_id_group = gsu_id_primary_group + INNER JOIN gems__rounds ON gsu_id_survey = gro_id_survey + INNER JOIN gems__tracks ON gro_id_track = gtr_id_track + WHERE ggp_group_active = 1 AND + gro_active=1 AND + gtr_active=1 AND + gtr_track_type='T' + ORDER BY ggp_name"; + $elements[] = $this->_createSelectElement('gsu_id_primary_group', $sql, $this->_('(all fillers)')); + + return $elements; + } + +} Copied: trunk/library/classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php (from rev 1107, trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php) =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php (rev 0) +++ trunk/library/classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -0,0 +1,127 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: ComplianceTableSnippet.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_Snippets_Tracker_Summary_SummaryTableSnippet extends Gems_Snippets_ModelTableSnippetGeneric +{ + /** + * When true (= default) the headers get sortable links. + * + * @var boolean + */ + public $sortableLinks = false; + + /** + * Adds columns from the model to the bridge that creates the browse table. + * + * Overrule this function to add different columns to the browse table, without + * having to recode the core table building code. + * + * @param MUtil_Model_TableBridge $bridge + * @param MUtil_Model_ModelAbstract $model + * @return void + */ + protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) + { + $bridge->getTable()->setAlternateRowClass('odd', 'odd', 'even', 'even'); + + $bridge->add('gro_round_description'); + $bridge->add('answered'); + $bridge->add('missed'); + $bridge->add('open'); + $bridge->add('future'); + $bridge->add('unknown'); + $bridge->addColumn(array('=', 'class' => 'centerAlign')); + $bridge->add('success'); + $bridge->tr(); + // $bridge->add('gsu_survey_name')->colspan = 4; + // $bridge->add('gsu_id_primary_group')->colspan = 2; + // $bridge->addColumn(); + $bridge->addColumn( + array( + $bridge->gsu_survey_name, + MUtil_Html::create('em', ' - ', $bridge->gsu_id_primary_group) + ), + array( + $model->get('gsu_survey_name', 'label'), + MUtil_Html::create('em', ' - ', $model->get('gsu_id_primary_group', 'label')) + ) + )->colspan = 7; + $bridge->add('removed'); + } + + /** + * + * @return int Return the track id if any or null + */ + public function getTrackId() + { + if ($this->requestCache) { + $data = $this->requestCache->getProgramParams(); + if (isset($data['gto_id_track'])) { + return $data['gto_id_track']; + } + } else { + return $this->request->getParam('gto_id_track'); + } + } + + /** + * Overrule to implement snippet specific filtering and sorting. + * + * @param MUtil_Model_ModelAbstract $model + */ + protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) + { + $trackId = $this->getTrackId(); + + if ($trackId) { + parent::processFilterAndSort($model); + } else { + $model->setFilter(array('1=0')); + $this->onEmpty = $this->_('No track selected...'); + } + } +} Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-01-16 12:56:22 UTC (rev 1107) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -937,7 +937,7 @@ public function has($name, $subkey = null) { if (null === $subkey) { - return isset($this->_model[$name]); + return array_key_exists($name, $this->_model); } else { return isset($this->_model[$name][$subkey]); } @@ -1258,27 +1258,32 @@ $args = func_get_args(); $args = MUtil_Ra::pairs($args, 1); - foreach ($args as $key => $value) { - // If $key end with ] it is array value - if (substr($key, -1) == ']') { - if (substr($key, -2) == '[]') { - // If $key ends with [], append it to array - $key = substr($key, 0, -2); - $this->_model[$name][$key][] = $value; + if ($args) { + foreach ($args as $key => $value) { + // If $key end with ] it is array value + if (substr($key, -1) == ']') { + if (substr($key, -2) == '[]') { + // If $key ends with [], append it to array + $key = substr($key, 0, -2); + $this->_model[$name][$key][] = $value; + } else { + // Otherwise extract subkey + $pos = strpos($key, '['); + $subkey = substr($key, $pos + 1, -1); + $key = substr($key, 0, $pos); + + $this->_model[$name][$key][$subkey] = $value; + } } else { - // Otherwise extract subkey - $pos = strpos($key, '['); - $subkey = substr($key, $pos + 1, -1); - $key = substr($key, 0, $pos); - - $this->_model[$name][$key][$subkey] = $value; + $this->_model[$name][$key] = $value; } - } else { - $this->_model[$name][$key] = $value; } + } elseif (!array_key_exists($name, $this->_model)) { + // Make sure this key occurs + $this->_model[$name] = array(); } - //Now set the order (repeat always, because order can be changed later on) + // Now set the order (repeat always, because order can be changed later on) if (isset($this->_model[$name]['order'])) { $order = $this->_model[$name]['order']; } elseif (isset($this->_model_order[$name]) && is_int($this->_model_order[$name])) { Modified: trunk/library/classes/MUtil/Model/SelectModel.php =================================================================== --- trunk/library/classes/MUtil/Model/SelectModel.php 2013-01-16 12:56:22 UTC (rev 1107) +++ trunk/library/classes/MUtil/Model/SelectModel.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -1,39 +1,48 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - + /** - * @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 Model + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ + +/** + * A model that takes any Zend_Db_Select statement as a source + * + * @package MUtil + * @subpackage Model + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 + */ class MUtil_Model_SelectModel extends MUtil_Model_DatabaseModelAbstract { /** @@ -45,12 +54,30 @@ */ public $canCreate = false; + /** + * + * @var Zend_Db_Select + */ private $_select; + /** + * + * @param Zend_Db_Select $select + * @param string $name Optiona name + */ public function __construct(Zend_Db_Select $select, $name = null) { $this->_select = $select; + // Make sure the columns are known to the model + foreach ($select->getPart(Zend_Db_Select::COLUMNS) as $column) { + if (isset($column[2])) { + $this->set($column[2]); + } elseif (is_string($column[1])) { + $this->set($column[1]); + } + } + if (null === $name) { $name = 'rnd' . rand(10000, 999999); } @@ -58,21 +85,45 @@ parent::__construct($name); } + /** + * Delete items from the model + * + * @param mixed $filter True to use the stored filter, array to specify a different filter + * @return int The number of items deleted + */ public function delete($filter = true) { throw new Exception('Cannot delete ' . __CLASS__ . ' data.'); } + /** + * The database adapter used by the model. + * + * @return Zend_Db_Adapter_Abstract + */ public function getAdapter() { return $this->_select->getAdapter(); } + /** + * The select object where we get the query from. + * + * @return Zend_Db_Table_Select + */ public function getSelect() { return clone $this->_select; } + /** + * Save a single model item. + * + * @param array $newValues The values to store for a single model item. + * @param array $filter If the filter contains old key values these are used + * to decide on update versus insert. + * @return array The values as they are after saving (they may change). + */ public function save(array $newValues, array $filter = null) { throw new Exception('Cannot save ' . __CLASS__ . ' data.'); Modified: trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php =================================================================== --- trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php 2013-01-16 12:56:22 UTC (rev 1107) +++ trunk/library/classes/MUtil/Snippets/ModelTableSnippetAbstract.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -121,7 +121,7 @@ } else { foreach($model->getItemsOrdered() as $name) { if ($label = $model->get($name, 'label')) { - $bridge->addColumn($bridge->$name, $label); + $bridge->add($name, $label); } } } Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2013-01-16 12:56:22 UTC (rev 1107) +++ trunk/library/configs/db/patches.sql 2013-01-16 18:46:11 UTC (rev 1108) @@ -465,3 +465,5 @@ UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.plan.compliance') WHERE grl_privileges LIKE '%pr.plan.%' AND grl_privileges NOT LIKE '%pr.plan.compliance%'; +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.plan.summary') + WHERE grl_privileges LIKE '%pr.plan.%' AND grl_privileges NOT LIKE '%pr.plan.summary%'; Copied: trunk/library/controllers/SummaryController.php (from rev 1107, trunk/library/controllers/ComplianceController.php) =================================================================== --- trunk/library/controllers/SummaryController.php (rev 0) +++ trunk/library/controllers/SummaryController.php 2013-01-16 18:46:11 UTC (rev 1108) @@ -0,0 +1,50 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Default + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: ComplianceController.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * + * + * @package Gems + * @subpackage Default + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.6 + */ +class SummaryController extends Gems_Default_SummaryAction +{ + +} Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2013-01-16 12:56:22 UTC (rev 1107) +++ trunk/library/languages/default-en.po 2013-01-16 18:46:11 UTC (rev 1108) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-15 19:02+0100\n" +"POT-Creation-Date: 2013-01-16 19:26+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -329,15 +329,15 @@ #: classes/Gems/Menu.php:323 classes/Gems/Menu.php:423 #: classes/Gems/Email/EmailFormAbstract.php:280 #: classes/Gems/Email/EmailFormAbstract.php:291 -#: classes/Gems/Menu/MenuAbstract.php:381 -#: classes/Gems/Menu/MenuAbstract.php:394 +#: classes/Gems/Menu/MenuAbstract.php:383 +#: classes/Gems/Menu/MenuAbstract.php:396 msgid "Preview" msgstr "Preview" #: classes/Gems/Menu.php:332 classes/Gems/Default/ExportAction.php:149 #: classes/Gems/Default/TrackMaintenanceAction.php:336 -#: classes/Gems/Menu/MenuAbstract.php:390 -#: classes/Gems/Menu/MenuAbstract.php:472 snippets/AddTracksSnippet.php:238 +#: classes/Gems/Menu/MenuAbstract.php:392 +#: classes/Gems/Menu/MenuAbstract.php:474 snippets/AddTracksSnippet.php:238 msgid "Tracks" msgstr "Tracks" @@ -355,8 +355,8 @@ #: classes/Gems/Menu.php:377 #: classes/Gems/Default/SurveyMaintenanceAction.php:586 -#: classes/Gems/Menu/MenuAbstract.php:397 -#: classes/Gems/Menu/MenuAbstract.php:459 +#: classes/Gems/Menu/MenuAbstract.php:399 +#: classes/Gems/Menu/MenuAbstract.php:461 #: classes/Gems/Tracker/Model/TrackModel.php:100 msgid "Surveys" msgstr "Surveys" @@ -388,7 +388,7 @@ msgid "Overview" msgstr "Overview" -#: classes/Gems/Menu.php:593 classes/Gems/Menu/MenuAbstract.php:354 +#: classes/Gems/Menu.php:593 classes/Gems/Menu/MenuAbstract.php:356 msgid "Project" msgstr "Project" @@ -817,7 +817,6 @@ msgstr "End date" #: classes/Gems/Default/ComplianceAction.php:98 -#: classes/Gems/Menu/MenuAbstract.php:325 msgid "Compliance" msgstr "Compliance" @@ -1222,6 +1221,7 @@ #: classes/Gems/Default/ExportAction.php:154 #: classes/Gems/Default/MailJobAction.php:100 #: classes/Gems/Default/ProjectSurveysAction.php:67 +#: classes/Gems/Default/SummaryAction.php:155 #: classes/Gems/Default/SurveyAction.php:201 #: classes/Gems/Email/OneMailForm.php:57 #: classes/Gems/Export/RespondentExport.php:156 @@ -1757,6 +1757,7 @@ #: classes/Gems/Default/StaffAction.php:335 #: classes/Gems/Default/StaffAction.php:405 #: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:66 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:66 msgid "(all organizations)" msgstr "(all organizations)" @@ -2054,7 +2055,7 @@ msgstr "Session content" #: classes/Gems/Default/ProjectInformationAction.php:226 -#: classes/Gems/Menu/MenuAbstract.php:355 +#: classes/Gems/Menu/MenuAbstract.php:357 msgid "Session" msgstr "Session" @@ -2524,7 +2525,7 @@ msgstr[1] "sources" #: classes/Gems/Default/SourceAction.php:249 -#: classes/Gems/Menu/MenuAbstract.php:450 +#: classes/Gems/Menu/MenuAbstract.php:452 msgid "Survey Sources" msgstr "Survey Sources" @@ -2606,6 +2607,68 @@ msgid "You are not allowed to change this password." msgstr "You are not allowed to change this password." +#: classes/Gems/Default/SummaryAction.php:154 +#: classes/Gems/Email/OneMailForm.php:55 +#: classes/Gems/Export/RespondentExport.php:157 +#: classes/Gems/Menu/MenuAbstract.php:497 +#: classes/Gems/Tracker/Model/StandardTokenModel.php:196 +msgid "Round" +msgstr "Round" + +#: classes/Gems/Default/SummaryAction.php:156 +msgid "Filler" +msgstr "Filler" + +#: classes/Gems/Default/SummaryAction.php:159 +#: classes/Gems/Default/TokenPlanAction.php:326 +#: classes/Gems/Selector/TokenByGroupDateSelector.php:139 +msgid "Answered" +msgstr "Answered" + +#: classes/Gems/Default/SummaryAction.php:160 +#: classes/Gems/Default/TokenPlanAction.php:327 +#: classes/Gems/Selector/TokenByGroupDateSelector.php:129 +#: classes/Gems/Tracker/Token.php:1038 +#: snippets/RespondentTokenTabsSnippet.php:68 +msgid "Missed" +msgstr "Missed" + +#: classes/Gems/Default/SummaryAction.php:161 +#: classes/Gems/Tracker/Token.php:1044 +msgid "Open" +msgstr "Open" + +#: classes/Gems/Default/SummaryAction.php:162 +#: classes/Gems/Tracker/Token.php:1040 classes/Gems/Tracker/Token.php:1042 +msgid "Future" +msgstr "Future" + +#: classes/Gems/Default/SummaryAction.php:163 +#: classes/Gems/Util/Translated.php:233 +msgid "Unknown" +msgstr "Unknown" + +#: classes/Gems/Default/SummaryAction.php:165 +msgid "Success" +msgstr "Success" + +#: classes/Gems/Default/SummaryAction.php:166 +msgid "Removed" +msgstr "Removed" + +#: classes/Gems/Default/SummaryAction.php:179 +msgid "Summary" +msgstr "Summary" + +#: classes/Gems/Default/SummaryAction.php:190 +#: classes/Gems/Default/TokenPlanAction.php:480 +#: classes/Gems/Default/TrackAction.php:450 +#: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:141 +msgid "token" +msgid_plural "tokens" +msgstr[0] "token" +msgstr[1] "tokens" + #: classes/Gems/Default/SurveyAction.php:72 #: classes/Gems/Tracker/Snippets/EditSingleSurveyTokenSnippetAbstract.php:179 msgid "Add survey" @@ -2912,19 +2975,8 @@ msgid "Yet to Answer" msgstr "Yet to Answer" -#: classes/Gems/Default/TokenPlanAction.php:326 -#: classes/Gems/Selector/TokenByGroupDateSelector.php:139 -msgid "Answered" -msgstr "Answered" - -#: classes/Gems/Default/TokenPlanAction.php:327 -#: classes/Gems/Selector/TokenByGroupDateSelector.php:129 -#: classes/Gems/Tracker/Token.php:1038 -#: snippets/RespondentTokenTabsSnippet.php:68 -msgid "Missed" -msgstr "Missed" - #: classes/Gems/Default/TokenPlanAction.php:341 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:79 msgid "(all fillers)" msgstr "(all fillers)" @@ -2940,14 +2992,6 @@ msgid "+" msgstr "+" -#: classes/Gems/Default/TokenPlanAction.php:480 -#: classes/Gems/Default/TrackAction.php:450 -#: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:141 -msgid "token" -msgid_plural "tokens" -msgstr[0] "token" -msgstr[1] "tokens" - #: classes/Gems/Default/TokenPlanAction.php:485 msgid "Token planning" msgstr "Token planning" @@ -3175,7 +3219,7 @@ msgstr[1] "fields" #: classes/Gems/Default/TrackFieldsAction.php:175 -#: classes/Gems/Menu/MenuAbstract.php:475 +#: classes/Gems/Menu/MenuAbstract.php:477 msgid "Fields" msgstr "Fields" @@ -3304,7 +3348,7 @@ msgstr[1] "rounds" #: classes/Gems/Default/TrackRoundsAction.php:227 -#: classes/Gems/Menu/MenuAbstract.php:483 +#: classes/Gems/Menu/MenuAbstract.php:485 msgid "Rounds" msgstr "Rounds" @@ -3384,11 +3428,6 @@ msgid "BBCode info page" msgstr "BBCode info page" -#: classes/Gems/Email/Mailer.php:235 classes/Gems/Email/TemplateMailer.php:360 -#, php-format -msgid "Invalid e-mail address '%s'." -msgstr "Invalid e-mail address '%s'." - #: classes/Gems/Email/MailTemplateForm.php:56 msgid "Send (test)" msgstr "Send (test)" @@ -3430,13 +3469,6 @@ msgid "Survey cannot be taken at this moment." msgstr "Survey cannot be taken at this moment." -#: classes/Gems/Email/OneMailForm.php:55 -#: classes/Gems/Export/RespondentExport.php:157 -#: classes/Gems/Menu/MenuAbstract.php:495 -#: classes/Gems/Tracker/Model/StandardTokenModel.php:196 -msgid "Round" -msgstr "Round" - #: classes/Gems/Email/OneMailForm.php:58 #: classes/Gems/Tracker/Model/StandardTokenModel.php:199 msgid "Last contact" @@ -3462,6 +3494,11 @@ msgid "Sent %d e-mails, updated %d tokens." msgstr "Sent %d e-mails, updated %d tokens." +#: classes/Gems/Email/TemplateMailer.php:360 +#, php-format +msgid "Invalid e-mail address '%s'." +msgstr "Invalid e-mail address '%s'." + #: classes/Gems/Event/Survey/BeforeAnswering/GetPreviousAnswers.php:64 msgid "Previous Version Answers Lookup" msgstr "Previous Version Answers Lookup" @@ -3569,77 +3606,85 @@ msgid "Templates" msgstr "Templates" -#: classes/Gems/Menu/MenuAbstract.php:328 +#: classes/Gems/Menu/MenuAbstract.php:325 +msgid "Track Summary" +msgstr "Track Summary" + +#: classes/Gems/Menu/MenuAbstract.php:327 +msgid "Track Compliance" +msgstr "Track Compliance" + +#: classes/Gems/Menu/MenuAbstract.php:330 msgid "By period" msgstr "By period" -#: classes/Gems/Menu/MenuAbstract.php:329 +#: classes/Gems/Menu/MenuAbstract.php:331 msgid "By token" msgstr "By token" -#: classes/Gems/Menu/MenuAbstract.php:330 +#: classes/Gems/Menu/MenuAbstract.php:332 msgid "By respondent" msgstr "By patient" -#: classes/Gems/Menu/MenuAbstract.php:334 +#: classes/Gems/Menu/MenuAbstract.php:336 msgid "Bulk mail" msgstr "Bulk mail" -#: classes/Gems/Menu/MenuAbstract.php:352 +#: classes/Gems/Menu/MenuAbstract.php:354 msgid "Errors" msgstr "Errors" -#: classes/Gems/Menu/MenuAbstract.php:353 +#: classes/Gems/Menu/MenuAbstract.php:355 msgid "PHP" msgstr "PHP" -#: classes/Gems/Menu/MenuAbstract.php:356 +#: classes/Gems/Menu/MenuAbstract.php:358 msgid "Maintenance mode" msgstr "Maintenance mode" -#: classes/Gems/Menu/MenuAbstract.php:357 +#: classes/Gems/Menu/MenuAbstract.php:359 msgid "Clean cache" msgstr "Clean cache" -#: classes/Gems/Menu/MenuAbstract.php:424 +#: classes/Gems/Menu/MenuAbstract.php:426 msgid "Reset password" msgstr "Reset password" -#: classes/Gems/Menu/MenuAbstract.php:451 +#: classes/Gems/Menu/MenuAbstract.php:453 msgid "Check status" msgstr "Check status" -#: classes/Gems/Menu/MenuAbstract.php:452 +#: classes/Gems/Menu/MenuAbstract.php:454 msgid "Synchronize surveys" msgstr "Synchronize surveys" -#: classes/Gems/Menu/MenuAbstract.php:453 -#: classes/Gems/Menu/MenuAbstract.php:466 +#: classes/Gems/Menu/MenuAbstract.php:455 +#: classes/Gems/Menu/MenuAbstract.php:468 msgid "Check is answered" msgstr "Check is answered" -#: classes/Gems/Menu/MenuAbstract.php:454 +#: classes/Gems/Menu/MenuAbstract.php:456 msgid "Check attributes" msgstr "Check attributes" -#: classes/Gems/Menu/MenuAbstract.php:455 +#: classes/Gems/Menu/MenuAbstract.php:457 msgid "Synchronize all surveys" msgstr "Synchronize all surveys" -#: classes/Gems/Menu/MenuAbstract.php:456 -#: classes/Gems/Menu/MenuAbstract.php:467 +#: classes/Gems/Menu/MenuAbstract.php:458 +#: classes/Gems/Menu/MenuAbstract.php:469 msgid "Check all is answered" msgstr "Check all is answered" -#: classes/Gems/Menu/MenuAbstract.php:463 +#: classes/Gems/Menu/MenuAbstract.php:465 msgid "PDF" msgstr "PDF" -#: classes/Gems/Menu/MenuAbstract.php:501 +#: classes/Gems/Menu/MenuAbstract.php:503 msgid "Check assignments" msgstr "Check assignments" -#: classes/Gems/Menu/MenuAbstract.php:504 +#: classes/Gems/Menu/MenuAbstract.php:506 msgid "Check all assignments" msgstr "Check all assignments" @@ -3862,10 +3907,12 @@ msgstr "Unknown respondent %s" #: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:62 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:62 msgid "(select a track)" msgstr "(select a track)" #: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:178 +#: classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php:124 msgid "No track selected..." msgstr "No track selected..." @@ -3953,14 +4000,6 @@ msgid "Completed" msgstr "Completed" -#: classes/Gems/Tracker/Token.php:1040 classes/Gems/Tracker/Token.php:1042 -msgid "Future" -msgstr "Future" - -#: classes/Gems/Tracker/Token.php:1044 -msgid "Open" -msgstr "Open" - #: classes/Gems/Tracker/Batch/SynchronizeSourcesBatch.php:135 msgid "No surveys were changed." msgstr "No surveys were changed." @@ -4733,10 +4772,6 @@ msgid "Send one mail per respondent, mark only mailed tokens as send." msgstr "Send one mail per patient, mark only mailed tokens as send." -#: classes/Gems/Util/Translated.php:233 -msgid "Unknown" -msgstr "Unknown" - #: classes/Gems/Util/Translated.php:246 msgid "mr." msgstr "Mr." Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2013-01-16 12:56:22 UTC (rev 1107) +++ trunk/library/languages/default-nl.po 2013-01-16 18:46:11 UTC (rev 1108) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-15 19:03+0100\n" +"POT-Creation-Date: 2013-01-16 19:27+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -329,15 +329,15 @@ #: classes/Gems/Menu.php:323 classes/Gems/Menu.php:423 #: classes/Gems/Email/EmailFormAbstract.php:280 #: classes/Gems/Email/EmailFormAbstract.php:291 -#: classes/Gems/Menu/MenuAbstract.php:381 -#: classes/Gems/Menu/MenuAbstract.php:394 +#: classes/Gems/Menu/MenuAbstract.php:383 +#: classes/Gems/Menu/MenuAbstract.php:396 msgid "Preview" msgstr "Preview" #: classes/Gems/Menu.php:332 classes/Gems/Default/ExportAction.php:149 #: classes/Gems/Default/TrackMaintenanceAction.php:336 -#: classes/Gems/Menu/MenuAbstract.php:390 -#: classes/Gems/Menu/MenuAbstract.php:472 snippets/AddTracksSnippet.php:238 +#: classes/Gems/Menu/MenuAbstract.php:392 +#: classes/Gems/Menu/MenuAbstract.php:474 snippets/AddTracksSnippet.php:238 msgid "Tracks" msgstr "Trajecten" @@ -355,8 +355,8 @@ #: classes/Gems/Menu.php:377 #: classes/Gems/Default/SurveyMaintenanceAction.php:586 -#: classes/Gems/Menu/MenuAbstract.php:397 -#: classes/Gems/Menu/MenuAbstract.php:459 +#: classes/Gems/Menu/MenuAbstract.php:399 +#: classes/Gems/Menu/MenuAbstract.php:461 #: classes/Gems/Tracker/Model/TrackModel.php:100 msgid "Surveys" msgstr "Vragenlijsten" @@ -388,7 +388,7 @@ msgid "Overview" msgstr "Overzicht" -#: classes/Gems/Menu.php:593 classes/Gems/Menu/MenuAbstract.php:354 +#: classes/Gems/Menu.php:593 classes/Gems/Menu/MenuAbstract.php:356 msgid "Project" msgstr "Project" @@ -819,7 +819,6 @@ msgstr "Einddatum" #: classes/Gems/Default/ComplianceAction.php:98 -#: classes/Gems/Menu/MenuAbstract.php:325 msgid "Compliance" msgstr "Voortgang" @@ -1227,6 +1226,7 @@ #: classes/Gems/Default/ExportAction.php:154 #: classes/Gems/Default/MailJobAction.php:100 #: classes/Gems/Default/ProjectSurveysAction.php:67 +#: classes/Gems/Default/SummaryAction.php:155 #: classes/Gems/Default/SurveyAction.php:201 #: classes/Gems/Email/OneMailForm.php:57 #: classes/Gems/Export/RespondentExport.php:156 @@ -1766,6 +1766,7 @@ #: classes/Gems/Default/StaffAction.php:335 #: classes/Gems/Default/StaffAction.php:405 #: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:66 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:66 msgid "(all organizations)" msgstr "(alle organisaties)" @@ -2065,7 +2066,7 @@ msgstr "Sessie inhoud" #: classes/Gems/Default/ProjectInformationAction.php:226 -#: classes/Gems/Menu/MenuAbstract.php:355 +#: classes/Gems/Menu/MenuAbstract.php:357 msgid "Session" msgstr "Sessie" @@ -2538,7 +2539,7 @@ msgstr[1] "bronnen" #: classes/Gems/Default/SourceAction.php:249 -#: classes/Gems/Menu/MenuAbstract.php:450 +#: classes/Gems/Menu/MenuAbstract.php:452 msgid "Survey Sources" msgstr "Bronnen" @@ -2622,6 +2623,68 @@ msgid "You are not allowed to change this password." msgstr "U mag dit wachtwoord niet wijzigen." +#: classes/Gems/Default/SummaryAction.php:154 +#: classes/Gems/Email/OneMailForm.php:55 +#: classes/Gems/Export/RespondentExport.php:157 +#: classes/Gems/Menu/MenuAbstract.php:497 +#: classes/Gems/Tracker/Model/StandardTokenModel.php:196 +msgid "Round" +msgstr "Ronde" + +#: classes/Gems/Default/SummaryAction.php:156 +msgid "Filler" +msgstr "Invuller" + +#: classes/Gems/Default/SummaryAction.php:159 +#: classes/Gems/Default/TokenPlanAction.php:326 +#: classes/Gems/Selector/TokenByGroupDateSelector.php:139 +msgid "Answered" +msgstr "Beantwoord" + +#: classes/Gems/Default/SummaryAction.php:160 +#: classes/Gems/Default/TokenPlanAction.php:327 +#: classes/Gems/Selector/TokenByGroupDateSelector.php:129 +#: classes/Gems/Tracker/Token.php:1038 +#: snippets/RespondentTokenTabsSnippet.php:68 +msgid "Missed" +msgstr "Gemist" + +#: classes/Gems/Default/SummaryAction.php:161 +#: classes/Gems/Tracker/Token.php:1044 +msgid "Open" +msgstr "Open" + +#: classes/Gems/Default/SummaryAction.php:162 +#: classes/Gems/Tracker/Token.php:1040 classes/Gems/Tracker/Token.php:1042 +msgid "Future" +msgstr "Toekomstig" + +#: classes/Gems/Default/SummaryAction.php:163 +#: classes/Gems/Util/Translated.php:233 +msgid "Unknown" +msgstr "Onbekend" + +#: classes/Gems/Default/SummaryAction.php:165 +msgid "Success" +msgstr "Succes" + +#: classes/Gems/Default/SummaryAction.php:166 +msgid "Removed" +msgstr "Verwijderd" + +#: classes/Gems/Default/SummaryAction.php:179 +msgid "Summary" +msgstr "Samenvatting" + +#: classes/Gems/Default/SummaryAction.php:190 +#: classes/Gems/Default/TokenPlanAction.php:480 +#: classes/Gems/Default/TrackAction.php:450 +#: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:141 +msgid "token" +msgid_plural "tokens" +msgstr[0] "kenmerk" +msgstr[1] "kenmerken" + #: classes/Gems/Default/SurveyAction.php:72 #: classes/Gems/Tracker/Snippets/EditSingleSurveyTokenSnippetAbstract.php:179 msgid "Add survey" @@ -2931,19 +2994,8 @@ msgid "Yet to Answer" msgstr "Nog te beantwoorden" -#: classes/Gems/Default/TokenPlanAction.php:326 -#: classes/Gems/Selector/TokenByGroupDateSelector.php:139 -msgid "Answered" -msgstr "Beantwoord" - -#: classes/Gems/Default/TokenPlanAction.php:327 -#: classes/Gems/Selector/TokenByGroupDateSelector.php:129 -#: classes/Gems/Tracker/Token.php:1038 -#: snippets/RespondentTokenTabsSnippet.php:68 -msgid "Missed" -msgstr "Gemist" - #: classes/Gems/Default/TokenPlanAction.php:341 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:79 msgid "(all fillers)" msgstr "(alle invullers)" @@ -2959,14 +3011,6 @@ msgid "+" msgstr "+" -#: classes/Gems/Default/TokenPlanAction.php:480 -#: classes/Gems/Default/TrackAction.php:450 -#: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:141 -msgid "token" -msgid_plural "tokens" -msgstr[0] "kenmerk" -msgstr[1] "kenmerken" - #: classes/Gems/Default/TokenPlanAction.php:485 msgid "Token planning" msgstr "Per kenmerk plannen" @@ -3199,7 +3243,7 @@ msgstr[1] "velden" #: classes/Gems/Default/TrackFieldsAction.php:175 -#: classes/Gems/Menu/MenuAbstract.php:475 +#: classes/Gems/Menu/MenuAbstract.php:477 msgid "Fields" msgstr "Velden" @@ -3331,7 +3375,7 @@ msgstr[1] "rondes" #: classes/Gems/Default/TrackRoundsAction.php:227 -#: classes/Gems/Menu/MenuAbstract.php:483 +#: classes/Gems/Menu/MenuAbstract.php:485 msgid "Rounds" msgstr "Rondes" @@ -3411,11 +3455,6 @@ msgid "BBCode info page" msgstr "BBCode info pagina" -#: classes/Gems/Email/Mailer.php:235 classes/Gems/Email/TemplateMailer.php:360 -#, php-format -msgid "Invalid e-mail address '%s'." -msgstr "Ongeldig email adres '%s'." - #: classes/Gems/Email/MailTemplateForm.php:56 msgid "Send (test)" msgstr "Verstuur (test)" @@ -3457,13 +3496,6 @@ msgid "Survey cannot be taken at this moment." msgstr "Deze vragenlijst kan op dit moment niet afgenomen worden." -#: classes/Gems/Email/OneMailForm.php:55 -#: classes/Gems/Export/RespondentExport.php:157 -#: classes/Gems/Menu/MenuAbstract.php:495 -#: classes/Gems/Tracker/Model/StandardTokenModel.php:196 -msgid "Round" -msgstr "Ronde" - #: classes/Gems/Email/OneMailForm.php:58 #: classes/Gems/Tracker/Model/StandardTokenModel.php:199 msgid "Last contact" @@ -3489,6 +3521,11 @@ msgid "Sent %d e-mails, updated %d tokens." msgstr "%d emails verzonden en %d kenmerken bijgewerkt." +#: classes/Gems/Email/TemplateMailer.php:360 +#, php-format +msgid "Invalid e-mail address '%s'." +msgstr "Ongeldig email adres '%s'." + #: classes/Gems/Event/Survey/BeforeAnswering/GetPreviousAnswers.php:64 msgid "Previous Version Answers Lookup" msgstr "Antwoorden overnemen van vorige keer" @@ -3597,77 +3634,85 @@ msgid "Templates" msgstr "Sjablonen" -#: classes/Gems/Menu/MenuAbstract.php:328 +#: classes/Gems/Menu/MenuAbstract.php:325 +msgid "Track Summary" +msgstr "Traject Samenvatting" + +#: classes/Gems/Menu/MenuAbstract.php:327 +msgid "Track Compliance" +msgstr "Traject Voortgang" + +#: classes/Gems/Menu/MenuAbstract.php:330 msgid "By period" msgstr "Per periode" -#: classes/Gems/Menu/MenuAbstract.php:329 +#: classes/Gems/Menu/MenuAbstract.php:331 msgid "By token" msgstr "Per kenmerk" -#: classes/Gems/Menu/MenuAbstract.php:330 +#: classes/Gems/Menu/MenuAbstract.php:332 msgid "By respondent" msgstr "Per patiënt" -#: classes/Gems/Menu/MenuAbstract.php:334 +#: classes/Gems/Menu/MenuAbstract.php:336 msgid "Bulk mail" msgstr "Bulk mail" -#: classes/Gems/Menu/MenuAbstract.php:352 +#: classes/Gems/Menu/MenuAbstract.php:354 msgid "Errors" msgstr "Foutmeldingen" -#: classes/Gems/Menu/MenuAbstract.php:353 +#: classes/Gems/Menu/MenuAbstract.php:355 msgid "PHP" msgstr "PHP" -#: classes/Gems/Menu/MenuAbstract.php:356 +#: classes/Gems/Menu/MenuAbstract.php:358 msgid "Maintenance mode" msgstr "Onderhoudsmodus" -#: classes/Gems/Menu/MenuAbstract.php:357 +#: classes/Gems/Menu/MenuAbstract.php:359 msgid "Clean cache" msgstr "Cache opruimen" -#: classes/Gems/Menu/MenuAbstract.php:424 +#: classes/Gems/Menu/MenuAbstract.php:426 msgid "Reset password" msgstr "Wijzig wachtwoord" -#: classes/Gems/Menu/MenuAbstract.php:451 +#: classes/Gems/Menu/MenuAbstract.php:453 msgid "Check status" msgstr "Status controle" -#: classes/Gems/Menu/MenuAbstract.php:452 +#: classes/Gems/Menu/MenuAbstract.php:454 msgid "Synchronize surveys" msgstr "Synchroniseer vragenlijsten" -#: classes/Gems/Menu/MenuAbstract.php:453 -#: classes/Gems/Menu/MenuAbstract.php:466 +#: classes/Gems/Menu/MenuAbstract.php:455 +#: classes/Gems/Menu/MenuAbstract.php:468 msgid "Check is answered" msgstr "Controleer op antwoorden" -#: classes/Gems/Menu/MenuAbstract.php:454 +#: classes/Gems/Menu/MenuAbstract.php:456 msgid "Check attributes" msgstr "Controleer attributen" -#: classes/Gems/Menu/MenuAbstract.php:455 +#: classes/Gems/Menu/MenuAbstract.php:457 msgid "Synchronize all surveys" msgstr "Synchroniseer alle vragenlijsten" -#: classes/Gems/Menu/MenuAbstract.php:456 -#: classes/Gems/Menu/MenuAbstract.php:467 +#: classes/Gems/Menu/MenuAbstract.php:458 +#: classes/Gems/Menu/MenuAbstract.php:469 msgid "Check all is answered" msgstr "Controleer alles op antwoorden" -#: classes/Gems/Menu/MenuAbstract.php:463 +#: classes/Gems/Menu/MenuAbstract.php:465 msgid "PDF" msgstr "PDF" -#: classes/Gems/Menu/MenuAbstract.php:501 +#: classes/Gems/Menu/MenuAbstract.php:503 msgid "Check assignments" msgstr "Controleer toewijzingen" -#: classes/Gems/Menu/MenuAbstract.php:504 +#: classes/Gems/Menu/MenuAbstract.php:506 msgid "Check all assignments" msgstr "Controleer alle toewijzingen" @@ -3890,10 +3935,12 @@ msgstr "Onbekende patiënt %s" #: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:62 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:62 msgid "(select a track)" msgstr "(selecteer een traject)" #: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:178 +#: classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php:124 msgid "No track selected..." msgstr "Geen traject geselecteerd..." @@ -3983,14 +4030,6 @@ msgid "Completed" msgstr "Ingevuld" -#: classes/Gems/Tracker/Token.php:1040 classes/Gems/Tracker/Token.php:1042 -msgid "Future" -msgstr "Toekomstig" - -#: classes/Gems/Tracker/Token.php:1044 -msgid "Open" -msgstr "Open" - #: classes/Gems/Tracker/Batch/SynchronizeSourcesBatch.php:135 msgid "No surveys were changed... [truncated message content] |
From: <gem...@li...> - 2013-01-17 14:21:25
|
Revision: 1109 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1109&view=rev Author: matijsdejong Date: 2013-01-17 14:21:18 +0000 (Thu, 17 Jan 2013) Log Message: ----------- Excel export now uses autofilterParameters to get identical results Added excel export to SummaryAction SummaryAction now looks more like Harm wants it Modified Paths: -------------- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php trunk/library/classes/Gems/Default/SummaryAction.php trunk/library/classes/Gems/Menu/MenuAbstract.php trunk/library/classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php trunk/library/configs/db/patches.sql Modified: trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php =================================================================== --- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2013-01-16 18:46:11 UTC (rev 1108) +++ trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2013-01-17 14:21:18 UTC (rev 1109) @@ -53,10 +53,12 @@ * @var array Mixed key => value array for snippet initialization */ private $_autofilterExtraParameters = array( - 'browse' => true, - 'containingId' => 'autofilter_target', - 'keyboard' => true, - 'onEmpty' => 'getOnEmptyText', + 'browse' => true, + 'containingId' => 'autofilter_target', + 'keyboard' => true, + 'onEmpty' => 'getOnEmptyText', + 'sortParamAsc' => 'asrt', + 'sortParamDesc' => 'dsrt', ); /** @@ -187,14 +189,34 @@ */ public function excelAction() { + // Make sure we have all the parameters used by the model + $this->autofilterParameters = $this->autofilterParameters + $this->_autofilterExtraParameters; + // Set the request cache to use the search params from the index action $requestCache = $this->util->getRequestCache('index', true); - $filter = $requestCache->getProgramParams(); + $filter = $requestCache->getProgramParams(); + $model = $this->getModel(); - $model = $this->getModel(); + // Set any defaults. + if (isset($this->autofilterParameters['sortParamAsc'])) { + $model->setSortParamAsc($this->autofilterParameters['sortParamAsc']); + } + if (isset($this->autofilterParameters['sortParamDesc'])) { + $model->setSortParamDesc($this->autofilterParameters['sortParamDesc']); + } + // Remove all empty values (but not arrays) from the filter + $filter = array_filter($filter, function($i) { return is_array($i) || strlen($i); }); $model->applyParameters($filter); + // Add any defaults. + if (isset($this->autofilterParameters['extraFilter'])) { + $model->addFilter($this->autofilterParameters['extraFilter']); + } + if (isset($this->autofilterParameters['extraSort'])) { + $model->addSort($this->autofilterParameters['extraSort']); + } + // $this->addExcelColumns($model); // Hook to modify the model // Use $this->formatExcelData to switch between formatted and unformatted data Modified: trunk/library/classes/Gems/Default/SummaryAction.php =================================================================== --- trunk/library/classes/Gems/Default/SummaryAction.php 2013-01-16 18:46:11 UTC (rev 1108) +++ trunk/library/classes/Gems/Default/SummaryAction.php 2013-01-17 14:21:18 UTC (rev 1109) @@ -56,7 +56,10 @@ * * @var array Mixed key => value array for snippet initialization */ - protected $autofilterParameters = array('browse' => false); + protected $autofilterParameters = array( + 'browse' => false, + 'extraSort' => array('gro_id_order' => SORT_ASC), + ); /** * The snippets used for the autofilter action. @@ -110,6 +113,15 @@ (gto_valid_until >= CURRENT_TIMESTAMP OR gto_valid_until IS NULL) THEN 1 ELSE 0 END )'); + $fields['total'] = new Zend_Db_Expr('SUM( + CASE + WHEN grc_success = 1 AND ( + gto_completion_time IS NOT NULL OR + (gto_valid_from IS NOT NULL AND gto_valid_from <= CURRENT_TIMESTAMP) + ) + THEN 1 ELSE 0 END + )'); + /* $fields['future'] = new Zend_Db_Expr('SUM( CASE WHEN grc_success = 1 AND gto_completion_time IS NULL AND gto_valid_from > CURRENT_TIMESTAMP @@ -131,6 +143,7 @@ WHEN grc_success = 0 THEN 1 ELSE 0 END )'); + // */ $select = $this->db->select(); $select->from('gems__tokens', $fields) @@ -139,33 +152,40 @@ array('gro_round_description', 'gro_id_survey')) ->joinInner('gems__surveys', 'gro_id_survey = gsu_id_survey', array('gsu_survey_name', 'gsu_id_primary_group')) - ->group(array('gro_round_description', 'gro_id_order', 'gsu_survey_name', 'gsu_id_primary_group')) - ->order('gto_round_order'); + ->group(array('gro_id_order', 'gro_round_description', 'gsu_survey_name', 'gsu_id_primary_group')); + // ->order('gto_round_order'); // MUtil_Model::$verbose = true; $model = new MUtil_Model_SelectModel($select, 'summary'); - // Make sure of filter for these fields + // Make sure of filter and sort for these fields + $model->set('gro_id_order'); + $model->set('gsu_id_primary_group'); $model->set('gto_id_track'); $model->set('gto_id_organization'); - $model->set('gsu_id_primary_group'); $model->resetOrder(); $model->set('gro_round_description', 'label', $this->_('Round')); $model->set('gsu_survey_name', 'label', $this->_('Survey')); - $model->set('gsu_id_primary_group', 'label', $this->_('Filler'), - 'multiOptions', $this->util->getDbLookup()->getGroups()); - $model->set('answered', 'label', $this->_('Answered'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); $model->set('missed', 'label', $this->_('Missed'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); $model->set('open', 'label', $this->_('Open'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - $model->set('future', 'label', $this->_('Future'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - $model->set('unknown', 'label', $this->_('Unknown'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('total', 'label', $this->_('Total'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + // $model->set('future', 'label', $this->_('Future'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + // $model->set('unknown', 'label', $this->_('Unknown'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); // $model->set('is', 'label', ' ', 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - $model->set('success', 'label', $this->_('Success'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - $model->set('removed', 'label', $this->_('Removed'), 'tdClass', 'deleted centerAlign', - 'thClass', 'centerAlign'); + // $model->set('success', 'label', $this->_('Success'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + // $model->set('removed', 'label', $this->_('Removed'), 'tdClass', 'deleted centerAlign', + // 'thClass', 'centerAlign'); + $model->set('gsu_id_primary_group', 'label', $this->_('Filler'), + 'multiOptions', $this->util->getDbLookup()->getGroups()); + + if (!$this->getTrackId()) { + $model->setFilter(array('1=0')); + $this->autofilterParameters['onEmpty'] = $this->_('No track selected...'); + } + return $model; } @@ -189,4 +209,16 @@ { return $this->plural('token', 'tokens', $count); } + + /** + * + * @return int Return the track id if any or null + */ + public function getTrackId() + { + $data = $this->util->getRequestCache('index')->getProgramParams(); + if (isset($data['gto_id_track'])) { + return $data['gto_id_track']; + } + } } Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php =================================================================== --- trunk/library/classes/Gems/Menu/MenuAbstract.php 2013-01-16 18:46:11 UTC (rev 1108) +++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2013-01-17 14:21:18 UTC (rev 1109) @@ -322,11 +322,14 @@ { $infoPage = $this->addContainer($label); - $infoPage->addPage($this->_('Track Summary'), 'pr.plan.summary', 'summary', 'index') - ->addAutofilterAction(); - $infoPage->addPage($this->_('Track Compliance'), 'pr.plan.compliance', 'compliance', 'index') - ->addAutofilterAction(); + $page = $infoPage->addPage($this->_('Track Summary'), 'pr.plan.summary', 'summary', 'index'); + $page->addAutofilterAction(); + $page->addExcelAction(); + $page = $infoPage->addPage($this->_('Track Compliance'), 'pr.plan.compliance', 'compliance', 'index'); + $page->addAutofilterAction(); + $page->addExcelAction(); + $plans[] = $infoPage->addPage($this->_('By period'), 'pr.plan.overview', 'overview-plan', 'index'); $plans[] = $infoPage->addPage($this->_('By token'), 'pr.plan.token', 'token-plan', 'index'); $plans[] = $infoPage->addPage($this->_('By respondent'), 'pr.plan.respondent', 'respondent-plan', 'index'); Modified: trunk/library/classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php 2013-01-16 18:46:11 UTC (rev 1108) +++ trunk/library/classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php 2013-01-17 14:21:18 UTC (rev 1109) @@ -47,13 +47,6 @@ class Gems_Snippets_Tracker_Summary_SummaryTableSnippet extends Gems_Snippets_ModelTableSnippetGeneric { /** - * When true (= default) the headers get sortable links. - * - * @var boolean - */ - public $sortableLinks = false; - - /** * Adds columns from the model to the bridge that creates the browse table. * * Overrule this function to add different columns to the browse table, without @@ -65,20 +58,37 @@ */ protected function addBrowseTableColumns(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model) { - $bridge->getTable()->setAlternateRowClass('odd', 'odd', 'even', 'even'); + // $bridge->getTable()->setAlternateRowClass('odd', 'odd', 'even', 'even'); - $bridge->add('gro_round_description'); - $bridge->add('answered'); - $bridge->add('missed'); - $bridge->add('open'); - $bridge->add('future'); - $bridge->add('unknown'); + // MUtil_Model::$verbose = true; + + $bridge->add( + 'gro_round_description', + $bridge->createSortLink('gro_id_order', $model->get('gro_round_description', 'label')) + ); + $bridge->addSortable('gsu_survey_name'); + $bridge->th(array($bridge->createSortLink('answered'), 'colspan' => 2))->class = 'centerAlign'; + $bridge->td($bridge->answered)->class = 'centerAlign'; + $bridge->td($this->percentageLazy($bridge->answered, $bridge->total))->class = 'rightAlign'; + $bridge->th(array($bridge->createSortLink('missed'), 'colspan' => 2))->class = 'centerAlign'; + $bridge->td($bridge->missed)->class = 'centerAlign'; + $bridge->td($this->percentageLazy($bridge->missed, $bridge->total))->class = 'rightAlign'; + $bridge->th(array($bridge->createSortLink('open'), 'colspan' => 2))->class = 'centerAlign'; + $bridge->td($bridge->open)->class = 'centerAlign'; + $bridge->td($this->percentageLazy($bridge->open, $bridge->total))->class = 'rightAlign'; + // $bridge->addSortable('answered'); + // $bridge->addSortable('missed'); + // $bridge->addSortable('open'); + // $bridge->add('future'); + // $bridge->add('unknown'); $bridge->addColumn(array('=', 'class' => 'centerAlign')); - $bridge->add('success'); - $bridge->tr(); + $bridge->addSortable('total'); + $bridge->addSortable('gsu_id_primary_group'); + // $bridge->tr(); // $bridge->add('gsu_survey_name')->colspan = 4; // $bridge->add('gsu_id_primary_group')->colspan = 2; // $bridge->addColumn(); + /* $bridge->addColumn( array( $bridge->gsu_survey_name, @@ -90,38 +100,28 @@ ) )->colspan = 7; $bridge->add('removed'); + // */ } /** * - * @return int Return the track id if any or null + * @param MUtil_Lazy_LazyInterface $part + * @param MUtil_Lazy_LazyInterface $total + * @return MUtil_Lazy_Call */ - public function getTrackId() + public function percentageLazy($part, $total) { - if ($this->requestCache) { - $data = $this->requestCache->getProgramParams(); - if (isset($data['gto_id_track'])) { - return $data['gto_id_track']; - } - } else { - return $this->request->getParam('gto_id_track'); - } + return MUtil_Lazy::method($this, 'showPercentage', $part, $total); } /** - * Overrule to implement snippet specific filtering and sorting. * - * @param MUtil_Model_ModelAbstract $model + * @param int $part + * @param int $total + * @return string */ - protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) + public function showPercentage($part, $total) { - $trackId = $this->getTrackId(); - - if ($trackId) { - parent::processFilterAndSort($model); - } else { - $model->setFilter(array('1=0')); - $this->onEmpty = $this->_('No track selected...'); - } + return sprintf($this->_('%d%%'), round($part / $total * 100, 0)); } } Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2013-01-16 18:46:11 UTC (rev 1108) +++ trunk/library/configs/db/patches.sql 2013-01-17 14:21:18 UTC (rev 1109) @@ -467,3 +467,9 @@ UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.plan.summary') WHERE grl_privileges LIKE '%pr.plan.%' AND grl_privileges NOT LIKE '%pr.plan.summary%'; + +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.plan.compliance.excel') + WHERE grl_privileges LIKE '%pr.plan.%' AND grl_privileges NOT LIKE '%pr.plan.compliance.excel%'; + +UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges, ',pr.plan.summary.excel') + WHERE grl_privileges LIKE '%pr.plan.%' AND grl_privileges NOT LIKE '%pr.plan.summary.excel%'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-01-18 17:26:29
|
Revision: 1112 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1112&view=rev Author: matijsdejong Date: 2013-01-18 17:26:18 +0000 (Fri, 18 Jan 2013) Log Message: ----------- TokenPlanAction and it's sub classes use the new date period selection mechanism TokenPlanAction and it's sub classes have the new status selections 'Open' and 'Removed' ComplianceAction.php and SummaryAction.php are finished unless Harm wants more Updated translations Modified Paths: -------------- trunk/library/classes/Gems/Default/ComplianceAction.php trunk/library/classes/Gems/Default/RespondentPlanAction.php trunk/library/classes/Gems/Default/SummaryAction.php trunk/library/classes/Gems/Default/TokenPlanAction.php trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/classes/Gems/Default/ComplianceAction.php =================================================================== --- trunk/library/classes/Gems/Default/ComplianceAction.php 2013-01-17 17:34:35 UTC (rev 1111) +++ trunk/library/classes/Gems/Default/ComplianceAction.php 2013-01-18 17:26:18 UTC (rev 1112) @@ -88,7 +88,6 @@ $model->set('gr2t_end_date', 'label', $this->_('End date'), 'dateFormat', 'dd-MM-yyyy'); $filter = $this->util->getRequestCache('index')->getProgramParams(); - MUtil_Echo::track($filter); if (! (isset($filter['gr2t_id_track']) && $filter['gr2t_id_track'])) { $model->setFilter(array('1=0')); $this->autofilterParameters['onEmpty'] = $this->_('No track selected...'); Modified: trunk/library/classes/Gems/Default/RespondentPlanAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentPlanAction.php 2013-01-17 17:34:35 UTC (rev 1111) +++ trunk/library/classes/Gems/Default/RespondentPlanAction.php 2013-01-18 17:26:18 UTC (rev 1112) @@ -100,14 +100,14 @@ $td->renderWithoutContent = false; // Do not display this cell and thus this row if there is not content } - $bridge->tr(array('class' => 'odd')); + $bridge->tr(array('class' => array('odd', $bridge->row_class))); $bridge->addColumn($this->getTokenLinks($bridge))->class = 'rightAlign'; $bridge->addSortable('gto_valid_from'); $bridge->addSortable('gto_valid_until'); $model->set('calc_round_description', 'tableDisplay', 'smallData'); $bridge->addMultiSort('gsu_survey_name', 'calc_round_description')->colspan = 2; - $bridge->tr(array('class' => 'odd')); + $bridge->tr(array('class' => array('odd', $bridge->row_class))); $bridge->addColumn(); $bridge->addSortable('gto_mail_sent_date'); $bridge->addSortable('gto_completion_time'); Modified: trunk/library/classes/Gems/Default/SummaryAction.php =================================================================== --- trunk/library/classes/Gems/Default/SummaryAction.php 2013-01-17 17:34:35 UTC (rev 1111) +++ trunk/library/classes/Gems/Default/SummaryAction.php 2013-01-18 17:26:18 UTC (rev 1112) @@ -94,6 +94,66 @@ */ public function createModel($detailed, $action) { + $select = $this->getSelect(); + + // MUtil_Model::$verbose = true; + $model = new MUtil_Model_SelectModel($select, 'summary'); + + // Make sure of filter and sort for these fields + $model->set('gro_id_order'); + $model->set('gsu_id_primary_group'); + $model->set('gto_id_track'); + $model->set('gto_id_organization'); + + $model->resetOrder(); + $model->set('gro_round_description', 'label', $this->_('Round')); + $model->set('gsu_survey_name', 'label', $this->_('Survey')); + $model->set('answered', 'label', $this->_('Answered'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('missed', 'label', $this->_('Missed'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('open', 'label', $this->_('Open'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + $model->set('total', 'label', $this->_('Total'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + // $model->set('future', 'label', $this->_('Future'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + // $model->set('unknown', 'label', $this->_('Unknown'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + // $model->set('is', 'label', ' ', 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + // $model->set('success', 'label', $this->_('Success'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); + // $model->set('removed', 'label', $this->_('Removed'), 'tdClass', 'deleted centerAlign', + // 'thClass', 'centerAlign'); + + $model->set('gsu_id_primary_group', 'label', $this->_('Filler'), + 'multiOptions', $this->util->getDbLookup()->getGroups()); + + $data = $this->util->getRequestCache('index')->getProgramParams(); + if (isset($data['gto_id_track']) &&$data['gto_id_track']) { + // Add the period filter + if ($where = Gems_Snippets_AutosearchFormSnippet::getPeriodFilter($data, $this->db)) { + $select->joinInner('gems__respondent2track', 'gto_id_respondent_track = gr2t_id_respondent_track', array()); + $model->addFilter(array($where)); + } + } else { + $model->setFilter(array('1=0')); + $this->autofilterParameters['onEmpty'] = $this->_('No track selected...'); + } + + return $model; + } + + /** + * Helper function to get the title for the index action. + * + * @return $string + */ + public function getIndexTitle() + { + return $this->_('Summary'); + } + + /** + * Select creation function, allowes overruling in child classes + * + * @return Zend_Db_Select + */ + public function getSelect() + { $select = $this->db->select(); $fields['answered'] = new Zend_Db_Expr("SUM( @@ -154,58 +214,10 @@ array('gsu_survey_name', 'gsu_id_primary_group')) ->group(array('gro_id_order', 'gro_round_description', 'gsu_survey_name', 'gsu_id_primary_group')); - // MUtil_Model::$verbose = true; - $model = new MUtil_Model_SelectModel($select, 'summary'); - - // Make sure of filter and sort for these fields - $model->set('gro_id_order'); - $model->set('gsu_id_primary_group'); - $model->set('gto_id_track'); - $model->set('gto_id_organization'); - - $model->resetOrder(); - $model->set('gro_round_description', 'label', $this->_('Round')); - $model->set('gsu_survey_name', 'label', $this->_('Survey')); - $model->set('answered', 'label', $this->_('Answered'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - $model->set('missed', 'label', $this->_('Missed'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - $model->set('open', 'label', $this->_('Open'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - $model->set('total', 'label', $this->_('Total'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - // $model->set('future', 'label', $this->_('Future'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - // $model->set('unknown', 'label', $this->_('Unknown'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - // $model->set('is', 'label', ' ', 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - // $model->set('success', 'label', $this->_('Success'), 'tdClass', 'centerAlign', 'thClass', 'centerAlign'); - // $model->set('removed', 'label', $this->_('Removed'), 'tdClass', 'deleted centerAlign', - // 'thClass', 'centerAlign'); - - $model->set('gsu_id_primary_group', 'label', $this->_('Filler'), - 'multiOptions', $this->util->getDbLookup()->getGroups()); - - $data = $this->util->getRequestCache('index')->getProgramParams(); - if (isset($data['gto_id_track'])) { - // Add the period filter - if ($where = Gems_Snippets_AutosearchFormSnippet::getPeriodFilter($data, $this->db)) { - $select->joinInner('gems__respondent2track', 'gto_id_respondent_track = gr2t_id_respondent_track', array()); - $model->addFilter(array($where)); - } - } else { - $model->setFilter(array('1=0')); - $this->autofilterParameters['onEmpty'] = $this->_('No track selected...'); - } - - return $model; + return $select; } /** - * Helper function to get the title for the index action. - * - * @return $string - */ - public function getIndexTitle() - { - return $this->_('Summary'); - } - - /** * Helper function to allow generalized statements about the items in the model. * * @param int $count Modified: trunk/library/classes/Gems/Default/TokenPlanAction.php =================================================================== --- trunk/library/classes/Gems/Default/TokenPlanAction.php 2013-01-17 17:34:35 UTC (rev 1111) +++ trunk/library/classes/Gems/Default/TokenPlanAction.php 2013-01-18 17:26:18 UTC (rev 1112) @@ -45,13 +45,6 @@ */ class Gems_Default_TokenPlanAction extends Gems_Controller_BrowseEditAction { - public $defaultPeriodEnd = 2; - public $defaultPeriodStart = -4; - public $defaultPeriodType = 'W'; - - public $maxPeriod = 15; - public $minPeriod = -15; - public $sortKey = array( 'gto_valid_from' => SORT_ASC, 'gto_mail_sent_date' => SORT_ASC, @@ -69,6 +62,8 @@ // Row with dates and patient data $bridge->gtr_track_type; // Data needed for buttons + + $bridge->tr()->appendAttrib('class', $bridge->row_class); $bridge->setDefaultRowClass(MUtil_Html_TableElement::createAlternateRowClass('even', 'even', 'odd', 'odd')); $bridge->addColumn($this->getTokenLinks($bridge), ' ')->rowspan = 2; // Space needed because TableElement does not look at rowspans @@ -224,55 +219,25 @@ $elements[] = null; // break into separate spans } - // Create date range elements - $min = $this->minPeriod; - $max = $this->maxPeriod; - $size = max(strlen($min), strlen($max)); - - $options = array( + $dates = array( 'gto_valid_from' => $this->_('Valid from'), 'gto_valid_until' => $this->_('Valid until'), 'gto_mail_sent_date' => $this->_('E-Mailed on'), 'gto_completion_time' => $this->_('Completion date'), ); - $element = $this->_createSelectElement('date_used', $options); - $element->class = 'minimal'; + + $element = $this->_createSelectElement('dateused', $dates); $element->setLabel($this->_('For date')); $elements[] = $element; - $element = new Zend_Form_Element_Text('period_start', array('label' => $this->_('from'), 'size' => $size - 1, 'maxlength' => $size, 'class' => 'rightAlign')); - $element->addValidator(new Zend_Validate_Int()); - $element->addValidator(new Zend_Validate_Between($min, $max)); - $elements[] = $element; + $options = array(); + $options['label'] = $this->_('from'); + MUtil_Model_FormBridge::applyFixedOptions('date', $options); + $elements[] = new Gems_JQuery_Form_Element_DatePicker('datefrom', $options); - $element = new Zend_Form_Element_Text('period_end', array('label' => $this->_('until'), 'size' => $size - 1, 'maxlength' => $size, 'class' => 'rightAlign')); - $element->addValidator(new Zend_Validate_Int()); - $element->addValidator(new Zend_Validate_Between($min, $max)); - $elements[] = $element; + $options['label'] = ' ' . $this->_('until'); + $elements[] = new Gems_JQuery_Form_Element_DatePicker('dateuntil', $options); - $options = array( - 'D' => $this->_('days'), - 'W' => $this->_('weeks'), - 'M' => $this->_('months'), - 'Y' => $this->_('years'), - ); - $element = $this->_createSelectElement('date_type', $options); - $element->class = 'minimal'; - $elements[] = $element; - - $joptions['change'] = new Zend_Json_Expr('function(e, ui) { -jQuery("#period_start").attr("value", ui.values[0]); -jQuery("#period_end" ).attr("value", ui.values[1]).trigger("keyup"); - -}'); - $joptions['min'] = $this->minPeriod; - $joptions['max'] = $this->maxPeriod; - $joptions['range'] = true; - $joptions['values'] = new Zend_Json_Expr('[jQuery("#period_start").attr("value"), jQuery("#period_end").attr("value")]'); - - $element = new ZendX_JQuery_Form_Element_Slider('period', array('class' => 'periodSlider', 'jQueryParams' => $joptions)); - $elements[] = $element; - $elements[] = null; // break into separate spans @@ -319,12 +284,14 @@ $options = array( 'all' => $this->_('(all actions)'), + 'open' => $this->_('Open'), 'notmailed' => $this->_('Not emailed'), 'tomail' => $this->_('To email'), 'toremind' => $this->_('Needs reminder'), 'toanswer' => $this->_('Yet to Answer'), 'answered' => $this->_('Answered'), 'missed' => $this->_('Missed'), + 'removed' => $this->_('Removed'), ); $elements[] = $this->_createSelectElement('main_filter', $options); @@ -368,6 +335,9 @@ //Add default filter $filter = array(); + if ($where = Gems_Snippets_AutosearchFormSnippet::getPeriodFilter($data, $this->db)) { + $filter[] = $where; + } $filter['gto_id_organization'] = isset($data['gto_id_organization']) ? $data['gto_id_organization'] : $this->escort->getCurrentOrganization(); // Is overruled when set in param $filter['gtr_active'] = 1; $filter['gsu_active'] = 1; @@ -375,24 +345,26 @@ if (isset($data['main_filter'])) { switch ($data['main_filter']) { - case 'notmailed': - $filter['gto_mail_sent_date'] = null; - $filter[] = '(gto_valid_until IS NULL OR gto_valid_until >= CURRENT_TIMESTAMP)'; + case 'answered': + $filter[] = 'gto_completion_time IS NOT NULL'; + break; + + case 'missed': + $filter[] = 'gto_valid_from <= CURRENT_TIMESTAMP'; + $filter[] = 'gto_valid_until < CURRENT_TIMESTAMP'; $filter['gto_completion_time'] = null; break; - case 'tomail': - $filter[] = "grs_email IS NOT NULL AND grs_email != '' AND ggp_respondent_members = 1"; + case 'notmailed': $filter['gto_mail_sent_date'] = null; $filter[] = '(gto_valid_until IS NULL OR gto_valid_until >= CURRENT_TIMESTAMP)'; $filter['gto_completion_time'] = null; break; - case 'toremind': - // $filter['can_email'] = 1; - $filter[] = 'gto_mail_sent_date < CURRENT_TIMESTAMP'; - $filter[] = '(gto_valid_until IS NULL OR gto_valid_until >= CURRENT_TIMESTAMP)'; + case 'open': $filter['gto_completion_time'] = null; + $filter[] = 'gto_valid_from <= CURRENT_TIMESTAMP'; + $filter[] = '(gto_valid_until >= CURRENT_TIMESTAMP OR gto_valid_until IS NULL)'; break; // case 'other': @@ -401,20 +373,28 @@ // $filter[] = '(gto_valid_until IS NULL OR gto_valid_until >= CURRENT_TIMESTAMP)'; // break; - case 'missed': - $filter[] = 'gto_valid_from <= CURRENT_TIMESTAMP'; - $filter[] = 'gto_valid_until < CURRENT_TIMESTAMP'; - $filter['gto_completion_time'] = null; + case 'removed': + $filter['grc_success'] = 0; break; - case 'answered': - $filter[] = 'gto_completion_time IS NOT NULL'; - break; - case 'toanswer': $filter[] = 'gto_completion_time IS NULL'; break; + case 'tomail': + $filter[] = "grs_email IS NOT NULL AND grs_email != '' AND ggp_respondent_members = 1"; + $filter['gto_mail_sent_date'] = null; + $filter[] = '(gto_valid_until IS NULL OR gto_valid_until >= CURRENT_TIMESTAMP)'; + $filter['gto_completion_time'] = null; + break; + + case 'toremind': + // $filter['can_email'] = 1; + $filter[] = 'gto_mail_sent_date < CURRENT_TIMESTAMP'; + $filter[] = '(gto_valid_until IS NULL OR gto_valid_until >= CURRENT_TIMESTAMP)'; + $filter['gto_completion_time'] = null; + break; + default: break; @@ -454,12 +434,15 @@ public function getDefaultSearchData() { + $options = array(); + MUtil_Model_FormBridge::applyFixedOptions('date', $options); + $inFormat = isset($options['dateFormat']) ? $options['dateFormat'] : null; + $now = new MUtil_Date(); + return array( - 'date_used' => 'gto_valid_from', - 'date_type' => $this->defaultPeriodType, + 'datefrom' => $now->toString($inFormat), + 'dateused' => 'gto_valid_from', 'gto_id_organization' => $this->escort->getCurrentOrganization(), - 'period_start' => $this->defaultPeriodStart, - 'period_end' => $this->defaultPeriodEnd, 'main_filter' => 'all', ); } Modified: trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php 2013-01-17 17:34:35 UTC (rev 1111) +++ trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php 2013-01-18 17:26:18 UTC (rev 1112) @@ -58,7 +58,7 @@ protected function getAutoSearchElements(array $data) { $elements[] = $this->_createSelectElement('gr2t_id_track', - $this->util->getTrackData()->getAllTracks(), + $this->util->getTrackData()->getSteppedTracks(), $this->_('(select a track)')); $elements[] = $this->_createSelectElement('gr2t_id_organization', Modified: trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php 2013-01-17 17:34:35 UTC (rev 1111) +++ trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php 2013-01-18 17:26:18 UTC (rev 1112) @@ -58,7 +58,7 @@ protected function getAutoSearchElements(array $data) { $elements[] = $this->_createSelectElement('gto_id_track', - $this->util->getTrackData()->getAllTracks(), + $this->util->getTrackData()->getSteppedTracks(), $this->_('(select a track)')); $elements[] = $this->_createSelectElement('gto_id_organization', Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2013-01-17 17:34:35 UTC (rev 1111) +++ trunk/library/languages/default-en.po 2013-01-18 17:26:18 UTC (rev 1112) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-16 19:26+0100\n" +"POT-Creation-Date: 2013-01-18 17:59+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -329,15 +329,15 @@ #: classes/Gems/Menu.php:323 classes/Gems/Menu.php:423 #: classes/Gems/Email/EmailFormAbstract.php:280 #: classes/Gems/Email/EmailFormAbstract.php:291 -#: classes/Gems/Menu/MenuAbstract.php:383 -#: classes/Gems/Menu/MenuAbstract.php:396 +#: classes/Gems/Menu/MenuAbstract.php:386 +#: classes/Gems/Menu/MenuAbstract.php:399 msgid "Preview" msgstr "Preview" #: classes/Gems/Menu.php:332 classes/Gems/Default/ExportAction.php:149 #: classes/Gems/Default/TrackMaintenanceAction.php:336 -#: classes/Gems/Menu/MenuAbstract.php:392 -#: classes/Gems/Menu/MenuAbstract.php:474 snippets/AddTracksSnippet.php:238 +#: classes/Gems/Menu/MenuAbstract.php:395 +#: classes/Gems/Menu/MenuAbstract.php:477 snippets/AddTracksSnippet.php:238 msgid "Tracks" msgstr "Tracks" @@ -355,8 +355,8 @@ #: classes/Gems/Menu.php:377 #: classes/Gems/Default/SurveyMaintenanceAction.php:586 -#: classes/Gems/Menu/MenuAbstract.php:399 -#: classes/Gems/Menu/MenuAbstract.php:461 +#: classes/Gems/Menu/MenuAbstract.php:402 +#: classes/Gems/Menu/MenuAbstract.php:464 #: classes/Gems/Tracker/Model/TrackModel.php:100 msgid "Surveys" msgstr "Surveys" @@ -388,7 +388,7 @@ msgid "Overview" msgstr "Overview" -#: classes/Gems/Menu.php:593 classes/Gems/Menu/MenuAbstract.php:356 +#: classes/Gems/Menu.php:593 classes/Gems/Menu/MenuAbstract.php:359 msgid "Project" msgstr "Project" @@ -418,7 +418,7 @@ msgid "Changelog" msgstr "Changelog" -#: classes/Gems/Model.php:212 classes/Gems/Default/ComplianceAction.php:84 +#: classes/Gems/Model.php:212 classes/Gems/Default/ComplianceAction.php:86 #: classes/Gems/Tracker/Model/StandardTokenModel.php:213 msgid "Respondent nr" msgstr "Patient nr" @@ -476,7 +476,7 @@ #: classes/Gems/Default/SourceAction.php:195 #: classes/Gems/Default/StaffAction.php:328 #: classes/Gems/Default/SurveyMaintenanceAction.php:435 -#: classes/Gems/Default/TokenPlanAction.php:121 +#: classes/Gems/Default/TokenPlanAction.php:116 #: classes/Gems/Default/TrackFieldsAction.php:98 #: classes/Gems/Default/TrackMaintenanceAction.php:249 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:60 @@ -549,7 +549,7 @@ msgstr "Trying upgrade for %s to level %s: %s" #: classes/Gems/Controller/BrowseEditAction.php:357 -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:239 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:261 #: classes/Gems/Default/StaffAction.php:228 #: classes/Gems/Snippets/ModelFormSnippetAbstract.php:186 #, php-format @@ -557,7 +557,7 @@ msgstr "New %s..." #: classes/Gems/Controller/BrowseEditAction.php:390 -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:259 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:281 #: classes/Gems/Default/TrackFieldsAction.php:130 #: classes/Gems/Default/TrackRoundsAction.php:171 #, php-format @@ -580,19 +580,19 @@ msgstr "Edit %s %s" #: classes/Gems/Controller/BrowseEditAction.php:413 -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:269 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:291 #: classes/Gems/Snippets/ModelFormSnippetAbstract.php:188 #, php-format msgid "Edit %s" msgstr "Edit %s" #: classes/Gems/Controller/BrowseEditAction.php:516 -#: classes/Gems/Snippets/AutosearchFormSnippet.php:166 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:249 msgid "Free search text" msgstr "Free search text" #: classes/Gems/Controller/BrowseEditAction.php:587 -#: classes/Gems/Snippets/AutosearchFormSnippet.php:241 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:324 msgid "Search" msgstr "Search" @@ -709,26 +709,26 @@ msgid "Cancel" msgstr "Cancel" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:249 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:271 #, php-format msgid "Do you want to delete this %s?" msgstr "Do you want to delete this %s?" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:282 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:304 msgid "No data found." msgstr "No data found." -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:344 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:366 #, php-format msgid "No %s found..." msgstr "No %s found..." -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:354 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:376 #, php-format msgid "Showing %s" msgstr "Showing %s" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:390 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:412 #: classes/Gems/Default/OptionAction.php:181 #: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:341 msgid "item" @@ -808,19 +808,24 @@ msgid "The survey for token %s is no longer active." msgstr "The survey for token %s is no longer active." -#: classes/Gems/Default/ComplianceAction.php:85 +#: classes/Gems/Default/ComplianceAction.php:87 msgid "Start date" msgstr "Start date" -#: classes/Gems/Default/ComplianceAction.php:86 +#: classes/Gems/Default/ComplianceAction.php:88 msgid "End date" msgstr "End date" -#: classes/Gems/Default/ComplianceAction.php:98 +#: classes/Gems/Default/ComplianceAction.php:93 +#: classes/Gems/Default/SummaryAction.php:192 +msgid "No track selected..." +msgstr "No track selected..." + +#: classes/Gems/Default/ComplianceAction.php:173 msgid "Compliance" msgstr "Compliance" -#: classes/Gems/Default/ComplianceAction.php:109 +#: classes/Gems/Default/ComplianceAction.php:184 #: classes/Gems/Default/ProjectTracksAction.php:85 #: classes/Gems/Default/TrackAction.php:452 #: classes/Gems/Default/TrackMaintenanceAction.php:331 @@ -1221,7 +1226,7 @@ #: classes/Gems/Default/ExportAction.php:154 #: classes/Gems/Default/MailJobAction.php:100 #: classes/Gems/Default/ProjectSurveysAction.php:67 -#: classes/Gems/Default/SummaryAction.php:155 +#: classes/Gems/Default/SummaryAction.php:168 #: classes/Gems/Default/SurveyAction.php:201 #: classes/Gems/Email/OneMailForm.php:57 #: classes/Gems/Export/RespondentExport.php:156 @@ -1429,32 +1434,30 @@ msgstr "Invalid language setting." #: classes/Gems/Default/LogAction.php:78 -#: classes/Gems/Default/TokenPlanAction.php:243 +#: classes/Gems/Default/TokenPlanAction.php:234 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:125 msgid "from" msgstr "from" #: classes/Gems/Default/LogAction.php:83 -#: classes/Gems/Default/TokenPlanAction.php:248 +#: classes/Gems/Default/TokenPlanAction.php:238 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:141 msgid "until" msgstr "until" #: classes/Gems/Default/LogAction.php:89 -#: classes/Gems/Default/TokenPlanAction.php:254 msgid "days" msgstr "days" #: classes/Gems/Default/LogAction.php:90 -#: classes/Gems/Default/TokenPlanAction.php:255 msgid "weeks" msgstr "weeks" #: classes/Gems/Default/LogAction.php:91 -#: classes/Gems/Default/TokenPlanAction.php:256 msgid "months" msgstr "months" #: classes/Gems/Default/LogAction.php:92 -#: classes/Gems/Default/TokenPlanAction.php:257 msgid "years" msgstr "years" @@ -1509,7 +1512,7 @@ msgstr "Message" #: classes/Gems/Default/LogAction.php:198 -#: classes/Gems/Default/TokenPlanAction.php:116 +#: classes/Gems/Default/TokenPlanAction.php:111 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:55 #: snippets/RespondentDetailsSnippet.php:74 #: snippets/RespondentDetailsWithAssignmentsSnippet.php:148 @@ -2055,7 +2058,7 @@ msgstr "Session content" #: classes/Gems/Default/ProjectInformationAction.php:226 -#: classes/Gems/Menu/MenuAbstract.php:357 +#: classes/Gems/Menu/MenuAbstract.php:360 msgid "Session" msgstr "Session" @@ -2072,6 +2075,7 @@ #: classes/Gems/Email/EmailFormAbstract.php:193 #: classes/Gems/Email/EmailFormAbstract.php:251 #: classes/Gems/Email/MailTemplateForm.php:81 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:112 #: classes/Gems/Tracker/Model/TrackModel.php:103 msgid "From" msgstr "From" @@ -2525,7 +2529,7 @@ msgstr[1] "sources" #: classes/Gems/Default/SourceAction.php:249 -#: classes/Gems/Menu/MenuAbstract.php:452 +#: classes/Gems/Menu/MenuAbstract.php:455 msgid "Survey Sources" msgstr "Survey Sources" @@ -2607,61 +2611,49 @@ msgid "You are not allowed to change this password." msgstr "You are not allowed to change this password." -#: classes/Gems/Default/SummaryAction.php:154 +#: classes/Gems/Default/SummaryAction.php:167 #: classes/Gems/Email/OneMailForm.php:55 #: classes/Gems/Export/RespondentExport.php:157 -#: classes/Gems/Menu/MenuAbstract.php:497 +#: classes/Gems/Menu/MenuAbstract.php:500 #: classes/Gems/Tracker/Model/StandardTokenModel.php:196 msgid "Round" msgstr "Round" -#: classes/Gems/Default/SummaryAction.php:156 -msgid "Filler" -msgstr "Filler" - -#: classes/Gems/Default/SummaryAction.php:159 -#: classes/Gems/Default/TokenPlanAction.php:326 +#: classes/Gems/Default/SummaryAction.php:169 +#: classes/Gems/Default/TokenPlanAction.php:292 #: classes/Gems/Selector/TokenByGroupDateSelector.php:139 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:149 msgid "Answered" msgstr "Answered" -#: classes/Gems/Default/SummaryAction.php:160 -#: classes/Gems/Default/TokenPlanAction.php:327 +#: classes/Gems/Default/SummaryAction.php:170 +#: classes/Gems/Default/TokenPlanAction.php:293 #: classes/Gems/Selector/TokenByGroupDateSelector.php:129 #: classes/Gems/Tracker/Token.php:1038 #: snippets/RespondentTokenTabsSnippet.php:68 msgid "Missed" msgstr "Missed" -#: classes/Gems/Default/SummaryAction.php:161 +#: classes/Gems/Default/SummaryAction.php:171 +#: classes/Gems/Default/TokenPlanAction.php:287 #: classes/Gems/Tracker/Token.php:1044 msgid "Open" msgstr "Open" -#: classes/Gems/Default/SummaryAction.php:162 -#: classes/Gems/Tracker/Token.php:1040 classes/Gems/Tracker/Token.php:1042 -msgid "Future" -msgstr "Future" +#: classes/Gems/Default/SummaryAction.php:172 +msgid "Total" +msgstr "Total" -#: classes/Gems/Default/SummaryAction.php:163 -#: classes/Gems/Util/Translated.php:233 -msgid "Unknown" -msgstr "Unknown" +#: classes/Gems/Default/SummaryAction.php:180 +msgid "Filler" +msgstr "Filler" -#: classes/Gems/Default/SummaryAction.php:165 -msgid "Success" -msgstr "Success" - -#: classes/Gems/Default/SummaryAction.php:166 -msgid "Removed" -msgstr "Removed" - -#: classes/Gems/Default/SummaryAction.php:179 +#: classes/Gems/Default/SummaryAction.php:205 msgid "Summary" msgstr "Summary" -#: classes/Gems/Default/SummaryAction.php:190 -#: classes/Gems/Default/TokenPlanAction.php:480 +#: classes/Gems/Default/SummaryAction.php:216 +#: classes/Gems/Default/TokenPlanAction.php:463 #: classes/Gems/Default/TrackAction.php:450 #: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:141 msgid "token" @@ -2893,98 +2885,106 @@ msgid "Not used in tracks." msgstr "Not used in tracks." -#: classes/Gems/Default/TokenPlanAction.php:117 +#: classes/Gems/Default/TokenPlanAction.php:112 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:56 msgid "Round / Details" msgstr "Round / Details" -#: classes/Gems/Default/TokenPlanAction.php:118 -#: classes/Gems/Default/TokenPlanAction.php:233 +#: classes/Gems/Default/TokenPlanAction.php:113 +#: classes/Gems/Default/TokenPlanAction.php:223 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:57 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:73 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:385 msgid "Valid from" msgstr "Valid from" -#: classes/Gems/Default/TokenPlanAction.php:119 -#: classes/Gems/Default/TokenPlanAction.php:234 +#: classes/Gems/Default/TokenPlanAction.php:114 +#: classes/Gems/Default/TokenPlanAction.php:224 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:58 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:74 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:386 #: classes/Gems/Tracker/Model/StandardTokenModel.php:198 msgid "Valid until" msgstr "Valid until" -#: classes/Gems/Default/TokenPlanAction.php:120 +#: classes/Gems/Default/TokenPlanAction.php:115 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:59 msgid "Contact date" msgstr "Contact date" -#: classes/Gems/Default/TokenPlanAction.php:174 +#: classes/Gems/Default/TokenPlanAction.php:169 #, php-format msgid "Email %s" msgstr "Email %s" -#: classes/Gems/Default/TokenPlanAction.php:180 +#: classes/Gems/Default/TokenPlanAction.php:175 msgid "No tokens found." msgstr "No tokens found." -#: classes/Gems/Default/TokenPlanAction.php:235 +#: classes/Gems/Default/TokenPlanAction.php:225 msgid "E-Mailed on" msgstr "E-Mailed on" -#: classes/Gems/Default/TokenPlanAction.php:236 +#: classes/Gems/Default/TokenPlanAction.php:226 msgid "Completion date" msgstr "Completion date" -#: classes/Gems/Default/TokenPlanAction.php:240 +#: classes/Gems/Default/TokenPlanAction.php:230 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:116 msgid "For date" msgstr "For date" -#: classes/Gems/Default/TokenPlanAction.php:287 +#: classes/Gems/Default/TokenPlanAction.php:252 msgid "Select:" msgstr "Select:" -#: classes/Gems/Default/TokenPlanAction.php:293 +#: classes/Gems/Default/TokenPlanAction.php:258 msgid "(all tracks)" msgstr "(all tracks)" -#: classes/Gems/Default/TokenPlanAction.php:304 +#: classes/Gems/Default/TokenPlanAction.php:269 msgid "(all rounds)" msgstr "(all rounds)" -#: classes/Gems/Default/TokenPlanAction.php:318 +#: classes/Gems/Default/TokenPlanAction.php:283 msgid "(all surveys)" msgstr "(all surveys)" -#: classes/Gems/Default/TokenPlanAction.php:321 +#: classes/Gems/Default/TokenPlanAction.php:286 msgid "(all actions)" msgstr "(all actions)" -#: classes/Gems/Default/TokenPlanAction.php:322 +#: classes/Gems/Default/TokenPlanAction.php:288 msgid "Not emailed" msgstr "Not emailed" -#: classes/Gems/Default/TokenPlanAction.php:323 +#: classes/Gems/Default/TokenPlanAction.php:289 msgid "To email" msgstr "To email" -#: classes/Gems/Default/TokenPlanAction.php:324 +#: classes/Gems/Default/TokenPlanAction.php:290 msgid "Needs reminder" msgstr "Needs reminder" -#: classes/Gems/Default/TokenPlanAction.php:325 +#: classes/Gems/Default/TokenPlanAction.php:291 msgid "Yet to Answer" msgstr "Yet to Answer" -#: classes/Gems/Default/TokenPlanAction.php:341 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:79 +#: classes/Gems/Default/TokenPlanAction.php:294 +msgid "Removed" +msgstr "Removed" + +#: classes/Gems/Default/TokenPlanAction.php:308 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:88 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:90 msgid "(all fillers)" msgstr "(all fillers)" -#: classes/Gems/Default/TokenPlanAction.php:360 +#: classes/Gems/Default/TokenPlanAction.php:327 msgid "(all staff)" msgstr "(all staff)" -#: classes/Gems/Default/TokenPlanAction.php:471 +#: classes/Gems/Default/TokenPlanAction.php:454 #: classes/Gems/Snippets/TokenModelSnippetAbstract.php:59 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:122 #: snippets/BrowseSingleSurveyTokenSnippet.php:144 @@ -2992,7 +2992,7 @@ msgid "+" msgstr "+" -#: classes/Gems/Default/TokenPlanAction.php:485 +#: classes/Gems/Default/TokenPlanAction.php:468 msgid "Token planning" msgstr "Token planning" @@ -3219,7 +3219,7 @@ msgstr[1] "fields" #: classes/Gems/Default/TrackFieldsAction.php:175 -#: classes/Gems/Menu/MenuAbstract.php:477 +#: classes/Gems/Menu/MenuAbstract.php:480 msgid "Fields" msgstr "Fields" @@ -3348,7 +3348,7 @@ msgstr[1] "rounds" #: classes/Gems/Default/TrackRoundsAction.php:227 -#: classes/Gems/Menu/MenuAbstract.php:485 +#: classes/Gems/Menu/MenuAbstract.php:488 msgid "Rounds" msgstr "Rounds" @@ -3610,81 +3610,81 @@ msgid "Track Summary" msgstr "Track Summary" -#: classes/Gems/Menu/MenuAbstract.php:327 +#: classes/Gems/Menu/MenuAbstract.php:329 msgid "Track Compliance" msgstr "Track Compliance" -#: classes/Gems/Menu/MenuAbstract.php:330 +#: classes/Gems/Menu/MenuAbstract.php:333 msgid "By period" msgstr "By period" -#: classes/Gems/Menu/MenuAbstract.php:331 +#: classes/Gems/Menu/MenuAbstract.php:334 msgid "By token" msgstr "By token" -#: classes/Gems/Menu/MenuAbstract.php:332 +#: classes/Gems/Menu/MenuAbstract.php:335 msgid "By respondent" msgstr "By patient" -#: classes/Gems/Menu/MenuAbstract.php:336 +#: classes/Gems/Menu/MenuAbstract.php:339 msgid "Bulk mail" msgstr "Bulk mail" -#: classes/Gems/Menu/MenuAbstract.php:354 +#: classes/Gems/Menu/MenuAbstract.php:357 msgid "Errors" msgstr "Errors" -#: classes/Gems/Menu/MenuAbstract.php:355 +#: classes/Gems/Menu/MenuAbstract.php:358 msgid "PHP" msgstr "PHP" -#: classes/Gems/Menu/MenuAbstract.php:358 +#: classes/Gems/Menu/MenuAbstract.php:361 msgid "Maintenance mode" msgstr "Maintenance mode" -#: classes/Gems/Menu/MenuAbstract.php:359 +#: classes/Gems/Menu/MenuAbstract.php:362 msgid "Clean cache" msgstr "Clean cache" -#: classes/Gems/Menu/MenuAbstract.php:426 +#: classes/Gems/Menu/MenuAbstract.php:429 msgid "Reset password" msgstr "Reset password" -#: classes/Gems/Menu/MenuAbstract.php:453 +#: classes/Gems/Menu/MenuAbstract.php:456 msgid "Check status" msgstr "Check status" -#: classes/Gems/Menu/MenuAbstract.php:454 +#: classes/Gems/Menu/MenuAbstract.php:457 msgid "Synchronize surveys" msgstr "Synchronize surveys" -#: classes/Gems/Menu/MenuAbstract.php:455 -#: classes/Gems/Menu/MenuAbstract.php:468 +#: classes/Gems/Menu/MenuAbstract.php:458 +#: classes/Gems/Menu/MenuAbstract.php:471 msgid "Check is answered" msgstr "Check is answered" -#: classes/Gems/Menu/MenuAbstract.php:456 +#: classes/Gems/Menu/MenuAbstract.php:459 msgid "Check attributes" msgstr "Check attributes" -#: classes/Gems/Menu/MenuAbstract.php:457 +#: classes/Gems/Menu/MenuAbstract.php:460 msgid "Synchronize all surveys" msgstr "Synchronize all surveys" -#: classes/Gems/Menu/MenuAbstract.php:458 -#: classes/Gems/Menu/MenuAbstract.php:469 +#: classes/Gems/Menu/MenuAbstract.php:461 +#: classes/Gems/Menu/MenuAbstract.php:472 msgid "Check all is answered" msgstr "Check all is answered" -#: classes/Gems/Menu/MenuAbstract.php:465 +#: classes/Gems/Menu/MenuAbstract.php:468 msgid "PDF" msgstr "PDF" -#: classes/Gems/Menu/MenuAbstract.php:503 +#: classes/Gems/Menu/MenuAbstract.php:506 msgid "Check assignments" msgstr "Check assignments" -#: classes/Gems/Menu/MenuAbstract.php:506 +#: classes/Gems/Menu/MenuAbstract.php:509 msgid "Check all assignments" msgstr "Check all assignments" @@ -3794,6 +3794,7 @@ msgstr "Y" #: classes/Gems/Selector/DateSelectorAbstract.php:563 +#: classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php:128 #: classes/Gems/Util/Translated.php:81 msgid "-" msgstr "n/a" @@ -3911,11 +3912,43 @@ msgid "(select a track)" msgstr "(select a track)" -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:178 -#: classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php:124 -msgid "No track selected..." -msgstr "No track selected..." +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:71 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:71 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:370 +msgid "Track start" +msgstr "Track start" +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:72 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:72 +#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:371 +msgid "Track end" +msgstr "Track end" + +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:151 +msgid "Missed deadline" +msgstr "Missed deadline" + +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:153 +msgid "Open - can be answered now" +msgstr "Open - can be answered now" + +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:155 +msgid "Valid from date unknown" +msgstr "Valid from date unknown" + +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:157 +msgid "Valid from date in the future" +msgstr "Valid from date in the future" + +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:159 +msgid "Token does not exist" +msgstr "Token does not exist" + +#: classes/Gems/Snippets/Tracker/Summary/SummaryTableSnippet.php:126 +#, php-format +msgid "%d%%" +msgstr "%d%%" + #: classes/Gems/Task/Db/ExecutePatch.php:66 #, php-format msgid "Executing patchlevel %d" @@ -4000,6 +4033,10 @@ msgid "Completed" msgstr "Completed" +#: classes/Gems/Tracker/Token.php:1040 classes/Gems/Tracker/Token.php:1042 +msgid "Future" +msgstr "Future" + #: classes/Gems/Tracker/Batch/SynchronizeSourcesBatch.php:135 msgid "No surveys were changed." msgstr "No surveys were changed." @@ -4051,14 +4088,6 @@ msgid "This track type does not allow the creation of new rounds." msgstr "This track type does not allow the creation of new rounds." -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:370 -msgid "Track start" -msgstr "Track start" - -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:371 -msgid "Track end" -msgstr "Track end" - #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:387 msgid "Start time" msgstr "Start time" @@ -4772,6 +4801,10 @@ msgid "Send one mail per respondent, mark only mailed tokens as send." msgstr "Send one mail per patient, mark only mailed tokens as send." +#: classes/Gems/Util/Translated.php:233 +msgid "Unknown" +msgstr "Unknown" + #: classes/Gems/Util/Translated.php:246 msgid "mr." msgstr "Mr." @@ -5250,8 +5283,8 @@ msgstr[1] "" "After this survey there are another %d surveys we would like you to answer." -#~ msgid "Survey can be answered until %s." -#~ msgstr "Survey can be answered until %s." +#~ msgid "Success" +#~ msgstr "Success" #~ msgid "Survey must be answered tomorrow!" #~ msgstr "Survey must be answered tomorrow!" @@ -5328,9 +5361,6 @@ #~ msgid "Dear {greeting}," #~ msgstr "Dear {greeting}," -#~ msgid "The token %s does not exist." -#~ msgstr "The token %s does not exist." - #~ msgid "" #~ "After answering the survey you will return to the respondent overview " #~ "screen." Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2013-01-17 17:34:35 UTC (rev 1111) +++ trunk/library/languages/default-nl.po 2013-01-18 17:26:18 UTC (rev 1112) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-16 19:27+0100\n" +"POT-Creation-Date: 2013-01-18 17:59+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -329,15 +329,15 @@ #: classes/Gems/Menu.php:323 classes/Gems/Menu.php:423 #: classes/Gems/Email/EmailFormAbstract.php:280 #: classes/Gems/Email/EmailFormAbstract.php:291 -#: classes/Gems/Menu/MenuAbstract.php:383 -#: classes/Gems/Menu/MenuAbstract.php:396 +#: classes/Gems/Menu/MenuAbstract.php:386 +#: classes/Gems/Menu/MenuAbstract.php:399 msgid "Preview" msgstr "Preview" #: classes/Gems/Menu.php:332 classes/Gems/Default/ExportAction.php:149 #: classes/Gems/Default/TrackMaintenanceAction.php:336 -#: classes/Gems/Menu/MenuAbstract.php:392 -#: classes/Gems/Menu/MenuAbstract.php:474 snippets/AddTracksSnippet.php:238 +#: classes/Gems/Menu/MenuAbstract.php:395 +#: classes/Gems/Menu/MenuAbstract.php:477 snippets/AddTracksSnippet.php:238 msgid "Tracks" msgstr "Trajecten" @@ -355,8 +355,8 @@ #: classes/Gems/Menu.php:377 #: classes/Gems/Default/SurveyMaintenanceAction.php:586 -#: classes/Gems/Menu/MenuAbstract.php:399 -#: classes/Gems/Menu/MenuAbstract.php:461 +#: classes/Gems/Menu/MenuAbstract.php:402 +#: classes/Gems/Menu/MenuAbstract.php:464 #: classes/Gems/Tracker/Model/TrackModel.php:100 msgid "Surveys" msgstr "Vragenlijsten" @@ -388,7 +388,7 @@ msgid "Overview" msgstr "Overzicht" -#: classes/Gems/Menu.php:593 classes/Gems/Menu/MenuAbstract.php:356 +#: classes/Gems/Menu.php:593 classes/Gems/Menu/MenuAbstract.php:359 msgid "Project" msgstr "Project" @@ -418,7 +418,7 @@ msgid "Changelog" msgstr "Changelog" -#: classes/Gems/Model.php:212 classes/Gems/Default/ComplianceAction.php:84 +#: classes/Gems/Model.php:212 classes/Gems/Default/ComplianceAction.php:86 #: classes/Gems/Tracker/Model/StandardTokenModel.php:213 msgid "Respondent nr" msgstr "Patiënt nr" @@ -476,7 +476,7 @@ #: classes/Gems/Default/SourceAction.php:195 #: classes/Gems/Default/StaffAction.php:328 #: classes/Gems/Default/SurveyMaintenanceAction.php:435 -#: classes/Gems/Default/TokenPlanAction.php:121 +#: classes/Gems/Default/TokenPlanAction.php:116 #: classes/Gems/Default/TrackFieldsAction.php:98 #: classes/Gems/Default/TrackMaintenanceAction.php:249 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:60 @@ -549,7 +549,7 @@ msgstr "Probeert upgrade voor %s naar niveau %s: %s" #: classes/Gems/Controller/BrowseEditAction.php:357 -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:239 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:261 #: classes/Gems/Default/StaffAction.php:228 #: classes/Gems/Snippets/ModelFormSnippetAbstract.php:186 #, php-format @@ -557,7 +557,7 @@ msgstr "Nieuwe %s..." #: classes/Gems/Controller/BrowseEditAction.php:390 -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:259 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:281 #: classes/Gems/Default/TrackFieldsAction.php:130 #: classes/Gems/Default/TrackRoundsAction.php:171 #, php-format @@ -580,19 +580,19 @@ msgstr "Bewerk %s %s" #: classes/Gems/Controller/BrowseEditAction.php:413 -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:269 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:291 #: classes/Gems/Snippets/ModelFormSnippetAbstract.php:188 #, php-format msgid "Edit %s" msgstr "Bewerk %s" #: classes/Gems/Controller/BrowseEditAction.php:516 -#: classes/Gems/Snippets/AutosearchFormSnippet.php:166 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:249 msgid "Free search text" msgstr "Vrije zoek tekst" #: classes/Gems/Controller/BrowseEditAction.php:587 -#: classes/Gems/Snippets/AutosearchFormSnippet.php:241 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:324 msgid "Search" msgstr "Zoeken" @@ -709,26 +709,26 @@ msgid "Cancel" msgstr "Annuleren" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:249 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:271 #, php-format msgid "Do you want to delete this %s?" msgstr "Weet u zeker dat deze %s verwijderd moet worden?" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:282 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:304 msgid "No data found." msgstr "Geen gegevens gevonden." -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:344 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:366 #, php-format msgid "No %s found..." msgstr "Geen %s gevonden..." -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:354 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:376 #, php-format msgid "Showing %s" msgstr "Toon %s" -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:390 +#: classes/Gems/Controller/ModelSnippetActionAbstract.php:412 #: classes/Gems/Default/OptionAction.php:181 #: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:341 msgid "item" @@ -810,19 +810,24 @@ msgid "The survey for token %s is no longer active." msgstr "De vragenlijst voor kenmerk %s is niet meer in gebruik." -#: classes/Gems/Default/ComplianceAction.php:85 +#: classes/Gems/Default/ComplianceAction.php:87 msgid "Start date" msgstr "Startdatum" -#: classes/Gems/Default/ComplianceAction.php:86 +#: classes/Gems/Default/ComplianceAction.php:88 msgid "End date" msgstr "Einddatum" -#: classes/Gems/Default/ComplianceAction.php:98 +#: classes/Gems/Default/ComplianceAction.php:93 +#: classes/Gems/Default/SummaryAction.php:192 +msgid "No track selected..." +msgstr "Geen traject geselecteerd..." + +#: classes/Gems/Default/ComplianceAction.php:173 msgid "Compliance" msgstr "Voortgang" -#: classes/Gems/Default/ComplianceAction.php:109 +#: classes/Gems/Default/ComplianceAction.php:184 #: classes/Gems/Default/ProjectTracksAction.php:85 #: classes/Gems/Default/TrackAction.php:452 #: classes/Gems/Default/TrackMaintenanceAction.php:331 @@ -1226,7 +1231,7 @@ #: classes/Gems/Default/ExportAction.php:154 #: classes/Gems/Default/MailJobAction.php:100 #: classes/Gems/Default/ProjectSurveysAction.php:67 -#: classes/Gems/Default/SummaryAction.php:155 +#: classes/Gems/Default/SummaryAction.php:168 #: classes/Gems/Default/SurveyAction.php:201 #: classes/Gems/Email/OneMailForm.php:57 #: classes/Gems/Export/RespondentExport.php:156 @@ -1437,32 +1442,30 @@ msgstr "Ongeldige taal instelling." #: classes/Gems/Default/LogAction.php:78 -#: classes/Gems/Default/TokenPlanAction.php:243 +#: classes/Gems/Default/TokenPlanAction.php:234 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:125 msgid "from" msgstr "vanaf" #: classes/Gems/Default/LogAction.php:83 -#: classes/Gems/Default/TokenPlanAction.php:248 +#: classes/Gems/Default/TokenPlanAction.php:238 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:141 msgid "until" msgstr "tot" #: classes/Gems/Default/LogAction.php:89 -#: classes/Gems/Default/TokenPlanAction.php:254 msgid "days" msgstr "dagen" #: classes/Gems/Default/LogAction.php:90 -#: classes/Gems/Default/TokenPlanAction.php:255 msgid "weeks" msgstr "weken" #: classes/Gems/Default/LogAction.php:91 -#: classes/Gems/Default/TokenPlanAction.php:256 msgid "months" msgstr "maanden" #: classes/Gems/Default/LogAction.php:92 -#: classes/Gems/Default/TokenPlanAction.php:257 msgid "years" msgstr "jaren" @@ -1517,7 +1520,7 @@ msgstr "Bericht" #: classes/Gems/Default/LogAction.php:198 -#: classes/Gems/Default/TokenPlanAction.php:116 +#: classes/Gems/Default/TokenPlanAction.php:111 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:55 #: snippets/RespondentDetailsSnippet.php:74 #: snippets/RespondentDetailsWithAssignmentsSnippet.php:148 @@ -2066,7 +2069,7 @@ msgstr "Sessie inhoud" #: classes/Gems/Default/ProjectInformationAction.php:226 -#: classes/Gems/Menu/MenuAbstract.php:357 +#: classes/Gems/Menu/MenuAbstract.php:360 msgid "Session" msgstr "Sessie" @@ -2083,6 +2086,7 @@ #: classes/Gems/Email/EmailFormAbstract.php:193 #: classes/Gems/Email/EmailFormAbstract.php:251 #: classes/Gems/Email/MailTemplateForm.php:81 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:112 #: classes/Gems/Tracker/Model/TrackModel.php:103 msgid "From" msgstr "Van" @@ -2539,7 +2543,7 @@ msgstr[1] "bronnen" #: classes/Gems/Default/SourceAction.php:249 -#: classes/Gems/Menu/MenuAbstract.php:452 +#: classes/Gems/Menu/MenuAbstract.php:455 msgid "Survey Sources" msgstr "Bronnen" @@ -2623,61 +2627,49 @@ msgid "You are not allowed to change this password." msgstr "U mag dit wachtwoord niet wijzigen." -#: classes/Gems/Default/SummaryAction.php:154 +#: classes/Gems/Default/SummaryAction.php:167 #: classes/Gems/Email/OneMailForm.php:55 #: classes/Gems/Export/RespondentExport.php:157 -#: classes/Gems/Menu/MenuAbstract.php:497 +#: classes/Gems/Menu/MenuAbstract.php:500 #: classes/Gems/Tracker/Model/StandardTokenModel.php:196 msgid "Round" msgstr "Ronde" -#: classes/Gems/Default/SummaryAction.php:156 -msgid "Filler" -msgstr "Invuller" - -#: classes/Gems/Default/SummaryAction.php:159 -#: classes/Gems/Default/TokenPlanAction.php:326 +#: classes/Gems/Default/SummaryAction.php:169 +#: classes/Gems/Default/TokenPlanAction.php:292 #: classes/Gems/Selector/TokenByGroupDateSelector.php:139 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceTableSnippet.php:149 msgid "Answered" msgstr "Beantwoord" -#: classes/Gems/Default/SummaryAction.php:160 -#: classes/Gems/Default/TokenPlanAction.php:327 +#: classes/Gems/Default/SummaryAction.php:170 +#: classes/Gems/Default/TokenPlanAction.php:293 #: classes/Gems/Selector/TokenByGroupDateSelector.php:129 #: classes/Gems/Tracker/Token.php:1038 #: snippets/RespondentTokenTabsSnippet.php:68 msgid "Missed" msgstr "Gemist" -#: classes/Gems/Default/SummaryAction.php:161 +#: classes/Gems/Default/SummaryAction.php:171 +#: classes/Gems/Default/TokenPlanAction.php:287 #: classes/Gems/Tracker/Token.php:1044 msgid "Open" msgstr "Open" -#: classes/Gems/Default/SummaryAction.php:162 -#: classes/Gems/Tracker/Token.php:1040 classes/Gems/Tracker/Token.php:1042 -msgid "Future" -msgstr "Toekomstig" +#: classes/Gems/Default/SummaryAction.php:172 +msgid "Total" +msgstr "Totaal" -#: classes/Gems/Default/SummaryAction.php:163 -#: classes/Gems/Util/Translated.php:233 -msgid "Unknown" -msgstr "Onbekend" +#: classes/Gems/Default/SummaryAction.php:180 +msgid "Filler" +msgstr "Invuller" -#: classes/Gems/Default/SummaryAction.php:165 -msgid "Success" -msgstr "Succes" - -#: classes/Gems/Default/SummaryAction.php:166 -msgid "Removed" -msgstr "Verwijderd" - -#: classes/Gems/Default/SummaryAction.php:179 +#: classes/Gems/Default/SummaryAction.php:205 msgid "Summary" msgstr "Samenvatting" -#: classes/Gems/Default/SummaryAction.php:190 -#: classes/Gems/Default/TokenPlanAction.php:480 +#: classes/Gems/Default/SummaryAction.php:216 +#: classes/Gems/Default/TokenPlanAction.php:463 #: classes/Gems/Default/TrackAction.php:450 #: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:141 msgid "token" @@ -2912,98 +2904,106 @@ msgid "Not used in tracks." msgstr "Niet in trajecten gebruikt." -#: classes/Gems/Default/TokenPlanAction.php:117 +#: classes/Gems/Default/TokenPlanAction.php:112 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:56 msgid "Round / Details" msgstr "Ronde / Details" -#: classes/Gems/Default/TokenPlanAction.php:118 -#: classes/Gems/Default/TokenPlanAction.php:233 +#: classes/Gems/Default/TokenPlanAction.php:113 +#: classes/Gems/Default/TokenPlanAction.php:223 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:57 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:73 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:385 msgid "Valid from" msgstr "Geldig vanaf" -#: classes/Gems/Default/TokenPlanAction.php:119 -#: classes/Gems/Default/TokenPlanAction.php:234 +#: classes/Gems/Default/TokenPlanAction.php:114 +#: classes/Gems/Default/TokenPlanAction.php:224 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:58 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:74 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:386 #: classes/Gems/Tracker/Model/StandardTokenModel.php:198 msgid "Valid until" msgstr "Geldig tot" -#: classes/Gems/Default/TokenPlanAction.php:120 +#: classes/Gems/Default/TokenPlanAction.php:115 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:59 msgid "Contact date" msgstr "Contactdatum" -#: classes/Gems/Default/TokenPlanAction.php:174 +#: classes/Gems/Default/TokenPlanAction.php:169 #, php-format msgid "Email %s" msgstr "Email %s" -#: classes/Gems/Default/TokenPlanAction.php:180 +#: classes/Gems/Default/TokenPlanAction.php:175 msgid "No tokens found." msgstr "Geen kenmerken gevonden." -#: classes/Gems/Default/TokenPlanAction.php:235 +#: classes/Gems/Default/TokenPlanAction.php:225 msgid "E-Mailed on" msgstr "Email verstuurd op" -#: classes/Gems/Default/TokenPlanAction.php:236 +#: classes/Gems/Default/TokenPlanAction.php:226 msgid "Completion date" msgstr "Datum ingevuld op" -#: classes/Gems/Default/TokenPlanAction.php:240 +#: classes/Gems/Default/TokenPlanAction.php:230 +#: classes/Gems/Snippets/AutosearchFormSnippet.php:116 msgid "For date" msgstr "Met datum" -#: classes/Gems/Default/TokenPlanAction.php:287 +#: classes/Gems/Default/TokenPlanAction.php:252 msgid "Select:" msgstr "Selecteren:" -#: classes/Gems/Default/TokenPlanAction.php:293 +#: classes/Gems/Default/TokenPlanAction.php:258 msgid "(all tracks)" msgstr "(alle trajecten)" -#: classes/Gems/Default/TokenPlanAction.php:304 +#: classes/Gems/Default/TokenPlanAction.php:269 msgid "(all rounds)" msgstr "(alle rondes)" -#: classes/Gems/Default/TokenPlanAction.php:318 +#: classes/Gems/Default/TokenPlanAction.php:283 msgid "(all surveys)" msgstr "(alle vragenlijsten)" -#: classes/Gems/Default/TokenPlanAction.php:321 +#: classes/Gems/Default/TokenPlanAction.php:286 msgid "(all actions)" msgstr "(alle acties)" -#: classes/Gems/Default/TokenPlanAction.php:322 +#: classes/Gems/Default/TokenPlanAction.php:288 msgid "Not emailed" msgstr "Niet gemaild" -#: classes/Gems/Default/TokenPlanAction.php:323 +#: classes/Gems/Default/TokenPlanAction.php:289 msgid "To email" msgstr "Te mailen" -#: classes/Gems/Default/TokenPlanAction.php:324 +#: classes/Gems/Default/TokenPlanAction.php:290 msgid "Needs reminder" msgstr "Herinnering nodig" -#: classes/Gems/Default/TokenPlanAction.php:325 +#: classes/Gems/Default/TokenPlanAction.php:291 msgid "Yet to Answer" msgstr "Nog te beantwoorden" -#: classes/Gems/Default/TokenPlanAction.php:341 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:79 +#: classes/Gems/Default/TokenPlanAction.php:294 +msgid "Removed" +msgstr "Verwijderd" + +#: classes/Gems/Default/TokenPlanAction.php:308 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:88 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:90 msgid "(all fillers)" msgstr "(alle invullers)" -#: classes/Gems/Default/TokenPlanAction.php:360 +#: classes/Gems/Default/TokenPlanAction.php:327 msgid "(all staff)" msgstr "(alle medewerkers)" -#: classes/Gems/Default/TokenPlanAction.php:471 +#: classes/Gems/Default/TokenPlanAction.php:454 #: classes/Gems/Snippets/TokenModelSnippetAbstract.php:59 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:122 #: snippets/BrowseSingleSurveyTokenSnippet.php:144 @@ -3011,7 +3011,7 @@ msgid "+" msgstr "+" -#: classes/Gems/Default/TokenPlanAction.php:485 +#: classes/Gems/Default/TokenPlanAction.php:468 msgid "Token planning" msgstr "Per kenmerk plannen" @@ -3243,7 +3243,7 @@ msgstr[1] "velden" #: classes/Gems/Default/TrackFieldsAction.php:175 -#: classes/Gems/Menu/MenuAbstract.php:477 +#: classes/Gems/Menu/MenuAbstract.php:480 msgid "Fields" msgstr "Velden" @@ -3375,7 +3375,7 @@ msgstr[1] "rondes" #: classes/Gems/Default/TrackRoundsAction.php:227 -#: classes/Gems/Menu/MenuAbstract.php:485 +#: classes/Gems/Menu/MenuAbstract.php:488 msgid "Rounds" msgstr "Rondes" @@ -3638,81 +3638,81 @@ msgid "Track Summary" msgstr "Traject Samenvatting" -#: classes/Gems/Menu/MenuAbstract.php:327 +#: classes/Gems/Menu/MenuAbstract.php:329 msgid "Track Compliance" msgstr "Traject Voortgang" -#: classes/Gems/Menu/MenuAbstract.php:330 +#: classes/Gems/Menu/MenuAbstract.php:333 msgid "By period" msgstr "Per periode" -#: classes/Gems/Menu/MenuAbstract.php:331 +#: classes/Gems/Menu/MenuAbstract.php:334 msgid "By token" msgstr "Per kenmerk" -#: classes/Gems/Menu/MenuAbstract.php:332 +#: classes/Gems/Menu/MenuAbstract.php:335 msgid "By respondent" msgstr "Per patiënt" -#: classes/Gems/Menu/MenuAbstract.php:336 +#: classes/Gems/Menu/MenuAbstract.php:339 msgid "Bulk mail" msgstr "Bulk mail" -#: cla... [truncated message content] |
From: <gem...@li...> - 2013-01-24 17:23:45
|
Revision: 1121 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1121&view=rev Author: matijsdejong Date: 2013-01-24 17:23:36 +0000 (Thu, 24 Jan 2013) Log Message: ----------- Fixed wrong translation Show code in survey overview Date selection now can include overlapping codes Fixed organization selection list in new overviews Modified Paths: -------------- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php trunk/library/classes/Gems/Default/TokenPlanAction.php trunk/library/classes/Gems/Events.php trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php trunk/library/classes/Gems/Tracker/Survey.php trunk/library/classes/Gems/Util/TrackData.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2013-01-24 17:23:36 UTC (rev 1121) @@ -461,9 +461,9 @@ $model->set('gsu_result_field', 'label', $this->_('Result field')); $model->set('gsu_duration', 'label', $this->_('Duration description'), 'description', $this->_('Text to inform the respondent, e.g. "20 seconds" or "1 minute".')); - - $model->setIfExists('gsu_code', 'label', $this->_('Code name'), 'size', 10, 'description', $this->_('Only for programmers.')); - + } + $model->setIfExists('gsu_code', 'label', $this->_('Code name'), 'size', 10, 'description', $this->_('Only for programmers.')); + if ($detailed) { $model->set('gsu_beforeanswering_event', 'label', $this->_('Before answering'), 'multiOptions', $events->listSurveyBeforeAnsweringEvents()); $model->set('gsu_completed_event', 'label', $this->_('After completion'), 'multiOptions', $events->listSurveyCompletionEvents()); $model->set('gsu_display_event', 'label', $this->_('Answer display'), 'multiOptions', $events->listSurveyDisplayEvents()); Modified: trunk/library/classes/Gems/Default/TokenPlanAction.php =================================================================== --- trunk/library/classes/Gems/Default/TokenPlanAction.php 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/classes/Gems/Default/TokenPlanAction.php 2013-01-24 17:23:36 UTC (rev 1121) @@ -62,7 +62,7 @@ // Row with dates and patient data $bridge->gtr_track_type; // Data needed for buttons - + $bridge->tr()->appendAttrib('class', $bridge->row_class); $bridge->setDefaultRowClass(MUtil_Html_TableElement::createAlternateRowClass('even', 'even', 'odd', 'odd')); @@ -220,6 +220,10 @@ } $dates = array( + '<gto_valid_from gto_valid_until' + => $this->_('Is valid during'), + '>gto_valid_from gto_valid_until' + => $this->_('Is valid within'), 'gto_valid_from' => $this->_('Valid from'), 'gto_valid_until' => $this->_('Valid until'), 'gto_mail_sent_date' => $this->_('E-Mailed on'), @@ -336,6 +340,7 @@ //Add default filter $filter = array(); if ($where = Gems_Snippets_AutosearchFormSnippet::getPeriodFilter($data, $this->db)) { + // MUtil_Echo::track($where); $filter[] = $where; } $filter['gto_id_organization'] = isset($data['gto_id_organization']) ? $data['gto_id_organization'] : $this->escort->getCurrentOrganization(); // Is overruled when set in param @@ -441,7 +446,8 @@ return array( 'datefrom' => $now->toString($inFormat), - 'dateused' => 'gto_valid_from', + 'dateused' => '<gto_valid_from gto_valid_until', + 'dateuntil' => $now->toString($inFormat), 'gto_id_organization' => $this->escort->getCurrentOrganization(), 'main_filter' => 'all', ); Modified: trunk/library/classes/Gems/Events.php =================================================================== --- trunk/library/classes/Gems/Events.php 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/classes/Gems/Events.php 2013-01-24 17:23:36 UTC (rev 1121) @@ -106,7 +106,7 @@ $paths[$prefix] = $dir . DIRECTORY_SEPARATOR . $eventType; } $paths[''] = APPLICATION_PATH . '/events/' . strtolower($eventType); - MUtil_Echo::track($paths); + // MUtil_Echo::track($paths); return $paths; } Modified: trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/classes/Gems/Snippets/AutosearchFormSnippet.php 2013-01-24 17:23:36 UTC (rev 1121) @@ -346,35 +346,111 @@ */ public static function getPeriodFilter(array $data, Zend_Db_Adapter_Abstract $db) { - if (isset($data['dateused'])) { - $options = array(); - MUtil_Model_FormBridge::applyFixedOptions('date', $options); + $isUsed = isset($data['dateused']) && $data['dateused']; + if (! $isUsed) { + return; + } - $outFormat = 'yyyy-MM-dd'; - $inFormat = isset($options['dateFormat']) ? $options['dateFormat'] : null; + $options = array(); + MUtil_Model_FormBridge::applyFixedOptions('date', $options); + $outFormat = 'yyyy-MM-dd'; + $inFormat = isset($options['dateFormat']) ? $options['dateFormat'] : null; - if (isset($data['datefrom']) && $data['datefrom']) { - if (isset($data['dateuntil']) && $data['dateuntil']) { + $isFrom = isset($data['datefrom']) && $data['datefrom'] && MUtil_Date::isDate($data['datefrom'], $inFormat); + $isUntil = isset($data['dateuntil']) && $data['dateuntil'] && MUtil_Date::isDate($data['dateuntil'], $inFormat); + if (! ($isFrom || $isUntil)) { + return; + } + + + switch ($data['dateused'][0]) { + case '<': + // overlaps + $periods = explode(' ', substr($data['dateused'], 1)); + + if ($isFrom && $isUntil) { return sprintf( + '(%1$s <= %4$s OR (%1$s IS NULL AND %2$s IS NOT NULL)) AND + (%2$s >= %3$s OR %2$s IS NULL)', + $db->quoteIdentifier($periods[0]), + $db->quoteIdentifier($periods[1]), + $db->quote(MUtil_Date::format($data['datefrom'], $outFormat, $inFormat)), + $db->quote(MUtil_Date::format($data['dateuntil'], $outFormat, $inFormat)) + ); + } + if ($isFrom) { + return sprintf( + '%2$s >= %3$s OR (%2$s IS NULL AND %1$s IS NOT NULL)', + $db->quoteIdentifier($periods[0]), + $db->quoteIdentifier($periods[1]), + $db->quote(MUtil_Date::format($data['datefrom'], $outFormat, $inFormat)) + ); + } + if ($isUntil) { + return sprintf( + '%1$s <= %3$s OR (%1$s IS NULL AND %2$s IS NOT NULL)', + $db->quoteIdentifier($periods[0]), + $db->quoteIdentifier($periods[1]), + $db->quote(MUtil_Date::format($data['dateuntil'], $outFormat, $inFormat)) + ); + } + return; + + case '>': + // within + $periods = explode(' ', substr($data['dateused'], 1)); + + if ($isFrom && $isUntil) { + return sprintf( + '%1$s >= %3$s AND %2$s <= %4$s', + $db->quoteIdentifier($periods[0]), + $db->quoteIdentifier($periods[1]), + $db->quote(MUtil_Date::format($data['datefrom'], $outFormat, $inFormat)), + $db->quote(MUtil_Date::format($data['dateuntil'], $outFormat, $inFormat)) + ); + } + if ($isFrom) { + return sprintf( + '%1$s >= %3$s AND (%2$s IS NULL OR %2$s >= %3$s)', + $db->quoteIdentifier($periods[0]), + $db->quoteIdentifier($periods[1]), + $db->quote(MUtil_Date::format($data['datefrom'], $outFormat, $inFormat)) + ); + } + if ($isUntil) { + return sprintf( + '%2$s <= %3$s AND (%1$s IS NULL OR %1$s <= %3$s)', + $db->quoteIdentifier($periods[0]), + $db->quoteIdentifier($periods[1]), + $db->quote(MUtil_Date::format($data['dateuntil'], $outFormat, $inFormat)) + ); + } + return; + + default: + if ($isFrom && $isUntil) { + return sprintf( '%s BETWEEN %s AND %s', $db->quoteIdentifier($data['dateused']), $db->quote(MUtil_Date::format($data['datefrom'], $outFormat, $inFormat)), $db->quote(MUtil_Date::format($data['dateuntil'], $outFormat, $inFormat)) ); } - return sprintf( - '%s >= %s', - $db->quoteIdentifier($data['dateused']), - $db->quote(MUtil_Date::format($data['datefrom'], $outFormat, $inFormat)) - ); - } - if (isset($data['dateuntil']) && $data['dateuntil']) { - return sprintf( - '%s <= %s', - $db->quoteIdentifier($data['dateused']), - $db->quote(MUtil_Date::format($data['dateuntil'], $outFormat, $inFormat)) - ); - } + if ($isFrom) { + return sprintf( + '%s >= %s', + $db->quoteIdentifier($data['dateused']), + $db->quote(MUtil_Date::format($data['datefrom'], $outFormat, $inFormat)) + ); + } + if ($isUntil) { + return sprintf( + '%s <= %s', + $db->quoteIdentifier($data['dateused']), + $db->quote(MUtil_Date::format($data['dateuntil'], $outFormat, $inFormat)) + ); + } + return; } } Modified: trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php 2013-01-24 17:23:36 UTC (rev 1121) @@ -47,6 +47,12 @@ class Gems_Snippets_Tracker_Compliance_ComplianceSearchFormSnippet extends Gems_Snippets_AutosearchFormSnippet { /** + * + * @var Gems_Loader + */ + protected $loader; + + /** * Returns a text element for autosearch. Can be overruled. * * The form / html elements to search on. Elements can be grouped by inserting null's between them. @@ -57,13 +63,17 @@ */ protected function getAutoSearchElements(array $data) { - $elements[] = $this->_createSelectElement('gr2t_id_track', + $elements[] = $this->_createSelectElement( + 'gr2t_id_track', $this->util->getTrackData()->getSteppedTracks(), - $this->_('(select a track)')); + $this->_('(select a track)') + ); - $elements[] = $this->_createSelectElement('gr2t_id_organization', - $this->util->getDbLookup()->getOrganizationsWithRespondents(), - $this->_('(all organizations)')); + $elements[] = $this->_createSelectElement( + 'gr2t_id_organization', + $this->loader->getCurrentUser()->getRespondentOrganizations(), + $this->_('(all organizations)') + ); $elements[] = null; Modified: trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php 2013-01-24 17:23:36 UTC (rev 1121) @@ -47,6 +47,12 @@ class Gems_Snippets_Tracker_Summary_SummarySearchFormSnippet extends Gems_Snippets_AutosearchFormSnippet { /** + * + * @var Gems_Loader + */ + protected $loader; + + /** * Returns a text element for autosearch. Can be overruled. * * The form / html elements to search on. Elements can be grouped by inserting null's between them. @@ -57,13 +63,17 @@ */ protected function getAutoSearchElements(array $data) { - $elements[] = $this->_createSelectElement('gto_id_track', + $elements[] = $this->_createSelectElement( + 'gto_id_track', $this->util->getTrackData()->getSteppedTracks(), - $this->_('(select a track)')); + $this->_('(select a track)') + ); - $elements[] = $this->_createSelectElement('gto_id_organization', - $this->util->getDbLookup()->getOrganizationsWithRespondents(), - $this->_('(all organizations)')); + $elements[] = $this->_createSelectElement( + 'gto_id_organization', + $this->loader->getCurrentUser()->getRespondentOrganizations(), + $this->_('(all organizations)') + ); $elements[] = null; Modified: trunk/library/classes/Gems/Tracker/Survey.php =================================================================== --- trunk/library/classes/Gems/Tracker/Survey.php 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/classes/Gems/Tracker/Survey.php 2013-01-24 17:23:36 UTC (rev 1121) @@ -36,7 +36,7 @@ */ /** - * Object representing a specific Survey + * Object representing a specific Survey * * @package Gems * @subpackage Tracker @@ -425,7 +425,7 @@ */ public function getSource() { - if (! $this->_source && isset($this->_gemsSurvey['gsu_id_source'])) { + if (! $this->_source && isset($this->_gemsSurvey['gsu_id_source']) && $this->_gemsSurvey['gsu_id_source']) { $this->_source = $this->tracker->getSource($this->_gemsSurvey['gsu_id_source']); if (! $this->_source) { Modified: trunk/library/classes/Gems/Util/TrackData.php =================================================================== --- trunk/library/classes/Gems/Util/TrackData.php 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/classes/Gems/Util/TrackData.php 2013-01-24 17:23:36 UTC (rev 1121) @@ -204,6 +204,30 @@ } /** + * + * @param string $code + * @return array survey id => survey name + */ + public function getSurveysByCode($code) + { + $cacheId = __CLASS__ . '_' . __FUNCTION__ . '_' . $code; + + if ($results = $this->cache->load($cacheId)) { + return $results; + } + + $select = $this->db->select(); + $select->from('gems__surveys', array('gsu_id_survey', 'gsu_survey_name')) + ->where("gsu_code = ?", $code) + ->where("gsu_active = 1") + ->order('gsu_survey_name'); + + $results = $this->db->fetchPairs($select); + $this->cache->save($results, $cacheId, array('surveys')); + return $results; + } + + /** * Returns array (id => name) of all 'T' tracks, sorted alphabetically * @return array */ Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/languages/default-en.po 2013-01-24 17:23:36 UTC (rev 1121) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-21 16:58+0100\n" +"POT-Creation-Date: 2013-01-24 18:21+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -1273,7 +1273,7 @@ #: classes/Gems/Default/SurveyMaintenanceAction.php:503 #: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:737 #: classes/Gems/Tracker/Model/TrackModel.php:102 -#: classes/Gems/Util/TrackData.php:147 +#: classes/Gems/Util/TrackData.php:153 msgid "Active" msgstr "Active" @@ -1434,13 +1434,13 @@ msgstr "Invalid language setting." #: classes/Gems/Default/LogAction.php:78 -#: classes/Gems/Default/TokenPlanAction.php:234 +#: classes/Gems/Default/TokenPlanAction.php:238 #: classes/Gems/Snippets/AutosearchFormSnippet.php:125 msgid "from" msgstr "from" #: classes/Gems/Default/LogAction.php:83 -#: classes/Gems/Default/TokenPlanAction.php:238 +#: classes/Gems/Default/TokenPlanAction.php:242 #: classes/Gems/Snippets/AutosearchFormSnippet.php:141 msgid "until" msgstr "until" @@ -1759,8 +1759,8 @@ #: classes/Gems/Default/RespondentAction.php:386 #: classes/Gems/Default/StaffAction.php:335 #: classes/Gems/Default/StaffAction.php:405 -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:66 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:66 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:75 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:75 msgid "(all organizations)" msgstr "(all organizations)" @@ -2620,14 +2620,14 @@ msgstr "Round" #: classes/Gems/Default/SummaryAction.php:111 -#: classes/Gems/Default/TokenPlanAction.php:292 +#: classes/Gems/Default/TokenPlanAction.php:296 #: classes/Gems/Selector/TokenByGroupDateSelector.php:139 #: classes/Gems/Util/TokenData.php:67 msgid "Answered" msgstr "Answered" #: classes/Gems/Default/SummaryAction.php:112 -#: classes/Gems/Default/TokenPlanAction.php:293 +#: classes/Gems/Default/TokenPlanAction.php:297 #: classes/Gems/Selector/TokenByGroupDateSelector.php:129 #: classes/Gems/Tracker/Token.php:1038 #: snippets/RespondentTokenTabsSnippet.php:68 @@ -2635,7 +2635,7 @@ msgstr "Missed" #: classes/Gems/Default/SummaryAction.php:113 -#: classes/Gems/Default/TokenPlanAction.php:287 +#: classes/Gems/Default/TokenPlanAction.php:291 #: classes/Gems/Tracker/Token.php:1044 msgid "Open" msgstr "Open" @@ -2653,7 +2653,7 @@ msgstr "Summary" #: classes/Gems/Default/SummaryAction.php:228 -#: classes/Gems/Default/TokenPlanAction.php:463 +#: classes/Gems/Default/TokenPlanAction.php:469 #: classes/Gems/Default/TrackAction.php:450 #: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:141 msgid "token" @@ -2891,17 +2891,17 @@ msgstr "Round / Details" #: classes/Gems/Default/TokenPlanAction.php:113 -#: classes/Gems/Default/TokenPlanAction.php:223 +#: classes/Gems/Default/TokenPlanAction.php:227 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:57 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:73 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:83 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:385 msgid "Valid from" msgstr "Valid from" #: classes/Gems/Default/TokenPlanAction.php:114 -#: classes/Gems/Default/TokenPlanAction.php:224 +#: classes/Gems/Default/TokenPlanAction.php:228 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:58 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:74 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:84 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:386 #: classes/Gems/Tracker/Model/StandardTokenModel.php:198 msgid "Valid until" @@ -2921,70 +2921,78 @@ msgid "No tokens found." msgstr "No tokens found." -#: classes/Gems/Default/TokenPlanAction.php:225 +#: classes/Gems/Default/TokenPlanAction.php:224 +msgid "Is valid during" +msgstr "Is valid during" + +#: classes/Gems/Default/TokenPlanAction.php:226 +msgid "Is valid within" +msgstr "Is valid within" + +#: classes/Gems/Default/TokenPlanAction.php:229 msgid "E-Mailed on" msgstr "E-Mailed on" -#: classes/Gems/Default/TokenPlanAction.php:226 +#: classes/Gems/Default/TokenPlanAction.php:230 msgid "Completion date" msgstr "Completion date" -#: classes/Gems/Default/TokenPlanAction.php:230 +#: classes/Gems/Default/TokenPlanAction.php:234 #: classes/Gems/Snippets/AutosearchFormSnippet.php:116 msgid "For date" msgstr "For date" -#: classes/Gems/Default/TokenPlanAction.php:252 +#: classes/Gems/Default/TokenPlanAction.php:256 msgid "Select:" msgstr "Select:" -#: classes/Gems/Default/TokenPlanAction.php:258 +#: classes/Gems/Default/TokenPlanAction.php:262 msgid "(all tracks)" msgstr "(all tracks)" -#: classes/Gems/Default/TokenPlanAction.php:269 +#: classes/Gems/Default/TokenPlanAction.php:273 msgid "(all rounds)" msgstr "(all rounds)" -#: classes/Gems/Default/TokenPlanAction.php:283 +#: classes/Gems/Default/TokenPlanAction.php:287 msgid "(all surveys)" msgstr "(all surveys)" -#: classes/Gems/Default/TokenPlanAction.php:286 +#: classes/Gems/Default/TokenPlanAction.php:290 msgid "(all actions)" msgstr "(all actions)" -#: classes/Gems/Default/TokenPlanAction.php:288 +#: classes/Gems/Default/TokenPlanAction.php:292 msgid "Not emailed" msgstr "Not emailed" -#: classes/Gems/Default/TokenPlanAction.php:289 +#: classes/Gems/Default/TokenPlanAction.php:293 msgid "To email" msgstr "To email" -#: classes/Gems/Default/TokenPlanAction.php:290 +#: classes/Gems/Default/TokenPlanAction.php:294 msgid "Needs reminder" msgstr "Needs reminder" -#: classes/Gems/Default/TokenPlanAction.php:291 +#: classes/Gems/Default/TokenPlanAction.php:295 msgid "Yet to Answer" msgstr "Yet to Answer" -#: classes/Gems/Default/TokenPlanAction.php:294 +#: classes/Gems/Default/TokenPlanAction.php:298 msgid "Removed" msgstr "Removed" -#: classes/Gems/Default/TokenPlanAction.php:308 -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:88 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:90 +#: classes/Gems/Default/TokenPlanAction.php:312 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:98 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:100 msgid "(all fillers)" msgstr "(all fillers)" -#: classes/Gems/Default/TokenPlanAction.php:327 +#: classes/Gems/Default/TokenPlanAction.php:331 msgid "(all staff)" msgstr "(all staff)" -#: classes/Gems/Default/TokenPlanAction.php:454 +#: classes/Gems/Default/TokenPlanAction.php:460 #: classes/Gems/Snippets/TokenModelSnippetAbstract.php:59 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:122 #: snippets/BrowseSingleSurveyTokenSnippet.php:144 @@ -2992,7 +3000,7 @@ msgid "+" msgstr "+" -#: classes/Gems/Default/TokenPlanAction.php:468 +#: classes/Gems/Default/TokenPlanAction.php:474 msgid "Token planning" msgstr "Token planning" @@ -3911,19 +3919,19 @@ msgid "Legend" msgstr "Legend" -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:62 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:62 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:69 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:69 msgid "(select a track)" msgstr "(select a track)" -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:71 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:71 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:81 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:81 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:370 msgid "Track start" msgstr "Track start" -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:72 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:72 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:82 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:82 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:371 msgid "Track end" msgstr "Track end" @@ -4704,35 +4712,35 @@ msgid "Token does not exist" msgstr "Token does not exist" -#: classes/Gems/Util/TrackData.php:147 +#: classes/Gems/Util/TrackData.php:153 msgid "Inactive" msgstr "Inactive" -#: classes/Gems/Util/TrackData.php:179 +#: classes/Gems/Util/TrackData.php:185 msgid "Minutes" msgstr "Minutes" -#: classes/Gems/Util/TrackData.php:180 +#: classes/Gems/Util/TrackData.php:186 msgid "Hours" msgstr "Hours" -#: classes/Gems/Util/TrackData.php:181 +#: classes/Gems/Util/TrackData.php:187 msgid "Days" msgstr "Days" -#: classes/Gems/Util/TrackData.php:182 +#: classes/Gems/Util/TrackData.php:188 msgid "Weeks" msgstr "Weeks" -#: classes/Gems/Util/TrackData.php:183 +#: classes/Gems/Util/TrackData.php:189 msgid "Months" msgstr "Months" -#: classes/Gems/Util/TrackData.php:184 +#: classes/Gems/Util/TrackData.php:190 msgid "Quarters" msgstr "Quarters" -#: classes/Gems/Util/TrackData.php:185 +#: classes/Gems/Util/TrackData.php:191 msgid "Years" msgstr "Years" @@ -5318,9 +5326,6 @@ #~ "Only for unanswered tokens: updates the survey of a token when changed in " #~ "the track." -#~ msgid "Invalid organization." -#~ msgstr "Invalid organization." - #~ msgid "Check all is answersed" #~ msgstr "Check all is answersed" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2013-01-22 18:30:24 UTC (rev 1120) +++ trunk/library/languages/default-nl.po 2013-01-24 17:23:36 UTC (rev 1121) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-21 16:58+0100\n" +"POT-Creation-Date: 2013-01-24 18:21+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -1278,7 +1278,7 @@ #: classes/Gems/Default/SurveyMaintenanceAction.php:503 #: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:737 #: classes/Gems/Tracker/Model/TrackModel.php:102 -#: classes/Gems/Util/TrackData.php:147 +#: classes/Gems/Util/TrackData.php:153 msgid "Active" msgstr "Actief" @@ -1442,13 +1442,13 @@ msgstr "Ongeldige taal instelling." #: classes/Gems/Default/LogAction.php:78 -#: classes/Gems/Default/TokenPlanAction.php:234 +#: classes/Gems/Default/TokenPlanAction.php:238 #: classes/Gems/Snippets/AutosearchFormSnippet.php:125 msgid "from" msgstr "vanaf" #: classes/Gems/Default/LogAction.php:83 -#: classes/Gems/Default/TokenPlanAction.php:238 +#: classes/Gems/Default/TokenPlanAction.php:242 #: classes/Gems/Snippets/AutosearchFormSnippet.php:141 msgid "until" msgstr "tot" @@ -1768,8 +1768,8 @@ #: classes/Gems/Default/RespondentAction.php:386 #: classes/Gems/Default/StaffAction.php:335 #: classes/Gems/Default/StaffAction.php:405 -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:66 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:66 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:75 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:75 msgid "(all organizations)" msgstr "(alle organisaties)" @@ -2636,14 +2636,14 @@ msgstr "Ronde" #: classes/Gems/Default/SummaryAction.php:111 -#: classes/Gems/Default/TokenPlanAction.php:292 +#: classes/Gems/Default/TokenPlanAction.php:296 #: classes/Gems/Selector/TokenByGroupDateSelector.php:139 #: classes/Gems/Util/TokenData.php:67 msgid "Answered" msgstr "Beantwoord" #: classes/Gems/Default/SummaryAction.php:112 -#: classes/Gems/Default/TokenPlanAction.php:293 +#: classes/Gems/Default/TokenPlanAction.php:297 #: classes/Gems/Selector/TokenByGroupDateSelector.php:129 #: classes/Gems/Tracker/Token.php:1038 #: snippets/RespondentTokenTabsSnippet.php:68 @@ -2651,7 +2651,7 @@ msgstr "Gemist" #: classes/Gems/Default/SummaryAction.php:113 -#: classes/Gems/Default/TokenPlanAction.php:287 +#: classes/Gems/Default/TokenPlanAction.php:291 #: classes/Gems/Tracker/Token.php:1044 msgid "Open" msgstr "Open" @@ -2669,7 +2669,7 @@ msgstr "Samenvatting" #: classes/Gems/Default/SummaryAction.php:228 -#: classes/Gems/Default/TokenPlanAction.php:463 +#: classes/Gems/Default/TokenPlanAction.php:469 #: classes/Gems/Default/TrackAction.php:450 #: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:141 msgid "token" @@ -2910,17 +2910,17 @@ msgstr "Ronde / Details" #: classes/Gems/Default/TokenPlanAction.php:113 -#: classes/Gems/Default/TokenPlanAction.php:223 +#: classes/Gems/Default/TokenPlanAction.php:227 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:57 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:73 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:83 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:385 msgid "Valid from" msgstr "Geldig vanaf" #: classes/Gems/Default/TokenPlanAction.php:114 -#: classes/Gems/Default/TokenPlanAction.php:224 +#: classes/Gems/Default/TokenPlanAction.php:228 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:58 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:74 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:84 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:386 #: classes/Gems/Tracker/Model/StandardTokenModel.php:198 msgid "Valid until" @@ -2940,70 +2940,78 @@ msgid "No tokens found." msgstr "Geen kenmerken gevonden." -#: classes/Gems/Default/TokenPlanAction.php:225 +#: classes/Gems/Default/TokenPlanAction.php:224 +msgid "Is valid during" +msgstr "Is geldig gedurende" + +#: classes/Gems/Default/TokenPlanAction.php:226 +msgid "Is valid within" +msgstr "Is geldig tijdens" + +#: classes/Gems/Default/TokenPlanAction.php:229 msgid "E-Mailed on" msgstr "Email verstuurd op" -#: classes/Gems/Default/TokenPlanAction.php:226 +#: classes/Gems/Default/TokenPlanAction.php:230 msgid "Completion date" msgstr "Datum ingevuld op" -#: classes/Gems/Default/TokenPlanAction.php:230 +#: classes/Gems/Default/TokenPlanAction.php:234 #: classes/Gems/Snippets/AutosearchFormSnippet.php:116 msgid "For date" msgstr "Met datum" -#: classes/Gems/Default/TokenPlanAction.php:252 +#: classes/Gems/Default/TokenPlanAction.php:256 msgid "Select:" msgstr "Selecteren:" -#: classes/Gems/Default/TokenPlanAction.php:258 +#: classes/Gems/Default/TokenPlanAction.php:262 msgid "(all tracks)" msgstr "(alle trajecten)" -#: classes/Gems/Default/TokenPlanAction.php:269 +#: classes/Gems/Default/TokenPlanAction.php:273 msgid "(all rounds)" msgstr "(alle rondes)" -#: classes/Gems/Default/TokenPlanAction.php:283 +#: classes/Gems/Default/TokenPlanAction.php:287 msgid "(all surveys)" msgstr "(alle vragenlijsten)" -#: classes/Gems/Default/TokenPlanAction.php:286 +#: classes/Gems/Default/TokenPlanAction.php:290 msgid "(all actions)" msgstr "(alle acties)" -#: classes/Gems/Default/TokenPlanAction.php:288 +#: classes/Gems/Default/TokenPlanAction.php:292 msgid "Not emailed" msgstr "Niet gemaild" -#: classes/Gems/Default/TokenPlanAction.php:289 +#: classes/Gems/Default/TokenPlanAction.php:293 msgid "To email" msgstr "Te mailen" -#: classes/Gems/Default/TokenPlanAction.php:290 +#: classes/Gems/Default/TokenPlanAction.php:294 msgid "Needs reminder" msgstr "Herinnering nodig" -#: classes/Gems/Default/TokenPlanAction.php:291 +#: classes/Gems/Default/TokenPlanAction.php:295 msgid "Yet to Answer" msgstr "Nog te beantwoorden" -#: classes/Gems/Default/TokenPlanAction.php:294 +#: classes/Gems/Default/TokenPlanAction.php:298 msgid "Removed" msgstr "Verwijderd" -#: classes/Gems/Default/TokenPlanAction.php:308 -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:88 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:90 +#: classes/Gems/Default/TokenPlanAction.php:312 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:98 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:100 msgid "(all fillers)" msgstr "(alle invullers)" -#: classes/Gems/Default/TokenPlanAction.php:327 +#: classes/Gems/Default/TokenPlanAction.php:331 msgid "(all staff)" msgstr "(alle medewerkers)" -#: classes/Gems/Default/TokenPlanAction.php:454 +#: classes/Gems/Default/TokenPlanAction.php:460 #: classes/Gems/Snippets/TokenModelSnippetAbstract.php:59 #: classes/Gems/Snippets/TokenPlanTableSnippet.php:122 #: snippets/BrowseSingleSurveyTokenSnippet.php:144 @@ -3011,7 +3019,7 @@ msgid "+" msgstr "+" -#: classes/Gems/Default/TokenPlanAction.php:468 +#: classes/Gems/Default/TokenPlanAction.php:474 msgid "Token planning" msgstr "Per kenmerk plannen" @@ -3079,7 +3087,7 @@ #: classes/Gems/Default/TrackAction.php:461 #, php-format msgid "Tracks assigned to %s: %s" -msgstr "Geen traject toegewezen aan patiënt nr: %s: %s" +msgstr "Trajecten toegewezen aan patiënt nr: %s: %s" #: classes/Gems/Default/TrackAction.php:489 #, php-format @@ -3939,19 +3947,19 @@ msgid "Legend" msgstr "Legenda" -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:62 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:62 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:69 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:69 msgid "(select a track)" msgstr "(selecteer een traject)" -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:71 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:71 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:81 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:81 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:370 msgid "Track start" msgstr "Traject start" -#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:72 -#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:72 +#: classes/Gems/Snippets/Tracker/Compliance/ComplianceSearchFormSnippet.php:82 +#: classes/Gems/Snippets/Tracker/Summary/SummarySearchFormSnippet.php:82 #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:371 msgid "Track end" msgstr "Traject einde" @@ -4106,7 +4114,7 @@ #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:387 msgid "Start time" -msgstr "Starten tijd" +msgstr "Start tijd" #: classes/Gems/Tracker/Engine/StepEngineAbstract.php:388 msgid "Completion time" @@ -4749,35 +4757,35 @@ msgid "Token does not exist" msgstr "Kenmerk bestaat niet" -#: classes/Gems/Util/TrackData.php:147 +#: classes/Gems/Util/TrackData.php:153 msgid "Inactive" msgstr "Inactief" -#: classes/Gems/Util/TrackData.php:179 +#: classes/Gems/Util/TrackData.php:185 msgid "Minutes" msgstr "Minuten" -#: classes/Gems/Util/TrackData.php:180 +#: classes/Gems/Util/TrackData.php:186 msgid "Hours" msgstr "Uren" -#: classes/Gems/Util/TrackData.php:181 +#: classes/Gems/Util/TrackData.php:187 msgid "Days" msgstr "Dagen" -#: classes/Gems/Util/TrackData.php:182 +#: classes/Gems/Util/TrackData.php:188 msgid "Weeks" msgstr "Weken" -#: classes/Gems/Util/TrackData.php:183 +#: classes/Gems/Util/TrackData.php:189 msgid "Months" msgstr "Maanden" -#: classes/Gems/Util/TrackData.php:184 +#: classes/Gems/Util/TrackData.php:190 msgid "Quarters" msgstr "Kwartieren" -#: classes/Gems/Util/TrackData.php:185 +#: classes/Gems/Util/TrackData.php:191 msgid "Years" msgstr "Jaren" @@ -5364,9 +5372,6 @@ #~ msgid "Some help for this export" #~ msgstr "Uitleg over deze export mogelijkheid" -#~ msgid "Invalid organization." -#~ msgstr "Ongeldige organisatie." - #~ msgid "Check all is answersed" #~ msgstr "Controleer alles is beantwoord" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-02-14 16:54:10
|
Revision: 1140 http://sourceforge.net/p/gemstracker/code/1140 Author: matijsdejong Date: 2013-02-14 16:54:06 +0000 (Thu, 14 Feb 2013) Log Message: ----------- Enabled RespondentModel.php to work when there are no organizations Removed old unused code from rest Modified Paths: -------------- trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php trunk/library/configs/db/tables/gems__respondents.30.sql Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-02-07 17:54:51 UTC (rev 1139) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-02-14 16:54:06 UTC (rev 1140) @@ -105,8 +105,10 @@ if (! isset($filter['gr2o_id_organization'])) { if ($this->isMultiOrganization() && !isset($filter['gr2o_patient_nr'])) { + $allowed = $this->user->getAllowedOrganizations(); + // If we are not looking for a specific patient, we can look at all patients - $filter[] = 'gr2o_id_organization IN (' . implode(', ', array_keys($this->user->getAllowedOrganizations())) . ')'; + $filter['gr2o_id_organization'] = array_keys($allowed); } else { // Otherwise, we can only see in our current organization $filter['gr2o_id_organization'] = $this->getCurrentOrganization(); Modified: trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-02-07 17:54:51 UTC (rev 1139) +++ trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-02-14 16:54:06 UTC (rev 1140) @@ -128,7 +128,6 @@ { $select = $this->getSelect(); - if ($this->hasItemsUsed()) { // Add expression columns by default // getColumn() triggers the columns as 'used' Modified: trunk/library/configs/db/tables/gems__respondents.30.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondents.30.sql 2013-02-07 17:54:51 UTC (rev 1139) +++ trunk/library/configs/db/tables/gems__respondents.30.sql 2013-02-14 16:54:06 UTC (rev 1140) @@ -2,33 +2,9 @@ CREATE TABLE if not exists gems__respondents ( grs_id_user bigint unsigned not null auto_increment references gems__user_ids (gui_id_user), - -- grs_login varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' - -- null unique key, - -- grs_password varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, - grs_ssn varchar(32) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null unique key, --- Naam --- Adres --- Woonplaats --- Tel. nr --- geb. datum --- aandoening (code bijv: ICD9, DBC etc) --- aangedaan lichaamsdeel --- uitgevoerde behandeling --- hand dominantie --- behandelend arts --- beroep/ hobby's --- OK/ behandel datum --- email - -- grs_staff boolean not null default 0, - -- grs_respondent boolean not null default 1, - -- grs_active boolean not null default 1, - -- grs_id_supervisor bigint unsigned default 1 - -- references gems_staff (grs_id_user), - -- grs_id_primary_group bigint unsigned - -- references gems__groups (umg_id_group), grs_iso_lang char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'en', grs_email varchar(100) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, @@ -38,10 +14,7 @@ grs_last_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', grs_gender char(1) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'U', - -- grs_dexterity char(1) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' - -- not null default 'U', grs_birthday date, - -- grs_function varchar(40) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', grs_address_1 varchar(80) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', grs_address_2 varchar(80) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', @@ -53,9 +26,6 @@ -- grs_phone_2 varchar(25) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', -- grs_phone_3 varchar(25) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', - -- grs_id_reception_code bigint unsigned not null default 1 - -- references gems__reception_codes (umrc_id_reception_code), - grs_changed timestamp not null default current_timestamp on update current_timestamp, grs_changed_by bigint unsigned not null, grs_created timestamp not null, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-02-19 17:11:10
|
Revision: 1148 http://sourceforge.net/p/gemstracker/code/1148 Author: matijsdejong Date: 2013-02-19 17:11:09 +0000 (Tue, 19 Feb 2013) Log Message: ----------- Whitespace can be used to separate respondent ids during export Modified Paths: -------------- trunk/library/classes/Gems/Default/RespondentExportAction.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/classes/Gems/Default/RespondentExportAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentExportAction.php 2013-02-19 10:32:35 UTC (rev 1147) +++ trunk/library/classes/Gems/Default/RespondentExportAction.php 2013-02-19 17:11:09 UTC (rev 1148) @@ -56,7 +56,7 @@ ->setAttrib('cols', 60) ->setAttrib('rows', 4) ->setOrder(-1) - ->setDescription($this->_('Separate multiple respondents with a comma (,)')); + ->setDescription($this->_('Separate multiple respondents with a comma (,) or whitespace')); $form->addElement($element); @@ -69,8 +69,8 @@ $form->populate($request->getParams()); if ($request->isPost()) { - $respondents = explode(',', $request->getParam('id')); - $respondents = array_map('trim', $respondents); + $respondents = preg_split('/[\s,]/', $request->getParam('id')); + $respondents = array_filter(array_map('trim', $respondents)); $export->render($respondents, $this->getRequest()->getParam('group'), $this->getRequest()->getParam('format')); } Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2013-02-19 10:32:35 UTC (rev 1147) +++ trunk/library/languages/default-en.po 2013-02-19 17:11:09 UTC (rev 1148) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-15 18:23+0100\n" +"POT-Creation-Date: 2013-02-19 18:03+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -2428,8 +2428,8 @@ msgstr "Patient numbers" #: classes/Gems/Default/RespondentExportAction.php:59 -msgid "Separate multiple respondents with a comma (,)" -msgstr "Separate multiple respondents with a comma (,)" +msgid "Separate multiple respondents with a comma (,) or whitespace" +msgstr "Separate multiple patients with a comma (,) or whitespace" #: classes/Gems/Default/RespondentPlanAction.php:67 #: classes/Gems/Default/SurveyAction.php:181 Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2013-02-19 10:32:35 UTC (rev 1147) +++ trunk/library/languages/default-nl.po 2013-02-19 17:11:09 UTC (rev 1148) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-15 18:22+0100\n" +"POT-Creation-Date: 2013-02-19 18:03+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -2437,8 +2437,10 @@ msgstr "Patiënt nummers" #: classes/Gems/Default/RespondentExportAction.php:59 -msgid "Separate multiple respondents with a comma (,)" -msgstr "Scheid meerdere patienten met een comma (,)" +msgid "Separate multiple respondents with a comma (,) or whitespace" +msgstr "" +"Scheid verschillende patiënten met een comma (,), spatie, tab of een nieuwe " +"regel" #: classes/Gems/Default/RespondentPlanAction.php:67 #: classes/Gems/Default/SurveyAction.php:181 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-05 17:53:43
|
Revision: 1170 http://sourceforge.net/p/gemstracker/code/1170 Author: matijsdejong Date: 2013-03-05 17:53:39 +0000 (Tue, 05 Mar 2013) Log Message: ----------- Made JoinTransformer.php easier to extend in specialized circumstances The from Html element now returns the added Html element on __call instead of the object itself Organization_ChooseOrganizationSnippet uses .larger class instead of inline stle attribute Sorted functions in TrackData.php Modified Paths: -------------- trunk/library/classes/Gems/Util/TrackData.php trunk/library/classes/MUtil/Form/Element/Html.php trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php trunk/library/snippets/Organization/ChooseOrganizationSnippet.php Modified: trunk/library/classes/Gems/Util/TrackData.php =================================================================== --- trunk/library/classes/Gems/Util/TrackData.php 2013-03-05 17:51:12 UTC (rev 1169) +++ trunk/library/classes/Gems/Util/TrackData.php 2013-03-05 17:53:39 UTC (rev 1170) @@ -204,6 +204,22 @@ } /** + * Returns array (id => name) of all 'T' tracks, sorted alphabetically + * @return array + */ + public function getSteppedTracks() + { + static $tracks; + + if (! $tracks) { + $tracks = $this->db->fetchPairs("SELECT gtr_id_track, gtr_track_name FROM gems__tracks WHERE gtr_track_type = 'T' ORDER BY gtr_track_name"); + } + + return $tracks; + } + + /** + * Get all the surveys for a certain code * * @param string $code * @return array survey id => survey name @@ -228,22 +244,6 @@ } /** - * Returns array (id => name) of all 'T' tracks, sorted alphabetically - * @return array - */ - public function getSteppedTracks() - { - static $tracks; - - if (! $tracks) { - $tracks = $this->db->fetchPairs("SELECT gtr_id_track, gtr_track_name FROM gems__tracks WHERE gtr_track_type = 'T' ORDER BY gtr_track_name"); - } - - return $tracks; - } - - - /** * Returns array (id => name) of the track date fields for this track, sorted by order * * @param int $trackId Modified: trunk/library/classes/MUtil/Form/Element/Html.php =================================================================== --- trunk/library/classes/MUtil/Form/Element/Html.php 2013-03-05 17:51:12 UTC (rev 1169) +++ trunk/library/classes/MUtil/Form/Element/Html.php 2013-03-05 17:53:39 UTC (rev 1170) @@ -51,7 +51,7 @@ * * @param string $method * @param array $args - * @return string + * @return MUtil_Html_HtmlElement or at least something that implements the MUtil_Html_HtmlInterface interface * @throws Zend_Form_Exception for invalid decorator or invalid method call */ public function __call($method, $args) @@ -70,7 +70,7 @@ $value->append($elem); $this->setValue($value); - return $this; + return $elem; } /** Modified: trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php =================================================================== --- trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php 2013-03-05 17:51:12 UTC (rev 1169) +++ trunk/library/classes/MUtil/Model/Transform/JoinTransformer.php 2013-03-05 17:53:39 UTC (rev 1170) @@ -133,63 +133,75 @@ } foreach ($this->_subModels as $name => $sub) { - /* @var $sub MUtil_Model_ModelAbstract */ + $this->transformSubModel($model, $sub, $data, $name); + } + // MUtil_Echo::track($data); - if (1 === count($this->_joins[$name])) { - $mkey = key($this->_joins[$name]); - $skey = reset($this->_joins[$name]); + return $data; + } - $mfor = MUtil_Ra::column($mkey, $data); + /** + * Function to allow overruling of transform for certain models + * + * @param MUtil_Model_ModelAbstract $model + * @param MUtil_Model_ModelAbstract $sub + * @param array $data + * @param string $name + */ + protected function transformSubModel + (MUtil_Model_ModelAbstract $model, MUtil_Model_ModelAbstract $sub, array &$data, $name) + { + if (1 === count($this->_joins[$name])) { + $mkey = key($this->_joins[$name]); + $skey = reset($this->_joins[$name]); - // MUtil_Echo::track($mfor); + $mfor = MUtil_Ra::column($mkey, $data); - $sdata = $sub->load(array($skey => $mfor)); - // MUtil_Echo::track($sdata); + // MUtil_Echo::track($mfor); - if ($sdata) { - $skeys = array_flip(MUtil_Ra::column($skey, $sdata)); - $empty = array_fill_keys(array_keys(reset($sdata)), null); + $sdata = $sub->load(array($skey => $mfor)); + // MUtil_Echo::track($sdata); - foreach ($data as &$mrow) { - $mfind = $mrow[$mkey]; + if ($sdata) { + $skeys = array_flip(MUtil_Ra::column($skey, $sdata)); + $empty = array_fill_keys(array_keys(reset($sdata)), null); - if (isset($skeys[$mfind])) { - $mrow += $sdata[$skeys[$mfind]]; - } else { - $mrow += $empty; - } - } - } else { - $empty = array_fill_keys($sub->getItemNames(), null); + foreach ($data as &$mrow) { + $mfind = $mrow[$mkey]; - foreach ($data as &$mrow) { + if (isset($skeys[$mfind])) { + $mrow += $sdata[$skeys[$mfind]]; + } else { $mrow += $empty; } } } else { $empty = array_fill_keys($sub->getItemNames(), null); + foreach ($data as &$mrow) { - $filter = $sub->getFilter(); - foreach ($this->_joins[$name] as $from => $to) { - if (isset($mrow[$from])) { - $filter[$to] = $mrow[$from]; - } + $mrow += $empty; + } + } + } else { + $empty = array_fill_keys($sub->getItemNames(), null); + foreach ($data as &$mrow) { + $filter = $sub->getFilter(); + foreach ($this->_joins[$name] as $from => $to) { + if (isset($mrow[$from])) { + $filter[$to] = $mrow[$from]; } + } - $sdata = $sub->loadFirst($filter); + $sdata = $sub->loadFirst($filter); - if ($sdata) { - $mrow += $sdata; - } else { - $mrow += $empty; - } + if ($sdata) { + $mrow += $sdata; + } else { + $mrow += $empty; + } - // MUtil_Echo::track($sdata, $mrow); - } + // MUtil_Echo::track($sdata, $mrow); } } - // MUtil_Echo::track($data); - - return $data; } } Modified: trunk/library/snippets/Organization/ChooseOrganizationSnippet.php =================================================================== --- trunk/library/snippets/Organization/ChooseOrganizationSnippet.php 2013-03-05 17:51:12 UTC (rev 1169) +++ trunk/library/snippets/Organization/ChooseOrganizationSnippet.php 2013-03-05 17:53:39 UTC (rev 1170) @@ -95,7 +95,7 @@ foreach ($orgs as $orgId => $name) { $url['org'] = $orgId; - $html->pInfo()->actionLink($url, $name, array('style' => 'font-size: 120%;')); + $html->pInfo()->actionLink($url, $name)->appendAttrib('class', 'larger'); } } else { $html->pInfo($this->_('This organization cannot have any respondents.')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-12 19:59:44
|
Revision: 1173 http://sourceforge.net/p/gemstracker/code/1173 Author: matijsdejong Date: 2013-03-12 19:59:39 +0000 (Tue, 12 Mar 2013) Log Message: ----------- Separated Dutch settings from main respondent model cleaned up tabform cleaned up Model order fixed bug in OrganizationEditSnippet.php caused by new tabform snippet Modified Paths: -------------- trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php trunk/library/classes/Gems/TabForm.php trunk/library/classes/MUtil/Model/ModelAbstract.php trunk/library/classes/MUtil/Validate/Db/UniqueValue.php trunk/library/classes/MUtil/Validate/SimpleEmail.php trunk/library/configs/db/tables/gems__respondent2org.50.sql trunk/library/snippets/Organization/OrganizationEditSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Model/RespondentNlModel.php trunk/library/classes/Gems/Validate/OneOf.php Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -97,8 +97,8 @@ } if (self::SSN_HASH === $this->hashSsn) { $this->setSaveWhen('grs_ssn', array($this, 'whenSSN')); - $this->setOnLoad('grs_ssn', array($this, 'saveSSN')); - $this->setOnSave('grs_ssn', array($this, 'formatSSN')); + $this->setOnLoad('grs_ssn', array($this, 'hideSSN')); + $this->setOnSave('grs_ssn', array($this, 'saveSSN')); } } @@ -218,6 +218,7 @@ public function applyDetailSettings($locale = null) { $dbLookup = $this->util->getDbLookup(); + $localized = $this->util->getLocalized(); $translated = $this->util->getTranslated(); $translator = $this->translate->getAdapter(); @@ -240,16 +241,14 @@ // The SSN if ($this->hashSsn !== Gems_Model_RespondentModel::SSN_HIDE) { - $this->set('grs_ssn', 'label', $translator->_('SSN')); + $this->set('grs_ssn', 'label', $translator->_('SSN'), + 'tab', $translator->_('Identification')); } - $this->setIfExists('gr2o_patient_nr', 'label', $translator->_('Respondent number')); + $this->setIfExists('gr2o_patient_nr', 'label', $translator->_('Respondent number'), + 'tab', $translator->_('Identification')); $this->setIfExists('grs_first_name', 'label', $translator->_('First name')); - $this->setIfExists('grs_surname_prefix', - 'label', $translator->_('Surname prefix'), - 'description', $translator->_('de, van der, \'t, etc...') - ); $this->setIfExists('grs_last_name', 'label', $translator->_('Last name')); $this->setIfExists('grs_gender', @@ -257,17 +256,38 @@ 'multiOptions', $translated->getGenderHello() ); - $this->setIfExists('grs_email', 'label', $translator->_('E-Mail')); + $this->setIfExists('grs_birthday', + 'label', $translator->_('Birthday'), + 'dateFormat', Zend_Date::DATE_MEDIUM + ); + $this->setIfExists('gr2o_treatment', 'label', $translator->_('Treatment')); + $this->setIfExists('gr2o_comments', 'label', $translator->_('Comments')); + + $this->setIfExists('grs_email', 'label', $translator->_('E-Mail'), + 'tab', $translator->_('Contact information')); + $this->setIfExists('grs_address_1', 'label', $translator->_('Street')); + $this->setIfExists('grs_address_2', 'label', $translator->_(' ')); + + // MUtil_Echo::track($this->getItemsOrdered()); + //MUtil_Echo::track($this->getItemsOrdered(), $this->getOrder('grs_email')); + $this->setIfExists('grs_zipcode', 'label', $translator->_('Zipcode')); $this->setIfExists('grs_city', 'label', $translator->_('City')); + $this->setIfExists('grs_iso_country', 'label', $translator->_('Country'), + 'multiOptions', $localized->getCountries()); $this->setIfExists('grs_phone_1', 'label', $translator->_('Phone')); + $this->setIfExists('grs_phone_2', 'label', $translator->_('Phone 2')); + $this->setIfExists('grs_phone_3', 'label', $translator->_('Phone 3')); - $this->setIfExists('grs_birthday', - 'label', $translator->_('Birthday'), - 'dateFormat', Zend_Date::DATE_MEDIUM + $this->setIfExists('grs_iso_lang', 'label', $translator->_('Language'), + 'multiOptions', $localized->getLanguages(), + 'tab', $translator->_('Settings')); + + $this->setIfExists('gr2o_consent', 'label', $translator->_('Consent'), + 'multiOptions', $dbLookup->getUserConsents() ); $this->setIfExists('gr2o_opened', @@ -275,16 +295,6 @@ 'formatFunction', $translated->formatDateTime ); - $this->setIfExists('gr2o_consent', - 'label', $translator->_('Consent'), - 'multiOptions', $dbLookup->getUserConsents() - ); - - $this->set('gr2o_comments', 'label', $translator->_('Comments')); - $this->set('gr2o_treatment', 'label', $translator->_('Treatment')); - - $this->addColumn('CASE WHEN grs_email IS NULL OR LENGTH(TRIM(grs_email)) = 0 THEN 1 ELSE 0 END', 'calc_email'); - return $this; } @@ -304,23 +314,7 @@ $ucfirst = new Zend_Filter_Callback('ucfirst'); if ($this->hashSsn !== Gems_Model_RespondentModel::SSN_HIDE) { - $this->set('grs_ssn', - 'size', 10, - 'maxlength', 12, - 'filter', 'Digits'); - - if (APPLICATION_ENV !== 'production') { - $bsn = new MUtil_Validate_Dutch_Burgerservicenummer(); - $num = mt_rand(100000000, 999999999); - - while (! $bsn->isValid($num)) { - $num++; - } - - $this->setIfExists('grs_ssn', 'description', sprintf($translator->_('Random Example BSN: %s'), $num)); - } else { - $this->setIfExists('grs_ssn', 'description', $translator->_('Enter a 9-digit SSN number.')); - } + $this->set('grs_ssn', 'validator[]', $this->createUniqueValidator('grs_ssn')); } $this->setIfExists('gr2o_patient_nr', @@ -331,7 +325,23 @@ array('gr2o_id_user' => 'grs_id_user', 'gr2o_id_organization') ) ); + $this->set('grs_id_user'); + $this->set('grs_email', + 'size', 30, + 'validator', 'SimpleEmail'); + $this->addColumn('CASE WHEN grs_email IS NULL OR LENGTH(TRIM(grs_email)) = 0 THEN 1 ELSE 0 END', 'calc_email'); + $this->set('calc_email', + 'label', $translator->_('Respondent has no e-mail'), + 'elementClass', 'Checkbox', + 'order', $this->getOrder('grs_email') + 1, + 'validator', new Gems_Validate_OneOf( + $translator->_('Respondent has no e-mail'), + 'grs_email', + $this->get('grs_email', 'label') + ) + ); + $this->setIfExists('grs_first_name', 'filter', $ucfirst); $this->setIfExists('grs_last_name', 'filter', $ucfirst, 'required', true); @@ -342,12 +352,34 @@ 'tab', $translator->_('Medical data') ); + $this->setIfExists('grs_birthday', + 'jQueryParams', array('defaultDate' => '-30y', 'maxDate' => 0, 'yearRange' => 'c-130:c0'), + 'elementClass', 'Date', + 'validator', new MUtil_Validate_Date_DateBefore()); + + $this->setIfExists('gr2o_treatment', 'size', 30); + $this->setIfExists('gr2o_comments', 'elementClass', 'Textarea', 'rows', 4, 'cols', 60); + + $this->setIfExists('grs_address_1', + 'size', 40, + 'description', $translator->_('With housenumber'), + 'filter', $ucfirst + ); + $this->setIfExists('grs_address_2', 'size', 40); + $this->setIfExists('grs_city', 'filter', $ucfirst); + $this->setIfExists('grs_phone_1', 'size', 15); + $this->setIfExists('grs_phone_2', 'size', 15); + $this->setIfExists('grs_phone_3', 'size', 15); + $this->setIfExists('gr2o_opened', 'elementClass', 'Exhibitor'); - $this->setIfExists('gr2o_consent', 'default', $this->util->getDefaultConsent()); + $this->setIfExists('gr2o_consent', + 'default', $this->util->getDefaultConsent(), + 'elementClass', 'Radio', + 'separator', '', + 'description', $translator->_('Has the respondent signed the informed consent letter?'), + 'required', true); - $this->setIfExists('grs_iso_lang', 'default', 'nl'); - return $this; } Added: trunk/library/classes/Gems/Model/RespondentNlModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentNlModel.php (rev 0) +++ trunk/library/classes/Gems/Model/RespondentNlModel.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -0,0 +1,140 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Model + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: RespondentNlModel.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Class containing the Netherlands specific model extensions. + * + * Extend your project specific RespondentModel from this model to make it go Dutch. + * + * @package Gems + * @subpackage Model + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.6 + */ +class Gems_Model_RespondentNlModel extends Gems_Model_RespondentModel +{ + /** + * Set those settings needed for the detailed display + * + * @param mixed $locale The locale for the settings + * @return \Gems_Model_RespondentModel + */ + public function applyDetailSettings($locale = null) + { + parent::applyDetailSettings($locale); + + $translator = $this->translate->getAdapter(); + + $this->setIfExists('grs_surname_prefix', + 'label', $translator->_('Surname prefix'), + 'description', $translator->_('de, van der, \'t, etc...'), + 'order', $this->getOrder('grs_first_name') + 1 + ); + + return $this; + } + + /** + * Set those values needed for editing + * + * @param mixed $locale The locale for the settings + * @return \Gems_Model_RespondentModel + */ + public function applyEditSettings($locale = null) + { + parent::applyEditSettings($locale); + $translator = $this->translate->getAdapter(); + + if ($this->hashSsn !== Gems_Model_RespondentModel::SSN_HIDE) { + self::setDutchSsn($this, $translator); + } + + $this->setIfExists('grs_iso_lang', 'default', 'nl'); + $this->setIfExists('gr2o_treatment', 'description', $translator->_('DBC\'s, etc...')); + + self::setDutchZipcode($this, $translator); + + return $this; + } + + /** + * Set the field values for a dutch social security number + * + * @param MUtil_Model_ModelAbstract $model + * @param Zend_Translate_Adapter $translator + * @param string $fieldName + */ + public static function setDutchSsn(MUtil_Model_ModelAbstract $model, Zend_Translate_Adapter $translator, $fieldName = 'grs_ssn') + { + $bsn = new MUtil_Validate_Dutch_Burgerservicenummer(); + + $model->set($fieldName, + 'size', 10, + 'maxlength', 12, + 'filter', 'Digits', + 'validator[]', $bsn); + + if (APPLICATION_ENV !== 'production') { + $num = mt_rand(100000000, 999999999); + + while (! $bsn->isValid($num)) { + $num++; + } + + $model->set($fieldName, 'description', sprintf($translator->_('Random Example BSN: %s'), $num)); + } else { + $model->set($fieldName, 'description', $translator->_('Enter a 9-digit SSN number.')); + } + } + + /** + * Set the field values for a dutch zipcode + * + * @param MUtil_Model_ModelAbstract $model + * @param Zend_Translate_Adapter $translator + * @param string $fieldName + */ + public static function setDutchZipcode(MUtil_Model_ModelAbstract $model, Zend_Translate_Adapter $translator, $fieldName = 'grs_zipcode') + { + $model->set($fieldName, + 'size', 7, + 'description', $translator->_('E.g.: 0000 AA'), + 'filter', new Gems_Filter_DutchZipcode() + ); + } +} Modified: trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/Gems/Snippets/ModelTabFormSnippetGeneric.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -74,25 +74,29 @@ } $bridge->setAllowedOptions(MUtil_Model_FormBridge::DISPLAY_OPTIONS, $displayOptions); - $tab = 0; - $group = 0; + $tab = 0; + $group = 0; + $oldTab = null; + // MUtil_Echo::track($model->getItemsOrdered()); foreach ($model->getItemsOrdered() as $name) { // Get all options at once $modelOptions = $model->get($name); - if ($tabName = $model->get($name, 'tab')) { + $tabName = $model->get($name, 'tab'); + if ($tabName && ($tabName !== $oldTab)) { $bridge->addTab('tab' . $tab, 'value', $tabName); + $oldTab = $tabName; $tab++; } if ($model->has($name, 'label')) { $bridge->add($name); - - if ($theName = $model->get('startGroup')) { + + if ($theName = $model->get($name, 'startGroup')) { //We start a new group here! $groupElements = array(); $groupElements[] = $name; $groupName = $theName; - } elseif ($theName = $model->get('endGroup')) { + } elseif ($theName = $model->get($name, 'endGroup')) { //Ok, last element define the group $groupElements[] = $name; $bridge->addDisplayGroup('grp_' . $groupElements[0], $groupElements, @@ -111,6 +115,7 @@ } else { $bridge->addHidden($name); } + unset($this->_items[$name]); } } @@ -146,7 +151,10 @@ $form->resetContext(); } $form->addElement($element); + $element->removeDecorator('HtmlTag'); + $element->removeDecorator('Label'); $form->addDisplayGroup(array('formLinks'), 'form_buttons'); + $form->getDisplayGroup(Gems_TabForm::GROUP_OTHER)->removeElement($element->getName()); } } Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/Gems/TabForm.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -43,6 +43,11 @@ class Gems_TabForm extends Gems_Form { /** + * Group ID for elements below form + */ + const GROUP_OTHER = 'not_in_tab'; + + /** * Holds the last tab we added information to * * @var Gems_Form_TabSubForm @@ -97,18 +102,40 @@ */ public function addElement($element, $name = null, $options = null) { + if ($element instanceof Zend_Form_Element_Hidden) { + parent::addElement($element, $name, $options); + + //Remove decorators + $element->removeDecorator('HtmlTag'); + $element->removeDecorator('Label'); + + $this->addToOtherGroup($element); + + $element->removeDecorator('DtDdWrapper'); + + return $this; + } + if ($this->currentTab) { return $this->currentTab->addElement($element, $name, $options); } else { parent::addElement($element, $name, $options); + if (is_string($element)) { $element = $this->getElement($element); } + + $this->addToOtherGroup($element); + + $element->removeDecorator('DtDdWrapper'); + if ($element instanceof Zend_Form_Element_Hidden) { //Remove decorators - $element->removeDecorator('htmlTag'); + $element->removeDecorator('HtmlTag'); $element->removeDecorator('Label'); + } elseif ($element instanceof Zend_Form_Element) { + $error = $element->getDecorator('Errors'); if ($error instanceof Zend_Form_Decorator_Errors) { $element->removeDecorator('Errors'); @@ -138,6 +165,24 @@ } /** + * Add to the group all non-tab elements are in + * + * @param mixed $element + * @return \Gems_TabForm + */ + public function addToOtherGroup($element) + { + if ($element instanceof Zend_Form_Element) { + if ($group = $this->getDisplayGroup(self::GROUP_OTHER)) { + $group->addElement($element); + } else { + $this->addDisplayGroup(array($element), self::GROUP_OTHER); + } + } + return $this; + } + + /** * Add an element to the form, when a tab (subform) had been added, it will return * the subform instead of the form, keep this in mind when chaining methods * Added: trunk/library/classes/Gems/Validate/OneOf.php =================================================================== --- trunk/library/classes/Gems/Validate/OneOf.php (rev 0) +++ trunk/library/classes/Gems/Validate/OneOf.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -0,0 +1,123 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Validate + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: EmailCheck.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Check for one of the two values being filled + * + * @package Gems + * @subpackage Validate + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.6 + */ +class Gems_Validate_OneOf extends Zend_Validate_Abstract +{ + /** + * Error codes + * @const string + */ + const NEITHER = 'neither'; + + protected $_messageTemplates = array( + self::NEITHER => "Either '%description%' or '%fieldDescription%' must be entered.", + ); + + /** + * @var array + */ + protected $_messageVariables = array( + 'description' => '_description', + 'fieldDescription' => '_fieldDescription' + ); + + + protected $_description; + + /** + * The field name against which to validate + * @var string + */ + protected $_fieldName; + + /** + * Description of field name against which to validate + * @var string + */ + protected $_fieldDescription; + + /** + * Sets validator options + * + * @param string $fieldName Field name against which to validate + * $param string $fieldDescription Description of field name against which to validate + * @return void + */ + public function __construct($description, $fieldName, $fieldDescription) + { + $this->_description = $description; + $this->_fieldName = $fieldName; + $this->_fieldDescription = $fieldDescription; + } + + /** + * Defined by Zend_Validate_Interface + * + * Returns true if and only if a token has been set and the provided value + * matches that token. + * + * @param mixed $value + * @return boolean + */ + public function isValid($value, $context = array()) + { + $this->_setValue((string) $value); + + $fieldSet = (boolean) isset($context[$this->_fieldName]) && $context[$this->_fieldName]; + $valueSet = (boolean) $value; + + if ($valueSet && (! $fieldSet)) { + return true; + } + + if ((! $valueSet) && $fieldSet) { + return true; + } + + $this->_error(self::NEITHER); + return false; + } +} Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -712,15 +712,9 @@ */ public function getItemsOrdered() { - $order = (array) $this->_model_order; - asort($order); - $result = array_keys($order); - foreach($this->_model as $field => $element) { - if (! array_key_exists($field, $order)) { - $result[] = $field; - } - } - return $result; + asort($this->_model_order); + $order = array_keys($this->_model_order); + return $order + array_diff(array_keys($this->_model), $order); } public function getItemsUsed() Modified: trunk/library/classes/MUtil/Validate/Db/UniqueValue.php =================================================================== --- trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/MUtil/Validate/Db/UniqueValue.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -108,6 +108,9 @@ public function isValid($value, $context = array()) { + // Quick fix for context not being complete in subform + $context = $context + $_POST; + /** * Check for an adapter being defined. if not, fetch the default adapter. */ @@ -180,7 +183,8 @@ } else { $this->_exclude = null; } - + // MUtil_Echo::track($this->_exclude, $this->_checkFields, $this->_keyFields, $context, $_POST); + return parent::isValid($value, $context); } } Modified: trunk/library/classes/MUtil/Validate/SimpleEmail.php =================================================================== --- trunk/library/classes/MUtil/Validate/SimpleEmail.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/classes/MUtil/Validate/SimpleEmail.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -1,47 +1,47 @@ <?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 Validate + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: SimpleEmail.php 203 2012-01-01t 12:51:32Z matijs $ */ /** - * - * @author Matijs de Jong - * @package MUtil + * + * @package MUtil * @subpackage Validate + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 */ class MUtil_Validate_SimpleEmail extends Zend_Validate_Regex { Modified: trunk/library/configs/db/tables/gems__respondent2org.50.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondent2org.50.sql 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/configs/db/tables/gems__respondent2org.50.sql 2013-03-12 19:59:39 UTC (rev 1173) @@ -10,8 +10,8 @@ -- gr2o_id_physician bigint unsigned null -- references gems_staff (gsf_id_user), - -- gr2o_treatment varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - -- gr2o_comments text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gr2o_treatment varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gr2o_comments text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, gr2o_consent varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'Unknown' references gems__consents (gco_description), Modified: trunk/library/snippets/Organization/OrganizationEditSnippet.php =================================================================== --- trunk/library/snippets/Organization/OrganizationEditSnippet.php 2013-03-07 17:06:55 UTC (rev 1172) +++ trunk/library/snippets/Organization/OrganizationEditSnippet.php 2013-03-12 19:59:39 UTC (rev 1173) @@ -130,7 +130,7 @@ if (count($this->_items)>0 && !($bridge->getTab('other'))) { $bridge->addTab('other', 'value', $this->_('Other')); } - parent::addFormElements($bridge, $model); + parent::addItems($bridge, $this->_items); } public function afterSave($changed) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-13 15:48:18
|
Revision: 1175 http://sourceforge.net/p/gemstracker/code/1175 Author: matijsdejong Date: 2013-03-13 15:48:13 +0000 (Wed, 13 Mar 2013) Log Message: ----------- RespondentNewAction.php works Getting the current menu is made more simple Fixed some bugs in default project setup Modified Paths: -------------- trunk/library/classes/Gems/Default/RespondentAction.php trunk/library/classes/Gems/Default/RespondentNewAction.php trunk/library/classes/Gems/Menu.php trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php trunk/library/classes/Gems/Snippets/RespondentDetailSnippetAbstract.php trunk/library/classes/Gems/TabForm.php trunk/library/classes/MUtil/Snippets/TabSnippetAbstract.php trunk/library/snippets/RespondentDetailsSnippet.php Modified: trunk/library/classes/Gems/Default/RespondentAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentAction.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Default/RespondentAction.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -182,7 +182,9 @@ $bridge->addCheckBox('calc_email', 'label', $this->_('Respondent has no e-mail')); $bridge->addText( 'grs_address_1', 'size', 40, 'description', $this->_('With housenumber')) ->addFilter( $ucfirst); - $bridge->addText( 'grs_address_2', 'size', 40); + if ($model->has('grs_address_2')) { + $bridge->addText( 'grs_address_2', 'size', 40); + } $bridge->addText( 'grs_zipcode', 'size', 7, 'description', '0000 AA'); $bridge->addFilter( 'grs_zipcode', new Gems_Filter_DutchZipcode()); $bridge->addText( 'grs_city') @@ -252,6 +254,7 @@ $options = $this->util->getReceptionCodeLibrary()->getRespondentDeletionCodes(); + $this->useTabbedForms = false; $bridge = new MUtil_Model_FormBridge($model, $this->createForm()); $bridge->addSelect('gr2o_reception_code', 'label', $this->_('Rejection code'), Modified: trunk/library/classes/Gems/Default/RespondentNewAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentNewAction.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Default/RespondentNewAction.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -47,6 +47,18 @@ abstract class Gems_Default_RespondentNewAction extends Gems_Controller_ModelSnippetActionAbstract { /** + * The parameters used for the create and edit actions. + * + * When the value is a function name of that object, then that functions is executed + * with the array key as single parameter and the return value is set as the used value + * - unless the key is an integer in which case the code is executed but the return value + * is not stored. + * + * @var array Mixed key => value array for snippet initialization + */ + protected $createEditParameters = array('resetRoute' => true); + + /** * The snippets used for the create and edit actions. * * @var mixed String or array of snippets name @@ -54,12 +66,55 @@ protected $createEditSnippets = 'ModelTabFormSnippetGeneric'; /** + * The snippets used for the delete action. * + * @var mixed String or array of snippets name + */ + public $deleteSnippets = array('RespondentDetailsSnippet'); + + /** + * The snippets used for the export action. + * + * @var mixed String or array of snippets name + */ + public $exportSnippets = array('RespondentDetailsSnippet'); + + /** + * * @var Gems_Loader */ public $loader; /** + * The snippets used for the show action + * + * @var mixed String or array of snippets name + */ + protected $showSnippets = array( + 'Generic_ContentTitleSnippet', + 'RespondentDetailsSnippet', + 'AddTracksSnippet', + 'RespondentTokenTabsSnippet', + 'RespondentTokenSnippet', + ); + + /** + * The parameters used for the show action + * + * When the value is a function name of that object, then that functions is executed + * with the array key as single parameter and the return value is set as the used value + * - unless the key is an integer in which case the code is executed but the return value + * is not stored. + * + * @var array Mixed key => value array for snippet initialization + */ + protected $showParameters = array( + 'baseUrl' => 'getItemUrlArray', + 'onclick' => 'getEditLink', + 'respondentData' => 'getRespondentData', + ); + + /** * 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 @@ -89,6 +144,110 @@ } /** + * Adjusted delete action + */ + public function deleteAction() + { + $model = $this->getModel(); + $params = $this->_processParameters($this->showParameters); + $data = $params['respondentData']; + $request = $this->getRequest(); + + $options = $this->util->getReceptionCodeLibrary()->getRespondentDeletionCodes(); + + $bridge = new MUtil_Model_FormBridge($model, new Gems_Form()); + $bridge->addSelect('gr2o_reception_code', + 'label', $this->_('Rejection code'), + 'multiOptions', $options, + 'required', true, + 'size', max(7, min(3, count($options) + 1))); + + $form = $bridge->getForm(); + + $save = new Zend_Form_Element_Submit('save_button', array('label' => $this->_('Delete respondent'), 'class' => 'button')); + $form->addElement($save); + + if ($request->isPost()) { + $data = $_POST + $data; + if ($form->isValid($data )) { + + $code = $this->util->getReceptionCode($data['gr2o_reception_code']); + + // Is the respondent really removed + if (! $code->isSuccess()) { + $userId = $this->loader->getCurrentUser()->getUserId(); + + // Cascade to tracks + // the responsiblilty to handle it correctly is on the sub objects now. + $tracks = $this->loader->getTracker()->getRespondentTracks($data['gr2o_id_user'], $data['gr2o_id_organization']); + foreach ($tracks as $track) { + $track->setReceptionCode($code, null, $userId); + } + + // Perform actual save, but not simple stop codes. + if ($code->isForRespondents()) { + $values['gr2o_reception_code'] = $data['gr2o_reception_code']; + $values['gr2o_changed'] = new MUtil_Db_Expr_CurrentTimestamp(); + $values['gr2o_changed_by'] = $userId; + + $where = 'gr2o_id_user = ? AND gr2o_id_organization = ?'; + $where = $this->db->quoteInto($where, $data['gr2o_id_user'], null, 1); + $where = $this->db->quoteInto($where, $data['gr2o_id_organization'], null, 1); + + $this->db->update('gems__respondent2org', $values, $where); + + $this->addMessage($this->_('Respondent deleted.')); + $this->_reroute(array('action' => 'index'), true); + } else { + // Just a stop code + $this->addMessage($this->_('Respondent tracks stopped.')); + $this->_reroute(array('action' => 'show')); + } + } else { + $this->addMessage($this->_('Choose a reception code to delete.')); + } + } else { + $this->addMessage($this->_('Input error! No changes saved!')); + } + } + $form->populate($data); + + $table = new MUtil_Html_TableElement(array('class' => 'formTable')); + $table->setAsFormLayout($form, true, true); + $table['tbody'][0][0]->class = 'label'; // Is only one row with formLayout, so all in output fields get class. + + $this->addSnippets($this->deleteSnippets, $params); + + $this->html[] = $form; + } + + /** + * Action for dossier export + */ + public function exportAction() + { + $params = $this->_processParameters($this->showParameters); + $data = $params['respondentData']; + + $this->addSnippets($this->exportSnippets, $params); + + //Now show the export form + $export = $this->loader->getRespondentExport($this); + $form = $export->getForm(); + $this->html->h2($this->_('Export respondent archive')); + $div = $this->html->div(array('id' => 'mainform')); + $div[] = $form; + + $request = $this->getRequest(); + + $form->populate($request->getParams()); + + if ($request->isPost()) { + $export->render((array) $data['gr2o_patient_nr'], $this->getRequest()->getParam('group'), $this->getRequest()->getParam('format')); + } + } + + /** * Set column usage to use for the browser. * * Must be an array of arrays containing the input for TableBridge->setMultisort() @@ -122,6 +281,25 @@ } /** + * Get the link to edit respondent + * + * @return MUtil_Html_HrefArrayAttribute + */ + public function getEditLink() + { + $request = $this->getRequest(); + + $item = $this->menu->find(array( + $request->getControllerKey() => $request->getControllerName(), + $request->getActionKey() => 'edit', + 'allowed' => true)); + + if ($item) { + return $item->toHRefAttribute($request); + } + } + + /** * Helper function to get the title for the index action. * * @return $string @@ -132,6 +310,48 @@ } /** + * Return the array with items that should be used to find this item + * + * @return array + */ + public function getItemUrlArray() + { + return array( + MUtil_Model::REQUEST_ID1 => $this->_getParam(MUtil_Model::REQUEST_ID1), + MUtil_Model::REQUEST_ID2 => $this->_getParam(MUtil_Model::REQUEST_ID2) + ); + } + + /** + * Retrieve the respondent data in advance + * (So we don't need to repeat that for every snippet.) + * + * @return array + */ + public function getRespondentData() + { + $model = $this->getModel(); + $data = $model->applyRequest($this->getRequest(), true)->loadFirst(); + + if (! isset($data['grs_id_user'])) { + $this->addMessage(sprintf($this->_('Unknown %s requested'), $this->getTopic())); + $this->_reroute(array('action' => 'index'), true); + return array(); + } + + // Log + $this->openedRespondent($data['gr2o_patient_nr'], $data['gr2o_id_organization'], $data['grs_id_user']); + + // Check for completed tokens + if ($this->loader->getTracker()->processCompletedTokens($data['grs_id_user'], $this->session->user_id, $data['gr2o_id_organization'])) { + //As data might have changed due to token events... reload + $data = $model->applyRequest($this->getRequest(), true)->loadFirst(); + } + + return $data; + } + + /** * Helper function to allow generalized statements about the items in the model. * * @param int $count @@ -156,4 +376,26 @@ $this->addSnippet('Organization_ChooseOrganizationSnippet'); } } + + /** + * Log the respondent opening + * + * @param string $patientId + * @param int $orgId + * @param int $userId + * @return \Gems_Default_RespondentNewAction + */ + protected function openedRespondent($patientId, $orgId = null, $userId = null) + { + if ($patientId) { + $where['gr2o_patient_nr = ?'] = $patientId; + $where['gr2o_id_organization = ?'] = $orgId ? $orgId : $this->escort->getCurrentOrganization(); + $values['gr2o_opened'] = new MUtil_Db_Expr_CurrentTimestamp(); + $values['gr2o_opened_by'] = $this->session->user_id; + + $this->db->update('gems__respondent2org', $values, $where); + } + + return $this; + } } Modified: trunk/library/classes/Gems/Menu.php =================================================================== --- trunk/library/classes/Gems/Menu.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Menu.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -137,7 +137,7 @@ $page->addAction(sprintf($this->_('About %s'), $project->getName()), null, 'about'); $page->addAction(sprintf($this->_('About %s'), $this->_('GemsTracker')), 'pr.contact.gems', 'gems'); - + if ($project->hasBugsUrl()) { $page->addAction($this->_('Reporting bugs'), 'pr.contact.bugs', 'bugs'); } @@ -518,7 +518,38 @@ } /** + * Menulist populated with current items * + * @param Zend_Controller_Request_Abstract $request + * @param $parentLabel + * @return Gems_Menu_MenuList + */ + public function getCurrentMenuList(Zend_Controller_Request_Abstract $request, $parentLabel = null) + { + $controller = $request->getControllerName(); + $action = $request->getActionName(); + + $menuList = $this->getMenuList(); + + if ($controller !== 'index') { + $menuList->addByController($controller, 'index', $parentLabel); + } + + foreach ($this->getCurrentParent()->getChildren() as $child) { + if ($child instanceof Gems_Menu_SubMenuItem) { + $chAction = $child->get('action'); + $chContr = $child->get('controller'); + if (! ($controller == $chContr && $action == $chAction)) { + $menuList->addByController($chContr, $chAction); + } + } + } + return $menuList; + } + + + /** + * * @return Gems_Menu_SubMenuItem */ public function getCurrentParent() Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -268,7 +268,7 @@ 'tab', $translator->_('Contact information')); $this->setIfExists('grs_address_1', 'label', $translator->_('Street')); - $this->setIfExists('grs_address_2', 'label', $translator->_(' ')); + $this->setIfExists('grs_address_2', 'label', ' '); // MUtil_Echo::track($this->getItemsOrdered()); //MUtil_Echo::track($this->getItemsOrdered(), $this->getOrder('grs_email')); Modified: trunk/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Snippets/ModelItemTableSnippetAbstract.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -173,14 +173,9 @@ */ protected function setShowTableFooter(MUtil_Model_VerticalTableBridge $bridge, MUtil_Model_ModelAbstract $model) { - $controller = $this->request->getControllerName(); + $menuList = $this->menu->getCurrentMenuList($this->request, $this->_('Cancel')); + $menuList->addParameterSources($bridge); - $menuList = $this->menu->getMenuList(); - $menuList->addParameterSources($bridge) - ->addByController($controller, 'index', $this->_('Cancel')) - ->addByController($controller, 'edit') - ->addByController($controller, 'delete'); - $bridge->tfrow($menuList, array('class' => 'centerAlign')); } } Modified: trunk/library/classes/Gems/Snippets/RespondentDetailSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/RespondentDetailSnippetAbstract.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/Snippets/RespondentDetailSnippetAbstract.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -102,6 +102,11 @@ { if ($this->buttons) { $bridge->tfrow($this->buttons, array('class' => 'centerAlign')); + } else { + $menuList = $this->menu->getCurrentMenuList($this->request, $this->_('Cancel')); + $menuList->addParameterSources($bridge); + + $bridge->tfrow($menuList, array('class' => 'centerAlign')); } } Modified: trunk/library/classes/Gems/TabForm.php =================================================================== --- trunk/library/classes/Gems/TabForm.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/Gems/TabForm.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -112,7 +112,7 @@ $this->addToOtherGroup($element); $element->removeDecorator('DtDdWrapper'); - + return $this; } @@ -127,15 +127,16 @@ $this->addToOtherGroup($element); - $element->removeDecorator('DtDdWrapper'); - if ($element instanceof Zend_Form_Element_Hidden) { //Remove decorators $element->removeDecorator('HtmlTag'); $element->removeDecorator('Label'); + $element->removeDecorator('DtDdWrapper'); } elseif ($element instanceof Zend_Form_Element) { + $element->removeDecorator('DtDdWrapper'); + $error = $element->getDecorator('Errors'); if ($error instanceof Zend_Form_Decorator_Errors) { $element->removeDecorator('Errors'); Modified: trunk/library/classes/MUtil/Snippets/TabSnippetAbstract.php =================================================================== --- trunk/library/classes/MUtil/Snippets/TabSnippetAbstract.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/classes/MUtil/Snippets/TabSnippetAbstract.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -52,7 +52,7 @@ * * @var array */ - protected $baseurl = array(); + protected $baseUrl = array(); /** * Shortfix to add class attribute Modified: trunk/library/snippets/RespondentDetailsSnippet.php =================================================================== --- trunk/library/snippets/RespondentDetailsSnippet.php 2013-03-12 20:13:10 UTC (rev 1174) +++ trunk/library/snippets/RespondentDetailsSnippet.php 2013-03-13 15:48:13 UTC (rev 1175) @@ -61,8 +61,10 @@ $br = $HTML->br(); $address[] = $bridge->grs_address_1; $address[] = $br; - $address[] = $bridge->grs_address_2; - $address[] = $bridge->itemIf('grs_address_2', $br); + if ($this->model->has('grs_address_2')) { + $address[] = $bridge->grs_address_2; + $address[] = $bridge->itemIf('grs_address_2', $br); + } $address[] = $bridge->grs_zipcode; $address[] = $bridge->itemIf('grs_zipcode', new MUtil_Html_Raw(' ')); $address[] = $bridge->grs_city; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-18 12:24:31
|
Revision: 1188 http://sourceforge.net/p/gemstracker/code/1188 Author: matijsdejong Date: 2013-03-18 12:24:26 +0000 (Mon, 18 Mar 2013) Log Message: ----------- Multiple small implementation fixes Modified Paths: -------------- trunk/library/classes/Gems/Model/RespondentModel.php trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php trunk/library/configs/db/tables/gems__roles.20.sql Modified: trunk/library/classes/Gems/Model/RespondentModel.php =================================================================== --- trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-14 15:49:48 UTC (rev 1187) +++ trunk/library/classes/Gems/Model/RespondentModel.php 2013-03-18 12:24:26 UTC (rev 1188) @@ -130,7 +130,13 @@ { $filter = parent::_checkFilterUsed($filter); - if (! isset($filter['gr2o_id_organization'])) { + if (isset($filter['gr2o_id_organization'])) { + // Check for option to check for any organisation + if (true === $filter['gr2o_id_organization']) { + unset($filter['gr2o_id_organization']); + } + } else { + // Add the correct filter if ($this->isMultiOrganization() && !isset($filter['gr2o_patient_nr'])) { $allowed = $this->user->getAllowedOrganizations(); Modified: trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php =================================================================== --- trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-14 15:49:48 UTC (rev 1187) +++ trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2013-03-18 12:24:26 UTC (rev 1188) @@ -109,7 +109,7 @@ */ protected function addFormElements(MUtil_Model_FormBridge $bridge, MUtil_Model_ModelAbstract $model) { - if (! $this->_form instanceof Gems_TabForm) { + if (! $bridge->getForm() instanceof Gems_TabForm) { parent::addFormElements($bridge, $model); return; } Modified: trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-03-14 15:49:48 UTC (rev 1187) +++ trunk/library/classes/MUtil/Model/DatabaseModelAbstract.php 2013-03-18 12:24:26 UTC (rev 1188) @@ -167,10 +167,7 @@ $select->where($name . ' IS NULL'); } elseif (is_array($value)) { if ($value) { - foreach ($value as $sub) { - $subs[] = $adapter->quote($value); - } - $select->where($name . ' IN (' . implode(', ', $subs) . ')'); + $select->where($name . ' IN (' . $adapter->quote($value) . ')'); } else { // Never a result when a value should be one of an empty set. $select->where('1=0'); Modified: trunk/library/configs/db/tables/gems__roles.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__roles.20.sql 2013-03-14 15:49:48 UTC (rev 1187) +++ trunk/library/configs/db/tables/gems__roles.20.sql 2013-03-18 12:24:26 UTC (rev 1188) @@ -29,8 +29,8 @@ ('guest','guest','pr.ask,pr.contact.bugs,pr.contact.gems,pr.contact.support,pr.islogin,pr.respondent','', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('respondent','respondent','','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('security','security','','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('staff','staff','pr.option.edit,pr.option.password,pr.plan,pr.plan.overview,pr.plan.token,pr.project,pr.project.questions,pr.respondent.create,pr.respondent.edit,pr.respondent.who,pr.setup,pr.staff,pr.survey,pr.survey.create,pr.token,pr.token.answers,pr.token.delete,pr.token.edit,pr.token.mail,pr.token.print,pr.track,pr.track.create,pr.track.delete,pr.track.edit,pr.respondent.reportdeath','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), + ('staff','staff','pr.option.edit,pr.option.password,pr.plan,pr.plan.overview,pr.plan.token,pr.project,pr.project.questions,pr.respondent.create,pr.respondent.edit,pr.respondent.who,pr.survey,pr.survey.create,pr.token,pr.token.answers,pr.token.delete,pr.token.edit,pr.token.mail,pr.token.print,pr.track,pr.track.create,pr.track.delete,pr.track.edit,pr.respondent.reportdeath','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('physician','physician','','staff', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('researcher','researcher','pr.project-information.changelog,pr.contact,pr.export,pr.plan.token,pr.plan.respondent,pr.plan.overview,pr.option.password,pr.option.edit,pr.organization-switch,pr.islogin','guest', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), - ('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.mail.log,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), + ('admin','admin','pr.consent,pr.consent.create,pr.consent.edit,pr.group,pr.role,pr.mail,pr.mail.create,pr.mail.delete,pr.mail.edit,pr.mail.log,pr.organization,pr.organization-switch,pr.plan.overview.excel,pr.plan.respondent,pr.plan.respondent.excel,pr.plan.token.excel,pr.project-information,pr.reception,pr.reception.create,pr.reception.edit,pr.respondent.choose-org,pr.respondent.delete,pr.respondent.result,pr.source,pr.staff,pr.staff.create,pr.staff.delete,pr.staff.edit,pr.staff.see.all,pr.survey-maintenance,pr.track-maintenance,pr.token.mail.freetext','staff,researcher,security', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('super','super','pr.consent.delete,pr.country,pr.country.create,pr.country.delete,pr.country.edit,pr.database,pr.database.create,pr.database.delete,pr.database.edit,pr.database.execute,pr.database.patches,pr.group.create,pr.group.edit,pr.language,pr.mail.server,pr.mail.server.create,pr.mail.server.delete,pr.mail.server.edit,pr.organization.create,pr.organization.edit,pr.plan.choose-org,pr.plan.mail-as-application,pr.reception.delete,pr.respondent.multiorg,pr.role.create,pr.role.edit,pr.source.create,pr.source.edit,pr.source.synchronize,pr.source.synchronize-all,pr.staff.edit.all,pr.survey-maintenance.edit,pr.track-maintenance.create,pr.track-maintenance.edit,pr.maintenance','admin', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-22 13:17:31
|
Revision: 1202 http://sourceforge.net/p/gemstracker/code/1202 Author: matijsdejong Date: 2013-03-22 13:17:27 +0000 (Fri, 22 Mar 2013) Log Message: ----------- Up to the new version 1.6.1 Modified Paths: -------------- trunk/library/classes/Gems/Versions.php trunk/library/classes/MUtil/Version.php trunk/library/configs/db/tables/gems__patch_levels.10.sql Modified: trunk/library/classes/Gems/Versions.php =================================================================== --- trunk/library/classes/Gems/Versions.php 2013-03-21 15:55:39 UTC (rev 1201) +++ trunk/library/classes/Gems/Versions.php 2013-03-22 13:17:27 UTC (rev 1202) @@ -59,7 +59,7 @@ * This means that future patches for will be loaded, * but that previous patches are ignored. */ - return 51; + return 52; } /** @@ -69,7 +69,7 @@ */ public final function getGemsVersion() { - return '1.6'; + return '1.6.1'; } /** Modified: trunk/library/classes/MUtil/Version.php =================================================================== --- trunk/library/classes/MUtil/Version.php 2013-03-21 15:55:39 UTC (rev 1201) +++ trunk/library/classes/MUtil/Version.php 2013-03-22 13:17:27 UTC (rev 1202) @@ -48,7 +48,7 @@ { const MAJOR = 1; const MINOR = 2; - const BUILD = 40; + const BUILD = 41; public static function get() { Modified: trunk/library/configs/db/tables/gems__patch_levels.10.sql =================================================================== --- trunk/library/configs/db/tables/gems__patch_levels.10.sql 2013-03-21 15:55:39 UTC (rev 1201) +++ trunk/library/configs/db/tables/gems__patch_levels.10.sql 2013-03-22 13:17:27 UTC (rev 1202) @@ -11,4 +11,4 @@ INSERT INTO gems__patch_levels (gpl_level, gpl_created) VALUES - (52, CURRENT_TIMESTAMP); + (53, CURRENT_TIMESTAMP); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-04-04 09:41:18
|
Revision: 1212 http://sourceforge.net/p/gemstracker/code/1212 Author: matijsdejong Date: 2013-04-04 09:41:13 +0000 (Thu, 04 Apr 2013) Log Message: ----------- Confirmed _initOpenRosa to coding standards Added Agenda field to surveys Modified Paths: -------------- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php trunk/library/classes/GemsEscort.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__surveys.30.sql Modified: trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2013-04-03 12:52:59 UTC (rev 1211) +++ trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2013-04-04 09:41:13 UTC (rev 1212) @@ -100,7 +100,10 @@ $survey = $this->loader->getTracker()->getSurvey($currentId); $standAlone = $this->escort instanceof Gems_Project_Tracks_StandAloneSurveysInterface; - $surveyFields = $this->util->getTranslated()->getEmptyDropdownArray() + $survey->getQuestionList($this->locale->getLanguage()); + $surveyFields = $this->util->getTranslated()->getEmptyDropdownArray() + + $survey->getQuestionList($this->locale->getLanguage()); + $dateFields = $this->util->getTranslated()->getEmptyDropdownArray() + + $survey->getDatesList($this->locale->getLanguage()); $surveyNotOK = $data['gsu_surveyor_active'] ? null : 'disabled'; // Forced data changes @@ -128,6 +131,7 @@ $bridge->addSelect( 'gsu_id_primary_group', 'description', $this->_('If empty, survey will never show up!')); $bridge->addSelect( 'gsu_result_field', 'multiOptions', $surveyFields); + $bridge->addSelect( 'gsu_agenda_result', 'multiOptions', $dateFields); $bridge->addText( 'gsu_duration'); $bridge->addExhibitor( 'calc_duration', 'label', $this->_('Duration calculated'), 'value', $this->calculateDuration(isset($data['gsu_id_survey']) ? $data['gsu_id_survey'] : null)); $bridge->addText( 'gsu_code'); Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2013-04-03 12:52:59 UTC (rev 1211) +++ trunk/library/classes/GemsEscort.php 2013-04-04 09:41:13 UTC (rev 1212) @@ -433,10 +433,8 @@ /** * Initialize the OpenRosa survey source - * - * @param Zend_Controller_Action $actionController */ - public function _initOpenRosa(Zend_Controller_Action $actionController = null) + protected function _initOpenRosa() { if ($this->getOption('useOpenRosa')) { // First handle dependencies Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2013-04-03 12:52:59 UTC (rev 1211) +++ trunk/library/configs/db/patches.sql 2013-04-04 09:41:13 UTC (rev 1212) @@ -483,3 +483,7 @@ -- PATCH: Longer SSN hashes ALTER TABLE gems__respondents CHANGE grs_ssn grs_ssn varchar(128) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; + +-- GEMS VERSION: 52 +-- PATCH: Agenda items +ALTER TABLE gems__surveys ADD gsu_agenda_result varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' AFTER gsu_result_field; Modified: trunk/library/configs/db/tables/gems__surveys.30.sql =================================================================== --- trunk/library/configs/db/tables/gems__surveys.30.sql 2013-04-03 12:52:59 UTC (rev 1211) +++ trunk/library/configs/db/tables/gems__surveys.30.sql 2013-04-04 09:41:13 UTC (rev 1212) @@ -36,6 +36,7 @@ -- end depreciated gsu_result_field varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', + gsu_agenda_result varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', gsu_duration varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci', gsu_code varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-04-04 15:34:30
|
Revision: 1213 http://sourceforge.net/p/gemstracker/code/1213 Author: matijsdejong Date: 2013-04-04 15:34:26 +0000 (Thu, 04 Apr 2013) Log Message: ----------- The agenda is still on the agenda Modified Paths: -------------- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php Added Paths: ----------- trunk/library/configs/db/tables/gems__respondent2appointment.sql Modified: trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php =================================================================== --- trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2013-04-04 09:41:13 UTC (rev 1212) +++ trunk/library/classes/Gems/Default/SurveyMaintenanceAction.php 2013-04-04 15:34:26 UTC (rev 1213) @@ -464,6 +464,7 @@ $events = $this->loader->getEvents(); $model->set('gsu_result_field', 'label', $this->_('Result field')); + $model->set('gsu_agenda_result', 'label', $this->_('Agenda field')); $model->set('gsu_duration', 'label', $this->_('Duration description'), 'description', $this->_('Text to inform the respondent, e.g. "20 seconds" or "1 minute".')); } $model->setIfExists('gsu_code', 'label', $this->_('Code name'), 'size', 10, 'description', $this->_('Only for programmers.')); Added: trunk/library/configs/db/tables/gems__respondent2appointment.sql =================================================================== --- trunk/library/configs/db/tables/gems__respondent2appointment.sql (rev 0) +++ trunk/library/configs/db/tables/gems__respondent2appointment.sql 2013-04-04 15:34:26 UTC (rev 1213) @@ -0,0 +1,27 @@ + +CREATE TABLE if not exists gems__respondent2appointment ( + gr2a_id_appointment bigint unsigned not null auto_increment, + gr2a_id_user bigint unsigned not null references gems__respondents (grs_id_user), + gr2a_id_organization bigint unsigned not null references gems__organizations (gor_id_organization), + + gr2a_appointment datetime not null, + gr2a_whole_day boolean not null default 0, + gr2a_until datetime null, + gr2a_active boolean not null default 1, + + gr2a_subject varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null, + gr2a_location varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null, + gr2a_comment TEXT CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null, + + gr2a_changed timestamp not null default current_timestamp on update current_timestamp, + gr2a_changed_by bigint unsigned not null, + gr2a_created timestamp not null, + gr2a_created_by bigint unsigned not null, + + PRIMARY KEY (gr2a_id_appointment), + INDEX (gr2a_id_user, gr2a_id_organization), + INDEX (gr2a_appointment) +) +ENGINE=InnoDB +auto_increment = 2000000 +CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-04-11 14:28:26
|
Revision: 1224 http://sourceforge.net/p/gemstracker/code/1224 Author: matijsdejong Date: 2013-04-11 14:27:58 +0000 (Thu, 11 Apr 2013) Log Message: ----------- Changed the default test and development password rules Modified Paths: -------------- trunk/library/classes/Gems/Project/ProjectSettings.php Added Paths: ----------- trunk/library/configs/application.example.ini trunk/library/configs/project.example.ini Modified: trunk/library/classes/Gems/Project/ProjectSettings.php =================================================================== --- trunk/library/classes/Gems/Project/ProjectSettings.php 2013-04-11 09:59:26 UTC (rev 1223) +++ trunk/library/classes/Gems/Project/ProjectSettings.php 2013-04-11 14:27:58 UTC (rev 1224) @@ -567,7 +567,7 @@ } /** - * Returns the super admin password, if it exists + * Returns the super admin ip range, if it exists * * @return string */ Added: trunk/library/configs/application.example.ini =================================================================== --- trunk/library/configs/application.example.ini (rev 0) +++ trunk/library/configs/application.example.ini 2013-04-11 14:27:58 UTC (rev 1224) @@ -0,0 +1,43 @@ + +[production] +phpSettings.display_startup_errors = 0 +phpSettings.display_errors = 0 + +bootstrap.path = GEMS_PROJECT_NAME_UC "/Escort.php" +bootstrap.class = GEMS_PROJECT_NAME_UC "_Escort" +; Uncomment this line if the project uses it's own code classes +; loaderDirs.GEMS_PROJECT_NAME_UC = APPLICATION_PATH "/classes/" GEMS_PROJECT_NAME_UC +loaderDirs.Gems = GEMS_LIBRARY_DIR "/classes/Gems" +; resources.db.adapter = PDO_MYSQL +resources.db.adapter = Mysqli +resources.db.params.charset = utf8 +; Either replace HOST, DATABASE, USER, PASSWD with the correct strings, +; or define() these strings as constants. +resources.db.params.host = HOST +resources.db.params.dbname = DATABASE +resources.db.params.username = USER +resources.db.params.password = PASSWD +resources.db.isDefaultTableAdapter = true +resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" +resources.layout.layout = "gems-fluid" +resources.layout.layoutPath = GEMS_LIBRARY_DIR "/layouts/scripts" + +firebug.log = 0 + +; Set to 0 to disable using OpenRosa survey source +useOpenRosa = 1 + +[staging : production] + +[testing : production] +phpSettings.display_startup_errors = 1 +phpSettings.display_errors = 1 + +[demo : production] + +[development : production] +phpSettings.display_startup_errors = 1 +phpSettings.display_errors = 1 +firebug.log = 1 +; Set to 1 if you want to enable zfdebug output +zfdebug.activate = 0 Added: trunk/library/configs/project.example.ini =================================================================== --- trunk/library/configs/project.example.ini (rev 0) +++ trunk/library/configs/project.example.ini 2013-04-11 14:27:58 UTC (rev 1224) @@ -0,0 +1,350 @@ +[production] +name = GEMS_PROJECT_NAME_UC +description = GEMS_PROJECT_NAME_UC +;longDescr = "" +;longDescrNl = "" + +;--------------------------------------------------- +; Hash encryption salt. REQUIRED! +; +; Use e.g. http://www.random.org/strings/ to create. +; +; Put %s somewhere within the salt to mix the value +; in the salt. +;--------------------------------------------------- +salt = + +;---------------------------------------------------------- +; The non database super user +; +; On production pwd should be empty or longer than 10 chars +; and quoted if it contains special characters. +;---------------------------------------------------------- +admin.user = superadmin +admin.pwd = PASSWD +;admin.ipRanges = 10.0.0.0-10.255.255.255;192.168.0.0-192.168.255.255 + +css.gems = gems/css/gems-fluid.css +css.print.url = gems/css/gems_print.css +css.print.media = print +imagedir = gems/images +imagedir = gems/images +css.local = basic/basic.css +favicon = basic/basic.ico +jquerycss = basic/jquery-basic.css + +contact.bugsUrl = http://gemstracker.org/mantis +contact.docsUrl = http://gemstracker.org/wiki/doku.php +;contact.forumUrl = http://gemstracker.org/wiki/doku.php +contact.gemsUrl = http://gemstracker.org/ +contact.manualUrl = "http://gemstracker.org/wiki/doku.php?id=userzone:userdoc:start" +;contact.supportUrl = http://gemstracker.org/wiki/doku.php + +databaseFileEncoding = ISO-8859-1 + +;------------------------------------------------------- +; SESSION SECTION +; +; idleTimeout +; +; Lifetime of the session (determines the expiration of +; the session namespace(s)). +; If not set, defaults to 1800 seconds = 30 minutes. +; +;------------------------------------------------------- + +session.idleTimeout = 1800 + +;------------------------------------------------------- +; ASK THROTTLE SECTION +; +; Sets values that control the throttling (slowdowns to +; combat brute-force attacks) of the ask / token +; controller. +; +; askThrottle.period +; +; Look for failed token attempts in from now to +; X seconds ago. +; +; askThrottle.threshold +; +; If the number of failed token attempts exceeds this +; number, starting throttling. +; +; askThrottle.delay +; +; Throttle by delaying each request by X seconds. +; +;------------------------------------------------------- + +askThrottle.period = 900 +askThrottle.threshold = 300 +askThrottle.delay = 10 + +;------------------------------------------------------- +; ASK DELAY SECTION +; +; askDelay +; +; When no askDelay is specified or is -1 the user will see +; greeting screen were he or she will a have to click +; on a button to fill in a survey. +; +; With the askDelay is > 0 then greeting screen will +; be shown (with the button) but after the specified +; number of seconds the survey will load automatically. +; +; With an askDelay of 0 seconds the survey will load +; automatically. +; +; askNextDelay +; +; askNextDelay works the same but applies to the wait +; after the user completed a survey while another survey +; is available. +;------------------------------------------------------- + +; askDelay = 10 +; askNextDelay = 0 + +;------------------------------------------------------- +; E-MAIL SECTION +; +; USE +; +; Here you can set three global e-mail settings: +; +; bcc = BCC every sent mail to this address. +; block = Block any sending of mail. +; bounce = When set to 1 all mails are not sent to the +; suplied TO address, but redirects them to +; the FROM not respondent address. This allows +; testing without altering respondent e-mail +; addresses. +; site = Supply a general site FROM address. +;------------------------------------------------------- + +; email.bcc = +email.block = 0 +email.bounce = 0 +; email.site = + +;------------------------------------------------------- +; LAYOUT SECTION +; +; USE +; +; For each layout item with a value other than 0 there +; must exist a _layout{Item}() method in GemsEscort or +; the {Project}Escort.php class specified in +; {Project}Application.ini file. +; +; Items are loaded in the order specified below. Order +; may be important, e.g. navigation should be called +; before crumbs. +; +; INPUT +; +; This method is called with layoutPrepareArgs.{Item} +; in an array. +; +; Both layoutPrepare and layoutPrepareArgs can be +; changed at runtime before GemsEscort.postDispatch() +; is called. +; +; OUTPUT: +; +; The result (if any) is stored as a $view property. +; When the item value is a number, the name will be +; the item name. +; When the item value is a string, then it is stored +; in a MUtil_Html_Sequence view property with that +; string as name. The sequence is created on demand. +;------------------------------------------------------- + +layoutPrepare.title = 1 +layoutPrepare.projectName = header +layoutPrepare.login = header_bar +layoutPrepare.contact = 0 +layoutPrepare.localeSet = header_bar +layoutPrepare.organizationSwitcher = header_bar +layoutPrepare.version = footer +layoutPrepare.user = footer +layoutPrepare.time = 0 +layoutPrepare.menuHtml = 1 +layoutPrepare.navigation = 0 +layoutPrepare.crumbs = main +layoutPrepare.messages = main +layoutPrepare.css = 1 +layoutPrepare.favicon = 1 +layoutPrepare.dojo = 0 +layoutPrepare.jQuery = 1 + +layoutPrepareArgs.login.class = rightFloat +;layoutPrepareArgs.contact.class = rightFloat +layoutPrepareArgs.time.class = rightFloat +layoutPrepareArgs.user.class = rightFloat +layoutPrepareArgs.version.class = leftFloat +layoutPrepareArgs.localeSet.class = leftFloat + +;------------------------------------------------------- +; LOCALE SECTION +; +; Specify a default locale and locales for each of the +; supported languages. +;------------------------------------------------------- + +locale.default = "en" +locales.en = "en" +locales.nl = "nl" + +;------------------------------------------------------- +; ORGANIZATION SECTION +; +; Specify a default organization for a project. Allows +; all user to login when this organization is choosen. +;------------------------------------------------------- + +; organization.default = 70 + +;---------------------------------------------------------------------- +; PASSWORD SECTION +; +; Allows default setting of initial password for new users: +; password.firstPassword = sesame +;---------------------------------------------------------------------- + +;password.initialPassword = sesame + +;---------------------------------------------------------------------- +; PASSWORDS SECTION +; +; The last key must be a function name in your PasswordChecker class. +; That function must accept as parameters the array value and the +; password. +; +; In between keys can contain case insensitive organization codes, user +; roles and user definition names in any order and can overrule previous +; defined values. +; BEWARE keep keys in fixed array order: +; passwords.staff.mgz.capsCount = 1 +; passwords.mgz.staff.lowerCount = 1 +; passwords.staff.mgz.lowerCount = 2 +; will be processed as: +; passwords.staff.mgz.capsCount = 1 +; passwords.staff.mgz.lowerCount = 2 +; passwords.mgz.staff.lowerCount = 1 +;---------------------------------------------------------------------- + +passwords.notTheName = 1 +passwords.guest.minLength = 6 +passwords.staff.capsCount = 1 +passwords.staff.lowerCount = 1 +passwords.staff.minLength = 8 +passwords.staff.numCount = 0 +passwords.staff.notAlphaCount = 1 +passwords.staff.notAlphaNumCount = 0 + +;------------------------------------------------------- +; TOKEN SECTION +; +; chars: characters allowed in a token. +; format: format string to show to user for input of +; token. The \ backslash is used as escape +; character for characters that are fixed. +; from: commonly mistaken input characters to correct. +; to: characters to translate from characters to. +; case: optional: 1|0. If the token should be +; treated case sensitive. If missing the token +; is case sensitive when chars contains +; uppercase characters. +; reuse: days tokens can be used: +; -1 = not at all +; 0 = only today (default and required for looping) +; 1 = only up to yesterdays tokens +;------------------------------------------------------- + +tokens.chars = 23456789abcdefghijklmnopqrstuvwxyz +tokens.format = XXXX\-XXXX; +tokens.from = 01; +tokens.to = ol; + +;--------------------------------------------------------- +; CONSENT SECTION +;--------------------------------------------------------- +consentRejected = 'do not use' +consentTypes = 'do not use|consent given' +consentDefault = 'Unknown' ;Default setup makes this 'do not use' + +;--------------------------------------------------------- +; LOGLEVEL SECTION +;--------------------------------------------------------- +; Use the loglevels as defined in Zend_Log to define the highest level of errors to log +; +; 0 Emergency: system is unusable +; 1 Alert: action must be taken immediately +; 2 Critical: critical conditions +; 3 Error: error conditions +; 4 Warning: warning conditions +; 5 Notice: normal but significant condition +; 6 Informational: informational messages +; 7 Debug: debug messages +; +; Defaults for production are 3 (error) and 7 (debug) for testing and development, uncomment the +; line below to use a custom setting +;logLevel = 6; + +;--------------------------------------------------------- +; EXPORT SECTION +;--------------------------------------------------------- +; Command line to the pdf export binary (such as +; wkhtmltopdf, Phantom.js or similar) +; +; Use as follows: +; export.pdfExportCommand = '/bin/wkhtmltopdf %s %s' +; +; where %s %s is respecitively the input (url) and +; the output (file) +export.pdfExportCommand = + +;--------------------------------------------------------- +; PERFORMANCE +; Define what kind of cache to use. Choose from: +; apc (shared) memory cache, can sometimes be slow due to limited available +; memory in shared environments +; file When filesystem is fast enough or apc is not available +; none No cache - good for development +;--------------------------------------------------------- +cache = "apc" + +[testing : production] +cache = "file" +admin.user = superadmin +admin.pwd = superadmin + +email.bounce = 1 + +passwords.notTheName = 0 +passwords.staff.minLength = 6 + +[demo : production] +admin.user = superadmin +admin.pwd = superadmin + +email.bounce = 1 + +[development : production] +cache = "none" +admin.user = superadmin +admin.pwd = superadmin + +email.bounce = 1 + +passwords.notTheName = 0 +passwords.staff.capsCount = 0 +passwords.staff.lowerCount = 0 +passwords.staff.minLength = 6 +passwords.staff.numCount = 0 +passwords.staff.notAlphaCount = 0 +passwords.staff.notAlphaNumCount = 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |