Ejemplo n.º 1
0
 /**
  *
  */
 public function SendReply()
 {
     $pn_set_id = $this->request->getParameter('set_id', pInteger);
     $o_purifier = new HTMLPurifier();
     $t_trans = new ca_commerce_transactions();
     if (!$t_trans->load(array('set_id' => $pn_set_id))) {
         $t_trans->setMode(ACCESS_WRITE);
         $t_trans->set('user_id', $this->request->getUserID());
         $t_trans->set('short_description', "Transaction for set {$pn_set_id}");
         $t_trans->set('set_id', $pn_set_id);
         $t_trans->insert();
     }
     $t_comm = $t_trans->sendUserMessage('O', $o_purifier->purify($this->request->getParameter('subject', pString)), $o_purifier->purify($this->request->getParameter('message', pString)), $this->request->getUserID());
     if ($t_comm->numErrors() == 0) {
         $this->notification->addNotification(_t("Your inquiry was sent.  You will receive a response through this web site and by email soon."), __NOTIFICATION_TYPE_INFO__);
     } else {
         $this->notification->addNotification(_t("Your inquiry was not sent due to errors: %1", join("; ", $t_comm->getErrors())), __NOTIFICATION_TYPE_ERROR__);
     }
     $this->index();
 }
Ejemplo n.º 2
0
 /**
  *
  */
 public function SendReply()
 {
     $pn_order_id = $this->request->getParameter('order_id', pInteger);
     $pn_transaction_id = $this->request->getParameter('transaction_id', pInteger);
     $o_purifier = new HTMLPurifier();
     $t_trans = new ca_commerce_transactions();
     if ($t_trans->load($pn_transaction_id)) {
         $t_trans->sendUserMessage('O', $o_purifier->purify($this->request->getParameter('subject', pString)), $o_purifier->purify($this->request->getParameter('message', pString)), $this->request->getUserID());
         $this->notification->addNotification(_t("Sent message"), __NOTIFICATION_TYPE_INFO__);
     } else {
         $this->notification->addNotification(_t("Your message could not be sent"), __NOTIFICATION_TYPE_INFO__);
     }
     $this->ViewOrder();
 }