public function doAction() { if (empty($_SESSION['cid'])) { //user not logged throw new Exception("User Not Logged."); } if ($this->res_type == "prj") { $old_status = getProjectJobData($this->res_id); $strOld = ''; foreach ($old_status as $item) { $strOld .= $item['id'] . ':' . $item['status_owner'] . ','; } $strOld = trim($strOld, ','); $this->result['old_status'] = $strOld; updateJobsStatus($this->res_type, $this->res_id, $this->new_status, $this->only_if, $this->undo); $start = ($this->page - 1) * $this->step + $this->step - 1; $projects = ManageUtils::queryProjects($start, 1, $this->search_in_pname, $this->search_source, $this->search_target, $this->search_status, $this->search_onlycompleted, $this->filter_enabled, null); $projnum = getProjectsNumber($start, $this->step, $this->search_in_pname, $this->search_source, $this->search_target, $this->search_status, $this->search_onlycompleted, $this->filter_enabled); $this->result['code'] = 1; $this->result['data'] = "OK"; $this->result['status'] = $this->new_status; $this->result['newItem'] = $projects; $this->result['page'] = $this->page; $this->result['pnumber'] = $projnum[0]['c']; } else { updateJobsStatus($this->res_type, $this->res_id, $this->new_status, $this->only_if, $this->undo, $this->job_password); $this->result['code'] = 1; $this->result['data'] = "OK"; $this->result['status'] = $this->new_status; } }
public function doAction() { $start = ($this->page - 1) * $this->step; if (empty($_SESSION['cid'])) { throw new Exception('User not Logged'); } $projects = ManageUtils::queryProjects($start, $this->step, $this->search_in_pname, $this->search_source, $this->search_target, $this->search_status, $this->search_onlycompleted, $this->filter_enabled, $this->project_id); // Log::doLog( $projects ); $projnum = getProjectsNumber($start, $this->step, $this->search_in_pname, $this->search_source, $this->search_target, $this->search_status, $this->search_onlycompleted, $this->filter_enabled); $this->result['data'] = json_encode($projects); $this->result['page'] = $this->page; $this->result['pnumber'] = $projnum[0]['c']; $this->result['pageStep'] = $this->step; }