Пример #1
0
 public function __construct()
 {
     parent::__construct();
     if (Mage::getStoreConfig('zendesk/features/show_on_order')) {
         $this->_addButton('ticket_new', array('label' => Mage::helper('zendesk')->__('Create Ticket'), 'onclick' => 'setLocation(\'' . $this->getTicketUrl() . '\')', 'class' => 'zendesk'));
     }
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     $payment = $this->getOrder()->getPayment();
     $method = $payment->getMethodInstance()->getCode();
     $tid = $payment->getAdditionalInformation('Cielo_tid');
     if (!$tid) {
         return;
     }
     if ($method == "Maxima_Cielo_Cc") {
         if ($this->_isAllowedAction("cielo-capture")) {
             $this->_addButton('maxima_cielo_capture', array('label' => Mage::helper('Maxima_Cielo')->__('Capture'), 'onclick' => "captureCieloOrder('" . $tid . "', " . $this->getOrder()->getId() . ");", 'class' => 'go'));
         }
     }
     if ($method == "Maxima_Cielo_Cc" || $method == "Maxima_Cielo_Dc") {
         if ($this->_isAllowedAction("cielo-consult")) {
             $this->_addButton('maxima_cielo_consult', array('label' => Mage::helper('Maxima_Cielo')->__('Consult WebService'), 'onclick' => "loadCieloWebServiceData('" . $tid . "', " . $this->getOrder()->getId() . ");", 'class' => 'go'));
         }
     }
     if ($method == "Maxima_Cielo_Cc") {
         if ($this->_isAllowedAction("cielo-cancel")) {
             $this->_addButton('maxima_cielo_cancel', array('label' => Mage::helper('Maxima_Cielo')->__('Cancel on Cielo'), 'onclick' => "cancelCieloOrder('" . $tid . "', " . $this->getOrder()->getId() . ");", 'class' => 'go'));
         }
     }
 }
Пример #3
0
 public function __construct()
 {
     parent::__construct();
     if ($this->_hasPdfShippingLabels()) {
         $this->_addButton('zitec_print_shipping_label', array('label' => $this->_getHelper()->__('Print Shipping Labels'), 'onclick' => "setLocation('{$this->_getPrintShippingLabelsUrl()}')"));
     }
 }
Пример #4
0
 protected function _prepareLayout()
 {
     if ($this->getOrderId()) {
         $this->_addButton('send_email', array('label' => Mage::helper('amemail')->__('Send Email...'), 'onclick' => "setLocation('{$this->_getSendEmailUrl()}')"), 0);
     }
     return parent::_prepareLayout();
 }
Пример #5
0
 public function __construct()
 {
     parent::__construct();
     if (Mage::helper('core')->isModuleEnabled('Gamuza_Labels') && Mage::getStoreConfig('labels/settings/active') && $this->getOrder()->hasInvoices()) {
         $this->_addButton('order_label', array('label' => Mage::helper('labels')->__('Label'), 'onclick' => "popWin ('" . $this->getLabelUrl() . "', '','width=400,height=585,resizable=no,scrollbars=no')", 'class' => 'go'));
     }
 }
 public function __construct()
 {
     parent::__construct();
     $vendorOrder = Mage::registry('vendor_order');
     if ($vendorOrder) {
         if (!$vendorOrder->canCancel()) {
             $this->_removeButton('order_cancel');
         }
         if (!$vendorOrder->canCreditmemo()) {
             $this->_removeButton('order_creditmemo');
         }
         if (!$vendorOrder->canInvoice()) {
             $this->_removeButton('order_invoice');
         }
         if (!$vendorOrder->canShip()) {
             $this->_removeButton('order_ship');
         }
         if (true) {
             $this->_removeButton('order_edit');
         }
         if (true) {
             $this->_removeButton('send_notification');
         }
         if (!$vendorOrder->canReorder()) {
             $this->_removeButton('order_reorder');
         }
         if ($vendorOrder->isCanceled()) {
             $this->_removeButton('send_notification');
         }
     }
 }
Пример #7
0
 public function __construct()
 {
     parent::__construct();
     $order = $this->getOrder();
     $url = $this->getUrl('sendcloud/index/parcel', array('id' => $order->getId(), 'redirect' => 'order_view'));
     $onclick = "setLocation('{$url}');";
     $this->_addButton('sendtosendcloud', array('label' => Mage::helper('sales')->__('Doorsturen naar Sendcloud'), 'onclick' => $onclick, 'class' => 'go'), 0, 100, 'header', 'header');
 }
