1 | <?php |
||
10 | class OrderStep_SendAdminNotification extends OrderStep implements OrderStepInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $emailClassName = 'Order_ReceiptEmail'; |
||
16 | |||
17 | private static $defaults = array( |
||
|
|||
18 | 'CustomerCanEdit' => 0, |
||
19 | 'CustomerCanCancel' => 0, |
||
20 | 'CustomerCanPay' => 1, |
||
21 | 'Name' => 'Send Admin Notification', |
||
22 | 'Code' => 'ADMINNOTIFIED', |
||
23 | 'ShowAsInProcessOrder' => 1, |
||
24 | ); |
||
25 | |||
26 | /** |
||
27 | * can run step once order has been submitted. |
||
28 | * |
||
29 | * @param Order object |
||
30 | * |
||
31 | * @return bool - true if the current step is ready to be run... |
||
32 | **/ |
||
33 | public function initStep(Order $order) |
||
41 | |||
42 | /** |
||
43 | * send invoice to customer |
||
44 | * or in case this is not selected, it will send a message to the shop admin only |
||
45 | * The latter is useful in case the payment does not go through (and no receipt is received). |
||
46 | * |
||
47 | * @param DataObject $order Order |
||
48 | * |
||
49 | * @return bool |
||
50 | **/ |
||
51 | public function doStep(Order $order) |
||
62 | |||
63 | /** |
||
64 | * can do next step once the admin notification has been sent |
||
65 | * |
||
66 | * @param Order $order |
||
67 | * |
||
68 | * @return OrderStep | Null (next step OrderStep object) |
||
69 | **/ |
||
70 | public function nextStep(Order $order) |
||
78 | |||
79 | /** |
||
80 | * Allows the opportunity for the Order Step to add any fields to Order::getCMSFields. |
||
81 | * |
||
82 | *@param FieldList $fields |
||
83 | *@param Order $order |
||
84 | * |
||
85 | *@return FieldList |
||
86 | **/ |
||
87 | public function addOrderStepFields(FieldList $fields, Order $order) |
||
95 | |||
96 | /** |
||
97 | * For some ordersteps this returns true... |
||
98 | * |
||
99 | * @return bool |
||
100 | **/ |
||
101 | protected function hasCustomerMessage() |
||
105 | |||
106 | /** |
||
107 | * Explains the current order step. |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | protected function myDescription() |
||
118 | } |
||
119 |