1 | <?php |
||
3 | class DMSDocumentCartCheckoutPage_Controller extends Page_Controller |
||
|
|||
4 | { |
||
5 | private static $allowed_actions = array( |
||
6 | 'DMSDocumentRequestForm', |
||
7 | 'complete' |
||
8 | ); |
||
9 | |||
10 | /** |
||
11 | * An array containing the recipients basic information |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | public static $receiverInfo = array( |
||
16 | 'ReceiverName' => '', |
||
17 | 'ReceiverPhone' => '', |
||
18 | 'ReceiverEmail' => '', |
||
19 | 'DeliveryAddressLine1' => '', |
||
20 | 'DeliveryAddressLine2' => '', |
||
21 | 'DeliveryAddressCountry' => '', |
||
22 | 'DeliveryAddressPostCode' => '', |
||
23 | ); |
||
24 | |||
25 | /** |
||
26 | * Gets and displays an editable list of items within the cart, as well as a contact form with entry |
||
27 | * fields for the recipients information. |
||
28 | * |
||
29 | * To extend use the following from within an Extension subclass: |
||
30 | * |
||
31 | * <code> |
||
32 | * public function updateDMSDocumentRequestForm($form) |
||
33 | * { |
||
34 | * // Do something here |
||
35 | * } |
||
36 | * </code> |
||
37 | * |
||
38 | * @return Form |
||
39 | */ |
||
40 | public function DMSDocumentRequestForm() |
||
87 | |||
88 | /** |
||
89 | * Sends an email to both the configured recipient as well as the requester. The |
||
90 | * configured recipient is bcc'ed to the email in order to fulfill it. |
||
91 | * |
||
92 | * To extend use the following from within an Extension subclass: |
||
93 | * |
||
94 | * <code> |
||
95 | * public function updateSend($email) |
||
96 | * { |
||
97 | * // Do something here |
||
98 | * } |
||
99 | * </code> |
||
100 | * @return mixed |
||
101 | * |
||
102 | * @throws DMSDocumentCartException |
||
103 | */ |
||
104 | public function send() |
||
135 | |||
136 | /** |
||
137 | * Handles form submission. |
||
138 | * Totals requested are updated, delivery details added, email sent for fulfillment |
||
139 | * and print request totals updated. |
||
140 | * |
||
141 | * @param array $data |
||
142 | * @param Form $form |
||
143 | * @param SS_HTTPRequest $request |
||
144 | * |
||
145 | * @return SS_HTTPResponse |
||
146 | */ |
||
147 | public function doRequestSend($data, Form $form, SS_HTTPRequest $request) |
||
158 | |||
159 | /** |
||
160 | * Displays the preconfigured thank you message to the user upon completion |
||
161 | * |
||
162 | * @return ViewableData_Customised |
||
163 | */ |
||
164 | public function complete() |
||
174 | |||
175 | /** |
||
176 | * Increments the print counts of all documents which were successfully sent. |
||
177 | */ |
||
178 | public function trackTimestampedPrintRequest() |
||
185 | |||
186 | /** |
||
187 | * Retrieves a {@link DMSDocumentCart} instance |
||
188 | * |
||
189 | * @return DMSDocumentCart |
||
190 | */ |
||
191 | public function getCart() |
||
195 | |||
196 | /** |
||
197 | * Updates the document quantities just before the request is sent. |
||
198 | * |
||
199 | * @param array $data |
||
200 | */ |
||
201 | public function updateCartItems($data) |
||
214 | |||
215 | /** |
||
216 | * Updates the cart receiver info just before the request is sent. |
||
217 | * |
||
218 | * @param array $data |
||
219 | */ |
||
220 | public function updateCartReceiverInfo($data) |
||
225 | } |
||
226 |
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.