1 | <?php |
||
3 | class DMSCheckoutController extends DMSCartAbstractController |
||
|
|||
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() |
||
46 | |||
47 | /** |
||
48 | * Gets and displays a list of items within the cart, as well as a contact form with entry |
||
49 | * fields for the recipients information. |
||
50 | * |
||
51 | * To extend use the following from within an Extension subclass: |
||
52 | * |
||
53 | * <code> |
||
54 | * public function updateDMSDocumentRequestForm($form) |
||
55 | * { |
||
56 | * // Do something here |
||
57 | * } |
||
58 | * </code> |
||
59 | * |
||
60 | * @return Form |
||
61 | */ |
||
62 | public function DMSDocumentRequestForm() |
||
103 | |||
104 | /** |
||
105 | * Sends an email to both the configured recipient as well as the requester. The |
||
106 | * configured recipient is bcc'ed to the email in order to fulfill it. |
||
107 | * |
||
108 | * To extend use the following from within an Extension subclass: |
||
109 | * |
||
110 | * <code> |
||
111 | * public function updateSend($email) |
||
112 | * { |
||
113 | * // Do something here |
||
114 | * } |
||
115 | * </code> |
||
116 | * @return mixed |
||
117 | */ |
||
118 | public function send() |
||
147 | |||
148 | /** |
||
149 | * Handles form submission. |
||
150 | * Totals requested are updated, delivery details added, email sent for fulfillment |
||
151 | * and print request totals updated. |
||
152 | * |
||
153 | * @param array $data |
||
154 | * @param Form $form |
||
155 | * @param SS_HTTPRequest $request |
||
156 | * |
||
157 | * @return SS_HTTPResponse |
||
158 | */ |
||
159 | 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 | * Updates the cart receiver info just before the request is sent. |
||
191 | * |
||
192 | * @param array $data |
||
193 | */ |
||
194 | public function updateCartReceiverInfo($data) |
||
199 | |||
200 | /** |
||
201 | * If BCC email addresses are configured, return the addresses to send to in comma delimited format |
||
202 | * |
||
203 | * @return string |
||
204 | */ |
||
205 | protected function getConfirmationBcc() |
||
214 | } |
||
215 |
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.