Beispiel #1
0
	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;
	}
Beispiel #2
0
 /**
  * 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');
     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);
     }
     return $linkModelList;
 }
 /**
  * Function to get the detail view links (links and widgets)
  * @param $linkParams
  * @internal param $ <array> $linkParams - parameters which will be used to calicaulate the params
  */
 public function getDetailViewLinks($linkParams)
 {
     $linkModelList = parent::getDetailViewLinks($linkParams);
     $actLinks = array();
     foreach ($linkModelList['DETAILVIEW'] as $key => $value) {
         if ($value->linklabel == 'LBL_INVOICE_ADD_ACT') {
             $actLinks[] = $key;
         }
     }
     if (count($actLinks) == 2) {
         unset($linkModelList['DETAILVIEW'][$actLinks[1]]);
     }
     return $linkModelList;
 }
Beispiel #4
0
 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]);
             }
         }
     }
     return $linkModelList;
 }
Beispiel #5
0
 public function getDetailViewLinks($linkParams)
 {
     $linkModelList = parent::getDetailViewLinks($linkParams);
     $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]);
             }
         }
     }
     $linkURL = 'index.php?module=OSSCosts&view=Hierarchy&record=' . $recordModel->getId();
     $basicActionLink = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_SHOW_HIERARCHY', 'linkurl' => 'javascript:OSSCosts_Detail_Js.triggerHierarchy("' . $linkURL . '");', 'linkicon' => '');
     //DETAILVIEW
     $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicActionLink);
     return $linkModelList;
 }