1 | <?php |
||
9 | class OrderStep_Sent extends OrderStep implements OrderStepInterface |
||
|
|||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $emailClassName = 'Order_StatusEmail'; |
||
15 | |||
16 | private static $db = array( |
||
17 | 'SendDetailsToCustomer' => 'Boolean', |
||
18 | 'EmailSubjectGift' => 'Varchar(200)', |
||
19 | 'CustomerMessageGift' => 'HTMLText' |
||
20 | ); |
||
21 | |||
22 | private static $defaults = array( |
||
23 | 'CustomerCanEdit' => 0, |
||
24 | 'CustomerCanCancel' => 0, |
||
25 | 'CustomerCanPay' => 0, |
||
26 | 'Name' => 'Send Order', |
||
27 | 'Code' => 'SENT', |
||
28 | 'ShowAsInProcessOrder' => 1 |
||
29 | ); |
||
30 | |||
31 | private static $field_labels = [ |
||
32 | 'EmailSubjectGift' => 'Email subject', |
||
33 | 'CustomerMessageGift' => 'Customer message' |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * The OrderStatusLog that is relevant to the particular step. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $relevantLogEntryClassName = 'OrderStatusLog_DispatchPhysicalOrder'; |
||
42 | |||
43 | public function getCMSFields() |
||
67 | |||
68 | /** |
||
69 | *initStep: |
||
70 | * makes sure the step is ready to run.... (e.g. check if the order is ready to be emailed as receipt). |
||
71 | * should be able to run this function many times to check if the step is ready. |
||
72 | * |
||
73 | * @see Order::doNextStatus |
||
74 | * |
||
75 | * @param Order object |
||
76 | * |
||
77 | * @return bool - true if the current step is ready to be run... |
||
78 | **/ |
||
79 | public function initStep(Order $order) |
||
83 | |||
84 | /** |
||
85 | *doStep: |
||
86 | * should only be able to run this function once |
||
87 | * (init stops you from running it twice - in theory....) |
||
88 | * runs the actual step. |
||
89 | * |
||
90 | * @see Order::doNextStatus |
||
91 | * |
||
92 | * @param Order object |
||
93 | * |
||
94 | * @return bool - true if run correctly. |
||
95 | **/ |
||
96 | public function doStep(Order $order) |
||
109 | |||
110 | /** |
||
111 | *nextStep: |
||
112 | * returns the next step (after it checks if everything is in place for the next step to run...). |
||
113 | * |
||
114 | * @see Order::doNextStatus |
||
115 | * |
||
116 | * @param Order $order |
||
117 | * |
||
118 | * @return OrderStep | Null (next step OrderStep object) |
||
119 | **/ |
||
120 | public function nextStep(Order $order) |
||
128 | |||
129 | /** |
||
130 | * Allows the opportunity for the Order Step to add any fields to Order::getCMSFields. |
||
131 | * |
||
132 | * @param FieldList $fields |
||
133 | * @param Order $order |
||
134 | * |
||
135 | * @return FieldList |
||
136 | **/ |
||
137 | public function addOrderStepFields(FieldList $fields, Order $order) |
||
145 | |||
146 | /** |
||
147 | * For some ordersteps this returns true... |
||
148 | * |
||
149 | * @return bool |
||
150 | **/ |
||
151 | protected function hasCustomerMessage() |
||
155 | |||
156 | /** |
||
157 | * Explains the current order step. |
||
158 | * |
||
159 | * @return string |
||
160 | */ |
||
161 | protected function myDescription() |
||
165 | |||
166 | public function CalculatedEmailSubject($order = null) |
||
178 | |||
179 | public function CalculatedCustomerMessage($order = null) |
||
191 | } |
||
192 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.