Noble_Extended_Order_Grid - Version 1.0.4

Version Notes

Added coupon code column.

Download this release

Release Info

Developer Gilles Lesire
Extension Noble_Extended_Order_Grid
Version 1.0.4
Comparing to
See all releases


Code changes from version 1.0.3 to 1.0.4

Files changed (37) hide show
  1. app/code/community/Noble/.DS_Store +0 -0
  2. app/code/community/Noble/AdminOrderGrid/Block/Sales/Order/Grid.php +12 -0
  3. app/code/community/Noble/AdminOrderGrid/Helper/Data.php +8 -1
  4. app/code/community/Noble/AdminOrderGrid/Model/System/Config/Source/Dropdown/Country.php +8 -1
  5. app/code/community/Noble/AdminOrderGrid/etc/config.xml +2 -1
  6. app/code/community/Noble/AdminOrderGrid/etc/system.xml +9 -0
  7. app/code/community/Noble/AutoInvoice/.DS_Store +0 -0
  8. app/code/community/Noble/AutoInvoice/Model/Observer.php +94 -0
  9. app/code/community/Noble/AutoInvoice/etc/.DS_Store +0 -0
  10. app/code/community/Noble/AutoInvoice/etc/config.xml +27 -0
  11. app/code/community/Noble/PickUpOrders/.DS_Store +0 -0
  12. app/code/community/Noble/PickUpOrders/Block/.DS_Store +0 -0
  13. app/code/community/Noble/PickUpOrders/Block/Adminhtml/.DS_Store +0 -0
  14. app/code/community/Noble/PickUpOrders/Block/Adminhtml/Sales/.DS_Store +0 -0
  15. app/code/community/Noble/PickUpOrders/Block/Adminhtml/Sales/Order.php +22 -0
  16. app/code/community/Noble/PickUpOrders/Block/Adminhtml/Sales/Order/.DS_Store +0 -0
  17. app/code/community/Noble/PickUpOrders/Block/Adminhtml/Sales/Order/Grid.php +527 -0
  18. app/code/community/Noble/PickUpOrders/Helper/Data.php +12 -0
  19. app/code/community/Noble/PickUpOrders/controllers/.DS_Store +0 -0
  20. app/code/community/Noble/PickUpOrders/controllers/Adminhtml/PickuporderController.php +42 -0
  21. app/code/community/Noble/PickUpOrders/etc/.DS_Store +0 -0
  22. app/code/community/Noble/PickUpOrders/etc/adminhtml.xml +14 -0
  23. app/code/community/Noble/PickUpOrders/etc/config.xml +49 -0
  24. app/code/community/Noble/UPSOrders/.DS_Store +0 -0
  25. app/code/community/Noble/UPSOrders/Block/.DS_Store +0 -0
  26. app/code/community/Noble/UPSOrders/Block/Adminhtml/.DS_Store +0 -0
  27. app/code/community/Noble/UPSOrders/Block/Adminhtml/Sales/.DS_Store +0 -0
  28. app/code/community/Noble/UPSOrders/Block/Adminhtml/Sales/Order.php +22 -0
  29. app/code/community/Noble/UPSOrders/Block/Adminhtml/Sales/Order/.DS_Store +0 -0
  30. app/code/community/Noble/UPSOrders/Block/Adminhtml/Sales/Order/Grid.php +527 -0
  31. app/code/community/Noble/UPSOrders/Helper/Data.php +12 -0
  32. app/code/community/Noble/UPSOrders/controllers/.DS_Store +0 -0
  33. app/code/community/Noble/UPSOrders/controllers/Adminhtml/UpsorderController.php +42 -0
  34. app/code/community/Noble/UPSOrders/etc/.DS_Store +0 -0
  35. app/code/community/Noble/UPSOrders/etc/adminhtml.xml +14 -0
  36. app/code/community/Noble/UPSOrders/etc/config.xml +49 -0
  37. package.xml +8 -8
app/code/community/Noble/.DS_Store ADDED
Binary file
app/code/community/Noble/AdminOrderGrid/Block/Sales/Order/Grid.php CHANGED
@@ -66,6 +66,10 @@ class Noble_AdminOrderGrid_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_W
66
  $orderFields["remote_ip"] = "remote_ip";
67
  }
68
 
 
 
 
 
69
  if(Mage::getStoreConfig('noble/extended_columns/billing_country')) {
70
  $billingFields["billing_country"] = "sfoba.country_id";
71
  }
@@ -358,6 +362,14 @@ class Noble_AdminOrderGrid_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_W
358
  ));
359
  }
360
 
 
 
 
 
 
 
 
 
361
  if(Mage::getStoreConfig('noble/default_columns/action')) {
362
  if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
363
  $this->addColumn('action',
66
  $orderFields["remote_ip"] = "remote_ip";
67
  }
68
 
69
+ if(Mage::getStoreConfig('noble/extended_columns/coupon_code')) {
70
+ $orderFields["coupon_code"] = "coupon_code";
71
+ }
72
+
73
  if(Mage::getStoreConfig('noble/extended_columns/billing_country')) {
74
  $billingFields["billing_country"] = "sfoba.country_id";
75
  }
362
  ));
363
  }
364
 
