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

PHP CRMEntity类代码示例

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

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



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

示例1: generate

 function generate(Vtiger_Request $xxx0b)
 {
     global $xxx22, $xxx23, $xxx24, $xxx25, $xxx26, $xxx27, $xxx28, $xxx29;
     $xxx0c = new PDFMaker_PDFMaker_Model();
     $xxx0d = $xxx0b->getAll();
     $xxx0e = PearDatabase::getInstance();
     $xxx0f = "site_URL";
     $xxx10 = "vtiger_current_version";
     $xxx11 = vglobal($xxx10);
     $xxx12 = vglobal($xxx0f);
     $xxx13 = $xxx0b->get('relmodule');
     $xxx14 = CRMEntity::getInstance($xxx13);
     $xxx15 = $xxx0b->get('record');
     $xxx16 = $xxx0b->get('mode');
     $xxx17 = $xxx0b->get('language');
     $xxx18 = $xxx0b->get('type');
     $xxx19 = "";
     $xxx1a = $xxx0c->GetPreparedMPDF($xxx19, $xxx15, $xxx13, $xxx17);
     $xxx19->Output('cache/' . $xxx1a . '.pdf');
     @$xxx27();
     $xxx25('Content-Type: application/pdf');
     $xxx25("Content-length: " . $xxx22("./cache/{$xxx1a}.pdf"));
     $xxx25("Cache-Control: private");
     $xxx25("Content-Disposition: attachment; filename={$xxx1a}.pdf");
     $xxx25("Content-Description: PHP Generated Data");
     echo $xxx23($xxx24("./cache/{$xxx1a}.pdf", "r"), $xxx22("./cache/{$xxx1a}.pdf"));
     @$xxx29("cache/{$xxx1a}.pdf");
 }
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:28,代码来源:checkGenerate.php


示例2: get_all_queue

 /**
  * function to load the queues 
  * @param integer $iduser
  * @return array
  */
 public function get_all_queue($iduser = 0)
 {
     if ((int) $iduser == 0) {
         $iduser = $_SESSION['do_user']->iduser;
         $user_timezone = $_SESSION['do_user']->user_timezone;
     } else {
         $do_user = new User();
         $do_user->getId($iduser);
         $user_timezone = $do_user->user_timezone;
     }
     $today = TimeZoneUtil::get_user_timezone_date($user_timezone);
     $security_where = $_SESSION["do_crm_action_permission"]->get_user_where_condition('q', 18, false, $iduser);
     $qry = "\n\t\tselect \n\t\tq.*,\n\t\tm.name as module_name,\n\t\tm.module_label\n\t\tfrom queue q\n\t\tinner join module m on m.idmodule = q.related_module_id\n\t\twhere \n\t\t1=1\n\t\t" . $security_where . "\n\t\tand q.queue_date >= ?\n\t\torder by q.queue_date,q.related_module_id\n\t\t";
     $this->query($qry, array($today));
     $return_array = array();
     if ($this->getNumRows() > 0) {
         $todayDateObj = new DateTime($today);
         $do_crm_entity = new CRMEntity();
         while ($this->next()) {
             $queueDateObj = new DateTime($this->queue_date);
             $diff = $todayDateObj->diff($queueDateObj);
             $day_diff = $diff->format('%R%a');
             $data = array("idqueue" => $this->idqueue, "sqcrm_record_id" => $this->sqcrm_record_id, "module_name" => $this->module_name, "module_label" => $this->module_label, "idmodule" => $this->related_module_id, "entity_identifier" => $do_crm_entity->get_entity_identifier($this->sqcrm_record_id, $this->module_name));
             if ($day_diff == 0) {
                 $return_array["today"][] = $data;
             } elseif ($day_diff == 1) {
                 $return_array["tomorrow"][] = $data;
             } elseif ($day_diff > 1) {
                 $return_array["later"][] = $data;
             }
         }
     }
     return $return_array;
 }
开发者ID:sQcrm,项目名称:sqcrm,代码行数:39,代码来源:Queue.class.php


