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


PHP Vtiger_Response::setEmitType方法代码示例

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


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

示例1: process

 public function process(Vtiger_Request $request)
 {
     $recordModel = $this->saveRecord($request);
     $fieldModelList = $recordModel->getModule()->getFields();
     $result = array();
     foreach ($fieldModelList as $fieldName => $fieldModel) {
         $recordFieldValue = $recordModel->get($fieldName);
         if (is_array($recordFieldValue) && $fieldModel->getFieldDataType() == 'multipicklist') {
             $recordFieldValue = implode(' |##| ', $recordFieldValue);
         }
         if (is_array($recordFieldValue) && $fieldModel->getFieldDataType() == 'sharedOwner') {
             $recordFieldValue = implode(',', $recordFieldValue);
         }
         $fieldValue = $displayValue = Vtiger_Util_Helper::toSafeHTML($recordFieldValue);
         if ($fieldModel->getFieldDataType() !== 'currency' && $fieldModel->getFieldDataType() !== 'datetime' && $fieldModel->getFieldDataType() !== 'date') {
             $displayValue = $fieldModel->getDisplayValue($fieldValue, $recordModel->getId());
         }
         $result[$fieldName] = array('value' => $fieldValue, 'display_value' => $displayValue);
     }
     //Handling salutation type
     if ($request->get('field') === 'firstname' && in_array($request->getModule(), array('Contacts'))) {
         $salutationType = $recordModel->getDisplayValue('salutationtype');
         $firstNameDetails = $result['firstname'];
         $firstNameDetails['display_value'] = $salutationType . " " . $firstNameDetails['display_value'];
         if ($salutationType != '--None--') {
             $result['firstname'] = $firstNameDetails;
         }
     }
     $result['_recordLabel'] = $recordModel->getName();
     $result['_recordId'] = $recordModel->getId();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
开发者ID:krzychab,项目名称:YetiForceCRM,代码行数:35,代码来源:SaveAjax.php

示例2: process

 public function process(Vtiger_Request $request)
 {
     $mode = $request->get('mode');
     if (!empty($mode)) {
         $this->invokeExposedMethod($mode, $request);
         return;
     }
     $recordModel = $this->saveRecord($request);
     $settingsModuleModel = Settings_Users_Module_Model::getInstance();
     $settingsModuleModel->refreshSwitchUsers();
     $fieldModelList = $recordModel->getModule()->getFields();
     $result = array();
     foreach ($fieldModelList as $fieldName => $fieldModel) {
         $fieldValue = $displayValue = Vtiger_Util_Helper::toSafeHTML($recordModel->get($fieldName));
         if ($fieldModel->getFieldDataType() !== 'currency') {
             $displayValue = $fieldModel->getDisplayValue($fieldValue, $recordModel->getId());
         }
         if ($fieldName == 'language') {
             $displayValue = Vtiger_Language_Handler::getLanguageLabel($fieldValue);
         }
         if (($fieldName == 'currency_decimal_separator' || $fieldName == 'currency_grouping_separator') && $displayValue == ' ') {
             $displayValue = vtranslate('LBL_SPACE', 'Users');
         }
         $result[$fieldName] = array('value' => $fieldValue, 'display_value' => $displayValue);
     }
     $result['_recordLabel'] = $recordModel->getName();
     $result['_recordId'] = $recordModel->getId();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:32,代码来源:SaveAjax.php

示例3: process

 public function process(Vtiger_Request $request)
 {
     $mode = $request->get('mode');
     if (!empty($mode)) {
         $this->invokeExposedMethod($mode, $request);
         return;
     }
     $recordModel = $this->saveRecord($request);
     $fieldModelList = $recordModel->getModule()->getFields();
     $result = array();
     foreach ($fieldModelList as $fieldName => $fieldModel) {
         $fieldValue = $displayValue = Vtiger_Util_Helper::toSafeHTML($recordModel->get($fieldName));
         if ($fieldModel->getFieldDataType() !== 'currency') {
             $displayValue = $fieldModel->getDisplayValue($fieldValue, $recordModel->getId());
         }
         if ($fieldName == 'language') {
             $displayValue = Vtiger_Language_Handler::getLanguageLabel($fieldValue);
         }
         $result[$fieldName] = array('value' => $fieldValue, 'display_value' => $displayValue);
     }
     $result['_recordLabel'] = $recordModel->getName();
     $result['_recordId'] = $recordModel->getId();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:27,代码来源:SaveAjax.php

示例4: process

    public function process(Vtiger_Request $request) {
        $db = PearDatabase::getInstance();
        $db->pquery("DELETE FROM vtiger_vgsdupdect WHERE vgsdupdectid=?", array($request->get('record_id')));

        $response = new Vtiger_Response();
        $response->setEmitType(Vtiger_Response::$EMIT_JSON);
        $response->setResult(array('caption' => vtranslate('JS_DELETED_SUCCESSFULLY_FOR', 'VGSDuplicateDetector')));
        $response->emit();
    }
开发者ID:Wasage,项目名称:werpa,代码行数:9,代码来源:deleteField.php

示例5: getModuleCustomNumberingData

 /**
  * Function to get Module custom numbering data
  * @param Vtiger_Request $request
  */
 public function getModuleCustomNumberingData(Vtiger_Request $request)
 {
     $sourceModule = $request->get('sourceModule');
     $moduleModel = Settings_Vtiger_CustomRecordNumberingModule_Model::getInstance($sourceModule);
     $moduleData = $moduleModel->getModuleCustomNumberingData();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($moduleData);
     $response->emit();
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:14,代码来源:CustomRecordNumberingAjax.php

示例6: getModuleCustomNumberingData

 /**
  * Function to get Module custom numbering data
  * @param Vtiger_Request $request
  */
 public function getModuleCustomNumberingData(Vtiger_Request $request)
 {
     $sourceModule = $request->get('sourceModule');
     $moduleModel = Settings_Vtiger_CustomRecordNumberingModule_Model::getInstance($sourceModule);
     // SalesPlatform.ru begin: Added separate numbering for self organizations
     $moduleData = $moduleModel->getModuleCustomNumberingData($request->get('spCompany'));
     //$moduleData = $moduleModel->getModuleCustomNumberingData();
     // SalesPlatform.ru end
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($moduleData);
     $response->emit();
 }
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:17,代码来源:CustomRecordNumberingAjax.php

示例7: process

 function process($request)
 {
     $pbxmanagerController = new PBXManager_PBXManager_Controller();
     $connector = $pbxmanagerController->getConnector();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     if ($this->validateRequest($connector->getVtigerSecretKey(), $request)) {
         $crmUserExtension = $this->getCrmUserExtension($request->get('callerNumber'));
         $response->setResult(array('crmUserExtension' => $crmUserExtension));
     } else {
         $response->setError(400, 'Invalid request params');
     }
     $response->emit();
 }
开发者ID:DeliveryPLANET,项目名称:vTiger,代码行数:14,代码来源:SPAgi.php

示例8: process

 public function process(Vtiger_Request $request)
 {
     global $log, $adb, $moduleName;
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $request->set('assigned_user_id', $currentUserModel->getId());
     $request->set('userid', $currentUserModel->getId());
     $recordModel = $this->saveRecord($request);
     $fieldModelList = $recordModel->getModule()->getFields();
     $result = array();
     foreach ($fieldModelList as $fieldName => $fieldModel) {
         $fieldValue = $recordModel->get($fieldName);
         $result[$fieldName] = array('value' => $fieldValue, 'display_value' => $fieldModel->getDisplayValue($fieldValue));
     }
     $result['id'] = $recordModel->getId();
     $result['_recordLabel'] = $recordModel->getName();
     $result['_recordId'] = $recordModel->getId();
     //modify by jmangarret 11jun2015 Enviar email
     $idCaso = $request->get("related_to");
     $userid = $request->get("userid");
     $comment = $request->get("commentcontent");
     $query = $adb->pquery("select smcreatorid, smownerid from vtiger_crmentity where setype='HelpDesk' and crmid = ? ", array($idCaso));
     $row = $adb->fetchByAssoc($query);
     $idowner = $row['smownerid'];
     $idcreator = $row['smcreatorid'];
     if ($userid == $idowner) {
         $userid = $idcreator;
     } else {
         $userid = $idowner;
     }
     $query = $adb->pquery("select * from vtiger_troubletickets where ticketid = ? ", array($idCaso));
     $row = $adb->fetchByAssoc($query);
     $title = $row['title'];
     //Para Validar si es un comentario de un caso
     $ticket = $row['ticket_no'];
     //Para Validar si es un comentario de un caso
     if ($title && $idowner != $idcreator) {
         $query = $adb->pquery("select * from vtiger_users where id = ? ", array($userid));
         $row = $adb->fetchByAssoc($query);
         $email = $row["email1"];
         $nombre = $row["first_name"];
         $asunto = "Informacion";
         $mensaje = " \n\t\t\t\t<html> \n\t\t\t\t<head> \n\t\t\t\t<title>Info - Tu Agencia 24</title> \n\t\t\t\t</head> \n\t\t\t\t<body> \n\t\t\t\t<p>" . $nombre . ",</p>\n\t\t\t\t<p>El siguiente caso ha sido comentado:</p>\n\t\t\t\t<p><b>Nro. Ticket: </b>" . $ticket . "</p>\n\t\t\t\t<p><b>Caso: </b>" . $title . "</p>\n\t\t\t\t<p><b>Comentario: </b>" . $comment . "</p>\n\t\t\t\t<BR><BR><BR>\n\t\t\t\t<i>\n\t\t\t\tGracias,\t\t\n\t\t\t\t<p>Equipo TuAgencia24.com</p>\n\t\t\t\t</i>\n\t\t\t\t</body> \n\t\t\t\t</html> ";
         enviarEmail($email, $asunto, $mensaje);
     }
     //Fin enviar email
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:50,代码来源:SaveAjax.php

示例9: getRecordsCount

 /**
  * Function returns the number of records for the current filter
  * @param Vtiger_Request $request
  */
 function getRecordsCount(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $cvId = $request->get('viewname');
     $count = $this->getListViewCount($request);
     $result = array();
     $result['module'] = $moduleName;
     $result['viewname'] = $cvId;
     $result['count'] = $count;
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:18,代码来源:ListAjax.php

示例10: deleteRule

 public function deleteRule(Vtiger_Request $request)
 {
     $forModule = $request->get('for_module');
     $ruleId = $request->get('record');
     $moduleModel = Settings_SharingAccess_Module_Model::getInstance($forModule);
     $ruleModel = Settings_SharingAccess_Rule_Model::getInstance($moduleModel, $ruleId);
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     try {
         $ruleModel->delete();
     } catch (AppException $e) {
         $response->setError('Deleting Sharing Access Rule failed');
     }
     $response->emit();
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:15,代码来源:IndexAjax.php

示例11: process

 public function process(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $recordId = $request->get('record');
     $parentRoleId = $request->get('parent_roleid');
     $parentRole = Settings_Roles_Record_Model::getInstanceById($parentRoleId);
     $recordModel = Settings_Roles_Record_Model::getInstanceById($recordId);
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     try {
         $recordModel->moveTo($parentRole);
     } catch (AppException $e) {
         $response->setError('Move Role Failed');
     }
     $response->emit();
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:16,代码来源:MoveAjax.php

示例12: process

 public function process(Vtiger_Request $request)
 {
     $db = PearDatabase::getInstance();
     //result array to send as json response
     $result = array();
     $moduleName = $request->getModule();
     $moduleModel = Settings_GravityForm_Module_Model::getInstance($moduleName);
     $moduleModel->set('url', $request->get('url'));
     $moduleModel->set('api_key', $request->get('api_key'));
     $moduleModel->set('private_key', $request->get('private_key'));
     $moduleModel->save_config($request);
     $result['success'] = true;
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
开发者ID:regisvidal,项目名称:vgravityform,代码行数:17,代码来源:Save.php

示例13: process

 public function process(Vtiger_Request $request)
 {
     $modulePermissions = $request->get('permissions');
     $modulePermissions[4] = $modulePermissions[6];
     foreach ($modulePermissions as $tabId => $permission) {
         $moduleModel = Settings_SharingAccess_Module_Model::getInstance($tabId);
         $moduleModel->set('permission', $permission);
         try {
             $moduleModel->save();
         } catch (AppException $e) {
         }
     }
     Settings_SharingAccess_Module_Model::recalculateSharingRules();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->emit();
 }
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:17,代码来源:SaveAjax.php

示例14: sendResponse

 protected function sendResponse($success, $callId)
 {
     $response = new Vtiger_Response();
     if ($success) {
         $response->setResult(array('success' => true, 'callId' => $callId));
     } else {
         $response->setResult(array('success' => false, 'callId' => $callId));
     }
     // Support JSONP
     if (!empty($_REQUEST['callback'])) {
         $callback = vtlib_purify($_REQUEST['callback']);
         $response->setEmitType('4');
         $response->setEmitJSONP($callback);
         $response->emit();
     } else {
         $response->emit();
     }
 }
开发者ID:xrstf,项目名称:vtiger-mirror,代码行数:18,代码来源:CheckCaptcha.php

示例15: getRecordsCount

 /**
  * Function to get related Records count from this relation
  * @param <Vtiger_Request> $request
  * @return <Number> Number of record from this relation
  */
 public function getRecordsCount(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $relatedModuleName = $request->get('relatedModule');
     $parentId = $request->get('record');
     $label = $request->get('tab_label');
     $parentRecordModel = Vtiger_Record_Model::getInstanceById($parentId, $moduleName);
     $relationListView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $relatedModuleName, $label);
     $count = $relationListView->getRelatedEntriesCount();
     $result = array();
     $result['module'] = $moduleName;
     $result['viewname'] = $cvId;
     $result['count'] = $count;
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:23,代码来源:DetailAjax.php


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