@@ -225,6 +225,44 @@ protected function _prepareColumns()
225
225
'frame_callback ' => [$ this , 'callbackColumnStatus ' ]
226
226
]);
227
227
228
+ $ this ->addColumn ('actions ' , [
229
+ 'header ' => $ this ->__ ('Actions ' ),
230
+ 'align ' => 'left ' ,
231
+ 'width ' => '100px ' ,
232
+ 'type ' => 'action ' ,
233
+ 'index ' => 'actions ' ,
234
+ 'filter ' => false ,
235
+ 'sortable ' => false ,
236
+ 'renderer ' => '\Ess\M2ePro\Block\Adminhtml\Magento\Grid\Column\Renderer\Action ' ,
237
+ 'getter ' => 'getId ' ,
238
+ 'actions ' => [
239
+ [
240
+ 'caption ' => $ this ->__ ('View ' ),
241
+ 'url ' => [
242
+ 'base ' => '*/amazon_order/view '
243
+ ],
244
+ 'field ' => 'id '
245
+ ],
246
+ [
247
+ 'caption ' => $ this ->__ ('Create Magento Order ' ),
248
+ 'url ' => [
249
+ 'base ' => '*/amazon_order/createMagentoOrder ' ,
250
+ ],
251
+ 'field ' => 'id '
252
+ ],
253
+ [
254
+ 'caption ' => $ this ->__ ('Mark As Shipped ' ),
255
+ 'field ' => 'id ' ,
256
+ 'onclick_action ' => 'AmazonOrderMerchantFulfillmentObj.markAsShippedAction '
257
+ ],
258
+ [
259
+ 'caption ' => $ this ->__ ('Amazon \'s Shipping Services ' ),
260
+ 'field ' => 'id ' ,
261
+ 'onclick_action ' => 'AmazonOrderMerchantFulfillmentObj.getPopupAction '
262
+ ]
263
+ ]
264
+ ]);
265
+
228
266
return parent ::_prepareColumns ();
229
267
}
230
268
@@ -591,46 +629,61 @@ public function getRowUrl($row)
591
629
return $ this ->getUrl ('*/amazon_order/view ' , ['id ' => $ row ->getId (), 'back ' => $ back ]);
592
630
}
593
631
594
- protected function _toHtml ()
632
+ protected function _prepareLayout ()
595
633
{
596
634
if ($ this ->getRequest ()->isXmlHttpRequest ()) {
597
635
$ this ->js ->add (
598
636
<<<JS
599
637
OrderObj.initializeGrids();
600
638
JS
601
639
);
602
-
603
- return parent ::_toHtml ();
604
640
}
605
641
606
- $ tempGridIds = [];
607
- $ this ->getHelper ('Component\Amazon ' )->isEnabled () && $ tempGridIds [] = $ this ->getId ();
608
-
609
- $ tempGridIds = $ this ->getHelper ('Data ' )->jsonEncode ($ tempGridIds );
610
-
611
642
$ this ->jsPhp ->addConstants ($ this ->getHelper ('Data ' )
612
643
->getClassConstants (\Ess \M2ePro \Model \Log \AbstractModel::class));
613
644
614
645
$ this ->jsUrl ->addUrls ([
615
646
'amazon_order/view ' => $ this ->getUrl (
616
647
'*/amazon_order/view ' ,
617
648
['back ' =>$ this ->getHelper ('Data ' )->makeBackUrlParam ('*/amazon_order/index ' )]
649
+ ),
650
+ 'getEditShippingAddressForm ' => $ this ->getUrl (
651
+ '*/amazon_order_shippingAddress/edit/ '
618
652
)
619
653
]);
654
+ $ this ->jsUrl ->addUrls ($ this ->getHelper ('Data ' )->getControllerActions ('Amazon\Order ' ));
655
+ $ this ->jsUrl ->addUrls ($ this ->getHelper ('Data ' )->getControllerActions ('Amazon\Order\MerchantFulfillment ' ));
656
+
657
+ $ this ->jsTranslator ->addTranslations ([
658
+ 'View Full Order Log ' => $ this ->__ ('View Full Order Log ' ),
659
+ 'Amazon \'s Shipping Services ' => $ this ->__ ('Amazon \'s Shipping Services ' ),
660
+ 'Please select an option. ' => $ this ->__ ('Please select an option. ' ),
661
+ 'This is a required fields. ' => $ this ->__ ('This is a required fields. ' ),
662
+ 'Please enter a number greater than 0 in this fields. ' =>
663
+ $ this ->__ ('Please enter a number greater than 0 in this fields. ' ),
664
+ 'Are you sure you want to create Shipment now? ' =>
665
+ $ this ->__ ('Are you sure you want to create Shipment now? ' ),
666
+ 'Please enter a valid date. ' => $ this ->__ ('Please enter a valid date. ' ),
667
+ ]);
620
668
621
- $ this ->jsTranslator ->add ('View Full Order Log ' , $ this ->__ ('View Full Order Log ' ));
669
+ $ tempGridIds = [];
670
+ $ this ->getHelper ('Component\Amazon ' )->isEnabled () && $ tempGridIds [] = $ this ->getId ();
671
+
672
+ $ tempGridIds = $ this ->getHelper ('Data ' )->jsonEncode ($ tempGridIds );
622
673
623
674
$ this ->js ->add (<<<JS
624
675
require([
625
676
'M2ePro/Order',
677
+ 'M2ePro/Amazon/Order/MerchantFulfillment'
626
678
], function(){
679
+ window.AmazonOrderMerchantFulfillmentObj = new AmazonOrderMerchantFulfillment();
627
680
window.OrderObj = new Order(' $ tempGridIds');
628
681
OrderObj.initializeGrids();
629
682
});
630
683
JS
631
684
);
632
685
633
- return parent ::_toHtml ();
686
+ return parent ::_prepareLayout ();
634
687
}
635
688
636
689
//########################################
0 commit comments