示例3: handleEvent

 function handleEvent($eventName, $data)
 {
     if ($eventName == 'vtiger.entity.beforesave') {
         // Entity is about to be saved, take required action
     }
     if ($eventName == 'vtiger.entity.aftersave') {
         $db = PearDatabase::getInstance();
         $relatedToId = $data->get('related_to');
         if ($relatedToId) {
             $moduleName = getSalesEntityType($relatedToId);
             $focus = CRMEntity::getInstance($moduleName);
             $focus->retrieve_entity_info($relatedToId, $moduleName);
             $focus->id = $relatedToId;
             $fromPortal = $data->get('from_portal');
             if ($fromPortal) {
                 $focus->column_fields['from_portal'] = $fromPortal;
             }
             $entityData = VTEntityData::fromCRMEntity($focus);
             $wfs = new VTWorkflowManager($db);
             $relatedToEventHandler = new VTWorkflowEventHandler();
             $relatedToEventHandler->workflows = $wfs->getWorkflowsForModuleSupportingComments($entityData->getModuleName());
             $wsId = vtws_getWebserviceEntityId($entityData->getModuleName(), $entityData->getId());
             $fromPortal = $entityData->get('from_portal');
             $util = new VTWorkflowUtils();
             $entityCache = new VTEntityCache($util->adminUser());
             $entityCacheData = $entityCache->forId($wsId);
             $entityCacheData->set('from_portal', $fromPortal);
             $entityCache->cache[$wsId] = $entityCacheData;
             $relatedToEventHandler->handleEvent($eventName, $entityData, $entityCache);
             $util->revertUser();
         }
     }
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:33,代码来源:ModCommentsHandler.php


示例4: vtlib_handler

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type
  */
 function vtlib_handler($moduleName, $eventType)
 {
     $adb = PearDatabase::getInstance();
     if ($eventType == 'module.postinstall') {
         $ModuleInstance = CRMEntity::getInstance('NewOrders');
         $ModuleInstance->setModuleSeqNumber("configure", 'NewOrders', 'NO', '1');
         $adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array('NewOrders'));
         // TODO Handle actions after this module is installed.
     } else {
         if ($eventType == 'module.disabled') {
             // TODO Handle actions before this module is being uninstalled.
         } else {
             if ($eventType == 'module.preuninstall') {
                 // TODO Handle actions when this module is about to be deleted.
             } else {
                 if ($eventType == 'module.preupdate') {
                     // TODO Handle actions before this module is updated.
                 } else {
                     if ($eventType == 'module.postupdate') {
                         // TODO Handle actions after this module is updated.
                     }
                 }
             }
         }
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:31,代码来源:NewOrders.php


示例5: render

 public static function render($userInputObject, $user)
 {
     global $list_max_entries_per_page;
     $adb = PearDatabase::getInstance();
     $viewer = new Import_UI_Viewer();
     $ownerId = $userInputObject->get('foruser');
     $owner = new Users();
     $owner->id = $ownerId;
     $owner->retrieve_entity_info($ownerId, 'Users');
     if (!is_admin($user) && $user->id != $owner->id) {
         $viewer->display('OperationNotPermitted.tpl', 'Vtiger');
         exit;
     }
     $userDBTableName = Import_Utils::getDbTableName($owner);
     $moduleName = $userInputObject->get('module');
     $moduleMeta = self::getModuleMeta($moduleName, $user);
     $result = $adb->query('SELECT recordid FROM ' . $userDBTableName . ' WHERE status is NOT NULL AND recordid IS NOT NULL');
     $noOfRecords = $adb->num_rows($result);
     $importedRecordIds = array();
     for ($i = 0; $i < $noOfRecords; ++$i) {
         $importedRecordIds[] = $adb->query_result($result, $i, 'recordid');
     }
     if (count($importedRecordIds) == 0) {
         $importedRecordIds[] = 0;
     }
     $focus = CRMEntity::getInstance($moduleName);
     $queryGenerator = new QueryGenerator($moduleName, $user);
     $customView = new CustomView($moduleName);
     $viewId = $customView->getViewIdByName('All', $moduleName);
     $queryGenerator->initForCustomViewById($viewId);
     $list_query = $queryGenerator->getQuery();
     // Fetch only last imported records
     $list_query .= ' AND ' . $focus->table_name . '.' . $focus->table_index . ' IN (' . implode(',', $importedRecordIds) . ')';
     if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true) {
         $count_result = $adb->query(mkCountQuery($list_query));
         $noofrows = $adb->query_result($count_result, 0, "count");
     } else {
         $noofrows = null;
     }
     $start = ListViewSession::getRequestCurrentPage($moduleName, $list_query, $viewId, false);
     $navigation_array = VT_getSimpleNavigationValues($start, $list_max_entries_per_page, $noofrows);
     $limit_start_rec = ($start - 1) * $list_max_entries_per_page;
     $list_result = $adb->pquery($list_query . " LIMIT {$limit_start_rec}, {$list_max_entries_per_page}", array());
     $recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec, $noofrows);
     $viewer->assign('recordListRange', $recordListRangeMsg);
     $controller = new ListViewController($adb, $user, $queryGenerator);
     $listview_header = $controller->getListViewHeader($focus, $moduleName, $url_string, $sorder, $order_by, true);
     $listview_entries = $controller->getListViewEntries($focus, $moduleName, $list_result, $navigation_array, true);
     $viewer->assign('CURRENT_PAGE', $start);
     $viewer->assign('LISTHEADER', $listview_header);
     $viewer->assign('LISTENTITY', $listview_entries);
     $viewer->assign('FOR_MODULE', $moduleName);
     $viewer->assign('FOR_USER', $ownerId);
     $isAjax = $userInputObject->get('ajax');
     if (!empty($isAjax)) {
         echo $viewer->fetch('ListViewEntries.tpl');
     } else {
         $viewer->display('ImportListView.tpl');
     }
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:60,代码来源:Import_ListView_Controller.php


示例6: 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;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:34,代码来源:Module.php


示例7: vtlib_handler

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     global $adb;
     if ($event_type == 'module.postinstall') {
         $ModuleInstance = CRMEntity::getInstance($modulename);
         $ModuleInstance->setModuleSeqNumber("configure", $modulename, '', '1');
         $Instance = Vtiger_Module::getInstance($modulename);
         $nModule = Vtiger_Module::getInstance('Accounts');
         if ($nModule) {
             $nModule->setRelatedList($Instance, $modulename, array('add'), 'get_dependents_list');
         }
         $Instance = Vtiger_Module::getInstance($modulename);
         $nModule = Vtiger_Module::getInstance('Invoice');
         if ($nModule) {
             $nModule->setRelatedList($Instance, $modulename, array('add'), 'get_dependents_list');
         }
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
         if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
             include_once 'modules/ModComments/ModComments.php';
             if (class_exists('ModComments')) {
                 ModComments::addWidgetTo(array('Payments'));
             }
         }
         $adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array($modulename));
         $tabid = Vtiger_Functions::getModuleId($modulename);
         include_once 'modules/ModTracker/ModTracker.php';
         $moduleModTrackerInstance = new ModTracker();
         if (!$moduleModTrackerInstance->isModulePresent($tabid)) {
             $res = $adb->pquery("INSERT INTO vtiger_modtracker_tabs VALUES(?,?)", array($tabid, 1));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         } else {
             $updatevisibility = $adb->pquery("UPDATE vtiger_modtracker_tabs SET visible = 1 WHERE tabid = ?", array($tabid));
             $moduleModTrackerInstance->updateCache($tabid, 1);
         }
         if (!$moduleModTrackerInstance->isModTrackerLinkPresent($tabid)) {
             $moduleInstance = Vtiger_Module::getInstance($tabid);
             $moduleInstance->addLink('DETAILVIEWBASIC', 'View History', "javascript:ModTrackerCommon.showhistory('\$RECORD\$')", '', '', array('path' => 'modules/ModTracker/ModTracker.php', 'class' => 'ModTracker', 'method' => 'isViewPermitted'));
         }
         $this->addWorkflow($modulename);
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:65,代码来源:PaymentsOut.php


