예제 #1
0
 public function fetchAllByUserPurv($uid)
 {
     $list = $this->fetchAllSortByPk("catid", array("order" => "sort ASC"));
     foreach ($list as $index => &$category) {
         if (WfCommonUtil::checkDeptPurv($uid, $category["deptid"])) {
             continue;
         } else {
             unset($list[$index]);
         }
     }
     return $list;
 }
예제 #2
0
 public function fetchAllOnOptListByUid($uid, $filter = true)
 {
     $temp = array();
     $list = $this->fetchAllForm();
     if (!empty($list)) {
         while (list(, $form) = each($list)) {
             if (!$filter || WfCommonUtil::checkDeptPurv($uid, $form["deptid"])) {
                 $data = array("id" => $form["formid"], "text" => $form["formname"]);
                 if (!$form["catid"]) {
                     $form["catid"] = 0;
                     $form["catname"] = "未分类";
                 }
                 if (!isset($temp[$form["catid"]])) {
                     $temp[$form["catid"]]["text"] = $form["catname"];
                     $temp[$form["catid"]]["children"] = array();
                 }
                 $temp[$form["catid"]]["children"][] = $data;
             }
         }
     }
     $result = array_merge(array(), $temp);
     return $result;
 }
예제 #3
0
 public function actionExport()
 {
     if ($this->flowid) {
         $flow = FlowType::model()->fetchByPk($this->flowid);
         $checkPurv = WfCommonUtil::checkDeptPurv($this->uid, $flow["deptid"]);
         if ($checkPurv) {
             WfTypeUtil::export($this->flowid);
         }
     }
     exit("Access Denied");
 }
예제 #4
0
 protected function handleFormData($list)
 {
     $return = array();
     if (!empty($list)) {
         $depts = DepartmentUtil::loadDepartment();
         $undefined = Ibos::lang("Undefined");
         $sysdept = Ibos::lang("Form sys dept");
         foreach ($list as $form) {
             if (!empty($form["formid"]) && WfCommonUtil::checkDeptPurv($this->uid, $form["deptid"])) {
                 $form["id"] = $form["formid"];
                 $form["name"] = $form["formname"];
                 $form["catelog"] = $form["catid"];
                 if (!isset($form["flow"]) || empty($form["flow"])) {
                     $form["flow"] = $undefined;
                 }
                 $form["department"] = isset($depts[$form["deptid"]]) ? $depts[$form["deptid"]]["deptname"] : $sysdept;
                 $form["departmentId"] = !empty($form["deptid"]) ? StringUtil::wrapId($form["deptid"], "d") : "";
                 $return[] = $form;
             }
         }
     }
     return $return;
 }
예제 #5
0
파일: FlowType.php 프로젝트: AxelPanda/ibos
 public function fetchAllByList($uid, $condition = "", $offset = 0, $limit = 10)
 {
     $list = Ibos::app()->db->createCommand()->select("ft.*,fft.formname")->from("{{flow_type}} ft")->leftJoin("{{flow_form_type}} fft", "ft.formid = fft.formid")->where($condition)->order("ft.sort,ft.flowid")->offset(intval($offset))->limit(intval($limit))->queryAll();
     $return = array();
     foreach ($list as $value) {
         if (WfCommonUtil::checkDeptPurv($uid, $value["deptid"], $value["catid"])) {
             $value["formname"] = StringUtil::filterCleanHtml($value["formname"]);
             $value["flowcount"] = FlowRun::model()->countAllByFlowId($value["flowid"]);
             $value["delcount"] = FlowRun::model()->countDelFlowByFlowId($value["flowid"]);
             $return[] = $value;
         }
     }
     return (array) $return;
 }