From: <gem...@li...> - 2012-11-28 16:18:12
|
Revision: 1045 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1045&view=rev Author: matijsdejong Date: 2012-11-28 16:18:00 +0000 (Wed, 28 Nov 2012) Log Message: ----------- New answer display filters that show all of survey for respondent or all single survey for respondent Extended SnippetLoader.php to search in Tracker/Snippets directory as well Modified Paths: -------------- trunk/library/classes/Gems/Event/Survey/Display/ByValue.php trunk/library/classes/Gems/Event/Survey/Display/Reverse.php trunk/library/classes/Gems/Event/Survey/Display/YesOnTop.php trunk/library/classes/Gems/Snippets/SnippetLoader.php trunk/library/classes/Gems/Tracker/Engine/SingleSurveyEngine.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/AllOfSurvey.php trunk/library/classes/Gems/Event/Survey/Display/AllSingleSurvey.php trunk/library/classes/Gems/Event/Survey/Display/TokenOnly.php trunk/library/classes/Gems/Event/Survey/Display/TrackOnly.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 Added: trunk/library/classes/Gems/Event/Survey/Display/AllOfSurvey.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/AllOfSurvey.php (rev 0) +++ trunk/library/classes/Gems/Event/Survey/Display/AllOfSurvey.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -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: AllOfSurvey.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_AllOfSurvey 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 'SurveyAnswersModelSnippet'; + } + + /** + * A pretty name for use in dropdown selection boxes. + * + * @return string Name + */ + public function getEventName() + { + return $this->translate->_('Show all answers for this survey type'); + } +} Added: trunk/library/classes/Gems/Event/Survey/Display/AllSingleSurvey.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/AllSingleSurvey.php (rev 0) +++ trunk/library/classes/Gems/Event/Survey/Display/AllSingleSurvey.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -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_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'); + } +} Modified: trunk/library/classes/Gems/Event/Survey/Display/ByValue.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/ByValue.php 2012-11-27 11:13:04 UTC (rev 1044) +++ trunk/library/classes/Gems/Event/Survey/Display/ByValue.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -32,7 +32,7 @@ * @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 $ + * @version $id: ByValue.php 203 2012-01-01t 12:51:32Z matijs $ */ /** Modified: trunk/library/classes/Gems/Event/Survey/Display/Reverse.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/Reverse.php 2012-11-27 11:13:04 UTC (rev 1044) +++ trunk/library/classes/Gems/Event/Survey/Display/Reverse.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -32,7 +32,7 @@ * @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 $ + * @version $id: Reverse.php 203 2012-01-01t 12:51:32Z matijs $ */ /** Added: trunk/library/classes/Gems/Event/Survey/Display/TokenOnly.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/TokenOnly.php (rev 0) +++ trunk/library/classes/Gems/Event/Survey/Display/TokenOnly.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -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: TokenOnly.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_TokenOnly 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 'SingleTokenAnswerModelSnippet'; + } + + /** + * A pretty name for use in dropdown selection boxes. + * + * @return string Name + */ + public function getEventName() + { + return $this->translate->_('Show answers for this token only'); + } +} Added: trunk/library/classes/Gems/Event/Survey/Display/TrackOnly.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/TrackOnly.php (rev 0) +++ trunk/library/classes/Gems/Event/Survey/Display/TrackOnly.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -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: TrackOnly.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_TrackOnly 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 'TrackAnswersModelSnippet'; + } + + /** + * 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 the track'); + } +} Modified: trunk/library/classes/Gems/Event/Survey/Display/YesOnTop.php =================================================================== --- trunk/library/classes/Gems/Event/Survey/Display/YesOnTop.php 2012-11-27 11:13:04 UTC (rev 1044) +++ trunk/library/classes/Gems/Event/Survey/Display/YesOnTop.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -32,7 +32,7 @@ * @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 $ + * @version $id: YesOnTop.php 203 2012-01-01t 12:51:32Z matijs $ */ /** Modified: trunk/library/classes/Gems/Snippets/SnippetLoader.php =================================================================== --- trunk/library/classes/Gems/Snippets/SnippetLoader.php 2012-11-27 11:13:04 UTC (rev 1044) +++ trunk/library/classes/Gems/Snippets/SnippetLoader.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -2,7 +2,7 @@ /** * Copyright (c) 2011, Erasmus MC * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright @@ -13,7 +13,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 @@ -24,7 +24,7 @@ * 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. - * + * * Gems specific version of the snippet loader * * @package Gems @@ -49,6 +49,11 @@ */ class Gems_Snippets_SnippetLoader extends Gems_Loader_TargetLoaderAbstract implements MUtil_Snippets_SnippetLoaderInterface { + /** + * Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for. + * + * @var string $cascade An optional subdirectory where this subclass always loads from. + */ protected $cascade = 'Snippets'; protected $loader; @@ -64,8 +69,13 @@ * @param mixed $container A container acting as source for MUtil_Registry_Source * @param array $dirs The directories where to look for requested classes */ - public function __construct($container = null, $dirs = array()) { + 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); $this->addDirectory(GEMS_LIBRARY_DIR . '/classes/MUtil/Snippets/Standard'); } Modified: trunk/library/classes/Gems/Tracker/Engine/SingleSurveyEngine.php =================================================================== --- trunk/library/classes/Gems/Tracker/Engine/SingleSurveyEngine.php 2012-11-27 11:13:04 UTC (rev 1044) +++ trunk/library/classes/Gems/Tracker/Engine/SingleSurveyEngine.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -104,7 +104,7 @@ */ public function getAnswerSnippetNames() { - return array('AnswerModelSnippet'); + return array('SingleTokenAnswerModelSnippet'); } /** Added: trunk/library/classes/Gems/Tracker/Snippets/SingleSurveyAnswersModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/SingleSurveyAnswersModelSnippet.php (rev 0) +++ trunk/library/classes/Gems/Tracker/Snippets/SingleSurveyAnswersModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -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_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); + } + } +} Added: trunk/library/classes/Gems/Tracker/Snippets/SingleTokenAnswerModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/SingleTokenAnswerModelSnippet.php (rev 0) +++ trunk/library/classes/Gems/Tracker/Snippets/SingleTokenAnswerModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -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 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())); + } + } +} Added: trunk/library/classes/Gems/Tracker/Snippets/SurveyAnswersModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/SurveyAnswersModelSnippet.php (rev 0) +++ trunk/library/classes/Gems/Tracker/Snippets/SurveyAnswersModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -0,0 +1,79 @@ +<?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); + } + } +} Added: trunk/library/classes/Gems/Tracker/Snippets/TrackAnswersModelSnippet.php =================================================================== --- trunk/library/classes/Gems/Tracker/Snippets/TrackAnswersModelSnippet.php (rev 0) +++ trunk/library/classes/Gems/Tracker/Snippets/TrackAnswersModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -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: 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-27 11:13:04 UTC (rev 1044) +++ trunk/library/languages/default-en.po 2012-11-28 16:18:00 UTC (rev 1045) @@ -2,9 +2,9 @@ msgstr "" "Project-Id-Version: GemsTracker EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-27 12:11+0100\n" +"POT-Creation-Date: 2012-11-28 16:25+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Menno Dekker <men...@er...>\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" @@ -1816,7 +1816,7 @@ msgstr "Can the organization be used?" #: classes/Gems/Default/OrganizationAction.php:152 -#: classes/Gems/User/Form/LoginForm.php:151 views/scripts/index/login.phtml:7 +#: classes/Gems/User/Form/LoginForm.php:151 msgid "Login" msgstr "Login" @@ -3435,6 +3435,14 @@ msgid "Previous Version Answers Lookup" msgstr "Previous Version Answers Lookup" +#: classes/Gems/Event/Survey/Display/AllOfSurvey.php:73 +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/ByValue.php:87 msgid "Show the highest answer first." msgstr "Show the highest answer first." @@ -3447,6 +3455,14 @@ msgid "Reverse the question order." msgstr "Reverse the question order." +#: classes/Gems/Event/Survey/Display/TokenOnly.php:73 +msgid "Show answers for this token only" +msgstr "Show answers for this token only" + +#: classes/Gems/Event/Survey/Display/TrackOnly.php:73 +msgid "Show all tokens for this survey in the track" +msgstr "Show all tokens for this survey in the track" + #: classes/Gems/Event/Survey/Display/YesOnTop.php:102 msgid "Yes answers on top." msgstr "Yes answers on top." @@ -3555,7 +3571,6 @@ msgstr "Clean cache" #: classes/Gems/Menu/MenuAbstract.php:421 -#: views/scripts/index/resetpassword.phtml:1 msgid "Reset password" msgstr "Reset password" 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-27 11:13:04 UTC (rev 1044) +++ trunk/library/languages/default-nl.po 2012-11-28 16:18:00 UTC (rev 1045) @@ -2,9 +2,9 @@ msgstr "" "Project-Id-Version: GemsTracker NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-11-27 12:09+0100\n" +"POT-Creation-Date: 2012-11-28 16:25+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Menno Dekker <men...@er...>\n" +"Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" "Language: nl_NL\n" "MIME-Version: 1.0\n" @@ -1826,7 +1826,7 @@ msgstr "Is de organisatie in gebruik?" #: classes/Gems/Default/OrganizationAction.php:152 -#: classes/Gems/User/Form/LoginForm.php:151 views/scripts/index/login.phtml:7 +#: classes/Gems/User/Form/LoginForm.php:151 msgid "Login" msgstr "Inloggen" @@ -3462,6 +3462,14 @@ msgid "Previous Version Answers Lookup" msgstr "Antwoorden overnemen van vorige keer" +#: classes/Gems/Event/Survey/Display/AllOfSurvey.php:73 +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/ByValue.php:87 msgid "Show the highest answer first." msgstr "Toon het hoogste antwoord eerst." @@ -3474,6 +3482,14 @@ msgid "Reverse the question order." msgstr "Draai de vraag volgorde om." +#: classes/Gems/Event/Survey/Display/TokenOnly.php:73 +msgid "Show answers for this token only" +msgstr "Toon alleen de antwoorden voor dit kenmerk" + +#: classes/Gems/Event/Survey/Display/TrackOnly.php:73 +msgid "Show all tokens for this survey in the track" +msgstr "Toon alle antwoorden voor deze vragenlijst in dit traject" + #: classes/Gems/Event/Survey/Display/YesOnTop.php:102 msgid "Yes answers on top." msgstr "Ja antwoorden bovenaan." @@ -3583,7 +3599,6 @@ msgstr "Cache opruimen" #: classes/Gems/Menu/MenuAbstract.php:421 -#: views/scripts/index/resetpassword.phtml:1 msgid "Reset password" msgstr "Reset wachtwoord" Modified: trunk/library/snippets/AnswerModelSnippet.php =================================================================== --- trunk/library/snippets/AnswerModelSnippet.php 2012-11-27 11:13:04 UTC (rev 1044) +++ trunk/library/snippets/AnswerModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -38,25 +38,13 @@ /** * Displays answers to a survey. * + * @deprecated * @package Gems * @subpackage Tracker * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4 */ -class AnswerModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric +class AnswerModelSnippet extends Gems_Tracker_Snippets_SingleTokenAnswerModelSnippet { - /** - * 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())); - } - } } Modified: trunk/library/snippets/TrackAnswersModelSnippet.php =================================================================== --- trunk/library/snippets/TrackAnswersModelSnippet.php 2012-11-27 11:13:04 UTC (rev 1044) +++ trunk/library/snippets/TrackAnswersModelSnippet.php 2012-11-28 16:18:00 UTC (rev 1045) @@ -39,40 +39,13 @@ /** * Class description of TrackAnswersModelSnippet * + * @deprecated * @package Gems * @subpackage Tracker * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License * @since Class available since version 1.4 */ -class TrackAnswersModelSnippet extends Gems_Tracker_Snippets_AnswerModelSnippetGeneric +class TrackAnswersModelSnippet extends Gems_Tracker_Snippets_TrackAnswersModelSnippet { - /** - * 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); - } - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |