From 97dc2b04fa2ffd796c26dd39c2fdbc7af3b6e5eb Mon Sep 17 00:00:00 2001 From: Etienne Pallier Date: Fri, 16 Jun 2017 10:33:37 +0200 Subject: [PATCH] dernieres petites modifs : amelioration js sur configuration/edit + update db (valeurs par défaut des booléens de la configuration) --- database/labinvent_2.6_09-06-17.sql | 35 +++++++++++++++++++++++++++++++++++ database/update/script_sql/db-update-2017-06-13-irap-only.sql | 14 +++++++++++--- src/Template/Configurations/edit.ctp | 5 ++--- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/database/labinvent_2.6_09-06-17.sql b/database/labinvent_2.6_09-06-17.sql index 6b0b56f..eb03abc 100644 --- a/database/labinvent_2.6_09-06-17.sql +++ b/database/labinvent_2.6_09-06-17.sql @@ -689,6 +689,41 @@ ALTER TABLE `users` ALTER TABLE `variables` ADD CONSTRAINT `fk_variables_formule_id` FOREIGN KEY (`formule_id`) REFERENCES `formules` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; +ALTER TABLE `configurations` +CHANGE `date_commande_facultative` `date_commande_facultative` TINYINT(1) NULL DEFAULT '0', +CHANGE `numero_labo_sans_annee` `numero_labo_sans_annee` TINYINT(1) NULL DEFAULT '0', +CHANGE `mode_install` `mode_install` TINYINT(1) NULL DEFAULT '1', +CHANGE `mode_debug` `mode_debug` TINYINT(1) NULL DEFAULT '0', +CHANGE `use_ldap` `use_ldap` TINYINT(1) NULL DEFAULT '0', +CHANGE `hasPrinter` `hasPrinter` TINYINT(1) NULL DEFAULT '0', +CHANGE `test` `test` TINYINT(1) NULL DEFAULT '0'; + + + +-- Insertion par défaut +Insert into type_suivis(nom) values ('Réparation'); +Insert into sites(id, nom) values (9, 'N/A'); + +Insert into type_documents(id, nom) values (1, 'N/A'); +Insert into type_documents(nom) values ('Bon de commande'); +Insert into type_documents(nom) values ('Bon de livraison'); +Insert into type_documents(nom) values ('Photo'); +Insert into type_documents(nom) values ('Documentation technique'); +Insert into type_documents(nom) values ('Spécifications'); +Insert into type_documents(nom) values ('CR de maintenance'); +Insert into type_documents(nom) values ('CR d\'étalonnage'); +Insert into type_documents(nom) values ('Suivi de panne'); +Insert into type_documents(nom) values ('Certificat de garantie'); +Insert into type_documents(nom) values ('Certificat de conformité'); +Insert into type_documents(nom) values ('Manuel d\'utilisation'); + +-- Insertion par défaut pour la table configuration +Insert into `configurations`(`nom`, `mode_install`, `mode_debug`, `use_ldap`, `host_ldap`, `port_ldap`, `authentificationType_ldap`, `baseDn_ldap`, `filter_ldap`, `labName`, `labNameShort`, `labPresent`, `labUmr`, `hasPrinter`, `emailGuest1`, `emailGuest2`, `emailGuest3`) +values ('default', '1', '0', '0', '', '', 'xxx', '', '', 'LABONAME', 'LABO', 'du ', '', '0', '', '', ''); + + + + /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/database/update/script_sql/db-update-2017-06-13-irap-only.sql b/database/update/script_sql/db-update-2017-06-13-irap-only.sql index fcb9904..51e7c95 100644 --- a/database/update/script_sql/db-update-2017-06-13-irap-only.sql +++ b/database/update/script_sql/db-update-2017-06-13-irap-only.sql @@ -288,8 +288,16 @@ ADD CONSTRAINT `fk_suivis_formule_id` -ALTER TABLE `configurations` ADD `envoi_mail_guests` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `envoi_mail` ; - ALTER TABLE `materiels` CHANGE `nom_gestionnaire` `gestionnaire_id` INT( 11 ) NULL ; -ALTER TABLE `configurations` ADD `procedure_sur_accueil` TINYINT( 1 ) NOT NULL DEFAULT '1'; \ No newline at end of file +ALTER TABLE `configurations` +ADD `envoi_mail_guests` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `envoi_mail`, +ADD `procedure_sur_accueil` TINYINT( 1 ) NOT NULL DEFAULT '1', +CHANGE `date_commande_facultative` `date_commande_facultative` TINYINT(1) NULL DEFAULT '0', +CHANGE `numero_labo_sans_annee` `numero_labo_sans_annee` TINYINT(1) NULL DEFAULT '0', +CHANGE `mode_install` `mode_install` TINYINT(1) NULL DEFAULT '1', +CHANGE `mode_debug` `mode_debug` TINYINT(1) NULL DEFAULT '0', +CHANGE `use_ldap` `use_ldap` TINYINT(1) NULL DEFAULT '0', +CHANGE `hasPrinter` `hasPrinter` TINYINT(1) NULL DEFAULT '0', +CHANGE `test` `test` TINYINT(1) NULL DEFAULT '0'; + diff --git a/src/Template/Configurations/edit.ctp b/src/Template/Configurations/edit.ctp index b30a484..b0395da 100644 --- a/src/Template/Configurations/edit.ctp +++ b/src/Template/Configurations/edit.ctp @@ -188,10 +188,9 @@ echo $this->element('menu_form', [ $(document).ready(function(){ $( ".form" ).submit(function( event ) { if($("#date-commande-facultative").is(':checked') && !$("#numero-labo-sans-annee").is(':checked')){ - alert("La case \"Numéro labo sans année\" dans la catégorie \Divers\" doit être cochée"); - $("#numero-labo-sans-annee").attr('required',true); + alert("La case \"Numéro labo sans année\" dans la catégorie \"Divers\" doit être cochée"); + //$("#numero-labo-sans-annee").attr('required',true); event.preventDefault(); - $("#numero-labo-sans-annee").attr('required',true); } }); }); -- libgit2 0.21.2