public function del($ids) { $ids = is_array($ids) ? $ids : explode(",", $ids); foreach ($ids as $id) { $this->deleteByPk($id); FlowFormVersion::model()->deleteAllByAttributes(array("formid" => $id)); } }
public function actionDel() { $verID = intval(EnvUtil::getRequest("verid")); if (FlowFormVersion::model()->deleteByPk($verID)) { $this->ajaxReturn(array("isSuccess" => true)); } else { $this->ajaxReturn(array("isSuccess" => false)); } }
public function actionPreview() { $formId = intval(EnvUtil::getRequest("formid")); $ver = intval(EnvUtil::getRequest("verid")); if (!$ver) { $arr = FlowFormType::model()->fetchByPk($formId); } else { $arr = FlowFormVersion::model()->fetchByPk($ver); } if ($arr) { $form = new ICFlowForm($arr["formid"]); $printmodel = $form->printmodelshort; $hidden = $read = array(); $viewer = new ICFlowFormViewer(array("form" => $form)); $viewer->handleForm($printmodel, $hidden, $read, true); $data = array("formname" => $form->formname, "printmodel" => $printmodel, "script" => $form->script, "css" => $form->css); $this->layout = false; $this->render("preview", $data); } }