/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $invoiceModuleModel = Vtiger_Module_Model::getInstance('Invoice'); $quoteModuleModel = Vtiger_Module_Model::getInstance('Quotes'); if ($currentUserModel->hasModuleActionPermission($invoiceModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => '', 'linkurl' => $recordModel->getCreateInvoiceUrl(), 'linkicon' => 'glyphicon glyphicon-list-alt', 'title' => vtranslate('LBL_CREATE') . ' ' . vtranslate($invoiceModuleModel->getSingularLabelKey(), 'Invoice')); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } if ($currentUserModel->hasModuleActionPermission($quoteModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => '', 'linkurl' => $recordModel->getCreateQuoteUrl(), 'linkicon' => 'glyphicon glyphicon-briefcase', 'title' => vtranslate('LBL_CREATE') . ' ' . vtranslate($quoteModuleModel->getSingularLabelKey(), 'Quotes')); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $CalendarActionLinks[] = array(); $CalendarModuleModel = Vtiger_Module_Model::getInstance('Calendar'); if ($currentUserModel->hasModuleActionPermission($CalendarModuleModel->getId(), 'EditView')) { $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => '', 'linkurl' => $recordModel->getCreateEventUrl(), 'linkicon' => 'glyphicon glyphicon-time', 'title' => vtranslate('LBL_ADD_EVENT')); $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => '', 'linkurl' => $recordModel->getCreateTaskUrl(), 'linkicon' => 'glyphicon glyphicon-calendar', 'title' => vtranslate('LBL_ADD_TASK')); } foreach ($CalendarActionLinks as $basicLink) { $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $recordModel = $this->getRecord(); $linkModelList = parent::getDetailViewLinks($linkParams); $moduleModel = $this->getModule(); $recordId = $recordModel->getId(); //TODO: update the database so that these separate handlings are not required $index = 0; foreach ($linkModelList['DETAILVIEW'] as $link) { if ($link->linklabel == 'View History' || $link->linklabel == 'Send SMS') { unset($linkModelList['DETAILVIEW'][$index]); } else { if ($link->linklabel == 'LBL_SHOW_ACCOUNT_HIERARCHY') { $link->linklabel = 'LBL_SHOW_ACCOUNT_HIERARCHY'; $linkURL = 'index.php?module=Accounts&view=AccountHierarchy&record=' . $recordId; $link->linkurl = 'javascript:Accounts_Detail_Js.triggerAccountHierarchy("' . $linkURL . '");'; $link->linkclass = 'hierarchy'; unset($linkModelList['DETAILVIEW'][$index]); $linkModelList['DETAILVIEW'][$index] = $link; } } $index++; } if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'DetailTransferOwnership')) { $massActionLink = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_TRANSFER_OWNERSHIP', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerTransferOwnership("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=transferOwnership")', 'linkicon' => 'glyphicon glyphicon-random'); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); if ($recordModel->getActiveStatusOfRecord()) { $quotesModuleModel = Vtiger_Module_Model::getInstance('Quotes'); if ($currentUserModel->hasModuleActionPermission($quotesModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => '', 'linkurl' => $recordModel->getCreateQuoteUrl(), 'linkicon' => 'icon-briefcase', 'title' => vtranslate('LBL_CREATE') . ' ' . vtranslate($quotesModuleModel->getSingularLabelKey(), 'Quotes')); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $invoiceModuleModel = Vtiger_Module_Model::getInstance('Invoice'); if ($currentUserModel->hasModuleActionPermission($invoiceModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => '', 'linkurl' => $recordModel->getCreateInvoiceUrl(), 'linkicon' => 'icon-list-alt', 'title' => vtranslate('LBL_CREATE') . ' ' . vtranslate($invoiceModuleModel->getSingularLabelKey(), 'Invoice')); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $purchaseOrderModuleModel = Vtiger_Module_Model::getInstance('PurchaseOrder'); if ($currentUserModel->hasModuleActionPermission($purchaseOrderModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => '', 'linkurl' => $recordModel->getCreatePurchaseOrderUrl(), 'linkicon' => 'icon-barcode', 'title' => vtranslate('LBL_CREATE') . ' ' . vtranslate($purchaseOrderModuleModel->getSingularLabelKey(), 'PurchaseOrder')); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $salesOrderModuleModel = Vtiger_Module_Model::getInstance('SalesOrder'); if ($currentUserModel->hasModuleActionPermission($salesOrderModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => '', 'linkurl' => $recordModel->getCreateSalesOrderUrl(), 'linkicon' => 'icon-shopping-cart', 'title' => vtranslate('LBL_CREATE') . ' ' . vtranslate($salesOrderModuleModel->getSingularLabelKey(), 'SalesOrder')); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $invoiceModuleModel = Vtiger_Module_Model::getInstance('Invoice'); $quoteModuleModel = Vtiger_Module_Model::getInstance('Quotes'); if ($currentUserModel->hasModuleActionPermission($invoiceModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => vtranslate('LBL_CREATE') . ' ' . vtranslate($invoiceModuleModel->getSingularLabelKey(), 'Invoice'), 'linkurl' => $recordModel->getCreateInvoiceUrl(), 'linkicon' => ''); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } //$quote_id = $request->get('quote_id'); $salesOrderModuleModel = Vtiger_Module_Model::getInstance('SalesOrder'); if ($currentUserModel->hasModuleActionPermission($salesOrderModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => vtranslate('LBL_GENERATE') . ' ' . vtranslate($salesOrderModuleModel->getSingularLabelKey(), 'SalesOrder'), 'linkurl' => '/vtigercrm/index.php?module=salesOrder&view=Edit"e_id=' . $quote_id, 'linkicon' => ''); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } if ($currentUserModel->hasModuleActionPermission($quoteModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => vtranslate('LBL_CREATE') . ' ' . vtranslate($quoteModuleModel->getSingularLabelKey(), 'Quotes'), 'linkurl' => $recordModel->getCreateQuoteUrl(), 'linkicon' => ''); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $CalendarActionLinks[] = array(); $CalendarModuleModel = Vtiger_Module_Model::getInstance('Calendar'); if ($currentUserModel->hasModuleActionPermission($CalendarModuleModel->getId(), 'EditView')) { $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_EVENT', 'linkurl' => $recordModel->getCreateEventUrl(), 'linkicon' => ''); $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_TASK', 'linkurl' => $recordModel->getCreateTaskUrl(), 'linkicon' => ''); } foreach ($CalendarActionLinks as $basicLink) { $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $linkModelList = Vtiger_DetailView_Model::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $moduleModel = $this->getModule(); $moduleName = $moduleModel->getName(); $recordId = $recordModel->getId(); //TODO: update the database so that these separate handlings are not required $index = 0; foreach ($linkModelList['DETAILVIEW'] as $link) { if ($link->linklabel == 'View History' || $link->linklabel == 'Send SMS') { unset($linkModelList['DETAILVIEW'][$index]); } else { if ($link->linklabel == 'LBL_SHOW_ACCOUNT_HIERARCHY') { $link->linklabel = 'LBL_SHOW_ACCOUNT_HIERARCHY'; $linkURL = 'index.php?module=Accounts&view=AccountHierarchy&record=' . $recordId; $link->linkurl = 'javascript:Accounts_Detail_Js.triggerAccountHierarchy("' . $linkURL . '");'; unset($linkModelList['DETAILVIEW'][$index]); $linkModelList['DETAILVIEW'][$index] = $link; } } $index++; } if (Users_Privileges_Model::isPermitted($moduleModel->getName(), 'ConvertLead', $recordModel->getId()) && Users_Privileges_Model::isPermitted($moduleModel->getName(), 'EditView', $recordModel->getId())) { $convert = !Leads_Module_Model::checkIfAllowedToConvert($recordModel->get('leadstatus')) ? 'hide' : ''; $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkclass' => 'btn-info btn-convertLead ' . $convert, 'linkhint' => vtranslate('LBL_CONVERT_LEAD', $moduleName), 'linkurl' => 'javascript:Leads_Detail_Js.convertLead("' . $recordModel->getConvertLeadUrl() . '",this);', 'linkicon' => 'glyphicon glyphicon-transfer'); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $recordModel = $this->getRecord(); $linkModelList = parent::getDetailViewLinks($linkParams); unset($linkModelList['DETAILVIEWBASIC']); $linkModelDetailViewList = $linkModelList['DETAILVIEW']; $countOfList = count($linkModelDetailViewList); return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $moduleName = $recordModel->getmoduleName(); if (Users_Privileges_Model::isPermitted($moduleName, 'DetailView', $recordModel->getId())) { $sendEmailLink = array('linklabel' => '', 'linkurl' => 'javascript:Inventory_Detail_Js.sendEmailPDFClickHandler(\'' . $recordModel->getSendEmailPDFUrl() . '\')', 'linkicon' => 'icon-envelope', 'title' => vtranslate('LBL_SEND_MAIL_PDF', $moduleName)); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($sendEmailLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $quotesModuleModel = Vtiger_Module_Model::getInstance('Faq'); if ($currentUserModel->hasModuleActionPermission($quotesModuleModel->getId(), 'DetailView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_CONVERT_FAQ', 'linkurl' => $recordModel->getConvertFAQUrl(), 'linkicon' => ''); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $purchaseOrderModuleModel = Vtiger_Module_Model::getInstance('PurchaseOrder'); if ($currentUserModel->hasModuleActionPermission($purchaseOrderModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => vtranslate('LBL_CREATE') . ' ' . vtranslate($purchaseOrderModuleModel->getSingularLabelKey(), 'PurchaseOrder'), 'linkurl' => $recordModel->getCreatePurchaseOrderUrl(), 'linkicon' => 'glyphicon glyphicon-list-alt'); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
public function getDetailViewLinks($linkParams) { $linkModelList = parent::getDetailViewLinks($linkParams); $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $recordModel = $this->getRecord(); $moduleName = $recordModel->getmoduleName(); $targetModuleModel = Vtiger_Module_Model::getInstance('Calculations'); if ($currentUserModel->hasModuleActionPermission($targetModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkurl' => "index.php?module=" . $targetModuleModel->getName() . "&view=" . $targetModuleModel->getEditViewName() . "&reference_id=" . $recordModel->getId(), 'linkimg' => 'layouts/vlayout/skins/images/Calculations.png', 'linkclass' => 'btn-success', 'linkhint' => vtranslate('LBL_GENERATE_CALCULATIONS', 'RequirementCards')); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
public function getDetailViewLinks($linkParams) { $linkModelList = parent::getDetailViewLinks($linkParams); $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $recordModel = $this->getRecord(); $moduleName = $recordModel->getmoduleName(); $targetModuleModel = Vtiger_Module_Model::getInstance('RequirementCards'); if ($currentUserModel->hasModuleActionPermission($targetModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkurl' => "index.php?module=" . $targetModuleModel->getName() . "&view=" . $targetModuleModel->getEditViewName() . "&reference_id=" . $recordModel->getId(), 'linkicon' => 'glyphicon glyphicon-level-up', 'linkclass' => 'btn-success', 'title' => vtranslate('LBL_GENERATE_REQUIREMENTCARDS', 'QuotesEnquires')); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
public function getDetailViewLinks($linkParams) { $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $moduleName = $recordModel->getModuleName(); $lockEdit = Users_Privileges_Model::checkLockEdit($moduleName, $recordId); $openRecord = Users_Privileges_Model::isPermitted($moduleName, 'OpenRecord', $recordId); if (Users_Privileges_Model::isPermitted($moduleName, 'EditView', $recordId) && !$lockEdit || $openRecord) { $basicActionLink = ['linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_SET_RECORD_STATUS', 'linkurl' => '#', 'linkdata' => ['url' => $recordModel->getModalUrl()], 'linkicon' => 'glyphicon glyphicon-modal-window', 'linkclass' => 'showModal']; $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = Vtiger_DetailView_Model::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $moduleModel = $this->getModule(); $moduleName = $moduleModel->getName(); $recordId = $recordModel->getId(); $emailModuleModel = Vtiger_Module_Model::getInstance('OSSMail'); if ($currentUserModel->hasModulePermission($emailModuleModel->getId())) { $config = $emailModuleModel->getComposeParameters(); $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkurl' => $emailModuleModel->getComposeUrl($moduleName, $recordId, 'Detail', $config['popup']), 'linkicon' => 'glyphicon glyphicon-envelope', 'linktarget' => $config['target'], 'linkPopup' => $config['popup'], 'linkhint' => 'LBL_SEND_EMAIL'); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } //TODO: update the database so that these separate handlings are not required $index = 0; foreach ($linkModelList['DETAILVIEW'] as $link) { if ($link->linklabel == 'View History' || $link->linklabel == 'Send SMS') { unset($linkModelList['DETAILVIEW'][$index]); } else { if ($link->linklabel == 'LBL_SHOW_ACCOUNT_HIERARCHY') { $link->linklabel = 'LBL_SHOW_ACCOUNT_HIERARCHY'; $linkURL = 'index.php?module=Accounts&view=AccountHierarchy&record=' . $recordId; $link->linkurl = 'javascript:Accounts_Detail_Js.triggerAccountHierarchy("' . $linkURL . '");'; unset($linkModelList['DETAILVIEW'][$index]); $linkModelList['DETAILVIEW'][$index] = $link; } } $index++; } $CalendarActionLinks[] = array(); $CalendarModuleModel = Vtiger_Module_Model::getInstance('Calendar'); if ($currentUserModel->hasModuleActionPermission($CalendarModuleModel->getId(), 'EditView')) { $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_EVENT', 'linkurl' => $recordModel->getCreateEventUrl(), 'linkicon' => 'glyphicon glyphicon-time'); $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_TASK', 'linkurl' => $recordModel->getCreateTaskUrl(), 'linkicon' => 'glyphicon glyphicon-calendar'); } $SMSNotifierModuleModel = Vtiger_Module_Model::getInstance('SMSNotifier'); if (!empty($SMSNotifierModuleModel) && $currentUserModel->hasModulePermission($SMSNotifierModuleModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_SEND_SMS', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerSendSms("index.php?module=' . $this->getModule()->getName() . '&view=MassActionAjax&mode=showSendSMSForm","SMSNotifier");', 'linkicon' => 'glyphicon glyphicon-comment', 'title' => vtranslate('LBL_SEND_SMS')); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } foreach ($CalendarActionLinks as $basicLink) { $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink); } if (Users_Privileges_Model::isPermitted($moduleModel->getName(), 'ConvertLead', $recordModel->getId()) && Users_Privileges_Model::isPermitted($moduleModel->getName(), 'EditView', $recordModel->getId())) { $moduleInstance = CRMEntity::getInstance($moduleName); $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkclass' => 'btn-info', 'linkhint' => vtranslate('LBL_CONVERT_LEAD', $moduleName), 'linkurl' => 'javascript:Leads_Detail_Js.convertLead("' . $recordModel->getConvertLeadUrl() . '",this);', 'linkicon' => 'glyphicon glyphicon-transfer', 'linkgrupclass' => !in_array($recordModel->get('leadstatus'), $moduleInstance->conversion_available_status) ? 'hide' : ''); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $recordModel = $this->getRecord(); $linkModelList = parent::getDetailViewLinks($linkParams); $moduleModel = $this->getModule(); $moduleName = $moduleModel->getName(); $recordId = $recordModel->getId(); $emailModuleModel = Vtiger_Module_Model::getInstance('OSSMail'); if ($currentUserModel->hasModulePermission($emailModuleModel->getId())) { $config = $emailModuleModel->getComposeParameters(); $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkurl' => $emailModuleModel->getComposeUrl($moduleName, $recordId, 'Detail', $config['popup']), 'linkicon' => 'glyphicon glyphicon-envelope', 'linktarget' => $config['target'], 'linkPopup' => $config['popup'], 'linkhint' => vtranslate('LBL_SEND_EMAIL')); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } //TODO: update the database so that these separate handlings are not required $index = 0; foreach ($linkModelList['DETAILVIEW'] as $link) { if ($link->linklabel == 'View History' || $link->linklabel == 'Send SMS') { unset($linkModelList['DETAILVIEW'][$index]); } else { if ($link->linklabel == 'LBL_SHOW_ACCOUNT_HIERARCHY') { $link->linklabel = 'LBL_SHOW_ACCOUNT_HIERARCHY'; $linkURL = 'index.php?module=Accounts&view=AccountHierarchy&record=' . $recordId; $link->linkurl = 'javascript:Accounts_Detail_Js.triggerAccountHierarchy("' . $linkURL . '");'; unset($linkModelList['DETAILVIEW'][$index]); $linkModelList['DETAILVIEW'][$index] = $link; } } $index++; } $CalendarActionLinks = array(); $CalendarModuleModel = Vtiger_Module_Model::getInstance('Calendar'); if ($currentUserModel->hasModuleActionPermission($CalendarModuleModel->getId(), 'EditView')) { $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_EVENT', 'linkurl' => $recordModel->getCreateEventUrl(), 'linkicon' => 'glyphicon glyphicon-time'); $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_EVENT', 'linkurl' => $recordModel->getCreateTaskUrl(), 'linkicon' => 'glyphicon glyphicon-calendar'); } $SMSNotifierModuleModel = Vtiger_Module_Model::getInstance('SMSNotifier'); if (!empty($SMSNotifierModuleModel) && $currentUserModel->hasModulePermission($SMSNotifierModuleModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_SEND_SMS', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerSendSms("index.php?module=' . $moduleName . '&view=MassActionAjax&mode=showSendSMSForm","SMSNotifier");', 'linkicon' => 'glyphicon glyphicon-comment'); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'EditView')) { $massActionLink = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_TRANSFER_OWNERSHIP', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerTransferOwnership("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=transferOwnership")', 'linkicon' => 'glyphicon glyphicon-random'); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink); } foreach ($CalendarActionLinks as $basicLink) { $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { global $log; $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $emailModuleModel = Vtiger_Module_Model::getInstance('Emails'); $recordModel = $this->getRecord(); $linkModelList = parent::getDetailViewLinks($linkParams); if ($currentUserModel->hasModulePermission($emailModuleModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_SEND_EMAIL', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerSendEmail("index.php?module=' . $this->getModule()->getName() . '&view=MassActionAjax&mode=showComposeEmailForm&step=step1","Emails");', 'linkicon' => ''); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } //TODO: update the database so that these separate handlings are not required $index = 0; foreach ($linkModelList['DETAILVIEW'] as $link) { if ($link->linklabel == 'View History' || $link->linklabel == 'Send SMS') { unset($linkModelList['DETAILVIEW'][$index]); } else { if ($link->linklabel == 'LBL_SHOW_ACCOUNT_HIERARCHY') { $linkURL = 'index.php?module=Accounts&view=AccountHierarchy&record=' . $recordModel->getId(); $link->linkurl = 'javascript:Accounts_Detail_Js.triggerAccountHierarchy("' . $linkURL . '");'; unset($linkModelList['DETAILVIEW'][$index]); $linkModelList['DETAILVIEW'][$index] = $link; } } $index++; } $CalendarActionLinks = array(); $CalendarModuleModel = Vtiger_Module_Model::getInstance('Calendar'); if ($currentUserModel->hasModuleActionPermission($CalendarModuleModel->getId(), 'EditView')) { $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_EVENT', 'linkurl' => $recordModel->getCreateEventUrl(), 'linkicon' => ''); $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_TASK', 'linkurl' => $recordModel->getCreateTaskUrl(), 'linkicon' => ''); } $SMSNotifierModuleModel = Vtiger_Module_Model::getInstance('SMSNotifier'); if (!empty($SMSNotifierModuleModel) && $currentUserModel->hasModulePermission($SMSNotifierModuleModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_SEND_SMS', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerSendSms("index.php?module=' . $this->getModule()->getName() . '&view=MassActionAjax&mode=showSendSMSForm","SMSNotifier");', 'linkicon' => ''); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $moduleModel = $this->getModule(); if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'EditView')) { $massActionLink = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_TRANSFER_OWNERSHIP', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerTransferOwnership("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=transferOwnership")', 'linkicon' => ''); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink); } foreach ($CalendarActionLinks as $basicLink) { $log->debug("Entring getDatailViewLinks:13"); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $CalendarActionLinks[] = array(); $CalendarModuleModel = Vtiger_Module_Model::getInstance('Calendar'); if ($currentUserModel->hasModuleActionPermission($CalendarModuleModel->getId(), 'EditView')) { $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_EVENT', 'linkurl' => $recordModel->getCreateEventUrl(), 'linkicon' => ''); $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_TASK', 'linkurl' => $recordModel->getCreateTaskUrl(), 'linkicon' => ''); } foreach ($CalendarActionLinks as $basicLink) { $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink); } return $linkModelList; }
public function getDetailViewLinks($linkParams) { $log = vglobal('log'); $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '(' . $linkParams . ') method ...'); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $moduleName = $recordModel->getModuleName(); $lockEdit = Users_Privileges_Model::checkLockEdit($moduleName, $recordId); $openRecord = Users_Privileges_Model::isPermitted($moduleName, 'OpenRecord', $recordId); if (Users_Privileges_Model::isPermitted($moduleName, 'EditView', $recordId) && !$lockEdit || $openRecord) { $basicActionLink = ['linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_SET_RECORD_STATUS', 'linkurl' => '#', 'linkdata' => ['url' => $recordModel->getModalUrl()], 'linkicon' => 'glyphicon glyphicon-modal-window', 'linkclass' => 'showModal closeQERekord']; $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__ . ' method ...'); return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $moduleName = $recordModel->getModuleName(); $recordId = $recordModel->getId(); $status = $recordModel->get('activitystatus'); $statusActivity = Calendar_Module_Model::getComponentActivityStateLabel('current'); $lockEdit = Users_Privileges_Model::checkLockEdit($moduleName, $recordId); if (Users_Privileges_Model::isPermitted($moduleName, 'EditView', $recordId) && $currentUserModel->hasModuleActionPermission($this->getModule()->getId(), 'DetailView') && !$lockEdit && isPermitted($moduleName, 'ActivityComplete', $recordId) == 'yes' && isPermitted($moduleName, 'ActivityCancel', $recordId) == 'yes' && isPermitted($moduleName, 'ActivityPostponed', $recordId) == 'yes' && in_array($status, $statusActivity)) { $basicActionLink = ['linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_SET_RECORD_STATUS', 'linkurl' => '#', 'linkdata' => ['url' => $recordModel->getActivityStateModalUrl()], 'linkicon' => 'glyphicon glyphicon-ok', 'linkclass' => 'showModal closeCalendarRekord']; $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $moduleModel = $this->getModule(); $recordModel = $this->getRecord(); $emailModuleModel = Vtiger_Module_Model::getInstance('Emails'); $linkModelList = Vtiger_DetailView_Model::getDetailViewLinks($linkParams); if ($currentUserModel->hasModulePermission($emailModuleModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_SEND_EMAIL', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerSendEmail("index.php?module=' . $this->getModule()->getName() . '&view=MassActionAjax&mode=showComposeEmailForm&step=step1","Emails");', 'linkicon' => ''); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } //TODO: update the database so that these separate handlings are not required $index = 0; foreach ($linkModelList['DETAILVIEW'] as $link) { if ($link->linklabel == 'View History' || $link->linklabel == 'Send SMS') { unset($linkModelList['DETAILVIEW'][$index]); } else { if ($link->linklabel == 'LBL_SHOW_ACCOUNT_HIERARCHY') { $linkURL = 'index.php?module=Accounts&view=AccountHierarchy&record=' . $recordModel->getId(); $link->linkurl = 'javascript:Accounts_Detail_Js.triggerAccountHierarchy("' . $linkURL . '");'; unset($linkModelList['DETAILVIEW'][$index]); $linkModelList['DETAILVIEW'][$index] = $link; } } $index++; } $CalendarActionLinks[] = array(); $CalendarModuleModel = Vtiger_Module_Model::getInstance('Calendar'); if ($currentUserModel->hasModuleActionPermission($CalendarModuleModel->getId(), 'EditView')) { $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_EVENT', 'linkurl' => $recordModel->getCreateEventUrl(), 'linkicon' => ''); $CalendarActionLinks[] = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_ADD_TASK', 'linkurl' => $recordModel->getCreateTaskUrl(), 'linkicon' => ''); } $SMSNotifierModuleModel = Vtiger_Module_Model::getInstance('SMSNotifier'); if ($currentUserModel->hasModulePermission($SMSNotifierModuleModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_SEND_SMS', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerSendSms("index.php?module=' . $this->getModule()->getName() . '&view=MassActionAjax&mode=showSendSMSForm","SMSNotifier");', 'linkicon' => ''); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } foreach ($CalendarActionLinks as $basicLink) { $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink); } if (Users_Privileges_Model::isPermitted($moduleModel->getName(), 'ConvertLead', $recordModel->getId()) && Users_Privileges_Model::isPermitted($moduleModel->getName(), 'EditView', $recordModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_CONVERT_LEAD', 'linkurl' => 'Javascript:Leads_Detail_Js.convertLead("' . $recordModel->getConvertLeadUrl() . '",this);', 'linkicon' => ''); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $recordModel = $this->getRecord(); $linkModelList = parent::getDetailViewLinks($linkParams); unset($linkModelList['DETAILVIEWBASIC']); $linkModelDetailViewList = $linkModelList['DETAILVIEW']; $countOfList = count($linkModelDetailViewList); for ($i = 0; $i < $countOfList; $i++) { $linkModel = $linkModelDetailViewList[$i]; if ($linkModel->get('linklabel') == 'LBL_DUPLICATE') { unset($linkModelList['DETAILVIEW'][$i]); break; } } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $emailModuleModel = Vtiger_Module_Model::getInstance('Emails'); if ($currentUserModel->hasModulePermission($emailModuleModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_SEND_EMAIL', 'linkurl' => 'javascript:Vtiger_Detail_Js.triggerSendEmail("index.php?module=' . $this->getModule()->getName() . '&view=MassActionAjax&mode=showComposeEmailForm&step=step1","Emails");', 'linkicon' => ''); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $purchaseOrderModuleModel = Vtiger_Module_Model::getInstance('PurchaseOrder'); if ($currentUserModel->hasModuleActionPermission($purchaseOrderModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => vtranslate('LBL_CREATE') . ' ' . vtranslate($purchaseOrderModuleModel->getSingularLabelKey(), 'PurchaseOrder'), 'linkurl' => $recordModel->getCreatePurchaseOrderUrl(), 'linkicon' => ''); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $recordModel = $this->getRecord(); $linkModelList = parent::getDetailViewLinks($linkParams); unset($linkModelList['DETAILVIEWBASIC']); $linkModelDetailViewList = $linkModelList['DETAILVIEW']; $countOfList = count($linkModelDetailViewList); for ($i = 0; $i < $countOfList; $i++) { $linkModel = $linkModelDetailViewList[$i]; if ($linkModel->get('linklabel') == 'LBL_CHECK_STATUS') { $linkModelList['DETAILVIEW'][$i]->set('linklabel', vtranslate('LBL_CHECK_STATUS', 'SMSNotifier')); $linkModelList['DETAILVIEW'][$i]->set('linkurl', $recordModel->getCheckStatusUrl()); break; } } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); if ($recordModel->get('filestatus') && $recordModel->get('filename') && $recordModel->get('filelocationtype') === 'I') { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_DOWNLOAD_FILE', 'linkurl' => $recordModel->getDownloadFileURL(), 'linkicon' => 'glyphicon glyphicon-download-alt'); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_CHECK_FILE_INTEGRITY', 'linkurl' => $recordModel->checkFileIntegrityURL(), 'linkicon' => ' glyphicon glyphicon-file'); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); if ($recordModel->get('filestatus') && $recordModel->get('filename') && $recordModel->get('filelocationtype') === 'I') { $emailModuleModel = Vtiger_Module_Model::getInstance('Emails'); if ($currentUserModel->hasModulePermission($emailModuleModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => vtranslate('LBL_EMAIL_FILE_AS_ATTACHMENT', 'Documents'), 'linkurl' => "javascript:Documents_Detail_Js.triggerSendEmail('" . ZEND_JSON::encode(array($recordModel->getId())) . "')", 'linkicon' => 'glyphicon glyphicon-envelope'); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $moduleModel = $this->getModule(); $moduleName = $moduleModel->getName(); $recordId = $recordModel->getId(); $emailModuleModel = Vtiger_Module_Model::getInstance('OSSMail'); if ($currentUserModel->hasModulePermission($emailModuleModel->getId())) { $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkurl' => 'index.php?module=OSSMail&view=compose&mod=' . $moduleName . '&record=' . $recordId, 'linkicon' => 'icon-envelope', 'linktarget' => '_blank', 'title' => vtranslate('LBL_SEND_EMAIL')); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $purchaseOrderModuleModel = Vtiger_Module_Model::getInstance('PurchaseOrder'); if ($currentUserModel->hasModuleActionPermission($purchaseOrderModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => '', 'linkurl' => $recordModel->getCreatePurchaseOrderUrl(), 'linkicon' => 'icon-list-alt', 'title' => vtranslate('LBL_CREATE') . ' ' . vtranslate($purchaseOrderModuleModel->getSingularLabelKey(), 'PurchaseOrder')); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
/** * Function to get the detail view links (links and widgets) * @param <array> $linkParams - parameters which will be used to calicaulate the params * @return <array> - array of link models in the format as below * array('linktype'=>list of link models); */ public function getDetailViewLinks($linkParams) { $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); $linkModelList = parent::getDetailViewLinks($linkParams); $recordModel = $this->getRecord(); $moduleModel = $this->getModule(); $moduleName = $moduleModel->getName(); $recordId = $recordModel->getId(); $emailModuleModel = Vtiger_Module_Model::getInstance('OSSMail'); if ($currentUserModel->hasModulePermission($emailModuleModel->getId())) { $config = $emailModuleModel->getComposeParameters(); $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkurl' => $emailModuleModel->getComposeUrl($moduleName, $recordId, 'Detail', $config['popup']), 'linkicon' => 'glyphicon glyphicon-envelope', 'linktarget' => $config['target'], 'linkPopup' => $config['popup'], 'linkhint' => 'LBL_SEND_EMAIL'); $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } $purchaseOrderModuleModel = Vtiger_Module_Model::getInstance('PurchaseOrder'); if ($currentUserModel->hasModuleActionPermission($purchaseOrderModuleModel->getId(), 'EditView')) { $basicActionLink = array('linktype' => 'DETAILVIEW', 'linklabel' => vtranslate('LBL_CREATE') . ' ' . vtranslate($purchaseOrderModuleModel->getSingularLabelKey(), 'PurchaseOrder'), 'linkurl' => $recordModel->getCreatePurchaseOrderUrl(), 'linkicon' => 'glyphicon glyphicon-list-alt'); $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink); } return $linkModelList; }
public function getDetailViewLinks($linkParams) { $recordModel = $this->getRecord(); $linkModelList = parent::getDetailViewLinks($linkParams); //TODO: update the database so that these separate handlings are not required $index = 0; foreach ($linkModelList['DETAILVIEW'] as $link) { if ($link->linklabel == 'View History' || $link->linklabel == 'Send SMS') { unset($linkModelList['DETAILVIEW'][$index]); } else { if ($link->linklabel == 'LBL_SHOW_EMPLOYEES_HIERARCHY') { $linkURL = 'index.php?module=OSSEmployees&view=EmployeeHierarchy&record=' . $recordModel->getId(); $link->linkurl = 'javascript:OSSEmployees_Detail_Js.triggerEmployeeHierarchy("' . $linkURL . '");'; unset($linkModelList['DETAILVIEW'][$index]); $linkModelList['DETAILVIEW'][$index] = $link; } } $index++; } return $linkModelList; }