From: <gem...@li...> - 2012-01-05 10:55:16
|
Revision: 396 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=396&view=rev Author: mennodekker Date: 2012-01-05 09:54:04 +0000 (Thu, 05 Jan 2012) Log Message: ----------- Fixed translation bug in form selects: When element was created and options added it didn't know about the translation status of the form it was being added to Modified Paths: -------------- trunk/library/classes/Gems/Default/GroupAction.php trunk/library/classes/Gems/Default/RoleAction.php trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/Gems/Default/GroupAction.php =================================================================== --- trunk/library/classes/Gems/Default/GroupAction.php 2012-01-05 09:27:33 UTC (rev 395) +++ trunk/library/classes/Gems/Default/GroupAction.php 2012-01-05 09:54:04 UTC (rev 396) @@ -1,35 +1,35 @@ <?php - -/** - * Copyright (c) 2011, Erasmus MC - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Erasmus MC nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - + /** + * Copyright (c) 2011, Erasmus MC + * All rights reserved. * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Erasmus MC nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * * @author Matijs de Jong * @since 1.0 * @version 1.1 @@ -62,7 +62,7 @@ $bridge->addHidden('ggp_id_group'); $bridge->addText('ggp_name', 'size', 15, 'minlength', 4, 'validator', $model->createUniqueValidator('ggp_name')); $bridge->addText('ggp_description', 'size', 40); - $bridge->addSelect('ggp_role', 'disableTranslator', true); + $bridge->addSelect('ggp_role'); $bridge->addCheckbox('ggp_group_active'); $bridge->addCheckbox('ggp_staff_members'); $bridge->addCheckbox('ggp_respondent_members'); Modified: trunk/library/classes/Gems/Default/RoleAction.php =================================================================== --- trunk/library/classes/Gems/Default/RoleAction.php 2012-01-05 09:27:33 UTC (rev 395) +++ trunk/library/classes/Gems/Default/RoleAction.php 2012-01-05 09:54:04 UTC (rev 396) @@ -77,9 +77,9 @@ $roles = $this->acl->getRoles(); $parents = array_combine($roles, $roles); - $bridge->addMultiCheckbox('grl_parents', 'disableTranslator', true, 'multiOptions', $parents, 'required', false); + $bridge->addMultiCheckbox('grl_parents', 'multiOptions', $parents, 'required', false); - $checkbox = $bridge->addMultiCheckbox('grl_privileges', 'disableTranslator', true, 'multiOptions', $this->getUsedPrivileges(), 'required', false); + $checkbox = $bridge->addMultiCheckbox('grl_privileges', 'multiOptions', $this->getUsedPrivileges(), 'required', false); //Get inherited privileges and disable tem $result = $this->escort->acl->getRolePrivileges(); Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-05 09:27:33 UTC (rev 395) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-05 09:54:04 UTC (rev 396) @@ -156,6 +156,12 @@ private function _mergeOptions($name, array $options, $allowedOptionKeys_array) { + //If not explicitly set, use the form value for translatorDisabled, since we + //create the element outside the form scope and later add it + if (!isset($options['disableTranslator'])) { + $options['disableTranslator'] = $this->form->translatorIsDisabled(); + } + $args = func_get_args(); $allowedOptionsKeys = MUtil_Ra::args($args, 2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |