コード例 #1
0
 public function ajaxSaveLabelRef4Record($request, $response)
 {
     /*{{{*/
     $customerInfoRecord = DAL::get()->find('FollowupCustomerInfoRecord', $request->recordid);
     if ($request->checked) {
         $labelRef = WendaClient::getInstance()->addLabelRef($customerInfoRecord, $request->labelid);
         if ($labelRef instanceof LabelRef) {
             echo 'ok';
         }
     } else {
         $success = WendaClient::getInstance()->deleteLabelRef($customerInfoRecord->id, $request->labelid);
         if ($success) {
             echo 'ok';
         }
     }
     return parent::DIRECT_OUTPUT;
 }
コード例 #2
0
 public function modifyNfsSubTaskPostImp($nfsSubTask, $params)
 {
     $labelRefs = DAL::get()->find_all_by_sourceid_and_sourcetype('LabelRef', $nfsSubTask->id, get_class($nfsSubTask));
     foreach ($labelRefs as $labelRef) {
         $label = $labelRef->label;
         WendaClient::getInstance()->deleteLabelRef($nfsSubTask->id, $label->id);
     }
     if (isset($params['sjbiaoqian']) && $params['sjbiaoqian']) {
         $sjLabelRefId = WendaClient::getInstance()->addLabelRef($nfsSubTask, $params['sjbiaoqian']);
     }
     if (isset($params['xmbiaoqian']) && $params['xmbiaoqian']) {
         $xmLabelRefId = WendaClient::getInstance()->addLabelRef($nfsSubTask, $params['xmbiaoqian']);
     }
     NfsSubTaskClient::getInstance()->modifyNfsSubTask($nfsSubTask->id, $params);
 }
コード例 #3
0
 public function changeLabelDesc($request, $response)
 {
     /*{{{*/
     WendaClient::getInstance()->changeLabelDescription($request->labelid, $request->description);
     $response->setRedirect('/nfsaudit/showlabeldesc?labelid=' . $request->labelid);
 }
コード例 #4
0
 public function createIntentionRecord($request, $response)
 {
     /*{{{*/
     $request->convertToGBK();
     $sheets = $request->sheets;
     $phoneNumber = $request->phoneNumber;
     $answerSheetArr = WendaClient::getInstance()->processAnswerSheets($sheets, $this->curInspector);
     $answerSheet = reset($answerSheetArr['add']);
     $answer = $answerSheet->getAnswerByQuestionContent(IntentionRecord::$questionDesc[IntentionRecord::QUESTION_6]);
     $intentionRecord = IntentionClient::getInstance()->createIntentionRecord($answer->content, $this->curInspector, $phoneNumber, XDateTime::now(), $answerSheet->id);
     $url = $response->router->urlfor("intention/showintentionrecorddetail", array('answerSheetId' => $intentionRecord->answersheetId, 'inspectorUserName' => $intentionRecord->inspector->realName, 'startTime' => $intentionRecord->answeringTime));
     $response->setRedirect($url);
     return parent::DIRECT_OUTPUT;
 }
コード例 #5
0
 public function updateWrapper($request, $response)
 {
     /*{{{*/
     DBC::requireNotEmptyString($request->id, '问题包id不可为空!');
     $arr = XString::convertEncoding($_REQUEST, 'gbk', 'utf8');
     $wrapper = WendaClient::getInstance()->modifyQuestionWrapper($request->id, $arr['wrappername'], $arr['wrapperinterval']);
     echo '{"res":"success", "name":"' . $wrapper->name . '", "interval":"' . $wrapper->intervalDay . '"}';
     return self::DIRECT_OUTPUT;
 }
コード例 #6
0
 public function updateCheckupAnswer($request, $response)
 {
     /*{{{*/
     $sheets = $request->sheets;
     $checkupAnswerSheet = DAL::get()->find('CheckupAnswerSheet', $request->checkupAnswerSheetId);
     $textLabels = $request->getRequest('textLabels', array());
     if ($checkupAnswerSheet->isNull()) {
         throw new BizException('CheckupAnswerSheet不存在!');
     }
     $answerSheetIds = CheckupWenDaClient::getInstance()->modifyStructedCheckupAnswerSheet($checkupAnswerSheet->user, $sheets, $this->auditor);
     WendaClient::getInstance()->auditLabels2Answers($answerSheetIds, $textLabels);
     $response->setRedirect($response->router->urlfor('checkup/inputcheckupanswersheet', array('sourceId' => $checkupAnswerSheet->id)));
 }