Пример #8
0
 public function __construct()
 {
     parent::__construct();
     if ($this->_isAllowedAction('review_payment') && $this->getOrder()->getPayment()->getMethod() == 'payu_account' && $this->getOrder()->getStatus() == 'pending_payment' && (int) Mage::getStoreConfig('payment/payu_account/selfreturn') == 0) {
         $this->_addButton('payu-complete', array('label' => Mage::helper('payu_account')->__('Complete PayU payment'), 'onclick' => 'setLocation(\'' . $this->getCompletePaymentUrl() . '\')', 'class' => ''), 0, 100, 'header', 'header');
         $this->_addButton('payu-cancel', array('label' => Mage::helper('payu_account')->__('Cancel PayU payment'), 'onclick' => 'setLocation(\'' . $this->getCancelPaymentUrl() . '\')', 'class' => ''), 0, 200, 'header', 'header');
     }
 }
Пример #9
0
 public function __construct()
 {
     parent::__construct();
     $enable = Mage::helper('pdfinvoiceplus')->checkEnable();
     $active = Mage::helper('pdfinvoiceplus')->checkStoreTemplate();
     if ($enable == 1 && $active == 1) {
         $this->_addButton('printpdf', array('label' => Mage::helper('pdfinvoiceplus')->__('Print Custom PDF File'), 'class' => 'save', 'onclick' => $this->getPrintPdfLink()));
     }
 }
Пример #10
0
 public function __construct()
 {
     $order = $this->getOrder();
     // removes the 'Edit' button by disallowing
     // Editing of an order to avoid confusion
     if ($this->_isAllowedAction('edit') && $order->canEdit()) {
         $order->setActionFlag('edit', false);
     }
     parent::__construct();
 }
 public function __construct()
 {
     $states = explode(',', Mage::getStoreConfig('nfe/general/pedido_status'));
     if (in_array($this->getOrder()->getState(), $states) || !is_array($states)) {
         $this->_addButton('call_to_send_nfe', array('label' => Mage::helper('Sales')->__('Emitir NF-e'), 'onclick' => 'setLocation(\'' . $this->getUrlSend() . '\')', 'class' => 'go'), 0, 100, 'header', 'header');
     } else {
         $this->_addButton('call_to_send_nfe', array('label' => Mage::helper('Sales')->__('Emitir NF-e'), 'class' => 'disabled'), 0, 100, 'header', 'header');
     }
     parent::__construct();
 }
Пример #12
0
 public function __construct()
 {
     $read = Mage::getSingleton('core/resource')->getConnection('core_read');
     $row = $read->fetchRow("select * from epay_order_status where orderid = '" . $this->getOrder()->getIncrementId() . "'");
     $standard = Mage::getModel('epay/standard');
     if (!$row || $row['status'] == '0') {
         $this->_addButton('button_sendpaymentrequest', array('label' => Mage::helper('epay')->__('Create payment request'), 'onclick' => 'setLocation(\'' . Mage::helper("adminhtml")->getUrl('epay/adminhtml_paymentrequest/create/', array('id' => $this->getOrder()->getRealOrderId())) . '\')', 'class' => 'scalable go'), 0, 100, 'header', 'header');
     }
     parent::__construct();
 }
Пример #13
0
 public function __construct()
 {
     $code = $this->getOrder()->getPayment()->getMethodInstance()->getCode();
     if (Mage::helper('ratepaypayment/payment')->isRatepayPayment($code)) {
         parent::__construct();
         $this->removeButton('order_ship');
     } else {
         parent::__construct();
     }
 }
Пример #14
0
 public function __construct()
 {
     parent::__construct();
     $this->_removeButton('order_cancel');
     $this->_removeButton('order_hold');
     $this->_removeButton('order_unhold');
     $this->_removeButton('order_invoice');
     $this->_removeButton('order_ship');
     $this->_removeButton('order_creditmemo');
 }
