[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 <?php 2 /*+*********************************************************************************** 3 * The contents of this file are subject to the vtiger CRM Public License Version 1.0 4 * ("License"); You may not use this file except in compliance with the License 5 * The Original Code is: vtiger CRM Open Source 6 * The Initial Developer of the Original Code is vtiger. 7 * Portions created by vtiger are Copyright (C) vtiger. 8 * All Rights Reserved. 9 *************************************************************************************/ 10 11 class Users_DetailView_Model extends Vtiger_DetailView_Model { 12 13 14 /** 15 * Function to get the detail view links (links and widgets) 16 * @param <array> $linkParams - parameters which will be used to calicaulate the params 17 * @return <array> - array of link models in the format as below 18 * array('linktype'=>list of link models); 19 */ 20 public function getDetailViewLinks($linkParams) { 21 $currentUserModel = Users_Record_Model::getCurrentUserModel(); 22 $recordModel = $this->getRecord(); 23 $recordId = $recordModel->getId(); 24 25 if (($currentUserModel->isAdminUser() == true || $currentUserModel->get('id') == $recordId) && $recordModel->get('status') == 'Active' ) { 26 $recordModel = $this->getRecord(); 27 28 $detailViewLinks = array( 29 array( 30 'linktype' => 'DETAILVIEWBASIC', 31 'linklabel' => 'LBL_EDIT', 32 'linkurl' => $recordModel->getEditViewUrl(), 33 'linkicon' => '' 34 ), 35 array( 36 'linktype' => 'DETAILVIEWBASIC', 37 'linklabel' => 'LBL_CHANGE_PASSWORD', 38 'linkurl' => "javascript:Users_Detail_Js.triggerChangePassword('index.php?module=Users&view=EditAjax&mode=changePassword&recordId=$recordId','Users')", 39 'linkicon' => '' 40 ) 41 ); 42 43 foreach ($detailViewLinks as $detailViewLink) { 44 $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink); 45 } 46 47 $detailViewPreferenceLinks = array( 48 array( 49 'linktype' => 'DETAILVIEWPREFERENCE', 50 'linklabel' => 'LBL_CHANGE_PASSWORD', 51 'linkurl' => "javascript:Users_Detail_Js.triggerChangePassword('index.php?module=Users&view=EditAjax&mode=changePassword&recordId=$recordId','Users')", 52 'linkicon' => '' 53 ), 54 array( 55 'linktype' => 'DETAILVIEWPREFERENCE', 56 'linklabel' => 'LBL_EDIT', 57 'linkurl' => $recordModel->getPreferenceEditViewUrl(), 58 'linkicon' => '' 59 ) 60 ); 61 62 foreach ($detailViewPreferenceLinks as $detailViewLink) { 63 $linkModelList['DETAILVIEWPREFERENCE'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink); 64 } 65 66 if($currentUserModel->isAdminUser() && $currentUserModel->get('id') != $recordId){ 67 $detailViewActionLinks = array( 68 array( 69 'linktype' => 'DETAILVIEW', 70 'linklabel' => 'LBL_DELETE', 71 'linkurl' => 'javascript:Users_Detail_Js.triggerDeleteUser("' . $recordModel->getDeleteUrl() . '")', 72 'linkicon' => '' 73 ) 74 ); 75 76 foreach ($detailViewActionLinks as $detailViewLink) { 77 $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink); 78 } 79 } 80 return $linkModelList; 81 } 82 } 83 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |