From: <gem...@li...> - 2013-04-17 16:29:42
|
Revision: 1237 http://sourceforge.net/p/gemstracker/code/1237 Author: matijsdejong Date: 2013-04-17 16:29:37 +0000 (Wed, 17 Apr 2013) Log Message: ----------- Bug: Nologin user was staff Added LimeSurvey 2.00 source type Modified Paths: -------------- trunk/library/classes/Gems/Tracker.php trunk/library/classes/Gems/User/NoLoginDefinition.php Added Paths: ----------- trunk/library/classes/Gems/Tracker/Source/LimeSurvey2m00Database.php Copied: trunk/library/classes/Gems/Tracker/Source/LimeSurvey2m00Database.php (from rev 1235, trunk/library/classes/Gems/Tracker/Source/LimeSurvey1m91Database.php) =================================================================== --- trunk/library/classes/Gems/Tracker/Source/LimeSurvey2m00Database.php (rev 0) +++ trunk/library/classes/Gems/Tracker/Source/LimeSurvey2m00Database.php 2013-04-17 16:29:37 UTC (rev 1237) @@ -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 + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** + * Class description of LimeSurvey1m91Database + * + * Difference with 1.9 version: + * - private field was renamed to anonymized + * + * @package Gems + * @subpackage Tracker + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.6.1 + */ +class Gems_Tracker_Source_LimeSurvey2m00Database extends Gems_Tracker_Source_LimeSurvey1m91Database +{ + /** + * Returns a list of field names that should be set in a newly inserted token. + * + * Adds the fields without default new in 2.00 + * + * @param Gems_Tracker_Token $token + * @return array Of fieldname => value type + */ + protected function _fillAttributeMap(Gems_Tracker_Token $token) + { + $values = parent::_fillAttributeMap($token); + + return self::addnewAttributeDefaults($values); + } + + /** + * Adds the fields without default new in 2.00 + * + * @param Gems_Tracker_Token $token + * @return array Of fieldname => value type + */ + public static function addnewAttributeDefaults(array $values) + { + // Not really attributes, but htey need a value + $values['participant_id'] = ''; + $values['blacklisted'] = ''; + + return $values; + } +} \ No newline at end of file Modified: trunk/library/classes/Gems/Tracker.php =================================================================== --- trunk/library/classes/Gems/Tracker.php 2013-04-17 15:46:57 UTC (rev 1236) +++ trunk/library/classes/Gems/Tracker.php 2013-04-17 16:29:37 UTC (rev 1237) @@ -75,6 +75,7 @@ protected $_sourceClasses = array( 'LimeSurvey1m9Database' => 'Lime Survey 1.90 DB', 'LimeSurvey1m91Database' => 'Lime Survey 1.91+ DB', + 'LimeSurvey2m00Database' => 'Lime Survey 2.00 DB', ); /** @@ -337,7 +338,7 @@ { return $this->getTokenLibrary()->filter($tokenId); } - + /** * * @param mixed $respTrackData Track id or array containing trackdata @@ -360,9 +361,9 @@ /** * Get all tracks for a respondent - * + * * Specify the optional $order to sort other than on start date - * + * * @param int $userId * @param int $organizationId * @param mixed $order The column(s) and direction to order by Modified: trunk/library/classes/Gems/User/NoLoginDefinition.php =================================================================== --- trunk/library/classes/Gems/User/NoLoginDefinition.php 2013-04-17 15:46:57 UTC (rev 1236) +++ trunk/library/classes/Gems/User/NoLoginDefinition.php 2013-04-17 16:29:37 UTC (rev 1237) @@ -75,4 +75,16 @@ 'user_role' => 'nologin', ); } + + /** + * Returns true when users using this definition are staff members. + * + * Used only when the definition does not return a user_staff field. + * + * @return boolean + */ + public function isStaff() + { + return false; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |