From fb60db4018aebfbeb4413665b5445c8dc8aae4bb Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 11 Oct 2020 10:24:31 +0200 Subject: [PATCH] Fix : by default new contact options were not added to document_type --- include/class/action_document_type_mtable.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/class/action_document_type_mtable.class.php b/include/class/action_document_type_mtable.class.php index 03a7d2dbf..f02f56d7b 100644 --- a/include/class/action_document_type_mtable.class.php +++ b/include/class/action_document_type_mtable.class.php @@ -168,6 +168,18 @@ class Action_Document_Type_MTable extends Manage_Table_SQL // Detail option contact $table=$this->get_table(); $cn=$table->cn; + // insert new contact options + $cn->exec_sql("insert into jnt_document_option_contact (jdoc_enable,document_type_id, + contact_option_ref_id) + select 0 , $1, cor_id + from contact_option_ref + where + cor_id not in (select cor_id from + jnt_document_option_contact a + where a.document_type_id=$1)",[$table->dt_id]); + + // Select all + $aOption=$cn->get_array("select cor_id,cor_label,cor_type,document_type_id ,coalesce(jdoc_enable,0) jdoc_enable from contact_option_ref cor