365
+ if(Mage::getStoreConfig('noble/extended_columns/coupon_code')) {
366
+ $this->addColumn('coupon_code', array(
367
+ 'header' => $this->__('Coupon code'),
368
+ 'index' => 'coupon_code',
369
+ 'filter_index' => 'sfo.coupon_code'
370
+ ));
371
+ }
372
+
373
  if(Mage::getStoreConfig('noble/default_columns/action')) {
374
  if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
375
  $this->addColumn('action',
app/code/community/Noble/AdminOrderGrid/Helper/Data.php CHANGED
@@ -1,5 +1,12 @@
1
  <?php
2
-
 
 
 
 
 
 
 
3
  class Noble_AdminOrderGrid_Helper_Data extends Mage_Core_Helper_Abstract{
4
 
5
  }
1
  <?php
2
+ /**
3
+ * @category Noble
4
+ * @package Noble_AdminOrderGrid
5
+ * @author Gilles Lesire
6
+ *
7
+ * Class Noble_AdminOrderGrid_Helper_Data
8
+ * Helper class
9
+ */
10
  class Noble_AdminOrderGrid_Helper_Data extends Mage_Core_Helper_Abstract{
11
 
12
  }
app/code/community/Noble/AdminOrderGrid/Model/System/Config/Source/Dropdown/Country.php CHANGED
@@ -1,5 +1,12 @@
1
  <?php
2
-
 
 
 
 
 
 
 
3
  class Noble_AdminOrderGrid_Model_System_Config_Source_Dropdown_Country
4
  {
5
  public function toOptionArray()
1
  <?php
2
+ /**
3
+ * @category Noble
4
+ * @package Noble_AdminOrderGrid
5
+ * @author Gilles Lesire
6
+ *
7
+ * Class Noble_AdminOrderGrid_Model_System_Config_Source_Dropdown_Country
8
+ * This class creates a select type for the Admin configuration panel
9
+ */
10
  class Noble_AdminOrderGrid_Model_System_Config_Source_Dropdown_Country
11
  {
12
  public function toOptionArray()
app/code/community/Noble/AdminOrderGrid/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Noble_AdminOrderGrid>
5
- <version>1.0.2</version>
6
  </Noble_AdminOrderGrid>
7
  </modules>
8
  <global>
@@ -48,6 +48,7 @@
48
  <subtotal>0</subtotal>
49
  <customer_group>0</customer_group>
50
  <remote_ip>0</remote_ip>
 
51
  </extended_columns>
52
  </noble>
53
  </default>
2
  <config>
3
  <modules>
4
  <Noble_AdminOrderGrid>
5
+ <version>1.0.4</version>
6
  </Noble_AdminOrderGrid>
7
  </modules>
8
  <global>
48
  <subtotal>0</subtotal>
49
  <customer_group>0</customer_group>
50
  <remote_ip>0</remote_ip>
51
+ <coupon_code>0</coupon_code>
52
  </extended_columns>
53
  </noble>
54
  </default>
app/code/community/Noble/AdminOrderGrid/etc/system.xml CHANGED
@@ -286,6 +286,15 @@
286
  <show_in_store>0</show_in_store>
287
  <source_model>adminhtml/system_config_source_yesno</source_model>
288
  </remote_ip>
 
 
 
 
 
 
 
 
 
289
  </fields>
290
  </extended_columns>
291
  </groups>
286
  <show_in_store>0</show_in_store>
287
  <source_model>adminhtml/system_config_source_yesno</source_model>
288
  </remote_ip>
289
+ <coupon_code translate="label">
290
+ <label>Coupon code: </label>
291
+ <frontend_type>select</frontend_type>
292
+ <sort_order>226</sort_order>
293
+ <show_in_default>1</show_in_default>
294
+ <show_in_website>0</show_in_website>
295
+ <show_in_store>0</show_in_store>
296
+ <source_model>adminhtml/system_config_source_yesno</source_model>
297
+ </coupon_code>
298
  </fields>
299
  </extended_columns>
300
  </groups>
app/code/community/Noble/AutoInvoice/.DS_Store ADDED
Binary file
app/code/community/Noble/AutoInvoice/Model/Observer.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Noble
4
+ * @package Noble_AutoInvoice
5
+ * @author Gilles Lesire
6
+ *
7
+ * Class Noble_AutoInvoice_Model_Observer
8
+ * Observer class which will execute the implementOrderStatus function when a new order is created
9
+ * In case of an order being payed with a gift certificate or being free, it will be automitically invoiced and set to processing
10
+ */
11
+ class Noble_AutoInvoice_Model_Observer {
12
+ public function implementOrderStatus($event)
13
+ {
14
+ $order = $event->getOrder();
15
+
16
+ if ($this->_getPaymentMethod($order) == 'free' || $this->_getPaymentMethod($order) == 'ugiftcert') {
17
+ if ($order->canInvoice())
18
+ $this->_processOrderStatus($order);
19
+ }
20
+ return $this;
21
+ }
22
+
23
+ private function _getPaymentMethod($order)
24
+ {
25
+ return $order->getPayment()->getMethodInstance()->getCode();
26
+ }
27
+
28
+ private function _processOrderStatus($order)
29
+ {
30
+ $invoice = $order->prepareInvoice();
31
+
32
+ $invoice->register();
33
+ Mage::getModel('core/resource_transaction')
34
+ ->addObject($invoice)
35
+ ->addObject($invoice->getOrder())
36
+ ->save();
37
+
38
+ $invoice->sendEmail(true, '');
39
+ $this->_changeOrderStatus($order);
40
+ return true;
41
+ }
42
+
43
+ private function _changeOrderStatus($order)
44
+ {
45
+ $statusMessage = '';
46
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
47
+ $order->save();
48
+ }
49
+ }
50
+
51
+
52
+
53
+ /**
54
+ * change order status to 'Completed'
55
+ *
56
+ $order->setState(Mage_Sales_Model_Order::STATE_COMPLETE, true)->save();
57
+ Similarly, you can change the order status to pending, processing, canceled, closed, held, etc.
58
+
59
+ /**
60
+ * change order status to "Pending"
61
+ *
62
+ $order->setState(Mage_Sales_Model_Order::STATE_NEW, true)->save();
63
+
64
+ /**
65
+ * change order status to "Pending Paypal"
66
+ *
67
+ $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true)->save();
68
+
69
+ /**
70
+ * change order status to "Processing"
71
+ *
72
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();
73
+
74
+ /**
75
+ * change order status to "Completed"
76
+ *
77
+ $order->setState(Mage_Sales_Model_Order::STATE_COMPLETE, true)->save();
78
+
79
+ /**
80
+ * change order status to "Closed"
81
+ *
82
+ $order->setState(Mage_Sales_Model_Order::STATE_CLOSED, true)->save();
83
+
84
+ /**
85
+ * change order status to "Canceled"
86
+ *
87
+ $order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true)->save();
88
+
89
+ /**
90
+ * change order status to "Held"
91
+ *
92
+ $order->setState(Mage_Sales_Model_Order::STATE_HOLDED, true)->save();
93
+ */
94
+ ?>
app/code/community/Noble/AutoInvoice/etc/.DS_Store ADDED
Binary file
app/code/community/Noble/AutoInvoice/etc/config.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Noble_AutoInvoice>
5
+ <version>1.0.0</version>
6
+ </Noble_AutoInvoice>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <orderhook>
11
+ <class>Noble_AutoInvoice_Model</class>
12
+ </orderhook>
13
+ </models>
14
+
15
+ <events>
16
+ <sales_order_place_after>
17
+ <observers>
18
+ <auto_invoice_order>
19
+ <type>singleton</type>
20
+ <class>Noble_AutoInvoice_Model_Observer</class>
21
+ <method>implementOrderStatus</method>
22
+ </auto_invoice_order>
23
+ </observers>
24
+ </sales_order_place_after>
25
+ </events>
26
+ </global>
27
+ </config>
app/code/community/Noble/PickUpOrders/.DS_Store ADDED
Binary file
app/code/community/Noble/PickUpOrders/Block/.DS_Store ADDED
Binary file
app/code/community/Noble/PickUpOrders/Block/Adminhtml/.DS_Store ADDED
Binary file
app/code/community/Noble/PickUpOrders/Block/Adminhtml/Sales/.DS_Store ADDED
Binary file
app/code/community/Noble/PickUpOrders/Block/Adminhtml/Sales/Order.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Noble
5
+ * @package Noble_PickUpOrders
6
+ * @author Gilles Lesire
7
+ *
8
+ * Class Noble_PickUpOrders_Block_Adminhtml_Sales_Order
9
+ * This class overrides the default orders grid in the Admin panel
10
+ */
11
+ class Noble_PickUpOrders_Block_Adminhtml_Sales_Order extends Mage_Adminhtml_Block_Widget_Grid_Container
12
+ {
13
+ public function __construct()
14
+ {
15
+ $this->_blockGroup = 'noble_pickuporders';
16
+ $this->_controller = 'adminhtml_sales_order';
17
+ $this->_headerText = Mage::helper('noble_pickuporders')->__('Afhaalorders');
18
+
19
+ parent::__construct();
20
+ $this->_removeButton('add');
21
+ }
22
+ }
app/code/community/Noble/PickUpOrders/Block/Adminhtml/Sales/Order/.DS_Store ADDED
Binary file
app/code/community/Noble/PickUpOrders/Block/Adminhtml/Sales/Order/Grid.php ADDED
@@ -0,0 +1,527 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Noble
5
+ * @package Noble_PickUpOrders
6
+ * @author Gilles Lesire
7
+ *
8
+ * Class Noble_PickUpOrders_Block_Adminthtml_Sales_Order_Grid
9
+ * This class overrides the default orders grid in the Admin panel
10
+ */
11
+ class Noble_PickUpOrders_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid
12
+ {
13
+
14
+ public function __construct()
15
+ {
16
+ parent::__construct();
17
+ $this->setId('noble_pickuporders_grid');
18
+ $this->setUseAjax(true);
19
+ $this->setDefaultFilter(array('status' => 'processing'));
20
+ $this->setDefaultSort('created_at');
21
+ $this->setDefaultDir('DESC');
22
+ $this->setSaveParametersInSession(true);
23
+ }
24
+
25
+ /**
26
+ * Retrieve collection class
27
+ *
28
+ * @return string
29
+ */
30
+ protected function _getCollectionClass()
31
+ {
32
+ return 'sales/order_grid_collection';
33
+ }
34
+
35
+ protected function _prepareCollection()
36
+ {
37
+ $orderFields = array();
38
+ $billingFields = array();
39
+ $shippingFields = array();
40
+ $paymentFields = array();
41
+
42
+ $orderFields["shipping_method"] = "shipping_method";
43
+
44
+ if(Mage::getStoreConfig('noble/extended_columns/customer_email')) {
45
+ $orderFields["customer_email"] = "customer_email";
46
+ }
47
+
48
+ if(Mage::getStoreConfig('noble/extended_columns/amount_items')) {
49
+ $orderFields["total_qty_ordered"] = "ROUND(total_qty_ordered,0)";
50
+ }
51
+
52
+ if(Mage::getStoreConfig('noble/extended_columns/weight')) {
53
+ $orderFields["weight"] = "weight";
54
+ }
55
+
56
+ if(Mage::getStoreConfig('noble/extended_columns/customer_group')) {
57
+ $orderFields["customer_group_id"] = "customer_group_id";
58
+ }
59
+
60
+ if(Mage::getStoreConfig('noble/extended_columns/subtotal')) {
61
+ $orderFields["subtotal"] = "subtotal";
62
+ }
63
+
64
+ if(Mage::getStoreConfig('noble/extended_columns/remote_ip')) {
65
+ $orderFields["remote_ip"] = "remote_ip";
66
+ }
67
+
68
+ if(Mage::getStoreConfig('noble/extended_columns/billing_country')) {
69
+ $billingFields["billing_country"] = "sfoba.country_id";
70
+ }
71
+
72
+ if(Mage::getStoreConfig('noble/extended_columns/billing_region')) {
73
+ $billingFields["billing_region"] = "sfoba.region";
74
+ }
75
+
76
+ if(Mage::getStoreConfig('noble/extended_columns/billing_city')) {
77
+ $billingFields["billing_city"] = "sfoba.city";
78
+ }
79
+
80
+ if(Mage::getStoreConfig('noble/extended_columns/billing_postcode')) {
81
+ $billingFields["billing_postcode"] = "sfoba.postcode";
82
+ }
83
+
84
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_country')) {
85
+ $shippingFields["shipping_country"] = "sfosa.country_id";
86
+ }
87
+
88
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_region')) {
89
+ $shippingFields["shipping_region"] = "sfosa.region";
90
+ }
91
+
92
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_city')) {
93
+ $shippingFields["shipping_city"] = "sfosa.city";
94
+ }
95
+
96
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_postcode')) {
97
+ $shippingFields["shipping_postcode"] = "sfosa.postcode";
98
+ }
99
+
100
+ if(Mage::getStoreConfig('noble/extended_columns/payment_method')) {
101
+ $paymentFields["payment_method"] = "sfop.method";
102
+ }
103
+
104
+ $collection = Mage::getResourceModel($this->_getCollectionClass());
105
+ $collection->getSelect()->join(Mage::getConfig()->getTablePrefix() . 'sales_flat_order as sfo', 'sfo.entity_id=`main_table`.entity_id and sfo.shipping_method="freeshipping_freeshipping"', $orderFields)
106
+ ->join(Mage::getConfig()->getTablePrefix() . 'sales_flat_order_address as sfoba', 'sfoba.parent_id=`main_table`.entity_id and sfoba.address_type = "billing"', $billingFields)
107
+ ->join(Mage::getConfig()->getTablePrefix() . 'sales_flat_order_address as sfosa', 'sfosa.parent_id=`main_table`.entity_id and sfosa.address_type = "shipping"', $shippingFields)
108
+ ->join(Mage::getConfig()->getTablePrefix() . 'sales_flat_order_payment as sfop', 'sfop.parent_id=`main_table`.entity_id', $paymentFields);
109
+
110
+ $this->setCollection($collection);
111
+ return parent::_prepareCollection();
112
+ }
113
+
114
+ protected function _prepareColumns()
115
+ {
116
+ $helper = Mage::helper('noble_pickuporders');
117
+
118
+ if(Mage::getStoreConfig('noble/default_columns/real_order_id')) {
119
+ $this->addColumn('real_order_id', array(
120
+ 'header'=> Mage::helper('sales')->__('Order #'),
121
+ 'width' => '80px',
122
+ 'type' => 'text',
123
+ 'index' => 'increment_id',
124
+ 'filter_index' => 'main_table.increment_id'
125
+ ));
126
+ }
127
+
128
+ if(Mage::getStoreConfig('noble/default_columns/store_id')) {
129
+ if (!Mage::app()->isSingleStoreMode()) {
130
+ $this->addColumn('store_id', array(
131
+ 'header' => Mage::helper('sales')->__('Purchased From (Store)'),
132
+ 'index' => 'store_id',
133
+ 'type' => 'store',
134
+ 'store_view'=> true,
135
+ 'display_deleted' => true,
136
+ 'filter_index' => 'sfo.store_id'
137
+ ));
138
+ }
139
+ }
140
+
141
+ if(Mage::getStoreConfig('noble/default_columns/created_at')) {
142
+ $this->addColumn('created_at', array(
143
+ 'header' => Mage::helper('sales')->__('Purchased On'),
144
+ 'index' => 'created_at',
145
+ 'type' => 'datetime',
146
+ 'width' => '100px',
147
+ 'filter_index' => 'main_table.created_at'
148
+ ));
149
+ }
150
+
151
+ if(Mage::getStoreConfig('noble/default_columns/billing_name')) {
152
+ $this->addColumn('billing_name', array(
153
+ 'header' => Mage::helper('sales')->__('Bill to Name'),
154
+ 'index' => 'billing_name',
155
+ 'filter_index' => 'main_table.billing_name'
156
+ ));
157
+ }
158
+
159
+ if(Mage::getStoreConfig('noble/default_columns/shipping_name')) {
160
+ $this->addColumn('shipping_name', array(
161
+ 'header' => Mage::helper('sales')->__('Ship to Name'),
162
+ 'index' => 'shipping_name',
163
+ 'filter_index' => 'main_table.shipping_name'
164
+ ));
165
+ }
166
+
167
+ if(Mage::getStoreConfig('noble/extended_columns/amount_items')) {
168
+ $this->addColumn('total_qty_ordered', array(
169
+ 'header' => $this->__('# of Items'),
170
+ 'type' => 'int',
171
+ 'index' => 'total_qty_ordered',
172
+ 'width' => '40px'
173
+ ));
174
+ }
175
+
176
+ if(Mage::getStoreConfig('noble/extended_columns/weight')) {
177
+ $this->addColumn('weight', array(
178
+ 'header' => $this->__('Weight'),
179
+ 'index' => 'weight',
180
+ 'filter_index' => 'sfo.weight'
181
+ ));
182
+ }
183
+
184
+ if(Mage::getStoreConfig('noble/default_columns/base_grand_total')) {
185
+ $this->addColumn('base_grand_total', array(
186
+ 'header' => Mage::helper('sales')->__('G.T. (Base)'),
187
+ 'index' => 'base_grand_total',
188
+ 'type' => 'currency',
189
+ 'currency' => 'base_currency_code',
190
+ ));
191
+ }
192
+
193
+ if(Mage::getStoreConfig('noble/default_columns/grand_total')) {
194
+ $this->addColumn('grand_total', array(
195
+ 'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
196
+ 'index' => 'grand_total',
197
+ 'type' => 'currency',
198
+ 'currency' => 'order_currency_code',
199
+ ));
200
+ }
201
+
202
+ if(Mage::getStoreConfig('noble/extended_columns/subtotal')) {
203
+ $this->addColumn('subtotal', array(
204
+ 'header' => Mage::helper('sales')->__('Subtotal'),
205
+ 'index' => 'subtotal',
206
+ 'type' => 'currency',
207
+ 'currency' => 'order_currency_code',
208
+ ));
209
+ }
210
+
211
+ if(Mage::getStoreConfig('noble/default_columns/status')) {
212
+ $this->addColumn('status', array(
213
+ 'header' => $this->__('Status'),
214
+ 'index' => 'status',
215
+ 'type' => 'options',
216
+ 'width' => '70px',
217
+ 'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
218
+ 'filter_index' => 'main_table.status'
219
+ ));
220
+ }
221
+
222
+ if(Mage::getStoreConfig('noble/extended_columns/customer_group')) {
223
+ $this->addColumn('customer_group_id', array(
224
+ 'header' => Mage::helper('customer')->__('Customer Group'),
225
+ 'width' => '100',
226
+ 'index' => 'customer_group_id',
227
+ 'type' => 'options',
228
+ 'options' => $this->getCustomerGroupOptions(),
229
+ 'renderer' => 'Noble_AdminOrderGrid_Block_Sales_Order_Grid_Renderer_CustomerGroup'
230
+ ));
231
+ }
232
+
233
+ if(Mage::getStoreConfig('noble/extended_columns/customer_email')) {
234
+ $this->addColumn('customer_email', array(
235
+ 'header' => $this->__('Customer email'),
236
+ 'index' => 'customer_email'
237
+ ));
238
+ }
239
+
240
+ if(Mage::getStoreConfig('noble/extended_columns/billing_country') == "code") {
241
+ $this->addColumn('billing_country', array(
242
+ 'header' => Mage::helper('sales')->__('Billing Country'),
243
+ 'index' => 'billing_country',
244
+ 'filter_index' => 'sfoba.country_id',
245
+ 'width' => '60'
246
+ ));
247
+ }
248
+
249
+ if(Mage::getStoreConfig('noble/extended_columns/billing_country') == "full") {
250
+ $this->addColumn('billing_country', array(
251
+ 'header' => Mage::helper('sales')->__('Billing Country'),
252
+ 'index' => 'billing_country',
253
+ 'type' => 'options',
254
+ 'options' => $this->getCountryOptions(),
255
+ 'filter_index' => 'sfoba.country_id',
256
+ 'renderer' => 'adminhtml/widget_grid_column_renderer_country',
257
+ 'width' => '60'
258
+ ));
259
+ }
260
+
261
+ if(Mage::getStoreConfig('noble/extended_columns/billing_region')) {
262
+ $this->addColumn('billing_region', array(
263
+ 'header' => $this->__('Billing Region'),
264
+ 'index' => 'billing_region',
265
+ 'filter_index' => 'sfoba.region'
266
+ ));
267
+ }
268
+
269
+ if(Mage::getStoreConfig('noble/extended_columns/billing_city')) {
270
+ $this->addColumn('billing_city', array(
271
+ 'header' => $this->__('Billing City'),
272
+ 'index' => 'billing_city',
273
+ 'filter_index' => 'sfoba.city'
274
+ ));
275
+ }
276
+
277
+ if(Mage::getStoreConfig('noble/extended_columns/billing_postcode')) {
278
+ $this->addColumn('billing_postcode', array(
279
+ 'header' => $this->__('Billing Postcode'),
280
+ 'index' => 'billing_postcode',
281
+ 'filter_index' => 'sfoba.postcode'
282
+ ));
283
+ }
284
+
285
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_country') == "code") {
286
+ $this->addColumn('shipping_country', array(
287
+ 'header' => Mage::helper('sales')->__('Billing Country'),
288
+ 'index' => 'shipping_country',
289
+ 'filter_index' => 'sfosa.country_id',
290
+ 'width' => '60'
291
+ ));
292
+ }
293
+
294
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_region')) {
295
+ $this->addColumn('shipping_region', array(
296
+ 'header' => $this->__('Shipping Region'),
297
+ 'index' => 'shipping_region',
298
+ 'filter_index' => 'sfosa.region'
299
+ ));
300
+ }
301
+
302
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_city')) {
303
+ $this->addColumn('shipping_city', array(
304
+ 'header' => $this->__('Shipping City'),
305
+ 'index' => 'shipping_city',
306
+ 'filter_index' => 'sfosa.city'
307
+ ));
308
+ }
309
+
310
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_postcode')) {
311
+ $this->addColumn('shipping_postcode', array(
312
+ 'header' => $this->__('Shipping Postcode'),
313
+ 'index' => 'shipping_postcode',
314
+ 'filter_index' => 'sfosa.postcode'
315
+ ));
316
+ }
317
+
318
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_country') == "full") {
319
+ $this->addColumn('billing_country', array(
320
+ 'header' => Mage::helper('sales')->__('Billing Country'),
321
+ 'index' => 'shipping_country',
322
+ 'type' => 'options',
323
+ 'options' => $this->getCountryOptions(),
324
+ 'filter_index' => 'sfosa.country_id',
325
+ 'renderer' => 'adminhtml/widget_grid_column_renderer_country',
326
+ 'width' => '60'
327
+ ));
328
+ }
329
+
330
+ if(Mage::getStoreConfig('noble/extended_columns/payment_method')) {
331
+ $this->addColumn('payment_method', array(
332
+ 'header' => Mage::helper('sales')->__('Payment method'),
333
+ 'index' => 'payment_method',
334
+ 'filter_index' => 'sfop.method',
335
+ 'type' => 'options',
336
+ 'options' => $this->getPaymentMethodOptions(),
337
+ 'renderer' => 'Noble_AdminOrderGrid_Block_Sales_Order_Grid_Renderer_Paymentmethod',
338
+ 'width' => '60'
339
+ ));
340
+ }
341
+
342
+ if(Mage::getStoreConfig('noble/extended_columns/remote_ip')) {
343
+ $this->addColumn('remote_ip', array(
344
+ 'header' => $this->__('Remote IP'),
345
+ 'index' => 'remote_ip',
346
+ 'filter_index' => 'sfo.remote_ip'
347
+ ));
348
+ }
349
+
350
+ if(Mage::getStoreConfig('noble/default_columns/action')) {
351
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
352
+ $this->addColumn('action',
353
+ array(
354
+ 'header' => Mage::helper('sales')->__('Action'),
355
+ 'width' => '50px',
356
+ 'type' => 'action',
357
+ 'getter' => 'getId',
358
+ 'actions' => array(
359
+ array(
360
+ 'caption' => Mage::helper('sales')->__('View'),
361
+ 'url' => array('base'=>'*/sales_order/view'),
362
+ 'field' => 'order_id'
363
+ )
364
+ ),
365
+ 'filter' => false,
366
+ 'sortable' => false,
367
+ 'index' => 'stores',
368
+ 'is_system' => true,
369
+ ));
370
+ }
371
+ }
372
+
373
+ $this->addRssList('rss/order/new', Mage::helper('sales')->__('New Order RSS'));
374
+
375
+ $this->addExportType('*/*/exportNobleCsv', $helper->__('CSV'));
376
+ $this->addExportType('*/*/exportNobleExcel', $helper->__('Excel XML'));
377
+
378
+ return parent::_prepareColumns();
379
+ }
380
+
381
+ protected function _prepareMassaction()
382
+ {
383
+ $this->setMassactionIdField('entity_id');
384
+ $this->getMassactionBlock()->setFormFieldName('order_ids');
385
+ $this->getMassactionBlock()->setUseSelectAll(false);
386
+
387
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/cancel')) {
388
+ $this->getMassactionBlock()->addItem('cancel_order', array(
389
+ 'label'=> Mage::helper('sales')->__('Cancel'),
390
+ 'url' => $this->getUrl('*/sales_order/massCancel'),
391
+ ));
392
+ }
393
+
394
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/hold')) {
395
+ $this->getMassactionBlock()->addItem('hold_order', array(
396
+ 'label'=> Mage::helper('sales')->__('Hold'),
397
+ 'url' => $this->getUrl('*/sales_order/massHold'),
398
+ ));
399
+ }
400
+
401
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/unhold')) {
402
+ $this->getMassactionBlock()->addItem('unhold_order', array(
403
+ 'label'=> Mage::helper('sales')->__('Unhold'),
404
+ 'url' => $this->getUrl('*/sales_order/massUnhold'),
405
+ ));
406
+ }
407
+
408
+ $this->getMassactionBlock()->addItem('pdfinvoices_order', array(
409
+ 'label'=> Mage::helper('sales')->__('Print Invoices'),
410
+ 'url' => $this->getUrl('*/sales_order/pdfinvoices'),
411
+ ));
412
+
413
+ $this->getMassactionBlock()->addItem('pdfshipments_order', array(
414
+ 'label'=> Mage::helper('sales')->__('Print Packingslips'),
415
+ 'url' => $this->getUrl('*/sales_order/pdfshipments'),
416
+ ));
417
+
418
+ $this->getMassactionBlock()->addItem('pdfcreditmemos_order', array(
419
+ 'label'=> Mage::helper('sales')->__('Print Credit Memos'),
420
+ 'url' => $this->getUrl('*/sales_order/pdfcreditmemos'),
421
+ ));
422
+
423
+ $this->getMassactionBlock()->addItem('pdfdocs_order', array(
424
+ 'label'=> Mage::helper('sales')->__('Print All'),
425
+ 'url' => $this->getUrl('*/sales_order/pdfdocs'),
426
+ ));
427
+
428
+ $this->getMassactionBlock()->addItem('print_shipping_label', array(
429
+ 'label'=> Mage::helper('sales')->__('Print Shipping Labels'),
430
+ 'url' => $this->getUrl('*/sales_order_shipment/massPrintShippingLabel'),
431
+ ));
432
+
433
+ return $this;
434
+ }
435
+
436
+ public function getRowUrl($row)
437
+ {
438
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
439
+ return $this->getUrl('*/sales_order/view', array('order_id' => $row->getId()));
440
+ }
441
+ return false;
442
+ }
443
+
444
+ public function getGridUrl()
445
+ {
446
+ return $this->getUrl('*/*/grid', array('_current'=>true));
447
+ }
448
+
449
+ /**
450
+ * Returns possible filters for CustomerGroup column.
451
+ *
452
+ * @return array
453
+ */
454
+ public function getCustomerGroupOptions()
455
+ {
456
+ $options = Mage::getResourceModel('customer/group_collection')
457
+ ->addFieldToFilter('customer_group_id', array('gt'=> 0))
458
+ ->load()
459
+ ->toOptionHash();
460
+
461
+ return $options;
462
+ }
463
+
464
+ /**
465
+ * Returns possible filters for PaymentMethod column.
466
+ *
467
+ * @return array
468
+ */
469
+ public function getPaymentMethodOptions()
470
+ {
471
+ $options = array();
472
+ $optionText = "";
473
+ $collection = Mage::getModel('sales/order_payment')->getCollection()->addFieldToSelect('method');
474
+ $collection->getSelect()->group('method');
475
+ foreach ($collection as $option) {
476
+ $optionText = "";
477
+
478
+ if ($option->getMethod() == "msp_banktransfer") {
479
+ $optionText = 'MSP Banktransfer';
480
+ } elseif ($option->getMethod() == "msp_directdebit") {
481
+ $optionText = 'MSP Direct Debit';
482
+ } elseif ($option->getMethod() == "msp_directebanking") {
483
+ $optionText = 'MSP Direct Banking';
484
+ } elseif ($option->getMethod() == "msp_giropay") {
485
+ $optionText = 'MSP Giropay';
486
+ } elseif ($option->getMethod() == "msp_ideal") {
487
+ $optionText = 'MSP Ideal';
488
+ } elseif ($option->getMethod() == "msp_maestro") {
489
+ $optionText = 'MSP Maestro';
490
+ } elseif ($option->getMethod() == "msp_mastercard") {
491
+ $optionText = 'MSP Mastercard';
492
+ } elseif ($option->getMethod() == "msp_mistercash") {
493
+ $optionText = 'MSP Mister Cash';
494
+ } elseif ($option->getMethod() == "msp_paypal") {
495
+ $optionText = 'MSP Paypal';
496
+ } elseif ($option->getMethod() == "msp_visa") {
497
+ $optionText = 'MSP Visa';
498
+ } elseif ($option->getMethod() == "paypal") {
499
+ $optionText = 'PayPal';
500
+ } elseif ($option->getMethod() == "ugiftcert") {
501
+ $optionText = 'Unirgy Gift Certificate';
502
+ } else {
503
+ $optionText = ucfirst($option->getMethod());
504
+ }
505
+
506
+ if($optionText) {
507
+ $options[$option->getMethod()] = ucfirst($optionText);
508
+ }
509
+ }
510
+ return $options;
511
+ }
512
+
513
+ /**
514
+ * Returns possible filters for Country column.
515
+ *
516
+ * @return array
517
+ */
518
+ public function getCountryOptions()
519
+ {
520
+ $options = Mage::getResourceModel('directory/country_collection')->load()->toOptionArray();
521
+ $countries = array();
522
+ foreach($options as $options){
523
+ $countries[$options['value']]=$options['label'];
524
+ }
525
+ return $countries;
526
+ }
527
+ }
app/code/community/Noble/PickUpOrders/Helper/Data.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Noble
4
+ * @package Noble_PickUpOrders
5
+ * @author Gilles Lesire
6
+ *
7
+ * Class Noble_PickUpOrders_Helper_Data
8
+ * Helper class
9
+ */
10
+ class Noble_PickUpOrders_Helper_Data extends Mage_Core_Helper_Abstract {
11
+
12
+ }
app/code/community/Noble/PickUpOrders/controllers/.DS_Store ADDED
Binary file
app/code/community/Noble/PickUpOrders/controllers/Adminhtml/PickuporderController.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Noble
4
+ * @package Noble_PickUpOrders
5
+ * @author Gilles Lesire
6
+ *
7
+ * Class Noble_PickUpOrders_Adminhtml_PickuporderController
8
+ * Controller for the designated order grid
9
+ */
10
+ class Noble_PickUpOrders_Adminhtml_PickuporderController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+ public function indexAction()
13
+ {
14
+ $this->_title($this->__('Sales'))->_title($this->__('Afhaalorders'));
15
+ $this->loadLayout();
16
+ $this->_setActiveMenu('sales/sales');
17
+ $this->_addContent($this->getLayout()->createBlock('noble_pickuporders/adminhtml_sales_order'));
18
+ $this->renderLayout();
19
+ }
20
+
21
+ public function gridAction()
22
+ {
23
+ $this->loadLayout();
24
+ $this->getResponse()->setBody(
25
+ $this->getLayout()->createBlock('noble_pickuporders/adminhtml_sales_order_grid')->toHtml()
26
+ );
27
+ }
28
+
29
+ public function exportNobleCsvAction()
30
+ {
31
+ $fileName = 'noble_pickuporders.csv';
32
+ $grid = $this->getLayout()->createBlock('noble_pickuporders/adminhtml_sales_order_grid');
33
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
34
+ }
35
+
36
+ public function exportNobleExcelAction()
37
+ {
38
+ $fileName = 'noble_pickuporders.xml';
39
+ $grid = $this->getLayout()->createBlock('noble_pickuporders/adminhtml_sales_order_grid');
40
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
41
+ }
42
+ }
app/code/community/Noble/PickUpOrders/etc/.DS_Store ADDED
Binary file
app/code/community/Noble/PickUpOrders/etc/adminhtml.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <menu>
4
+ <sales>
5
+ <children>
6
+ <noble_pickuporders translate="title" module="noble_pickuporders">
7
+ <sort_order>11</sort_order>
8
+ <title>Afhaalorders</title>
9
+ <action>adminhtml/pickuporder/</action>
10
+ </noble_pickuporders>
11
+ </children>
12
+ </sales>
13
+ </menu>
14
+ </config>
app/code/community/Noble/PickUpOrders/etc/config.xml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Noble_PickUpOrders>
5
+ <version>0.0.0.1</version>
6
+ </Noble_PickUpOrders>
7
+ </modules>
8
+
9
+ <global>
10
+ <models>
11
+ <noble_pickuporders>
12
+ <class>Noble_PickUpOrders_Model</class>
13
+ <resourceModel>noble_pickuporders_resource</resourceModel>
14
+ </noble_pickuporders>
15
+ </models>
16
+
17
+ <resources>
18
+ <noble_pickuporders_setup>
19
+ <setup>
20
+ <module>Noble_PickUpOrders</module>
21
+ </setup>
22
+ </noble_pickuporders_setup>
23
+ </resources>
24
+
25
+ <blocks>
26
+ <noble_pickuporders>
27
+ <class>Noble_PickUpOrders_Block</class>
28
+ </noble_pickuporders>
29
+ </blocks>
30
+
31
+ <helpers>
32
+ <noble_pickuporders>
33
+ <class>Noble_PickUpOrders_Helper</class>
34
+ </noble_pickuporders>
35
+ </helpers>
36
+ </global>
37
+
38
+ <admin>
39
+ <routers>
40
+ <adminhtml>
41
+ <args>
42
+ <modules>
43
+ <noble_pickuporders before="Mage_Adminhtml">Noble_PickUpOrders_Adminhtml</noble_pickuporders>
44
+ </modules>
45
+ </args>
46
+ </adminhtml>
47
+ </routers>
48
+ </admin>
49
+ </config>
app/code/community/Noble/UPSOrders/.DS_Store ADDED
Binary file
app/code/community/Noble/UPSOrders/Block/.DS_Store ADDED
Binary file
app/code/community/Noble/UPSOrders/Block/Adminhtml/.DS_Store ADDED
Binary file
app/code/community/Noble/UPSOrders/Block/Adminhtml/Sales/.DS_Store ADDED
Binary file
app/code/community/Noble/UPSOrders/Block/Adminhtml/Sales/Order.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Noble
5
+ * @package Noble_UPSOrders
6
+ * @author Gilles Lesire
7
+ *
8
+ * Class Noble_UPSOrders_Block_Adminhtml_Sales_Order
9
+ * This class overrides the default orders grid in the Admin panel
10
+ */
11
+ class Noble_UPSOrders_Block_Adminhtml_Sales_Order extends Mage_Adminhtml_Block_Widget_Grid_Container
12
+ {
13
+ public function __construct()
14
+ {
15
+ $this->_blockGroup = 'noble_upsorders';
16
+ $this->_controller = 'adminhtml_sales_order';
17
+ $this->_headerText = Mage::helper('noble_upsorders')->__('UPS Orders');
18
+
19
+ parent::__construct();
20
+ $this->_removeButton('add');
21
+ }
22
+ }
app/code/community/Noble/UPSOrders/Block/Adminhtml/Sales/Order/.DS_Store ADDED
Binary file
app/code/community/Noble/UPSOrders/Block/Adminhtml/Sales/Order/Grid.php ADDED
@@ -0,0 +1,527 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Noble
5
+ * @package Noble_UPSOrders
6
+ * @author Gilles Lesire
7
+ *
8
+ * Class Noble_UPSOrders_Block_Adminhtml_Sales_Order_Grid
9
+ * This class overrides the default orders grid in the Admin panel
10
+ */
11
+ class Noble_UPSOrders_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid
12
+ {
13
+
14
+ public function __construct()
15
+ {
16
+ parent::__construct();
17
+ $this->setId('noble_upsorders_grid');
18
+ $this->setUseAjax(true);
19
+ $this->setDefaultFilter(array('status' => 'processing'));
20
+ $this->setDefaultSort('created_at');
21
+ $this->setDefaultDir('DESC');
22
+ $this->setSaveParametersInSession(true);
23
+ }
24
+
25
+ /**
26
+ * Retrieve collection class
27
+ *
28
+ * @return string
29
+ */
30
+ protected function _getCollectionClass()
31
+ {
32
+ return 'sales/order_grid_collection';
33
+ }
34
+
35
+ protected function _prepareCollection()
36
+ {
37
+ $orderFields = array();
38
+ $billingFields = array();
39
+ $shippingFields = array();
40
+ $paymentFields = array();
41
+
42
+ $orderFields["shipping_method"] = "shipping_method";
43
+
44
+ if(Mage::getStoreConfig('noble/extended_columns/customer_email')) {
45
+ $orderFields["customer_email"] = "customer_email";
46
+ }
47
+
48
+ if(Mage::getStoreConfig('noble/extended_columns/amount_items')) {
49
+ $orderFields["total_qty_ordered"] = "ROUND(total_qty_ordered,0)";
50
+ }
51
+
52
+ if(Mage::getStoreConfig('noble/extended_columns/weight')) {
53
+ $orderFields["weight"] = "weight";
54
+ }
55
+
56
+ if(Mage::getStoreConfig('noble/extended_columns/customer_group')) {
57
+ $orderFields["customer_group_id"] = "customer_group_id";
58
+ }
59
+
60
+ if(Mage::getStoreConfig('noble/extended_columns/subtotal')) {
61
+ $orderFields["subtotal"] = "subtotal";
62
+ }
63
+
64
+ if(Mage::getStoreConfig('noble/extended_columns/remote_ip')) {
65
+ $orderFields["remote_ip"] = "remote_ip";
66
+ }
67
+
68
+ if(Mage::getStoreConfig('noble/extended_columns/billing_country')) {
69
+ $billingFields["billing_country"] = "sfoba.country_id";
70
+ }
71
+
72
+ if(Mage::getStoreConfig('noble/extended_columns/billing_region')) {
73
+ $billingFields["billing_region"] = "sfoba.region";
74
+ }
75
+
76
+ if(Mage::getStoreConfig('noble/extended_columns/billing_city')) {
77
+ $billingFields["billing_city"] = "sfoba.city";
78
+ }
79
+
80
+ if(Mage::getStoreConfig('noble/extended_columns/billing_postcode')) {
81
+ $billingFields["billing_postcode"] = "sfoba.postcode";
82
+ }
83
+
84
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_country')) {
85
+ $shippingFields["shipping_country"] = "sfosa.country_id";
86
+ }
87
+
88
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_region')) {
89
+ $shippingFields["shipping_region"] = "sfosa.region";
90
+ }
91
+
92
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_city')) {
93
+ $shippingFields["shipping_city"] = "sfosa.city";
94
+ }
95
+
96
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_postcode')) {
97
+ $shippingFields["shipping_postcode"] = "sfosa.postcode";
98
+ }
99
+
100
+ if(Mage::getStoreConfig('noble/extended_columns/payment_method')) {
101
+ $paymentFields["payment_method"] = "sfop.method";
102
+ }
103
+
104
+ $collection = Mage::getResourceModel($this->_getCollectionClass());
105
+ $collection->getSelect()->join(Mage::getConfig()->getTablePrefix() . 'sales_flat_order as sfo', 'sfo.entity_id=`main_table`.entity_id and sfo.shipping_method LIKE "ups%"', $orderFields)
106
+ ->join(Mage::getConfig()->getTablePrefix() . 'sales_flat_order_address as sfoba', 'sfoba.parent_id=`main_table`.entity_id and sfoba.address_type = "billing"', $billingFields)
107
+ ->join(Mage::getConfig()->getTablePrefix() . 'sales_flat_order_address as sfosa', 'sfosa.parent_id=`main_table`.entity_id and sfosa.address_type = "shipping"', $shippingFields)
108
+ ->join(Mage::getConfig()->getTablePrefix() . 'sales_flat_order_payment as sfop', 'sfop.parent_id=`main_table`.entity_id', $paymentFields);
109
+
110
+ $this->setCollection($collection);
111
+ return parent::_prepareCollection();
112
+ }
113
+
114
+ protected function _prepareColumns()
115
+ {
116
+ $helper = Mage::helper('noble_upsorders');
117
+
118
+ if(Mage::getStoreConfig('noble/default_columns/real_order_id')) {
119
+ $this->addColumn('real_order_id', array(
120
+ 'header'=> Mage::helper('sales')->__('Order #'),
121
+ 'width' => '80px',
122
+ 'type' => 'text',
123
+ 'index' => 'increment_id',
124
+ 'filter_index' => 'main_table.increment_id'
125
+ ));
126
+ }
127
+
128
+ if(Mage::getStoreConfig('noble/default_columns/store_id')) {
129
+ if (!Mage::app()->isSingleStoreMode()) {
130
+ $this->addColumn('store_id', array(
131
+ 'header' => Mage::helper('sales')->__('Purchased From (Store)'),
132
+ 'index' => 'store_id',
133
+ 'type' => 'store',
134
+ 'store_view'=> true,
135
+ 'display_deleted' => true,
136
+ 'filter_index' => 'sfo.store_id'
137
+ ));
138
+ }
139
+ }
140
+
141
+ if(Mage::getStoreConfig('noble/default_columns/created_at')) {
142
+ $this->addColumn('created_at', array(
143
+ 'header' => Mage::helper('sales')->__('Purchased On'),
144
+ 'index' => 'created_at',
145
+ 'type' => 'datetime',
146
+ 'width' => '100px',
147
+ 'filter_index' => 'main_table.created_at'
148
+ ));
149
+ }
150
+
151
+ if(Mage::getStoreConfig('noble/default_columns/billing_name')) {
152
+ $this->addColumn('billing_name', array(
153
+ 'header' => Mage::helper('sales')->__('Bill to Name'),
154
+ 'index' => 'billing_name',
155
+ 'filter_index' => 'main_table.billing_name'
156
+ ));
157
+ }
158
+
159
+ if(Mage::getStoreConfig('noble/default_columns/shipping_name')) {
160
+ $this->addColumn('shipping_name', array(
161
+ 'header' => Mage::helper('sales')->__('Ship to Name'),
162
+ 'index' => 'shipping_name',
163
+ 'filter_index' => 'main_table.shipping_name'
164
+ ));
165
+ }
166
+
167
+ if(Mage::getStoreConfig('noble/extended_columns/amount_items')) {
168
+ $this->addColumn('total_qty_ordered', array(
169
+ 'header' => $this->__('# of Items'),
170
+ 'type' => 'int',
171
+ 'index' => 'total_qty_ordered',
172
+ 'width' => '40px'
173
+ ));
174
+ }
175
+
176
+ if(Mage::getStoreConfig('noble/extended_columns/weight')) {
177
+ $this->addColumn('weight', array(
178
+ 'header' => $this->__('Weight'),
179
+ 'index' => 'weight',
180
+ 'filter_index' => 'sfo.weight'
181
+ ));
182
+ }
183
+
184
+ if(Mage::getStoreConfig('noble/default_columns/base_grand_total')) {
185
+ $this->addColumn('base_grand_total', array(
186
+ 'header' => Mage::helper('sales')->__('G.T. (Base)'),
187
+ 'index' => 'base_grand_total',
188
+ 'type' => 'currency',
189
+ 'currency' => 'base_currency_code',
190
+ ));
191
+ }
192
+
193
+ if(Mage::getStoreConfig('noble/default_columns/grand_total')) {
194
+ $this->addColumn('grand_total', array(
195
+ 'header' => Mage::helper('sales')->__('G.T. (Purchased)'),
196
+ 'index' => 'grand_total',
197
+ 'type' => 'currency',
198
+ 'currency' => 'order_currency_code',
199
+ ));
200
+ }
201
+
202
+ if(Mage::getStoreConfig('noble/extended_columns/subtotal')) {
203
+ $this->addColumn('subtotal', array(
204
+ 'header' => Mage::helper('sales')->__('Subtotal'),
205
+ 'index' => 'subtotal',
206
+ 'type' => 'currency',
207
+ 'currency' => 'order_currency_code',
208
+ ));
209
+ }
210
+
211
+ if(Mage::getStoreConfig('noble/default_columns/status')) {
212
+ $this->addColumn('status', array(
213
+ 'header' => $this->__('Status'),
214
+ 'index' => 'status',
215
+ 'type' => 'options',
216
+ 'width' => '70px',
217
+ 'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
218
+ 'filter_index' => 'main_table.status'
219
+ ));
220
+ }
221
+
222
+ if(Mage::getStoreConfig('noble/extended_columns/customer_group')) {
223
+ $this->addColumn('customer_group_id', array(
224
+ 'header' => Mage::helper('customer')->__('Customer Group'),
225
+ 'width' => '100',
226
+ 'index' => 'customer_group_id',
227
+ 'type' => 'options',
228
+ 'options' => $this->getCustomerGroupOptions(),
229
+ 'renderer' => 'Noble_AdminOrderGrid_Block_Sales_Order_Grid_Renderer_CustomerGroup'
230
+ ));
231
+ }
232
+
233
+ if(Mage::getStoreConfig('noble/extended_columns/customer_email')) {
234
+ $this->addColumn('customer_email', array(
235
+ 'header' => $this->__('Customer email'),
236
+ 'index' => 'customer_email'
237
+ ));
238
+ }
239
+
240
+ if(Mage::getStoreConfig('noble/extended_columns/billing_country') == "code") {
241
+ $this->addColumn('billing_country', array(
242
+ 'header' => Mage::helper('sales')->__('Billing Country'),
243
+ 'index' => 'billing_country',
244
+ 'filter_index' => 'sfoba.country_id',
245
+ 'width' => '60'
246
+ ));
247
+ }
248
+
249
+ if(Mage::getStoreConfig('noble/extended_columns/billing_country') == "full") {
250
+ $this->addColumn('billing_country', array(
251
+ 'header' => Mage::helper('sales')->__('Billing Country'),
252
+ 'index' => 'billing_country',
253
+ 'type' => 'options',
254
+ 'options' => $this->getCountryOptions(),
255
+ 'filter_index' => 'sfoba.country_id',
256
+ 'renderer' => 'adminhtml/widget_grid_column_renderer_country',
257
+ 'width' => '60'
258
+ ));
259
+ }
260
+
261
+ if(Mage::getStoreConfig('noble/extended_columns/billing_region')) {
262
+ $this->addColumn('billing_region', array(
263
+ 'header' => $this->__('Billing Region'),
264
+ 'index' => 'billing_region',
265
+ 'filter_index' => 'sfoba.region'
266
+ ));
267
+ }
268
+
269
+ if(Mage::getStoreConfig('noble/extended_columns/billing_city')) {
270
+ $this->addColumn('billing_city', array(
271
+ 'header' => $this->__('Billing City'),
272
+ 'index' => 'billing_city',
273
+ 'filter_index' => 'sfoba.city'
274
+ ));
275
+ }
276
+
277
+ if(Mage::getStoreConfig('noble/extended_columns/billing_postcode')) {
278
+ $this->addColumn('billing_postcode', array(
279
+ 'header' => $this->__('Billing Postcode'),
280
+ 'index' => 'billing_postcode',
281
+ 'filter_index' => 'sfoba.postcode'
282
+ ));
283
+ }
284
+
285
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_country') == "code") {
286
+ $this->addColumn('shipping_country', array(
287
+ 'header' => Mage::helper('sales')->__('Billing Country'),
288
+ 'index' => 'shipping_country',
289
+ 'filter_index' => 'sfosa.country_id',
290
+ 'width' => '60'
291
+ ));
292
+ }
293
+
294
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_region')) {
295
+ $this->addColumn('shipping_region', array(
296
+ 'header' => $this->__('Shipping Region'),
297
+ 'index' => 'shipping_region',
298
+ 'filter_index' => 'sfosa.region'
299
+ ));
300
+ }
301
+
302
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_city')) {
303
+ $this->addColumn('shipping_city', array(
304
+ 'header' => $this->__('Shipping City'),
305
+ 'index' => 'shipping_city',
306
+ 'filter_index' => 'sfosa.city'
307
+ ));
308
+ }
309
+
310
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_postcode')) {
311
+ $this->addColumn('shipping_postcode', array(
312
+ 'header' => $this->__('Shipping Postcode'),
313
+ 'index' => 'shipping_postcode',
314
+ 'filter_index' => 'sfosa.postcode'
315
+ ));
316
+ }
317
+
318
+ if(Mage::getStoreConfig('noble/extended_columns/shipping_country') == "full") {
319
+ $this->addColumn('billing_country', array(
320
+ 'header' => Mage::helper('sales')->__('Billing Country'),
321
+ 'index' => 'shipping_country',
322
+ 'type' => 'options',
323
+ 'options' => $this->getCountryOptions(),
324
+ 'filter_index' => 'sfosa.country_id',
325
+ 'renderer' => 'adminhtml/widget_grid_column_renderer_country',
326
+ 'width' => '60'
327
+ ));
328
+ }
329
+
330
+ if(Mage::getStoreConfig('noble/extended_columns/payment_method')) {
331
+ $this->addColumn('payment_method', array(
332
+ 'header' => Mage::helper('sales')->__('Payment method'),
333
+ 'index' => 'payment_method',
334
+ 'filter_index' => 'sfop.method',
335
+ 'type' => 'options',
336
+ 'options' => $this->getPaymentMethodOptions(),
337
+ 'renderer' => 'Noble_AdminOrderGrid_Block_Sales_Order_Grid_Renderer_Paymentmethod',
338
+ 'width' => '60'
339
+ ));
340
+ }
341
+
342
+ if(Mage::getStoreConfig('noble/extended_columns/remote_ip')) {
343
+ $this->addColumn('remote_ip', array(
344
+ 'header' => $this->__('Remote IP'),
345
+ 'index' => 'remote_ip',
346
+ 'filter_index' => 'sfo.remote_ip'
347
+ ));
348
+ }
349
+
350
+ if(Mage::getStoreConfig('noble/default_columns/action')) {
351
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
352
+ $this->addColumn('action',
353
+ array(
354
+ 'header' => Mage::helper('sales')->__('Action'),
355
+ 'width' => '50px',
356
+ 'type' => 'action',
357
+ 'getter' => 'getId',
358
+ 'actions' => array(
359
+ array(
360
+ 'caption' => Mage::helper('sales')->__('View'),
361
+ 'url' => array('base'=>'*/sales_order/view'),
362
+ 'field' => 'order_id'
363
+ )
364
+ ),
365
+ 'filter' => false,
366
+ 'sortable' => false,
367
+ 'index' => 'stores',
368
+ 'is_system' => true,
369
+ ));
370
+ }
371
+ }
372
+
373
+ $this->addRssList('rss/order/new', Mage::helper('sales')->__('New Order RSS'));
374
+
375
+ $this->addExportType('*/*/exportNobleCsv', $helper->__('CSV'));
376
+ $this->addExportType('*/*/exportNobleExcel', $helper->__('Excel XML'));
377
+
378
+ return parent::_prepareColumns();
379
+ }
380
+
381
+ protected function _prepareMassaction()
382
+ {
383
+ $this->setMassactionIdField('entity_id');
384
+ $this->getMassactionBlock()->setFormFieldName('order_ids');
385
+ $this->getMassactionBlock()->setUseSelectAll(false);
386
+
387
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/cancel')) {
388
+ $this->getMassactionBlock()->addItem('cancel_order', array(
389
+ 'label'=> Mage::helper('sales')->__('Cancel'),
390
+ 'url' => $this->getUrl('*/sales_order/massCancel'),
391
+ ));
392
+ }
393
+
394
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/hold')) {
395
+ $this->getMassactionBlock()->addItem('hold_order', array(
396
+ 'label'=> Mage::helper('sales')->__('Hold'),
397
+ 'url' => $this->getUrl('*/sales_order/massHold'),
398
+ ));
399
+ }
400
+
401
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/unhold')) {
402
+ $this->getMassactionBlock()->addItem('unhold_order', array(
403
+ 'label'=> Mage::helper('sales')->__('Unhold'),
404
+ 'url' => $this->getUrl('*/sales_order/massUnhold'),
405
+ ));
406
+ }
407
+
408
+ $this->getMassactionBlock()->addItem('pdfinvoices_order', array(
409
+ 'label'=> Mage::helper('sales')->__('Print Invoices'),
410
+ 'url' => $this->getUrl('*/sales_order/pdfinvoices'),
411
+ ));
412
+
413
+ $this->getMassactionBlock()->addItem('pdfshipments_order', array(
414
+ 'label'=> Mage::helper('sales')->__('Print Packingslips'),
415
+ 'url' => $this->getUrl('*/sales_order/pdfshipments'),
416
+ ));
417
+
418
+ $this->getMassactionBlock()->addItem('pdfcreditmemos_order', array(
419
+ 'label'=> Mage::helper('sales')->__('Print Credit Memos'),
420
+ 'url' => $this->getUrl('*/sales_order/pdfcreditmemos'),
421
+ ));
422
+
423
+ $this->getMassactionBlock()->addItem('pdfdocs_order', array(
424
+ 'label'=> Mage::helper('sales')->__('Print All'),
425
+ 'url' => $this->getUrl('*/sales_order/pdfdocs'),
426
+ ));
427
+
428
+ $this->getMassactionBlock()->addItem('print_shipping_label', array(
429
+ 'label'=> Mage::helper('sales')->__('Print Shipping Labels'),
430
+ 'url' => $this->getUrl('*/sales_order_shipment/massPrintShippingLabel'),
431
+ ));
432
+
433
+ return $this;
434
+ }
435
+
436
+ public function getRowUrl($row)
437
+ {
438
+ if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
439
+ return $this->getUrl('*/sales_order/view', array('order_id' => $row->getId()));
440
+ }
441
+ return false;
442
+ }
443
+
444
+ public function getGridUrl()
445
+ {
446
+ return $this->getUrl('*/*/grid', array('_current'=>true));
447
+ }
448
+
449
+ /**
450
+ * Returns possible filters for CustomerGroup column.
451
+ *
452
+ * @return array
453
+ */
454
+ public function getCustomerGroupOptions()
455
+ {
456
+ $options = Mage::getResourceModel('customer/group_collection')
457
+ ->addFieldToFilter('customer_group_id', array('gt'=> 0))
458
+ ->load()
459
+ ->toOptionHash();
460
+
461
+ return $options;
462
+ }
463
+
464
+ /**
465
+ * Returns possible filters for PaymentMethod column.
466
+ *
467
+ * @return array
468
+ */
469
+ public function getPaymentMethodOptions()
470
+ {
471
+ $options = array();
472
+ $optionText = "";
473
+ $collection = Mage::getModel('sales/order_payment')->getCollection()->addFieldToSelect('method');
474
+ $collection->getSelect()->group('method');
475
+ foreach ($collection as $option) {
476
+ $optionText = "";
477
+
478
+ if ($option->getMethod() == "msp_banktransfer") {
479
+ $optionText = 'MSP Banktransfer';
480
+ } elseif ($option->getMethod() == "msp_directdebit") {
481
+ $optionText = 'MSP Direct Debit';
482
+ } elseif ($option->getMethod() == "msp_directebanking") {
483
+ $optionText = 'MSP Direct Banking';
484
+ } elseif ($option->getMethod() == "msp_giropay") {
485
+ $optionText = 'MSP Giropay';
486
+ } elseif ($option->getMethod() == "msp_ideal") {
487
+ $optionText = 'MSP Ideal';
488
+ } elseif ($option->getMethod() == "msp_maestro") {
489
+ $optionText = 'MSP Maestro';
490
+ } elseif ($option->getMethod() == "msp_mastercard") {
491
+ $optionText = 'MSP Mastercard';
492
+ } elseif ($option->getMethod() == "msp_mistercash") {
493
+ $optionText = 'MSP Mister Cash';
494
+ } elseif ($option->getMethod() == "msp_paypal") {
495
+ $optionText = 'MSP Paypal';
496
+ } elseif ($option->getMethod() == "msp_visa") {
497
+ $optionText = 'MSP Visa';
498
+ } elseif ($option->getMethod() == "paypal") {
499
+ $optionText = 'PayPal';
500
+ } elseif ($option->getMethod() == "ugiftcert") {
501
+ $optionText = 'Unirgy Gift Certificate';
502
+ } else {
503
+ $optionText = ucfirst($option->getMethod());
504
+ }
505
+
506
+ if($optionText) {
507
+ $options[$option->getMethod()] = ucfirst($optionText);
508
+ }
509
+ }
510
+ return $options;
511
+ }
512
+
513
+ /**
514
+ * Returns possible filters for Country column.
515
+ *
516
+ * @return array
517
+ */
518
+ public function getCountryOptions()
519
+ {
520
+ $options = Mage::getResourceModel('directory/country_collection')->load()->toOptionArray();
521
+ $countries = array();
522
+ foreach($options as $options){
523
+ $countries[$options['value']]=$options['label'];
524
+ }
525
+ return $countries;
526
+ }
527
+ }
app/code/community/Noble/UPSOrders/Helper/Data.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Noble
4
+ * @package Noble_UPSOrders
5
+ * @author Gilles Lesire
6
+ *
7
+ * Class Noble_UPSOrders_Helper_Data
8
+ * Helper class
9
+ */
10
+ class Noble_UPSOrders_Helper_Data extends Mage_Core_Helper_Abstract {
11
+
12
+ }
app/code/community/Noble/UPSOrders/controllers/.DS_Store ADDED
Binary file
app/code/community/Noble/UPSOrders/controllers/Adminhtml/UpsorderController.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Noble
4
+ * @package Noble_UPSOrders
5
+ * @author Gilles Lesire
6
+ *
7
+ * Class Noble_UPSOrders_Adminhtml_UPS_OrderController
8
+ * Controller for the designated order grid
9
+ */
10
+ class Noble_UPSOrders_Adminhtml_UpsorderController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+ public function indexAction()
13
+ {
14
+ $this->_title($this->__('Sales'))->_title($this->__('UPS Orders'));
15
+ $this->loadLayout();
16
+ $this->_setActiveMenu('sales/sales');
17
+ $this->_addContent($this->getLayout()->createBlock('noble_upsorders/adminhtml_sales_order'));
18
+ $this->renderLayout();
19
+ }
20
+
21
+ public function gridAction()
22
+ {
23
+ $this->loadLayout();
24
+ $this->getResponse()->setBody(
25
+ $this->getLayout()->createBlock('noble_upsorders/adminhtml_sales_order_grid')->toHtml()
26
+ );
27
+ }
28
+
29
+ public function exportNobleCsvAction()
30
+ {
31
+ $fileName = 'noble_upsorders.csv';
32
+ $grid = $this->getLayout()->createBlock('noble_upsorders/adminhtml_sales_order_grid');
33
+ $this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
34
+ }
35
+
36
+ public function exportNobleExcelAction()
37
+ {
38
+ $fileName = 'noble_upsorders.xml';
39
+ $grid = $this->getLayout()->createBlock('noble_upsorders/adminhtml_sales_order_grid');
40
+ $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
41
+ }
42
+ }
app/code/community/Noble/UPSOrders/etc/.DS_Store ADDED
Binary file
app/code/community/Noble/UPSOrders/etc/adminhtml.xml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <menu>
4
+ <sales>
5
+ <children>
6
+ <noble_upsorders translate="title" module="noble_upsorders">
7
+ <sort_order>12</sort_order>
8
+ <title>UPS Orders</title>
9
+ <action>adminhtml/upsorder/</action>
10
+ </noble_upsorders>
11
+ </children>
12
+ </sales>
13
+ </menu>
14
+ </config>
app/code/community/Noble/UPSOrders/etc/config.xml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Noble_UPSOrders>
5
+ <version>0.0.0.1</version>
6
+ </Noble_UPSOrders>
7
+ </modules>
8
+
9
+ <global>
10
+ <models>
11
+ <noble_upsorders>
12
+ <class>Noble_UPSOrders_Model</class>
13
+ <resourceModel>noble_upsorders_resource</resourceModel>
14
+ </noble_upsorders>
15
+ </models>
16
+
17
+ <resources>
18
+ <noble_upsorders_setup>
19
+ <setup>
20
+ <module>Noble_UPSOrders</module>
21
+ </setup>
22
+ </noble_upsorders_setup>
23
+ </resources>
24
+
25
+ <blocks>
26
+ <noble_upsorders>
27
+ <class>Noble_UPSOrders_Block</class>
28
+ </noble_upsorders>
29
+ </blocks>
30
+
31
+ <helpers>
32
+ <noble_upsorders>
33
+ <class>Noble_UPSOrders_Helper</class>
34
+ </noble_upsorders>
35
+ </helpers>
36
+ </global>
37
+
38
+ <admin>
39
+ <routers>
40
+ <adminhtml>
41
+ <args>
42
+ <modules>
43
+ <noble_upsorders before="Mage_Adminhtml">Noble_UPSOrders_Adminhtml</noble_upsorders>
44
+ </modules>
45
+ </args>
46
+ </adminhtml>
47
+ </routers>
48
+ </admin>
49
+ </config>
package.xml CHANGED
@@ -1,14 +1,13 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Noble_Extended_Order_Grid</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="https://opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This extension gives the user the flexibility to customize the orders grid in the admin.</summary>
10
- <description>&lt;h2&gt;Description&lt;/h2&gt;&#xD;
11
- &lt;p&gt;&#xD;
12
  Managing orders is probably the most frequent task you'll be doing in Magento when running your store. Unfortunately most of the information of an order is not visible in the order grid out of the box, making it impossible to filter on attributes which might be more relevant to you. &#xD;
