Skip to content
Snippets Groups Projects
Commit 06d60025 authored by Uma's avatar Uma
Browse files

Merge branch 'Clean_ModComments_On_RecordDelete' into 'master'

Fixes #167 Record deletion clean ModComments

See merge request !560
parents a9dbfc68 2f2ddd22
No related branches found
No related tags found
No related merge requests found
......@@ -149,6 +149,9 @@ class RecycleBin_Module_Model extends Vtiger_Module_Model {
$query = 'DELETE FROM vtiger_relatedlists_rb WHERE entityid in('.generateQuestionMarks($recordIds).')';
$db->pquery($query, array($recordIds));
// Delete related mod comments
$this->deleteRelatedComments($recordIds);
// TODO - Remove records from module tables and other related stores.
$query = 'DELETE FROM vtiger_modtracker_basic WHERE crmid in(' . generateQuestionMarks($recordIds) . ')';
......@@ -244,4 +247,13 @@ class RecycleBin_Module_Model extends Vtiger_Module_Model {
public function isQuickSearchEnabled() {
return true;
}
public function deleteRelatedComments($recordIds) {
$db = PearDatabase::getInstance();
$query = 'DELETE vtiger_crmentity.* FROM vtiger_crmentity '
. 'INNER JOIN vtiger_modcomments ON vtiger_modcomments.modcommentsid = vtiger_crmentity.crmid '
. 'WHERE vtiger_modcomments.related_to in(' . generateQuestionMarks($recordIds) . ')';
$db->pquery($query, array($recordIds));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment