From: <gem...@li...> - 2012-11-29 11:06:36
|
Revision: 1046 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1046&view=rev Author: matijsdejong Date: 2012-11-29 11:06:23 +0000 (Thu, 29 Nov 2012) Log Message: ----------- Moved tracker snippets to snippet directory Improvbed naming Modified Paths: -------------- trunk/library/classes/Gems/Event/Survey/Display/AllOfSurvey.php trunk/library/classes/Gems/Event/Survey/Display/TokenOnly.php trunk/library/classes/Gems/Event/Survey/Display/TrackOnly.php trunk/library/classes/Gems/Snippets/SnippetLoader.php trunk/library/classes/Gems/Tracker/Engine/SingleSurveyEngine.php trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php trunk/library/languages/default-en.mo trunk/library/languages/default-en.po trunk/library/languages/default-nl.mo trunk/library/languages/default-nl.po trunk/library/snippets/AnswerModelSnippet.php trunk/library/snippets/TrackAnswersModelSnippet.php Added Paths: ----------- trunk/library/classes/Gems/Event/Survey/Display/AllSingleTrack.php trunk/library/classes/Gems/Snippets/Tracker/ trunk/library/classes/Gems/Snippets/Tracker/Answers/ trunk/library/classes/Gems/Snippets/Tracker/Answers/SingleTokenAnswerModelSnippet.php trunk/library/classes/Gems/Snippets/Tracker/Answers/SingleTrackAnswersModelSnippet.php trunk/library/classes/Gems/Snippets/Tracker/Answers/SurveyAnswersModelSnippet.php trunk/library/classes/Gems/Snippets/Tracker/Answers/TrackAnswersModelSnippet.php Removed Paths: ------------- trunk/library/classes/Gems/Event/Survey/Display/AllSingleSurvey.php trunk/library/classes/Gems/Tracker/Snippets/SingleSurveyAnswersModelSnippet.php trunk/library/classes/Gems/Tracker/Snippets/SingleTokenAnswerModelSnippet.php trunk/library/classes/Gems/Tracker/Snippets/SurveyAnswersModelSnippet.php trunk/library/classes/Gems/Tracker/Snippets/TrackAnswersModelSnippet.php Modified: trunk/library/classes/Gems/Event/Survey/Display/AllOfSurvey.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/AllOfSurvey.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Event/Survey/Display/AllOfSurvey.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -60,7 +60,7 @@ */ public function getAnswerDisplaySnippets(Gems_Tracker_Token $token) { - return 'SurveyAnswersModelSnippet'; + return 'Tracker_Answers_SurveyAnswersModelSnippet'; } /** Deleted: trunk/library/classes/Gems/Event/Survey/Display/AllSingleSurvey.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/AllSingleSurvey.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Event/Survey/Display/AllSingleSurvey.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -1,75 +0,0 @@ -<?php - -/** - * Copyright (c) 2012, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * @package Gems - * @subpackage Events - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2012 Erasmus MC - * @license New BSD License - * @version $id: AllSingleSurvey.php 203 2012-01-01t 12:51:32Z matijs $ - */ - -/** - * Put the highest value first - * - * @package Gems - * @subpackage Events - * @copyright Copyright (c) 2012 Erasmus MC - * @license New BSD License - * @since Class available since version 1.5.7 - */ -class Gems_Event_Survey_Display_AllSingleSurvey extends Gems_Registry_TargetAbstract implements Gems_Event_SurveyDisplayEventInterface -{ - /** - * - * @var Zend_Translate - */ - protected $translate; - - /** - * 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) - { - return 'SingleSurveyAnswersModelSnippet'; - } - - /** - * A pretty name for use in dropdown selection boxes. - * - * @return string Name - */ - public function getEventName() - { - return $this->translate->_('Show all stand alone surveys for this type'); - } -} Added: trunk/library/classes/Gems/Event/Survey/Display/AllSingleTrack.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/AllSingleTrack.php (rev 0) +++ trunk/library/classes/Gems/Event/Survey/Display/AllSingleTrack.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -0,0 +1,75 @@ +<?php + +/** + * Copyright (c) 2012, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Events + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @version $id: AllSingleSurvey.php 203 2012-01-01t 12:51:32Z matijs $ + */ + +/** + * Put the highest value first + * + * @package Gems + * @subpackage Events + * @copyright Copyright (c) 2012 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5.7 + */ +class Gems_Event_Survey_Display_AllSingleTrack extends Gems_Registry_TargetAbstract implements Gems_Event_SurveyDisplayEventInterface +{ + /** + * + * @var Zend_Translate + */ + protected $translate; + + /** + * 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) + { + return 'Tracker_Answers_SingleTrackAnswersModelSnippet'; + } + + /** + * A pretty name for use in dropdown selection boxes. + * + * @return string Name + */ + public function getEventName() + { + return $this->translate->_('Show all tokens for this survey in this track type'); + } +} Modified: trunk/library/classes/Gems/Event/Survey/Display/TokenOnly.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/TokenOnly.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Event/Survey/Display/TokenOnly.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -60,7 +60,7 @@ */ public function getAnswerDisplaySnippets(Gems_Tracker_Token $token) { - return 'SingleTokenAnswerModelSnippet'; + return 'Tracker_Answers_SingleTokenAnswerModelSnippet'; } /** Modified: trunk/library/classes/Gems/Event/Survey/Display/TrackOnly.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/TrackOnly.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Event/Survey/Display/TrackOnly.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -60,7 +60,7 @@ */ public function getAnswerDisplaySnippets(Gems_Tracker_Token $token) { - return 'TrackAnswersModelSnippet'; + return 'Tracker_Answers_TrackAnswersModelSnippet'; } /** Modified: trunk/library/classes/Gems/Snippets/SnippetLoader.php =================================================================== --- trunk/library/classes/Gems/Snippets/SnippetLoader.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Snippets/SnippetLoader.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -1,4 +1,5 @@ <?php + /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -71,9 +72,6 @@ */ public function __construct($container = null, $dirs = array()) { - // Add tracker snippets directory - $dirs['Gems_Tracker'] = realpath(__DIR__ . '/../..'); - parent::__construct($container, $dirs); $this->backup = new MUtil_Snippets_SnippetLoader($this); Added: trunk/library/classes/Gems/Snippets/Tracker/Answers/SingleTokenAnswerModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Answers/SingleTokenAnswerModelSnippet.php (rev 0) +++ trunk/library/classes/Gems/Snippets/Tracker/Answers/SingleTokenAnswerModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -0,0 +1,62 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: SingleTokenAnswerModelSnippet.php 685 2012-05-16 15:11:59Z michieltcs $ + */ + +/** + * Displays answers from a single token to a survey. + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5.7 + */ +class Gems_Snippets_Tracker_Answers_SingleTokenAnswerModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric +{ + /** + * Overrule to implement snippet specific filtering and sorting. + * + * @param MUtil_Model_ModelAbstract $model + */ + protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) + { + if ($this->request) { + $this->processSortOnly($model); + + $model->setFilter(array('gto_id_token' => $this->token->getTokenId())); + } + } +} Added: trunk/library/classes/Gems/Snippets/Tracker/Answers/SingleTrackAnswersModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Answers/SingleTrackAnswersModelSnippet.php (rev 0) +++ trunk/library/classes/Gems/Snippets/Tracker/Answers/SingleTrackAnswersModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -0,0 +1,80 @@ +<?php + + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: SingleSurveyModelSnippet.php 946 2012-09-19 13:08:21Z mennodekker $ + */ + +/** + * Show answers for all standalone surveys of this survey type + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4 + */ +class Gems_Snippets_Tracker_Answers_SingleTrackAnswersModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric +{ + /** + * Use compact view and show all tokens of the same surveyId in + * one view. Property used by respondent export + * + * @var boolean + */ + public $grouped = true; + + /** + * Overrule to implement snippet specific filtering and sorting. + * + * @param MUtil_Model_ModelAbstract $model + */ + protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) + { + if ($this->request) { + $this->processSortOnly($model); + + if ($this->grouped) { + $filter['gto_id_track'] = $this->token->getTrackId(); + $filter['gto_id_respondent'] = $this->token->getRespondentId(); + $filter['gto_id_organization'] = $this->token->getOrganizationId(); + $filter['gto_id_survey'] = $this->token->getSurveyId(); + } else { + $filter['gto_id_token'] = $this->token->getTokenId(); + } + + $model->setFilter($filter); + } + } +} Added: trunk/library/classes/Gems/Snippets/Tracker/Answers/SurveyAnswersModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Answers/SurveyAnswersModelSnippet.php (rev 0) +++ trunk/library/classes/Gems/Snippets/Tracker/Answers/SurveyAnswersModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -0,0 +1,78 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: SurveyAnswersModelSnippet.php 946 2012-09-19 13:08:21Z mennodekker $ + */ + +/** + * Show all tokens of a certain survey type + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5.7 + */ +class Gems_Snippets_Tracker_Answers_SurveyAnswersModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric +{ + /** + * Use compact view and show all tokens of the same surveyId in + * one view. Property used by respondent export + * + * @var boolean + */ + public $grouped = true; + + /** + * Overrule to implement snippet specific filtering and sorting. + * + * @param MUtil_Model_ModelAbstract $model + */ + protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) + { + if ($this->request) { + $this->processSortOnly($model); + + if ($this->grouped) { + $filter['gto_id_respondent'] = $this->token->getRespondentId(); + $filter['gto_id_organization'] = $this->token->getOrganizationId(); + $filter['gto_id_survey'] = $this->token->getSurveyId(); + } else { + $filter['gto_id_token'] = $this->token->getTokenId(); + } + + $model->setFilter($filter); + } + } +} Added: trunk/library/classes/Gems/Snippets/Tracker/Answers/TrackAnswersModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Snippets/Tracker/Answers/TrackAnswersModelSnippet.php (rev 0) +++ trunk/library/classes/Gems/Snippets/Tracker/Answers/TrackAnswersModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -0,0 +1,77 @@ +<?php + +/** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * @package Gems + * @subpackage Tracker + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: TrackAnswersModelSnippet.php 946 2012-09-19 13:08:21Z mennodekker $ + */ + +/** + * Show all answers for one survey within a track + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.4 + */ +class Gems_Snippets_Tracker_Answers_TrackAnswersModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric +{ + /** + * Use compact view and show all tokens of the same surveyId in + * one view. Property used by respondent export + * + * @var boolean + */ + public $grouped = true; + + /** + * Overrule to implement snippet specific filtering and sorting. + * + * @param MUtil_Model_ModelAbstract $model + */ + protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) + { + if ($this->request) { + $this->processSortOnly($model); + + if ($this->grouped) { + $filter['gto_id_respondent_track'] = $this->token->getRespondentTrackId(); + $filter['gto_id_survey'] = $this->token->getSurveyId(); + } else { + $filter['gto_id_token'] = $this->token->getTokenId(); + } + + $model->setFilter($filter); + } + } +} Modified: trunk/library/classes/Gems/Tracker/Engine/SingleSurveyEngine.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/SingleSurveyEngine.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Tracker/Engine/SingleSurveyEngine.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -104,7 +104,7 @@ */ public function getAnswerSnippetNames() { - return array('SingleTokenAnswerModelSnippet'); + return array('Tracker_Answers_SingleTokenAnswerModelSnippet'); } /** Modified: trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Tracker/Engine/StepEngineAbstract.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -339,7 +339,7 @@ */ public function getAnswerSnippetNames() { - return array('TrackAnswersModelSnippet'); + return array('Tracker_Answers_TrackAnswersModelSnippet'); } /** Deleted: trunk/library/classes/Gems/Tracker/Snippets/SingleSurveyAnswersModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/SingleSurveyAnswersModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Tracker/Snippets/SingleSurveyAnswersModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -1,80 +0,0 @@ -<?php - - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * @package Gems - * @subpackage Tracker - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id: SingleSurveyModelSnippet.php 946 2012-09-19 13:08:21Z mennodekker $ - */ - -/** - * Show answers for all standalone surveys of this survey type - * - * @package Gems - * @subpackage Tracker - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.4 - */ -class Gems_Tracker_Snippets_SingleSurveyAnswersModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric -{ - /** - * Use compact view and show all tokens of the same surveyId in - * one view. Property used by respondent export - * - * @var boolean - */ - public $grouped = true; - - /** - * Overrule to implement snippet specific filtering and sorting. - * - * @param MUtil_Model_ModelAbstract $model - */ - protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) - { - if ($this->request) { - $this->processSortOnly($model); - - if ($this->grouped) { - $filter['gto_id_track'] = $this->token->getTrackId(); - $filter['gto_id_respondent'] = $this->token->getRespondentId(); - $filter['gto_id_organization'] = $this->token->getOrganizationId(); - $filter['gto_id_survey'] = $this->token->getSurveyId(); - } else { - $filter['gto_id_token'] = $this->token->getTokenId(); - } - - $model->setFilter($filter); - } - } -} Deleted: trunk/library/classes/Gems/Tracker/Snippets/SingleTokenAnswerModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/SingleTokenAnswerModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Tracker/Snippets/SingleTokenAnswerModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -1,62 +0,0 @@ -<?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * @package Gems - * @subpackage Tracker - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id: SingleTokenAnswerModelSnippet.php 685 2012-05-16 15:11:59Z michieltcs $ - */ - -/** - * Displays answers to a survey. - * - * @package Gems - * @subpackage Tracker - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.5.7 - */ -class Gems_Tracker_Snippets_SingleTokenAnswerModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric -{ - /** - * Overrule to implement snippet specific filtering and sorting. - * - * @param MUtil_Model_ModelAbstract $model - */ - protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) - { - if ($this->request) { - $this->processSortOnly($model); - - $model->setFilter(array('gto_id_token' => $this->token->getTokenId())); - } - } -} Deleted: trunk/library/classes/Gems/Tracker/Snippets/SurveyAnswersModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/SurveyAnswersModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Tracker/Snippets/SurveyAnswersModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -1,79 +0,0 @@ -<?php - - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * @package Gems - * @subpackage Tracker - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id: SurveyAnswersModelSnippet.php 946 2012-09-19 13:08:21Z mennodekker $ - */ - -/** - * Show all tokens of a certain survey type - * - * @package Gems - * @subpackage Tracker - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.5.7 - */ -class Gems_Tracker_Snippets_SurveyAnswersModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric -{ - /** - * Use compact view and show all tokens of the same surveyId in - * one view. Property used by respondent export - * - * @var boolean - */ - public $grouped = true; - - /** - * Overrule to implement snippet specific filtering and sorting. - * - * @param MUtil_Model_ModelAbstract $model - */ - protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) - { - if ($this->request) { - $this->processSortOnly($model); - - if ($this->grouped) { - $filter['gto_id_respondent'] = $this->token->getRespondentId(); - $filter['gto_id_organization'] = $this->token->getOrganizationId(); - $filter['gto_id_survey'] = $this->token->getSurveyId(); - } else { - $filter['gto_id_token'] = $this->token->getTokenId(); - } - - $model->setFilter($filter); - } - } -} Deleted: trunk/library/classes/Gems/Tracker/Snippets/TrackAnswersModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/TrackAnswersModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/classes/Gems/Tracker/Snippets/TrackAnswersModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -1,78 +0,0 @@ -<?php - - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * @package Gems - * @subpackage Tracker - * @author Matijs de Jong <mj...@ma...> - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @version $Id: TrackAnswersModelSnippet.php 946 2012-09-19 13:08:21Z mennodekker $ - */ - -/** - * Class description of TrackAnswersModelSnippet - * - * @package Gems - * @subpackage Tracker - * @copyright Copyright (c) 2011 Erasmus MC - * @license New BSD License - * @since Class available since version 1.4 - */ -class Gems_Tracker_Snippets_TrackAnswersModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric -{ - /** - * Use compact view and show all tokens of the same surveyId in - * one view. Property used by respondent export - * - * @var boolean - */ - public $grouped = true; - - /** - * Overrule to implement snippet specific filtering and sorting. - * - * @param MUtil_Model_ModelAbstract $model - */ - protected function processFilterAndSort(MUtil_Model_ModelAbstract $model) - { - if ($this->request) { - $this->processSortOnly($model); - - if ($this->grouped) { - $filter['gto_id_respondent_track'] = $this->token->getRespondentTrackId(); - $filter['gto_id_survey'] = $this->token->getSurveyId(); - } else { - $filter['gto_id_token'] = $this->token->getTokenId(); - } - - $model->setFilter($filter); - } - } -} Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/languages/default-en.po 2012-11-29 11:06:23 UTC (rev 1046) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-28 16:25+0100\n" +"POT-Creation-Date: 2012-11-29 12:04+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -3439,9 +3439,9 @@ msgid "Show all answers for this survey type" msgstr "Show all answers for this survey type" -#: classes/Gems/Event/Survey/Display/AllSingleSurvey.php:73 -msgid "Show all stand alone surveys for this type" -msgstr "Show all stand alone surveys for this type" +#: classes/Gems/Event/Survey/Display/AllSingleTrack.php:73 +msgid "Show all tokens for this survey in this track type" +msgstr "Show all tokens for this survey in this track type" #: classes/Gems/Event/Survey/Display/ByValue.php:87 msgid "Show the highest answer first." @@ -5176,6 +5176,9 @@ msgstr[1] "" "After this survey there are another %d surveys we would like you to answer." +#~ msgid "Show all stand alone surveys for this type" +#~ msgstr "Show all stand alone surveys for this type" + #~ msgid "Gems project path" #~ msgstr "Gems project path" 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-28 16:18:00 UTC (rev 1045) +++ trunk/library/languages/default-nl.po 2012-11-29 11:06:23 UTC (rev 1046) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-28 16:25+0100\n" +"POT-Creation-Date: 2012-11-29 12:04+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -3466,9 +3466,9 @@ msgid "Show all answers for this survey type" msgstr "Toon alle antwoorden voor deze vragenlijst" -#: classes/Gems/Event/Survey/Display/AllSingleSurvey.php:73 -msgid "Show all stand alone surveys for this type" -msgstr "Toon alle antwoorden voor deze losse vragenlijst" +#: classes/Gems/Event/Survey/Display/AllSingleTrack.php:73 +msgid "Show all tokens for this survey in this track type" +msgstr "Toon alle antwoorden voor deze vragenlijst in dit traject type" #: classes/Gems/Event/Survey/Display/ByValue.php:87 msgid "Show the highest answer first." @@ -5232,6 +5232,9 @@ msgstr[0] "Na deze vragenlijst hebben we nog één andere vragenlijst voor u." msgstr[1] "Na deze vragenlijst hebben we nog %d andere vragenlijsten voor u." +#~ msgid "Show all stand alone surveys for this type" +#~ msgstr "Toon alle antwoorden voor deze losse vragenlijst" + #~ msgid "Gems project path" #~ msgstr "Gems project folder" Modified: trunk/library/snippets/AnswerModelSnippet.php =================================================================== --- trunk/library/snippets/AnswerModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/snippets/AnswerModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -45,6 +45,6 @@ * @license New BSD License * @since Class available since version 1.4 */ -class AnswerModelSnippet extends Gems_Tracker_Snippets_SingleTokenAnswerModelSnippet +class AnswerModelSnippet extends Gems_Snippets_Tracker_Answers_SingleTokenAnswerModelSnippet { } Modified: trunk/library/snippets/TrackAnswersModelSnippet.php =================================================================== --- trunk/library/snippets/TrackAnswersModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) +++ trunk/library/snippets/TrackAnswersModelSnippet.php 2012-11-29 11:06:23 UTC (rev 1046) @@ -46,6 +46,6 @@ * @license New BSD License * @since Class available since version 1.4 */ -class TrackAnswersModelSnippet extends Gems_Tracker_Snippets_TrackAnswersModelSnippet +class TrackAnswersModelSnippet extends Gems_Snippets_Tracker_Answers_TrackAnswersModelSnippet { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |