本文整理汇总了PHP中Vtiger_DetailView_Model::getDetailViewLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_DetailView_Model::getDetailViewLinks方法的具体用法?PHP Vtiger_DetailView_Model::getDetailViewLinks怎么用?PHP Vtiger_DetailView_Model::getDetailViewLinks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_DetailView_Model
的用法示例。
在下文中一共展示了Vtiger_DetailView_Model::getDetailViewLinks方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDetailViewLinks
/**
* 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;
}
示例2: getDetailViewLinks
/**
* 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;
}
示例3: getDetailViewLinks
/**
* 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;
}
示例4: getDetailViewLinks
/**
* 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;
}
示例5: getDetailViewLinks
/**
* 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;
}
示例6: getDetailViewLinks
/**
* 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;
}
示例7: getDetailViewLinks
/**
* 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;
}
示例8: getDetailViewLinks
/**
* 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;
}
示例9: getDetailViewLinks
/**
* 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;
}
示例10: getDetailViewLinks
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;
}
示例11: getDetailViewLinks
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;
}
示例12: getDetailViewLinks
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;
}
示例13: getDetailViewLinks
/**
* 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;
}
示例14: getDetailViewLinks
/**
* 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;
}
示例15: getDetailViewLinks
/**
* 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;
}