[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 88/119: Fix bug : follow up option contact ar
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 88/119: Fix bug : follow up option contact are not remove when document type changed |
Date: |
Mon, 26 Oct 2020 18:27:31 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit f2ae91ed7c93fd43457607c3951cf0b63d82a599
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Mon Oct 12 13:33:08 2020 +0200
Fix bug : follow up option contact are not remove when document type changed
---
include/class/action_document_type_mtable.class.php | 13 +++++++++++++
include/class/card_multiple.class.php | 7 ++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/include/class/action_document_type_mtable.class.php
b/include/class/action_document_type_mtable.class.php
index a48b98a..64c8c57 100644
--- a/include/class/action_document_type_mtable.class.php
+++ b/include/class/action_document_type_mtable.class.php
@@ -197,6 +197,19 @@ class Action_Document_Type_MTable extends Manage_Table_SQL
document_type_id is null
or document_type_id = $1
order by cor_label", [$this->table->dt_id]);
+
+ // delete unused option by the action_person_
+ $cn->exec_sql("delete from action_person_option where ap_id
in (select apo.ap_id
+ from action_person a
+ left join action_person_option apo ON
(a.ap_id=apo.action_person_id)
+ left join contact_option_ref cor on
(apo.contact_option_ref_id=cor.cor_id)
+ join action_gestion ag on (a.ag_id=ag.ag_id)
+ where
+ cor.cor_id not in (select jdoc2.contact_option_ref_id
+ from jnt_document_option_contact jdoc2
+ where jdoc2.document_type_id =$1
+ and jdoc2.jdoc_enable =1));
+ ",[$table->dt_id]);
}
// Detail option
diff --git a/include/class/card_multiple.class.php
b/include/class/card_multiple.class.php
index 60ed305..13ca09f 100644
--- a/include/class/card_multiple.class.php
+++ b/include/class/card_multiple.class.php
@@ -146,9 +146,10 @@ class Card_Multiple
// delete disable
$cn->exec_sql("delete
from action_person_option apo
- where contact_option_ref_id in
- (select contact_option_ref_id from jnt_document_option_contact
jdoc join action_gestion on (ag_type=document_type_id)
- where ag_id=$1 and jdoc_enable=0)",[$ag_id]);
+ where contact_option_ref_id not in
+ (select contact_option_ref_id from jnt_document_option_contact
jdoc join action_gestion on
+ (ag_type=document_type_id)
+ where ag_id=$1 and jdoc_enable=1)",[$ag_id]);
// First select the option
$sql="select ap_id,cor_id,ap_value,cor_type ,cor_label,cor_value_select
- [Noalyss-commit] [noalyss] 101/119: Grand livre waiting box, (continued)
- [Noalyss-commit] [noalyss] 101/119: Grand livre waiting box, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 107/119: Follow-Up : comment optional, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 108/119: fix SQL bug, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 113/119: Bug : create card failed, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 112/119: Cosmetic Follow Up add waiting box for search, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 114/119: Cosmetic & version, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 115/119: Analytic accountancy protect against divide by zero, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 82/119: Follow up search card, add a button to select all , cosmetic add qcode in dialog box for contact option, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 83/119: Bug : from VEN , cannot get the price, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 85/119: Follow-up fix order, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 88/119: Fix bug : follow up option contact are not remove when document type changed,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 99/119: Upgrade DB 147, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 102/119: remove dead code, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 106/119: Filter_Multiselect : make a search on select (multi-row), Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 104/119: Select_Box Add new position : absolute, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 111/119: Follow-Up improve search, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 110/119: Follow Up : an action can have several parents, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 119/119: Tache #0001859: PARAM/CFGDOC : icone fermer + bouton, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 116/119: Modern CheckBox, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 118/119: Fontello : fix icon-edit, Dany De Bontridder, 2020/10/26