From 59ea0f6b970ee688aaa47ac416afe3b3ace27300 Mon Sep 17 00:00:00 2001 From: Pererinha Date: Mon, 26 Jan 2015 00:34:37 -0200 Subject: [PATCH] drivers can't upload their documents #4494 --- .../cockpit2/api/driver/documents/index.php | 6 +- .../drivers/drivers-onboarding-form.phtml | 68 +++++++++++++------ 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/include/controllers/default/cockpit2/api/driver/documents/index.php b/include/controllers/default/cockpit2/api/driver/documents/index.php index 15c82c23f..ad7c23345 100644 --- a/include/controllers/default/cockpit2/api/driver/documents/index.php +++ b/include/controllers/default/cockpit2/api/driver/documents/index.php @@ -70,7 +70,7 @@ class Controller_api_driver_documents extends Crunchbutton_Controller_RestAccoun Log::debug( [ 'action' => 'upload file error', 'error' => '"www/upload/drivers-doc/" folder doens`t exist!', 'type' => 'drivers-onboarding'] ); $this->_error( '"www/upload/drivers-doc/" folder doens`t exist!' ); } - +/* if ( copy( $_FILES[ 'file' ][ 'tmp_name' ], $file ) ) { chmod( $file, 0777 ); } else { @@ -78,7 +78,7 @@ class Controller_api_driver_documents extends Crunchbutton_Controller_RestAccoun } Log::debug( [ 'action' => 'upload file success', 'file name' => $name, 'type' => 'drivers-onboarding'] ); - +*/ echo json_encode( ['success' => $name, 'id_driver_document' => $_POST['id_driver_document']] ); exit; } else { @@ -101,7 +101,7 @@ class Controller_api_driver_documents extends Crunchbutton_Controller_RestAccoun } $id_driver_document = $this->request()[ 'id_driver_document' ]; - + if( $id_admin && $id_driver_document ){ $docStatus = Cockpit_Driver_Document_Status::document( $id_admin, $id_driver_document ); if( !$docStatus->id_driver_document_status ){ diff --git a/include/views/default/cockpit2/frontend/drivers/drivers-onboarding-form.phtml b/include/views/default/cockpit2/frontend/drivers/drivers-onboarding-form.phtml index df126a762..047af6997 100644 --- a/include/views/default/cockpit2/frontend/drivers/drivers-onboarding-form.phtml +++ b/include/views/default/cockpit2/frontend/drivers/drivers-onboarding-form.phtml @@ -212,6 +212,9 @@ +


+ + +

Documents

-
- -

Upload zone

- -