1 | <?php |
||
23 | class ElectronicDelivery_OrderStep extends OrderStep |
||
|
|||
24 | { |
||
25 | private static $db = array( |
||
26 | "SendMessageToCustomer" => "Boolean", |
||
27 | "NumberOfHoursBeforeDownloadGetsDeleted" => "Float" |
||
28 | ); |
||
29 | |||
30 | private static $many_many = array( |
||
31 | "AdditionalFiles" => "File" |
||
32 | ); |
||
33 | |||
34 | private static $field_labels = array( |
||
35 | "SendMessageToCustomer" => "Send a message to the customer with download details?", |
||
36 | "NumberOfHoursBeforeDownloadGetsDeleted" => "Number of hours before download expires (you can use decimals (e.g. 0.5 equals half-an-hour)." |
||
37 | ); |
||
38 | |||
39 | private static $defaults = array( |
||
40 | "Name" => "Download", |
||
41 | "Code" => "DOWNLOAD", |
||
42 | "Description" => "Customer downloads the files", |
||
43 | "NumberOfHoursBeforeDownloadGetsDeleted" => 72, |
||
44 | "SendMessageToCustomer" => true, |
||
45 | |||
46 | //customer privileges |
||
47 | "CustomerCanEdit" => 0, |
||
48 | "CustomerCanCancel" => 0, |
||
49 | "CustomerCanPay" => 0, |
||
50 | //What to show the customer... |
||
51 | "ShowAsUncompletedOrder" => 0, |
||
52 | "ShowAsInProcessOrder" => 1, |
||
53 | "ShowAsCompletedOrder" => 0, |
||
54 | //sort |
||
55 | "Sort" => 37, |
||
56 | ); |
||
57 | |||
58 | /** |
||
59 | * The method that provides a datalist of files to be downloaded for a buyable. |
||
60 | * @var String |
||
61 | */ |
||
62 | private static $download_method_in_byable = "DownloadFiles"; |
||
63 | |||
64 | /** |
||
65 | * The OrderStatusLog that is relevant to the particular step. |
||
66 | * @var String |
||
67 | */ |
||
68 | protected $relevantLogEntryClassName = "ElectronicDelivery_OrderLog"; |
||
69 | |||
70 | /** |
||
71 | * @var String |
||
72 | */ |
||
73 | protected $emailClassName = "Order_StatusEmail"; |
||
74 | |||
75 | |||
76 | public function getCMSFields() |
||
84 | |||
85 | /** |
||
86 | * Can always run step. |
||
87 | * remove anything that is expired... |
||
88 | * @param Order $order |
||
89 | * @return Boolean |
||
90 | **/ |
||
91 | public function initStep(Order $order) |
||
95 | |||
96 | /** |
||
97 | * Add the member to the order, in case the member is not an admin. |
||
98 | * @param Order $order |
||
99 | * @return Boolean |
||
100 | **/ |
||
101 | public function doStep(Order $order) |
||
152 | |||
153 | /** |
||
154 | * nextStep: |
||
155 | * returns the next step (after it checks if everything is in place for the next step to run...) |
||
156 | * @see Order::doNextStatus |
||
157 | * |
||
158 | * @param Order $order |
||
159 | * |
||
160 | * @return OrderStep | Null (next step OrderStep object) |
||
161 | **/ |
||
162 | public function nextStep(Order $order) |
||
184 | |||
185 | /** |
||
186 | * Allows the opportunity for the Order Step to add any fields to Order::getCMSFields |
||
187 | * |
||
188 | * @param FieldList $fields |
||
189 | * @param Order $order |
||
190 | * |
||
191 | * @return FieldList |
||
192 | **/ |
||
193 | public function addOrderStepFields(FieldList $fields, Order $order) |
||
199 | |||
200 | /** |
||
201 | * Explains the current order step. |
||
202 | * @return String |
||
203 | */ |
||
204 | protected function myDescription() |
||
208 | |||
209 | |||
210 | /** |
||
211 | * For some ordersteps this returns true... |
||
212 | * @return Boolean |
||
213 | **/ |
||
214 | protected function hasCustomerMessage() |
||
218 | } |
||
219 |
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.