diff --git a/app/Http/Controllers/Publish/WorkflowController.php b/app/Http/Controllers/Publish/WorkflowController.php index f5e0f29..911ad0f 100644 --- a/app/Http/Controllers/Publish/WorkflowController.php +++ b/app/Http/Controllers/Publish/WorkflowController.php @@ -29,8 +29,8 @@ class WorkflowController extends Controller $builder = Dataset::query(); $myDatasets = $builder - ->whereIn('server_state', ['inprogress', 'released']) - // ->where('account_id', $user_id) + ->whereIn('server_state', ['inprogress', 'released', 'editor_accepted']) + ->where('account_id', $user_id) ->with('user:id,login') ->get(); return view('workflow.index', [ @@ -120,7 +120,7 @@ class WorkflowController extends Controller $builder = Dataset::query(); $datasets = $builder //->where('server_state', 'inprogress') - ->whereIn('server_state', ['released']) + ->whereIn('server_state', ['released', 'editor_accepted']) ->get(); return view('workflow.editor_index', compact('datasets')); } @@ -152,6 +152,17 @@ class WorkflowController extends Controller public function acceptUpdate(Request $request, $id) { $dataset = Dataset::findOrFail($id); + + try { + $dataset->setServerState("editor_accepted"); + $user = Auth::user(); + $dataset->editor()->associate($user)->save(); + $dataset->save(); + return redirect()->back(); + //return redirect()->route('settings.review.index'); + } catch (Exception $e) { + throw new GeneralException(trans('exceptions.publish.accept.update_error')); + } } // public function release() @@ -190,7 +201,7 @@ class WorkflowController extends Controller session()->flash('flash_message', 'You have puplished 1 dataset!'); } $dataset->save(); - return redirect()->back(); + //return redirect()->back(); //return redirect()->route('settings.review.index'); } catch (Exception $e) { //return $this->_redirectTo('index', array('failure' => $e->getMessage()), 'documents', 'admin'); diff --git a/public/backend/style.css b/public/backend/style.css index dae2a80..a78b2ea 100644 --- a/public/backend/style.css +++ b/public/backend/style.css @@ -943,6 +943,11 @@ textarea.large, input.large { .pure-table tr.released { background-color: greenyellow; } +.pure-table tr.editor_accepted { + padding: 0.8em; + background-color: lightblue; +} + diff --git a/resources/lang/en/exceptions.php b/resources/lang/en/exceptions.php index 47e496c..7c8621f 100644 --- a/resources/lang/en/exceptions.php +++ b/resources/lang/en/exceptions.php @@ -16,6 +16,9 @@ return [ 'release' => [ 'update_error' => 'There was a problem rleasing this dataset. Please try again.', ], + 'accept' => [ + 'update_error' => 'There was a problem accepting this dataset. Please try again.', + ], ], 'backend' => [ diff --git a/resources/views/settings/layouts/app.blade.php b/resources/views/settings/layouts/app.blade.php index 2900447..972a755 100644 --- a/resources/views/settings/layouts/app.blade.php +++ b/resources/views/settings/layouts/app.blade.php @@ -92,15 +92,21 @@
  • Publish