13
  &lt;/p&gt;&#xD;
14
  &lt;p&gt;&#xD;
@@ -47,6 +46,7 @@ Available custom columns are:&#xD;
47
  - Customer Group&lt;br /&gt;&#xD;
48
  - Weight&lt;br /&gt;&#xD;
49
  - Remote IP&lt;br /&gt;&#xD;
 
50
  &lt;/p&gt;&#xD;
51
  &lt;h2&gt;2. Implementation&lt;/h2&gt;&#xD;
52
  &lt;p&gt;&#xD;
@@ -62,11 +62,11 @@ Configuring the columns is very easy. Just login to your Magento Admin panel, go
62
  &lt;h2&gt;4. Extra information&lt;/h2&gt;&#xD;
63
  &lt;p&gt;&#xD;
64
  &lt;a href="https://github.com/KingIsulgard/Magento-Noble-Extended-Order-Grid"&gt;Visit on GitHub&lt;/a&gt;&lt;/p&gt;</description>
65
- <notes>Fixed issue with non standard payment methods not showing up in the column filter select field.</notes>
66
- <authors><author><name>Gilles Lesire</name><user>NobleHouse</user><email>gilles.lesire@gmail.com</email></author></authors>
67
- <date>2016-02-09</date>
68
- <time>13:12:46</time>
69
- <contents><target name="magecommunity"><dir name="Noble"><dir name="AdminOrderGrid"><dir name="Block"><dir name="Sales"><dir name="Order"><dir name="Grid"><dir name="Renderer"><file name="CustomerGroup.php" hash="0415c522a79744de05fdbabbe293233d"/><file name="Paymentmethod.php" hash="78748496a1d56afb0435db876f32c276"/><file name="Shippingmethod.php" hash="fb337469e0f8f40b91d9efc5197c4ce2"/></dir></dir><file name="Grid.php" hash="b27077b825f07c83888784f8205959bb"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f26371c30f43b67fc7e8895e67af20b9"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Country.php" hash="15aaf45cb5ee39ac3dbf94cab44d46fd"/></dir></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="dd8f9834661e4f43e6fe7b4176431b15"/><file name="config.xml" hash="467754d8e88bf2616c4cb3184f973f0f"/><file name="system.xml" hash="82875e917a5dc2a1b8a9647ab0a610f9"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Noble_AdminOrderGrid.xml" hash="1637b9c7d1a23394272986444bc3880b"/></dir></target></contents>
70
  <compatible/>
71
  <dependencies><required><php><min>4.0.0</min><max>6.0.0</max></php></required></dependencies>
72
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Noble_Extended_Order_Grid</name>
4
+ <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license uri="https://opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This extension gives the user the flexibility to customize the orders grid in the admin.</summary>
10
+ <description>&lt;p&gt;&#xD;
 
11
  Managing orders is probably the most frequent task you'll be doing in Magento when running your store. Unfortunately most of the information of an order is not visible in the order grid out of the box, making it impossible to filter on attributes which might be more relevant to you. &#xD;
12
  &lt;/p&gt;&#xD;
13
  &lt;p&gt;&#xD;
46
  - Customer Group&lt;br /&gt;&#xD;
47
  - Weight&lt;br /&gt;&#xD;
48
  - Remote IP&lt;br /&gt;&#xD;
49
+ - Coupon code&lt;br /&gt;&#xD;
50
  &lt;/p&gt;&#xD;
51
  &lt;h2&gt;2. Implementation&lt;/h2&gt;&#xD;
52
  &lt;p&gt;&#xD;
62
  &lt;h2&gt;4. Extra information&lt;/h2&gt;&#xD;
63
  &lt;p&gt;&#xD;
64
  &lt;a href="https://github.com/KingIsulgard/Magento-Noble-Extended-Order-Grid"&gt;Visit on GitHub&lt;/a&gt;&lt;/p&gt;</description>
