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() |
||
80 | |||
81 | /** |
||
82 | * Sends an email to both the configured recipient as well as the requester. The |
||
83 | * configured recipient is bcc'ed to the email in order to fulfill it. |
||
84 | * |
||
85 | * To extend use the following from within an Extension subclass: |
||
86 | * |
||
87 | * <code> |
||
88 | * public function updateSend($email) |
||
89 | * { |
||
90 | * // Do something here |
||
91 | * } |
||
92 | * </code> |
||
93 | * @return mixed |
||
94 | * |
||
95 | * @throws DMSDocumentCartException |
||
96 | */ |
||
97 | public function send() |
||
124 | |||
125 | /** |
||
126 | * Handles form submission. |
||
127 | * Totals requested are updated, delivery details added, email sent for fulfillment |
||
128 | * and print request totals updated. |
||
129 | * |
||
130 | * @param array $data |
||
131 | * @param Form $form |
||
132 | * @param SS_HTTPRequest $request |
||
133 | * |
||
134 | * @return SS_HTTPResponse |
||
135 | */ |
||
136 | public function doRequestSend($data, Form $form, SS_HTTPRequest $request) |
||
147 | |||
148 | /** |
||
149 | * Displays the preconfigured thank you message to the user upon completion |
||
150 | * |
||
151 | * @return ViewableData_Customised |
||
152 | */ |
||
153 | public function complete() |
||
163 | |||
164 | /** |
||
165 | * Increments the print counts of all documents which were successfully sent. |
||
166 | */ |
||
167 | public function trackTimestampedPrintRequest() |
||
176 | |||
177 | /** |
||
178 | * Retrieves a {@link DMSDocumentCart} instance |
||
179 | * |
||
180 | * @return DMSDocumentCart |
||
181 | */ |
||
182 | public function getCart() |
||
186 | |||
187 | /** |
||
188 | * Updates the document quantities just before the request is sent. |
||
189 | * |
||
190 | * @param array $data |
||
191 | */ |
||
192 | public function updateCartItems($data) |
||
205 | |||
206 | /** |
||
207 | * Updates the cart receiver info just before the request is sent. |
||
208 | * |
||
209 | * @param array $data |
||
210 | */ |
||
211 | public function updateCartReceiverInfo($data) |
||
216 | } |
||
217 |
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.