Esempio n. 1
0
 public function view_modify()
 {
     include WEB_PATH . 'model/dept.model.php';
     include WEB_PATH . 'model/action.model.php';
     include WEB_PATH . 'action/dept.action.php';
     include WEB_PATH . 'action/action.action.php';
     $deptid = isset($_GET['did']) ? intval($_GET['did']) : 0;
     $myselfid = $_SESSION[C('USER_AUTH_ID')];
     $modifydept = array();
     $usersingle = UserAct::getInstance();
     $deptsingle = DeptAct::getInstance();
     $jobsingle = JobAct::getInstance();
     $actionsingle = ActionAct::getInstance();
     $modifydept = $deptsingle->act_getDeptById($deptid);
     if ($deptid == 0) {
         echo 'You submit parameters are incorrect !';
         exit;
     }
     $this->smarty->assign("modifydept", $modifydept);
     $this->smarty->display('deptModify.htm');
 }
Esempio n. 2
0
 private function _checkReturnData($data, $errreturn)
 {
     if ($data === false) {
         self::$errCode = ActionModel::$errCode;
         self::$errMsg = ActionModel::$errMsg;
         return $errreturn;
     } elseif (empty($data)) {
         self::$errCode = 5806;
         self::$errMsg = 'There is no data!';
         if (self::$debug === true) {
             self::$errMsg .= 'The SQL is ' . ActionModel::$errMsg;
         }
         return $errreturn;
     } else {
         self::$errCode = 1;
         self::$errMsg = 'success';
         return $data;
     }
 }
Esempio n. 3
0
 public function view_add()
 {
     include WEB_PATH . 'model/dept.model.php';
     include WEB_PATH . 'model/action.model.php';
     include WEB_PATH . 'action/dept.action.php';
     include WEB_PATH . 'action/action.action.php';
     $myselfid = $_SESSION[C('USER_AUTH_ID')];
     $modifyuser = array();
     $modifypower = true;
     $usersingle = UserAct::getInstance();
     $deptsingle = DeptAct::getInstance();
     $jobsingle = JobAct::getInstance();
     $actionsingle = ActionAct::getInstance();
     $userself = $usersingle->act_getUserById($myselfid);
     $myjob = $jobsingle->act_getJobPowerById($userself['user_job']);
     $jobcondition = array();
     $jobcondition[] = "jobpower_system_id='{$userself['user_system_id']}'";
     $jobcondition[] = "job_company_id='{$userself['user_company']}'";
     $jobcondition[] = "(job_path LIKE '{$userself['user_job_path']}-%' OR job_path='{$userself['user_job_path']}')";
     $joblists = $jobsingle->act_getJobLists($jobcondition, 'job_dept_id ASC,job_level ASC');
     $deptlists = $deptsingle->act_getDeptLists();
     $basepowers = $myjob['user_independence'] == 1 ? json_decode($userself['user_power'], true) : json_decode($myjob['jobpower_power'], true);
     foreach ($basepowers as $groupname => $basepower) {
         foreach ($basepower as $key => $actionname) {
             $actioninfo = $actionsingle->act_getActionGroupByName($groupname, parent::$_systemid);
             if (!isset($basepowers[$groupname]['groupdesc'])) {
                 $basepowers[$groupname]['groupdesc'] = $actioninfo['group_description'];
             }
             $actioninfo = $actionsingle->act_getActionByName($actionname, $actioninfo['action_group_id']);
             $basepowers[$groupname]['action'][$key] = array();
             $basepowers[$groupname]['action'][$key]['actionname'] = $actioninfo['action_name'];
             $basepowers[$groupname]['action'][$key]['actiondesc'] = $actioninfo['action_description'];
             $basepowers[$groupname]['action'][$key]['actioncheck'] = 0;
         }
     }
     unset($editablepowers, $myjob['jobpower_power'], $modifyjobpower['jobpower_power']);
     $this->smarty->assign('joblists', $joblists);
     $this->smarty->assign('basepowers', $basepowers);
     $this->smarty->assign("deptlists", $deptlists);
     $this->smarty->display('jobAdd.htm');
 }
Esempio n. 4
0
 public function view_add()
 {
     include WEB_PATH . 'model/dept.model.php';
     include WEB_PATH . 'model/job.model.php';
     include WEB_PATH . 'model/action.model.php';
     include WEB_PATH . 'action/dept.action.php';
     include WEB_PATH . 'action/job.action.php';
     include WEB_PATH . 'action/action.action.php';
     $usercompany = parent::$_companyid;
     $myselfid = $_SESSION[C('USER_AUTH_ID')];
     $usersingle = UserAct::getInstance();
     $deptsingle = DeptAct::getInstance();
     $jobsingle = JobAct::getInstance();
     $actionsingle = ActionAct::getInstance();
     $userself = $usersingle->act_getUserById($myselfid);
     $jobcondition = array();
     $jobcondition[] = "jobpower_system_id='{$userself['user_system_id']}'";
     $jobcondition[] = "job_isdelete=0 AND jobpower_isdelete=0";
     //增加逻辑删除判断 2013-09-17
     $jobcondition[] = "job_company_id='{$userself['user_company']}'";
     $jobcondition[] = "(job_path LIKE '{$userself['user_job_path']}-%' OR job_path='{$userself['user_job_path']}')";
     $joblists = $jobsingle->act_getJobLists($jobcondition, 'job_dept_id ASC,job_level ASC');
     //增加当然登录用户默认为某个公司全部部门列表 add by guanyongjun 2014-03-18
     $deptlists = $deptsingle->act_getDeptLists(array("dept_isdelete=0", "dept_company_id='{$usercompany}'"));
     if ($userself['user_independence'] == 1) {
         $basepowers = json_decode($userself['user_power'], true);
     } else {
         $bjobpower = $jobsingle->act_getJobPowerById($userself['user_job']);
         $basepowers = json_decode($bjobpower['jobpower_power'], true);
     }
     foreach ($basepowers as $groupname => $basepower) {
         foreach ($basepower as $key => $actionname) {
             $actioninfo = $actionsingle->act_getActionGroupByName($groupname, parent::$_systemid);
             if (!isset($basepowers[$groupname]['groupdesc'])) {
                 $basepowers[$groupname]['groupdesc'] = $actioninfo['group_description'];
             }
             $actioninfo = $actionsingle->act_getActionByName($actionname, $actioninfo['action_group_id']);
             $basepowers[$groupname]['action'][$key] = array();
             $basepowers[$groupname]['action'][$key]['actionname'] = $actioninfo['action_name'];
             $basepowers[$groupname]['action'][$key]['actiondesc'] = $actioninfo['action_description'];
             $basepowers[$groupname]['action'][$key]['actioncheck'] = 0;
         }
     }
     unset($userself['user_power']);
     $this->smarty->assign('basepowers', $basepowers);
     $this->smarty->assign("userself", $userself);
     $this->smarty->assign("joblists", $joblists);
     $this->smarty->assign("deptlists", $deptlists);
     $this->smarty->display('admin/userAdd.htm');
 }