Exemplo n.º 1
0
 protected function tplNameExists($name, $sid)
 {
     return FlowQueryTpl::model()->checkTplNameExists($name, $sid);
 }
Exemplo n.º 2
0
 public function actionAdd()
 {
     if (EnvUtil::submitCheck("formhash")) {
         $data = $this->getPostData();
         $data["flowconditions"] = serialize($data["flowconditions"]);
         $data["groupbyfields"] = serialize($data["groupbyfields"]);
         $data["createtime"] = TIMESTAMP;
         if (FlowQueryTpl::model()->checkTplNameExists($data["tplname"])) {
             $data["tplname"] .= StringUtil::random(3);
         }
         $newID = FlowQueryTpl::model()->add($data, true);
         $this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("query/search", array("id" => $newID)));
     }
 }