| @@ 248-260 (lines=13) @@ | ||
| 245 | return $this->redirect(Url::toRoute(['view', 'id' => $submission->form_id])); |
|
| 246 | } |
|
| 247 | ||
| 248 | public function actionDownload($key, $submissionId) |
|
| 249 | { |
|
| 250 | $submission = Submission::findOne($submissionId); |
|
| 251 | if ($submission === null) { |
|
| 252 | throw new NotFoundHttpException('Submission not found'); |
|
| 253 | } |
|
| 254 | $prop = $submission->getPropertyValuesByKey($key); |
|
| 255 | return \Yii::$app->response->sendFile( |
|
| 256 | Yii::getAlias(Yii::$app->getModule('core')->visitorsFileUploadPath) . |
|
| 257 | DIRECTORY_SEPARATOR . |
|
| 258 | $prop->values[0]['value'] |
|
| 259 | ); |
|
| 260 | } |
|
| 261 | ||
| 262 | public function actionDelete($id = null) |
|
| 263 | { |
|
| @@ 65-77 (lines=13) @@ | ||
| 62 | } |
|
| 63 | } |
|
| 64 | ||
| 65 | public function actionDownloadFile($key, $orderId) |
|
| 66 | { |
|
| 67 | $order = Order::findOne($orderId); |
|
| 68 | if ($order === null) { |
|
| 69 | throw new NotFoundHttpException('Order not found'); |
|
| 70 | } |
|
| 71 | $prop = $order->getPropertyValuesByKey($key); |
|
| 72 | return \Yii::$app->response->sendFile( |
|
| 73 | Yii::getAlias(Yii::$app->getModule('core')->visitorsFileUploadPath) . |
|
| 74 | DIRECTORY_SEPARATOR . |
|
| 75 | $prop->values[0]['value'] |
|
| 76 | ); |
|
| 77 | } |
|
| 78 | ||
| 79 | ||
| 80 | protected function getManagersList() |
|