当前位置: 首页>>代码示例>>PHP>>正文


PHP Users_Privileges_Model::getCurrentUserPrivilegesModel方法代码示例

本文整理汇总了PHP中Users_Privileges_Model::getCurrentUserPrivilegesModel方法的典型用法代码示例。如果您正苦于以下问题:PHP Users_Privileges_Model::getCurrentUserPrivilegesModel方法的具体用法?PHP Users_Privileges_Model::getCurrentUserPrivilegesModel怎么用?PHP Users_Privileges_Model::getCurrentUserPrivilegesModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Users_Privileges_Model的用法示例。


在下文中一共展示了Users_Privileges_Model::getCurrentUserPrivilegesModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getListViewMassActions

 /**
  * Function to get the list of Mass actions for the module
  * @param <Array> $linkParams
  * @return <Array> - Associative array of Link type to List of  Vtiger_Link_Model instances for Mass Actions
  */
 public function getListViewMassActions($linkParams)
 {
     $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     $moduleModel = $this->getModule();
     $linkTypes = array('LISTVIEWMASSACTION');
     $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
     $massActionLinks = [];
     if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassEdit')) {
         $massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MASS_EDIT', 'linkurl' => 'javascript:Vtiger_List_Js.triggerMassEdit("index.php?module=' . $moduleModel->get('name') . '&view=MassActionAjax&mode=showMassEditForm");', 'linkicon' => '');
     }
     if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassDelete')) {
         $massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MASS_DELETE', 'linkurl' => 'javascript:Vtiger_List_Js.massDeleteRecords("index.php?module=' . $moduleModel->get('name') . '&action=MassDelete");', 'linkicon' => '');
     }
     $modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
     if ($moduleModel->isCommentEnabled() && $modCommentsModel->isPermitted('EditView') && $currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassAddComment')) {
         $massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MASS_ADD_COMMENT', 'linkurl' => 'index.php?module=' . $moduleModel->get('name') . '&view=MassActionAjax&mode=showAddCommentForm', 'linkicon' => '');
     }
     if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassTransferOwnership')) {
         $massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_TRANSFER_OWNERSHIP', 'linkurl' => 'javascript:Vtiger_List_Js.triggerTransferOwnership("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=transferOwnership")', 'linkicon' => '');
     }
     if ($linkParams['MODULE'] == 'Users' && $linkParams['ACTION'] == 'List' && is_admin($currentUserModel)) {
         $massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MASS_PWD_EDIT', 'linkurl' => 'javascript:Settings_Users_List_Js.triggerEditPasswords("index.php?module=Users&view=EditAjax&mode=editPasswords", "' . $linkParams['MODULE'] . '")', 'linkicon' => '');
     }
     foreach ($massActionLinks as $massActionLink) {
         $links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
     }
     return $links;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:33,代码来源:ListView.php

示例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;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:35,代码来源:DetailView.php