Пример #15
0
 public function __construct()
 {
     parent::__construct();
     $order = $this->getOrder();
     /* 
     	if ($this->_isAllowedAction('ship') && $order->canShip() && !$order->getForcedDoShipmentWithInvoice())
     */
     if (!$order->canVirtual() && Mage::helper('printlabel')->printlabel_enable()) {
         $this->_addButton('order_print_label', array('label' => Mage::helper('sales')->__('Print Label'), 'onclick' => 'setLocation(\'' . $this->getPrintLabelUrl() . '\')', 'class' => 'go'));
     }
 }
Пример #16
0
 public function __construct()
 {
     if (Mage::helper('tweaks')->isOrderViewPrevnextBottonsEnable()) {
         if ($prevOrderUrl = $this->getPrevNextOrderUrl('<')) {
             $this->_addButton('order_prev', array('label' => Mage::helper('tweaks')->__('View Previous'), 'onclick' => "setLocation('{$prevOrderUrl}')"));
         }
         parent::__construct();
         if ($nextOrderUrl = $this->getPrevNextOrderUrl('>')) {
             $this->_addButton('order_next', array('label' => Mage::helper('tweaks')->__('View Next'), 'onclick' => "setLocation('{$nextOrderUrl}')"));
         }
     } else {
         parent::__construct();
     }
 }
Пример #17
0
 function __construct()
 {
     $itemscount = 0;
     $totalWeight = 0;
     $_order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'));
     $itemsv = $_order->getAllVisibleItems();
     foreach ($itemsv as $itemvv) {
         if ($itemvv->getQtyOrdered() > $itemvv->getQtyShipped()) {
             $itemscount += $itemvv->getQtyOrdered() - $itemvv->getQtyShipped();
         }
         if ($itemvv->getWeight() != 0) {
             $weight = $itemvv->getWeight() * $itemvv->getQtyOrdered();
         } else {
             $weight = 0.5 * $itemvv->getQtyOrdered();
         }
         $totalWeight += $weight;
     }
     $shipments = Mage::getResourceModel('sales/order_shipment_collection')->addAttributeToSelect('*')->addFieldToFilter("order_id", $_order->getId())->join("sales/shipment_comment", 'main_table.entity_id=parent_id', 'comment')->addFieldToFilter('comment', array('like' => "%{$_order->getIncrementId()}%"))->load();
     $aramex_return_button = false;
     if ($shipments->count()) {
         foreach ($shipments as $key => $comment) {
             if (version_compare(PHP_VERSION, '5.3.0') <= 0) {
                 $awbno = substr($comment->getComment(), 0, strpos($comment->getComment(), "- Order No"));
             } else {
                 $awbno = strstr($comment->getComment(), "- Order No", true);
             }
             $awbno = trim($awbno, "AWB No.");
             break;
         }
         if ((int) $awbno) {
             $aramex_return_button = true;
         }
     }
     if ($_order->canShip()) {
         $this->_addButton('create_aramex_shipment', array('label' => Mage::helper('Sales')->__('Prepare Aramex Shipment'), 'onclick' => 'aramexpop(' . $itemscount . ')', 'class' => 'go'), 0, 100, 'header', 'header');
     } elseif (!$_order->canShip() && $aramex_return_button) {
         $this->_addButton('create_aramex_shipment', array('label' => Mage::helper('Sales')->__('Return Aramex Shipment'), 'onclick' => 'aramexreturnpop(' . $itemscount . ')', 'class' => 'go'), 0, 100, 'header', 'header');
     }
     //barry code
     if ($itemscount == 0) {
         $this->_addButton('print_aramex_label', array('label' => Mage::helper('Sales')->__('Aramex Print Label'), 'onclick' => "myObj.printLabel()", 'class' => 'go'), 0, 200, 'header', 'header');
     }
     //barry code end here
     parent::__construct();
 }
