Esempio n. 1
0
 /**
  * 设置审核步骤与用户的关联
  *
  * @access private
  */
 private function setRelation()
 {
     $this->checkFormHash();
     $stepId = (int) Request::input('stepId');
     $workflowId = (int) Request::input('workflowId');
     $userIds = Request::input('ids');
     if (!$userIds) {
         return Js::error(Lang::get('workflow.relation_user_empty'));
     }
     if (!$stepId or !$workflowId or !is_array($userIds)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     $userIds = array_map('intval', $userIds);
     $stepInfo = $this->workflowProcess->workflowStepInfo(['id' => $stepId]);
     if (empty($stepInfo)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     if ($this->workflowProcess->setRelation($workflowId, $stepId, $userIds)) {
         $this->setActionLog(['userIds' => $userIds, 'stepInfo' => $stepInfo]);
         return Js::alert(Lang::get('common.action_success'));
     }
     return Js::error($this->workflowProcess->getErrorMessage());
 }