diff --git a/migration/20.03/2003.sql b/migration/20.03/2003.sql index d82d912be0d35bbac9bb48dc694615c73eb8ddb5..abf3c1b582702da2e33b6d7e32bd1a33459c9e8a 100644 --- a/migration/20.03/2003.sql +++ b/migration/20.03/2003.sql @@ -236,7 +236,7 @@ DO $$ BEGIN ALTER TABLE tags ADD COLUMN id serial NOT NULL; UPDATE tags SET id = tag_id; ALTER TABLE tags DROP COLUMN IF EXISTS tag_id; - + ALTER TABLE tags DROP COLUMN IF EXISTS entity_id_owner ALTER TABLE tags DROP COLUMN IF EXISTS description; ALTER TABLE tags ADD COLUMN description TEXT; ALTER TABLE tags DROP COLUMN IF EXISTS parent_id; @@ -247,16 +247,13 @@ DO $$ BEGIN ALTER TABLE tags ADD COLUMN links jsonb DEFAULT '[]'; ALTER TABLE tags DROP COLUMN IF EXISTS usage; ALTER TABLE tags ADD COLUMN usage TEXT; - END IF; -END$$; -DO $$ BEGIN - IF (SELECT count(attname) FROM pg_attribute WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'tag_res')) = 1 THEN DROP TABLE IF EXISTS resources_tags; ALTER TABLE tag_res ADD COLUMN id serial NOT NULL; ALTER TABLE tag_res RENAME TO resources_tags; END IF; END$$; + SELECT setval('tags_id_seq', (SELECT MAX(id) from tags)); DROP TABLE IF EXISTS tags_entities; diff --git a/modules/tags/class/TagControler_Abstract.php b/modules/tags/class/TagControler_Abstract.php index c3a164b345bca47cb7f0370a0cb9834846bb259c..436a0354204df83cae8a1cee1c2df8ce579ae4fc 100755 --- a/modules/tags/class/TagControler_Abstract.php +++ b/modules/tags/class/TagControler_Abstract.php @@ -594,8 +594,8 @@ abstract class tag_controler_Abstract extends ObjectControler {*/ $stmt = $db->query( "INSERT INTO " ._TAG_TABLE_NAME - . "(label, entity_id_owner) VALUES (?, ?)", - array($new_tag_label,$_SESSION['user']['primaryentity']['id']) + . "(label) VALUES (?, ?)", + array($new_tag_label) ); $tag_id = $db->lastInsertId('tags_id_seq'); diff --git a/modules/tags/manage_tag_list_controller.php b/modules/tags/manage_tag_list_controller.php index 2987ea6391e480db5a10dcb9852838e65397d892..1c29e4a1a62bec2f1cfb019bd554d66ae20ff3b6 100755 --- a/modules/tags/manage_tag_list_controller.php +++ b/modules/tags/manage_tag_list_controller.php @@ -187,13 +187,10 @@ function display_list() array_push( $select['tags'], 'id', 'label' ); - if ($_SESSION['user']['UserId'] == 'superadmin') { - $where = ''; - $where_what = array(); - } else { - $where = '(entity_id_owner = ? OR entity_id_owner IS NULL)'; - $where_what = array($_SESSION['user']['primaryentity']['id']); - } + + $where = ''; + $where_what = array(); + $what = ''; if (isset($_REQUEST['what'])) { diff --git a/sql/data_en.sql b/sql/data_en.sql index e698292a5a64ffe02416e77aea9752df109efa32..a3787361218415cf5e9679ba9ed3ac67b06e76f4 100644 --- a/sql/data_en.sql +++ b/sql/data_en.sql @@ -1057,19 +1057,19 @@ INSERT INTO templates_doctype_ext (template_id, type_id, is_generated) VALUES (9 --KEYWORDS / TAGS ------------ TRUNCATE TABLE tags; -INSERT INTO tags (label, entity_id_owner) VALUES ('SEMINAIRE', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('INNOVATION', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('MAARCH', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('ENVIRONNEMENT', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('PARTENARIAT', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('JUMELAGE', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('ECONOMIE', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('ASSOCIATIONS', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('RH', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('BUDGET', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('QUARTIERS', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('LITTORAL', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('SPORT', 'COU'); +INSERT INTO tags (label) VALUES ('SEMINAIRE'); +INSERT INTO tags (label) VALUES ('INNOVATION'); +INSERT INTO tags (label) VALUES ('MAARCH'); +INSERT INTO tags (label) VALUES ('ENVIRONNEMENT'); +INSERT INTO tags (label) VALUES ('PARTENARIAT'); +INSERT INTO tags (label) VALUES ('JUMELAGE'); +INSERT INTO tags (label) VALUES ('ECONOMIE'); +INSERT INTO tags (label) VALUES ('ASSOCIATIONS'); +INSERT INTO tags (label) VALUES ('RH'); +INSERT INTO tags (label) VALUES ('BUDGET'); +INSERT INTO tags (label) VALUES ('QUARTIERS'); +INSERT INTO tags (label) VALUES ('LITTORAL'); +INSERT INTO tags (label) VALUES ('SPORT'); TRUNCATE TABLE tags_entities; INSERT INTO tags_entities (tag_id, entity_id) VALUES (1, 'COU'); diff --git a/sql/data_fr.sql b/sql/data_fr.sql index 5540f05e9f2be5173cfa32b7106aba94147044da..cf9b11f76e650c6cb457f11feb074f46881ab575 100755 --- a/sql/data_fr.sql +++ b/sql/data_fr.sql @@ -1185,19 +1185,19 @@ Select setval('groupbasket_redirect_system_id_seq', (select max(system_id)+1 fro --KEYWORDS / TAGS ------------ TRUNCATE TABLE tags; -INSERT INTO tags (label, entity_id_owner) VALUES ('SEMINAIRE', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('INNOVATION', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('MAARCH', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('ENVIRONNEMENT', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('PARTENARIAT', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('JUMELAGE', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('ECONOMIE', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('ASSOCIATIONS', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('RH', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('BUDGET', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('QUARTIERS', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('LITTORAL', 'COU'); -INSERT INTO tags (label, entity_id_owner) VALUES ('SPORT', 'COU'); +INSERT INTO tags (label) VALUES ('SEMINAIRE'); +INSERT INTO tags (label) VALUES ('INNOVATION'); +INSERT INTO tags (label) VALUES ('MAARCH'); +INSERT INTO tags (label) VALUES ('ENVIRONNEMENT'); +INSERT INTO tags (label) VALUES ('PARTENARIAT'); +INSERT INTO tags (label) VALUES ('JUMELAGE'); +INSERT INTO tags (label) VALUES ('ECONOMIE'); +INSERT INTO tags (label) VALUES ('ASSOCIATIONS'); +INSERT INTO tags (label) VALUES ('RH'); +INSERT INTO tags (label) VALUES ('BUDGET'); +INSERT INTO tags (label) VALUES ('QUARTIERS'); +INSERT INTO tags (label) VALUES ('LITTORAL'); +INSERT INTO tags (label) VALUES ('SPORT'); ------------ ------------ diff --git a/sql/structure.sql b/sql/structure.sql index 6c6e97ad33a1a835b647a1bbe0abc2df130c972a..00f3b1e87c1a686363def5bfe57074e9899332b4 100755 --- a/sql/structure.sql +++ b/sql/structure.sql @@ -900,7 +900,6 @@ CREATE TABLE tags ( id serial NOT NULL, label character varying(128) NOT NULL, - entity_id_owner character varying(32), description text, parent_id INT, creation_date timestamp DEFAULT NOW(),