log.debug "Il existe un paramétrage source pour les options"
}
- if (bulletinOptionsCible) {
-
- if (log.debugEnabled) {
- log.debug "Il existe un paramétrage cible pour les options"
- }
-
- // modifie les options de la classe cible
- copyProperties(bulletinOptionsSource, bulletinOptionsCible)
- enregistre(bulletinOptionsCible)
- } else {
+ if (!bulletinOptionsCible) {
bulletinOptionsCible = new BulletinOptions()
- copyProperties(bulletinOptionsSource, bulletinOptionsCible)
- bulletinOptionsCible.templateDocument = bulletinOptionsSource.templateDocument
- bulletinOptionsCible.classe = classeCible
- bulletinOptionsCible.portee = portee
- enregistre(bulletinOptionsCible)
}
+ copyProperties(bulletinOptionsSource, bulletinOptionsCible)
+
+ bulletinOptionsCible.classe = classeCible
+ bulletinOptionsCible.portee = portee
+ enregistre(bulletinOptionsCible)
} else {
// s'il existe un info cible on doit la supprimer
// on doit supprimer l'option cible
bulletinOptionsCible.delete()
}
-
}
-
}
/**
* Permet de copier les propriétés
*/
- private void copyProperties(BulletinOptions bulletinOptionsSource, BulletinOptions bulletinOptionsCible) {
+ private void copyProperties(BulletinOptions bulletinOptionsSource,
+ BulletinOptions bulletinOptionsCible) {
def id = bulletinOptionsCible.id
- BeanUtils.copyProperties(bulletinOptionsCible, bulletinOptionsSource)
+ BeanUtils.copyProperties(bulletinOptionsSource, bulletinOptionsCible)
bulletinOptionsCible.id = id
-
}
- private BulletinOptions findOrCree(StructureEnseignement classe, BulletinOptionsPortee portee) {
+ private BulletinOptions findOrCree(StructureEnseignement classe,
+ BulletinOptionsPortee portee) {
BulletinOptions bulletinOptions =
BulletinOptions.findByClasseAndPortee(classe, portee)
--- /dev/null
+<!--
+ ~ Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ ~ This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ ~
+ ~ Lilie is free software. You can redistribute it and/or modify since
+ ~ you respect the terms of either (at least one of the both license) :
+ ~ - under the terms of the GNU Affero General Public License as
+ ~ published by the Free Software Foundation, either version 3 of the
+ ~ License, or (at your option) any later version.
+ ~ - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ ~ License, or any later version
+ ~
+ ~ There are special exceptions to the terms and conditions of the
+ ~ licenses as they are applied to this software. View the full text of
+ ~ the exception in file LICENSE.txt in the directory of this software
+ ~ distribution.
+ ~
+ ~ Lilie is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ Licenses for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ and the CeCILL-C along with Lilie. If not, see :
+ ~ <http://www.gnu.org/licenses/> and
+ ~ <http://www.cecill.info/licences.fr.html>.
+ -->
+
+<databaseChangeLog
+ xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
+
+ <changeSet id="1" author="bper">
+ <comment>
+ Ajout des contraintes NOT NULL sur les colonnes 'largeur_matiere', 'taille_police', 'hauteur_du_bas' de la table 'impression.bulletin_options'
+ </comment>
+
+ <sql>
+ UPDATE impression.bulletin_options
+ SET largeur_matiere = 40
+ WHERE largeur_matiere IS NULL;
+
+ UPDATE impression.bulletin_options
+ SET taille_police = 8
+ WHERE taille_police IS NULL;
+
+ UPDATE impression.bulletin_options
+ SET hauteur_du_bas = 35
+ WHERE hauteur_du_bas IS NULL;
+ </sql>
+
+ <addNotNullConstraint schemaName="impression"
+ tableName="bulletin_options"
+ columnName="largeur_matiere" />
+
+ <addNotNullConstraint schemaName="impression"
+ tableName="bulletin_options"
+ columnName="taille_police" />
+
+ <addNotNullConstraint schemaName="impression"
+ tableName="bulletin_options"
+ columnName="hauteur_du_bas" />
+
+ </changeSet>
+
+</databaseChangeLog>