示例4: getAll

 /**
  * Static Function to get all the accessible menu models with/without ordering them by sequence
  * @param <Boolean> $sequenced - true/false
  * @return <Array> - List of Vtiger_Menu_Model instances
  */
 public static function getAll($sequenced = false)
 {
     global $log;
     $log->debug("Entering ./models/Menu.php::staticgetAll");
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     $restrictedModulesList = array('Emails', 'ProjectMilestone', 'ProjectTask', 'ModComments', 'ExtensionStore', 'ExtensionStorePro', 'Integration', 'Dashboard', 'Home', 'vtmessages', 'vttwitter');
     $allModules = parent::getAll(array('0', '2'));
     $menuModels = array();
     $moduleSeqs = array();
     $moduleNonSeqs = array();
     foreach ($allModules as $module) {
         if ($module->get('tabsequence') != -1) {
             $moduleSeqs[$module->get('tabsequence')] = $module;
         } else {
             $moduleNonSeqs[] = $module;
         }
     }
     ksort($moduleSeqs);
     $modules = array_merge($moduleSeqs, $moduleNonSeqs);
     foreach ($modules as $module) {
         if (($userPrivModel->isAdminUser() || $userPrivModel->hasGlobalReadPermission() || $userPrivModel->hasModulePermission($module->getId())) & !in_array($module->getName(), $restrictedModulesList) && $module->get('parent') != '') {
             $menuModels[$module->getName()] = $module;
         }
     }
     return $menuModels;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:32,代码来源:Menu.php

示例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)
 {
     $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

示例6: 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

示例7: getListViewMassActions

 /**
  * Function to get the list of Mass actions for the module
  * @param <Array> $linkParams
  * @return <Array> - Associative array of Link type to List of  Vtiger_Link_Model instances for Mass Actions
  */
 public function getListViewMassActions($linkParams)
 {
     $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     $moduleModel = $this->getModule();
     $linkTypes = array('LISTVIEWMASSACTION');
     $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
     //Opensource fix to make documents module mass editable
     $massActionLinks = [];
     if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassEdit')) {
         $massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_EDIT', 'linkurl' => 'javascript:Vtiger_List_Js.triggerMassEdit("index.php?module=' . $moduleModel->get('name') . '&view=MassActionAjax&mode=showMassEditForm");', 'linkicon' => '');
     }
     if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassDelete')) {
         $massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_DELETE', 'linkurl' => 'javascript:Vtiger_List_Js.massDeleteRecords("index.php?module=' . $moduleModel->getName() . '&action=MassDelete");', 'linkicon' => '');
     }
     if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassMoveDocuments')) {
         $massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MOVE', 'linkurl' => 'javascript:Documents_List_Js.massMove("index.php?module=' . $moduleModel->getName() . '&view=MoveDocuments");', 'linkicon' => '');
     }
     if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassTransferOwnership')) {
         $massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_TRANSFER_OWNERSHIP', 'linkurl' => 'javascript:Vtiger_List_Js.triggerTransferOwnership("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=transferOwnership")', 'linkicon' => '');
     }
     foreach ($massActionLinks as $massActionLink) {
         $links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
     }
     return $links;
 }
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:30,代码来源:ListView.php

