From: <gem...@li...> - 2011-11-14 17:51:14
|
Revision: 213 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=213&view=rev Author: matijsdejong Date: 2011-11-14 17:51:04 +0000 (Mon, 14 Nov 2011) Log Message: ----------- Started on independent Organization object for #31 respondent login. User switch is performed on organization cookie instead of style cookie. Added a lot of documentation. Modified Paths: -------------- trunk/library/changelog.txt trunk/library/classes/Gems/Default/IndexAction.php trunk/library/classes/Gems/Loader.php trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php trunk/library/classes/Gems/Project/Layout/SingleLayoutInterface.php trunk/library/classes/Gems/Project/Log/LogRespondentAccessInterface.php trunk/library/classes/Gems/Project/Organization/MultiOrganizationInterface.php trunk/library/classes/Gems/Project/Organization/SingleOrganizationInterface.php trunk/library/classes/Gems/Project/Tracks/FixedTracksInterface.php trunk/library/classes/Gems/Project/Tracks/MultiTracksInterface.php trunk/library/classes/Gems/Project/Tracks/SingleTrackInterface.php trunk/library/classes/Gems/Project/Tracks/StandAloneSurveysInterface.php trunk/library/classes/Gems/Project/Tracks/TracksOnlyInterface.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/User/UserLoader.php trunk/library/classes/GemsEscort.php Added Paths: ----------- trunk/library/classes/Gems/User/Organization.php Modified: trunk/library/changelog.txt =================================================================== --- trunk/library/changelog.txt 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/changelog.txt 2011-11-14 17:51:04 UTC (rev 213) @@ -2,6 +2,7 @@ ============================================================ Passwords should be set with a project.ini->salt. Salt is now a required project setting! The table gems__staff is split into gems__staff, gems__user_logins with generic login data and gems__users_passwords containing db stored password information. +GemsEscort->afterLogin(), ->afterLogout() and ->loadLoginInfo(0 are now all handled by Gems_User_UserDefinitionInterface objects. The table gems__user_ids provides unique and non-sequential user ids accross gems__staff and gems__respondents. The gems__respondent.grs_bsn has been renamed to grs_ssn, to make the code more international. MailController is now called MailTemplateController. Modified: trunk/library/classes/Gems/Default/IndexAction.php =================================================================== --- trunk/library/classes/Gems/Default/IndexAction.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Default/IndexAction.php 2011-11-14 17:51:04 UTC (rev 213) @@ -164,7 +164,7 @@ $element->setRequired(true); if (! $this->_request->isPost()) { - $element->setValue($this->escort->getCurrentOrganization()); + $element->setValue($this->loader->getCurrentUser()->getOrganizationId()); } } Modified: trunk/library/classes/Gems/Loader.php =================================================================== --- trunk/library/classes/Gems/Loader.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Loader.php 2011-11-14 17:51:04 UTC (rev 213) @@ -160,7 +160,20 @@ } /** + * Returns an organization object, initiated from the database. * + * @param int $organizationId Optional, uses current user when empty + * @return Gems_User_Organization + */ + public function getOrganization($organizationId = null) + { + $loader = $this->getUserLoader(); + + return $loader->getOrganization($organizationId); + } + + /** + * * @return Gems_Pdf */ public function getPdf() Modified: trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Layout/MultiLayoutInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,34 +1,41 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects using only multi layout * * But Gems_Project_Layout_MultiLayoutAbstract implements the functionality to use these functions. @@ -37,14 +44,25 @@ * * @see Gems_Project_Layout_SingleLayoutInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Layout_MultiLayoutInterface { + /** + * Returns an array with descriptions of the styles that can be used in this project. + * + * @return array styleKey => styleDescription + */ public function getStyles(); - public function layoutSwitch(Zend_Controller_Request_Abstract $request, $settings); + + /** + * Performs the actual switch of the layout + * + * @param Zend_Controller_Request_Abstract $request + */ + public function layoutSwitch(Zend_Controller_Request_Abstract $request); } \ No newline at end of file Modified: trunk/library/classes/Gems/Project/Layout/SingleLayoutInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Layout/SingleLayoutInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Layout/SingleLayoutInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,43 +1,50 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects using only a single layout * * @see Gems_Project_Layout_MultiLayoutInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Layout_SingleLayoutInterface { Modified: trunk/library/classes/Gems/Project/Log/LogRespondentAccessInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Log/LogRespondentAccessInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Log/LogRespondentAccessInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,41 +1,48 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - /** + * 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 Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects logging access to respondent data and their tokens * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Log_LogRespondentAccessInterface {} \ No newline at end of file Modified: trunk/library/classes/Gems/Project/Organization/MultiOrganizationInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Organization/MultiOrganizationInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Organization/MultiOrganizationInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,6 +1,5 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -26,6 +25,14 @@ * 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 Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ */ /** @@ -40,13 +47,12 @@ * * @see Gems_Project_Organization_SingleOrganizationInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Organization_MultiOrganizationInterface { - public function getUserOrganization(); } Modified: trunk/library/classes/Gems/Project/Organization/SingleOrganizationInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Organization/SingleOrganizationInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Organization/SingleOrganizationInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,34 +1,41 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects having respondents * in only one organization. * @@ -37,11 +44,11 @@ * * @see Gems_Project_Organization_MultiOrganizationInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Organization_SingleOrganizationInterface { Modified: trunk/library/classes/Gems/Project/Tracks/FixedTracksInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/FixedTracksInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/FixedTracksInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,45 +1,52 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects that use tracks that cannot be assigned by the user * (but are assigned by the system instead). * * @see Gems_Project_Tracks_MultiTracksInterface * @see Gems_Project_Tracks_SingleTrackInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_FixedTracksInterface { Modified: trunk/library/classes/Gems/Project/Tracks/MultiTracksInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/MultiTracksInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/MultiTracksInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,45 +1,52 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects that use tracks that be assigned at will by the user * to respondents. * * @see Gems_Project_Tracks_FixedTracksInterface * @see Gems_Project_Tracks_SingleTrackInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_MultiTracksInterface { Modified: trunk/library/classes/Gems/Project/Tracks/SingleTrackInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/SingleTrackInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/SingleTrackInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,33 +1,40 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + include_once('Gems/Project/Tracks/TracksOnlyInterface.php'); /** @@ -41,11 +48,11 @@ * @see Gems_Project_Tracks_FixedTracksInterface * @see Gems_Project_Tracks_MultiTracksInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_SingleTrackInterface extends Gems_Project_Tracks_TracksOnlyInterface { Modified: trunk/library/classes/Gems/Project/Tracks/StandAloneSurveysInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/StandAloneSurveysInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/StandAloneSurveysInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,44 +1,51 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects allowing single survey tracks * that are just shells for assinging a single survey. * * @see Gems_Project_Tracks_TracksOnlyInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_StandAloneSurveysInterface {} \ No newline at end of file Modified: trunk/library/classes/Gems/Project/Tracks/TracksOnlyInterface.php =================================================================== --- trunk/library/classes/Gems/Project/Tracks/TracksOnlyInterface.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/Project/Tracks/TracksOnlyInterface.php 2011-11-14 17:51:04 UTC (rev 213) @@ -1,45 +1,52 @@ <?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. + * + * + * @package Gems + * @subpackage Project + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id$ + */ + +/** * Marker interface for Pulse Projects NOT allowing the single survey tracks * allowed by Gems_Project_Tracks_StandAloneSurveysInterface (a nd that are just * shells for assinging a single survey). * * @see Gems_Project_Tracks_StandAloneSurveysInterface * - * @author Matijs de Jong <mj...@ma...> - * @since 1.1 - * @version 1.1 - * @package Gems + * @package Gems * @subpackage Project + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.1 */ interface Gems_Project_Tracks_TracksOnlyInterface {} \ No newline at end of file Added: trunk/library/classes/Gems/User/Organization.php =================================================================== --- trunk/library/classes/Gems/User/Organization.php (rev 0) +++ trunk/library/classes/Gems/User/Organization.php 2011-11-14 17:51:04 UTC (rev 213) @@ -0,0 +1,76 @@ +<?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 User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * Contains information on the organization of the current User + * + * @see Gems_Useer_User + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_User_Organization +{ + /** + * + * @var array + */ + protected $_organizationData; + + /** + * Creates the organization object. + * + * @param array $organizationData + */ + public function __construct(array $organizationData) + { + $this->_organizationData = $organizationData; + } + + /** + * Get the style attribute. + * + * @return string + */ + public function getStyle() + { + return $this->_organizationData['gor_style']; + } +} Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/User/User.php 2011-11-14 17:51:04 UTC (rev 213) @@ -32,7 +32,7 @@ * @author Matijs de Jong <mj...@ma...> * @copyright Copyright (c) 2011 Erasmus MC * @license New BSD License - * @version $Id$ + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ */ /** @@ -173,6 +173,22 @@ } /** + * Applies any setttings coming from the request object, e.g. processing cookies. + * + * @param Zend_Controller_Request_Abstract $request + * @return Gems_User_User (continuation pattern) + */ + public function applyRequest(Zend_Controller_Request_Abstract $request) + { + // MUtil_Echo::track($this->getOrganizationId(), Gems_Cookies::getOrganization($request)); + if (! $this->getOrganizationId()) { + $this->_setVar('user_organization_id', Gems_Cookies::getOrganization($request)); + } + + return $this; + } + + /** * Return true if a password reset key can be created. * * @return boolean Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/Gems/User/UserLoader.php 2011-11-14 17:51:04 UTC (rev 213) @@ -55,6 +55,20 @@ const USER_STAFF = 'StaffUser'; /** + * The default organization data for 'no organization'. + * + * @var array + */ + protected static $_noOrganization = array( + 'gor_id_organization' => 1, + 'gor_name' => 'NO ORGANIZATION', + 'gor_code' => null, + 'gor_style' => null, + 'gor_iso_lang' => 'en', + 'gor_active' => 0, + ); + + /** * 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. @@ -75,6 +89,12 @@ /** * + * @var Zend_Controller_Request_Abstract + */ + protected $request; + + /** + * * @var Zend_Session_Namespace */ protected $session; @@ -87,6 +107,13 @@ protected static $currentUser; /** + * Session storage of loaded organizations. + * + * @var Zend_Session_Namespace + */ + protected static $organizationStore; + + /** * Checks the password for the specified $login_name and $organization and * handles the login security. * @@ -209,6 +236,49 @@ } /** + * Returns an organization object, initiated from the database or from + * self::$_noOrganization when the database does not yet exist. + * + * @param int $organizationId Optional, uses current user when empty + * @return Gems_User_Organization + */ + public function getOrganization($organizationId = null) + { + if (! self::$organizationStore) { + self::$organizationStore = new Zend_Session_Namespace('gems.' . GEMS_PROJECT_NAME . '.organizations'); + } + + if (null === $organizationId) { + $organizationId = intval(self::$currentUser->getOrganizationId()); + } + + if (! self::$organizationStore->__isset($organizationId)) { + + // We are not sure the is a database at this moment + try { + $data = $this->db->fetchRow('SELECT * FROM gems__organizations WHERE gor_id_organization = ? LIMIT 1', $organizationId); + } catch (Zend_Db_Exception $e) { + $data = false; + } + if (! $data) { + // Use default + $data = self::$_noOrganization; + + // But do attempt to get the last added organization. + foreach (self::$organizationStore->getIterator() as $key => $value) { + if ($key !== 0) { + $organizationId = $key; + $data = self::$organizationStore->__get($key); + } + } + } + self::$organizationStore->__set($organizationId, $data); + } + + return new Gems_User_Organization(self::$organizationStore->__get($organizationId)); + } + + /** * Returns a user object, that may be empty if no user exist. * * @param string $login_name @@ -262,7 +332,9 @@ */ protected function getUserClassName($login_name, $organization) { - if (is_null($login_name) && is_null($organization)) return 'NoLoginDefinition'; + if ((null == $login_name) || (null == $organization)) { + return 'NoLoginDefinition'; + } if ($this->isProjectUser($login_name)) { return 'ProjectUserDefinition'; } Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-14 15:42:16 UTC (rev 212) +++ trunk/library/classes/GemsEscort.php 2011-11-14 17:51:04 UTC (rev 213) @@ -89,7 +89,7 @@ $firebug = $application->getOption('firebug'); $this->_startFirebird = $firebug['log']; - + Zend_Session::start( array( 'name' => GEMS_PROJECT_NAME_UC . 'SESSID', @@ -1064,21 +1064,7 @@ */ public function getCurrentOrganization() { - /* - if ($this instanceof Gems_Project_Organization_MultiOrganizationInterface) { - return $this->getUserOrganization(); - } - - if ($this instanceof Gems_Project_Organization_SingleOrganizationInterface) { - return $this->getRespondentOrganization(); - } - */ - - if (isset($this->session->user_organization_id)) { - return $this->session->user_organization_id; - } else { - return Gems_Cookies::getOrganization(Zend_Controller_Front::getInstance()->getRequest()); - } + return $this->getLoader()->getCurrentUser()->getOrganizationId(); } /** @@ -1357,7 +1343,7 @@ public function prepareController() { if ($this instanceof Gems_Project_Layout_MultiLayoutInterface) { - $this->layoutSwitch($this->request, $this->session); + $this->layoutSwitch($this->request); } } @@ -1448,7 +1434,8 @@ public function routeShutdown(Zend_Controller_Request_Abstract $request) { $loader = $this->getLoader(); - $user = $loader->getCurrentUser(); + $user = $loader->getCurrentUser() + ->applyRequest($request); // MUtil_Echo::r($request->getParams(), 'params'); // MUtil_Echo::r($request->getUserParams(), 'userparams'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |