Example #1
0
 public function change_more()
 {
     $ids = Lib_Req::any('ids');
     $is_from_svn = Lib_Req::any('from_svn');
     if ($is_from_svn) {
         $row = array('status' => Config_App::STATUS_RESOLVED, 'test_status' => Config_App::TEST_STATUS_NULL);
     } else {
         $row = Lib_Req::any('row');
         $this->_check_pri();
     }
     if ('' == $ids) {
         $this->on_msg('未选择');
     }
     $O_Ticket = new O_Ticket();
     $db = $O_Ticket->get_db();
     $sql = 'update ' . $O_Ticket->get_table() . ' set last_t=' . RUNTIME;
     foreach ($row as $k => $v) {
         $sql .= ', ' . $k . '="' . $v . '"';
     }
     $sql .= ' where id in(' . $ids . ')';
     $db->query($sql);
     if ($is_from_svn) {
         $author = Lib_Req::any('author');
         $author_name = $this->_get_role_id_by_svn($author);
         $O_TicketLog = new O_TicketLog();
         $O_TicketLog->name = $author_name;
         $O_TicketLog->k = '状态';
         $O_TicketLog->v = '已解决 svn version: ' . Lib_Req::any('version');
         $ids_explode = explode(',', $ids);
         foreach ($ids_explode as $id) {
             $O_Ticket = new O_Ticket();
             $O_Ticket->init_from_id($id);
             if ($O_Ticket->is_in_db()) {
                 $O_Ticket->log[] = $O_TicketLog;
                 $O_Ticket->set('log');
                 $O_Ticket->flush();
             }
         }
     }
     $this->ajax->add_eval_js('search();');
     $this->on_ajax();
 }
Example #2
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();
 }