public function SendReply() { $pn_transaction_id = $this->request->getParameter('transaction_id', pInteger); $t_trans = new ca_commerce_transactions($pn_transaction_id); //$this->view->setVar('communication_id', $pn_communication_id); $this->view->setVar('transaction_id', $pn_transaction_id); if ($t_trans->haveAccessToTransaction($this->request->getUserID())) { $t_trans->sendInstitutionMessage('L', $this->request->getParameter('subject', pString), $this->request->getParameter('message', pString), $this->request->getUserID()); $this->Index(); } else { $this->view->setVar('transaction', null); $this->render('reply_to_communication_html.php'); } }
public function SaveCommunications() { if (!$this->opt_order->getPrimaryKey()) { $this->Edit(); return; } $pn_transaction_id = $this->request->getParameter('transaction_id', pInteger); $t_trans = new ca_commerce_transactions($pn_transaction_id); //$this->view->setVar('communication_id', $pn_communication_id); $this->view->setVar('transaction_id', $pn_transaction_id); if ($t_trans->haveAccessToTransaction($this->request->getUserID())) { if ($this->request->getParameter('message', pString)) { if ($t_trans->sendInstitutionMessage('L', $this->request->getParameter('subject', pString), $this->request->getParameter('message', pString), $this->request->getUserID())) { $this->notification->addNotification(_t('Message has been sent'), __NOTIFICATION_TYPE_INFO__); } else { $this->notification->addNotification(_t('Errors occurred when sending message: %1', join('; ', $t_trans->getErrors())), __NOTIFICATION_TYPE_ERROR__); } } else { $this->notification->addNotification(_t('There were errors sending your message: You must enter message text.'), __NOTIFICATION_TYPE_ERROR__); } } else { $this->notification->addNotification(_t('You do not have access to this transaction'), __NOTIFICATION_TYPE_ERROR__); } $this->Communications(); }