From f1728568c30b00b0faec3f6ebd9598942e80ddb7 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Tue, 17 Sep 2019 12:55:01 +0200 Subject: [PATCH] - add publisher_name and publish_id - extend DatasetExtension wirt PublisherName and PublishId - adapt migrations --- .../Controllers/Publish/EditorController.php | 10 +++ app/Library/Xml/DatasetExtension.php | 2 + app/Models/Dataset.php | 2 + ...19_08_28_083836_create_documents_table.php | 1 + .../views/publish/create-step1.blade.php | 2 - .../views/workflow/editor/publish.blade.php | 62 +++++++++---------- 6 files changed, 44 insertions(+), 35 deletions(-) diff --git a/app/Http/Controllers/Publish/EditorController.php b/app/Http/Controllers/Publish/EditorController.php index bb13743..417a4bd 100644 --- a/app/Http/Controllers/Publish/EditorController.php +++ b/app/Http/Controllers/Publish/EditorController.php @@ -371,9 +371,19 @@ class EditorController extends Controller public function publishUpdate(Request $request, $id) { $dataset = Dataset::findOrFail($id); + + $max = Dataset::max('publish_id'); + $publish_id = 0; + if ($max != null) { + $publish_id = $max +1; + } else { + $publish_id = $publish_id + 1; + } + $input = $request->all(); $input['server_state'] = 'published'; $input['server_date_published'] = Carbon::now()->toDateTimeString(); // Produces something like "2019-03-11 12:25:00" + $input['publish_id'] = $publish_id; if ($dataset->update($input)) { // event(new PageUpdated($page)); diff --git a/app/Library/Xml/DatasetExtension.php b/app/Library/Xml/DatasetExtension.php index 453bbb7..b57acc7 100644 --- a/app/Library/Xml/DatasetExtension.php +++ b/app/Library/Xml/DatasetExtension.php @@ -85,6 +85,8 @@ trait DatasetExtension { $fields = array( "Id", + "PublisherName", + "PublishId", "ContributingCorporation", "CreatingCorporation", "Language", diff --git a/app/Models/Dataset.php b/app/Models/Dataset.php index dde0d4c..d972553 100644 --- a/app/Models/Dataset.php +++ b/app/Models/Dataset.php @@ -33,6 +33,8 @@ class Dataset extends Model 'language', 'server_state', 'server_date_published', + 'publisher_name', + 'publish_id', 'creating_corporation', 'project_id', 'embargo_date', diff --git a/database/migrations/2019_08_28_083836_create_documents_table.php b/database/migrations/2019_08_28_083836_create_documents_table.php index 00294e2..9e2a548 100644 --- a/database/migrations/2019_08_28_083836_create_documents_table.php +++ b/database/migrations/2019_08_28_083836_create_documents_table.php @@ -19,6 +19,7 @@ class CreateDocumentsTable extends Migration $table->string('creating_corporation', 255); $table->string('publisher_name', 255)->nullable(); $table->dateTime('embargo_date')->nullable(); + $table->unsignedInteger('publish_id')->unique()->nullable(); $table->integer('project_id')->unsigned()->nullable(); $table->foreign('project_id')->references('id')->on('projects'); $table->enum( diff --git a/resources/views/publish/create-step1.blade.php b/resources/views/publish/create-step1.blade.php index 9ed301e..2aada13 100644 --- a/resources/views/publish/create-step1.blade.php +++ b/resources/views/publish/create-step1.blade.php @@ -245,8 +245,6 @@
- {{-- Einräumung eines einfachen Nutzungsrechts --}} -
-@stop -@section('after-scripts') +@stop +@section('after-scripts') @stop \ No newline at end of file