示例8: beforeGetTaskform

 public function beforeGetTaskform($viewer)
 {
     global $adb;
     if (!\Workflow\VtUtils::existTable("vtiger_wf_customnumbering")) {
         echo "Create table vtiger_wf_confirmation_user ... ok<br>";
         $adb->query("CREATE TABLE IF NOT EXISTS `vtiger_wf_customnumbering` (\r\n              `serie` varchar(24) NOT NULL,\r\n              `prefix` varchar(16) NOT NULL,\r\n              `current` int(10) unsigned NOT NULL,\r\n              `length` tinyint(4) NOT NULL,\r\n              PRIMARY KEY (`serie`)\r\n            ) ENGINE=InnoDB;");
     }
     $crmidColObj = CRMEntity::getInstance($this->getModuleName());
     $viewer->assign('crmidCol', $crmidColObj->table_index);
     $moduleName = $this->getModuleName();
     $fields = VtUtils::getFieldsWithBlocksForModule($moduleName, false);
     $selectedId = $this->get('field');
     if ($selectedId === -1 || empty($selectedId)) {
         $sql = 'SELECT * FROM vtiger_field WHERE uitype = 4 AND tabid = ' . getTabid($moduleName);
         $result = $adb->query($sql);
         $selectedId = $adb->query_result($result, 0, 'fieldname');
         $this->set('field', $selectedId);
     }
     $sql = 'SELECT * FROM vtiger_wf_customnumbering';
     $result = $adb->query($sql);
     $series = array();
     while ($row = $adb->fetchByAssoc($result)) {
         $series[$row['serie']] = $row;
     }
     if (isset($series[$this->get('serie')])) {
         $viewer->assign('lockFields', true);
     }
     $viewer->assign('series', $series);
     $viewer->assign('fields', $fields);
     /* Insert here source code to create custom configurations pages */
 }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:31,代码来源:WfTaskCustomNumbers.php


