Esempio n. 1
0
 /**
  * 删除工作流
  *
  * @access public
  */
 public function delete(Process $manager)
 {
     $id = array_map('intval', (array) Request::input('id'));
     $info = $manager->workflowInfos(['ids' => $id]);
     if (!$manager->deleteWorkflow(['ids' => $id])) {
         return responseJson($manager->getErrorMessage());
     }
     $this->setActionLog(['workflowInfo' => $info]);
     return responseJson(Lang::get('common.action_success'), true);
 }
Esempio n. 2
0
 /**
  * 设置审核步骤与用户的关联
  *
  * @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());
 }
Esempio n. 3
0
 /**
  * 删除工作流
  *
  * @access public
  */
 public function delete()
 {
     $id = Request::input('id');
     if (!is_array($id)) {
         if (!$id) {
             return responseJson(Lang::get('common.action_error'));
         }
         $id = array($id);
     }
     $id = array_map('intval', $id);
     $manager = new Process();
     $info = $manager->workflowInfos(['ids' => $id]);
     if ($manager->deleteWorkflow(['ids' => $id])) {
         $this->setActionLog(['workflowInfo' => $info]);
         return responseJson(Lang::get('common.action_success'), true);
     }
     return responseJson($manager->getErrorMessage());
 }