[Решено] ask advance support ticket 2.0.1

Тема в разделе "OpenCart", создана пользователем crist, 16 сен 2014.

  1. crist

    crist

    Регистрация:
    2 окт 2013
    Сообщения:
    269
    Симпатии:
    503
    using advance support ticket 2.0.1
    everthing normal
    user can chat
    admin can reply, until
    user can not reply what admin say

    always redirect to
    Код:
    index.php?subscribe_email=&subscribe_name=Put+your+email+address+here
    controller
    Код:
        
      if ( isset($this->request->get['ticket_id']) ){
                $ticket_id = $this->request->get['ticket_id'];
            }
         
            $ticket = $this->model_ticket_ticket->getTicket( $ticket_id );
            if($ticket['ticket_customer_id']!=$this->customer->getId()){
                $this->redirect($this->url->link('ticket/ticket_manage'));
            }
            if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
                $this->request->post['ticket_id'] = $ticket_id;
                $this->model_ticket_message->addMessage($this->request->post);
                $this->model_ticket_ticket->lastUpdate($ticket_id, $this->customer->getFirstname() . ' ' . $this->customer->getLastname());    
                $this->redirect($this->url->link('ticket/detail/view', '&ticket_id=' . $ticket_id));
            }
    .tpl
    Код:
              <?php if($ticket['ticket_status']!='Resolved'){ ?>
              <a class="btn btn-success" onclick="$('form').submit();"><span><?php echo $button_save; ?></span></a>
              <?php } ?>
              <a class="btn btn-danger" style="color: white;" href="<?php echo $cancel; ?>"><span><?php echo $button_cancel?></span></a>
            </div>
    model
    Код:
        public function addMessage($data) {
            if (!isset($data['file'])){
                $data['file'] = '';
            }   
              $this->db->query("INSERT INTO " . DB_PREFIX . "ticket_message SET content = '" . $this->db->escape(nl2br($data['message'])) . "', ticket_id = '" . (int)$data['ticket_id'] . "', is_user = 1, created = NOW(), file = '" . (string)$data['file'] . "'");
        }
    thanks before


    update. nevermind [form] the secret :banghead:
     
    Последнее редактирование: 17 сен 2014