diff --git a/cosmogramme/sql/patch/patch_233.php b/cosmogramme/sql/patch/patch_233.php index 39e397625054af8bbc2052d3eead3678b29cc52c..08bb016d2e1a6b955367c3560f50d747b2865ead 100644 --- a/cosmogramme/sql/patch/patch_233.php +++ b/cosmogramme/sql/patch/patch_233.php @@ -1,12 +1,13 @@ <?php -$adapter = Zend_Registry::get('sql'); -$adapter->query("CREATE TABLE `permission` ( id INT(11) unsigned NOT NULL AUTO_INCREMENT, code varchar(255) NOT NULL, module varchar(255) NOT NULL, type varchar(255) NOT NULL, sorting int(11) NOT NULL, description text NULL, PRIMARY KEY (id), KEY (code), KEY (module), KEY (type), KEY (sorting)) ENGINE = MYISAM, character set=UTF8;"); +/* see patch 246 */ +/* $adapter = Zend_Registry::get('sql'); */ +/* $adapter->query("CREATE TABLE `permission` ( id INT(11) unsigned NOT NULL AUTO_INCREMENT, code varchar(255) NOT NULL, module varchar(255) NOT NULL, type varchar(255) NOT NULL, sorting int(11) NOT NULL, description text NULL, PRIMARY KEY (id), KEY (code), KEY (module), KEY (type), KEY (sorting)) ENGINE = MYISAM, character set=UTF8;"); */ -$adapter->query("insert into `permission` (code, module, type, sorting, description) values ('CATEGORY', 'ARTICLE', 'Droits', 1, 'Créer des sous-catégories et des articles'), ('ARTICLE', 'ARTICLE', 'Droits', 2, 'Créer des articles'), ('PENDING', 'ARTICLE', 'Nouveaux statuts autorisés', 1, 'À valider'), ('VALIDATED', 'ARTICLE', 'Nouveaux statuts autorisés', 101, 'Validé'), ('REFUSED', 'ARTICLE', 'Nouveaux statuts autorisés', 102, 'Refusé'), ('ARCHIVED', 'ARTICLE', 'Nouveaux statuts autorisés', 103, 'Archivé');"); +/* $adapter->query("insert into `permission` (code, module, type, sorting, description) values ('CATEGORY', 'ARTICLE', 'Droits', 1, 'Créer des sous-catégories et des articles'), ('ARTICLE', 'ARTICLE', 'Droits', 2, 'Créer des articles'), ('PENDING', 'ARTICLE', 'Nouveaux statuts autorisés', 1, 'À valider'), ('VALIDATED', 'ARTICLE', 'Nouveaux statuts autorisés', 101, 'Validé'), ('REFUSED', 'ARTICLE', 'Nouveaux statuts autorisés', 102, 'Refusé'), ('ARCHIVED', 'ARTICLE', 'Nouveaux statuts autorisés', 103, 'Archivé');"); */ -$adapter->query('CREATE TABLE `user_group_permission` ( id INT(11) unsigned NOT NULL AUTO_INCREMENT, id_group INT(11) unsigned NOT NULL, id_permission INT(11) unsigned NOT NULL, id_model INT(11) unsigned NOT NULL, model_class varchar(255) NOT NULL, PRIMARY KEY (id), KEY(id_group), KEY(id_permission), KEY(id_model), KEY(model_class)) ENGINE = MYISAM, character set=UTF8;'); +/* $adapter->query('CREATE TABLE `user_group_permission` ( id INT(11) unsigned NOT NULL AUTO_INCREMENT, id_group INT(11) unsigned NOT NULL, id_permission INT(11) unsigned NOT NULL, id_model INT(11) unsigned NOT NULL, model_class varchar(255) NOT NULL, PRIMARY KEY (id), KEY(id_group), KEY(id_permission), KEY(id_model), KEY(model_class)) ENGINE = MYISAM, character set=UTF8;'); */ -$adapter->query("UPDATE `user_group_categorie` SET `libelle` = 'Général' WHERE `user_group_categorie`.`libelle` = 'Catégorie par défaut' LIMIT 1;"); +/* $adapter->query("UPDATE `user_group_categorie` SET `libelle` = 'Général' WHERE `user_group_categorie`.`libelle` = 'Catégorie par défaut' LIMIT 1;"); */ -$adapter->query("ALTER TABLE `user_groups` add column `id_bib` INT(11) NOT NULL DEFAULT '0', add key `id_bib` (`id_bib`);"); +/* $adapter->query("ALTER TABLE `user_groups` add column `id_bib` INT(11) NOT NULL DEFAULT '0', add key `id_bib` (`id_bib`);"); */ ?> diff --git a/cosmogramme/sql/patch/patch_237.php b/cosmogramme/sql/patch/patch_237.php index 232df963a209958ddfee57df2603187d7bbf0951..ee8dac36f5f4414bc2fe8175c2239ec1396ace2a 100644 --- a/cosmogramme/sql/patch/patch_237.php +++ b/cosmogramme/sql/patch/patch_237.php @@ -1,4 +1,9 @@ <?php $adapter = Zend_Db_Table_Abstract::getDefaultAdapter(); -$adapter->query("ALTER TABLE album ADD status tinyint(1) unsigned DEFAULT NULL"); \ No newline at end of file + +try { + $adapter->query("select status from album"); +} catch (Exception $e) { + $adapter->query("ALTER TABLE album ADD status tinyint(1) unsigned DEFAULT NULL"); +} \ No newline at end of file diff --git a/cosmogramme/sql/patch/patch_239.php b/cosmogramme/sql/patch/patch_239.php index 69e32aab073cd84083322b1297ddc97cd2d0d76c..43328136ee85bfd901521758a638cad933da4876 100644 --- a/cosmogramme/sql/patch/patch_239.php +++ b/cosmogramme/sql/patch/patch_239.php @@ -1,6 +1,6 @@ <?php $adapter = Zend_Registry::get('sql'); -$adapter->query('CREATE TABLE `harvest_log` ( ' +$adapter->query('CREATE TABLE if not exists `harvest_log` ( ' . 'id int(11) unsigned not null auto_increment,' . '`type_doc` int(11) not null,' . '`end_date` varchar(10) not null,' diff --git a/cosmogramme/sql/patch/patch_242.php b/cosmogramme/sql/patch/patch_242.php index c4239c7dcc4542b40df8bf48b4cdaf0e49093f30..bdcfa4388a923d508bca7104a56aac2b958a2011 100644 --- a/cosmogramme/sql/patch/patch_242.php +++ b/cosmogramme/sql/patch/patch_242.php @@ -1,5 +1,5 @@ <?php -Zend_Registry::get('sql')->query('CREATE TABLE `album_item` ( ' +Zend_Registry::get('sql')->query('CREATE TABLE if not exists `album_item` ( ' . 'id int(11) unsigned not null auto_increment,' . 'album_id int(11) unsigned not null,' . 'loan_count int(11) not null,' diff --git a/cosmogramme/sql/patch/patch_243.php b/cosmogramme/sql/patch/patch_243.php index c53f43d24ad4208102f45aa54115d74b7c6a131c..a2bf5d1bf6ca7cf0166fdc9388739a81c0f2737c 100644 --- a/cosmogramme/sql/patch/patch_243.php +++ b/cosmogramme/sql/patch/patch_243.php @@ -1,5 +1,5 @@ <?php -Zend_Registry::get('sql')->query('CREATE TABLE `loan_pnb` ( ' +Zend_Registry::get('sql')->query('CREATE TABLE if not exists `loan_pnb` ( ' . 'id int(11) unsigned not null auto_increment,' . 'record_origin_id varchar(50) not null,' . 'subscriber_id varchar(20) not null,' diff --git a/cosmogramme/sql/patch/patch_245.php b/cosmogramme/sql/patch/patch_245.php index f955190452f70fb0e823054a276d7bab07d9df62..d04697b60d991d451bcd70384f23f979f6b2c2d0 100644 --- a/cosmogramme/sql/patch/patch_245.php +++ b/cosmogramme/sql/patch/patch_245.php @@ -1,4 +1,9 @@ <?php -Zend_Db_Table::getDefaultAdapter() - ->query('alter table codif_thesaurus add column rules varchar(250)'); +$adapter = Zend_Db_Table::getDefaultAdapter(); + +try { + $adapter->query('select rules from codif_thesaurus'); +} catch (Exception $e) { + $adapter->query('alter table codif_thesaurus add column rules varchar(250)'); +} ?> \ No newline at end of file diff --git a/cosmogramme/sql/patch/patch_257.php b/cosmogramme/sql/patch/patch_257.php index 9ba6fa116435d5f54b649657235a69010333f3ce..4c700ae77c57a91be4c06b24a632df4289ea74bb 100644 --- a/cosmogramme/sql/patch/patch_257.php +++ b/cosmogramme/sql/patch/patch_257.php @@ -1,5 +1,10 @@ <?php -$adapter = Zend_Registry::get('sql'); -$adapter->query('ALTER TABLE reservations ADD COLUMN rang tinyint'); +$adapter = Zend_Db_Table::getDefaultAdapter(); + +try { + $adapter->query('select rang from reservations limit 1'); +} catch (Exception $e) { + $adapter->query('ALTER TABLE reservations ADD COLUMN rang tinyint'); +} $adapter->query('ALTER TABLE reservations modify date_resa datetime default null'); ?> \ No newline at end of file diff --git a/library/startup.php b/library/startup.php index c10fd21e04af32cfd8cb9ce4b15507b7a1ad93f4..e4cc6cfe015bfd01a13e7c8d3a33d02163f7167b 100644 --- a/library/startup.php +++ b/library/startup.php @@ -64,7 +64,7 @@ function defineConstant($name, $value) { function setupConstants() { defineConstant('BOKEH_MAJOR_VERSION','7.2'); - defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.0'); + defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.2'); defineConstant('ROOT_PATH', realpath(dirname(__FILE__).'/..').'/'); @@ -73,7 +73,7 @@ function setupConstants() { defineConstant('MODULEDIRECTORY', ROOT_PATH . 'application/modules'); defineConstant('LANG_DIR', ROOT_PATH . 'library/translation/'); - defineConstant('USERFILESPATH', ROOT_PATH . 'userfiles'); + defineConstant('USERFILESPATH', './userfiles'); defineConstant('USERFILESURL', BASE_URL . '/userfiles/'); defineConstant('PATH_TEMP', ROOT_PATH . 'temp/');