Пример #18
0
 public function __construct()
 {
     parent::__construct();
     $order = $this->getOrder();
     // Consulta transaçao Bcash
     $quoteId = $order->getQuoteId();
     $quote = Mage::getModel('sales/quote')->loadByIdWithoutStore($quoteId);
     $transactionIdBcash = $quote->getTransactionIdBcash();
     $transactionInfo = Mage::helper('bcash')->getTransaction($transactionIdBcash);
     // Checa se o status da transaçao Bcash permite cancelamento
     if ($transactionInfo->transacao->cod_status == NotificationStatusEnum::IN_PROGRESS || $transactionInfo->transacao->cod_status == NotificationStatusEnum::APPROVED) {
         if ($order->canCancel() || $order->canCreditmemo()) {
             $confirmationMessage = Mage::helper('core')->jsQuoteEscape(Mage::helper('sales')->__('Deseja realmente cancelar o pedido ' . $order->getId() . '? \\n\\nA transação de pagamento também será cancelada.'));
             $this->_addButton('button_cancel_with_bcash', array('label' => 'Cancelar com Bcash', 'onclick' => 'deleteConfirm(\'' . $confirmationMessage . '\', \'' . $this->getUrl('bcash/admin_sales_order/canceltransaction/') . '\')'), 0, 100, 'header', 'header');
         }
     }
     $payment_link = $quote->getPaymentLinkBcash();
     if ($transactionInfo->transacao->cod_status == 1 && $payment_link) {
         $this->_addButton('button_payment_link_bcash', array('label' => 'Link de Pagamento Bcash', 'onclick' => 'window.open(\'' . $payment_link . '\')'), 0, 110, 'header', 'header');
     }
 }
Пример #19
0
 public function __construct()
 {
     parent::__construct();
     $order_id = $this->getOrderId();
     $order = $this->getOrder();
     $manual_shipping = Mage::getStoreConfig('carriers/shiphawk_shipping/book_shipment');
     $shipping_code = $order->getShippingMethod();
     $confirm_messsage = $this->__('Are you sure to process?');
     $check_shiphawk = Mage::helper('shiphawk_shipping')->isShipHawkShipping($shipping_code);
     if ($check_shiphawk !== false) {
         if ($order->canShip()) {
             if ($manual_shipping) {
                 $this->_addButton('shiphawk_shipping', array('label' => Mage::helper('shiphawk_shipping')->__('ShipHawk Shipment'), 'onclick' => "confirmSetLocation('{$confirm_messsage}', '{$this->getShipHawkUrl($order_id)}')", 'class' => 'go'), 0, 100, 'header', 'header');
             }
         }
     } else {
         if ($order->canShip()) {
             $this->_addButton('shiphawk_shipping_new', array('label' => Mage::helper('shiphawk_shipping')->__('New ShipHawk Shipment'), 'class' => 'newshipment', 'onclick' => "showPopup('{$this->getNewShipHawkUrl($order_id)}')"), 0, 150, 'header', 'header');
         }
     }
 }
Пример #20
0
 public function getHeaderText()
 {
     $parentMessage = parent::getHeaderText();
     $isArchieved = '';
     $editMsg = '';
     $typeMsg = '';
     $type = $this->getOrder()->getIsArchieved();
     $isEdited = $this->getOrder()->getIsEdit();
     if (isset($type) && $type == 1) {
         $typeText = Mage::helper('sales')->__('Group - Archieve');
         $typeMsg = ' ( ' . $typeText . ' ) ';
     } else {
         $typeText = Mage::helper('sales')->__('Group - Active');
         $typeMsg = ' ( ' . $typeText . ' ) ';
     }
     if (isset($isEdited) && $isEdited == 1) {
         $editText = Mage::helper('sales')->__('Edited');
         $editMsg = ' ( ' . $editText . ' ) ';
     }
     $parentMessage = $parentMessage . $editMsg . $typeMsg;
     return $parentMessage;
 }
