本文整理汇总了PHP中vimport函数的典型用法代码示例。如果您正苦于以下问题:PHP vimport函数的具体用法?PHP vimport怎么用?PHP vimport使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vimport函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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)
{
$linkTypes = array('DETAILVIEWBASIC', 'DETAILVIEW');
$moduleModel = $this->getModule();
$recordModel = $this->getRecord();
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$moduleName = $moduleModel->getName();
$recordId = $recordModel->getId();
$detailViewLinks = [];
$adb = PearDatabase::getInstance();
vimport('~~modules/com_vtiger_workflow/include.inc');
vimport('~~modules/com_vtiger_workflow/VTEntityMethodManager.inc');
$wfs = new VTWorkflowManager($adb);
$workflows = $wfs->getWorkflowsForModule($moduleName, VTWorkflowManager::$TRIGGER);
if (Users_Privileges_Model::isPermitted($moduleName, 'WorkflowTrigger') && count($workflows) > 0) {
$detailViewLinks[] = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkurl' => 'Vtiger_Detail_Js.showWorkflowTriggerView(this)', 'linkicon' => 'glyphicon glyphicon-plus-sign', 'linkhint' => 'BTN_WORKFLOW_TRIGGER');
}
$lockEdit = Users_Privileges_Model::checkLockEdit($moduleName, $recordId);
$currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
if (Users_Privileges_Model::isPermitted($moduleName, 'EditView', $recordId) && !$lockEdit) {
$detailViewLinks[] = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => '', 'linkurl' => $recordModel->getEditViewUrl(), 'linkicon' => 'glyphicon glyphicon-pencil', 'linkclass' => 'btn', 'linkhint' => 'BTN_RECORD_EDIT');
}
foreach ($detailViewLinks as $detailViewLink) {
$linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
}
$linkModelListDetails = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
//Mark all detail view basic links as detail view links.
//Since ui will be look ugly if you need many basic links
$detailViewBasiclinks = $linkModelListDetails['DETAILVIEWBASIC'];
unset($linkModelListDetails['DETAILVIEWBASIC']);
if (Users_Privileges_Model::isPermitted($moduleName, 'Delete', $recordId) && $recordPermissionToEditView) {
$deletelinkModel = array('linktype' => 'DETAILVIEW', 'linklabel' => sprintf("%s %s", getTranslatedString('LBL_DELETE', $moduleName), vtranslate('SINGLE_' . $moduleName, $moduleName)), 'linkurl' => 'javascript:Vtiger_Detail_Js.deleteRecord("' . $recordModel->getDeleteUrl() . '")', 'linkicon' => 'glyphicon glyphicon-trash', 'title' => vtranslate('LBL_DELETE_RECORD'));
$linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($deletelinkModel);
}
if (Users_Privileges_Model::isPermitted($moduleName, 'DuplicateRecord')) {
$duplicateLinkModel = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_DUPLICATE', 'linkurl' => $recordModel->getDuplicateRecordUrl(), 'linkicon' => 'glyphicon glyphicon-retweet', 'title' => vtranslate('LBL_DUPLICATE_RECORD'));
$linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($duplicateLinkModel);
}
if (!empty($detailViewBasiclinks)) {
foreach ($detailViewBasiclinks as $linkModel) {
// Remove view history, needed in vtiger5 to see history but not in vtiger6
if ($linkModel->linklabel == 'View History') {
continue;
}
$linkModelList['DETAILVIEW'][] = $linkModel;
}
}
$relatedLinks = $this->getDetailViewRelatedLinks();
foreach ($relatedLinks as $relatedLinkEntry) {
$relatedLink = Vtiger_Link_Model::getInstanceFromValues($relatedLinkEntry);
$linkModelList[$relatedLink->getType()][] = $relatedLink;
}
if ($currentUserModel->isAdminUser()) {
$settingsLinks = $moduleModel->getSettingLinks();
foreach ($settingsLinks as $settingsLink) {
$linkModelList['DETAILVIEWSETTING'][] = Vtiger_Link_Model::getInstanceFromValues($settingsLink);
}
}
return $linkModelList;
}
示例2: process
public function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
vimport('~~modules/' . $moduleName . '/' . $moduleName . '.php');
$bag = false;
$paymentsIn = $request->get('paymentsIn');
foreach ($paymentsIn as $fields) {
$ossPaymentsIn = new $moduleName();
$ossPaymentsIn->column_fields['paymentsname'] = 'Name';
$ossPaymentsIn->column_fields['paymentsvalue'] = $fields['amount'];
$ossPaymentsIn->column_fields['paymentscurrency'] = $fields['third_letter_currency_code'];
$ossPaymentsIn->column_fields['paymentstitle'] = $fields['details']['title'];
$ossPaymentsIn->column_fields['bank_account'] = $fields['details']['contAccount'];
$saved = $ossPaymentsIn->save('PaymentsIn');
if ($saved == false) {
$bag = true;
}
}
if ($bag) {
$result = array('success' => true, 'return' => vtranslate('MSG_SAVE_OK', $moduleName));
} else {
$result = array('success' => false, 'return' => vtranslate('MSG_SAVE_ERROR', $moduleName));
}
$response = new Vtiger_Response();
$response->setResult($result);
$response->emit();
}
示例3: getGroupsIdsForUsers
public function getGroupsIdsForUsers($userId)
{
vimport('~include/utils/GetUserGroups.php');
$userGroupInstance = new GetUserGroups();
$userGroupInstance->getAllUserGroups($userId);
return $userGroupInstance->user_groups;
}
示例4: process
function process(Vtiger_Request $request)
{
$moduleName = $request->getModule();
$record = $request->get('record');
vimport('~~modules/com_vtiger_workflow/include.inc');
vimport('~~modules/com_vtiger_workflow/VTEntityCache.inc');
vimport('~~modules/com_vtiger_workflow/include.inc');
vimport('~~include/Webservices/Utils.php');
vimport('~~include/Webservices/Retrieve.php');
$adb = PearDatabase::getInstance();
$wfs = new VTWorkflowManager($adb);
$workflows = $wfs->getWorkflowsForModule($moduleName, VTWorkflowManager::$TRIGGER);
$currentUser = Users_Record_Model::getCurrentUserModel();
$wsId = vtws_getWebserviceEntityId($moduleName, $record);
$entityCache = new VTEntityCache($currentUser);
$entityData = $entityCache->forId($wsId);
foreach ($workflows as $id => $workflow) {
if (!$workflow->evaluate($entityCache, $entityData->getId())) {
unset($workflows[$id]);
}
}
$viewer = $this->getViewer($request);
$viewer->assign('RECORD', $record);
$viewer->assign('MODULE', $moduleName);
$viewer->assign('WORKFLOWS', $workflows);
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
$viewer->view('WorkflowTrigger.tpl', $moduleName);
}
示例5: updateUserModuleStep3
public function updateUserModuleStep3(Vtiger_Request $request)
{
$importModuleName = $request->get('module_import_name');
$uploadFile = $request->get('module_import_file');
$uploadDir = Settings_ModuleManager_Module_Model::getUploadDirectory();
$uploadFileName = "{$uploadDir}/{$uploadFile}";
checkFileAccess($uploadFileName);
$importType = strtolower($request->get('module_import_type'));
if ($importType == 'language') {
$package = new Vtiger_Language();
} else {
if ($importType == 'layout') {
vimport('vtlib.Vtiger.Layout');
$package = new Vtiger_Layout();
} else {
$package = new Vtiger_Package();
}
}
if ($importType == 'language' || $importType == 'layout') {
$package->import($uploadFileName);
} else {
$package->update(Vtiger_Module::getInstance($importModuleName), $uploadFileName);
}
checkFileAccessForDeletion($uploadFileName);
unlink($uploadFileName);
$result = array('success' => true, 'importModuleName' => $importModuleName);
$response = new Vtiger_Response();
$response->setResult($result);
$response->emit();
}
示例6: handleEvent
function handleEvent($eventName, $data)
{
$moduleName = $data->getModuleName();
if ($eventName == 'vtiger.entity.aftersave.final' && $moduleName == 'ProjectTask') {
$recordId = $data->getId();
if ($data->isNew()) {
$recordModel = Vtiger_Module_Model::getInstance('ProjectMilestone');
$recordModel->updateProgressMilestone($data->get('projectmilestoneid'));
} else {
vimport('include.events.VTEntityDelta');
$vtEntityDelta = new VTEntityDelta();
$delta = $vtEntityDelta->getEntityDelta($moduleName, $recordId, true);
foreach ($delta as $name => $value) {
if ($name == 'projectmilestoneid' || $name == 'estimated_work_time' || $name == 'projecttaskprogress') {
$recordModel = Vtiger_Module_Model::getInstance('ProjectMilestone');
if ($name == 'projectmilestoneid') {
$recordModel->updateProgressMilestone($value['currentValue']);
$recordModel->updateProgressMilestone($value['oldValue']);
} else {
$recordModel->updateProgressMilestone($data->get('projectmilestoneid'));
}
}
}
}
} elseif ($eventName == 'vtiger.entity.afterdelete' && $moduleName == 'ProjectTask') {
$recordModel = Vtiger_Module_Model::getInstance('ProjectMilestone');
$recordModel->updateProgressMilestone($data->get('projectmilestoneid'));
} elseif ($eventName == 'vtiger.entity.afterrestore' && $moduleName == 'ProjectTask') {
$recordModel = Vtiger_Module_Model::getInstance('ProjectMilestone');
$recordModel->updateProgressMilestone($data->get('projectmilestoneid'));
}
}
示例7: _createXLS
private function _createXLS($tmpFile, $reportId)
{
vimport('~~/modules/SQLReports/ReportRunSQL.php');
/**
* @var $reportRun \ReportRunSQL
*/
$reportRun = \ReportRunSQL::getInstance($reportId);
$reportRun->writeReportToExcelFile($tmpFile, false);
}
示例8: saveRecord
/**
* Function to save record
* @param <Vtiger_Request> $request - values of the record
* @return <RecordModel> - record Model of saved record
*/
public function saveRecord($request)
{
$adb = PearDatabase::getInstance();
$recordModel = $this->getRecordModelFromRequest($request);
$recordModel->save();
$originalRecordId = $recordModel->getId();
if ($request->get('relationOperation')) {
$parentModuleName = $request->get('sourceModule');
$parentModuleModel = Vtiger_Module_Model::getInstance($parentModuleName);
$parentRecordId = $request->get('sourceRecord');
$relatedModule = $recordModel->getModule();
if ($relatedModule->getName() == 'Events') {
$relatedModule = Vtiger_Module_Model::getInstance('Calendar');
}
$relatedRecordId = $recordModel->getId();
$relationModel = Vtiger_Relation_Model::getInstance($parentModuleModel, $relatedModule);
$relationModel->addRelation($parentRecordId, $relatedRecordId);
}
// Handled to save follow up event
$followupMode = $request->get('followup');
//Start Date and Time values
$startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($request->get('followup_time_start'));
$startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($request->get('followup_date_start') . " " . $startTime);
list($startDate, $startTime) = explode(' ', $startDateTime);
$subject = $request->get('subject');
if ($followupMode == 'on' && $startTime != '' && $startDate != '') {
$recordModel->set('eventstatus', 'Planned');
$recordModel->set('subject', '[Followup] ' . $subject);
$recordModel->set('date_start', $startDate);
$recordModel->set('time_start', $startTime);
$currentUser = Users_Record_Model::getCurrentUserModel();
$activityType = $recordModel->get('activitytype');
if ($activityType == 'Call') {
$minutes = $currentUser->get('callduration');
} else {
$minutes = $currentUser->get('othereventduration');
}
$dueDateTime = date('Y-m-d H:i:s', strtotime("{$startDateTime}+{$minutes} minutes"));
list($startDate, $startTime) = explode(' ', $dueDateTime);
$recordModel->set('due_date', $startDate);
$recordModel->set('time_end', $startTime);
$recordModel->set('recurringtype', '');
$recordModel->set('mode', 'create');
$recordModel->save();
$heldevent = true;
}
//TODO: remove the dependency on $_REQUEST
if ($_REQUEST['recurringtype'] != '' && $_REQUEST['recurringtype'] != '--None--') {
vimport('~modules/Calendar/RepeatEvents.php');
$focus = new Activity();
//get all the stored data to this object
$focus->column_fields = $recordModel->getData();
Calendar_RepeatEvents::repeatFromRequest($focus);
}
return $recordModel;
}
示例9: getSettingLinks
public function getSettingLinks()
{
vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
$layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif');
$settingsLinks = array();
$db = PearDatabase::getInstance();
$result = $db->query("SELECT fieldid FROM vtiger_settings_field WHERE name = 'OSSMail' AND description = 'OSSMail'", true);
$settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_MODULE_CONFIGURATION', 'linkurl' => 'index.php?module=OSSMail&parent=Settings&view=index&block=4&fieldid=' . $db->query_result($result, 0, 'fieldid'), 'linkicon' => $layoutEditorImagePath);
return $settingsLinks;
}
示例10: getSettingLinks
/**
* Function to get Settings links
* @return <Array>
*/
public function getSettingLinks()
{
vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
$editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png');
$settingsLinks = array();
if (VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
$settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_WORKFLOWS', 'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule=' . $this->getName(), 'linkicon' => $editWorkflowsImagePath);
}
return $settingsLinks;
}
示例11: recalculate
public function recalculate()
{
$php_max_execution_time = vglobal('php_max_execution_time');
set_time_limit($php_max_execution_time);
vimport('~~modules/Users/CreateUserPrivilegeFile.php');
$userIdsList = Settings_Profiles_Record_Model::getUsersList(true);
if ($userIdsList) {
foreach ($userIdsList as $userId) {
createUserPrivilegesfile($userId);
}
}
}
示例12: getSummary
public function getSummary($type, $bank, $file)
{
$adres = vglobal('cache_dir');
if ($bank == 'Default') {
vimport('~~modules/PaymentsIn/helpers/' . $type . '.php');
$records = new $type($adres . $file);
return $records;
}
vimport('~~modules/PaymentsIn/helpers/subclass/' . $type . '_' . $bank . '.php');
$class = $type . '_' . $bank;
$records = new $class($adres . $file);
return $records;
}
示例13: Contacts_createPortalLoginDetails
function Contacts_createPortalLoginDetails($entityData)
{
vimport('modules.Settings.CustomerPortal.helpers.CustomerPortalPassword');
$encodePass = vglobal('encode_customer_portal_passwords');
$adb = PearDatabase::getInstance();
$wsId = $entityData->getId();
$parts = explode('x', $wsId);
$entityId = $parts[1];
$email = $entityData->get('email');
if (($entityData->get('portal') == 'on' || $entityData->get('portal') == '1') && $entityData->get('contactstatus') != 'Inactive') {
$sql = "SELECT id, user_name, user_password, isactive FROM vtiger_portalinfo WHERE id=?";
$result = $adb->pquery($sql, array($entityId));
$insert = false;
if ($adb->num_rows($result) == 0) {
$insert = true;
} else {
$dbusername = $adb->query_result($result, 0, 'user_name');
$isactive = $adb->query_result($result, 0, 'isactive');
if ($email == $dbusername && $isactive == 1 && !$entityData->isNew()) {
$update = false;
} else {
if ($entityData->get('portal') == 'on' || $entityData->get('portal') == '1') {
$sql = "UPDATE vtiger_portalinfo SET user_name=?, isactive=1 WHERE id=?";
$adb->pquery($sql, array($email, $entityId));
$password = $adb->query_result($result, 0, 'user_password');
$update = true;
} else {
$sql = "UPDATE vtiger_portalinfo SET user_name=?, isactive=? WHERE id=?";
$adb->pquery($sql, array($email, 0, $entityId));
$update = false;
}
}
}
if ($insert == true) {
$password = makeRandomPassword();
$truePassword = $password;
if ($encodePass) {
$password = CustomerPortalPassword::encryptPassword($password, $email);
$params = array($entityId, $email, $password, 'C', 1, CustomerPortalPassword::getCryptType(), $truePassword);
$sql = "INSERT INTO vtiger_portalinfo(`id`, `user_name`, `user_password`, `type`, `isactive`, `crypt_type`, `password_sent`) VALUES(" . generateQuestionMarks($params) . ")";
} else {
$params = array($entityId, $email, $password, 'C', 1, $truePassword);
$sql = "INSERT INTO vtiger_portalinfo(`id`, `user_name`, `user_password`, `type`, `isactive`, `password_sent`) VALUES(" . generateQuestionMarks($params) . ")";
}
$adb->pquery($sql, $params);
}
} else {
$sql = "UPDATE vtiger_portalinfo SET user_name=?,isactive=0 WHERE id=?";
$adb->pquery($sql, array($email, $entityId));
}
}
示例14: initialize
/**
* Function starts applying schema changes
*/
public function initialize()
{
global $YetiForce_current_version;
$this->initializeDatabase($this->sql_directory, array('scheme', 'data'));
$this->setDefaultUsersAccess();
$currencyName = $_SESSION['config_file_info']['currency_name'];
$currencyCode = $_SESSION['config_file_info']['currency_code'];
$currencySymbol = $_SESSION['config_file_info']['currency_symbol'];
$this->db->pquery("UPDATE vtiger_currency_info SET currency_name = ?, currency_code = ?, currency_symbol = ?", [$currencyName, $currencyCode, $currencySymbol]);
$this->db->pquery("UPDATE vtiger_version SET `current_version` = ? ;", [$YetiForce_current_version]);
// recalculate all sharing rules for users
vimport('~include/utils/UserInfoUtil.php');
RecalculateSharingRules();
}
示例15: getSettingLinks
/**
* Function to get Settings links
* @return <Array>
*/
public function getSettingLinks()
{
if (!$this->isEntityModule()) {
return array();
}
vimport('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
$layoutEditorImagePath = Vtiger_Theme::getImagePath('LayoutEditor.gif');
$editWorkflowsImagePath = Vtiger_Theme::getImagePath('EditWorkflows.png');
$settingsLinks = array();
if (VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
$settingsLinks[] = array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'LBL_EDIT_WORKFLOWS', 'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule=' . $this->getName(), 'linkicon' => $editWorkflowsImagePath);
}
$settingsLinks[] = array('linktype' => 'LISTVIEWSETTINGS', 'linklabel' => 'LBL_SERVER_CONFIGURATION', 'linkurl' => 'index.php?parent=Settings&module=PBXManager&view=Index', 'linkicon' => '');
return $settingsLinks;
}