示例8: process

 function process(Vtiger_Request $request)
 {
     $currentUserPriviligeModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     $viewer = $this->getViewer($request);
     $recordId = $request->get('record');
     $moduleName = $request->getModule();
     $recordModel = Vtiger_Record_Model::getInstanceById($recordId);
     $moduleModel = $recordModel->getModule();
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('CURRENT_USER_PRIVILEGE', $currentUserPriviligeModel);
     $viewer->assign('RECORD', $recordModel);
     $viewer->assign('CONVERT_LEAD_FIELDS', $recordModel->getConvertLeadFields());
     $assignedToFieldModel = $moduleModel->getField('assigned_user_id');
     $assignedToFieldModel->set('fieldvalue', $recordModel->get('assigned_user_id'));
     $viewer->assign('ASSIGN_TO', $assignedToFieldModel);
     $potentialModuleModel = Vtiger_Module_Model::getInstance('Potentials');
     $accountField = Vtiger_Field_Model::getInstance('related_to', $potentialModuleModel);
     $contactField = Vtiger_Field_Model::getInstance('contact_id', $potentialModuleModel);
     $viewer->assign('ACCOUNT_FIELD_MODEL', $accountField);
     $viewer->assign('CONTACT_FIELD_MODEL', $contactField);
     $contactsModuleModel = Vtiger_Module_Model::getInstance('Contacts');
     $accountField = Vtiger_Field_Model::getInstance('parent_id', $contactsModuleModel);
     $viewer->assign('CONTACT_ACCOUNT_FIELD_MODEL', $accountField);
     $state = Settings_Leads_ConvertToAccount_Model::getState();
     $viewer->assign('STATE', $state);
     $viewer->view('ConvertLead.tpl', $moduleName);
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:28,代码来源:ConvertLead.php

示例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();
     $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

示例10: getListViewMassActions

	/**
	 * Function to get the list of Mass actions for the module
	 * @param <Array> $linkParams
	 * @return <Array> - Associative array of Link type to List of  Vtiger_Link_Model instances for Mass Actions
	 */
	public function getListViewMassActions() {
		$currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

		$massActionLinks = array();
		if($currentUserModel->isAdminUser()) {
			$massActionLinks[] = array(
					'linktype' => 'LISTVIEWMASSACTION',
					'linklabel' => 'LBL_DELETE',
					'linkurl' => 'javascript:RecycleBin_List_Js.deleteRecords("index.php?module='.$this->get('name').'&action=RecycleBinAjax")',
					'linkicon' => ''
			);
		}

			$massActionLinks[] = array(
					'linktype' => 'LISTVIEWMASSACTION',
					'linklabel' => 'LBL_RESTORE',
					'linkurl' => 'javascript:RecycleBin_List_Js.restoreRecords("index.php?module='.$this->get('name').'&action=RecycleBinAjax")',
					'linkicon' => ''
			);
		

		foreach($massActionLinks as $massActionLink) {
			$links[] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
		}
		
		return $links;
	}
开发者ID:Wasage,项目名称:werpa,代码行数:32,代码来源:Module.php

示例11: getDetailViewLinks

	public function getDetailViewLinks($linkParams)
	{
		$linkModelList = parent::getDetailViewLinks($linkParams);
		$currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
		$recordModel = $this->getRecord();
		$moduleName = $recordModel->getModuleName();
		foreach ($linkModelList as $kaytab => $linktab) {
			foreach ($linktab as $kay => $link) {
				if ($link->linklabel == 'LBL_EXPORT_TO_PDF' || $link->linklabel == 'LBL_SEND_MAIL_PDF') {
					unset($linkModelList[$kaytab][$kay]);
				}
			}
		}
		$quotesModuleModel = Vtiger_Module_Model::getInstance('Quotes');
		if ($currentUserModel->hasModuleActionPermission($quotesModuleModel->getId(), 'EditView')) {
			$basicActionLink = array(
				'linktype' => 'DETAILVIEWBASIC',
				'linklabel' => '',
				'linkurl' => "index.php?module=" . $quotesModuleModel->getName() . "&view=" . $quotesModuleModel->getEditViewName() . "&calculation_id=" . $recordModel->getId(),
				'linkclass' => 'btn-success',
				'linkimg' => 'layouts/vlayout/skins/images/Quotes.png',
				'linkhint' => vtranslate('LBL_GENERATE_QUOTES', 'Quotes'),
			);
			$linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink);
		}
		return $linkModelList;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:27,代码来源:DetailView.php

示例12: getListViewMassActions

 /**
  * Overrided to remove Mass Edit Option 
  */
 public function getListViewMassActions($linkParams)
 {
     $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     $moduleModel = $this->getModule();
     $linkTypes = array('LISTVIEWMASSACTION');
     $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
     return $links;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:11,代码来源:ListView.php

示例13: checkPermission

 function checkPermission(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $record = $request->get('record');
     $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     if (!$currentUserPrivilegesModel->isPermitted($moduleName, 'Delete', $record)) {
         throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:9,代码来源:Delete.php

示例14: checkPermission

 function checkPermission(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     if (!$currentUserPriviligesModel->hasModuleActionPermission($moduleModel->getId(), 'EditView') || !$currentUserPriviligesModel->hasModuleActionPermission($moduleModel->getId(), 'MassTransferOwnership')) {
         throw new NoPermittedException('LBL_PERMISSION_DENIED');
     }
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:9,代码来源:TransferOwnership.php

示例15: process

 public function process($ModuleName, $ID, $record_form, $config)
 {
     $db = PearDatabase::getInstance();
     $userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     if (!isset($ID) || $ID == 0 || $ID == '' || !$userPrivModel->hasModuleActionPermission(getTabid($config['modules']), 'EditView')) {
         return array('save_record' => true);
     }
     return array('save_record' => false, 'type' => 1, 'module' => $config['modules']);
 }
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:9,代码来源:show_quick_create.php


注:本文中的Users_Privileges_Model::getCurrentUserPrivilegesModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。