コード例 #1
0
ファイル: StepController.php プロジェクト: pfdtk/bmsys
 /**
  * 设置审核步骤与用户的关联
  *
  * @access private
  */
 private function setRelation()
 {
     $this->checkFormHash();
     $stepId = (int) Request::input('stepId');
     $workflowId = (int) Request::input('workflowId');
     $userIds = Request::input('ids');
     if (!$stepId or !$workflowId or !is_array($userIds)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     $userIds = array_map('intval', $userIds);
     $manager = new Process();
     $stepInfo = $manager->workflowStepInfo(['id' => $stepId]);
     if (empty($stepInfo)) {
         return Js::error(Lang::get('common.illegal_operation'));
     }
     if ($manager->setRelation($workflowId, $stepId, $userIds)) {
         $this->setActionLog(['userIds' => $userIds, 'stepInfo' => $stepInfo]);
         return Js::alert(Lang::get('common.action_success'));
     }
     return Js::error($manager->getErrorMessage());
 }