Пример #21
0
 public function __construct()
 {
     parent::__construct();
     if (!Mage::helper('giftcard')->isActive()) {
         return;
     }
     $order = $this->getOrder();
     $items = $order->getAllItems();
     if (count($items) != 0) {
         foreach ($items as $item) {
             if ($item->getProductType() == MT_Giftcard_Model_Catalog_Product_Type::TYPE_GIFTCARD_PRODUCT) {
                 $this->_addButton('download_pdf_giftcard', array('label' => Mage::helper('sales')->__('Gift Card (.pdf)'), 'class' => 'scalable', 'onclick' => 'downloadPdfGiftCard()'));
                 $this->_addButton('download_pdf_giftcard_zipped', array('label' => Mage::helper('sales')->__('Gift Card (.jpg zipped)'), 'class' => 'scalable', 'onclick' => 'downloadImageGiftCard()'));
                 $downloadPdfLink = Mage::helper("adminhtml")->getUrl("adminhtml/giftcard_export/order", array('id' => $order->getId(), 'format' => 'pdf'));
                 $downloadImageLink = Mage::helper("adminhtml")->getUrl("adminhtml/giftcard_export/order", array('id' => $order->getId(), 'format' => 'zip'));
                 $this->_formScripts[] = " function downloadPdfGiftCard(){ window.location.href='" . $downloadPdfLink . "'; } ";
                 $this->_formScripts[] = " function downloadImageGiftCard(){ window.location.href='" . $downloadImageLink . "'; } ";
                 break;
             }
         }
     }
 }
 public function __construct()
 {
     parent::__construct();
     $order = $this->getOrder();
     if (Mage::helper("creditcard")->isMOPLitle($order->getPayment())) {
         $authTransaction = $order->getPayment()->lookupTransaction(false, Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
         // check if Auth-Reversal need to be shown
         if (!Mage::helper("creditcard")->isMOPLitleECheck($order->getPayment()->getData('method'))) {
             if ($authTransaction && !$authTransaction->getIsClosed()) {
                 if ($order->getPayment()->getAmountPaid() == 0) {
                     $message = 'Are you sure you want to reverse the authorization?';
                     $this->_updateButton('void_payment', 'label', 'Auth-Reversal');
                     $this->_updateButton('void_payment', 'onclick', "confirmSetLocation('{$message}', '{$this->getVoidPaymentUrl()}')");
                 }
             } else {
                 $this->removeButton('order_invoice');
             }
         }
         // 			check if Void-Refund needs to be shown
         if (Mage::helper("creditcard")->isStateOfOrderEqualTo($order, Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND)) {
             $onclickJs = 'deleteConfirm(\'' . Mage::helper('sales')->__('Are you sure? The refund request will be canceled.') . '\', \'' . $this->getVoidPaymentUrl() . '\');';
             $this->_addButton('void_refund', array('label' => 'Void Refund', 'onclick' => $onclickJs));
         }
         //check if void capture or void sale needs to be shown
         if (Mage::helper("creditcard")->isStateOfOrderEqualTo($order, Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE) && $this->wasLastTxnLessThan24HrsAgo($order->getPayment())) {
             $mop = $order->getPayment()->getData('method');
             //check if paying with a credit card
             if (Mage::helper("creditcard")->isMOPLitleCC($mop) || Mage::helper("creditcard")->isMOPLitlePaypal($mop)) {
                 $onclickJs = 'deleteConfirm(\'' . Mage::helper('sales')->__('Are you sure?  If any previous partial captures were done on this order, or if capture was not done today then do a refund instead.') . '\', \'' . $this->getVoidPaymentUrl() . '\');';
                 $this->_addButton('void_capture', array('label' => 'Void Capture', 'onclick' => $onclickJs));
             } elseif (Mage::helper("creditcard")->isMOPLitleECheck($mop)) {
                 $onclickJs = 'deleteConfirm(\'' . Mage::helper('sales')->__('Are you sure?  If any previous partial captures were done on this order, or if capture was not done today then do a refund instead.') . '\', \'' . $this->getVoidPaymentUrl() . '\');';
                 $this->_addButton('void_sale', array('label' => 'Void Sale', 'onclick' => $onclickJs));
             }
         }
     }
 }
Пример #23
0
 public function __construct()
 {
     parent::__construct();
     $message = Mage::helper('sales')->__('Are you sure you want to delete this order?');
     $this->_addButton('button_id', array('label' => Mage::helper('Sales')->__('Delete Order'), 'onclick' => 'deleteConfirm(\'' . $message . '\', \'' . $this->getDeleteUrl() . '\')', 'class' => 'go'), 0, 100, 'header', 'header');
 }
Пример #24
0
 public function __construct()
 {
     parent::__construct();
     $this->_addButton('print', array('label' => Mage::helper('sales')->__('Print'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getPrintUrl() . '\')'));
 }
Пример #25
0
 public function __construct()
 {
     parent::__construct();
     $order = $this->getOrder();
     $this->_addButton('unionpay_query', array('label' => Mage::helper('sales')->__('Unionpay Order Query'), 'onclick' => 'setLocation(\'' . $this->getUrl('unionpay/adminhtml_query/query', array('order_increcement' => $order->getIncrementId())) . '\')', 'class' => 'go'));
 }
Пример #26
0
 public function getUrl($params = '', $params2 = array())
 {
     $params2['order_id'] = $this->getOrderId();
     return parent::getUrl($params, $params2);
 }