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 DMSDocumentRequestForm |
||
39 | */ |
||
40 | public function DMSDocumentRequestForm() |
||
58 | |||
59 | /** |
||
60 | * Sends an email to both the configured recipient as well as the requester. The |
||
61 | * configured recipient is bcc'ed to the email in order to fulfill it. |
||
62 | * |
||
63 | * To extend use the following from within an Extension subclass: |
||
64 | * |
||
65 | * <code> |
||
66 | * public function updateSend($email) |
||
67 | * { |
||
68 | * // Do something here |
||
69 | * } |
||
70 | * </code> |
||
71 | * @return mixed |
||
72 | * |
||
73 | * @throws DMSDocumentCartException |
||
74 | */ |
||
75 | public function send() |
||
102 | |||
103 | /** |
||
104 | * Handles form submission. |
||
105 | * Totals requested are updated, delivery details added, email sent for fulfillment |
||
106 | * and print request totals updated. |
||
107 | * |
||
108 | * @param array $data |
||
109 | * @param Form $form |
||
110 | * @param SS_HTTPRequest $request |
||
111 | * |
||
112 | * @return SS_HTTPResponse |
||
113 | */ |
||
114 | public function doRequestSend($data, Form $form, SS_HTTPRequest $request) |
||
125 | |||
126 | /** |
||
127 | * Displays the preconfigured thank you message to the user upon completion |
||
128 | * |
||
129 | * @return ViewableData_Customised |
||
130 | */ |
||
131 | public function complete() |
||
141 | |||
142 | /** |
||
143 | * Increments the print counts of all documents which were successfully sent. |
||
144 | */ |
||
145 | public function trackTimestampedPrintRequest() |
||
154 | |||
155 | /** |
||
156 | * Retrieves a {@link DMSDocumentCart} instance |
||
157 | * |
||
158 | * @return DMSDocumentCart |
||
159 | */ |
||
160 | public function getCart() |
||
164 | |||
165 | /** |
||
166 | * Updates the document quantities just before the request is sent. |
||
167 | * |
||
168 | * @param array $data |
||
169 | */ |
||
170 | public function updateCartItems($data) |
||
183 | |||
184 | /** |
||
185 | * Updates the cart receiver info just before the request is sent. |
||
186 | * |
||
187 | * @param array $data |
||
188 | */ |
||
189 | public function updateCartReceiverInfo($data) |
||
194 | } |
||
195 |
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.