Example #1
0
 public function index()
 {
     $id = Lib_Req::post('id');
     $O_Ticket = new O_Ticket();
     $O_Ticket->init_from_id($id);
     if (!$O_Ticket->is_in_db()) {
         $this->on_msg('ID 不正确');
     }
     $this->view->ticket = $O_Ticket;
     $this->ajax->popup('ticket');
     $this->on_ajax();
 }
Example #2
0
 public function test_report()
 {
     $row = Lib_Req::post('row');
     $O_Ticket = new O_Ticket();
     $O_Ticket->init_from_id($row['id']);
     if (!$O_Ticket->is_in_db()) {
         $this->on_msg('不存在');
     }
     foreach ($row as $k => $v) {
         if ($k != $O_Ticket->get_pk_name()) {
             $O_Ticket->set($k, '=', $v);
         }
     }
     $content = Lib_Req::post('content');
     $O_TicketTestReport = new O_TicketTestReport();
     $O_TicketTestReport->acter_name = $this->acter->id;
     $O_TicketTestReport->status = $O_Ticket->test_status;
     $O_TicketTestReport->content = $content;
     $O_Ticket->test_report[] = $O_TicketTestReport;
     $O_Ticket->set('test_report');
     $O_Ticket->flush();
     $this->view->ticket = $O_Ticket;
     $this->ajax->add_innerhtml('#ticket_report', 'ticket_report');
     $this->ajax->add_eval_js('FCKeditorAPI.GetInstance("ticket_test_report_content").SetData("");');
     $this->on_ajax();
 }
Example #3
0
 public function set_department()
 {
     $name = trim(Lib_Req::post('name'));
     if ('' == $name) {
         $this->on_ajax();
     }
     $O_Sys = O_Sys::readone(O_Sys::SYS_DEPARTMENT);
     if (Lib_Req::post('delete')) {
         if ('admin' == $name) {
             $this->on_ajax();
         }
         if (!isset($O_Sys->list[$name])) {
             $this->on_ajax();
         }
         unset($O_Sys->list[$name]);
         $O_Ticket = new O_Ticket();
         $db = $O_Ticket->get_db();
         $sql = 'update ' . $O_Ticket->get_table() . ' set department="admin" where department="' . $name . '"';
         $db->query($sql);
     } else {
         $O_Sys->list[$name] = $name;
     }
     $O_Sys->set('list');
     $O_Sys->flush();
     $this->get_department_list();
 }