コード例 #1
0
 function execute()
 {
     $id = Request::post('id');
     $status = Request::post('status');
     $model = new connectionFeedbackModel();
     $model->setStatus($id, $status, true);
 }
コード例 #2
0
 function execute()
 {
     $id = Request::post('id');
     $this->frame = false;
     $model = new connectionFeedbackModel();
     $this->smarty->assign('ticket', $model->getTicket($id));
 }
コード例 #3
0
 function add($answer)
 {
     $model = new connectionFeedbackModel();
     if (!isset($answer['ticket']) || !isset($answer['message'])) {
         return false;
     }
     if (!$model->getTicket($answer['ticket'])) {
         return false;
     }
     $data = array();
     $data['ticket'] = (int) $answer['ticket'];
     $data['message'] = nl2br(htmlspecialchars($answer['message']));
     $data['user'] = (int) $answer['user'];
     $data['date'] = strtotime('now');
     $data['attachment'] = array();
     if (!isset($answer['type'])) {
         $data['type'] = 'message';
     } else {
         $data['type'] = $answer['type'];
         $data['status'] = $answer['status'];
     }
     if (isset($answer['attachment']) && is_array($answer['attachment']) && sizeof($answer['attachment']) > 0) {
         foreach ($answer['attachment'] as $attachment) {
             if (is_numeric((int) $attachment) && (int) $attachment > 0) {
                 $data['attachment'][] = (int) $attachment;
             }
         }
     }
     return $this->insert($data);
 }
コード例 #4
0
 function execute()
 {
     $user = ConnectionHelper::userLogin();
     $model = new connectionFeedbackModel();
     $list = $model->where(array('contact' => (int) $user['id']))->sort('date', -1)->fetchAll();
     return array('list' => $list);
 }
コード例 #5
0
 function execute()
 {
     $ticketID = (int) Request::get('ticket_id');
     $model = new connectionFeedbackModel();
     $ticket = $model->getTicket($ticketID);
     if (!$ticket) {
         $this->showNotFound();
         return;
     }
     return array('ticket' => $ticket, 'feedbackModel' => $model);
 }
コード例 #6
0
 function execute()
 {
     if (!Request::post('feedback')) {
         Request::redirect('/');
     }
     $feedback = Request::post('feedback');
     $model = new connectionFeedbackModel();
     $ticket = $model->add($feedback);
     if (isset($feedback['ajax'])) {
         echo json_encode(array('title' => '[`Title feedback success send message`]', 'content' => '[`Title feedback number ticket`]: ' . $ticket . '<br>[`Text feedback success send message`]'));
         $this->end();
     }
     return array('ticket' => $ticket);
 }
コード例 #7
0
 function execute()
 {
     $id = Request::post('id');
     connectionFeedbackModel::create()->where(array('id' => (int) $id))->delete();
     connectionFeedbackAnswerModel::create()->where(array('ticket' => (int) $id))->delete();
 }
コード例 #8
0
 function execute()
 {
     $model = new connectionFeedbackModel();
     $list = $model->getByStatus(Request::get('list'));
     $this->smarty->assign('tickets', $list);
 }
コード例 #9
0
 function execute()
 {
     connectionFeedbackModel::create()->setStatus((int) Request::post('ticket'), Request::post('status'), false);
 }