|
|
@ -395,7 +395,7 @@ class ActivityController extends Controller |
|
|
|
$gantt_id = $request->gantt_id; |
|
|
|
$gantt_id = $request->gantt_id; |
|
|
|
$name = $document->getClientOriginalName(); |
|
|
|
$name = $document->getClientOriginalName(); |
|
|
|
|
|
|
|
|
|
|
|
$result = $document->move($this->pathDocument, $name); |
|
|
|
$result = $document->move($this->pathTmpImport, $name); |
|
|
|
if($result){ |
|
|
|
if($result){ |
|
|
|
$data = [ |
|
|
|
$data = [ |
|
|
|
'ref_id' => (int)$gantt_id, |
|
|
|
'ref_id' => (int)$gantt_id, |
|
|
@ -406,7 +406,7 @@ class ActivityController extends Controller |
|
|
|
$result = TmpImport::create($data); |
|
|
|
$result = TmpImport::create($data); |
|
|
|
|
|
|
|
|
|
|
|
if(!$result){ |
|
|
|
if(!$result){ |
|
|
|
unlink($this->pathDocument.$name); |
|
|
|
unlink($this->pathTmpImport.$name); |
|
|
|
return response()->json(['status'=>'failed','message'=>'Upload failed!','code'=> 500], 500); |
|
|
|
return response()->json(['status'=>'failed','message'=>'Upload failed!','code'=> 500], 500); |
|
|
|
} |
|
|
|
} |
|
|
|
return response()->json(['status'=>'success','message'=>'Upload successful!','code'=>200], 200); |
|
|
|
return response()->json(['status'=>'success','message'=>'Upload successful!','code'=>200], 200); |
|
|
|