当前位置: 首页>>代码示例>>PHP>>正文


PHP vglobal函数代码示例

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


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


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