• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP vglobal函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中vglobal函数的典型用法代码示例。如果您正苦于以下问题:PHP vglobal函数的具体用法?PHP vglobal怎么用?PHP vglobal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了vglobal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getUserFldArray

/**
 * Function to get picklist fields for the given module
 * @ param $fld_module
 * It gets the picklist details array for the given module in the given format
 * $fieldlist = Array(Array('fieldlabel'=>$fieldlabel,'generatedtype'=>$generatedtype,'columnname'=>$columnname,'fieldname'=>$fieldname,'value'=>picklistvalues))
 */
function getUserFldArray($fld_module, $roleid)
{
    $adb = PearDatabase::getInstance();
    $log = vglobal('log');
    $user_fld = array();
    $tabid = getTabid($fld_module);
    $query = "select vtiger_field.fieldlabel,vtiger_field.columnname,vtiger_field.fieldname, vtiger_field.uitype" . " FROM vtiger_field inner join vtiger_picklist on vtiger_field.fieldname = vtiger_picklist.name" . " where (displaytype=1 and vtiger_field.tabid=? and vtiger_field.uitype in ('15','55','33','16') " . " or (vtiger_field.tabid=? and fieldname='salutationtype' and fieldname !='vendortype')) " . " and vtiger_field.presence in (0,2) ORDER BY vtiger_picklist.picklistid ASC";
    $result = $adb->pquery($query, array($tabid, $tabid));
    $noofrows = $adb->num_rows($result);
    if ($noofrows > 0) {
        $fieldlist = array();
        for ($i = 0; $i < $noofrows; $i++) {
            $user_fld = array();
            $fld_name = $adb->query_result($result, $i, "fieldname");
            $user_fld['fieldlabel'] = $adb->query_result($result, $i, "fieldlabel");
            $user_fld['generatedtype'] = $adb->query_result($result, $i, "generatedtype");
            $user_fld['columnname'] = $adb->query_result($result, $i, "columnname");
            $user_fld['fieldname'] = $adb->query_result($result, $i, "fieldname");
            $user_fld['uitype'] = $adb->query_result($result, $i, "uitype");
            $user_fld['value'] = getAssignedPicklistValues($user_fld['fieldname'], $roleid, $adb);
            $fieldlist[] = $user_fld;
        }
    }
    return $fieldlist;
}
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:31,代码来源:PickListUtils.php


