Example #1
0
 public function actionDel()
 {
     if (EnvUtil::submitCheck("formhash")) {
         $id = EnvUtil::getRequest("id");
         $ruleId = StringUtil::filterStr($id);
         if (!empty($ruleId)) {
             $res = FlowRule::model()->deleteAll(sprintf("FIND_IN_SET(ruleid,'%s') AND uid = %d", $ruleId, $this->uid));
             $this->ajaxReturn(array("isSuccess" => !!$res));
         }
     }
 }
Example #2
0
 public function delFlow($flowIds)
 {
     $ids = is_array($flowIds) ? $flowIds : explode(",", $flowIds);
     $sqlCondition = sprintf("FIND_IN_SET(flowid,'%s')", implode(",", $ids));
     $this->clearFlow($ids);
     $uid = Ibos::app()->user->uid;
     foreach ($ids as $id) {
         $flow = $this->fetchByPk($id);
         $content = Ibos::lang("Del flow", "workflow.default", array("{flowName}" => $flow["name"]));
         FlowManageLog::model()->log($id, $flow["name"], $uid, 3, $content);
     }
     $delFlow = $this->deleteByPk($ids);
     FlowProcess::model()->deleteAll($sqlCondition);
     FlowRule::model()->deleteAll($sqlCondition);
     FlowPermission::model()->deleteAll($sqlCondition);
     if ($delFlow) {
         return true;
     } else {
         return false;
     }
 }