Example #1
0
  
版本:
<input forme="val" name="version" value="<?php 
echo $this->version;
?>
" type="text" class="inputstyle input_100" />
</p>
</div>

<p>
    状态:
<select forme="val" name="status" class="selectstyle">
<option value=0>全部</option>
<?php 
$status_list = Config_App::get_status_list();
echo Lib_Global::format_select_options($status_list, $this->status);
?>
</select>

&nbsp;&nbsp;
测试结果:
<select forme="val" name="test_status" class="selectstyle">
<option value=0>全部</option>
<?php 
$test_status_list = Config_App::get_test_status_list();
echo Lib_Global::format_select_options($test_status_list, $this->test_status);
?>
</select>

&nbsp;&nbsp;
Example #2
0
 public function edit()
 {
     $row = Lib_Req::post('row');
     if (isset($row['content'])) {
         //data:image
         if (false === strpos($row['content'], 'data:image')) {
         } else {
             $this->on_msg('图像格式不正确');
         }
     }
     $is_new = true;
     $O_Ticket = new O_Ticket();
     if ($row['id']) {
         //已经有
         $O_Ticket->init_from_id($row['id']);
         if (!$O_Ticket->is_in_db()) {
             $this->on_msg('不存在');
         }
         $is_new = false;
         //检查权限
         if (isset($row['acter_id']) || isset($row['status'])) {
             $this->_check_pri();
         } else {
             if ($this->acter_id != $O_Ticket->reporter_id) {
                 $this->_check_pri();
             }
         }
     } else {
         //新增
         $O_Ticket->status = Config_App::STATUS_NEW;
         $O_Ticket->reporter_id = $this->acter_id;
     }
     $changed = false;
     foreach ($row as $k => $v) {
         if (!$is_new && $v == $O_Ticket->{$k}) {
             continue;
         }
         $O_Ticket->set($k, '=', $v);
         $changed = true;
     }
     if ($is_new) {
         if (empty($O_Ticket->title) || empty($O_Ticket->content)) {
             $this->on_msg('标题或内容不能为空!');
         }
     }
     if (!$changed) {
         $this->on_msg('修改成功!');
     }
     $refresh_log = false;
     if (!$is_new) {
         $log_a = array('acter_id' => '负责人', 'status' => '状态', 'test_status' => '测试结果');
         $config = array('status' => Config_App::get_status_list(), 'test_status' => Config_App::get_test_status_list());
         $reason = Lib_Req::post('reason');
         foreach ($log_a as $log_column => $log_column_name) {
             if (isset($row[$log_column])) {
                 $O_TicketLog = new O_TicketLog();
                 $O_TicketLog->name = $this->acter->id;
                 $O_TicketLog->k = $log_column_name;
                 if ('acter_id' == $log_column) {
                     $O_TicketLog->v = $row['acter_id'];
                 } else {
                     $O_TicketLog->v = $config[$log_column][$O_Ticket->{$log_column}];
                 }
                 if ($reason) {
                     $O_TicketLog->v .= ' ' . $reason;
                 }
                 $O_Ticket->log[] = $O_TicketLog;
                 $O_Ticket->set('log');
                 $refresh_log = true;
             }
         }
     }
     $O_Ticket->flush();
     if ($refresh_log) {
         $this->view->ticket = $O_Ticket;
         $this->ajax->add_innerhtml('#ticket_log', 'ticket_log');
     }
     $save_and_next = Lib_Req::post('save_and_next');
     if (!$save_and_next) {
         $this->ajax->add_eval_js('msg("提交成功");');
     }
     $this->ajax->add_eval_js('search();');
     if ($is_new) {
         if ($save_and_next) {
             $this->index();
         } else {
             $this->ajax->add_eval_js('cls("ticket_one");');
         }
     }
     $this->on_ajax();
 }