65
+ <notes>Added coupon code column.</notes>
66
+ <authors><author><name>Gilles Lesire</name><user>NobleHouse</user><email>gilles.lesire@noble-house.tk</email></author></authors>
67
+ <date>2016-02-17</date>
68
+ <time>17:04:49</time>
69
+ <contents><target name="magecommunity"><dir name="Noble"><dir name="AdminOrderGrid"><dir name="Block"><dir name="Sales"><dir name="Order"><dir name="Grid"><dir name="Renderer"><file name="CustomerGroup.php" hash="0415c522a79744de05fdbabbe293233d"/><file name="Paymentmethod.php" hash="78748496a1d56afb0435db876f32c276"/><file name="Shippingmethod.php" hash="fb337469e0f8f40b91d9efc5197c4ce2"/></dir></dir><file name="Grid.php" hash="89180324a2115a6ead2570505bbf4689"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="499a39af87fc5642604e93dd0ee9f294"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Country.php" hash="c153f42c3522fbf32963c59ab79c12fb"/></dir></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="dd8f9834661e4f43e6fe7b4176431b15"/><file name="config.xml" hash="fe6514cd3ca2f331905a02892b021eae"/><file name="system.xml" hash="6e366d3578ab0f79e52fc5dd92a71be8"/></dir></dir><dir name="AutoInvoice"><dir name="Model"><file name="Observer.php" hash="1d4571dfe9b0e73ff05f5979b7bad9c0"/></dir><dir name="etc"><file name="config.xml" hash="509650794f0dd267d2dee9ba96f363ef"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="PickUpOrders"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="721c5ff4187ed1f8d265fed88c65f922"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name="Order.php" hash="e15c0a54b29c13a5830b969b311084b8"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="9478929620ef60358c0794d5ca9ed97e"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PickuporderController.php" hash="b5df4be837e45debb5c53ae14e0fd96a"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="460a5361cb214f82674f54a4802376f0"/><file name="config.xml" hash="9f348006972adf69078b9e3c66b6f222"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="UPSOrders"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="a174e12a444e1e53561dbce6307dd7ae"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name="Order.php" hash="36108dfce8f389f3a89d855a1250c36c"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="Helper"><file name="Data.php" hash="da550aadb62e4c32b4c151004ee09675"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="UpsorderController.php" hash="6278740fd665f6275c6062c171fe15e4"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="116c8f4bf7e4b9610905a70608237ef7"/><file name="config.xml" hash="98acd476cb4ecb82575dbdaa7b73a28c"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="a686a5607d70f9aebb60d8b2f4260b00"/></dir></target><target name="mageetc"><dir name="modules"><file name="Noble_AdminOrderGrid.xml" hash="1637b9c7d1a23394272986444bc3880b"/></dir></target></contents>
70
  <compatible/>
71
  <dependencies><required><php><min>4.0.0</min><max>6.0.0</max></php></required></dependencies>
72
  </package>