From 87a77657b105c9783193fabe95cfe9999b4083c8 Mon Sep 17 00:00:00 2001 From: Laurent Giovannoni <laurent.giovannoni@maarch.org> Date: Mon, 16 Apr 2018 11:37:21 +0200 Subject: [PATCH] FIX #7559 pb with data model --- modules/attachments/remove_letterbox.php | 4 ++-- modules/attachments/xml/IVS/validation_rules.xml | 2 ++ sql/develop.sql | 5 +++++ sql/structure.sql | 10 +++++----- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/attachments/remove_letterbox.php b/modules/attachments/remove_letterbox.php index bb2d98d4ea3..f3a9914a5fa 100755 --- a/modules/attachments/remove_letterbox.php +++ b/modules/attachments/remove_letterbox.php @@ -21,7 +21,7 @@ $close_incoming = $_SESSION['modules_loaded']['attachments']['reconciliation'][' // Modification of the incoming document, as deleted \Resource\models\ResModel::update([ 'set' => ['status' => 'DEL'], - 'where' => ['res_id = (?)'], + 'where' => ['res_id = ?'], 'data' => [$res_id] ]); @@ -32,7 +32,7 @@ if($delete_response_project == 'true'){ \SrcCore\models\DatabaseModel::update([ 'set' => ['status' => 'DEL'], 'table' => $attachmentTable, - 'where' => ["res_id_master = (?) AND identifier = (?) AND status NOT IN ('DEL','TMP') AND attachment_type = 'response_project'"], + 'where' => ["res_id_master = ? AND identifier = ? AND status NOT IN ('DEL','TMP') AND attachment_type = 'response_project'"], 'data' => [$res_id_master[0], $tabFormValues['chrono_number']], ]); diff --git a/modules/attachments/xml/IVS/validation_rules.xml b/modules/attachments/xml/IVS/validation_rules.xml index 7eaa544c41c..87a61ff459b 100755 --- a/modules/attachments/xml/IVS/validation_rules.xml +++ b/modules/attachments/xml/IVS/validation_rules.xml @@ -29,6 +29,8 @@ <validationRule name="get_chrono_attachment" extends="standardForm" mode="error"> <parameter name="module" type="identifier" /> <parameter name="index" type="integer" /> + <parameter name="type_id" type="string" /> + <parameter name="attachment" type="string" /> </validationRule> <validationRule name="frame_list_attachments" extends="standardForm" mode="error"> diff --git a/sql/develop.sql b/sql/develop.sql index 558c40c3115..cdb84e5dd3e 100755 --- a/sql/develop.sql +++ b/sql/develop.sql @@ -139,6 +139,11 @@ DROP VIEW IF EXISTS res_view_letterbox; /* Alter table here because view depends on it*/ ALTER TABLE res_letterbox ALTER COLUMN priority TYPE character varying(16); +ALTER TABLE res_attachments ALTER COLUMN priority TYPE character varying(16); +ALTER TABLE res_x ALTER COLUMN priority TYPE character varying(16); +ALTER TABLE res_version_attachments ALTER COLUMN priority TYPE character varying(16); +ALTER TABLE res_version_letterbox ALTER COLUMN priority TYPE character varying(16); +ALTER TABLE res_version_x ALTER COLUMN priority TYPE character varying(16); --ALTER TABLE for external infos webservice ALTER TABLE res_letterbox DROP COLUMN IF EXISTS external_id; diff --git a/sql/structure.sql b/sql/structure.sql index bebc7e196e4..8188fb02eec 100755 --- a/sql/structure.sql +++ b/sql/structure.sql @@ -334,7 +334,7 @@ CREATE TABLE res_attachments work_batch bigint, origin character varying(50) DEFAULT NULL::character varying, is_ingoing character(1) DEFAULT NULL::bpchar, - priority smallint, + priority character varying(16), initiator character varying(50) DEFAULT NULL::character varying, dest_user character varying(128) DEFAULT NULL::character varying, coll_id character varying(32) NOT NULL, @@ -1416,7 +1416,7 @@ CREATE TABLE res_x work_batch bigint, origin character varying(50) DEFAULT NULL::character varying, is_ingoing character(1) DEFAULT NULL::bpchar, - priority smallint, + priority character varying(16), arbatch_id bigint DEFAULT NULL, policy_id character varying(32) DEFAULT NULL::character varying, cycle_id character varying(32) DEFAULT NULL::character varying, @@ -1742,7 +1742,7 @@ CREATE TABLE res_version_letterbox work_batch bigint, origin character varying(50) DEFAULT NULL::character varying, is_ingoing character(1) DEFAULT NULL::bpchar, - priority smallint, + priority character varying(16), arbatch_id bigint, policy_id character varying(32), cycle_id character varying(32), @@ -1857,7 +1857,7 @@ CREATE TABLE res_version_x work_batch bigint, origin character varying(50) DEFAULT NULL::character varying, is_ingoing character(1) DEFAULT NULL::bpchar, - priority smallint, + priority character varying(16), arbatch_id bigint, policy_id character varying(32), cycle_id character varying(32), @@ -2470,7 +2470,7 @@ CREATE TABLE res_version_attachments work_batch bigint, origin character varying(50) DEFAULT NULL::character varying, is_ingoing character(1) DEFAULT NULL::bpchar, - priority smallint, + priority character varying(16), arbatch_id bigint, policy_id character varying(32), cycle_id character varying(32), -- GitLab