public function __construct(ICFlowForm $form) { $cache = CacheUtil::get("form_" . $form->getID()); if (is_array($cache)) { $this->_cache = $cache; } parent::__construct($form); }
private static function handleExportSingleForm($id) { $form = new ICFlowForm($id); $content = self::handleExportContent($form->toArray()); $formName = self::handleExportTitle($form->formname); unset($form); return array("content" => $content, "title" => $formName); }
public function actionRestore() { $verID = intval(EnvUtil::getRequest("verid")); $ver = FlowFormVersion::model()->fetchByPk($verID); $formID = $ver["formid"]; foreach (FlowType::model()->fetchAllAssociatedFlowIDByFormID($formID) as $flowID) { $hasRun = FlowRun::model()->countAllByFlowId($flowID); if ($hasRun) { $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Formversion Still has run"))); } else { continue; } } unset($ver["formid"]); unset($ver["id"]); unset($ver["time"]); unset($ver["mark"]); FlowFormType::model()->modify($formID, $ver); $form = new ICFlowForm($formID); $form->getParser()->parse(true); $this->ajaxReturn(array("isSuccess" => true)); }
public function __construct(ICFlowForm $form) { $this->setAttributes($form->toArray()); }
public function actionDesign() { if (filter_input(INPUT_GET, "op") == "showcomponet") { $type = filter_input(INPUT_GET, "type"); return $this->renderPartial("ic" . $type, null, false); } $formId = intval(EnvUtil::getRequest("formid")); $mode = EnvUtil::getRequest("mode"); if (!in_array($mode, array("advanced", "simple"))) { $mode = "advanced"; } if (EnvUtil::submitCheck("formhash")) { $content = preg_replace("/<form.*?>(.*?)<\\/form>/is", "", $_POST["content"]); if ($_POST["op"] == "version") { $verMax = FlowFormVersion::model()->getMaxMark($formId); $mark = $verMax ? $verMax + 1 : 1; $oldForm = FlowFormType::model()->fetchByPk($formId); $data = array("formid" => $formId, "printmodel" => $oldForm["printmodel"], "printmodel_short" => $oldForm["printmodelshort"], "script" => $oldForm["script"], "css" => $oldForm["css"], "time" => TIMESTAMP, "mark" => $mark); FlowFormVersion::model()->add($data); MainUtil::setCookie("form_op_version", 1, 30, 0); } else { $this->setAllGuideInfo($formId); MainUtil::setCookie("form_op_save", 1, 30, 0); } FlowFormType::model()->modify($formId, array("printmodel" => $content)); CacheUtil::rm("form_" . $formId); $form = new ICFlowForm($formId); $form->parser->parse(); $url = $this->createUrl("formtype/design", array("mode" => $mode, "formid" => $formId)); $this->redirect($url); exit; } $form = new ICFlowForm($formId); $arr = $form->toArray(); $data = array("form" => $arr, "mode" => $mode, "formid" => $formId); $this->layout = false; $this->render("designer" . ucfirst($mode), $data, false, array("workflow.item")); }