示例9: getQuery

 /**
  * Function returns the Query for the relationhips
  * @param <Vtiger_Record_Model> $recordModel
  * @param type $actions
  * @return <String>
  */
 public function getQuery($recordModel, $actions = false)
 {
     $parentModuleModel = $this->getParentModuleModel();
     $relatedModuleModel = $this->getRelationModuleModel();
     $relatedModuleName = $relatedModuleModel->get('name');
     $parentModuleName = $parentModuleModel->get('name');
     $functionName = $this->get('name');
     $focus = CRMEntity::getInstance($parentModuleName);
     $focus->id = $recordModel->getId();
     if (method_exists($parentModuleModel, $functionName)) {
         $query = $parentModuleModel->{$functionName}($recordModel, $relatedModuleModel);
     } else {
         $result = $focus->{$functionName}($recordModel->getId(), $parentModuleModel->getId(), $relatedModuleModel->getId(), $actions);
         $query = $result['query'];
     }
     //modify query if any module has summary fields, those fields we are displayed in related list of that module
     $relatedListFields = $relatedModuleModel->getConfigureRelatedListFields();
     if (count($relatedListFields) > 0) {
         $currentUser = Users_Record_Model::getCurrentUserModel();
         $queryGenerator = new QueryGenerator($relatedModuleName, $currentUser);
         $queryGenerator->setFields($relatedListFields);
         $selectColumnSql = $queryGenerator->getSelectClauseColumnSQL();
         $newQuery = spliti('FROM', $query);
         $selectColumnSql = 'SELECT DISTINCT vtiger_crmentity.crmid,' . $selectColumnSql;
     }
     if ($functionName == ('get_pricebook_products' || 'get_pricebook_services')) {
         $selectColumnSql = $selectColumnSql . ', vtiger_pricebookproductrel.listprice';
     }
     $query = $selectColumnSql . ' FROM ' . $newQuery[1];
     return $query;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:37,代码来源:Relation.php


示例10: vtlib_handler

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     global $adb;
     if ($event_type == 'module.postinstall') {
         $ModuleInstance = CRMEntity::getInstance($modulename);
         $ModuleInstance->setModuleSeqNumber("configure", $modulename, 'UO', '1');
         include_once 'vtlib/Vtiger/Module.php';
         $moduleInstance = Vtiger_Module::getInstance($modulename);
         $docelowy_Module = Vtiger_Module::getInstance('Accounts');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSOutsourcedServices', array('ADD'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('Leads');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSOutsourcedServices', array('ADD'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('Potentials');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSOutsourcedServices', array('ADD'), 'get_dependents_list');
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:40,代码来源:OSSOutsourcedServices.php


示例11: vtlib_handler

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type
  */
 function vtlib_handler($moduleName, $eventType)
 {
     $adb = PearDatabase::getInstance();
     if ($eventType == 'module.postinstall') {
         include_once 'vtlib/Vtiger/Module.php';
         $moduleInstance = CRMEntity::getInstance('HolidaysEntitlement');
         $moduleInstance->setModuleSeqNumber("configure", 'HolidaysEntitlement', 'HE', '1');
         $adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array('HolidaysEntitlement'));
         $moduleInstance = Vtiger_Module::getInstance('HolidaysEntitlement');
         $targetModule = Vtiger_Module::getInstance('OSSEmployees');
         $targetModule->setRelatedList($moduleInstance, 'HolidaysEntitlement', array('ADD'), 'get_dependents_list');
     } else {
         if ($eventType == 'module.disabled') {
             // TODO Handle actions before this module is being uninstalled.
         } else {
             if ($eventType == 'module.preuninstall') {
                 // TODO Handle actions when this module is about to be deleted.
             } else {
                 if ($eventType == 'module.preupdate') {
                     // TODO Handle actions before this module is updated.
                 } else {
                     if ($eventType == 'module.postupdate') {
                         // TODO Handle actions after this module is updated.
                     }
                 }
             }
         }
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:34,代码来源:HolidaysEntitlement.php


示例12: setUp

 protected function setUp()
 {
     global $adb, $phpUnitLeadId;
     ${"GLOBALS"}["vqinqhvudy"] = "sql";
     ${"GLOBALS"}["omirinrsle"] = "sql";
     ${${"GLOBALS"}["omirinrsle"]} = "SELECT leadid FROM\n                    vtiger_leaddetails\n                     LEFT JOIN vtiger_crmentity ON(vtiger_crmentity.crmid = vtiger_leaddetails.leadid)\n                WHERE firstname = 'PHPUNIT' AND lastname = 'PHPUNIT' AND deleted = 0";
     ${${"GLOBALS"}["dlfzmzsoafs"]} = $adb->query(${${"GLOBALS"}["vqinqhvudy"]});
     if ($adb->num_rows(${${"GLOBALS"}["dlfzmzsoafs"]}) > 0) {
         $pcbcvlo = "result";
         ${${"GLOBALS"}["odcnybklnoz"]} = $adb->query_result(${$pcbcvlo}, 0, "leadid");
     } else {
         $zgdgywgjnie = "document";
         ${"GLOBALS"}["fbjylokbk"] = "result";
         ${$zgdgywgjnie} = CRMEntity::getInstance("Leads");
         $document->column_fields["firstname"] = "PHPUNIT";
         $document->column_fields["lastname"] = "PHPUNIT";
         $qxhkyg = "sql";
         $document->column_fields["annualrevenue"] = "1000";
         $document->column_fields["cf_654"] = 1;
         $document->column_fields["assigned_user_id"] = 1;
         $elbiflyj = "sql";
         $document->save("Leads");
         ${$elbiflyj} = "SELECT leadid FROM\n                                vtiger_leaddetails\n                                 LEFT JOIN vtiger_crmentity ON(vtiger_crmentity.crmid = vtiger_leaddetails.leadid)\n                            WHERE firstname = 'PHPUNIT' AND lastname = 'PHPUNIT' AND deleted = 0";
         $adb->query(${$qxhkyg});
         ${${"GLOBALS"}["odcnybklnoz"]} = $adb->query_result(${${"GLOBALS"}["fbjylokbk"]}, 0, "leadid");
     }
     VTEntity::setUser(VtUtils::getAdminUser());
     print "\nMySuite::setUp()";
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:29,代码来源:Workflow2.php


示例13: showImportStatus

 public static function showImportStatus($importInfo, $user)
 {
     if ($importInfo == null) {
         Import_Utils_Helper::showErrorPage(vtranslate('ERR_IMPORT_INTERRUPTED', 'Import'));
         exit;
     }
     $importDataController = new Import_Data_Action($importInfo, $user);
     if ($importInfo['status'] == Import_Queue_Action::$IMPORT_STATUS_HALTED || $importInfo['status'] == Import_Queue_Action::$IMPORT_STATUS_NONE) {
         $continueImport = true;
     } else {
         $continueImport = false;
     }
     $focus = CRMEntity::getInstance($importInfo['module']);
     if (method_exists($focus, 'getImportStatusCount')) {
         $importStatusCount = $focus->getImportStatusCount($importDataController);
     } else {
         $importStatusCount = $importDataController->getImportStatusCount();
     }
     $totalRecords = $importStatusCount['TOTAL'];
     if ($totalRecords > $importStatusCount['IMPORTED'] + $importStatusCount['FAILED']) {
         //			if($importInfo['status'] == Import_Queue_Action::$IMPORT_STATUS_SCHEDULED) {
         //				self::showScheduledStatus($importInfo);
         //				exit;
         //			}
         self::showCurrentStatus($importInfo, $importStatusCount, $continueImport);
         exit;
     } else {
         $importDataController->finishImport();
         self::showResult($importInfo, $importStatusCount);
     }
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:31,代码来源:Main.php


示例14: vtlib_handler

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     $registerLink = false;
     $displayLabel = 'Time Control';
     global $adb, $log;
     if ($event_type == 'module.postinstall') {
         $tabid = getTabid($modulename);
         $adb->query("UPDATE `vtiger_field` SET `summaryfield` = '1' WHERE `tabid` = {$tabid} AND `columnname` IN ('name','osstimecontrol_no','osstimecontrol_status','smownerid','date_start','time_start','time_end','due_date','sum_time','platnosc');", true);
         $ModuleInstance = CRMEntity::getInstance($modulename);
         $ModuleInstance->setModuleSeqNumber("configure", $modulename, 'TC', '1');
         include_once 'vtlib/Vtiger/Module.php';
         $moduleInstance = Vtiger_Module::getInstance($modulename);
         $docelowy_Module = Vtiger_Module::getInstance('Accounts');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('HelpDesk');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('Project');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('ProjectTask');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('ServiceContracts');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('Assets');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('SalesOrder');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('Potentials');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('Quotes');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('Leads');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSTimeControl', array('add'), 'get_dependents_list');
         $modcommentsModuleInstance = Vtiger_Module::getInstance('ModComments');
         if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
             include_once 'modules/ModComments/ModComments.php';
             if (class_exists('ModComments')) {
                 ModComments::addWidgetTo(array('OSSTimeControl'));
             }
         }
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:65,代码来源:OSSTimeControl.php


示例15: getJoinSQLbyFieldRelation

 public function getJoinSQLbyFieldRelation(&$join_array, &$columns_array)
 {
     $related_focus = CRMEntity::getInstance($this->relModuleName);
     $params_fieldname = $this->params["fieldname"];
     // first join to vtiger module table
     $this->params["fieldname"] = $related_focus->tab_name_index[$this->params["tablename"]];
     $this->getStJoinSQL($join_array, $columns_array);
     $r_tabid = getTabid($this->relModuleName);
     $adb = PEARDatabase::getInstance();
     $uirel_row = $adb->fetchByAssoc($adb->pquery("SELECT *  FROM vtiger_field WHERE tabid = ? AND fieldname = ?", array($r_tabid, $params_fieldname)), 0);
     $related_table_name = $related_focus->table_name;
     $related_table_index = $related_focus->table_index;
     foreach ($related_focus->tab_name as $other_table) {
         $related_join_array[$other_table] = $related_focus->tab_name_index[$other_table];
     }
     $field_uitype = $uirel_row["uitype"];
     $fieldid = $this->params["fieldid"];
     $oth_as = "";
     if ($uirel_row["tablename"] == "vtiger_crmentity") {
         $oth_as = $this->oth_as;
         $related_table_name = $uirel_row["tablename"];
         $related_table_index = $uirel_row["columnname"];
     }
     $using_aliastablename = $related_table_name . $oth_as . $fieldid;
     $using_columnname = $related_table_index;
     $params = array('fieldid' => $uirel_row["fieldid"], 'fieldtabid' => $uirel_row["tabid"], 'field_uitype' => $field_uitype, 'fieldname' => $uirel_row["fieldname"], 'columnname' => $uirel_row["columnname"], 'tablename' => $uirel_row["tablename"], 'table_index' => $related_join_array, 'report_primary_table' => $this->params["report_primary_table"], 'primary_table_name' => $related_focus->table_name, 'primary_table_index' => $related_focus->table_index, 'primary_tableid' => $r_tabid, 'using_aliastablename' => $using_array["u_tablename"], 'using_columnname' => $using_array["u_tableindex"], 'old_oth_as' => $oth_as, 'old_oth_fieldid' => $fieldid, 'fld_string' => $this->params["fld_string"]);
     $using_array = getJoinInformation($params);
     $params["using_array"] = $using_array;
     $uifactory = new UIFactory($params);
     //show("<font color='green'>fielduitype".$field_uitype."_IN_P_".$field_uitype,$related_join_array,$params["using_array"],"</font>");
     $uifactory->getJoinSQL($field_uitype, $join_array, $columns_array);
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:32,代码来源:UITypes.php


示例16: 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;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:33,代码来源:Module.php


示例17: vtEditExpressions

function vtEditExpressions($adb, $appStrings, $current_language, $theme, $formodule = '')
{
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $smarty = new vtigerCRM_Smarty();
    $smarty->assign('APP', $appStrings);
    $mod = array_merge(return_module_language($current_language, 'FieldFormulas'), return_module_language($current_language, 'Settings'));
    $jsStrings = array('NEED_TO_ADD_A' => $mod['NEED_TO_ADD_A'], 'CUSTOM_FIELD' => $mod['LBL_CUSTOM_FIELD'], 'LBL_USE_FUNCTION_DASHDASH' => $mod['LBL_USE_FUNCTION_DASHDASH'], 'LBL_USE_FIELD_VALUE_DASHDASH' => $mod['LBL_USE_FIELD_VALUE_DASHDASH'], 'LBL_DELETE_EXPRESSION_CONFIRM' => $mod['LBL_DELETE_EXPRESSION_CONFIRM']);
    $smarty->assign("JS_STRINGS", Zend_Json::encode($jsStrings));
    $smarty->assign("MOD", $mod);
    $smarty->assign("THEME", $theme);
    $smarty->assign("IMAGE_PATH", $image_path);
    $smarty->assign("MODULE_NAME", 'FieldFormulas');
    $smarty->assign("PAGE_NAME", 'LBL_FIELDFORMULAS');
    $smarty->assign("PAGE_TITLE", 'LBL_FIELDFORMULAS');
    $smarty->assign("PAGE_DESC", 'LBL_FIELDFORMULAS_DESCRIPTION');
    $smarty->assign("FORMODULE", $formodule);
    if (file_exists("modules/{$formodule}/{$formodule}.php")) {
        $focus = CRMEntity::getInstance($formodule);
        $validationArray = split_validationdataArray(getDBValidationData($focus->tab_name, getTabid($formodule)));
        $smarty->assign('VALIDATION_DATA_FIELDNAME', $validationArray['fieldname']);
        $smarty->assign('VALIDATION_DATA_FIELDDATATYPE', $validationArray['datatype']);
        $smarty->assign('VALIDATION_DATA_FIELDLABEL', $validationArray['fieldlabel']);
    }
    $smarty->display(vtlib_getModuleTemplate('FieldFormulas', 'EditExpressions.tpl'));
}
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:26,代码来源:editexpressions.php


示例18: trigger

 /**
  * Trigger event based on CRM Record
  * @param String Name of the Event to trigger
  * @param Integer CRM record id on which event needs to be triggered.
  */
 static function trigger($eventname, $crmid)
 {
     if (!self::hasSupport()) {
         return;
     }
     $adb = PearDatabase::getInstance();
     $checkres = $adb->pquery("SELECT setype, crmid, deleted FROM vtiger_crmentity WHERE crmid=?", array($crmid));
     if ($adb->num_rows($checkres)) {
         $result = $adb->fetch_array($checkres, 0);
         if ($result['deleted'] == '0') {
             $module = $result['setype'];
             $moduleInstance = CRMEntity::getInstance($module);
             $moduleInstance->retrieve_entity_info($result['crmid'], $module);
             $moduleInstance->id = $result['crmid'];
             $current_user = vglobal('current_user');
             if (!$current_user) {
                 $current_user = new Users();
                 $current_user->id = $moduleInstance->column_fields['assigned_user_id'];
             }
             // Trig 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP CRMSmarty类代码示例发布时间:2022-05-23
下一篇:
PHP CR3DCQuery类代码示例发布时间: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