示例2: process

 public function process(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $url = OSSMail_Record_Model::GetSite_URL() . 'modules/OSSMail/roundcube/';
     $config = Settings_Mail_Config_Model::getConfig('autologin');
     if ($config['autologinActive'] == 'true') {
         $account = OSSMail_Autologin_Model::getAutologinUsers();
         if ($account) {
             $rcUser = isset($_SESSION['AutoLoginUser']) && array_key_exists($_SESSION['AutoLoginUser'], $account) ? $account[$_SESSION['AutoLoginUser']] : reset($account);
             require_once 'modules/OSSMail/RoundcubeLogin.class.php';
             $rcl = new RoundcubeLogin($url, false);
             //$rcl->setHostname('fdc.org.pl');
             //$rcl->setPort(143);
             //$rcl->setSSL(false);
             try {
                 if ($rcl->isLoggedIn()) {
                     if ($rcl->getUsername() != $rcUser['username']) {
                         $rcl->logout();
                         $rcl->login($rcUser['username'], $rcUser['password']);
                     }
                 } else {
                     $rcl->login($rcUser['username'], $rcUser['password']);
                 }
             } catch (RoundcubeLoginException $ex) {
                 $log = vglobal('log');
                 $log->error('OSSMail_index_View|RoundcubeLoginException: ' . $ex->getMessage());
             }
         }
     }
     $viewer = $this->getViewer($request);
     $viewer->assign('URL', $url);
     $viewer->view('index.tpl', $moduleName);
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:33,代码来源:index.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_Record_Model::getCurrentUserModel();
     $recordModel = $this->getRecord();
     $recordId = $recordModel->getId();
     if (($currentUserModel->isAdminUser() == true || $currentUserModel->get('id') == $recordId) && $recordModel->get('status') == 'Active') {
         $recordModel = $this->getRecord();
         $detailViewLinks = array(array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_EDIT', 'linkurl' => $recordModel->getEditViewUrl(), 'linkicon' => ''));
         if (vglobal('systemMode') != 'demo') {
             $detailViewLinks[] = array('linktype' => 'DETAILVIEWBASIC', 'linklabel' => 'LBL_CHANGE_PASSWORD', 'linkurl' => "javascript:Users_Detail_Js.triggerChangePassword('index.php?module=Users&view=EditAjax&mode=changePassword&recordId={$recordId}','Users')", 'linkicon' => '');
         }
         foreach ($detailViewLinks as $detailViewLink) {
             $linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
         }
         $detailViewPreferenceLinks = array();
         if (vglobal('systemMode') != 'demo') {
             $detailViewPreferenceLinks[] = array('linktype' => 'DETAILVIEWPREFERENCE', 'linklabel' => 'LBL_CHANGE_PASSWORD', 'linkurl' => "javascript:Users_Detail_Js.triggerChangePassword('index.php?module=Users&view=EditAjax&mode=changePassword&recordId={$recordId}','Users')", 'linkicon' => '');
         }
         $detailViewPreferenceLinks[] = array('linktype' => 'DETAILVIEWPREFERENCE', 'linklabel' => 'LBL_EDIT', 'linkurl' => $recordModel->getPreferenceEditViewUrl(), 'linkicon' => '');
         foreach ($detailViewPreferenceLinks as $detailViewLink) {
             $linkModelList['DETAILVIEWPREFERENCE'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
         }
         if ($currentUserModel->isAdminUser() && $currentUserModel->get('id') != $recordId) {
             $detailViewActionLinks = array(array('linktype' => 'DETAILVIEW', 'linklabel' => 'LBL_DELETE', 'linkurl' => 'javascript:Users_Detail_Js.triggerDeleteUser("' . $recordModel->getDeleteUrl() . '")', 'linkicon' => ''));
             foreach ($detailViewActionLinks as $detailViewLink) {
                 $linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
             }
         }
         return $linkModelList;
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:37,代码来源:DetailView.php


示例4: process

 public function process(Vtiger_Request $request)
 {
     global $log;
     $log->debug("Entering ./views/QuickCreateAjax.php::process");
     $moduleName = $request->getModule();
     $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_QUICKCREATE);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer = $this->getViewer($request);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('SINGLE_MODULE', 'SINGLE_' . $moduleName);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     echo $viewer->view('QuickCreate.tpl', $moduleName, true);
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:31,代码来源:QuickCreateAjax.php


示例5: getHeaderLinks

 /**
  * Function to get the list of Header Links
  * @return <Array> - List of Vtiger_Link_Model instances
  */
 function getHeaderLinks()
 {
     $appUniqueKey = vglobal('application_unique_key');
     $vtigerCurrentVersion = vglobal('vtiger_current_version');
     $site_URL = vglobal('site_URL');
     $userModel = Users_Record_Model::getCurrentUserModel();
     $userEmail = $userModel->get('email1');
     $headerLinks = array(array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_HELP', 'linkicon' => 'info.png', 'childlinks' => array(array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_DOCUMENTATION', 'linkurl' => 'http://salesplatform.ru/wiki/index.php/SalesPlatform_vtiger_crm_640', 'linkicon' => '', 'target' => '_blank'), array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_FEEDBACK', 'linkurl' => 'http://community.salesplatform.ru/forums/', 'target' => '_blank', 'linkicon' => ''))));
     if ($userModel->isAdminUser()) {
         $crmSettingsLink = array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_CRM_SETTINGS', 'linkurl' => '', 'linkicon' => 'setting.png', 'childlinks' => array(array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_CRM_SETTINGS', 'linkurl' => '?module=Vtiger&parent=Settings&view=Index', 'linkicon' => ''), array(), array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_MANAGE_USERS', 'linkurl' => '?module=Users&parent=Settings&view=List', 'linkicon' => '')));
         array_push($headerLinks, $crmSettingsLink);
     }
     $userPersonalSettingsLinks = array('linktype' => 'HEADERLINK', 'linklabel' => $userModel->getDisplayName(), 'linkurl' => '', 'linkicon' => '', 'childlinks' => array(array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_MY_PREFERENCES', 'linkurl' => $userModel->getPreferenceDetailViewUrl(), 'linkicon' => ''), array(), array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_SIGN_OUT', 'linkurl' => '?module=Users&parent=Settings&action=Logout', 'linkicon' => '')));
     array_push($headerLinks, $userPersonalSettingsLinks);
     $headerLinkInstances = array();
     $index = 0;
     foreach ($headerLinks as $headerLink) {
         $headerLinkInstance = Vtiger_Link_Model::getInstanceFromValues($headerLink);
         foreach ($headerLink['childlinks'] as $childLink) {
             $headerLinkInstance->addChildLink(Vtiger_Link_Model::getInstanceFromValues($childLink));
         }
         $headerLinkInstances[$index++] = $headerLinkInstance;
     }
     $headerLinks = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERLINK'));
     foreach ($headerLinks as $headerType => $headerLinks) {
         foreach ($headerLinks as $headerLink) {
             $headerLinkInstances[$index++] = Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
         }
     }
     return $headerLinkInstances;
 }
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:35,代码来源:Header.php


示例6: getConfig

 public static function getConfig($process, $type, $procesParam = false)
 {
     $log = vglobal('log');
     $log->debug('Start ' . __CLASS__ . ':' . __FUNCTION__ . " | Process: {$process}, Type: {$type}");
     $db = PearDatabase::getInstance();
     $processList = ['marketing' => 'yetiforce_proc_marketing', 'sales' => 'yetiforce_proc_sales'];
     $cache = Vtiger_Cache::get('ProcessesModel', $process . $type);
     if ($cache) {
         $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
         return $cache;
     }
     $result = $db->pquery('SELECT * FROM ' . $processList[$process] . ' WHERE type = ?;', [$type]);
     if ($db->num_rows($result) == 0) {
         return [];
     }
     $config = [];
     for ($i = 0; $i < $db->num_rows($result); ++$i) {
         $param = $db->query_result_raw($result, $i, 'param');
         $value = $db->query_result_raw($result, $i, 'value');
         if ($param == 'users') {
             $config[$param] = $value == '' ? [] : explode(',', $value);
         } else {
             $config[$param] = $value;
         }
         if ($procesParam != false && $param == $procesParam) {
             Vtiger_Cache::set('ProcessesModel', $process . $type . $procesParam, $value);
             $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
             return $value;
         }
     }
     Vtiger_Cache::set('ProcessesModel', $process . $type, $config);
     $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__);
     return $config;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:34,代码来源:Processes.php


示例7: process

 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["jhslxixksw"] = "id";
     $hbtbpmlh = "path";
     ${"GLOBALS"}["lxinqwn"] = "params";
     ${${"GLOBALS"}["yetinhmxt"]} = PearDatabase::getInstance();
     $ougpgodj = "filename";
     ${${"GLOBALS"}["lxinqwn"]} = $request->getAll();
     ${${"GLOBALS"}["jhslxixksw"]} = $request->get("id");
     $wdittud = "id";
     $hsnxkpbpjgl = "path";
     ${"GLOBALS"}["ospxotjg"] = "filename";
     ${$ougpgodj} = $request->get("filename");
     ${$hbtbpmlh} = vglobal("root_directory") . "/modules/Workflow2/tmp/download/" . ${$wdittud};
     if (!file_exists(${$hsnxkpbpjgl})) {
         \Workflow2::error_handler(E_ERROR, "File to download not found! You could download a file only one time!");
     }
     header("Pragma: public");
     ${"GLOBALS"}["bjnhsjrlsql"] = "path";
     header("Expires: 0");
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
     header("Cache-Control: public");
     header("Content-Description: File Transfer");
     header("Content-type: application/octet-stream");
     header("Content-Disposition: attachment; filename=\"" . ${${"GLOBALS"}["ospxotjg"]} . "\"");
     header("Content-Transfer-Encoding: binary");
     header("Content-Length: " . filesize(${${"GLOBALS"}["bjnhsjrlsql"]}));
     @readfile(${${"GLOBALS"}["rxsnhyopph"]});
     @unlink(${${"GLOBALS"}["rxsnhyopph"]});
     exit;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:31,代码来源:DownloadFile.php


示例8: transferRecordsOwnership

 public function transferRecordsOwnership($transferOwnerId, $relatedModuleRecordIds)
 {
     $currentUser = vglobal('current_user');
     $db = PearDatabase::getInstance();
     $query = 'UPDATE vtiger_crmentity SET smownerid = ?, modifiedby = ?, modifiedtime = NOW() WHERE crmid IN (' . $db->generateQuestionMarks($relatedModuleRecordIds) . ')';
     $db->pquery($query, [$transferOwnerId, $currentUser->id, $relatedModuleRecordIds]);
 }
开发者ID:epsilonsc,项目名称:YetiForceCRM,代码行数:7,代码来源:TransferOwnership.php


示例9: formattime

 /**
  * Based on user time format convert the YYYY-MM-DD HH:MM value.
  */
 static function formattime($timeInYMDHIS)
 {
     $current_user = vglobal('current_user');
     $format_string = 'Y-m-d H:i';
     switch ($current_user->date_format) {
         case 'dd-mm-yyyy':
             $format_string = 'd-m-Y H:i';
             break;
         case 'mm-dd-yyyy':
             $format_string = 'm-d-Y H:i';
             break;
         case 'yyyy-mm-dd':
             $format_string = 'Y-m-d H:i';
             break;
         case 'dd.mm.yyyy':
             $format_string = 'd.m.Y H:i';
             break;
         case 'mm.dd.yyyy':
             $format_string = 'm.d.Y H:i';
             break;
         case 'yyyy.mm.dd':
             $format_string = 'Y.m.d H:i';
             break;
         case 'dd/mm/yyyy':
             $format_string = 'd/m/Y H:i';
             break;
         case 'mm/dd/yyyy':
             $format_string = 'm/d/Y H:i';
             break;
         case 'yyyy/mm/dd':
             $format_string = 'Y/m/d H:i';
             break;
     }
     return date($format_string, self::mktime($timeInYMDHIS));
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:38,代码来源:RepeatEvents.php


示例10: handleEvent

 function handleEvent($eventName, $entityData)
 {
     $current_user = vglobal('current_user');
     $db = PearDatabase::getInstance();
     $moduleName = $entityData->getModuleName();
     //Specific to VAS
     if ($moduleName == 'Users') {
         return;
     }
     //END
     $recordId = $entityData->getId();
     $vtEntityDelta = new VTEntityDelta();
     $newEntityData = $vtEntityDelta->getNewEntity($moduleName, $recordId);
     $recordValues = $newEntityData->getData();
     $isAssignToModified = $this->isAssignToChanged($moduleName, $recordId, $current_user);
     if (!$isAssignToModified) {
         return;
     }
     $wsModuleName = $this->getWsModuleName($moduleName);
     if ($wsModuleName == "Calendar") {
         $wsModuleName = vtws_getCalendarEntityType($recordId);
     }
     $handler = vtws_getModuleHandlerFromName($wsModuleName, $current_user);
     $meta = $handler->getMeta();
     $recordWsValues = DataTransform::sanitizeData($recordValues, $meta);
     $syncServer = new SyncServer();
     $syncServer->markRecordAsDeleteForAllCleints($recordWsValues);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:28,代码来源:WSAPPAssignToTracker.php


示例11: vglobal

 /**
  * Manage instance usage of this class
  */
 public static function &getInstance($type = 'base')
 {
     if (key_exists($type, self::$dbCache)) {
         $db = self::$dbCache[$type];
         vglobal('adb', $db);
         return $db;
     } else {
         if (key_exists('base', self::$dbCache)) {
             $db = self::$dbCache['base'];
             vglobal('adb', $db);
             return $db;
         }
     }
     $config = self::getDBConfig($type);
     $db = new self($config['db_type'], $config['db_server'], $config['db_name'], $config['db_username'], $config['db_password'], $config['db_port']);
     if ($db->database == NULL) {
         $db->log('Database getInstance: Error connecting to the database', 'error');
         $db->checkError('Error connecting to the database');
         return false;
     } else {
         self::$dbCache[$type] = $db;
         vglobal('adb', $db);
     }
     return $db;
 }
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:28,代码来源:PearDatabase.php


示例12: getHeaderLinks

 /**
  * Function to get the list of Header Links
  * @return <Array> - List of Vtiger_Link_Model instances
  */
 function getHeaderLinks()
 {
     global $log;
     $appUniqueKey = vglobal('application_unique_key');
     $vtigerCurrentVersion = vglobal('vtiger_current_version');
     $site_URL = vglobal('site_URL');
     $userModel = Users_Record_Model::getCurrentUserModel();
     $userEmail = $userModel->get('email1');
     $headerLinks = array(array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_FEEDBACK', 'linkurl' => "javascript:window.open('http://vtiger.com/products/crm/od-feedback/index.php?version=" . $vtigerCurrentVersion . "&email=" . $userEmail . "&uid=" . $appUniqueKey . "&ui=6','feedbackwin','height=400,width=550,top=200,left=300')", 'linkicon' => 'info.png', 'childlinks' => array(array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_DOCUMENTATION', 'linkurl' => 'https://wiki.vtiger.com/vtiger6/index.php/Main_Page', 'linkicon' => '', 'target' => '_blank'), array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_VIDEO_TUTORIAL', 'linkurl' => 'https://www.vtiger.com/crm/videos', 'linkicon' => '', 'target' => '_blank'), array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_FEEDBACK', 'linkurl' => "javascript:window.open('http://vtiger.com/products/crm/od-feedback/index.php?version=" . $vtigerCurrentVersion . "&email=" . $userEmail . "&uid=" . $appUniqueKey . "&ui=6','feedbackwin','height=400,width=550,top=200,left=300')", 'linkicon' => ''))));
     if ($userModel->isAdminUser()) {
         $crmSettingsLink = array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_CRM_SETTINGS', 'linkurl' => '', 'linkicon' => 'setting.png', 'childlinks' => array(array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_CRM_SETTINGS', 'linkurl' => '?module=Vtiger&parent=Settings&view=Index', 'linkicon' => ''), array(), array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_MANAGE_USERS', 'linkurl' => '?module=Users&parent=Settings&view=List', 'linkicon' => '')));
         array_push($headerLinks, $crmSettingsLink);
     }
     $userPersonalSettingsLinks = array('linktype' => 'HEADERLINK', 'linklabel' => $userModel->getDisplayName(), 'linkurl' => '', 'linkicon' => '', 'childlinks' => array(array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_MY_PREFERENCES', 'linkurl' => $userModel->getPreferenceDetailViewUrl(), 'linkicon' => ''), array(), array('linktype' => 'HEADERLINK', 'linklabel' => 'LBL_SIGN_OUT', 'linkurl' => '?module=Users&parent=Settings&action=Logout', 'linkicon' => '')));
     array_push($headerLinks, $userPersonalSettingsLinks);
     $headerLinkInstances = array();
     $index = 0;
     foreach ($headerLinks as $headerLink) {
         $headerLinkInstance = Vtiger_Link_Model::getInstanceFromValues($headerLink);
         foreach ($headerLink['childlinks'] as $childLink) {
             $headerLinkInstance->addChildLink(Vtiger_Link_Model::getInstanceFromValues($childLink));
         }
         $headerLinkInstances[$index++] = $headerLinkInstance;
     }
     $headerLinks = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERLINK'));
     foreach ($headerLinks as $headerType => $headerLinks) {
         foreach ($headerLinks as $headerLink) {
             $headerLinkInstances[$index++] = Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
         }
     }
     return $headerLinkInstances;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:36,代码来源:Header.php


示例13: color_generator

function color_generator($count = 1, $start = '33CCFF', $step = '221133')
{
    $log = vglobal('log');
    $log->debug("Entering color_generator(" . $count . "," . $start . "," . $step . ") method ...");
    // explode color strings to RGB array
    if ($start[0] == "#") {
        $start = substr($start, 1);
    }
    if ($step[0] == "#") {
        $step = substr($step, 1);
    }
    // pad shorter strings with 0
    $start = substr($start . "000000", 0, 6);
    $step = substr($step . "000000", 0, 6);
    $colors = array(hexdec(substr($start, 0, 2)), hexdec(substr($start, 2, 2)), hexdec(substr($start, 4, 2)));
    $steps = array(hexdec(substr($step, 0, 2)), hexdec(substr($step, 2, 2)), hexdec(substr($step, 4, 2)));
    // buils $count colours adding $step to $start
    $result = array();
    for ($i = 1; $i <= $count; $i++) {
        array_push($result, "#" . dechex($colors[0]) . dechex($colors[1]) . dechex($colors[2]));
        for ($j = 0; $j < 3; $j++) {
            $colors[$j] += $steps[$j];
            if ($colors[$j] > 0xff) {
                $colors[$j] -= 0xff;
            }
        }
    }
    $log->debug("Exiting color_generator method ...");
    return $result;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:30,代码来源:GraphUtils.php


示例14: process

 public function process(Vtiger_Request $request)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $page = $request->get('page');
     $linkId = $request->get('linkid');
     $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
     if (!$request->has('owner')) {
         $owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget);
     } else {
         $owner = $request->get('owner');
     }
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $page);
     $pagingModel->set('limit', (int) $widget->get('limit'));
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $calendarActivities = $owner === false ? array() : $moduleModel->getCalendarActivities('assigned_over', $pagingModel, $owner);
     $viewer->assign('WIDGET', $widget);
     $viewer->assign('MODULE_NAME', $moduleName);
     $viewer->assign('ACTIVITIES', $calendarActivities);
     $viewer->assign('PAGING', $pagingModel);
     $viewer->assign('CURRENTUSER', $currentUser);
     $title_max_length = vglobal('title_max_length');
     $href_max_length = vglobal('href_max_length');
     $viewer->assign('NAMELENGHT', $title_max_length);
     $viewer->assign('HREFNAMELENGHT', $href_max_length);
     $viewer->assign('NODATAMSGLABLE', 'LBL_NO_OVERDUE_ACTIVITIES');
     $content = $request->get('content');
     if (!empty($content)) {
         $viewer->view('dashboards/CalendarActivitiesContents.tpl', $moduleName);
     } else {
         $viewer->view('dashboards/CalendarActivities.tpl', $moduleName);
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:35,代码来源:AssignedOverdueCalendarTasks.php


示例15: vtws_retrieve

function vtws_retrieve($id, $user)
{
    $adb = PearDatabase::getInstance();
    $log = vglobal('log');
    $webserviceObject = VtigerWebserviceObject::fromId($adb, $id);
    $handlerPath = $webserviceObject->getHandlerPath();
    $handlerClass = $webserviceObject->getHandlerClass();
    require_once $handlerPath;
    $handler = new $handlerClass($webserviceObject, $user, $adb, $log);
    $meta = $handler->getMeta();
    $entityName = $meta->getObjectEntityName($id);
    $types = vtws_listtypes(null, $user);
    if (!in_array($entityName, $types['types'])) {
        throw new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, "Permission to perform the operation is denied");
    }
    if ($meta->hasReadAccess() !== true) {
        throw new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, "Permission to write is denied");
    }
    if ($entityName !== $webserviceObject->getEntityName()) {
        throw new WebServiceException(WebServiceErrorCode::$INVALIDID, "Id specified is incorrect");
    }
    if (!$meta->hasPermission(EntityMeta::$RETRIEVE, $id)) {
        throw new WebServiceException(WebServiceErrorCode::$ACCESSDENIED, "Permission to read given object is denied");
    }
    $idComponents = vtws_getIdComponents($id);
    if (!$meta->exists($idComponents[1])) {
        throw new WebServiceException(WebServiceErrorCode::$RECORDNOTFOUND, "Record you are trying to access is not found");
    }
    $entity = $handler->retrieve($id);
    VTWS_PreserveGlobal::flush();
    return $entity;
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:32,代码来源:Retrieve.php


示例16: process

 public function process(Vtiger_Request $request)
 {
     $qualifiedModuleName = $request->getModule(false);
     $moduleModel = Settings_Vtiger_CompanyDetails_Model::getInstance();
     $saveLogo = $securityError = false;
     $logoDetails = $_FILES['logo'];
     $fileType = explode('/', $logoDetails['type']);
     $fileType = $fileType[1];
     $logoContent = file_get_contents($logoDetails['tmp_name']);
     if (preg_match('(<\\?php?(.*?))', $imageContent) != 0) {
         $securityError = true;
     }
     if (!$securityError) {
         if ($logoDetails['size'] && in_array($fileType, Settings_Vtiger_CompanyDetails_Model::$logoSupportedFormats)) {
             $saveLogo = true;
         }
         if ($saveLogo) {
             $moduleModel->saveLogo();
             $moduleModel->set('logoname', ltrim(basename(' ' . Vtiger_Util_Helper::sanitizeUploadFileName($logoDetails['name'], vglobal('upload_badext')))));
             $moduleModel->save();
         }
     }
     $reloadUrl = $moduleModel->getIndexViewUrl();
     if ($securityError) {
         $reloadUrl .= '&error=LBL_IMAGE_CORRUPTED';
     } else {
         if (!$saveLogo) {
             $reloadUrl .= '&error=LBL_INVALID_IMAGE';
         }
     }
     header('Location: ' . $reloadUrl);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:32,代码来源:UpdateCompanyLogo.php


示例17: saveLogo

 /**
  * Function to save the logoinfo
  */
 public function saveLogo()
 {
     $uploadDir = vglobal('root_directory') . '/' . $this->logoPath;
     $logoName = $uploadDir . $_FILES["logo"]["name"];
     move_uploaded_file($_FILES["logo"]["tmp_name"], $logoName);
     copy($logoName, $uploadDir . 'application.ico');
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:10,代码来源:CompanyDetails.php


示例18: 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);
 }
开发者ID:Wasage,项目名称:werpa,代码行数:25,代码来源:Index.php


示例19: requestForgotPassword

 public function requestForgotPassword($request)
 {
     $request = new Vtiger_Request($request);
     $adb = PearDatabase::getInstance();
     $username = vtlib_purify($request->get('user_name'));
     $result = $adb->pquery('select id,email1 from vtiger_users where user_name = ? ', array($username));
     if ($adb->num_rows($result) > 0) {
         $email = $adb->query_result($result, 0, 'email1');
     }
     if (strcasecmp($request->get('emailId'), $email) === 0) {
         $userId = $adb->query_result($result, 0, 'id');
         $time = time();
         $options = array('handler_path' => 'modules/Users/handlers/ForgotPassword.php', 'handler_class' => 'Users_ForgotPassword_Handler', 'handler_function' => 'changePassword', 'handler_data' => array('username' => $username, 'email' => $email, 'time' => $time, 'hash' => md5($username . $time)));
         $trackURL = Vtiger_ShortURL_Helper::generateURL($options);
         $data = ['sysname' => 'UsersForgotPassword', 'to_email' => $email, 'module' => 'Users', 'record' => $userId, 'trackURL' => $trackURL];
         $recordModel = Vtiger_Record_Model::getCleanInstance('OSSMailTemplates');
         $status = $recordModel->sendMailFromTemplate($data);
         $site_URL = vglobal('site_URL') . 'index.php?modules=Users&view=Login';
         if ($status === 1) {
             header('Location:  ' . $site_URL . '&status=1');
         } else {
             header('Location:  ' . $site_URL . '&statusError=1');
         }
     } else {
         $site_URL = vglobal('site_URL') . 'index.php?modules=Users&view=Login';
         header('Location:  ' . $site_URL . '&fpError=1');
     }
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:28,代码来源:ForgotPassword.php


示例20: _getFile

 protected function _getFile($id, $moduleName, $crmid)
 {
     $current_user = \Users_Record_Model::getCurrentUserModel();
     $useUser = \Users::getActiveAdminUser();
     $oldUser = vglobal('current_user');
     vglobal('current_user', $useUser);
     $tmpFilename = $this->_getTmpFilename();
     $mpdf = "";
     $language = $current_user->language;
     if (empty($language)) {
         $language = \Vtiger_Language_Handler::getLanguage();
     }
     $Records = array($crmid);
     // $request = $_REQUEST;
     // $_REQUEST['search'] = true;
     //$_REQUEST['submode'] = true;
     \Vtiger_Loader::autoLoad('PDFMaker_PDFMaker_Model');
     $PDFMaker = new \PDFMaker_PDFMaker_Model();
     $name = $PDFMaker->GetPreparedMPDF($mpdf, $Records, array($id), $moduleName, $language);
     $name = $PDFMaker->generate_cool_uri($name);
     if ($name != "") {
         $name = $name . ".pdf";
     }
     $mpdf->Output($tmpFilename);
     vglobal('current_user', $oldUser);
     $filetype = "application/pdf";
     //$_REQUEST = $request;
     return array('path' => $tmpFilename, 'name' => $name, 'type' => $filetype);
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:29,代码来源:Pdfmaker.inc.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP vibe_breadcrumbs函数代码示例发布时间:2022-05-23
下一篇:
PHP vget函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap