Beispiel #1
0
 public function actionGetField()
 {
     $flowId = intval(EnvUtil::getRequest("flowid"));
     $flow = new ICFlowType($flowId);
     $structure = $flow->form->parser->getStructure();
     $exceptType = array("sign");
     $field = WfFormUtil::getAllItemName($structure, $exceptType, "[A@],[B@]");
     $this->ajaxReturn(array("isSuccess" => true, "data" => $field));
 }
Beispiel #2
0
 public function actionExport()
 {
     $id = EnvUtil::getRequest("id");
     $idstr = StringUtil::filterStr(StringUtil::filterCleanHtml($id));
     WfFormUtil::export($idstr);
 }
Beispiel #3
0
 protected function handleFormItem(&$data)
 {
     $p = $data["prcs"];
     $processItem = !empty($p["processitem"]) ? explode(",", $p["processitem"]) : array();
     $hiddenItem = !empty($p["hiddenitem"]) ? explode(",", $p["hiddenitem"]) : array();
     $microItem = !empty($p["processitemauto"]) ? explode(",", $p["processitemauto"]) : array();
     $checkField = $checkRule = array();
     if (!empty($p["checkitem"])) {
         $items = explode(",", $p["checkitem"]);
         foreach ($items as $index => $item) {
             list($checkField[$index], $checkRule[$index]) = explode("=", $item);
         }
     }
     $data["check"] = $data["prcsItem"] = $data["microItem"] = $data["hiddenItem"] = $data["parentField"] = array();
     foreach ($data["structure"] as &$config) {
         if ($config["data-type"] !== "label") {
             $title = $config["data-title"];
             $id = $config["itemid"];
             if (in_array($title, $processItem)) {
                 $data["prcsItem"][] = $id;
             }
             if (in_array($title, $microItem)) {
                 $data["microItem"][] = $id;
             }
             if (in_array($title, $hiddenItem)) {
                 $data["hiddenItem"][] = $id;
             }
             if (in_array($title, $checkField)) {
                 $index = array_search($title, $checkField);
                 $index & ($data["check"][$id] = $checkRule[$index]);
             }
             if ($config["data-type"] != "sign") {
                 $data["parentField"][] = $title;
             }
             $config["desc"] = $this->getFormFieldDesc($config, $data["lang"]);
         }
     }
     if (strstr($p["processitem"], "[A@],")) {
         $data["prcsItem"][] = "a";
     }
     if (!empty($data["check"])) {
         $data["checkStr"] = CJSON::encode($data["check"]);
     }
     $data["checkList"] = Regular::model()->fetchAll();
     $data["allItemName"] = WfFormUtil::getAllItemName($data["structure"], array(), "[A@],[B@]");
 }
Beispiel #4
0
 private function getAllItemName($var)
 {
     $flow = $var["flow"];
     if ($var["processid"] == 1) {
         $allItemName = WfFormUtil::getAllItemName($flow->form->structure, array(), ($flow->allowattachment == "1" ? "" : "[A@]") . "[B@]");
         unset($flow);
     } else {
         $allItemName = FlowRunProcess::model()->fetchFreeitem($var["runid"], $var["processid"]);
     }
     return $allItemName;
 }