本文整理汇总了PHP中Vtiger_DetailView_Model类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_DetailView_Model类的具体用法?PHP Vtiger_DetailView_Model怎么用?PHP Vtiger_DetailView_Model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_DetailView_Model类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getActivities
/**
* Function to get activities
* @param Vtiger_Request $request
* @return <List of activity models>
*/
public function getActivities(Vtiger_Request $request)
{
$moduleName = 'Calendar';
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
if ($currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) {
$moduleName = $request->getModule();
$recordId = $request->get('record');
$pageNumber = $request->get('page');
if (empty($pageNumber)) {
$pageNumber = 1;
}
$pagingModel = new Vtiger_Paging_Model();
$pagingModel->set('page', $pageNumber);
$pagingModel->set('limit', 10);
if (!$this->record) {
$this->record = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
}
$recordModel = $this->record->getRecord();
$moduleModel = $recordModel->getModule();
$relatedActivities = $moduleModel->getCalendarActivities('', $pagingModel, 'all', $recordId);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('PAGING_MODEL', $pagingModel);
$viewer->assign('PAGE_NUMBER', $pageNumber);
$viewer->assign('ACTIVITIES', $relatedActivities);
return $viewer->view('RelatedActivities.tpl', $moduleName, true);
}
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:35,代码来源:Detail.php
示例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)
{
$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;
}
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:36,代码来源:DetailView.php
示例3: preProcess
public function preProcess(Vtiger_Request $request, $display=true) {
if($this->checkPermission($request)) {
$viewer = $this->getViewer($request);
$currentUser = Users_Record_Model::getCurrentUserModel();
$selectedModule = $request->getModule();
$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
$companyLogo = $companyDetails->getLogo();
$currentDate = Vtiger_Date_UIType::getDisplayDateValue(date('Y-n-j'));
$viewer->assign('CURRENTDATE', $currentDate);
$viewer->assign('MODULE', $selectedModule);
$viewer->assign('MODULE_NAME', $selectedModule);
$viewer->assign('QUALIFIED_MODULE', $selectedModule);
$viewer->assign('PARENT_MODULE', $request->get('parent'));
$viewer->assign('MENUS', Vtiger_Menu_Model::getAll(true));
$viewer->assign('VIEW', $request->get('view'));
$viewer->assign('COMPANY_LOGO',$companyLogo);
$viewer->assign('USER_MODEL', $currentUser);
$homeModuleModel = Vtiger_Module_Model::getInstance('Home');
$viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
$viewer->assign('HEADER_LINKS',$this->getHeaderLinks());
$viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
$viewer->assign('CHAT_ACTIVE', vtlib_isModuleActive('AJAXChat'));
//Additional parameters
$recordId = $request->get('record');
$moduleName = $request->getModule();
$detailViewModel = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
$recordModel = $detailViewModel->getRecord();
$detailViewLinkParams = array('MODULE'=>$moduleName,'RECORD'=>$recordId);
$detailViewLinks = $detailViewModel->getDetailViewLinks($detailViewLinkParams);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_MODEL', $detailViewModel->getModule());
$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
$viewer->assign('IS_EDITABLE', $detailViewModel->getRecord()->isEditable($moduleName));
$viewer->assign('IS_DELETABLE', $detailViewModel->getRecord()->isDeletable($moduleName));
$linkParams = array('MODULE'=>$moduleName, 'ACTION'=>$request->get('view'));
$linkModels = $detailViewModel->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $linkModels);
$viewer->assign('PAGETITLE', $this->getPageTitle($request));
$viewer->assign('FOOTER_SCRIPTS',$this->getFooterScripts($request));
$viewer->assign('STYLES',$this->getHeaderCss($request));
$viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
$viewer->assign('CURRENT_VIEW', $request->get('view'));
$viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
$viewer->assign('HTMLLANG', Vtiger_Language_Handler::getShortLanguageName());
$viewer->assign('LANGUAGE', $currentUser->get('language'));
$viewer->assign('HEADER_SCRIPTS',$this->getHeaderScripts($request));
if($display) {
$this->preProcessDisplay($request);
}
}
}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:55,代码来源:PreferenceDetail.php
示例4: getDetailViewRelatedLinks
function getDetailViewRelatedLinks()
{
$recordModel = $this->getRecord();
$moduleName = $recordModel->getModuleName();
$parentModuleModel = $this->getModule();
$relatedLinks = Vtiger_DetailView_Model::getDetailViewRelatedLinks();
$showPSTab = vtlib_isModuleActive('OutsourcedProducts') || vtlib_isModuleActive('Products') || vtlib_isModuleActive('Services') || vtlib_isModuleActive('OSSOutsourcedServices') || vtlib_isModuleActive('Assets') || vtlib_isModuleActive('OSSSoldServices');
if ($showPSTab) {
$relatedLinks[] = ['linktype' => 'DETAILVIEWTAB', 'linklabel' => vtranslate('LBL_RECORD_SUMMARY_PRODUCTS_SERVICES', $moduleName), 'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showRelatedProductsServices&requestMode=summary', 'linkicon' => '', 'linkKey' => 'LBL_RECORD_SUMMARY', 'related' => 'ProductsAndServices', 'countRelated' => true];
}
return $relatedLinks;
}
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:12,代码来源:DetailView.php
示例5: preProcess
public function preProcess(Vtiger_Request $request, $display = true)
{
if ($this->checkPermission($request)) {
$currentUser = Users_Record_Model::getCurrentUserModel();
$recordId = $request->get('record');
$moduleName = $request->getModule();
$detailViewModel = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
$recordModel = $detailViewModel->getRecord();
$detailViewLinkParams = array('MODULE' => $moduleName, 'RECORD' => $recordId);
$detailViewLinks = $detailViewModel->getDetailViewLinks($detailViewLinkParams);
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('MODULE_MODEL', $detailViewModel->getModule());
$viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
$viewer->assign('IS_EDITABLE', $detailViewModel->getRecord()->isEditable($moduleName));
$viewer->assign('IS_DELETABLE', $detailViewModel->getRecord()->isDeletable($moduleName));
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$linkModels = $detailViewModel->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $linkModels);
$viewer->assign('PAGETITLE', $this->getPageTitle($request));
$viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
$viewer->assign('STYLES', $this->getHeaderCss($request));
$viewer->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
$viewer->assign('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
$menuModelsList = Vtiger_Menu_Model::getAll(true);
$selectedModule = $request->getModule();
$menuStructure = Vtiger_MenuStructure_Model::getInstanceFromMenuList($menuModelsList, $selectedModule);
// Order by pre-defined automation process for QuickCreate.
uksort($menuModelsList, array('Vtiger_MenuStructure_Model', 'sortMenuItemsByProcess'));
$companyDetails = Vtiger_CompanyDetails_Model::getInstanceById();
$companyLogo = $companyDetails->getLogo();
$viewer->assign('CURRENTDATE', date('Y-n-j'));
$viewer->assign('MODULE', $selectedModule);
$viewer->assign('PARENT_MODULE', $request->get('parent'));
$viewer->assign('VIEW', $request->get('view'));
$viewer->assign('MENUS', $menuModelsList);
$viewer->assign('MENU_STRUCTURE', $menuStructure);
$viewer->assign('MENU_SELECTED_MODULENAME', $selectedModule);
$viewer->assign('MENU_TOPITEMS_LIMIT', $menuStructure->getLimit());
$viewer->assign('COMPANY_LOGO', $companyLogo);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$homeModuleModel = Vtiger_Module_Model::getInstance('Home');
$viewer->assign('HOME_MODULE_MODEL', $homeModuleModel);
$viewer->assign('HEADER_LINKS', $this->getHeaderLinks());
$viewer->assign('ANNOUNCEMENT', $this->getAnnouncement());
$viewer->assign('CURRENT_VIEW', $request->get('view'));
$viewer->assign('SKIN_PATH', Vtiger_Theme::getCurrentUserThemePath());
$viewer->assign('LANGUAGE', $currentUser->get('language'));
if ($display) {
$this->preProcessDisplay($request);
}
}
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:53,代码来源:PreferenceDetail.php
示例6: getHelpbox
public function getHelpbox(Vtiger_Request $request){
$viewer = $this->getViewer($request);
$wikiId = $request->get('id');
$detailViewModel = Vtiger_DetailView_Model::getInstance($moduleName, $wikiId);
$recordModel = $detailViewModel->getRecord();
$viewer->assign('MODULE_NAME', $request->getModule());
$viewer->assign('WIKI_ID', $wikiId);
$viewer->assign('WIKI_RECORD', $recordModel);
$viewer->view('Helpbox.tpl', $request->getModule());
}
开发者ID:Wasage,项目名称:werpa,代码行数:13,代码来源:Frames.php
示例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)
{
$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;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:57,代码来源:DetailView.php
示例8: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
$recordId = $request->get('record');
$moduleName = $request->getModule();
if (!$this->record) {
$this->record = Vtiger_DetailView_Model::getInstance($moduleName, $recordId);
}
$recordModel = $this->record->getRecord();
// To show recording link only if callstatus is 'completed'
if ($recordModel->get('callstatus') != 'completed') {
$recordModel->set('recordingurl', '');
}
return parent::preProcess($request, true);
}
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:14,代码来源:Detail.php
示例9: process
function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$id = $request->get('record');
$recordModel = Vtiger_DetailView_Model::getInstance($moduleName, $id)->getRecord();
$recordStrucure = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_DETAIL);
$structuredValues = $recordStrucure->getStructure();
$viewer = $this->getViewer($request);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('RECORD', $recordModel);
$viewer->assign('RECORD_STRUCTURE', $structuredValues);
$viewer->assign('RESTRICTS_ITEM', ['PLL_DISCARDED', 'PLL_ACCEPTED']);
$this->preProcess($request);
$viewer->view('Modal.tpl', $moduleName);
$this->postProcess($request);
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:16,代码来源:Modal.php
示例10: 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();
$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;
}
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:52,代码来源:DetailView.php
示例11: 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;
}
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:36,代码来源:DetailView.php
示例12: 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;
}
开发者ID:epsilonsc,项目名称:YetiForceCRM,代码行数:32,代码来源:DetailView.php
示例13: getWidgets
/**
* Function to get the detail view widgets
* @return <Array> - List of widgets , where each widget is an Vtiger_Link_Model
*/
public function getWidgets()
{
$userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
$widgetLinks = parent::getWidgets();
$widgets = array();
$helpDeskInstance = Vtiger_Module_Model::getInstance('HelpDesk');
if ($userPrivilegesModel->hasModuleActionPermission($helpDeskInstance->getId(), 'DetailView')) {
$createPermission = $userPrivilegesModel->hasModuleActionPermission($helpDeskInstance->getId(), 'EditView');
$widgets[] = array('linktype' => 'DETAILVIEWWIDGET', 'linklabel' => 'HelpDesk', 'linkName' => $helpDeskInstance->getName(), 'linkurl' => 'module=' . $this->getModuleName() . '&view=Detail&record=' . $this->getRecord()->getId() . '&relatedModule=HelpDesk&mode=showRelatedRecords&page=1&limit=5', 'action' => $createPermission == true ? array('Add') : array(), 'actionURL' => $helpDeskInstance->getQuickCreateUrl());
}
$projectMileStoneInstance = Vtiger_Module_Model::getInstance('ProjectMilestone');
if ($userPrivilegesModel->hasModuleActionPermission($projectMileStoneInstance->getId(), 'DetailView')) {
$createPermission = $userPrivilegesModel->hasModuleActionPermission($projectMileStoneInstance->getId(), 'EditView');
$widgets[] = array('linktype' => 'DETAILVIEWWIDGET', 'linklabel' => 'LBL_MILESTONES', 'linkName' => $projectMileStoneInstance->getName(), 'linkurl' => 'module=' . $this->getModuleName() . '&view=Detail&record=' . $this->getRecord()->getId() . '&relatedModule=ProjectMilestone&mode=showRelatedRecords&page=1&limit=5', 'action' => $createPermission == true ? array('Add') : array(), 'actionURL' => $projectMileStoneInstance->getQuickCreateUrl());
}
$projectTaskInstance = Vtiger_Module_Model::getInstance('ProjectTask');
if ($userPrivilegesModel->hasModuleActionPermission($projectTaskInstance->getId(), 'DetailView')) {
$createPermission = $userPrivilegesModel->hasModuleActionPermission($projectTaskInstance->getId(), 'EditView');
$widgets[] = array('linktype' => 'DETAILVIEWWIDGET', 'linklabel' => 'LBL_TASKS', 'linkName' => $projectTaskInstance->getName(), 'linkurl' => 'module=' . $this->getModuleName() . '&view=Detail&record=' . $this->getRecord()->getId() . '&relatedModule=ProjectTask&mode=showRelatedRecords&page=1&limit=5', 'action' => $createPermission == true ? array('Add') : array(), 'actionURL' => $projectTaskInstance->getQuickCreateUrl());
}
$documentsInstance = Vtiger_Module_Model::getInstance('Documents');
if ($userPrivilegesModel->hasModuleActionPermission($documentsInstance->getId(), 'DetailView')) {
$createPermission = $userPrivilegesModel->hasModuleActionPermission($documentsInstance->getId(), 'EditView');
$widgets[] = array('linktype' => 'DETAILVIEWWIDGET', 'linklabel' => 'Documents', 'linkName' => $documentsInstance->getName(), 'linkurl' => 'module=' . $this->getModuleName() . '&view=Detail&record=' . $this->getRecord()->getId() . '&relatedModule=Documents&mode=showRelatedRecords&page=1&limit=5', 'action' => $createPermission == true ? array('Add') : array(), 'actionURL' => $documentsInstance->getQuickCreateUrl());
}
foreach ($widgets as $widgetDetails) {
$widgetLinks[] = Vtiger_Link_Model::getInstanceFromValues($widgetDetails);
}
return $widgetLinks;
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:34,代码来源:DetailView.php
示例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();
$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;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:35,代码来源:DetailView.php
示例15: getDetailViewRelatedLinks
/**
* Function to get the detail view related links
* @return <array> - list of links parameters
*/
public function getDetailViewRelatedLinks()
{
$recordModel = $this->getRecord();
$moduleName = $recordModel->getModuleName();
$relatedLinks = parent::getDetailViewRelatedLinks();
$relatedLinks[] = array('linktype' => 'DETAILVIEWTAB', 'linklabel' => vtranslate('LBL_CHARTS', $moduleName), 'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showCharts&requestMode=charts', 'linkicon' => '', 'linkKey' => 'LBL_RECORD_SUMMARY', 'related' => 'Charts');
$relatedLinks[] = array('linktype' => 'DETAILVIEWTAB', 'linklabel' => vtranslate('LBL_GANTT', $moduleName), 'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showGantt', 'linkicon' => '', 'linkKey' => 'LBL_GANTT', 'related' => 'Gantt');
return $relatedLinks;
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:13,代码来源:DetailView.php
示例16: 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;
}
开发者ID:DeliveryPLANET,项目名称:vTiger,代码行数:16,代码来源:DetailView.php
示例17: 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;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:17,代码来源:DetailView.php
示例18: 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;
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:18,代码来源:DetailView.php
示例19: getDetailViewLinks
public function getDetailViewLinks($linkParams)
{
$linkModelList = parent::getDetailViewLinks($linkParams);
$recordModel = $this->getRecord();
$moduleName = $recordModel->getModuleName();
$lockEdit = Users_Privileges_Model::checkLockEdit($moduleName, $recordId);
$openRecord = Users_Priv
|
请发表评论