本文整理汇总了PHP中CRMEntity类的典型用法代码示例。如果您正苦于以下问题:PHP CRMEntity类的具体用法?PHP CRMEntity怎么用?PHP CRMEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRMEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}
示例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;
}
示例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();
}
}
}
示例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.
}
}
}
}
}
}
示例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');
}
}
示例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;
}
示例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') {
}
}
}
}
}
}
}
示例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 */
}
示例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;
}
示例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') {
}
}
}
}
}
}
}
示例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.
}
}
}
}
}
}
示例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()";
}
示例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);
}
}
示例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') {
}
}
}
}
}
}
}
示例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);
}