本文整理汇总了PHP中Vtiger_Module_Model类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Module_Model类的具体用法?PHP Vtiger_Module_Model怎么用?PHP Vtiger_Module_Model使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_Module_Model类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRelationQuery
/**
* Function to get relation query for particular module with function name
* @param <record> $recordId
* @param <String> $functionName
* @param Vtiger_Module_Model $relatedModule
* @return <String>
*/
public function getRelationQuery($recordId, $functionName, $relatedModule)
{
if ($functionName === 'get_activities') {
$focus = CRMEntity::getInstance($this->getName());
$focus->id = $recordId;
$entityIds = $focus->getRelatedContactsIds();
$entityIds = implode(',', $entityIds);
$userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
$query = "SELECT CASE WHEN (vtiger_users.user_name not like '') THEN {$userNameSql} ELSE vtiger_groups.groupname END AS user_name,\n\t\t\t\t\t\tvtiger_crmentity.*, vtiger_activity.activitytype, vtiger_activity.subject, vtiger_activity.date_start, vtiger_activity.time_start,\n\t\t\t\t\t\tvtiger_activity.recurringtype, vtiger_activity.due_date, vtiger_activity.time_end, vtiger_activity.visibility, vtiger_seactivityrel.crmid AS parent_id,\n\t\t\t\t\t\tCASE WHEN (vtiger_activity.activitytype = 'Task') THEN (vtiger_activity.status) ELSE (vtiger_activity.eventstatus) END AS status\n\t\t\t\t\t\tFROM vtiger_activity\n\t\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_seactivityrel ON vtiger_seactivityrel.activityid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_cntactivityrel ON vtiger_cntactivityrel.activityid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\t\t\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.activitytype <> 'Emails'\n\t\t\t\t\t\t\t\tAND (vtiger_seactivityrel.crmid = " . $recordId;
if ($entityIds) {
$query .= " OR vtiger_cntactivityrel.contactid IN (" . $entityIds . "))";
} else {
$query .= ")";
}
$relatedModuleName = $relatedModule->getName();
$query .= $this->getSpecificRelationQuery($relatedModuleName);
$nonAdminQuery = $this->getNonAdminAccessControlQueryForRelation($relatedModuleName);
if ($nonAdminQuery) {
$query = appendFromClauseToQuery($query, $nonAdminQuery);
}
// There could be more than one contact for an activity.
$query .= ' GROUP BY vtiger_activity.activityid';
} else {
$query = parent::getRelationQuery($recordId, $functionName, $relatedModule);
}
return $query;
}
示例2: getRelationQuery
/**
* Function to get relation query for particular module with function name
* @param <record> $recordId
* @param <String> $functionName
* @param Vtiger_Module_Model $relatedModule
* @return <String>
*/
public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
{
if ($functionName === 'get_activities') {
$userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
$query = "SELECT CASE WHEN (vtiger_users.user_name not like '') THEN {$userNameSql} ELSE vtiger_groups.groupname END AS user_name,\n\t\t\t\t\t\tvtiger_crmentity.*, vtiger_activity.activitytype, vtiger_activity.subject, vtiger_activity.date_start, vtiger_activity.time_start,\n\t\t\t\t\t\tvtiger_activity.recurringtype, vtiger_activity.due_date, vtiger_activity.time_end, vtiger_activity.visibility,\n\t\t\t\t\t\tvtiger_activity.status AS status\n\t\t\t\t\t\tFROM vtiger_activity\n\t\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\t\t\tWHERE vtiger_activity.link = " . $recordId . " AND vtiger_crmentity.deleted = 0";
$time = vtlib_purify($_REQUEST['time']);
if ($time == 'current') {
$stateActivityLabels = Calendar_Module_Model::getComponentActivityStateLabel('current');
$query .= " AND (vtiger_activity.activitytype NOT IN ('Emails') AND vtiger_activity.status IN ('" . implode("','", $stateActivityLabels) . "'))";
}
if ($time == 'history') {
$stateActivityLabels = Calendar_Module_Model::getComponentActivityStateLabel('history');
$query .= " AND (vtiger_activity.activitytype NOT IN ('Emails') AND vtiger_activity.status IN ('" . implode("','", $stateActivityLabels) . "'))";
}
$relatedModuleName = $relatedModule->getName();
$query .= $this->getSpecificRelationQuery($relatedModuleName);
$instance = CRMEntity::getInstance($relatedModuleName);
$securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName, false, $recordId);
if ($securityParameter != '') {
$query .= $securityParameter;
}
} elseif ($functionName === 'get_mails' && $relatedModule->getName() == 'OSSMailView') {
$query = OSSMailView_Record_Model::getMailsQuery($recordId, $relatedModule->getName());
} else {
$query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel);
}
return $query;
}
示例3: getRelationQuery
/**
* Function to get relation query for particular module with function name
* @param <record> $recordId
* @param <String> $functionName
* @param Vtiger_Module_Model $relatedModule
* @return <String>
*/
public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
{
if ($functionName === 'get_activities') {
$userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
$query = "SELECT CASE WHEN (vtiger_users.user_name not like '') THEN {$userNameSql} ELSE vtiger_groups.groupname END AS user_name,\n\t\t\t\t\t\tvtiger_crmentity.*, vtiger_activity.activitytype, vtiger_activity.subject, vtiger_activity.date_start, vtiger_activity.time_start,\n\t\t\t\t\t\tvtiger_activity.recurringtype, vtiger_activity.due_date, vtiger_activity.time_end, vtiger_activity.visibility,\n\t\t\t\t\t\tCASE WHEN (vtiger_activity.activitytype = 'Task') THEN (vtiger_activity.status) ELSE (vtiger_activity.eventstatus) END AS status\n\t\t\t\t\t\tFROM vtiger_activity\n\t\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\t\t\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.process = " . $recordId;
$time = vtlib_purify($_REQUEST['time']);
if ($time == 'current') {
$query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred'))\n\t\t\t\tOR (vtiger_activity.activitytype not in ('Emails','Task') and vtiger_activity.eventstatus not in ('','Held')))";
}
if ($time == 'history') {
$query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status in ('Completed','Deferred'))\n\t\t\t\tOR (vtiger_activity.activitytype not in ('Emails','Task') and vtiger_activity.eventstatus in ('','Held')))";
}
$relatedModuleName = $relatedModule->getName();
$query .= $this->getSpecificRelationQuery($relatedModuleName);
$instance = CRMEntity::getInstance($relatedModuleName);
$securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName);
if ($securityParameter != '') {
$sql .= $securityParameter;
}
} elseif ($functionName === 'get_mails' && $relatedModule->getName() == 'OSSMailView') {
$query = OSSMailView_Record_Model::getMailsQuery($recordId, $relatedModule->getName());
} else {
$query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel);
}
return $query;
}
示例4: getRelationQuery
/**
* Function to get relation query for particular module with function name
* @param <record> $recordId
* @param <String> $functionName
* @param Vtiger_Module_Model $relatedModule
* @return <String>
*/
public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
{
if ($functionName === 'get_mails' && $relatedModule->getName() == 'OSSMailView') {
$query = OSSMailView_Record_Model::getMailsQuery($recordId, $relatedModule->getName());
} else {
$query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel);
}
return $query;
}
示例5: output
/**
* Function that create the exported file
* @param Vtiger_Request $request
* @param <Array> $result
* @param Vtiger_Module_Model $moduleModel
*/
public function output($request, $result, $moduleModel)
{
$fileName = $request->get('filename');
$exportType = $this->getExportContentType($request);
// Send the right content type and filename
header("Content-type: {$exportType}");
header("Content-Disposition: attachment; filename={$fileName}.ics");
$timeZone = new iCalendar_timezone();
$timeZoneId = split('/', date_default_timezone_get());
if (!empty($timeZoneId[1])) {
$zoneId = $timeZoneId[1];
} else {
$zoneId = $timeZoneId[0];
}
$timeZone->add_property('TZID', $zoneId);
$timeZone->add_property('TZOFFSETTO', date('O'));
if (date('I') == 1) {
$timeZone->add_property('DAYLIGHTC', date('I'));
} else {
$timeZone->add_property('STANDARDC', date('I'));
}
$myiCal = new iCalendar();
$myiCal->add_component($timeZone);
while (!$result->EOF) {
$eventFields = $result->fields;
$id = $eventFields['activityid'];
$type = $eventFields['activitytype'];
if ($type != 'Task') {
$temp = $moduleModel->get('eventFields');
foreach ($temp as $fieldName => $access) {
$temp[$fieldName] = $eventFields[$fieldName];
}
$temp['id'] = $id;
$iCalTask = new iCalendar_event();
$iCalTask->assign_values($temp);
$iCalAlarm = new iCalendar_alarm();
$iCalAlarm->assign_values($temp);
$iCalTask->add_component($iCalAlarm);
} else {
$temp = $moduleModel->get('todoFields');
foreach ($temp as $fieldName => $access) {
$temp[$fieldName] = $eventFields[$fieldName];
}
$iCalTask = new iCalendar_todo();
$iCalTask->assign_values($temp);
}
$myiCal->add_component($iCalTask);
$result->MoveNext();
}
echo $myiCal->serialize();
}
示例6: process
public function process(Vtiger_Request $request)
{
$moduleSettingsName = $request->getModule(false);
$moduleName = $request->getModule();
$baseModule = $request->get('module_name');
$idTpl = $request->get('tpl_id');
$viewer = $this->getViewer($request);
if ($idTpl) {
$docInfo = Settings_OSSDocumentControl_Module_Model::getDocInfo($idTpl);
$viewer->assign('BASE_INFO', $docInfo['basic_info']);
//var_dump($docInfo['required_conditions']);
for ($i = 0; $i < count($docInfo['required_conditions']); $i++) {
$fieldModel = Vtiger_Field_Model::getInstance($docInfo['required_conditions'][$i]['fieldname'], Vtiger_Module_Model::getInstance($baseModule));
$docInfo['required_conditions'][$i]['info'] = $fieldModel->getFieldInfo();
}
$viewer->assign('REQUIRED_CONDITIONS', $docInfo['required_conditions']);
for ($i = 0; $i < count($docInfo['optional_conditions']); $i++) {
$fieldModel = Vtiger_Field_Model::getInstance($docInfo['optional_conditions'][$i]['fieldname'], Vtiger_Module_Model::getInstance($baseModule));
$docInfo['optional_conditions'][$i]['info'] = $fieldModel->getFieldInfo();
}
$viewer->assign('OPTIONAL_CONDITIONS', $docInfo['optional_conditions']);
$viewer->assign('TPL_ID', $idTpl);
//$fieldModel = Vtiger_Field_Model::getInstance($value->get('name'), $baseModuleModel);
}
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('SUMMARY', $request->get('summary'));
$viewer->assign('BASE_MODULE', $baseModule);
$viewer->assign('QUALIFIED_MODULE', $moduleSettingsName);
$viewer->assign('FIELD_LIST', Settings_OSSDocumentControl_Module_Model::getListBaseModuleField($baseModule));
//$viewer->assign('FOLDER_LIST', Documents_Module_Model::getAllFolders());
$viewer->assign('CONDITION_BY_TYPE', Settings_OSSDocumentControl_Module_Model::getConditionByType());
echo $viewer->view('Edit2.tpl', $moduleSettingsName, true);
}
示例7: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$linkId = $request->get('linkid');
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$data = $moduleModel->getPotentialTotalAmountBySalesStage();
$listViewUrl = $moduleModel->getListViewUrl();
for ($i = 0; $i < count($data); $i++) {
$data[$i]["links"] = $listViewUrl . $this->getSearchParams($data[$i][1]);
}
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('DATA', $data);
$viewer->assign('STYLES', $this->getHeaderCss($request));
$viewer->assign('CURRENTUSER', $currentUser);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/FunnelAmount.tpl', $moduleName);
}
}
示例8: process
public function process(Vtiger_Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$linkId = $request->get('linkid');
$createdTime = $request->get('createdtime');
$owner = $request->get('owner');
//Date conversion from user to database format
if (!empty($createdTime)) {
$dates['start'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['start']);
$dates['end'] = Vtiger_Date_UIType::getDBInsertedValue($createdTime['end']);
}
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$data = $moduleModel->getLeadsCreated($owner, $dates);
$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
//Include special script and css needed for this widget
$viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
$viewer->assign('WIDGET', $widget);
$viewer->assign('MODULE_NAME', $moduleName);
$viewer->assign('DATA', $data);
$viewer->assign('CURRENTUSER', $currentUser);
$accessibleUsers = $currentUser->getAccessibleUsersForModule('Leads');
$viewer->assign('ACCESSIBLE_USERS', $accessibleUsers);
$content = $request->get('content');
if (!empty($content)) {
$viewer->view('dashboards/DashBoardWidgetContents.tpl', $moduleName);
} else {
$viewer->view('dashboards/LeadsCreated.tpl', $moduleName);
}
}
示例9: preProcess
function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$menuModelsList = Vtiger_Menu_Model::getAll(true);
$selectedModule = $request->getModule();
$menuStructure = Vtiger_MenuStructure_Model::getInstanceFromMenuList($menuModelsList, $selectedModule);
$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('VIEW', $request->get('view'));
// Order by pre-defined automation process for QuickCreate.
uksort($menuModelsList, array('Vtiger_MenuStructure_Model', 'sortMenuItemsByProcess'));
$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('SEARCHABLE_MODULES', Vtiger_Module_Model::getSearchableModules());
if ($display) {
$this->preProcessDisplay($request);
}
}
示例10: 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;
}
示例11: content_56729157bec70
function content_56729157bec70($_smarty_tpl)
{
if (!is_callable('smarty_modifier_regex_replace')) {
include 'D:\\wamp\\www\\vtigercrm-debug\\libraries\\Smarty\\libs\\plugins\\modifier.regex_replace.php';
}
?>
<?php
$_smarty_tpl->tpl_vars['MODULE'] = new Smarty_variable('PBXManager', null, 0);
$_smarty_tpl->tpl_vars['MODULEMODEL'] = new Smarty_variable(Vtiger_Module_Model::getInstance($_smarty_tpl->tpl_vars['MODULE']->value), null, 0);
$_smarty_tpl->tpl_vars['FIELD_VALUE'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'), null, 0);
if ($_smarty_tpl->tpl_vars['MODULEMODEL']->value && $_smarty_tpl->tpl_vars['MODULEMODEL']->value->isActive() && $_smarty_tpl->tpl_vars['FIELD_VALUE']->value) {
?>
<?php
$_smarty_tpl->tpl_vars['PERMISSION'] = new Smarty_variable(PBXManager_Server_Model::checkPermissionForOutgoingCall(), null, 0);
?>
<?php
if ($_smarty_tpl->tpl_vars['PERMISSION']->value) {
?>
<?php
$_smarty_tpl->tpl_vars['PHONE_FIELD_VALUE'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_VALUE']->value, null, 0);
?>
<?php
$_smarty_tpl->tpl_vars['PHONE_NUMBER'] = new Smarty_variable(smarty_modifier_regex_replace($_smarty_tpl->tpl_vars['PHONE_FIELD_VALUE']->value, "/[-()\\s]/", ''), null, 0);
?>
<a class="phoneField" data-value="<?php
echo $_smarty_tpl->tpl_vars['PHONE_NUMBER']->value;
?>
" record="<?php
echo $_smarty_tpl->tpl_vars['RECORD']->value->getId();
?>
" onclick="Vtiger_PBXManager_Js.registerPBXOutboundCall('<?php
echo $_smarty_tpl->tpl_vars['PHONE_NUMBER']->value;
?>
',<?php
echo $_smarty_tpl->tpl_vars['RECORD']->value->getId();
?>
)"><?php
echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue');
?>
</a>
<?php
} else {
?>
<?php
echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'), $_smarty_tpl->tpl_vars['RECORD']->value->getId(), $_smarty_tpl->tpl_vars['RECORD']->value);
?>
<?php
}
} else {
?>
<?php
echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'), $_smarty_tpl->tpl_vars['RECORD']->value->getId(), $_smarty_tpl->tpl_vars['RECORD']->value);
?>
<?php
}
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:60,代码来源:eec83eb637465077bcf1cc2a05c0af7ba8ad8722.file.PhoneDetailView.tpl.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();
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;
}
示例13: 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);
}
}
示例14: preProcess
public function preProcess(Vtiger_Request $request)
{
date_default_timezone_set('Europe/London');
// to overcome the pre configuration settings
// Added to redirect to default module if already installed
$configFileName = 'config.inc.php';
if (is_file($configFileName) && filesize($configFileName) > 0) {
$defaultModule = vglobal('default_module');
$defaultModuleInstance = Vtiger_Module_Model::getInstance($defaultModule);
$defaultView = $defaultModuleInstance->getDefaultViewName();
header('Location:index.php?module=' . $defaultModule . '&view=' . $defaultView);
exit;
}
parent::preProcess($request);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$defaultLanguage = $request->get('lang') ? $request->get('lang') : 'ru_ru';
vglobal('default_language', $defaultLanguage);
define('INSTALLATION_MODE', true);
define('INSTALLATION_MODE_DEBUG', $this->debug);
// SalesPlatform.ru begin
$viewer->assign('MODULE_NAME', 'Install');
// SalesPlatform.ru end
$viewer->view('InstallPreProcess.tpl', $moduleName);
}
示例15: preProcess
public function preProcess(Vtiger_Request $request, $display = true)
{
parent::preProcess($request, false);
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
if (!empty($moduleName)) {
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
$currentUser = Users_Record_Model::getCurrentUserModel();
$userPrivilegesModel = Users_Privileges_Model::getInstanceById($currentUser->getId());
$permission = $userPrivilegesModel->hasModulePermission($moduleModel->getId());
$viewer->assign('MODULE', $moduleName);
if (!$permission) {
$viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
$viewer->view('OperationNotPermitted.tpl', $moduleName);
exit;
}
$linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view'));
$linkModels = $moduleModel->getSideBarLinks($linkParams);
$viewer->assign('QUICK_LINKS', $linkModels);
}
$viewer->assign('CURRENT_USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->assign('CURRENT_VIEW', $request->get('view'));
if ($display) {
$this->preProcessDisplay($request);
}
}