1 | <?php |
||
3 | class DMSCheckoutController extends ContentController |
||
|
|||
4 | { |
||
5 | private static $allowed_actions = array( |
||
6 | 'DMSDocumentRequestForm', |
||
7 | 'index', |
||
8 | 'complete', |
||
9 | 'send' |
||
10 | ); |
||
11 | |||
12 | /** |
||
13 | * An array containing the recipients basic information |
||
14 | * |
||
15 | * @config |
||
16 | * @var array |
||
17 | */ |
||
18 | private static $receiver_info = array( |
||
19 | 'ReceiverName' => '', |
||
20 | 'ReceiverPhone' => '', |
||
21 | 'ReceiverEmail' => '', |
||
22 | 'DeliveryAddressLine1' => '', |
||
23 | 'DeliveryAddressLine2' => '', |
||
24 | 'DeliveryAddressCountry' => '', |
||
25 | 'DeliveryAddressPostCode' => '', |
||
26 | ); |
||
27 | |||
28 | public function init() |
||
34 | |||
35 | public function index() |
||
45 | |||
46 | /** |
||
47 | * Gets and displays an editable list of items within the cart, as well as a contact form with entry |
||
48 | * fields for the recipients information. |
||
49 | * |
||
50 | * To extend use the following from within an Extension subclass: |
||
51 | * |
||
52 | * <code> |
||
53 | * public function updateDMSDocumentRequestForm($form) |
||
54 | * { |
||
55 | * // Do something here |
||
56 | * } |
||
57 | * </code> |
||
58 | * |
||
59 | * @return Form |
||
60 | */ |
||
61 | public function DMSDocumentRequestForm() |
||
102 | |||
103 | /** |
||
104 | * Sends an email to both the configured recipient as well as the requester. The |
||
105 | * configured recipient is bcc'ed to the email in order to fulfill it. |
||
106 | * |
||
107 | * To extend use the following from within an Extension subclass: |
||
108 | * |
||
109 | * <code> |
||
110 | * public function updateSend($email) |
||
111 | * { |
||
112 | * // Do something here |
||
113 | * } |
||
114 | * </code> |
||
115 | * @return mixed |
||
116 | */ |
||
117 | public function send() |
||
146 | |||
147 | /** |
||
148 | * Handles form submission. |
||
149 | * Totals requested are updated, delivery details added, email sent for fulfillment |
||
150 | * and print request totals updated. |
||
151 | * |
||
152 | * @param array $data |
||
153 | * @param Form $form |
||
154 | * @param SS_HTTPRequest $request |
||
155 | * |
||
156 | * @return SS_HTTPResponse |
||
157 | */ |
||
158 | public function doRequestSend($data, Form $form, SS_HTTPRequest $request) |
||
168 | |||
169 | /** |
||
170 | * Displays the preconfigured thank you message to the user upon completion |
||
171 | * |
||
172 | * @return ViewableData |
||
173 | */ |
||
174 | public function complete() |
||
188 | |||
189 | /** |
||
190 | * Retrieves a {@link DMSDocumentCart} instance |
||
191 | * |
||
192 | * @return DMSDocumentCart |
||
193 | */ |
||
194 | public function getCart() |
||
198 | |||
199 | /** |
||
200 | * Updates the document quantities just before the request is sent. |
||
201 | * |
||
202 | * @param array $data |
||
203 | */ |
||
204 | public function updateCartItems($data) |
||
217 | |||
218 | /** |
||
219 | * Updates the cart receiver info just before the request is sent. |
||
220 | * |
||
221 | * @param array $data |
||
222 | */ |
||
223 | public function updateCartReceiverInfo($data) |
||
228 | |||
229 | /** |
||
230 | * Ensure that links for this controller use the customised route |
||
231 | * |
||
232 | * @param string $action |
||
233 | * @return string |
||
234 | */ |
||
235 | public function Link($action = null) |
||
239 | |||
240 | /** |
||
241 | * If BCC email addresses are configured, return the addresses to send to in comma delimited format |
||
242 | * |
||
243 | * @return string |
||
244 | */ |
||
245 | protected function getConfirmationBcc() |
||
254 | } |
||
255 |
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.