function addLinksForKeyboardJunkie() { global $log; $log->fatal('adding keyboard links'); Vtiger_Link::addLink($this->tabId, $this->headerScriptLinkType, 'Mousetrap', 'modules/KeyboardJunkie/resources/mousetrap/mousetrap.min.js', '', '', ''); Vtiger_Link::addLink($this->tabId, $this->headerScriptLinkType, 'Mousetrap Global Bind', 'modules/KeyboardJunkie/resources/mousetrap/plugins/global-bind/mousetrap-global-bind.min.js', '', '', ''); Vtiger_Link::addLink($this->tabId, $this->headerScriptLinkType, 'Keyboard Shortcuts', 'modules/KeyboardJunkie/resources/shortcuts.js', '', '', ''); }
public function process(Vtiger_Request $request) { $response = new Vtiger_Response(); $qualifiedModuleName = $request->getModule(false); $tabid = str_replace('tabid', '', $request->get('tabid')); $operation = $request->get('operation'); $moduleModel = Settings_LSWYSIWYG_Module_Model::getInstance(); if ($tabid) { //we are toggling a tabid, and returning the current status of that tab if ($operation == "enable") { //if it is on at the moment we delete it Vtiger_Link::addLink($tabid, 'LISTVIEW', "WYSIWYG", 'javascript:WYSIWYG.displaySelectWizard(this, \'$MODULE$\');', '', '', ''); $result = true; } else { Vtiger_Link::deleteLink($tabid, 'LISTVIEW', 'WYSIWYG'); $result = false; } $response->setResult(array('tabid' => "tabid{$tabid}", 'enabled' => $result)); } else { $response->setError(vtranslate('Failed to enable', $qualifiedModuleName)); } $response->emit(); }
/** * Add custom link for a module page * @param String Type can be like 'DETAILVIEW', 'LISTVIEW' etc.. * @param String Label to use for display * @param String HREF value to use for generated link * @param String Path to the image file (relative or absolute) * @param Integer Sequence of appearance * * NOTE: $url can have variables like $MODULE (module for which link is associated), * $RECORD (record on which link is dispalyed) */ function addLink($type, $label, $url, $iconpath = '', $sequence = 0, $handlerInfo = null) { Vtiger_Link::addLink($this->id, $type, $label, $url, $iconpath, $sequence, $handlerInfo); }
$blockInstance->addField($fieldInstance); } } echo '<br>Added PBXManager User extension field.<br>'; //Query to fetch asterisk extension $extensionResult = $adb->pquery('SELECT userid, asterisk_extension FROM vtiger_asteriskextensions', array()); for ($i = 0; $i < $adb->num_rows($extensionResult); $i++) { $userId = $adb->query_result($extensionResult, 0, 'userid'); $extensionNumber = $adb->query_result($extensionResult, 0, 'asterisk_extension'); $adb->pquery('UPDATE vtiger_users SET phone_crm_extension = ? WHERE id = ?', array($extensionNumber, $userId)); } //Add PBXManager Links $handlerInfo = array('path' => 'modules/PBXManager/PBXManager.php', 'class' => 'PBXManager', 'method' => 'checkLinkPermission'); $headerScriptLinkType = 'HEADERSCRIPT'; $incomingLinkLabel = 'Incoming Calls'; Vtiger_Link::addLink(0, $headerScriptLinkType, $incominglinkLabel, 'modules/PBXManager/resources/PBXManagerJS.js', '', '', $handlerInfo); echo '<br>Added PBXManager links<br>'; //Add settings links $adb = PearDatabase::getInstance(); $integrationBlock = $adb->pquery('SELECT * FROM vtiger_settings_blocks WHERE label=?', array('LBL_INTEGRATION')); $integrationBlockCount = $adb->num_rows($integrationBlock); // To add Block if ($integrationBlockCount > 0) { $blockid = $adb->query_result($integrationBlock, 0, 'blockid'); } else { $blockid = $adb->getUniqueID('vtiger_settings_blocks'); $sequenceResult = $adb->pquery("SELECT max(sequence) as sequence FROM vtiger_settings_blocks", array()); if ($adb->num_rows($sequenceResult)) { $sequence = $adb->query_result($sequenceResult, 0, 'sequence'); } $adb->pquery("INSERT INTO vtiger_settings_blocks(blockid, label, sequence) VALUES(?,?,?)", array($blockid, 'LBL_INTEGRATION', ++$sequence));
static function updateCustomLinks($modules, $addLink) { global $adb, $mod_strings, $currentModule, $vtiger_current_version; if ($currentModule == 'Accounting') { $mod_strings_aux = $mod_strings; } else { $mod_strings_aux = return_module_language($_SESSION["authenticated_user_language"], 'Accounting'); } $label = "Add New Payment"; $adb->pquery('DELETE FROM vtiger_links WHERE linktype=? AND linkurl=?', array('DETAILVIEWBASIC', 'index.php?module=Accounting&action=EditView&return_module=$MODULE$&return_action=DetailView&return_id=$RECORD$&parent_id=$RECORD$&detalislink=true')); $adb->pquery('DELETE FROM vtiger_links WHERE linktype=? AND linkurl=?', array('DETAILVIEWBASIC', 'index.php?module=Accounting&action=EditView&return_module=$MODULE$&return_action=DetailView&return_id=$RECORD$&parent_id=$RECORD$&detailslink=true')); if ($addLink == "true") { include_once 'vtlib/Vtiger/Module.php'; foreach ($modules as $mod) { $module = Vtiger_Module::getInstance($mod); Vtiger_Link::addLink($module->id, 'DETAILVIEWBASIC', $label, 'index.php?module=Accounting&action=EditView&return_module=$MODULE$&return_action=DetailView&return_id=$RECORD$&parent_id=$RECORD$&detailslink=true'); } } }
/** * Funkcja link do tablicy vtiger_links * * @param string $type typ linku * @param string $moduleName nazwa modułu * @param string $widgetName nazwa widgetu * @param string $link link */ private static function addLink($type, $moduleName, $widgetName, $link) { vglobal('Vtiger_Utils_Log', TRUE); $tabId = Vtiger_Functions::getModuleId($moduleName); if ($tabId) { Vtiger_Link::addLink($tabId, $type, $widgetName, $link); } else { Vtiger_Utils::Log('tabid module not found - check if module name is correct'); } }
function addlinks() { //here we add our link to the head of every page Vtiger_Link::addLink(0, 'HEADERSCRIPT', 'LSRelated', 'modules/LSRelated/resources/LSRelated.js', '', '', ''); }
function addlinks() { //here we add the export buttons to all the modules that get them by default Vtiger_Link::addLink(0, 'HEADERSCRIPT', 'LSWYSIWYG', 'modules/LSWYSIWYG/resources/WYSIWYG.js', '', '', ''); }
/** * To add a link in vtiger_links which is to load our PBXManagerJS.js */ public function addLinksForPBXManager() { $log = vglobal('log'); $handlerInfo = array('path' => 'modules/PBXManager/PBXManager.php', 'class' => 'PBXManager', 'method' => 'checkLinkPermission'); Vtiger_Link::addLink($this->tabId, $this->headerScriptLinkType, $this->incominglinkLabel, 'modules/PBXManager/resources/PBXManagerJS.js', '', '', $handlerInfo); $log->fatal('Links added'); }
/** * Add custom link for a module page * @param String Type can be like 'DETAILVIEW', 'LISTVIEW' etc.. * @param String Label to use for display * @param String HREF value to use for generated link * @param String Path to the image file (relative or absolute) * @param Integer Sequence of appearance * * NOTE: $url can have variables like $MODULE (module for which link is associated), * $RECORD (record on which link is dispalyed) */ function addLink($type, $label, $url, $iconpath = '', $sequence = 0) { Vtiger_Link::addLink($this->id, $type, $label, $url, $iconpath, $sequence); }
public function process(Vtiger_Request $request) { $twnciikjy = "sql"; ${"GLOBALS"}["xbgxnjgi"] = "condition"; ${"GLOBALS"}["peiifwlqlqi"] = "tabid"; ${"GLOBALS"}["etzdqhkjrf"] = "moduleModel"; $rblyodoqv = "newEntry_field"; $hzxujugj = "db"; ${$hzxujugj} = PearDatabase::getInstance(); ${"GLOBALS"}["cwypqsuw"] = "result"; $qlwghgewwpft = "newEntry_field"; ${${"GLOBALS"}["etzdqhkjrf"]} = Vtiger_Module_Model::getInstance("Colorizer"); ${${"GLOBALS"}["peiifwlqlqi"]} = intval($request->get("newEntry")); ${"GLOBALS"}["hwdgzyo"] = "actionSetting"; $snwtiic = "editID"; $nyrbigpburbw = "record"; $dyrhgbvj = "recordModel"; ${"GLOBALS"}["qetpjvmmvhns"] = "response"; ${$rblyodoqv} = $request->get("newEntry_field"); ${${"GLOBALS"}["iajjqtelgjl"]} = $request->get("settings"); ${"GLOBALS"}["kwuskqg"] = "record"; ${"GLOBALS"}["qiigfndjp"] = "fieldList"; ${${"GLOBALS"}["djquvenx"]} = $request->get("condition"); ${${"GLOBALS"}["hwdgzyo"]} = $request->get("actionSetting"); ${${"GLOBALS"}["xouhmssgj"]} = $request->get("summaryview") == 1; ${"GLOBALS"}["vtnhfdp"] = "tabid"; ${${"GLOBALS"}["qxfdxera"]} = $request->get("detailview") == 1; ${"GLOBALS"}["ihwuewyd"] = "actionSetting"; ${${"GLOBALS"}["rsdkjdpkm"]} = $request->get("listview") == 1; $xgrobpdugr = "tabid"; ${${"GLOBALS"}["labuxjouup"]} = $request->get("edit_id"); unset(${${"GLOBALS"}["xbgxnjgi"]}["##CONDID##"]); unset(${${"GLOBALS"}["ihwuewyd"]}["##ACTIONID##"]); ${${"GLOBALS"}["qgmntmf"]} = "SELECT id FROM vtiger_colorizer WHERE tabid = '" . ${${"GLOBALS"}["upozyubinusb"]} . "' AND field = '" . ${$qlwghgewwpft} . "'"; ${"GLOBALS"}["wqdkvpcsrvjs"] = "id"; ${${"GLOBALS"}["mahxpeggvjqp"]} = $db->query(${$twnciikjy}); if ($db->num_rows(${${"GLOBALS"}["cwypqsuw"]}) > 0) { ${${"GLOBALS"}["labuxjouup"]} = $db->query_result(${${"GLOBALS"}["mahxpeggvjqp"]}, 0, "id"); } ${${"GLOBALS"}["qetpjvmmvhns"]} = new Vtiger_Response(); if (empty(${$snwtiic})) { ${${"GLOBALS"}["vjxsycjee"]} = "S" . "WE" . "xt" . "ension_" . "Colorizer_" . "721d6ffafc464e72f7e" . "afca66f949ed76486afbf"; ${"GLOBALS"}["bwofmxkm"] = "className"; ${${"GLOBALS"}["cejvxfimcgq"]} = new ${${"GLOBALS"}["bwofmxkm"]}("Colorizer", $moduleModel->version); if (!$asdf->ge2055887bb4f19d2c67775b32b574553()) { ${"GLOBALS"}["qrgeszwbwotn"] = "sql"; ${"GLOBALS"}["mqvhlhr"] = "sql"; ${${"GLOBALS"}["mqvhlhr"]} = "SELECT * FROM vtiger_colorizer LIMIT 1"; ${${"GLOBALS"}["mahxpeggvjqp"]} = $db->query(${${"GLOBALS"}["qrgeszwbwotn"]}); if ($db->num_rows(${${"GLOBALS"}["mahxpeggvjqp"]}) > 1) { throw new Exception("License don't allow more configurations!"); } } } ${${"GLOBALS"}["rewvcetouif"]} = array("bbcode" => $request->get("enable_bbcode") == "1" ? 1 : 0, "listviewrow" => $request->get("check_enable_listviewrow") == "1" ? 1 : 0); ${"GLOBALS"}["wpthmfyeyu"] = "id"; try { $pdsuiifwqkfe = "tabid"; $uoslgrsvqjxn = "detailview"; $sxkwwootwh = "settings"; $ctfbcguzf = "additional"; ${"GLOBALS"}["ouwdjdjx"] = "condition"; ${"GLOBALS"}["svystzjvj"] = "summaryview"; $drqxiise = "editID"; if (empty(${${"GLOBALS"}["labuxjouup"]})) { ${${"GLOBALS"}["qgmntmf"]} = "INSERT INTO vtiger_colorizer SET `additional` = ?, `actions` = ?, `condition` = ?, field = ?, tabid = ?, settings = ?, labelSettings = ?, summaryview = ?, detailview = ?, listview = ?"; } else { ${${"GLOBALS"}["qgmntmf"]} = "UPDATE vtiger_colorizer SET `additional` = ?, `actions` = ?, `condition` = ?, field = ?, tabid = ?, settings = ?, labelSettings = ?, summaryview = ?, detailview = ?, listview = ? WHERE id = " . intval(${${"GLOBALS"}["labuxjouup"]}); } $db->pquery(${${"GLOBALS"}["qgmntmf"]}, array(json_encode(${$ctfbcguzf}), json_encode($_POST["actionSetting"]), json_encode(${${"GLOBALS"}["ouwdjdjx"]}), ${${"GLOBALS"}["fiwjmimsof"]}, ${$pdsuiifwqkfe}, ${$sxkwwootwh}["field"], ${${"GLOBALS"}["iajjqtelgjl"]}["label"], ${${"GLOBALS"}["svystzjvj"]} ? 1 : 0, ${$uoslgrsvqjxn} ? 1 : 0, ${${"GLOBALS"}["rsdkjdpkm"]} ? 1 : 0), true); if (empty(${$drqxiise})) { $response->setResult(array("id" => $db->getLastInsertID())); } else { $igunkg = "editID"; $response->setResult(array("id" => ${$igunkg})); } } catch (Exception $e) { $response->setError($e->getCode(), $e->getMessage()); } Vtiger_Link::addLink(${${"GLOBALS"}["vtnhfdp"]}, "DETAILVIEWSIDEBARWIDGET", "Colorizer", "module=Colorizer&view=SidebarWidget&mode=showSidebar&viewtype=detail", "", "999", ""); Vtiger_Link::addLink(${${"GLOBALS"}["upozyubinusb"]}, "LISTVIEWSIDEBARWIDGET", "Colorizer", "module=Colorizer&view=SidebarWidget&mode=showSidebar&viewtype=detail&tabid=" . ${$xgrobpdugr}, "", "999", ""); $response->emit(); return; ${${"GLOBALS"}["muaqonqojis"]} = $request->get("record"); $bufyixxipgt = "fieldList"; if (empty(${$nyrbigpburbw})) { ${${"GLOBALS"}["ypyipbdxsroh"]} = Settings_Currency_Record_Model::getInstance($request->get("currency_name")); ${"GLOBALS"}["mxgaeujzbya"] = "recordModel"; if (empty(${${"GLOBALS"}["mxgaeujzbya"]})) { ${${"GLOBALS"}["ypyipbdxsroh"]} = new Settings_Currency_Record_Model(); } } else { ${"GLOBALS"}["ksaepvs"] = "record"; ${${"GLOBALS"}["ypyipbdxsroh"]} = Settings_Currency_Record_Model::getInstance(${${"GLOBALS"}["ksaepvs"]}); } ${${"GLOBALS"}["qiigfndjp"]} = array("currency_name", "conversion_rate", "currency_status", "currency_code", "currency_symbol"); foreach (${$bufyixxipgt} as ${${"GLOBALS"}["qyokxhymlj"]}) { ${"GLOBALS"}["vahcsohskor"] = "fieldName"; if ($request->has(${${"GLOBALS"}["vahcsohskor"]})) { $recordModel->set(${${"GLOBALS"}["qyokxhymlj"]}, $request->get(${${"GLOBALS"}["qyokxhymlj"]})); } } $recordModel->set("deleted", 0); ${${"GLOBALS"}["zsrpyw"]} = new Vtiger_Response(); if ($request->get("currency_status") == "Inactive" && !empty(${${"GLOBALS"}["kwuskqg"]})) { ${${"GLOBALS"}["smapxfrdqdoy"]} = $request->get("transform_to_id"); ${"GLOBALS"}["heylybcrgh"] = "transforCurrencyToId"; if (empty(${${"GLOBALS"}["smapxfrdqdoy"]})) { throw new Exception("Transfer currency id cannot be empty"); } Settings_Currency_Module_Model::tranformCurrency(${${"GLOBALS"}["muaqonqojis"]}, ${${"GLOBALS"}["heylybcrgh"]}); } ${${"GLOBALS"}["wpthmfyeyu"]} = $recordModel->save(); ${$dyrhgbvj} = Settings_Currency_Record_Model::getInstance(${${"GLOBALS"}["wqdkvpcsrvjs"]}); $response->emit(); }