You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
(70) |
Nov
(164) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(52) |
Feb
(77) |
Mar
(70) |
Apr
(58) |
May
(81) |
Jun
(74) |
Jul
(87) |
Aug
(30) |
Sep
(45) |
Oct
(37) |
Nov
(51) |
Dec
(31) |
2013 |
Jan
(47) |
Feb
(29) |
Mar
(40) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gem...@li...> - 2012-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-08 13:25:42
|
Revision: 1006 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1006&view=rev Author: roelfaber Date: 2012-11-08 13:25:32 +0000 (Thu, 08 Nov 2012) Log Message: ----------- a few dutch spelling errors (grammar) corrected Modified Paths: -------------- trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2012-11-01 16:34:55 UTC (rev 1005) +++ trunk/library/languages/default-nl.po 2012-11-08 13:25:32 UTC (rev 1006) @@ -4,7 +4,7 @@ "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-10-17 12:56+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Matijs de Jong <mj...@ma...>\n" +"Last-Translator: Roel Faber <r....@er...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -2061,11 +2061,11 @@ #: classes/Gems/Default/SourceAction.php:115 msgid "Check tokens for being answered or not, reruns survey and round event code on completed tokens and recalculates the start and end times of all tokens in tracks that have completed tokens." -msgstr "Controleert of kenmerken beantwoort zijn, voert vragenlijst- en ronde-afrondingscode (opnieuw) uit voor beantwoorde kenmerken en herberekent de begin- en eind-tijden voor de onbeantwoorde kenmerken in trajecten met beantwoorde kenmerken." +msgstr "Controleert of kenmerken beantwoord zijn, voert vragenlijst- en ronde-afrondingscode (opnieuw) uit voor beantwoorde kenmerken en herberekent de begin- en eind-tijden voor de onbeantwoorde kenmerken in trajecten met beantwoorde kenmerken." #: classes/Gems/Default/SourceAction.php:116 msgid "Run this code when survey result fields, survey or round events or the event code has changed or after bulk changes in a survey source." -msgstr "Voer deze opdracht uit als vragenlijst resultaat velden of vragenlijst- of ronde-afrondingscodes verandert zijn en na bulk veranderingen in een vragenlijst bron." +msgstr "Voer deze opdracht uit als vragenlijst resultaat velden of vragenlijst- of ronde-afrondingscodes veranderd zijn en na bulk veranderingen in een vragenlijst bron." #: classes/Gems/Default/SourceAction.php:126 msgid "Check source for new surveys, changes in survey status and survey deletion. Can also perform maintenance on some sources, e.g. by changing the number of attributes." @@ -2073,7 +2073,7 @@ #: classes/Gems/Default/SourceAction.php:127 msgid "Run this code when the status of a survey in a source has changed or when the code has changed and the source must be adapted." -msgstr "Voer deze opdracht uit als de bron status van een vragenlijst verandert is of als de programma code verandert is en de bron aangepast moet worden." +msgstr "Voer deze opdracht uit als de bron status van een vragenlijst veranderd is of als de programma code veranderd is en de bron aangepast moet worden." #: classes/Gems/Default/SourceAction.php:140 #, php-format @@ -2086,7 +2086,7 @@ #: classes/Gems/Default/SourceAction.php:146 msgid "Run this code when the number of attributes has changed or when you suspect the attributes have been corrupted somehow." -msgstr "Voer deze opdracht uit als het aantal kenmerk attributen verandert is of als er een vermoeden is dat de kenmerken om een of andere reden niet langer correct zijn opgeslagen." +msgstr "Voer deze opdracht uit als het aantal kenmerk attributen veranderd is of als er een vermoeden is dat de kenmerken om een of andere reden niet langer correct zijn opgeslagen." #: classes/Gems/Default/SourceAction.php:159 #, php-format This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-11-01 16:35:01
|
Revision: 1005 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1005&view=rev Author: matijsdejong Date: 2012-11-01 16:34:55 +0000 (Thu, 01 Nov 2012) Log Message: ----------- Fix for bug 547 superadmin cannot change email template Fix for bug 570 wrong reception code shown while deleting Modified Paths: -------------- trunk/library/classes/Gems/Email/MailTemplateForm.php trunk/library/classes/Gems/Util/ReceptionCodeLibrary.php Modified: trunk/library/classes/Gems/Email/MailTemplateForm.php =================================================================== --- trunk/library/classes/Gems/Email/MailTemplateForm.php 2012-11-01 11:08:38 UTC (rev 1004) +++ trunk/library/classes/Gems/Email/MailTemplateForm.php 2012-11-01 16:34:55 UTC (rev 1005) @@ -131,10 +131,10 @@ $org_id = $this->getValue('gto_id_organization'); $filter['gto_id_organization'] = $org_id ? $org_id : $this->escort->getCurrentOrganization(); + $filter[] = 'grs_email IS NOT NULL'; - // By sorting descending we get the filled values first, so we usually get a correct value - // with email and valid_from date, but use any other token afterwards - $sort = array('grs_email' => SORT_DESC, 'gto_valid_from' => SORT_DESC); + // Without sorting we get the fastest load times + $sort = false; $tokenData = $model->loadFirst($filter, $sort); Modified: trunk/library/classes/Gems/Util/ReceptionCodeLibrary.php =================================================================== --- trunk/library/classes/Gems/Util/ReceptionCodeLibrary.php 2012-11-01 11:08:38 UTC (rev 1004) +++ trunk/library/classes/Gems/Util/ReceptionCodeLibrary.php 2012-11-01 16:34:55 UTC (rev 1005) @@ -136,7 +136,7 @@ public function getRespondentDeletionCodes() { $select = $this->_getDeletionCodeSelect(); - $select->where('(grc_for_respondents = 1 OR grc_for_surveys = ?)', self::APPLY_STOP); + $select->where('grc_for_respondents = 1'); return $this->db->fetchPairs($select); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-11-01 11:08:45
|
Revision: 1004 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1004&view=rev Author: matijsdejong Date: 2012-11-01 11:08:38 +0000 (Thu, 01 Nov 2012) Log Message: ----------- removed renderAny added documentation Modified Paths: -------------- trunk/library/classes/MUtil/Html/HtmlElement.php trunk/library/classes/MUtil/Html/Renderer.php trunk/library/classes/MUtil/Html.php Modified: trunk/library/classes/MUtil/Html/HtmlElement.php =================================================================== --- trunk/library/classes/MUtil/Html/HtmlElement.php 2012-11-01 09:38:21 UTC (rev 1003) +++ trunk/library/classes/MUtil/Html/HtmlElement.php 2012-11-01 11:08:38 UTC (rev 1004) @@ -1062,14 +1062,14 @@ if ($this->_repeater->__start()) { $html = null; while ($this->_repeater->__next()) { - $html .= implode('', $renderer->renderAny($view, $this->_content)); + $html .= $renderer->renderAny($view, $this->_content); } return $html; } } elseif ($content = $renderer->renderAny($view, $this->_content)) { - return implode('', $content); + return $content; } } Modified: trunk/library/classes/MUtil/Html/Renderer.php =================================================================== --- trunk/library/classes/MUtil/Html/Renderer.php 2012-11-01 09:38:21 UTC (rev 1003) +++ trunk/library/classes/MUtil/Html/Renderer.php 2012-11-01 11:08:38 UTC (rev 1004) @@ -1,10 +1,9 @@ <?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 @@ -15,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 @@ -26,25 +25,50 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @package MUtil + * @subpackage Html + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $id: Renderer.php 362 2011-12-15 17:21:17Z matijsdejong $ */ /** - * @author Matijs de Jong - * @since 1.0 - * @version 1.1 - * @package MUtil + * Render output for a view. + * + * This object handles MUtil_Html_HtmlInterface and MUtil_Lazy_LazyInterface + * objects natively, as well as array, scalar values and objects with a + * __toString function. + * + * All other object types passed to the renderer should have a render function + * defined for them in the ClassRenderList. + * + * @package MUtil * @subpackage Html + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 */ - class MUtil_Html_Renderer { + /** + * + * @var MUtil_Util_ClassList + */ protected $_classRenderFunctions; - // The MUtil_Html_Renderer::doNotRender items allow you to pass these - // items to a content without triggering error messages. - // - // This is usefull if you want to pass an item but are not sure that - // it will be used in very case. + /** + * Default array of objects rendering functions. + * + * The MUtil_Html_Renderer::doNotRender function allows items to be passed + * as content without triggering error messages. + * + * This is usefull if you want to pass an item to sub objects, but are not + * sure that it will be used in every case. + * + * @var array classname => static output function + */ protected $_initialClassRenderFunctions = array( 'Zend_Db_Adapter_Abstract' => 'MUtil_Html_Renderer::doNotRender', 'Zend_Controller_Request_Abstract' => 'MUtil_Html_Renderer::doNotRender', @@ -54,11 +78,23 @@ 'Zend_Translate' => 'MUtil_Html_Renderer::doNotRender', ); + /** + * Create the renderer + * + * @param mixed $classRenderFunctions Array of classname => renderFunction or MUtil_Util_ClassList + * @param boolean $append Replace when false, append to default definitions otherwise + */ public function __construct($classRenderFunctions = null, $append = true) { $this->setClassRenderList($classRenderFunctions, $append); } + /** + * Check if the value can be rendered by this object + * + * @param mixed $value + * @return boolean True when the object can be rendered + */ public function canRender($value) { if (is_object($value)) { @@ -83,6 +119,16 @@ } } + /** + * Static helper function used for object types that should + * not produce output when (accidently) rendered. + * + * Eg Zend_Translate or Zend_Db_Adapter_Abstract + * + * @param Zend_View_Abstract $view + * @param mixed $content + * @return null + */ public static function doNotRender(Zend_View_Abstract $view, $content) { if (MUtil_Html::$verbose) { @@ -91,11 +137,33 @@ return null; } + /** + * Get the classlist containing render functions for non-builtin objects + * + * @return MUtil_Util_ClassList + */ public function getClassRenderList() { return $this->_classRenderFunctions; } + /** + * Renders the $content so that it can be used as output for the $view, + * including output escaping and encoding correction. + * + * This functions handles MUtil_Html_HtmlInterface and MUtil_Lazy_LazyInterface + * objects natively, as well as array, scalar values and objects with a + * __toString function. + * + * Other objects a definition should have a render function in getClassRenderList(). + * + * All Lazy variabables are raised. + * + * @param Zend_View_Abstract $view + * @param mixed $content Anything HtmlInterface, number, string, array, object with __toString + * or an object that has a defined render function in getClassRenderList(). + * @return string Output to echo to the user + */ public function renderAny(Zend_View_Abstract $view, $content) { // Resolve first as this function as recursion heavy enough as it is. @@ -111,14 +179,10 @@ // Again, skip on the recursion count foreach ($content as $key => $item) { - $new_content[$key] = $this->renderAny($view, $item); - // MUtil_Echo::r($key . '=>' . $new_content[$key]); - if (null === $new_content[$key]) { - unset($new_content[$key]); - } + $new_content[] = $this->renderAny($view, $item); } - return $new_content; + return implode('', $new_content); } else { if (is_object($content)) { @@ -141,25 +205,20 @@ return $new_content; - } elseif (! is_array($content)) { - return $content; // Returns 0 (zero) and '' when that is the value of $content } - } - public function renderArray(Zend_View_Abstract $view, array $content) - { - if ($content) { - foreach ($content as $key => $item) { - $content[$key] = $this->renderAny($view, $item); - if (null === $content[$key]) { - unset($content[$key]); - } - } - - return $content; + if (! is_array($content)) { // Skip empty array + return $content; // Returns 0 (zero) and '' when that is the value of $content } } + /** + * Change the list of non-builtin objects that can be rendered by this renderer. + * + * @param mixed $classRenderFunctions Array of classname => renderFunction or MUtil_Util_ClassList + * @param boolean $append Replace when false, append otherwise + * @return MUtil_Html_Renderer (continuation pattern) + */ public function setClassRenderList($classRenderFunctions = null, $append = false) { if ($classRenderFunctions instanceof MUtil_Util_ClassList) { Modified: trunk/library/classes/MUtil/Html.php =================================================================== --- trunk/library/classes/MUtil/Html.php 2012-11-01 09:38:21 UTC (rev 1003) +++ trunk/library/classes/MUtil/Html.php 2012-11-01 11:08:38 UTC (rev 1004) @@ -98,6 +98,12 @@ return self::getCreator()->createAttribute($attributeName, $args); } + /** + * Check if the value can be rendered by the default renderer + * + * @param mixed $value + * @return boolean True when the object can be rendered + */ public static function canRender($value) { return self::getRenderer()->canRender($value); @@ -235,16 +241,19 @@ return self::getCreator()->create('raw', array($content)); } + /** + * Renders the $content so that it can be used as output for the $view, + * including output escaping and encoding correction. + * + * @param Zend_View_Abstract $view + * @param mixed $content Anything number, string, array, Lazy, HtmlInterface, object with __toString + * @return string Output to echo to the user + */ public static function renderAny(Zend_View_Abstract $view, $content) { return self::getRenderer()->renderAny($view, $content); } - public static function renderArray(Zend_View_Abstract $view, array $content) - { - return self::getRenderer()->renderArray($view, $content); - } - public static function renderNew(Zend_View_Abstract $view, $tagName, $arg_array = null) { $args = array_slice(func_get_args(), 2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-11-01 09:38:27
|
Revision: 1003 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1003&view=rev Author: michieltcs Date: 2012-11-01 09:38:21 +0000 (Thu, 01 Nov 2012) Log Message: ----------- Call translation on right object Modified Paths: -------------- trunk/library/classes/Gems/Pdf.php Modified: trunk/library/classes/Gems/Pdf.php =================================================================== --- trunk/library/classes/Gems/Pdf.php 2012-11-01 08:55:36 UTC (rev 1002) +++ trunk/library/classes/Gems/Pdf.php 2012-11-01 09:38:21 UTC (rev 1003) @@ -333,7 +333,7 @@ @unlink($tempInputFilename); @unlink($tempOutputFilename); - throw new Exception(sprintf($this->_('Unable to run PDF conversion (%s): "%s"'), $command, $lastLine)); + throw new Exception(sprintf($this->translate->_('Unable to run PDF conversion (%s): "%s"'), $command, $lastLine)); } $pdfContents = file_get_contents($tempOutputFilename); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-11-01 08:55:44
|
Revision: 1002 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1002&view=rev Author: mennodekker Date: 2012-11-01 08:55:36 +0000 (Thu, 01 Nov 2012) Log Message: ----------- Made renderArray obsolete by making renderAny behave the same as renderAny (as it should) Modified Paths: -------------- trunk/library/classes/MUtil/Html/HtmlElement.php trunk/library/classes/MUtil/Html/Renderer.php Modified: trunk/library/classes/MUtil/Html/HtmlElement.php =================================================================== --- trunk/library/classes/MUtil/Html/HtmlElement.php 2012-10-31 16:58:48 UTC (rev 1001) +++ trunk/library/classes/MUtil/Html/HtmlElement.php 2012-11-01 08:55:36 UTC (rev 1002) @@ -1062,13 +1062,13 @@ if ($this->_repeater->__start()) { $html = null; while ($this->_repeater->__next()) { - $html .= implode('', $renderer->renderArray($view, $this->_content)); + $html .= implode('', $renderer->renderAny($view, $this->_content)); } return $html; } - } elseif ($content = $renderer->renderArray($view, $this->_content)) { + } elseif ($content = $renderer->renderAny($view, $this->_content)) { return implode('', $content); } } Modified: trunk/library/classes/MUtil/Html/Renderer.php =================================================================== --- trunk/library/classes/MUtil/Html/Renderer.php 2012-10-31 16:58:48 UTC (rev 1001) +++ trunk/library/classes/MUtil/Html/Renderer.php 2012-11-01 08:55:36 UTC (rev 1002) @@ -1,34 +1,34 @@ <?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. - */ - + /** + * 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 @@ -118,11 +118,7 @@ } } - if (count($new_content)) { - $new_content = implode('', $new_content); - } else { - return null; - } + return $new_content; } else { if (is_object($content)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-31 16:59:00
|
Revision: 1001 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1001&view=rev Author: matijsdejong Date: 2012-10-31 16:58:48 +0000 (Wed, 31 Oct 2012) Log Message: ----------- Added new string functions with tests Some more small renderer speedups Modified Paths: -------------- trunk/library/classes/MUtil/Html/ElementDecorator.php trunk/library/classes/MUtil/Html/HtmlElement.php trunk/library/classes/MUtil/Html/RepeatRenderer.php trunk/library/classes/MUtil/String.php trunk/test/classes/MUtil/StringTest.php Modified: trunk/library/classes/MUtil/Html/ElementDecorator.php =================================================================== --- trunk/library/classes/MUtil/Html/ElementDecorator.php 2012-10-31 15:43:33 UTC (rev 1000) +++ trunk/library/classes/MUtil/Html/ElementDecorator.php 2012-10-31 16:58:48 UTC (rev 1001) @@ -128,7 +128,7 @@ if ($prologue instanceof MUtil_Html_HtmlInterface) { $prologue = $prologue->render($view); } else { - $prologue = MUtil_Html::getrenderer()->renderAny($view, $prologue); + $prologue = MUtil_Html::getRenderer()->renderAny($view, $prologue); } } else { $prologue = ''; Modified: trunk/library/classes/MUtil/Html/HtmlElement.php =================================================================== --- trunk/library/classes/MUtil/Html/HtmlElement.php 2012-10-31 15:43:33 UTC (rev 1000) +++ trunk/library/classes/MUtil/Html/HtmlElement.php 2012-10-31 16:58:48 UTC (rev 1001) @@ -1056,11 +1056,11 @@ */ protected function renderContent(Zend_View_Abstract $view) { + $renderer = MUtil_Html::getRenderer(); if ($this->_content) { if ($this->_repeater && (! $this->_repeatTags)) { if ($this->_repeater->__start()) { $html = null; - $renderer = MUtil_Html::getRenderer(); while ($this->_repeater->__next()) { $html .= implode('', $renderer->renderArray($view, $this->_content)); } @@ -1068,13 +1068,13 @@ return $html; } - } elseif ($content = MUtil_Html::getRenderer()->renderArray($view, $this->_content)) { + } elseif ($content = $renderer->renderArray($view, $this->_content)) { return implode('', $content); } } if ($this->_onEmptyContent) { - return MUtil_Html::getRenderer()->renderAny($view, $this->_onEmptyContent); + return $renderer->renderAny($view, $this->_onEmptyContent); } return null; Modified: trunk/library/classes/MUtil/Html/RepeatRenderer.php =================================================================== --- trunk/library/classes/MUtil/Html/RepeatRenderer.php 2012-10-31 15:43:33 UTC (rev 1000) +++ trunk/library/classes/MUtil/Html/RepeatRenderer.php 2012-10-31 16:58:48 UTC (rev 1001) @@ -1,10 +1,9 @@ <?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 @@ -15,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 @@ -26,59 +25,60 @@ * 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 + * + * + * @package MUtil * @subpackage Html + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** * RepeatRenderer wraps itself around some content and returns at rendering * time that content repeated multiple times or the $_emptyContent when the * repeater is empty. - * - * Most of the functions are the just to implement the ElementInterface and + * + * Most of the functions are the just to implement the ElementInterface and * are nothing but a stub to the internal content. These functions will * throw errors if you try to use them in ways that the actual $_content does * not allow. * * @see MUtil_Lazy_Repeatable - * - * @author Matijs de Jong - * @package MUtil + * + * @package MUtil * @subpackage Html + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 */ class MUtil_Html_RepeatRenderer implements MUtil_Html_ElementInterface { /** * The content to be repeated. - * - * @var mixed + * + * @var mixed */ protected $_content; - + /** * The content to show when the $_repeater returns no data. - * + * * @var mixed Optional */ protected $_emptyContent; - + /** * Any content to mixed between the instances of content. - * + * * @var mixed Optional */ protected $_glue; - + /** * The repeater containing a dataset - * + * * @var MUtil_Lazy_RepeatableInterface */ protected $_repeater; @@ -161,7 +161,7 @@ /** * Renders the element into a html string - * + * * The $view is used to correctly encode and escape the output * * @param Zend_View_Abstract $view @@ -169,22 +169,22 @@ */ public function render(Zend_View_Abstract $view) { + $renderer = MUtil_Html::getRenderer(); if ($this->hasRepeater() && $this->_content) { $data = $this->getRepeater(); if ($data->__start()) { $html = array(); - $renderer = MUtil_Html::getRenderer(); while ($data->__next()) { $html[] = $renderer->renderAny($view, $this->_content); } if ($html) { - return implode(MUtil_Html::getRenderer()->renderAny($view, $this->_glue), $html); + return implode($renderer->renderAny($view, $this->_glue), $html); } } } if ($this->_emptyContent) { - return MUtil_Html::getRenderer()->renderAny($view, $this->_emptyContent); + return $renderer->renderAny($view, $this->_emptyContent); } return null; Modified: trunk/library/classes/MUtil/String.php =================================================================== --- trunk/library/classes/MUtil/String.php 2012-10-31 15:43:33 UTC (rev 1000) +++ trunk/library/classes/MUtil/String.php 2012-10-31 16:58:48 UTC (rev 1001) @@ -81,6 +81,32 @@ } /** + * Returns true if haystack ends with needle or needle is empty + * + * @param string $haystack The string to search in + * @param string $needle The string to search for + * @param boolean $caseInSensitive When true a case insensitive compare is performed + * @return boolean + */ + public static function endsWith($haystack, $needle, $caseInSensitive = false) + { + $len = strlen($needle); + if ($len == 0) { + return true; + } + + if ((strlen($haystack) < $len)) { + return false; + } + + if ($caseInSensitive) { + return strtolower(substr($haystack, -$len)) === strtolower($needle); + } + + return substr($haystack, -$len) === (string) $needle; + } + + /** * Split a string whereever the callback returns true (including * the character that returns true. * @@ -119,6 +145,32 @@ } /** + * Returns true if haystack starts with needle or needle is empty + * + * @param string $haystack The string to search in + * @param string $needle The string to search for + * @param boolean $caseInSensitive When true a case insensitive compare is performed + * @return boolean + */ + public static function startsWith($haystack, $needle, $caseInSensitive = false) + { + $len = strlen($needle); + if ($len == 0) { + return true; + } + + if ((strlen($haystack) < $len)) { + return false; + } + + if ($caseInSensitive) { + return strtolower(substr($haystack, 0, $len)) === strtolower($needle); + } + + return substr($haystack, 0, $len) === (string) $needle; + } + + /** * Return the part after $input and $filter have stopped being the same * * stripStringLeft('abcdef', 'abcx') => 'def' Modified: trunk/test/classes/MUtil/StringTest.php =================================================================== --- trunk/test/classes/MUtil/StringTest.php 2012-10-31 15:43:33 UTC (rev 1000) +++ trunk/test/classes/MUtil/StringTest.php 2012-10-31 16:58:48 UTC (rev 1001) @@ -103,6 +103,69 @@ } /** + * Haystack ends with needle but wrong case + */ + public function testEndsWithCaseFalse() + { + $result = MUtil_String::endsWith('abcdef', 'deF'); + $this->assertEquals($result, false); + } + + /** + * Haystack does not end with needle + */ + public function testEndsWithFalse() + { + $result = MUtil_String::endsWith('abcdef', 'xdef'); + $this->assertEquals($result, false); + } + + /** + * Needle is empty + */ + public function testEndsWithNeedleEmpty() + { + $result = MUtil_String::endsWith('abcdef', ''); + $this->assertEquals($result, true); + } + + /** + * Needle is longer than haystack + */ + public function testEndsWithNeedleLonger() + { + $result = MUtil_String::endsWith('abc', 'abcdef'); + $this->assertEquals($result, false); + } + + /** + * Haystack ends with needle that is number (should work) + */ + public function testEndsWithNumber() + { + $result = MUtil_String::endsWith('abc10', 10); + $this->assertEquals($result, true); + } + + /** + * Haystack ends with needle but only case insensitively + */ + public function testEndsWithNoCaseTrue() + { + $result = MUtil_String::endsWith('abCdef', 'Def', true); + $this->assertEquals($result, true); + } + + /** + * Haystack ends with needle + */ + public function testEndsWithTrue() + { + $result = MUtil_String::endsWith('abcdef', 'def'); + $this->assertEquals($result, true); + } + + /** * Test a default callback usage */ public function testSplitOnCharCallbackDefault() @@ -179,6 +242,69 @@ } /** + * Haystack starts with needle but wrong case + */ + public function testStartsWithCaseFalse() + { + $result = MUtil_String::startsWith('abcdef', 'abC'); + $this->assertEquals($result, false); + } + + /** + * Haystack does not start with needle + */ + public function testStartsWithFalse() + { + $result = MUtil_String::startsWith('abcdef', 'abcx'); + $this->assertEquals($result, false); + } + + /** + * Needle is empty + */ + public function testStartsWithNeedleEmpty() + { + $result = MUtil_String::startsWith('abcdef', ''); + $this->assertEquals($result, true); + } + + /** + * Needle is longer + */ + public function testStartsWithNeedleLonger() + { + $result = MUtil_String::startsWith('abc', 'abcdef'); + $this->assertEquals($result, false); + } + + /** + * Haystack starts with numberic needle that is the same (is allowed) + */ + public function testStartsWithNumber() + { + $result = MUtil_String::startsWith('10abc', 10); + $this->assertEquals($result, true); + } + + /** + * Haystack starts with needle, but only case-insentivile + */ + public function testStartsWithNoCaseTrue() + { + $result = MUtil_String::startsWith('abCdef', 'abC', true); + $this->assertEquals($result, true); + } + + /** + * Haystack starts with needle + */ + public function testStartsWithTrue() + { + $result = MUtil_String::startsWith('abcdef', 'abc'); + $this->assertEquals($result, true); + } + + /** * Remove the characters where both strings are the same */ public function testStripStringLeftRemovepartFilter() @@ -199,7 +325,7 @@ /** * Remove nothing as both strings have no common starting characters */ - public function teststripStringLeftNothing() + public function testStripStringLeftNothing() { $result = MUtil_String::stripStringLeft('abcdef', 'xabc'); $this->assertEquals($result, 'abcdef'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-31 15:43:47
|
Revision: 1000 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1000&view=rev Author: mennodekker Date: 2012-10-31 15:43:33 +0000 (Wed, 31 Oct 2012) Log Message: ----------- Decreased maximum nesting level for project information page from 108 to 95 Modified Paths: -------------- trunk/library/classes/MUtil/Html/ArrayAttribute.php trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php trunk/library/classes/MUtil/Html/ElementDecorator.php trunk/library/classes/MUtil/Html/HtmlElement.php trunk/library/classes/MUtil/Html/ImgElement.php trunk/library/classes/MUtil/Html/LabelElement.php trunk/library/classes/MUtil/Html/MultiWrapper.php trunk/library/classes/MUtil/Html/RepeatRenderer.php trunk/library/classes/MUtil/Html/Sequence.php Modified: trunk/library/classes/MUtil/Html/ArrayAttribute.php =================================================================== --- trunk/library/classes/MUtil/Html/ArrayAttribute.php 2012-10-29 12:08:44 UTC (rev 999) +++ trunk/library/classes/MUtil/Html/ArrayAttribute.php 2012-10-31 15:43:33 UTC (rev 1000) @@ -101,8 +101,9 @@ $results = array(); $view = $this->getView(); + $renderer = MUtil_Html::getRenderer(); foreach ($this->getArray() as $key => $value) { - $results[$key] = MUtil_Html::renderAny($view, $value); + $results[$key] = $renderer->renderAny($view, $value); } return $results; Modified: trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php =================================================================== --- trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php 2012-10-29 12:08:44 UTC (rev 999) +++ trunk/library/classes/MUtil/Html/Code/DynamicAbstract.php 2012-10-31 15:43:33 UTC (rev 1000) @@ -114,9 +114,10 @@ $output = array(); + $renderer = MUtil_Html::getRenderer(); foreach ($this->_content as $content) { if (! is_string($content)) { - $content = MUtil_Html::renderAny($view, $content); + $content = $renderer->renderAny($view, $content); } if ((false === strpos($content, "\n")) && file_exists($content)) { Modified: trunk/library/classes/MUtil/Html/ElementDecorator.php =================================================================== --- trunk/library/classes/MUtil/Html/ElementDecorator.php 2012-10-29 12:08:44 UTC (rev 999) +++ trunk/library/classes/MUtil/Html/ElementDecorator.php 2012-10-31 15:43:33 UTC (rev 1000) @@ -128,7 +128,7 @@ if ($prologue instanceof MUtil_Html_HtmlInterface) { $prologue = $prologue->render($view); } else { - $prologue = MUtil_Html::renderAny($view, $prologue); + $prologue = MUtil_Html::getrenderer()->renderAny($view, $prologue); } } else { $prologue = ''; Modified: trunk/library/classes/MUtil/Html/HtmlElement.php =================================================================== --- trunk/library/classes/MUtil/Html/HtmlElement.php 2012-10-29 12:08:44 UTC (rev 999) +++ trunk/library/classes/MUtil/Html/HtmlElement.php 2012-10-31 15:43:33 UTC (rev 1000) @@ -762,8 +762,9 @@ { $results = array(); + $renderer = MUtil_Html::getRenderer(); foreach ($this->_attribs as $key => $value) { - $value = MUtil_Html::renderAny($view, $value); + $value = $renderer->renderAny($view, $value); if (null !== $value) { $results[$key] = $value; @@ -1059,20 +1060,21 @@ if ($this->_repeater && (! $this->_repeatTags)) { if ($this->_repeater->__start()) { $html = null; + $renderer = MUtil_Html::getRenderer(); while ($this->_repeater->__next()) { - $html .= implode('', MUtil_Html::renderArray($view, $this->_content)); + $html .= implode('', $renderer->renderArray($view, $this->_content)); } return $html; } - } elseif ($content = MUtil_Html::renderArray($view, $this->_content)) { + } elseif ($content = MUtil_Html::getRenderer()->renderArray($view, $this->_content)) { return implode('', $content); } } if ($this->_onEmptyContent) { - return MUtil_Html::renderAny($view, $this->_onEmptyContent); + return MUtil_Html::getRenderer()->renderAny($view, $this->_onEmptyContent); } return null; Modified: trunk/library/classes/MUtil/Html/ImgElement.php =================================================================== --- trunk/library/classes/MUtil/Html/ImgElement.php 2012-10-29 12:08:44 UTC (rev 999) +++ trunk/library/classes/MUtil/Html/ImgElement.php 2012-10-31 15:43:33 UTC (rev 1000) @@ -258,7 +258,7 @@ protected function renderElement(Zend_View_Abstract $view) { if (isset($this->_attribs['src'])) { - $src = MUtil_Html::renderAny($view, $this->_attribs['src']); + $src = MUtil_Html::getRenderer()->renderAny($view, $this->_attribs['src']); } else { $src = false; } Modified: trunk/library/classes/MUtil/Html/LabelElement.php =================================================================== --- trunk/library/classes/MUtil/Html/LabelElement.php 2012-10-29 12:08:44 UTC (rev 999) +++ trunk/library/classes/MUtil/Html/LabelElement.php 2012-10-31 15:43:33 UTC (rev 1000) @@ -1,34 +1,34 @@ <?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. - */ - + /** + * 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 @@ -150,11 +150,11 @@ protected function renderContent(Zend_View_Abstract $view) { - if ($content = MUtil_Html::renderAny($view, $this->_currentContent)) { + if ($content = MUtil_Html::getRenderer()->renderAny($view, $this->_currentContent)) { return $content; } elseif ($this->_onEmptyContent) { - return MUtil_Html::renderAny($view, $this->_onEmptyContent); + return MUtil_Html::getRenderer()->renderAny($view, $this->_onEmptyContent); } else { return ' '; Modified: trunk/library/classes/MUtil/Html/MultiWrapper.php =================================================================== --- trunk/library/classes/MUtil/Html/MultiWrapper.php 2012-10-29 12:08:44 UTC (rev 999) +++ trunk/library/classes/MUtil/Html/MultiWrapper.php 2012-10-31 15:43:33 UTC (rev 1000) @@ -1,35 +1,35 @@ <?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. - */ - + /** + * 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 @@ -67,8 +67,9 @@ { $results = array(); + $renderer = MUtil_Html::getRenderer(); foreach ($this->_array as $item) { - $result = MUtil_Html::renderAny($view, $item); + $result = $renderer->renderAny($view, $item); if ((null !== $result) && strlen($result)) { $results[] = $result; Modified: trunk/library/classes/MUtil/Html/RepeatRenderer.php =================================================================== --- trunk/library/classes/MUtil/Html/RepeatRenderer.php 2012-10-29 12:08:44 UTC (rev 999) +++ trunk/library/classes/MUtil/Html/RepeatRenderer.php 2012-10-31 15:43:33 UTC (rev 1000) @@ -1,35 +1,35 @@ <?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. - */ - + /** + * 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 @@ -173,17 +173,18 @@ $data = $this->getRepeater(); if ($data->__start()) { $html = array(); + $renderer = MUtil_Html::getRenderer(); while ($data->__next()) { - $html[] = MUtil_Html::renderAny($view, $this->_content); + $html[] = $renderer->renderAny($view, $this->_content); } if ($html) { - return implode(MUtil_Html::renderAny($view, $this->_glue), $html); + return implode(MUtil_Html::getRenderer()->renderAny($view, $this->_glue), $html); } } } if ($this->_emptyContent) { - return MUtil_Html::renderAny($view, $this->_emptyContent); + return MUtil_Html::getRenderer()->renderAny($view, $this->_emptyContent); } return null; Modified: trunk/library/classes/MUtil/Html/Sequence.php =================================================================== --- trunk/library/classes/MUtil/Html/Sequence.php 2012-10-29 12:08:44 UTC (rev 999) +++ trunk/library/classes/MUtil/Html/Sequence.php 2012-10-31 15:43:33 UTC (rev 1000) @@ -1,35 +1,35 @@ <?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. - */ - + /** + * 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 @@ -203,9 +203,10 @@ $view = $this->getView(); + $renderer = MUtil_Html::getRenderer(); foreach ($this->getIterator() as $item) { $html .= $glue; - $html .= MUtil_Html::renderAny($view, $item); + $html .= $renderer->renderAny($view, $item); } return substr($html, strlen($glue)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-29 12:08:53
|
Revision: 999 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=999&view=rev Author: matijsdejong Date: 2012-10-29 12:08:44 +0000 (Mon, 29 Oct 2012) Log Message: ----------- New MUtil_String::splitOnCharCallback function Modified Paths: -------------- trunk/library/classes/MUtil/String.php trunk/test/classes/MUtil/StringTest.php Modified: trunk/library/classes/MUtil/String.php =================================================================== --- trunk/library/classes/MUtil/String.php 2012-10-25 15:05:27 UTC (rev 998) +++ trunk/library/classes/MUtil/String.php 2012-10-29 12:08:44 UTC (rev 999) @@ -81,6 +81,44 @@ } /** + * Split a string whereever the callback returns true (including + * the character that returns true. + * + * MUtil_String::splitOnCharCallback('abcDef', 'ctype_upper') => array(0 => 'abc', 1 => 'Def'); + * + * MUtil_String::splitOnCharCallback('abCDef', 'ctype_upper', true) => array(0 => 'ab', 2 => 'ef'); + * + * @param string $input + * @param callback $callBack Taking a single character as input + * @param boolean $excludeDelimiter When excluded and 2 delimiters are next to each other, the output + * index in the array will skip a value + * @return array index => split portion + */ + public static function splitOnCharCallback($input, $callBack, $excludeDelimiter = false) + { + $current = 0; + $length = strlen($input); + $results = array(); + + for ($i = 0; $i < $length; $i++) { + if ($callBack($input[$i])) { + $current++; + + if ($excludeDelimiter) { + continue; + } + } + if (isset($results[$current])) { + $results[$current] .= $input[$i]; + } else { + $results[$current] = $input[$i]; + } + } + + return $results; + } + + /** * Return the part after $input and $filter have stopped being the same * * stripStringLeft('abcdef', 'abcx') => 'def' Modified: trunk/test/classes/MUtil/StringTest.php =================================================================== --- trunk/test/classes/MUtil/StringTest.php 2012-10-25 15:05:27 UTC (rev 998) +++ trunk/test/classes/MUtil/StringTest.php 2012-10-29 12:08:44 UTC (rev 999) @@ -103,6 +103,82 @@ } /** + * Test a default callback usage + */ + public function testSplitOnCharCallbackDefault() + { + $result = MUtil_String::splitOnCharCallback('abcDef', 'ctype_upper'); + $test[0] = 'abc'; + $test[1] = 'Def'; + $this->assertEquals($result, $test); + } + + /** + * Test callback usage, with two consecutive delimiters + */ + public function testSplitOnCharCallbackDoubleD() + { + $result = MUtil_String::splitOnCharCallback('abcDDef', 'ctype_upper'); + $test[0] = 'abc'; + $test[1] = 'D'; + $test[2] = 'Def'; + $this->assertEquals($result, $test); + } + + /** + * Test a callback usage where nothing happens + */ + public function testSplitOnCharCallbackEmptyString() + { + $result = MUtil_String::splitOnCharCallback('', 'ctype_upper'); + $this->assertEquals($result, array()); + } + + /** + * Test callback usage, excluding the delimiter + */ + public function testSplitOnCharCallbackNoDelimeter() + { + $result = MUtil_String::splitOnCharCallback('abcDef', 'ctype_upper', true); + $test[0] = 'abc'; + $test[1] = 'ef'; + $this->assertEquals($result, $test); + } + + /** + * Test callback usage where there are no delimiters + */ + public function testSplitOnCharCallbackNosplit() + { + $result = MUtil_String::splitOnCharCallback('abcdef', 'ctype_upper'); + $test[0] = 'abcdef'; + $this->assertEquals($result, $test); + } + + /** + * Test callback usage, with two consecutive caps, excluding the delimiter + */ + public function testSplitOnCharCallbackNoDelimiterDoubleD() + { + $result = MUtil_String::splitOnCharCallback('abcDDef', 'ctype_upper', true); + $test[0] = 'abc'; + $test[2] = 'ef'; + $this->assertEquals($result, $test); + } + + /** + * Test callback usage with another function + */ + public function testSplitOnCharCallbackNumeric() + { + $result = MUtil_String::splitOnCharCallback('ab1cD2ef', 'is_numeric'); + $test[0] = 'ab'; + $test[1] = '1cD'; + $test[2] = '2ef'; + $this->assertEquals($result, $test); + } + + /** * Remove the characters where both strings are the same */ public function testStripStringLeftRemovepartFilter() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-25 15:05:36
|
Revision: 998 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=998&view=rev Author: matijsdejong Date: 2012-10-25 15:05:27 +0000 (Thu, 25 Oct 2012) Log Message: ----------- Code cleanup + documentation Extr unitility getRespondentId in DbLookup.php Modified Paths: -------------- trunk/library/classes/Gems/Menu.php trunk/library/classes/Gems/Util/DbLookup.php trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/Gems/Menu.php =================================================================== --- trunk/library/classes/Gems/Menu.php 2012-10-25 12:55:41 UTC (rev 997) +++ trunk/library/classes/Gems/Menu.php 2012-10-25 15:05:27 UTC (rev 998) @@ -278,7 +278,6 @@ { $orgId = $this->escort->getLoader()->getCurrentUser()->getCurrentOrganizationId(); - // $params = array(MUtil_Model::REQUEST_ID => 'gr2o_patient_nr'); $params = array(MUtil_Model::REQUEST_ID1 => 'gr2o_patient_nr', MUtil_Model::REQUEST_ID2 => 'gr2o_id_organization'); // MAIN RESPONDENTS ITEM Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2012-10-25 12:55:41 UTC (rev 997) +++ trunk/library/classes/Gems/Util/DbLookup.php 2012-10-25 15:05:27 UTC (rev 998) @@ -92,7 +92,7 @@ return $organizations; } - + /** * Return key/value pairs of all active staff members * @@ -338,6 +338,27 @@ return $organizations; } + /** + * Find the respondent id corresponding to this patientNr / Orgid combo + * + * @param string $patientNr + * @param int $orgid + * @return int A respondent id or null + */ + public function getRespondentId($patientNr, $orgid) + { + $result = $this->db->fetchOne("SELECT gr2o_id_user FROM gems__respondent2org WHERE gr2o_patient_nr = ? AND gr2o_id_organization = ?", array($patientNr, $orgid)); + + if ($result !== false) { + return $result; + } + } + + /** + * Returns the roles in the acl + * + * @return array roleId => ucfirst(roleId) + */ public function getRoles() { $roles = array(); Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-10-25 12:55:41 UTC (rev 997) +++ trunk/library/classes/GemsEscort.php 2012-10-25 15:05:27 UTC (rev 998) @@ -572,9 +572,9 @@ if ($menuItem) { $contactDiv = MUtil_Html::create()->div( - $args, - array('id' => 'contact') - ); // tooltip + $args, + array('id' => 'contact') + ); // tooltip $contactDiv->a($menuItem->toHRefAttribute(), $menuItem->get('label')); $ul = $menuItem->toUl(); @@ -689,13 +689,13 @@ $icon = isset($this->project->favicon) ? $this->project->favicon : 'favicon.ico'; if (file_exists(GEMS_WEB_DIR . '/' . $icon)) { $this->view->headLink( - array( - 'rel' => 'shortcut icon', - 'href' => $this->basepath->getBasePath() . '/' . $icon, - 'type' => 'image/x-icon' - ), - Zend_View_Helper_Placeholder_Container_Abstract::PREPEND - ); + array( + 'rel' => 'shortcut icon', + 'href' => $this->basepath->getBasePath() . '/' . $icon, + 'type' => 'image/x-icon' + ), + Zend_View_Helper_Placeholder_Container_Abstract::PREPEND + ); } } @@ -749,12 +749,15 @@ if ($locale == $this->view->locale) { $localeDiv->span(strtoupper($locale)); } else { - $localeDiv->a(array( + $localeDiv->a( + array( 'controller' => 'language', 'action' => 'change-ui', 'language' => urlencode($locale), 'current_uri' => $currentUri - ), strtoupper($locale)); + ), + strtoupper($locale) + ); } $localeDiv[] = ' '; } @@ -914,7 +917,12 @@ $url = $this->view->url(array('controller' => 'organization', 'action' => 'change-ui'), null, true); $formDiv = $orgSwitch->form(array('method' => 'get', 'action' => $url))->div(); - $formDiv->input(array('type' => "hidden", 'name' => "current_uri", 'value' => base64_encode($currentUri))); + $formDiv->input( + array( + 'type' => "hidden", + 'name' => "current_uri", + 'value' => base64_encode($currentUri)) + ); $select = $formDiv->select(array('name' => "org", 'onchange' => "javascript:this.form.submit();")); foreach ($orgs as $id => $org) { @@ -1122,7 +1130,9 @@ protected function createProjectClass($className, $paramOne = null, $paramTwo = null) { - if (file_exists(APPLICATION_PATH . '/classes/' . GEMS_PROJECT_NAME_UC . '/' . str_replace('_', '/', $className) . '.php')) { + $filename = APPLICATION_PATH . '/classes/' . GEMS_PROJECT_NAME_UC . '/'; + $filename .= str_replace('_', '/', $className) . '.php'; + if (file_exists($filename)) { $className = GEMS_PROJECT_NAME_UC . '_' . $className; } else { $className = 'Gems_' . $className; @@ -1140,7 +1150,9 @@ return new $className($paramOne, $paramTwo); default: - throw new Gems_Exception_Coding(__CLASS__ . '->' . __FUNCTION__ . '() called with more parameters than possible.'); + throw new Gems_Exception_Coding( + __CLASS__ . '->' . __FUNCTION__ . '() called with more parameters than possible.' + ); } } @@ -1167,7 +1179,9 @@ { // Check the installation if (! isset($this->db)) { - $this->setException(new Gems_Exception_Coding('No database registered in ' . GEMS_PROJECT_NAME . 'Application.ini for key resources.db.')); + $this->setException(new Gems_Exception_Coding( + 'No database registered in ' . GEMS_PROJECT_NAME . 'Application.ini for key resources.db.') + ); } } @@ -1315,7 +1329,9 @@ break; default: - throw new Zend_Application_Exception('Invalid configuration file provided; unknown config type ' . $extension); + throw new Zend_Application_Exception( + 'Invalid configuration file provided; unknown config type ' . $extension + ); } @@ -1402,7 +1418,8 @@ if ($request->isDispatched()) { // Only when we need to render the layout, we run the layout prepare - if (Zend_Controller_Action_HelperBroker::hasHelper('layout') && Zend_Controller_Action_HelperBroker::getExistingHelper('layout')->isEnabled()) { + if (Zend_Controller_Action_HelperBroker::hasHelper('layout') && + Zend_Controller_Action_HelperBroker::getExistingHelper('layout')->isEnabled()) { // Per project layout preparation if (isset($this->project->layoutPrepare)) { @@ -1609,7 +1626,8 @@ // Gems does not use index/index $action = $request->getActionName(); - if (('index' == $request->getControllerName()) && (('index' == $action) || ($user->isActive() && ('login' == $action)))) { + if (('index' == $request->getControllerName()) && + (('index' == $action) || ($user->isActive() && ('login' == $action)))) { // Instead Gems routes to the first available menu item when this is the request target if (! $user->gotoStartPage($this->menu, $request)) { $this->setError( @@ -1758,7 +1776,10 @@ // Count todo $tSelect = $this->getLoader()->getTracker()->getTokenSelect(array( 'all' => 'COUNT(*)', - 'track' => $this->db->quoteInto('SUM(CASE WHEN gto_id_respondent_track = ? THEN 1 ELSE 0 END)', $tokenData['gto_id_respondent_track']))); + 'track' => $this->db->quoteInto( + 'SUM(CASE WHEN gto_id_respondent_track = ? THEN 1 ELSE 0 END)', + $tokenData['gto_id_respondent_track']) + )); $tSelect->andSurveys(array()) ->forRespondent($tokenData['gto_id_respondent'], $tokenData['gto_id_organization']) ->forGroupId($tokenData['gsu_id_primary_group']) @@ -1770,7 +1791,8 @@ $result['{first_name}'] = $tokenData['grs_first_name']; $result['{full_name}'] = implode(' ', $hello); $result['{greeting}'] = implode(' ', $greeting); - $result['{last_name}'] = ($tokenData['grs_surname_prefix'] ? $tokenData['grs_surname_prefix'] . ' ' : '') . $tokenData['grs_last_name']; + $result['{last_name}'] = ($tokenData['grs_surname_prefix'] ? $tokenData['grs_surname_prefix'] . ' ' : ''); + $result['{last_name}'] .= $tokenData['grs_last_name']; array_shift($hello); $result['{name}'] = implode(' ', $hello); @@ -1780,8 +1802,9 @@ $result['{site_ask_url}'] = $orgResults['organization_login_url'] . '/ask/'; // Url's - $url = $orgResults['organization_login_url'] . '/ask/forward/' . MUtil_Model::REQUEST_ID . '/' . $tokenData['gto_id_token']; - $url_input = $result['{site_ask_url}'] . 'index/' . MUtil_Model::REQUEST_ID . '/' . $tokenData['gto_id_token']; + $url = $orgResults['organization_login_url'] . '/ask/forward/' . MUtil_Model::REQUEST_ID . '/'; + $url .= $tokenData['gto_id_token']; + $urlInput = $result['{site_ask_url}'] . 'index/' . MUtil_Model::REQUEST_ID . '/' . $tokenData['gto_id_token']; $result['{survey}'] = $tokenData['gsu_survey_name']; @@ -1792,14 +1815,14 @@ $result['{token}'] = strtoupper($tokenData['gto_id_token']); $result['{token_from}'] = MUtil_Date::format($tokenData['gto_valid_from'], Zend_Date::DATE_LONG, 'yyyy-MM-dd', $locale); - // $result['{token_input}'] = MUtil_Html::create()->a($url_input, $tokenData['gsu_survey_name']); + // $result['{token_input}'] = MUtil_Html::create()->a($urlInput, $tokenData['gsu_survey_name']); // $result['{token_link}'] = MUtil_Html::create()->a($url, $tokenData['gsu_survey_name']); // $result['{token_link}'] = '<a href="' . $url . '">' . $tokenData['gsu_survey_name'] . '</a>'; $result['{token_link}'] = '[url=' . $url . ']' . $tokenData['gsu_survey_name'] . '[/url]'; $result['{token_until}'] = MUtil_Date::format($tokenData['gto_valid_until'], Zend_Date::DATE_LONG, 'yyyy-MM-dd', $locale); $result['{token_url}'] = $url; - $result['{token_url_input}'] = $url_input; + $result['{token_url_input}'] = $urlInput; $result['{track}'] = $tokenData['gtr_track_name']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-25 12:55:47
|
Revision: 997 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=997&view=rev Author: matijsdejong Date: 2012-10-25 12:55:41 +0000 (Thu, 25 Oct 2012) Log Message: ----------- Some style fixes Modified Paths: -------------- trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-10-25 12:44:18 UTC (rev 996) +++ trunk/library/classes/GemsEscort.php 2012-10-25 12:55:41 UTC (rev 997) @@ -159,7 +159,7 @@ // Check if APC extension is loaded - if($useCache === 'apc' && extension_loaded('apc') ) { + if ($useCache === 'apc' && extension_loaded('apc')) { $cacheBackend = 'Apc'; $cacheBackendOptions = array(); //Add path to the prefix as APC is a SHARED cache @@ -210,13 +210,13 @@ $this->bootstrap('project'); // Make sure the project object is available $logger = Gems_Log::getLogger(); - $log_path = GEMS_ROOT_DIR . '/var/logs'; + $logPath = GEMS_ROOT_DIR . '/var/logs'; try { - $writer = new Zend_Log_Writer_Stream($log_path . '/errors.log'); + $writer = new Zend_Log_Writer_Stream($logPath . '/errors.log'); } catch (Exception $exc) { $this->bootstrap(array('locale', 'translate')); - die(sprintf($this->translate->_('Path %s not writable'), $log_path)); + die(sprintf($this->translate->_('Path %s not writable'), $logPath)); } $filter = new Zend_Log_Filter_Priority($this->project->getLogLevel()); @@ -286,7 +286,8 @@ return $acl->getAcl(); } - protected function _initActionHelpers() { + protected function _initActionHelpers() + { Zend_Controller_Action_HelperBroker::addPrefix('Gems_Controller_Action_Helper'); } @@ -571,8 +572,9 @@ if ($menuItem) { $contactDiv = MUtil_Html::create()->div( - $args, - array('id' => 'contact')); // tooltip + $args, + array('id' => 'contact') + ); // tooltip $contactDiv->a($menuItem->toHRefAttribute(), $menuItem->get('label')); $ul = $menuItem->toUl(); @@ -686,12 +688,14 @@ // FAVICON $icon = isset($this->project->favicon) ? $this->project->favicon : 'favicon.ico'; if (file_exists(GEMS_WEB_DIR . '/' . $icon)) { - $this->view->headLink(array( - 'rel' => 'shortcut icon', - 'href' => $this->basepath->getBasePath() . '/' . $icon, - 'type' => 'image/x-icon'), - Zend_View_Helper_Placeholder_Container_Abstract::PREPEND - ); + $this->view->headLink( + array( + 'rel' => 'shortcut icon', + 'href' => $this->basepath->getBasePath() . '/' . $icon, + 'type' => 'image/x-icon' + ), + Zend_View_Helper_Placeholder_Container_Abstract::PREPEND + ); } } @@ -837,7 +841,8 @@ if ($messages) { foreach ($messages as &$message) { // Make sure html is preserved - if (is_string($message) && strlen($message) && ((strpos($message, '<') !== false) || (strpos($message, '&') !== false))) { + if (is_string($message) && strlen($message) && + ((strpos($message, '<') !== false) || (strpos($message, '&') !== false))) { $message = MUtil_Html::raw($message); } } @@ -991,10 +996,10 @@ if ($user->isActive()) { return MUtil_Html::create()->div( - sprintf($this->_('User: %s'), $user->getFullName()), - $args, - array('id' => 'username') - ); + sprintf($this->_('User: %s'), $user->getFullName()), + $args, + array('id' => 'username') + ); } } @@ -1115,7 +1120,7 @@ Zend_Registry::set(MUtil_Model_FormBridge::REGISTRY_KEY, array('date' => $dateFormOptions)); } - protected function createProjectClass($className, $param1 = null, $param2 = null) + protected function createProjectClass($className, $paramOne = null, $paramTwo = null) { if (file_exists(APPLICATION_PATH . '/classes/' . GEMS_PROJECT_NAME_UC . '/' . str_replace('_', '/', $className) . '.php')) { $className = GEMS_PROJECT_NAME_UC . '_' . $className; @@ -1129,10 +1134,10 @@ return new $className(); case 2: - return new $className($param1); + return new $className($paramOne); case 3: - return new $className($param1, $param2); + return new $className($paramOne, $paramTwo); default: throw new Gems_Exception_Coding(__CLASS__ . '->' . __FUNCTION__ . '() called with more parameters than possible.'); @@ -1786,7 +1791,7 @@ $result['{todo_track_count}'] = $todo['track']; $result['{token}'] = strtoupper($tokenData['gto_id_token']); - $result['{token_from}'] = MUtil_Date::format($tokenData['gto_valid_from'], Zend_Date::DATE_LONG, 'yyyy-MM-dd', $locale); + $result['{token_from}'] = MUtil_Date::format($tokenData['gto_valid_from'], Zend_Date::DATE_LONG, 'yyyy-MM-dd', $locale); // $result['{token_input}'] = MUtil_Html::create()->a($url_input, $tokenData['gsu_survey_name']); // $result['{token_link}'] = MUtil_Html::create()->a($url, $tokenData['gsu_survey_name']); // $result['{token_link}'] = '<a href="' . $url . '">' . $tokenData['gsu_survey_name'] . '</a>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-25 12:44:29
|
Revision: 996 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=996&view=rev Author: matijsdejong Date: 2012-10-25 12:44:18 +0000 (Thu, 25 Oct 2012) Log Message: ----------- Regenerated sql file Modified Paths: -------------- trunk/test/data/sqllite/create-lite.sql Modified: trunk/test/data/sqllite/create-lite.sql =================================================================== --- trunk/test/data/sqllite/create-lite.sql 2012-10-25 12:21:35 UTC (rev 995) +++ trunk/test/data/sqllite/create-lite.sql 2012-10-25 12:44:18 UTC (rev 996) @@ -14,8 +14,8 @@ ; -INSERT INTO gems__consents - (gco_description, gco_order, gco_code, gco_changed, gco_changed_by, gco_created, gco_created_by) +INSERT INTO gems__consents + (gco_description, gco_order, gco_code, gco_changed, gco_changed_by, gco_created, gco_created_by) VALUES ('Yes', 10, 'consent given', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), ('No', 20, 'do not use', CURRENT_TIMESTAMP, 1, CURRENT_TIMESTAMP, 1), @@ -25,26 +25,26 @@ ggp_id_group bigint not null , ggp_name varchar(30) not null, ggp_description varchar(50) not null, - + ggp_role varchar(150) not null default 'respondent', -- The ggp_role value(s) determines someones roles as not null default 1, ggp_staff_members TINYINT(1) not null default 0, ggp_respondent_members TINYINT(1) not null default 1, ggp_allowed_ip_ranges text, - + ggp_changed TEXT not null default current_timestamp, ggp_changed_by bigint not null, ggp_created TEXT not null, ggp_created_by bigint not null, - + PRIMARY KEY(ggp_id_group) ) ; -- Default group -INSERT ignore INTO gems__groups +INSERT ignore INTO gems__groups (ggp_id_group, ggp_name, ggp_description, ggp_role, ggp_group_active, ggp_staff_members, ggp_respondent_members, ggp_changed_by, ggp_created, ggp_created_by) - VALUES + VALUES (800, 'Super Administrators', 'Super administrators with access to the whole site', 'super', 1, 1, 0, 0, current_timestamp, 0); -- ggp_group_rights = '*' gives access to all pages. @@ -224,14 +224,14 @@ gpa_sql text not null, - gpa_executed TINYINT(1) not null default 0, - gpa_completed TINYINT(1) not null default 0, + gpa_executed TINYINT(1) not null default 0, + gpa_completed TINYINT(1) not null default 0, gpa_result varchar(255), gpa_changed TEXT not null default current_timestamp, gpa_created TEXT, - + PRIMARY KEY (gpa_id_patch), UNIQUE (gpa_level, gpa_location, gpa_name, gpa_order) ) @@ -314,7 +314,7 @@ gr2o_created_by bigint not null, PRIMARY KEY (gr2o_patient_nr, gr2o_id_organization), - UNIQUE (gr2o_id_user, gr2o_id_organization) + UNIQUE (gr2o_id_user, gr2o_id_organization) ) ; @@ -866,25 +866,25 @@ CREATE TABLE gems__track_fields ( - gtf_id_field bigint not null , - gtf_id_track int not null, + gtf_id_field bigint not null , + gtf_id_track int not null, - gtf_id_order int not null default 10, + gtf_id_order int not null default 10, - gtf_field_name varchar(200) not null, - gtf_field_code varchar(20), + gtf_field_name varchar(200) not null, + gtf_field_code varchar(20), gtf_field_description varchar(200), - gtf_field_values text, + gtf_field_values text, - gtf_field_type varchar(20) not null, + gtf_field_type varchar(20) not null, - gtf_required TINYINT(1) not null default false, - gtf_readonly TINYINT(1) not null default false, + gtf_required TINYINT(1) not null default false, + gtf_readonly TINYINT(1) not null default false, - gtf_changed TEXT not null default current_timestamp, + gtf_changed TEXT not null default current_timestamp, gtf_changed_by bigint not null, - gtf_created TEXT not null, + gtf_created TEXT not null, gtf_created_by bigint not null, PRIMARY KEY (gtf_id_field) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-25 12:21:46
|
Revision: 995 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=995&view=rev Author: matijsdejong Date: 2012-10-25 12:21:35 +0000 (Thu, 25 Oct 2012) Log Message: ----------- Added unit tests for MUtil_String Modified Paths: -------------- trunk/library/classes/MUtil/String.php Added Paths: ----------- trunk/test/classes/MUtil/StringTest.php Modified: trunk/library/classes/MUtil/String.php =================================================================== --- trunk/library/classes/MUtil/String.php 2012-10-25 11:54:36 UTC (rev 994) +++ trunk/library/classes/MUtil/String.php 2012-10-25 12:21:35 UTC (rev 995) @@ -81,7 +81,7 @@ } /** - * Return the part after $input and $filter stopped being the same + * Return the part after $input and $filter have stopped being the same * * stripStringLeft('abcdef', 'abcx') => 'def' * Added: trunk/test/classes/MUtil/StringTest.php =================================================================== --- trunk/test/classes/MUtil/StringTest.php (rev 0) +++ trunk/test/classes/MUtil/StringTest.php 2012-10-25 12:21:35 UTC (rev 995) @@ -0,0 +1,131 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage String + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +require_once 'PHPUnit/Framework/TestCase.php'; + +/** + * Unit test for class MUtil_String + * + * @package MUtil + * @subpackage String + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5.7 + */ +class MUtil_StringTest extends PHPUnit_Framework_TestCase +{ + /** + * Return empty string if charFilters hit on first character + */ + public function testBeforeCharsReturnNone() + { + $result = MUtil_String::beforeChars('abcdef', 'rara'); + $this->assertEquals($result, ''); + } + + /** + * Return part of the input when charFilters hits later + */ + public function testBeforeCharsReturnPart() + { + $result = MUtil_String::beforeChars('abcdef', 'god'); + $this->assertEquals($result, 'abc'); + } + + /** + * Return the whole input if no charFilters characters where there + */ + public function testBeforeCharsReturnAll() + { + $result = MUtil_String::beforeChars('abcdef', 'xyz'); + $this->assertEquals($result, 'abcdef'); + } + + /** + * Return true when the needle is contained in the haystack + */ + public function testContainsIndeed() + { + $result = MUtil_String::contains('abcdefg', 'def'); + $this->assertEquals($result, true); + } + + /** + * Return true when the needle is contained in the haystack, starting at the first character + */ + public function testContainsIndeedStart() + { + $result = MUtil_String::contains('abcdef', 'abc'); + $this->assertEquals($result, true); + } + + /** + * Return false when the needle is not contained in the haystack + */ + public function testContainsNot() + { + $result = MUtil_String::contains('abcdef', 'xyz'); + $this->assertEquals($result, false); + } + + /** + * Remove the characters where both strings are the same + */ + public function testStripStringLeftRemovepartFilter() + { + $result = MUtil_String::stripStringLeft('abcdef', 'abcx'); + $this->assertEquals($result, 'def'); + } + + /** + * Remove the characters where the input string starts with the filter + */ + public function testStripStringLeftRemoveWholeFilter() + { + $result = MUtil_String::stripStringLeft('abcdef', 'abc'); + $this->assertEquals($result, 'def'); + } + + /** + * Remove nothing as both strings have no common starting characters + */ + public function teststripStringLeftNothing() + { + $result = MUtil_String::stripStringLeft('abcdef', 'xabc'); + $this->assertEquals($result, 'abcdef'); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-25 11:54:43
|
Revision: 994 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=994&view=rev Author: matijsdejong Date: 2012-10-25 11:54:36 +0000 (Thu, 25 Oct 2012) Log Message: ----------- Version set to 1.5.7 - 50 Gems DatePicker will now work in auto submit forms Added documentation and extra utility functions Modified Paths: -------------- trunk/library/classes/Gems/Form.php trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php trunk/library/classes/Gems/Tracker/Token.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/Util/DatabasePatcher.php trunk/library/classes/Gems/Versions.php trunk/library/classes/MUtil/Form.php trunk/library/classes/MUtil/String.php trunk/library/classes/MUtil/Version.php trunk/library/configs/db/patches.sql Added Paths: ----------- trunk/library/classes/Gems/Form/AutosubmitElementInterface.php trunk/library/classes/Gems/JQuery/Form/Element/DatePicker.php Added: trunk/library/classes/Gems/Form/AutosubmitElementInterface.php =================================================================== --- trunk/library/classes/Gems/Form/AutosubmitElementInterface.php (rev 0) +++ trunk/library/classes/Gems/Form/AutosubmitElementInterface.php 2012-10-25 11:54:36 UTC (rev 994) @@ -0,0 +1,56 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Form + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Interface for elements that need to change settings on an autosubmit form. + * + * @package Gems + * @subpackage Form + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5.7 + */ +interface Gems_Form_AutosubmitElementInterface +{ + /** + * Change the form into an autosubmit form + * + * @see Gems_Form setAutoSubmit + * @param array $autoSubmitArgs Array containing submitUrl and targetId + */ + public function enableAutoSubmit(array $autoSubmitArgs); +} Modified: trunk/library/classes/Gems/Form.php =================================================================== --- trunk/library/classes/Gems/Form.php 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/classes/Gems/Form.php 2012-10-25 11:54:36 UTC (rev 994) @@ -77,8 +77,8 @@ { parent::__construct($options); - // $this->addPrefixPath(GEMS_PROJECT_NAME_UC . '_Form_Decorator', GEMS_PROJECT_NAME_UC . '/Form/Decorator/', Zend_Form::DECORATOR); - // $this->addPrefixPath(GEMS_PROJECT_NAME_UC . '_Form_Element', GEMS_PROJECT_NAME_UC . '/Form/Element/', Zend_Form::ELEMENT); + $this->addPrefixPath(GEMS_PROJECT_NAME_UC . '_Form_Decorator', GEMS_PROJECT_NAME_UC . '/Form/Decorator/', Zend_Form::DECORATOR); + $this->addPrefixPath(GEMS_PROJECT_NAME_UC . '_Form_Element', GEMS_PROJECT_NAME_UC . '/Form/Element/', Zend_Form::ELEMENT); $this->addPrefixPath('Gems_Form_Decorator', 'Gems/Form/Decorator/', Zend_Form::DECORATOR); $this->addPrefixPath('Gems_Form_Element', 'Gems/Form/Element/', Zend_Form::ELEMENT); @@ -110,6 +110,24 @@ } } + /** + * Change all elements into an autosubmit element + * + * Call only when $_autoSubmit is set + * + * @param mixed $element + */ + private function _enableAutoSubmitElement($element) + { + if ($element instanceof Zend_Form || $element instanceof Zend_Form_DisplayGroup) { + foreach ($element->getElements() as $sub) { + $this->_enableAutoSubmitElement($sub); + } + } elseif ($element instanceof Gems_Form_AutosubmitElementInterface) { + $element->enableAutoSubmit($this->_autosubmit); + } + } + public function activateJQuery() { if ($this->_no_jquery) { @@ -126,6 +144,49 @@ } /** + * Attach a css file to the form with form-specific css + * + * Optional media parameter can be used to determine media-type (print, screen etc) + * + * @param string $file + * @param string $media + */ + public function addCss($file, $media = '') { + $this->_css[$file] = $media; + } + + /** + * Add a new element + * + * $element may be either a string element type, or an object of type + * Zend_Form_Element. If a string element type is provided, $name must be + * provided, and $options may be optionally provided for configuring the + * element. + * + * If a Zend_Form_Element is provided, $name may be optionally provided, + * and any provided $options will be ignored. + * + * @param string|Zend_Form_Element $element + * @param string $name + * @param array|Zend_Config $options + * @throws Zend_Form_Exception on invalid element + * @return Zend_Form (continuation pattern) + */ + public function addElement($element, $name = null, $options = null) + { + parent::addElement($element, $name, $options); + + if ($this->isAutoSubmit()) { + if (null !== $name) { + $element = $this->getElement($name); + } + $this->_enableAutoSubmitElement($element); + } + + return $this; + } + + /** * Add a script to the head * * @param sring $script name of script, located in baseurl/js/ @@ -150,18 +211,6 @@ } /** - * Attach a css file to the form with form-specific css - * - * Optional media parameter can be used to determine media-type (print, screen etc) - * - * @param string $file - * @param string $media - */ - public function addCss($file, $media = '') { - $this->_css[$file] = $media; - } - - /** * Allows the loader to set resources. * * @param string $name Name of resource to set @@ -204,14 +253,14 @@ return '_' !== $name[0]; } - public function getCss() + public function getAutoSubmit() { - return $this->_css; + return $this->_autosubmit; } - public function getAutoSubmit() + public function getCss() { - return $this->_autosubmit; + return $this->_css; } /** @@ -239,9 +288,10 @@ } /** + * Change the form into an autosubmit form * - * @param type $submitUrl - * @param type $targetId + * @param mixed $submitUrl Url as MUtil_Html_UrlArrayAttribute, array or string + * @param mixed $targetId Id of html element whose content is replaced by the submit result: MUtil_Html_ElementInterface or string */ public function setAutoSubmit($submitUrl, $targetId) { // Filter out elements passed by type @@ -257,6 +307,7 @@ $args['targetId'] = '#' . $args['targetId']; } $this->_autosubmit = $args; + $this->_enableAutoSubmitElement($this); $this->activateJQuery(); } } \ No newline at end of file Added: trunk/library/classes/Gems/JQuery/Form/Element/DatePicker.php =================================================================== --- trunk/library/classes/Gems/JQuery/Form/Element/DatePicker.php (rev 0) +++ trunk/library/classes/Gems/JQuery/Form/Element/DatePicker.php 2012-10-25 11:54:36 UTC (rev 994) @@ -0,0 +1,59 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage JQuery + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * DatePicker extended with autosubmit + * + * @package Gems + * @subpackage JQuery + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5.7 + */ +class Gems_JQuery_Form_Element_DatePicker extends MUtil_JQuery_Form_Element_DatePicker implements Gems_Form_AutosubmitElementInterface +{ + /** + * Change the form into an autosubmit form + * + * @see Gems_Form setAutoSubmit + * @param array $autoSubmitArgs Array containing submitUrl and targetId + */ + public function enableAutoSubmit(array $autoSubmitArgs) + { + $this->setJQueryParam('onSelect', new Zend_Json_Expr('function(dateText, inst) {jQuery(this).trigger(jQuery.Event("keyup"));}')); + } +} Modified: trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/classes/Gems/Tracker/Engine/TrackEngineAbstract.php 2012-10-25 11:54:36 UTC (rev 994) @@ -544,7 +544,7 @@ $options = array(); MUtil_Model_FormBridge::applyFixedOptions('date', $options); - $element = new MUtil_JQuery_Form_Element_DatePicker($name, $options); + $element = new Gems_JQuery_Form_Element_DatePicker($name, $options); $element->setStorageFormat('yyyy-MM-dd'); break; Modified: trunk/library/classes/Gems/Tracker/Token.php =================================================================== --- trunk/library/classes/Gems/Tracker/Token.php 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/classes/Gems/Tracker/Token.php 2012-10-25 11:54:36 UTC (rev 994) @@ -626,7 +626,18 @@ } /** + * Returns the staff or respondent id of the person + * who created this token. * + * @return int + */ + public function getCreatedBy() + { + return $this->_gemsData['gto_created_by']; + } + + /** + * * @param string $fieldName * @return MUtil_Date */ Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/classes/Gems/User/User.php 2012-10-25 11:54:36 UTC (rev 994) @@ -1186,7 +1186,7 @@ $formData = Zend_Registry::get(MUtil_Model_FormBridge::REGISTRY_KEY); $label = $this->translate->_('Your birthday'); - $birthdayElem = new MUtil_JQuery_Form_Element_DatePicker('birthday'); + $birthdayElem = new Gems_JQuery_Form_Element_DatePicker('birthday'); $birthdayElem->setLabel($label); if (isset($formData['date'])) { $birthdayElem->setOptions($formData['date']); Modified: trunk/library/classes/Gems/Util/DatabasePatcher.php =================================================================== --- trunk/library/classes/Gems/Util/DatabasePatcher.php 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/classes/Gems/Util/DatabasePatcher.php 2012-10-25 11:54:36 UTC (rev 994) @@ -176,8 +176,16 @@ $data['gpa_completed'] = 1; } catch (Zend_Db_Statement_Exception $e) { - $data['gpa_result'] = substr($e->getMessage(), 0, 254); - $data['gpa_completed'] = $patch['gpa_completed'] ? $patch['gpa_completed'] : 0; + $message = $e->getMessage(); + + // Make sure these do not remain uncompleted + if (MUtil_String::contains($message, 'Duplicate column name')) { + $data['gpa_result'] = 'Column exists in table'; + $data['gpa_completed'] = 1; + } else { + $data['gpa_result'] = substr($message, 0, 254); + $data['gpa_completed'] = $patch['gpa_completed'] ? $patch['gpa_completed'] : 0; + } } $this->db->update('gems__patches', $data, $this->db->quoteInto('gpa_id_patch = ?', $patch['gpa_id_patch'])); Modified: trunk/library/classes/Gems/Versions.php =================================================================== --- trunk/library/classes/Gems/Versions.php 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/classes/Gems/Versions.php 2012-10-25 11:54:36 UTC (rev 994) @@ -59,7 +59,7 @@ * This means that future patches for the current level * will be loaded, but that previous patches are ignored. */ - return 49; + return 50; } /** @@ -69,7 +69,7 @@ */ public final function getGemsVersion() { - return '1.5.6'; + return '1.5.7'; } /** Modified: trunk/library/classes/MUtil/Form.php =================================================================== --- trunk/library/classes/MUtil/Form.php 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/classes/MUtil/Form.php 2012-10-25 11:54:36 UTC (rev 994) @@ -35,7 +35,12 @@ */ /** + * Extends a Zend_Form with automatic Dojo and JQuery activation, + * MUtil_Html rendering integration and non-css stylesheet per + * form (possibly automatically calculated) fixed label widths. * + * @see MUtil_Html + * * @package MUtil * @subpackage Form * @copyright Copyright (c) 2011 Erasmus MC @@ -44,6 +49,12 @@ */ class MUtil_Form extends Zend_Form { + /** + * The order in which the element parts should be displayed + * when using a fixed or dynamic label width. + * + * @var array + */ protected $_displayOrder = array('element', 'errors', 'description'); /** @@ -139,6 +150,23 @@ } } + /** + * Add a new element + * + * $element may be either a string element type, or an object of type + * Zend_Form_Element. If a string element type is provided, $name must be + * provided, and $options may be optionally provided for configuring the + * element. + * + * If a Zend_Form_Element is provided, $name may be optionally provided, + * and any provided $options will be ignored. + * + * @param string|Zend_Form_Element $element + * @param string $name + * @param array|Zend_Config $options + * @throws Zend_Form_Exception on invalid element + * @return Zend_Form (continuation pattern) + */ public function addElement($element, $name = null, $options = null) { parent::addElement($element, $name, $options); @@ -162,6 +190,14 @@ return $this; } + /** + * The order in which the element parts should be displayed + * when using a fixed or dynamic label width. + * + * @see setLabelWidth + * + * @return array Array containing element parts like 'element', 'errors' and 'description' + */ public function getDisplayOrder() { return $this->_displayOrder; @@ -232,7 +268,7 @@ $this->setDisableTranslator($disableTranslateValidators); } } - + $valid = parent::isValid($data); if (isset($oldTranslations)) { @@ -284,6 +320,15 @@ return $this; } + /** + * The order in which the element parts should be displayed + * when using a fixed or dynamic label width. + * + * @see setLabelWidth + * + * @param array $order Array containing element parts like 'element', 'errors' and 'description' + * @return MUtil_Form (continuation pattern) + */ public function setDisplayOrder(array $order) { $this->_displayOrder = $order; Modified: trunk/library/classes/MUtil/String.php =================================================================== --- trunk/library/classes/MUtil/String.php 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/classes/MUtil/String.php 2012-10-25 11:54:36 UTC (rev 994) @@ -69,6 +69,18 @@ } /** + * Returns true if needle is anywhere in haystack + * + * @param string $haystack The string to search in + * @param string $needle The string to search for + * @return boolean + */ + public static function contains($haystack, $needle) + { + return strpos($haystack, $needle) !== false; + } + + /** * Return the part after $input and $filter stopped being the same * * stripStringLeft('abcdef', 'abcx') => 'def' Modified: trunk/library/classes/MUtil/Version.php =================================================================== --- trunk/library/classes/MUtil/Version.php 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/classes/MUtil/Version.php 2012-10-25 11:54:36 UTC (rev 994) @@ -25,16 +25,30 @@ * 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 Version + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** - * @package MUtil + * MUtil version info + * + * @package MUtil + * @subpackage Util + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.0 */ class MUtil_Version { const MAJOR = 1; const MINOR = 1; - const BUILD = 33; + const BUILD = 34; public static function get() { Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2012-10-24 15:30:17 UTC (rev 993) +++ trunk/library/configs/db/patches.sql 2012-10-25 11:54:36 UTC (rev 994) @@ -439,3 +439,5 @@ ALTER TABLE `gems__rounds` ADD gro_display_event varchar(128) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' NULL AFTER gro_changed_event; ALTER TABLE `gems__tracks` CHANGE gtr_completed_event gtr_completed_event varchar(128) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null; + +-- GEMS VERSION: 50 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-24 15:30:30
|
Revision: 993 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=993&view=rev Author: matijsdejong Date: 2012-10-24 15:30:17 +0000 (Wed, 24 Oct 2012) Log Message: ----------- Small fix for echo Started on string utility class Modified Paths: -------------- trunk/library/classes/MUtil/Echo.php Added Paths: ----------- trunk/library/classes/MUtil/String.php Modified: trunk/library/classes/MUtil/Echo.php =================================================================== --- trunk/library/classes/MUtil/Echo.php 2012-10-19 14:43:01 UTC (rev 992) +++ trunk/library/classes/MUtil/Echo.php 2012-10-24 15:30:17 UTC (rev 993) @@ -208,7 +208,9 @@ if (isset($trace[1]['type'])) { $header .= $trace[1]['class'] . $trace[1]['type']; } - $header .= $trace[1]['function'] . '() '; + if (isset($trace[1]['function'])) { + $header .= $trace[1]['function'] . '() '; + } if (isset($trace[0]['line'])) { $header .= ': ' . $trace[0]['line']; } Added: trunk/library/classes/MUtil/String.php =================================================================== --- trunk/library/classes/MUtil/String.php (rev 0) +++ trunk/library/classes/MUtil/String.php 2012-10-24 15:30:17 UTC (rev 993) @@ -0,0 +1,94 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package MUtil + * @subpackage String + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: String.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * A collection of static string utility functions + * + * @package MUtil + * @subpackage String + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class MUtil_String +{ + /** + * Return the part of $input before any of the $charFilter characters + * + * beforeChars('abcdef', 'dgi') => 'abc' + * + * beforeChars('abcdef', 'xyz') => 'abcdef' + * + * @param string $input The text to return part of + * @param string $charFilter The characters to filter on + * @return string + */ + public static function beforeChars($input, $charFilter) + { + $rest = strpbrk($input, $charFilter); + + if ($rest === false) { + return $input; + } + + return substr($input, 0, -strlen($rest)); + } + + /** + * Return the part after $input and $filter stopped being the same + * + * stripStringLeft('abcdef', 'abcx') => 'def' + * + * stripStringLeft('abcdef', 'def') => 'abcdef' + * + * @param string $input The text to return part of + * @param string $filter The text to filter on + * @return string + */ + public static function stripStringLeft($input, $filter) + { + $count = min(array(strlen($input), strlen($filter))); + + for ($i = 0; $i < $count; $i++) { + if ($input[$i] != $filter[$i]) { + break; + } + } + + return substr($input, $i); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-19 14:43:12
|
Revision: 992 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=992&view=rev Author: matijsdejong Date: 2012-10-19 14:43:01 +0000 (Fri, 19 Oct 2012) Log Message: ----------- Small fix, bug occurs occasionally with users noticing it Modified Paths: -------------- trunk/new_project/htdocs/gems/js/tableRowKeySelector.js Modified: trunk/new_project/htdocs/gems/js/tableRowKeySelector.js =================================================================== --- trunk/new_project/htdocs/gems/js/tableRowKeySelector.js 2012-10-18 12:55:40 UTC (rev 991) +++ trunk/new_project/htdocs/gems/js/tableRowKeySelector.js 2012-10-19 14:43:01 UTC (rev 992) @@ -44,7 +44,7 @@ listener: function (e) { "use strict"; - var currentItem, key, link, nextItem; + var currentItem, key, link, nextItem = null; if (e === null) { key = event.keyCode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-18 12:55:46
|
Revision: 991 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=991&view=rev Author: mennodekker Date: 2012-10-18 12:55:40 +0000 (Thu, 18 Oct 2012) Log Message: ----------- Release v1.5.6 Added Paths: ----------- tags/1.5.6/ Property changes on: tags/1.5.6 ___________________________________________________________________ Added: svn:ignore + nbproject Added: svn:mergeinfo + /branches/1.5.0-pulse:306-430,467 /branches/1.5.x:426-455,458-472,475-481 /tags/1.5.0beta1:305 /tags/1.5.1:485,489,509-510 /tags/1.5.3-rc2:612,614,616,618 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-18 12:40:40
|
Revision: 990 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=990&view=rev Author: mennodekker Date: 2012-10-18 12:40:34 +0000 (Thu, 18 Oct 2012) Log Message: ----------- initially hide datepicker div Modified Paths: -------------- trunk/new_project/htdocs/basic/jquery-basic.css Modified: trunk/new_project/htdocs/basic/jquery-basic.css =================================================================== --- trunk/new_project/htdocs/basic/jquery-basic.css 2012-10-18 12:21:38 UTC (rev 989) +++ trunk/new_project/htdocs/basic/jquery-basic.css 2012-10-18 12:40:34 UTC (rev 990) @@ -404,4 +404,7 @@ }/* Progressbar ----------------------------------*/ .ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } + +/* Initially hide datepicker div */ +#ui-datepicker-div { display: none; } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-18 12:21:49
|
Revision: 989 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=989&view=rev Author: mennodekker Date: 2012-10-18 12:21:38 +0000 (Thu, 18 Oct 2012) Log Message: ----------- preparing for 1.5.6 release Modified Paths: -------------- trunk/library/classes/Gems/Upgrades.php Removed Paths: ------------- trunk/new_project/application/snippets/ Modified: trunk/library/classes/Gems/Upgrades.php =================================================================== --- trunk/library/classes/Gems/Upgrades.php 2012-10-17 11:03:07 UTC (rev 988) +++ trunk/library/classes/Gems/Upgrades.php 2012-10-18 12:21:38 UTC (rev 989) @@ -62,6 +62,7 @@ $this->register(array($this, 'Upgrade152to153'), 'Upgrade from 1.5.2 to 1.5.3'); $this->register(array($this, 'Upgrade153to154'), 'Upgrade from 1.5.3 to 1.5.4'); $this->register(array($this, 'Upgrade154to155'), 'Upgrade from 1.5.4 to 1.5.5'); + $this->register(array($this, 'Upgrade155to156'), 'Upgrade from 1.5.5 to 1.5.6'); /** * To have the new_project updated to the highest level, update @@ -150,4 +151,16 @@ return true; } + + /** + * To upgrade to 1.5.6 just execute patchlevel 48 + */ + public function Upgrade155to156() + { + $this->_batch->addTask('Db_ExecutePatch', 49); + + $this->_batch->addTask('Echo', $this->_('Make sure to read the changelog as it contains important instructions')); + + return true; + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-17 11:03:20
|
Revision: 988 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=988&view=rev Author: matijsdejong Date: 2012-10-17 11:03:07 +0000 (Wed, 17 Oct 2012) Log Message: ----------- Created useful restoreHeaderPositions() function for survey answer filters Made LimeSurvey field map more abstract by defining the header classes in SurveyModel Modified Paths: -------------- trunk/library/classes/Gems/Event/Survey/Display/ByValue.php trunk/library/classes/Gems/Event/Survey/Display/OnlyAnswered.php trunk/library/classes/Gems/Event/Survey/Display/Reverse.php trunk/library/classes/Gems/Event/SurveyAnswerFilterAbstract.php trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php trunk/library/classes/Gems/Tracker/SurveyModel.php trunk/library/classes/MUtil/Model/ModelAbstract.php trunk/library/classes/MUtil/Model.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po Added Paths: ----------- trunk/library/classes/Gems/Event/Survey/Display/YesOnTop.php Modified: trunk/library/classes/Gems/Event/Survey/Display/ByValue.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/ByValue.php 2012-10-16 13:41:46 UTC (rev 987) +++ trunk/library/classes/Gems/Event/Survey/Display/ByValue.php 2012-10-17 11:03:07 UTC (rev 988) @@ -47,13 +47,6 @@ class Gems_Event_Survey_Display_ByValue extends Gems_Event_SurveyAnswerFilterAbstract { /** - * Contains the values of the current token - * - * @var array - */ - private $_values; - - /** * This function is called in addBrowseTableColumns() to filter the names displayed * by AnswerModelSnippetGeneric. * @@ -68,50 +61,23 @@ { $currentNames = array_combine($currentNames, $currentNames); $newOrder = array(); + $values = array_filter($this->token->getRawAnswers(), 'is_numeric'); + arsort($values); - foreach ($this->_values as $key => $value) { - if (isset($currentNames[$key])) { - if ($parent = $model->get($key, 'parent_question')) { - $count = 0; - foreach ($model->getCol('parent_question') as $name => $currentParent) { - if (isset($currentNames[$name]) && ($currentParent === $parent)) { - $count++; - } - } - // Last occurence of this parent question - if ($count < 2) { - unset($currentNames[$parent]); - } - $newOrder[] = $parent; - // MUtil_Echo::track($key, $parent); - } - + foreach ($values as $key => $value) { + if (isset($currentNames[$key])) { unset($currentNames[$key]); $newOrder[] = $key; } } - // MUtil_Echo::track($this->_values, $newOrder + $currentNames); + // MUtil_Echo::track($this->_values, $newOrder, $newOrder + $currentNames); - return $newOrder + $currentNames; + return $this->restoreHeaderPositions($model, $newOrder + $currentNames); } /** - * Function that returns the snippets to use for this display. - * - * @param Gems_Tracker_Token $token The token to get the snippets for - * @return array of Snippet names or nothing - */ - public function getAnswerDisplaySnippets(Gems_Tracker_Token $token) - { - $this->_values = array_filter($token->getRawAnswers(), 'is_numeric'); - arsort($this->_values); - - return parent::getAnswerDisplaySnippets($token); - } - - /** * A pretty name for use in dropdown selection boxes. * * @return string Name Modified: trunk/library/classes/Gems/Event/Survey/Display/OnlyAnswered.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/OnlyAnswered.php 2012-10-16 13:41:46 UTC (rev 987) +++ trunk/library/classes/Gems/Event/Survey/Display/OnlyAnswered.php 2012-10-17 11:03:07 UTC (rev 988) @@ -74,37 +74,10 @@ $keys += array_filter($row->getArrayCopy()); } - $lastMain = null; - $names = array(); - foreach ($currentNames as $name) { - $exists = isset($keys[$name]); + $results = array_intersect($currentNames, array_keys($keys)); + // MUtil_Echo::track($results); - // Keep track of should a main question be displayed. - // The question or a sub question should be answered - if ($model->get($name, 'thClass') === 'question') { - if ($lastMain) { - unset($names[$lastMain]); - } - - if ($exists) { - $lastMain = null; // Has value, display - } else { - $exists = true; // Add to list for the moment - $lastMain = $name; // But keep track for possible removal - } - } elseif ($exists) { - $lastMain = null; // Must display last main question - } - - - if ($exists) { - $names[$name] = $name; - // MUtil_Echo::track($name, $model->get($name, 'thClass'), $model->get($name, 'label')); - } - } - // MUtil_Echo::track($names); - - return $names; + return $this->restoreHeaderPositions($model, $results); } /** Modified: trunk/library/classes/Gems/Event/Survey/Display/Reverse.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/Reverse.php 2012-10-16 13:41:46 UTC (rev 987) +++ trunk/library/classes/Gems/Event/Survey/Display/Reverse.php 2012-10-17 11:03:07 UTC (rev 988) @@ -59,7 +59,7 @@ */ public function filterAnswers(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model, array $currentNames) { - return array_reverse($currentNames); + return $this->restoreHeaderPositions($model, array_reverse($currentNames)); } /** Added: trunk/library/classes/Gems/Event/Survey/Display/YesOnTop.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/YesOnTop.php (rev 0) +++ trunk/library/classes/Gems/Event/Survey/Display/YesOnTop.php 2012-10-17 11:03:07 UTC (rev 988) @@ -0,0 +1,103 @@ +<?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 Events + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: OnlyAnswered.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Display those questions that are answered with 'yes' op top + * + * Questions names that are the same as the yes question but with a longer name + * separated by an '_' are moved with the question, as are header questions + * (which may be doubled when not all question come out on top). + * + * @package Gems + * @subpackage Events + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5.6 + */ +class Gems_Event_Survey_Display_YesOnTop extends Gems_Event_SurveyAnswerFilterAbstract +{ + /** + * This function is called in addBrowseTableColumns() to filter the names displayed + * by AnswerModelSnippetGeneric. + * + * @see Gems_Tracker_Snippets_AnswerModelSnippetGeneric + * + * @param MUtil_Model_TableBridge $bridge + * @param MUtil_Model_ModelAbstract $model + * @param array $currentNames The current names in use (allows chaining) + * @return array Of the names of labels that should be shown + */ + public function filterAnswers(MUtil_Model_TableBridge $bridge, MUtil_Model_ModelAbstract $model, array $currentNames) + { + if (! $this->token->isCompleted()) { + return $currentNames; + } + + $answers = $this->token->getRawAnswers(); + $onTop = array(); + + // MUtil_Echo::track($answers); + + foreach($answers as $name => $value) { + if ($value === 'Y') { + $onTop[$name] = $name; + } else { + $nameParts = explode('_', $name); + + if (count($nameParts) > 1) { + if (isset($onTop[$nameParts[0]])) { + $onTop[$name] = $name; + } + } + } + } + + // MUtil_Echo::track($onTop, $onTop + $currentNames, $currentNames); + + return $this->restoreHeaderPositions($model, $onTop + $currentNames); + } + + /** + * A pretty name for use in dropdown selection boxes. + * + * @return string Name + */ + public function getEventName() + { + return $this->translate->_('Yes answers on top.'); + } +} Modified: trunk/library/classes/Gems/Event/SurveyAnswerFilterAbstract.php =================================================================== --- trunk/library/classes/Gems/Event/SurveyAnswerFilterAbstract.php 2012-10-16 13:41:46 UTC (rev 987) +++ trunk/library/classes/Gems/Event/SurveyAnswerFilterAbstract.php 2012-10-17 11:03:07 UTC (rev 988) @@ -49,6 +49,18 @@ { /** * + * @var Zend_Locale + */ + protected $locale; + + /** + * + * @var Gems_Tracker_Token + */ + protected $token; + + /** + * * @var Zend_Translate */ protected $translate; @@ -63,6 +75,8 @@ */ public function getAnswerDisplaySnippets(Gems_Tracker_Token $token) { + $this->token = $token; + $snippets = (array) $token->getTrackEngine()->getAnswerSnippetNames(); $snippets['answerFilter'] = $this; @@ -71,4 +85,53 @@ } // public function getEventName() + + /** + * Restores the header position of question before their corresponding question_sub + * + * When sub-questions with the same parent are shown continuous the parent is shown + * once before them. When the sub-questions are displayed in seperate groups the + * parent is shown once at their start. + * + * Stand alone headers without any corresponding value are removed. When they do have + * a value of their own they are still shown, but their position may change according + * to their sub-questions position. (NOTE: As in LimeSurvey their are no question + * headers with values we leave it at this for the moment.) + * + * @param MUtil_Model_ModelAbstract $model + * @param array $currentNames The current names in use (allows chaining) + * @return array Of the names of labels that should be shown + */ + protected function restoreHeaderPositions(MUtil_Model_ModelAbstract $model, array $currentNames) + { + $lastParent = null; + $results = array(); + foreach ($currentNames as $name) { + if ($model->is($name, 'type', MUtil_Model::TYPE_NOVALUE)) { + // Skip header types that contain no value + continue; + } + + if ($parent = $model->get($name, 'parent_question')) { + // Check for change of parent + if ($lastParent !== $parent) { + if (isset($results[$parent])) { + // Add another copy of the parent to the array + $results[] = $parent; + } else { + // Insert parent header on name if it was not shown before + $results[$parent] = $parent; + } + $lastParent = $parent; + } + } + + // If already set (as a $parent) this will not + // redisplay the $parent as $result[$name] does + // not change position + $results[$name] = $name; + } + + return $results; + } } Modified: trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2012-10-16 13:41:46 UTC (rev 987) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php 2012-10-17 11:03:07 UTC (rev 988) @@ -604,7 +604,7 @@ foreach ($map as $name => $field) { $tmpres = array(); - $tmpres['thClass'] = 'question'; + $tmpres['thClass'] = Gems_Tracker_SurveyModel::CLASS_MAIN_QUESTION; $tmpres['group'] = $field['gid']; $tmpres['type'] = $this->_getType($field); @@ -625,13 +625,14 @@ // Add non answered question for grouping and make it the current parent $parent = '_' . $name . '_'; $model->set($parent, $tmpres); + $model->set($parent, 'type', MUtil_Model::TYPE_NOVALUE); } if (isset($field['sq_question1'])) { $tmpres['label'] = MUtil_Html::raw(sprintf($this->translate->_('%s: %s'), $this->removeHtml($field['sq_question']), $this->removeHtml($field['sq_question1']))); } else { $tmpres['label'] = MUtil_Html::raw($this->removeHtml($field['sq_question'])); } - $tmpres['thClass'] = 'question_sub'; + $tmpres['thClass'] = Gems_Tracker_SurveyModel::CLASS_SUB_QUESTION; } if ($options = $this->_getMultiOptions($field)) { $tmpres['multiOptions'] = $options; @@ -643,7 +644,7 @@ } // Parent storage - if ('question' === $tmpres['thClass']) { + if (Gems_Tracker_SurveyModel::CLASS_MAIN_QUESTION === $tmpres['thClass']) { $parent = $name; } elseif ($parent) { // Add the name of the parent item @@ -675,7 +676,7 @@ foreach ($map as $name => $field) { $tmpres = array(); - $tmpres['class'] = 'question'; + $tmpres['class'] = Gems_Tracker_SurveyModel::CLASS_MAIN_QUESTION; $tmpres['group'] = $field['gid']; $tmpres['type'] = $field['type']; $tmpres['title'] = $field['title']; @@ -700,7 +701,7 @@ // "Next" question $tmpres['question'] = $this->removeMarkup($field['sq_question']); } - $tmpres['class'] = 'question_sub'; + $tmpres['class'] = Gems_Tracker_SurveyModel::CLASS_SUB_QUESTION; } $tmpres['answers'] = $this->_getPossibleAnswers($field); Modified: trunk/library/classes/Gems/Tracker/SurveyModel.php =================================================================== --- trunk/library/classes/Gems/Tracker/SurveyModel.php 2012-10-16 13:41:46 UTC (rev 987) +++ trunk/library/classes/Gems/Tracker/SurveyModel.php 2012-10-17 11:03:07 UTC (rev 988) @@ -47,6 +47,16 @@ class Gems_Tracker_SurveyModel extends Gems_Model_JoinModel { /** + * Constant containing css classname for main questions + */ + const CLASS_MAIN_QUESTION = 'question'; + + /** + * Constant containing css classname for subquestions + */ + const CLASS_SUB_QUESTION = 'question_sub'; + + /** * * @var Gems_Tracker_Source_SourceInterface */ Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-10-16 13:41:46 UTC (rev 987) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2012-10-17 11:03:07 UTC (rev 988) @@ -545,7 +545,7 @@ * Use <code>$this->set('fieldname', 'order', <value>);</code> to set a custom ordering. * * @see set() - * @return array + * @return array int => name */ public function getItemsOrdered() { Modified: trunk/library/classes/MUtil/Model.php =================================================================== --- trunk/library/classes/MUtil/Model.php 2012-10-16 13:41:46 UTC (rev 987) +++ trunk/library/classes/MUtil/Model.php 2012-10-17 11:03:07 UTC (rev 988) @@ -78,6 +78,7 @@ */ const TEXT_FILTER = 'search'; + const TYPE_NOVALUE = 0; const TYPE_STRING = 1; const TYPE_NUMERIC = 2; const TYPE_DATE = 3; Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2012-10-16 13:41:46 UTC (rev 987) +++ trunk/library/languages/default-en.po 2012-10-17 11:03:07 UTC (rev 988) @@ -2,14 +2,14 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-10-11 18:28+0100\n" +"POT-Creation-Date: 2012-10-17 12:56+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" -"Language: en_GB\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: en_GB\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Poedit-SourceCharset: iso-8859-1\n" "X-Poedit-Basepath: ../\n" @@ -31,7 +31,8 @@ msgid "You are logged in as %s" msgstr "You are logged in as %s" -#: classes/GemsEscort.php:803 classes/Gems/Menu.php:263 +#: classes/GemsEscort.php:803 +#: classes/Gems/Menu.php:263 msgid "Logoff" msgstr "Logoff" @@ -49,18 +50,15 @@ msgstr "version" #: classes/GemsEscort.php:1465 -msgid "" -"Take note: your session has expired, your inputs were not saved. Please " -"check the input data and try again" -msgstr "" -"Take note: your session has expired, your inputs were not saved. Please " -"check the input data and try again" +msgid "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" +msgstr "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" #: classes/GemsEscort.php:1594 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1596 classes/GemsEscort.php:1600 +#: classes/GemsEscort.php:1596 +#: classes/GemsEscort.php:1600 #: classes/GemsEscort.php:1601 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" @@ -69,22 +67,22 @@ msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1613 classes/GemsEscort.php:1656 +#: classes/GemsEscort.php:1613 +#: classes/GemsEscort.php:1656 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1629 classes/Gems/Default/StaffAction.php:317 +#: classes/GemsEscort.php:1629 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1631 classes/Gems/Default/OrganizationAction.php:102 -#: classes/Gems/Default/StaffAction.php:318 -#: classes/Gems/Model/HiddenOrganizationModel.php:115 +#: classes/GemsEscort.php:1631 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "Access to this page is not allowed for current role: %s." -#: classes/GemsEscort.php:1641 classes/GemsEscort.php:1654 +#: classes/GemsEscort.php:1641 +#: classes/GemsEscort.php:1654 msgid "You are no longer logged in." msgstr "You are no longer logged in." @@ -92,7 +90,8 @@ msgid "You must login to access this page." msgstr "You must login to access this page." -#: classes/GemsEscort.php:1783 classes/GemsEscort.php:1785 +#: classes/GemsEscort.php:1783 +#: classes/GemsEscort.php:1785 #, php-format msgid "%d survey" msgid_plural "%d surveys" @@ -148,7 +147,7 @@ msgid "Project setup" msgstr "Project setup" -#: classes/Gems/Menu.php:170 classes/Gems/Default/SourceAction.php:203 +#: classes/Gems/Menu.php:170 msgid "Database" msgstr "Database" @@ -156,11 +155,11 @@ msgid "Content" msgstr "Content" -#: classes/Gems/Menu.php:177 classes/Gems/Default/DatabaseAction.php:313 +#: classes/Gems/Menu.php:177 msgid "Execute" msgstr "Execute" -#: classes/Gems/Menu.php:182 classes/Gems/Default/DatabaseAction.php:289 +#: classes/Gems/Menu.php:182 msgid "Patches" msgstr "Patches" @@ -176,7 +175,7 @@ msgid "Run SQL" msgstr "Run SQL" -#: classes/Gems/Menu.php:190 classes/Gems/Default/ReceptionAction.php:131 +#: classes/Gems/Menu.php:190 msgid "Reception codes" msgstr "Reception codes" @@ -184,16 +183,16 @@ msgid "Consents" msgstr "Consents" -#: classes/Gems/Menu.php:196 classes/Gems/Default/RoleAction.php:309 +#: classes/Gems/Menu.php:196 msgid "Roles" msgstr "Roles" -#: classes/Gems/Menu.php:197 classes/Gems/Menu.php:391 +#: classes/Gems/Menu.php:197 +#: classes/Gems/Menu.php:391 msgid "Assigned" msgstr "Assigned" -#: classes/Gems/Menu.php:198 classes/Gems/Default/RoleAction.php:238 -#: classes/Gems/Default/RoleAction.php:324 +#: classes/Gems/Menu.php:198 msgid "Privileges" msgstr "Privileges" @@ -202,20 +201,14 @@ msgstr "Groups" #: classes/Gems/Menu.php:204 -#: classes/Gems/Default/SurveyMaintenanceAction.php:204 -#: classes/Gems/Default/TrackMaintenanceAction.php:131 -#: classes/Gems/Email/MailTemplateForm.php:101 -#: classes/Gems/Tracker/Snippets/EditTrackEngineSnippetGeneric.php:140 msgid "Organizations" msgstr "Organizations" -#: classes/Gems/Menu.php:207 classes/Gems/Default/GroupAction.php:121 -#: classes/Gems/Default/LogAction.php:193 -#: classes/Gems/Default/StaffAction.php:470 +#: classes/Gems/Menu.php:207 msgid "Staff" msgstr "Staff" -#: classes/Gems/Menu.php:210 classes/Gems/Default/LogAction.php:213 +#: classes/Gems/Menu.php:210 msgid "Logging" msgstr "Logging" @@ -227,15 +220,14 @@ msgid "Upgrade" msgstr "Upgrade" -#: classes/Gems/Menu.php:220 classes/Gems/Menu.php:221 -#: classes/Gems/Default/ProjectInformationAction.php:113 -#: classes/Gems/Default/ProjectInformationAction.php:118 +#: classes/Gems/Menu.php:220 +#: classes/Gems/Menu.php:221 #, php-format msgid "Changelog %s" msgstr "Changelog %s" -#: classes/Gems/Menu.php:222 classes/Gems/Menu.php:355 -#: classes/Gems/Menu/SubMenuItem.php:551 +#: classes/Gems/Menu.php:222 +#: classes/Gems/Menu.php:355 msgid "Show" msgstr "Show" @@ -264,7 +256,7 @@ msgid "Logon" msgstr "Logon" -#: classes/Gems/Menu.php:258 classes/Gems/User/Form/LoginForm.php:112 +#: classes/Gems/Menu.php:258 msgid "Lost password" msgstr "Lost password" @@ -272,72 +264,40 @@ msgid "Your account" msgstr "Your account" -#: classes/Gems/Menu.php:260 classes/Gems/Default/OptionAction.php:153 +#: classes/Gems/Menu.php:260 msgid "Activity overview" msgstr "Activity overview" -#: classes/Gems/Menu.php:261 classes/Gems/Default/OptionAction.php:78 +#: classes/Gems/Menu.php:261 msgid "Change password" msgstr "Change password" -#: classes/Gems/Menu.php:262 classes/Gems/Menu.php:315 -#: classes/Gems/Menu.php:361 classes/Gems/Default/MailLogAction.php:114 -#: classes/Gems/Default/TrackAction.php:459 -#: classes/Gems/Export/RespondentExport.php:147 -#: classes/Gems/Snippets/TokenModelSnippetAbstract.php:70 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:482 -#: classes/Gems/Tracker/Form/AskTokenForm.php:77 -#: classes/Gems/Tracker/Model/StandardTokenModel.php:195 -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:188 -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:197 -#: snippets/BrowseSingleSurveyTokenSnippet.php:164 -#: snippets/TrackTokenOverviewSnippet.php:132 -#: snippets/Organization/OrganizationEditSnippet.php:89 -#: snippets/Track/Token/ShowAllOpenSnippet.php:88 -#: snippets/Track/Token/ShowFirstOpenSnippet.php:110 +#: classes/Gems/Menu.php:262 +#: classes/Gems/Menu.php:315 +#: classes/Gems/Menu.php:361 msgid "Token" msgstr "Token" -#: classes/Gems/Menu.php:303 classes/Gems/Export/RespondentExport.php:318 +#: classes/Gems/Menu.php:303 msgid "Export" msgstr "Export" -#: classes/Gems/Menu.php:310 classes/Gems/Default/MailJobAction.php:99 -#: classes/Gems/Default/ProjectTracksAction.php:64 -#: classes/Gems/Default/TrackAction.php:328 -#: classes/Gems/Default/TrackActionAbstract.php:219 -#: classes/Gems/Default/TrackFieldsAction.php:96 -#: classes/Gems/Email/OneMailForm.php:54 -#: classes/Gems/Export/RespondentExport.php:224 -#: classes/Gems/Export/RespondentExport.php:236 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:484 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:752 -#: classes/Gems/Tracker/Model/StandardTokenModel.php:216 -#: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:149 -#: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:146 -#: snippets/Track/Token/ShowAllOpenSnippet.php:148 +#: classes/Gems/Menu.php:310 msgid "Track" msgstr "Track" -#: classes/Gems/Menu.php:318 classes/Gems/Menu.php:343 +#: classes/Gems/Menu.php:318 +#: classes/Gems/Menu.php:343 #: classes/Gems/Menu.php:385 -#: classes/Gems/Default/TrackMaintenanceAction.php:367 -#: snippets/AddTracksSnippet.php:242 msgid "Add" msgstr "Add" -#: classes/Gems/Menu.php:324 classes/Gems/Menu.php:424 -#: classes/Gems/Email/EmailFormAbstract.php:280 -#: classes/Gems/Email/EmailFormAbstract.php:291 -#: classes/Gems/Menu/MenuAbstract.php:367 -#: classes/Gems/Menu/MenuAbstract.php:380 +#: classes/Gems/Menu.php:324 +#: classes/Gems/Menu.php:424 msgid "Preview" msgstr "Preview" -#: classes/Gems/Menu.php:333 classes/Gems/Default/ExportAction.php:149 -#: classes/Gems/Default/TrackMaintenanceAction.php:314 -#: classes/Gems/Menu/MenuAbstract.php:376 -#: classes/Gems/Menu/MenuAbstract.php:458 snippets/AddTracksSnippet.php:239 +#: classes/Gems/Menu.php:333 msgid "Tracks" msgstr "Tracks" @@ -345,19 +305,15 @@ msgid "Assignments" msgstr "Assignments" -#: classes/Gems/Menu.php:365 classes/Gems/Menu/SubMenuItem.php:417 +#: classes/Gems/Menu.php:365 msgid "Edit" msgstr "Edit" -#: classes/Gems/Menu.php:371 classes/Gems/Menu/SubMenuItem.php:398 +#: classes/Gems/Menu.php:371 msgid "Delete" msgstr "Delete" #: classes/Gems/Menu.php:378 -#: classes/Gems/Default/SurveyMaintenanceAction.php:564 -#: classes/Gems/Menu/MenuAbstract.php:383 -#: classes/Gems/Menu/MenuAbstract.php:445 -#: classes/Gems/Tracker/Model/TrackModel.php:100 msgid "Surveys" msgstr "Surveys" @@ -374,13 +330,10 @@ msgstr "E-Mail now!" #: classes/Gems/Menu.php:427 -#: classes/Gems/Tracker/Engine/StepEngineAbstract.php:481 msgid "Answers" msgstr "Answers" -#: classes/Gems/Menu.php:579 classes/Gems/Default/GroupAction.php:122 -#: classes/Gems/Default/OrganizationAction.php:150 -#: classes/Gems/Default/RespondentAction.php:425 +#: classes/Gems/Menu.php:579 msgid "Respondents" msgstr "Patients" @@ -388,7 +341,7 @@ msgid "Overview" msgstr "Overview" -#: classes/Gems/Menu.php:594 classes/Gems/Menu/MenuAbstract.php:340 +#: classes/Gems/Menu.php:594 msgid "Project" msgstr "Project" @@ -404,13 +357,11 @@ msgid "Mail" msgstr "Mail" -#: classes/Gems/Menu.php:609 classes/Gems/Default/RespondentAction.php:533 -#: classes/Gems/Default/RespondentExportAction.php:60 +#: classes/Gems/Menu.php:609 msgid "Export respondent" msgstr "Export respondent" -#: classes/Gems/Menu.php:615 classes/Gems/Default/ContactAction.php:101 -#: snippets/Organization/OrganizationEditSnippet.php:82 +#: classes/Gems/Menu.php:615 msgid "Contact" msgstr "Contact" @@ -419,19 +370,10 @@ msgstr "Changelog" #: classes/Gems/Model.php:206 -#: classes/Gems/Tracker/Model/StandardTokenModel.php:213 msgid "Respondent nr" msgstr "Patient nr" -#: classes/Gems/Model.php:209 classes/Gems/Default/ExportAction.php:172 -#: classes/Gems/Default/IndexAction.php:229 -#: classes/Gems/Default/LogAction.php:197 -#: classes/Gems/Default/MailJobAction.php:98 -#: classes/Gems/Default/StaffAction.php:340 -#: classes/Gems/Snippets/Export/ReportHeaderSnippet.php:63 -#: classes/Gems/User/Form/LayeredLoginForm.php:254 -#: classes/Gems/User/Form/OrganizationFormAbstract.php:166 -#: snippets/Organization/OrganizationEditSnippet.php:80 +#: classes/Gems/Model.php:209 msgid "Organization" msgstr "Organization" @@ -443,44 +385,27 @@ msgid "Consent" msgstr "Consent" -#: classes/Gems/Model.php:214 classes/Gems/Default/OptionAction.php:130 -#: classes/Gems/Default/StaffAction.php:330 +#: classes/Gems/Model.php:214 msgid "E-Mail" msgstr "E-Mail" -#: classes/Gems/Model.php:219 classes/Gems/Default/OptionAction.php:134 -#: classes/Gems/Default/StaffAction.php:343 +#: classes/Gems/Model.php:219 msgid "Gender" msgstr "Gender" -#: classes/Gems/Model.php:220 classes/Gems/Default/OptionAction.php:131 -#: classes/Gems/Default/StaffAction.php:185 +#: classes/Gems/Model.php:220 msgid "First name" msgstr "First name" -#: classes/Gems/Model.php:221 classes/Gems/Default/OptionAction.php:132 -#: classes/Gems/Default/StaffAction.php:187 +#: classes/Gems/Model.php:221 msgid "Surname prefix" msgstr "Surname prefix" -#: classes/Gems/Model.php:222 classes/Gems/Default/OptionAction.php:133 -#: classes/Gems/Default/StaffAction.php:188 +#: classes/Gems/Model.php:222 msgid "Last name" msgstr "Last name" -#: classes/Gems/Model.php:224 classes/Gems/Default/DatabaseAction.php:135 -#: classes/Gems/Default/DatabaseAction.php:335 -#: classes/Gems/Default/GroupAction.php:115 -#: classes/Gems/Default/OrganizationAction.php:122 -#: classes/Gems/Default/RoleAction.php:231 -#: classes/Gems/Default/SourceAction.php:195 -#: classes/Gems/Default/StaffAction.php:328 -#: classes/Gems/Default/SurveyMaintenanceAction.php:413 -#: classes/Gems/Default/TokenPlanAction.php:121 -#: classes/Gems/Default/TrackFieldsAction.php:98 -#: classes/Gems/Default/TrackMaintenanceAction.php:227 -#: classes/Gems/Snippets/TokenPlanTableSnippet.php:60 -#: classes/Gems/Tracker/Model/TrackModel.php:98 +#: classes/Gems/Model.php:224 msgid "Name" msgstr "Name" @@ -493,7 +418,6 @@ msgstr "Zipcode" #: classes/Gems/Model.php:229 -#: classes/Gems/Default/RespondentPlanAction.php:134 msgid "City" msgstr "City" @@ -502,7 +426,6 @@ msgstr "Phone" #: classes/Gems/Model.php:233 -#: classes/Gems/Default/RespondentPlanAction.php:133 msgid "Birthday" msgstr "Birthday" @@ -549,110 +472,61 @@ msgstr "Trying upgrade for %s to level %s: %s" #: classes/Gems/Controller/BrowseEditAction.php:357 -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:239 -#: classes/Gems/Default/StaffAction.php:228 -#: classes/Gems/Snippets/ModelFormSnippetAbstract.php:186 #, php-format msgid "New %s..." msgstr "New %s..." #: classes/Gems/Controller/BrowseEditAction.php:390 -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:259 -#: classes/Gems/Default/TrackFieldsAction.php:130 -#: classes/Gems/Default/TrackRoundsAction.php:171 #, php-format msgid "Delete %s" msgstr "Delete %s" #: classes/Gems/Controller/BrowseEditAction.php:394 -#: classes/Gems/Default/TrackFieldsAction.php:137 -#: classes/Gems/Default/TrackRoundsAction.php:186 -#: snippets/DeleteSingleSurveyInSourceTokenSnippet.php:134 -#: snippets/DeleteTrackTokenSnippet.php:152 #, php-format msgid "%2$u %1$s deleted" msgstr "%2$u %1$s deleted" #: classes/Gems/Controller/BrowseEditAction.php:411 -#: classes/Gems/Default/OrganizationAction.php:208 #, php-format msgid "Edit %s %s" msgstr "Edit %s %s" #: classes/Gems/Controller/BrowseEditAction.php:413 -#: classes/Gems/Controller/ModelSnippetActionAbstract.php:269 -#: 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 msgid "Free search text" msgstr "Free search text" #: classes/Gems/Controller/BrowseEditAction.php:587 -#: classes/Gems/Snippets/AutosearchFormSnippet.php:241 msgid "Search" msgstr "Search" #: classes/Gems/Controller/BrowseEditAction.php:603 -#: classes/Gems/Default/TrackMaintenanceAction.php:361 #, php-format msgid "No %s found" msgstr "No %s found" #: classes/Gems/Controller/BrowseEditAction.php:690 -#: classes/Gems/Default/ExportAction.php:245 #, php-format msgid "No %s found." msgstr "No %s found." #: classes/Gems/Controller/BrowseEditAction.php:805 -#: classes/Gems/Default/TrackRoundsAction.php:244 -#: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:94 msgid "Are you sure?" msgstr "Are you sure?" #: classes/Gems/Controller/BrowseEditAction.php:821 -#: classes/Gems/Default/DatabaseAction.php:187 -#: classes/Gems/Default/DatabaseAction.php:499 -#: classes/Gems/Default/StaffAction.php:276 -#: classes/Gems/Default/TrackAction.php:419 -#: classes/Gems/Default/TrackRoundsAction.php:265 -#: classes/Gems/Snippets/ModelItemYesNoDeleteSnippetAbstract.php:181 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:143 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:147 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:166 -#: classes/Gems/Util/Translated.php:263 -#: classes/MUtil/Snippets/ModelYesNoDeleteSnippetAbstract.php:192 -#: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:124 msgid "Yes" msgstr "Yes" #: classes/Gems/Controller/BrowseEditAction.php:822 -#: classes/Gems/Default/DatabaseAction.php:188 -#: classes/Gems/Default/DatabaseAction.php:500 -#: classes/Gems/Default/StaffAction.php:277 -#: classes/Gems/Default/TrackAction.php:420 -#: classes/Gems/Default/TrackRoundsAction.php:266 -#: classes/Gems/Snippets/ModelItemYesNoDeleteSnippetAbstract.php:183 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:144 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:148 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:167 -#: classes/Gems/Util/ReceptionCodeLibrary.php:99 -#: classes/Gems/Util/ReceptionCodeLibrary.php:123 -#: classes/Gems/Util/Translated.php:263 -#: classes/MUtil/Snippets/ModelYesNoDeleteSnippetAbstract.php:194 -#: snippets/DeleteSingleSurveyNotUsedTokenSnippet.php:125 msgid "No" msgstr "No" #: classes/Gems/Controller/BrowseEditAction.php:875 -#: classes/Gems/Default/RespondentAction.php:246 -#: classes/Gems/Default/RespondentAction.php:478 -#: classes/Gems/Default/RespondentAction.php:516 -#: classes/Gems/Default/TrackAction.php:554 #, php-format msgid "Unknown %s requested" msgstr "Unknown %s requested" @@ -663,15 +537,10 @@ msgstr "New %1$s..." #: classes/Gems/Controller/BrowseEditAction.php:906 -#: classes/Gems/Email/MailTemplateForm.php:108 -#: classes/Gems/User/Form/ChangePasswordForm.php:341 -#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:245 msgid "Save" msgstr "Save" #: classes/Gems/Controller/BrowseEditAction.php:942 -#: classes/Gems/Default/MailTemplateAction.php:116 -#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:209 #, php-format msgid "%2$u %1$s saved" msgstr "%2$u %1$s saved" @@ -681,31 +550,21 @@ msgstr "No changes to save." #: classes/Gems/Controller/BrowseEditAction.php:954 -#: classes/Gems/Default/RespondentAction.php:307 msgid "Input error! No changes saved!" msgstr "Input error! No changes saved!" #: classes/Gems/Controller/BrowseEditAction.php:982 -#: classes/Gems/Default/SurveyMaintenanceAction.php:593 #, php-format msgid "Show %s" msgstr "Show %s" #: classes/Gems/Controller/BrowseEditAction.php:989 -#: classes/Gems/Default/SurveyMaintenanceAction.php:602 #, php-format msgid "Unknown %s." msgstr "Unknown %s." #: classes/Gems/Controller/ModelActionAbstract.php:97 #: classes/Gems/Default/DatabaseAction.php:503 -#: classes/Gems/Default/SourceAction.php:292 -#: classes/Gems/Default/UpgradeAction.php:184 -#: classes/Gems/Snippets/ModelFormSnippetAbstract.php:171 -#: classes/Gems/Snippets/ModelItemTableSnippetAbstract.php:180 -#: classes/Gems/Tracker/Snippets/ShowRoundSnippetAbstract.php:193 -#: snippets/Generic/CurrentButtonRowSnippet.php:77 -#: snippets/Track/Token/ShowFirstOpenSnippet.php:133 msgid "Cancel" msgstr "Cancel" @@ -729,8 +588,6 @@ msgstr "Showing %s" #: classes/Gems/Controller/ModelSnippetActionAbstract.php:390 -#: classes/Gems/Default/OptionAction.php:181 -#: classes/MUtil/Snippets/ModelFormSnippetAbstract.php:341 msgid "item" msgid_plural "items" msgstr[0] "item" @@ -767,36 +624,22 @@ msgstr "After answering the survey you will be logged off automatically." #: classes/Gems/Default/AskAction.php:100 -msgid "" -"A token consists of two groups of four letters and numbers, separated by an " -"optional hyphen. Tokens are case insensitive." -msgstr "" -"A token consists of two groups of four letters and numbers, separated by an " -"optional hyphen. Tokens are case insensitive." +msgid "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive." +msgstr "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive." #: classes/Gems/Default/AskAction.php:101 -msgid "" -"The number zero and the letter O are treated as the same; the same goes for " -"the number one and the letter L." -msgstr "" -"The number zero and the letter O are treated as the same; the same goes for " -"the number one and the letter L." +msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L." +msgstr "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L." #: classes/Gems/Default/AskAction.php:136 #, php-format -msgid "" -"Thank you for answering. At the moment we have no further surveys for you to " -"take." -msgstr "" -"Thank you for answering. At the moment we have no further surveys for you to " -"take." +msgid "Thank you for answering. At the moment we have no further surveys for you to take." +msgstr "Thank you for answering. At the moment we have no further surveys for you to take." #: classes/Gems/Default/AskAction.php:138 #, php-format -msgid "" -"The survey for token %s has been answered and no further surveys are open." -msgstr "" -"The survey for token %s has been answered and no further surveys are open." +msgid "The survey for token %s has been answered and no further surveys are open." +msgstr "The survey for token %s has been answered and no further surveys are open." #: classes/Gems/Default/AskAction.php:145 #, php-format @@ -810,26 +653,11 @@ #: classes/Gems/Default/ConsentAction.php:68 #: classes/Gems/Default/GroupAction.php:116 -#: classes/Gems/Default/ReceptionAction.php:81 -#: classes/Gems/Default/RoleAction.php:232 -#: classes/Gems/Default/SurveyMaintenanceAction.php:200 -#: classes/Gems/Default/SurveyMaintenanceAction.php:414 -#: classes/Gems/Default/TrackActionAbstract.php:220 -#: classes/Gems/Default/TrackFieldsAction.php:101 -#: classes/Gems/Default/UpgradeAction.php:176 -#: classes/Gems/Export/RespondentExport.php:225 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:758 -#: classes/Gems/Tracker/Model/StandardTokenModel.php:214 -#: classes/Gems/Tracker/Snippets/EditTrackSnippetAbstract.php:150 -#: classes/Gems/Tracker/Snippets/ShowTrackUsageAbstract.php:147 -#: snippets/TrackSurveyOverviewSnippet.php:115 msgid "Description" msgstr "Description" #: classes/Gems/Default/ConsentAction.php:70 #: classes/Gems/Default/DatabaseAction.php:139 -#: classes/Gems/Default/TrackFieldsAction.php:97 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:757 msgid "Order" msgstr "Order" @@ -842,12 +670,8 @@ msgstr "Consent code" #: classes/Gems/Default/ConsentAction.php:75 -msgid "" -"Internal code, not visible to users, copied with the token information to " -"the source." -msgstr "" -"Internal code, not visible to users, copied with the token information to " -"the source." +msgid "Internal code, not visible to users, copied with the token information to the source." +msgstr "Internal code, not visible to users, copied with the token information to the source." #: classes/Gems/Default/ConsentAction.php:92 msgid "respondent consent" @@ -896,14 +720,10 @@ msgstr "No mails sent." #: classes/Gems/Default/CronAction.php:195 -#: classes/Gems/Email/MultiMailForm.php:49 -#: classes/Gems/Email/OneMailForm.php:47 msgid "On this test system all mail will be delivered to the from address." msgstr "On this test system all mail will be delivered to the from address." #: classes/Gems/Default/DatabaseAction.php:75 -#: classes/Gems/Default/ProjectInformationAction.php:192 -#: classes/Gems/Task/CleanCache.php:58 msgid "Cache cleaned" msgstr "Cache cleaned" @@ -913,25 +733,18 @@ msgstr "No rows in %s." #: classes/Gems/Default/DatabaseAction.php:134 -#: classes/Gems/Default/TrackFieldsAction.php:104 -#: classes/Gems/Default/TrackMaintenanceAction.php:229 msgid "Type" msgstr "Type" #: classes/Gems/Default/DatabaseAction.php:138 -#: classes/Gems/Default/SurveyMaintenanceAction.php:435 msgid "Group" msgstr "Group" #: classes/Gems/Default/DatabaseAction.php:140 -#: classes/Gems/Default/OrganizationAction.php:123 msgid "Location" msgstr "Location" #: classes/Gems/Default/DatabaseAction.php:143 -#: classes/Gems/Default/SourceAction.php:210 -#: classes/Gems/Export/RespondentExport.php:148 -#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:157 msgid "Status" msgstr "Status" @@ -942,7 +755,6 @@ #: classes/Gems/Default/DatabaseAction.php:148 #: classes/Gems/Default/DatabaseAction.php:293 #: classes/Gems/Default/DatabaseAction.php:340 -#: classes/Gems/Tracker/Model/StandardTokenModel.php:204 msgid "Changed on" msgstr "Changed on" @@ -1013,9 +825,6 @@ #: classes/Gems/Default/DatabaseAction.php:287 #: classes/Gems/Default/DatabaseAction.php:333 -#: classes/Gems/Default/UpgradeAction.php:126 -#: classes/Gems/Default/UpgradeAction.php:153 -#: classes/Gems/Default/UpgradeAction.php:175 msgid "Level" msgstr "Level" @@ -1048,7 +857,6 @@ msgstr "%d new or changed patch(es)." #: classes/Gems/Default/DatabaseAction.php:303 -#: classes/Gems/Default/ProjectInformationAction.php:137 msgid "Gems build" msgstr "Gems build" @@ -1073,7 +881,6 @@ msgstr "Show patches" #: classes/Gems/Default/DatabaseAction.php:326 -#: classes/Gems/Task/Db/ExecutePatch.php:68 #, php-format msgid "%d patch(es) executed." msgstr "%d patch(es) executed." @@ -1117,7 +924,6 @@ msgstr "Starting %d object creation scripts." #: classes/Gems/Default/DatabaseAction.php:474 -#: classes/Gems/Task/Db/CreateNewTable.php:73 #, php-format msgid "Finished %s creation script for object %d of %d" msgstr "Finished %s creation script for object %d of %d" @@ -1152,7 +958,6 @@ msgstr "Separate multiple commands with semicolons (;)." #: classes/Gems/Default/DatabaseAction.php:522 -#: classes/Gems/Menu/MenuAbstract.php:275 msgid "Run" msgstr "Run" @@ -1196,14 +1001,6 @@ msgstr "Not patient nr, but respondent id as exported here." #: classes/Gems/Default/ExportAction.php:154 -#: classes/Gems/Default/MailJobAction.php:100 -#: classes/Gems/Default/ProjectSurveysAction.php:67 -#: classes/Gems/Default/SurveyAction.php:193 -#: classes/Gems/Email/OneMailForm.php:57 -#: classes/Gems/Export/RespondentExport.php:145 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:755 -#: classes/Gems/Tracker/Model/StandardTokenModel.php:215 -#: snippets/TrackSurveyOverviewSnippet.php:111 msgid "Survey" msgstr "Survey" @@ -1225,40 +1022,25 @@ msgstr "Export data" #: classes/Gems/Default/GroupAction.php:71 -#: classes/Gems/Default/ReceptionAction.php:55 msgid "Can be assigned to" msgstr "Can be assigned to" #: classes/Gems/Default/GroupAction.php:117 #: classes/Gems/Default/LogAction.php:201 -#: classes/Gems/Default/RoleAction.php:298 msgid "Role" msgstr "Role" #: classes/Gems/Default/GroupAction.php:120 -#: classes/Gems/Default/MailJobAction.php:82 -#: classes/Gems/Default/OrganizationAction.php:147 -#: classes/Gems/Default/ReceptionAction.php:87 -#: classes/Gems/Default/SourceAction.php:101 -#: classes/Gems/Default/SurveyMaintenanceAction.php:426 -#: classes/Gems/Default/SurveyMaintenanceAction.php:481 -#: classes/Gems/Tracker/Engine/TrackEngineAbstract.php:761 -#: classes/Gems/Tracker/Model/TrackModel.php:102 -#: classes/Gems/Util/TrackData.php:147 msgid "Active" msgstr "Active" #: classes/Gems/Default/GroupAction.php:125 -#: classes/Gems/Default/OrganizationAction.php:171 msgid "Allowed IP Ranges" msgstr "Allowed IP Ranges" #: classes/Gems/Default/GroupAction.php:126 -#: classes/Gems/Default/OrganizationAction.php:172 -msgid "" -"Separate with | example: 10.0.0.0-10.0.0.255 (subnet masks are not supported)" -msgstr "" -"Separate with | example: 10.0.0.0-10.0.0.255 (subnet masks are not supported)" +msgid "Separate with | example: 10.0.0.0-10.0.0.255 (subnet masks are not supported)" +msgstr "Separate with | example: 10.0.0.0-10.0.0.255 (subnet masks are not supported)" #: classes/Gems/Default/GroupAction.php:136 msgid "group" @@ -1283,12 +1065,8 @@ msgstr "Please enter your username or e-mail address. " #: classes/Gems/Default/IndexAction.php:182 -msgid "" -"We will then send you an e-mail with a link. The link will bring you to a " -"page where you can set a new password of your choice." -msgstr "" -"We will then send you an e-mail with a link. The link will bring you to a " -"page where you can set a new password of your choice." +msgid "We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice." +msgstr "We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice." #: classes/Gems/Default/IndexAction.php:188 msgid "Execute password reset" @@ -1312,7 +1090,6 @@ msgstr "Please enter your password of choice twice." #: classes/Gems/Default/IndexAction.php:218 -#: classes/Gems/User/Form/LayeredLoginForm.php:258 msgid "Department" msgstr "Department" @@ -1331,26 +1108,18 @@ msgstr "Good bye: %s." #: classes/Gems/Default/IndexAction.php:339 -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." +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 -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." +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 -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." +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/OptionAction.php:94 -#: classes/Gems/Default/StaffAction.php:510 msgid "New password is active." msgstr "New password is active." @@ -1363,9 +1132,7 @@ "Dear {greeting},\n" "\n" "\n" -"A new password was requested for your [b]{organization}[/b] account on the " -"[b]{project}[/b] site, please click within {reset_in_hours} hours on [url=" -"{reset_url}]this link[/url] to enter the password of your choice.\n" +"A new password was requested for your [b]{organization}[/b] account on the [b]{project}[/b] site, please click within {reset_in_hours} hours on [url={reset_url}]this link[/url] to enter the password of your choice.\n" "\n" "\n" "{organization_signature}\n" @@ -1375,9 +1142,7 @@ "Dear {greeting},\n" "\n" "\n" -"A new password was requested for your [b]{organization}[/b] account on the " -"[b]{project}[/b] site, please click within {reset_in_hours} hours on [url=" -"{reset_url}]this link[/url] to enter the password of your choice.\n" +"A new password was requested for your [b]{organization}[/b] account on the [b]{project}[/b] site, please click within {reset_in_hours} hours on [url={reset_url}]this link[/url] to enter the password of your choice.\n" "\n" "\n" "{organization_signature}\n" @@ -1397,32 +1162,26 @@ msgstr "Invalid language setting." #: classes/Gems/Default/LogAction.php:78 -#: classes/Gems/Default/TokenPlanAction.php:243 msgid "from" msgstr "from" #: classes/Gems/Default/LogAction.php:83 -#: classes/Gems/Default/TokenPlanAction.php:248 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" @@ -1459,34 +1218,23 @@ msgstr "All actions" #: classes/Gems/Default/LogAction.php:190 -#: classes/Gems/Default/TrackFieldsAction.php:92 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:472 msgid "Date" msgstr "Date" #: classes/Gems/Default/LogAction.php:191 #: classes/Gems/Default/LogMaintenanceAction.php:52 -#: classes/Gems/Default/UpgradeAction.php:177 msgid "Action" msgstr "Action" #: classes/Gems/Default/LogAction.php:192 -#: classes/Gems/Default/MailTemplateAction.php:66 -#: classes/Gems/Email/EmailFormAbstract.php:168 msgid "Message" msgstr "Message" #: classes/Gems/Default/LogAction.php:198 -#: classes/Gems/Default/TokenPlanAction.php:116 -#: classes/Gems/Snippets/TokenPlanTableSnippet.php:55 -#: snippets/RespondentDetailsSnippet.php:74 -#: snippets/RespondentDetailsWithAssignmentsSnippet.php:148 msgid "Respondent" msgstr "Patient" #: classes/Gems/Default/LogAction.php:202 -#: classes/Gems/Default/OptionAction.php:175 -#: classes/Gems/User/RadiusUserDefinition.php:163 msgid "IP address" msgstr "IP address" @@ -1500,7 +1248,6 @@ msgstr "Log:" #: classes/Gems/Default/LogMaintenanceAction.php:72 -#: snippets/RespondentTokenTabsSnippet.php:69 msgid "All" msgstr "All" @@ -1514,7 +1261,6 @@ #: classes/Gems/Default/MailJobAction.php:78 #: classes/Gems/Default/MailLogAction.php:118 -#: classes/Gems/Email/EmailFormAbstract.php:308 msgid "Template" msgstr "Template" @@ -1581,10 +1327,6 @@ msgstr "Use the 'By staff member' address" #: classes/Gems/Default/MailJobAction.php:133 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:290 -#: classes/Gems/Tracker/Source/LimeSurvey1m9FieldMap.php:338 -#: snippets/Organization/OrganizationEditSnippet.php:85 -#: snippets/Organization/OrganizationEditSnippet.php:131 msgid "Other" msgstr "Other" @@ -1608,12 +1350,8 @@ msgstr "Turn Automatic Mail Jobs ON" #: classes/Gems/Default/MailJobAction.php:176 -msgid "" -"With automatic mail jobs and a cron job on the server, mails can be sent " -"without manual user action." -msgstr "" -"With automatic mail jobs and a cron job on the server, mails can be sent " -"without manual user action." +msgid "With automatic mail jobs and a cron job on the server, mails can be sent without manual user action." +msgstr "With automatic mail jobs and a cron job on the server, mails can be sent without manual user action." #: classes/Gems/Default/MailLogAction.php:109 msgid "Date sent" @@ -1637,7 +1375,6 @@ #: classes/Gems/Default/MailLogAction.php:115 #: classes/Gems/Default/MailTemplateAction.php:62 -#: classes/Gems/Email/EmailFormAbstract.php:349 msgid "Subject" msgstr "Subject" @@ -1680,7 +1417,6 @@ msgstr "TLS" #: classes/Gems/Default/MailServerAction.php:80 -#: classes/Gems/User/RadiusUserDefinition.php:164 msgid "Port" msgstr "Port" @@ -1693,20 +1429,16 @@ msgstr "User ID" #: classes/Gems/Default/MailServerAction.php:88 -#: classes/Gems/User/Form/LoginForm.php:127 msgid "Password" msgstr "Password" #: classes/Gems/Default/MailServerAction.php:90 #: classes/Gems/Default/SourceAction.php:95 -#: classes/Gems/User/Form/ChangePasswordForm.php:241 -#: classes/Gems/User/Form/ChangePasswordForm.php:287 msgid "Repeat password" msgstr "Repeat password" #: classes/Gems/Default/MailServerAction.php:91 #: classes/Gems/Default/SourceAction.php:74 -#: classes/Gems/User/RadiusUserDefinition.php:169 msgid "Enter only when changing" msgstr "Enter only when changing the password" @@ -1722,8 +1454,6 @@ #: classes/Gems/Default/MailTemplateAction.php:76 #: classes/Gems/Default/RespondentAction.php:349 -#: classes/Gems/Default/StaffAction.php:335 -#: classes/Gems/Default/StaffAction.php:405 msgid "(all organizations)" msgstr "(all organizations)" @@ -1746,9 +1476,8 @@ msgstr "Login Name" #: classes/Gems/Default/OptionAction.php:136 -#: classes/Gems/Default/OrganizationAction.php:143 +#: classes/Gems/Default/OrganizationAction.php:147 #: classes/Gems/Default/RespondentAction.php:195 -#: classes/Gems/Default/StaffAction.php:351 msgid "Language" msgstr "Language" @@ -1758,12 +1487,8 @@ msgstr "Options" #: classes/Gems/Default/OptionAction.php:155 -msgid "" -"This overview provides information about the last login activity on your " -"account." -msgstr "" -"This overview provides information about the last login activity on your " -"account." +msgid "This overview provides information about the last login activity on your account." +msgstr "This overview provides information about the last login activity on your account." #: classes/Gems/Default/OptionAction.php:175 msgid "Date / time" @@ -1773,122 +1498,113 @@ msgid "Item" msgstr "Item" -#: classes/Gems/Default/OrganizationAction.php:100 -#: classes/Gems/Model/HiddenOrganizationModel.php:113 +#: classes/Gems/Default/OrganizationAction.php:104 msgid "Inaccessible or unknown organization" msgstr "Inaccessible or unknown organization" -#: classes/Gems/Default/OrganizationAction.php:124 +#: classes/Gems/Default/OrganizationAction.php:128 msgid "Url" msgstr "Url" -#: classes/Gems/Default/OrganizationAction.php:125 +#: classes/Gems/Default/OrganizationAction.php:129 msgid "Task" msgstr "Task" -#: classes/Gems/Default/OrganizationAction.php:126 +#: classes/Gems/Default/OrganizationAction.php:130 msgid "Contact name" msgstr "Contact name" -#: classes/Gems/Default/OrganizationAction.php:127 +#: classes/Gems/Default/OrganizationAction.php:131 msgid "Contact email" msgstr "Contact email" -#: classes/Gems/Default/OrganizationAction.php:130 +#: classes/Gems/Default/OrganizationAction.php:134 msgid "Style" msgstr "Style" -#: classes/Gems/Default/OrganizationAction.php:135 +#: classes/Gems/Default/OrganizationAction.php:139 msgid "Default url's" msgstr "Default url's" -#: classes/Gems/Default/OrganizationAction.php:137 +#: classes/Gems/Default/OrganizationAction.php:141 #, php-format -msgid "" -"Always switch to this organization when %s is accessed from one of these " -"space separated url's. The first is used for mails." -msgstr "" -"Always switch to this organization when %s is accessed from one of these " -"space separated url's. The first is used for mails." +msgid "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails." +msgstr "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails." -#: classes/Gems/Default/OrganizationAction.php:147 +#: classes/Gems/Default/OrganizationAction.php:151 msgid "Can the organization be used?" msgstr "Can the organization be used?" -#: classes/Gems/Default/OrganizationAction.php:148 -#: classes/Gems/User/Form/LoginForm.php:151 +#: classes/Gems/Default/OrganizationAction.php:152 msgid "Login" msgstr "Login" -#: classes/Gems/Default/OrganizationAction.php:148 +#: classes/Gems/Default/OrganizationAction.php:152 msgid "Can people login for this organization?" msgstr "Can people login for this organization?" -#: classes/Gems/Default/OrganizationAction.php:149 +#: classes/Gems/Default/OrganizationAction.php:153 msgid "Accepting" msgstr "Accepting" -#: classes/Gems/Default/OrganizationAction.php:149 +#: classes/Gems/Default/OrganizationAction.php:153 msgid "Can new respondents be added to the organization?" msgstr "Can new patients be added to the organization?" -#: classes/Gems/Default/OrganizationAction.php:150 +#: classes/Gems/Default/OrganizationAction.php:154 msgid "Does the organization have respondents?" msgstr "Does the organization have patients?" -#: classes/Gems/Default/OrganizationAction.php:151 +#: classes/Gems/Default/OrganizationAction.php:155 msgid "Respondent group" msgstr "Patient group" -#: classes/Gems/Default/OrganizationAction.php:151 +#: classes/Gems/Default/OrganizationAction.php:155 msgid "Allows respondents to login." msgstr "Allow patients to login." -#: classes/Gems/Default/OrganizationAction.php:155 +#: classes/Gems/Default/OrganizationAction.php:159 msgid "Greeting" msgstr "Greeting" -#: classes/Gems/Default/OrganizationAction.php:155 -#: classes/Gems/Default/OrganizationAction.php:156 +#: classes/Gems/Default/OrganizationAction.php:159 +#: classes/Gems/Default/OrganizationAction.php:160 msgid "For emails and token forward screen." msgstr "For emails and token forward screen." -#: classes/Gems/Default/OrganizationAction.php:156 +#: classes/Gems/Default/OrganizationAction.php:160 msgid "Signature" msgstr "Signature" -#: classes/Gems/Default/OrganizationAction.php:158 +#: classes/Gems/Default/OrganizationAction.php:162 msgid "Accessible by" msgstr "Accessible by" -#: classes/Gems/Default/OrganizationAction.php:158 +#: classes/Gems/Default/OrganizationAction.php:162 msgid "Checked organizations see this organizations respondents." msgstr "Checked organizations see this organizations patients." -#: classes/Gems/Default/OrganizationAction.php:168 -#: classes/Gems/Default/SurveyMaintenanceAction.php:443 +#: classes/Gems/Default/OrganizationAction.php:172 msgid "Code name" msgstr "Code name" -#: classes/Gems/Default/OrganizationAction.php:168 -#: classes/Gems/Default/SurveyMaintenanceAction.php:443 +#: classes/Gems/Default/OrganizationAction.php:172 msgid "Only for programmers." msgstr "Only for programmers." -#: classes/Gems/Default/OrganizationAction.php:186 +#: classes/Gems/Default/OrganizationActio... [truncated message content] |
From: <gem...@li...> - 2012-10-16 13:41:52
|
Revision: 987 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=987&view=rev Author: matijsdejong Date: 2012-10-16 13:41:46 +0000 (Tue, 16 Oct 2012) Log Message: ----------- Final fix for org-switch/setParam() problem Modified Paths: -------------- trunk/library/classes/Gems/Default/OrganizationAction.php Property Changed: ---------------- trunk/library/ Property changes on: trunk/library ___________________________________________________________________ Modified: svn:mergeinfo - /branches/1.5.0-pulse/library:306-344,346,467 /branches/1.5.x/library:426-455,458-472,475-481 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 /tags/1.5.1/library:485,489,509-510,534 /tags/1.5.3-rc2/library:612,614,616,618 + /branches/1.5.0-pulse/library:306-344,346,467 /branches/1.5.x/library:426-455,458-472,475-481 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 /tags/1.5.1/library:485,489,509-510,534 /tags/1.5.3-rc2/library:612,614,616,618 /tags/1.5.6-pulse20121012/library:986 Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2012-10-16 13:15:50 UTC (rev 986) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2012-10-16 13:41:46 UTC (rev 987) @@ -82,14 +82,15 @@ $user->setCurrentOrganization($orgId); if ($origUrl) { - if (strpos($origUrl, '/index/') === false) { - $correctUrl = $origUrl; - } else { + // Check for organisation id in url, but not when a patient id is stated + if (strpos($origUrl, '/' . MUtil_Model::REQUEST_ID1 . '/') === false) { foreach ($user->possibleOrgIds as $key) { $finds[] = '/' . $key. '/' . $oldOrg; $replaces[] = '/' . $key. '/' . $orgId; } $correctUrl = str_replace($finds, $replaces, $origUrl); + } else { + $correctUrl = $origUrl; } // MUtil_Echo::track($origUrl, $correctUrl); $this->getResponse()->setRedirect($correctUrl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-16 13:15:59
|
Revision: 986 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=986&view=rev Author: matijsdejong Date: 2012-10-16 13:15:50 +0000 (Tue, 16 Oct 2012) Log Message: ----------- Final fix for org-switch/setParam() problem Modified Paths: -------------- tags/1.5.6-pulse20121012/library/classes/Gems/Default/OrganizationAction.php Modified: tags/1.5.6-pulse20121012/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- tags/1.5.6-pulse20121012/library/classes/Gems/Default/OrganizationAction.php 2012-10-12 16:57:08 UTC (rev 985) +++ tags/1.5.6-pulse20121012/library/classes/Gems/Default/OrganizationAction.php 2012-10-16 13:15:50 UTC (rev 986) @@ -82,14 +82,15 @@ $user->setCurrentOrganization($orgId); if ($origUrl) { - if (strpos($origUrl, '/index/') === false) { - $correctUrl = $origUrl; - } else { + // Check for organisation id in url, but not when a patient id is stated + if (strpos($origUrl, '/' . MUtil_Model::REQUEST_ID1 . '/') === false) { foreach ($user->possibleOrgIds as $key) { $finds[] = '/' . $key. '/' . $oldOrg; $replaces[] = '/' . $key. '/' . $orgId; } $correctUrl = str_replace($finds, $replaces, $origUrl); + } else { + $correctUrl = $origUrl; } // MUtil_Echo::track($origUrl, $correctUrl); $this->getResponse()->setRedirect($correctUrl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-12 16:57:15
|
Revision: 985 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=985&view=rev Author: matijsdejong Date: 2012-10-12 16:57:08 +0000 (Fri, 12 Oct 2012) Log Message: ----------- changelog updated Modified Paths: -------------- tags/1.5.6-pulse20121012/library/changelog.txt Property Changed: ---------------- tags/1.5.6-pulse20121012/library/ Property changes on: tags/1.5.6-pulse20121012/library ___________________________________________________________________ Modified: svn:mergeinfo - /branches/1.5.0-pulse/library:306-344,346,467 /branches/1.5.x/library:426-455,458-472,475-481 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 /tags/1.5.1/library:485,489,509-510,534 /tags/1.5.3-rc2/library:612,614,616,618 + /branches/1.5.0-pulse/library:306-344,346,467 /branches/1.5.x/library:426-455,458-472,475-481 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 /tags/1.5.1/library:485,489,509-510,534 /tags/1.5.3-rc2/library:612,614,616,618 /trunk/library:984 Modified: tags/1.5.6-pulse20121012/library/changelog.txt =================================================================== --- tags/1.5.6-pulse20121012/library/changelog.txt 2012-10-12 16:51:07 UTC (rev 984) +++ tags/1.5.6-pulse20121012/library/changelog.txt 2012-10-12 16:57:08 UTC (rev 985) @@ -1,6 +1,9 @@ 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. +Events can be specified at the GemsTracker level as well as the project level +Surveys can now have their own survey specific display, in a manner similar to event system +Several interface bugs/improvements were solved/written Important changes from 1.5.4 => 1.5.5 ============================================================ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-12 16:51:14
|
Revision: 984 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=984&view=rev Author: matijsdejong Date: 2012-10-12 16:51:07 +0000 (Fri, 12 Oct 2012) Log Message: ----------- Modified Paths: -------------- trunk/library/changelog.txt Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2012-10-12 16:42:25 UTC (rev 983) +++ trunk/library/changelog.txt 2012-10-12 16:51:07 UTC (rev 984) @@ -1,6 +1,9 @@ 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. +Events can be specified at the GemsTracker level as well as the project level +Surveys can now have their own survey specific display, in a manner similar to event system +Several interface bugs/improvements were solved/written Important changes from 1.5.4 => 1.5.5 ============================================================ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-10-12 16:42:31
|
Revision: 983 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=983&view=rev Author: matijsdejong Date: 2012-10-12 16:42:25 +0000 (Fri, 12 Oct 2012) Log Message: ----------- Added Paths: ----------- tags/1.5.6-pulse20121012/ Property changes on: tags/1.5.6-pulse20121012 ___________________________________________________________________ Added: svn:ignore + nbproject Added: svn:mergeinfo + /branches/1.5.0-pulse:306-430,467 /branches/1.5.x:426-455,458-472,475-481 /tags/1.5.0beta1:305 /tags/1.5.1:485,489,509-510 /tags/1.5.3-rc2:612,614,616,618 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |