From c6ff857fbd50b69cd090456fd6eba7592f12fb77 Mon Sep 17 00:00:00 2001 From: satish <satish.dvnk@vtiger.com> Date: Tue, 5 Sep 2017 10:42:50 +0530 Subject: [PATCH] Vtlib api to add settings link in CRM --- include/utils/VtlibUtils.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/utils/VtlibUtils.php b/include/utils/VtlibUtils.php index b7adac0b..4dae7198 100644 --- a/include/utils/VtlibUtils.php +++ b/include/utils/VtlibUtils.php @@ -771,8 +771,15 @@ function vtlib_addSettingsLink($linkName, $linkURL, $blockName = false) { //Check entry name exist in DB or not $result = $db->pquery('SELECT 1 FROM vtiger_settings_field WHERE name=?', array($linkName)); if ($result && !$db->num_rows($result)) { - $blockName = ($blockName) ? $blockName : 'LBL_OTHER_SETTINGS'; - $blockId = getSettingsBlockId($blockName);//Check block name exist in DB or not + $blockId = 0; + if ($blockName) { + $blockId = getSettingsBlockId($blockName);//Check block name exist in DB or not + } + + if (!$blockId) { + $blockName = 'LBL_OTHER_SETTINGS'; + $blockId = getSettingsBlockId($blockName);//Check block name exist in DB or not + } //Add block in to DB if not exists if (!$blockId) { -- GitLab