- add publisher_name and publish_id

- extend DatasetExtension wirt PublisherName and PublishId
- adapt migrations
This commit is contained in:
Arno Kaimbacher 2019-09-17 12:55:01 +02:00
parent 68add9025f
commit f1728568c3
6 changed files with 44 additions and 35 deletions

View File

@ -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));

View File

@ -85,6 +85,8 @@ trait DatasetExtension
{
$fields = array(
"Id",
"PublisherName",
"PublishId",
"ContributingCorporation",
"CreatingCorporation",
"Language",

View File

@ -33,6 +33,8 @@ class Dataset extends Model
'language',
'server_state',
'server_date_published',
'publisher_name',
'publish_id',
'creating_corporation',
'project_id',
'embargo_date',

View File

@ -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(

View File

@ -245,8 +245,6 @@
</fieldset>
<div :class="{'form-group':true, 'has-error':errors.has('step-1.rights')}">
{{-- <legend>Einräumung eines einfachen Nutzungsrechts</legend> --}}
<label for="rights">
<input class="form-checkbox" name="rights" id="rights" type="checkbox" v-model="dataset.rights" v-validate="'required'" data-vv-scope="step-1">
terms and conditions

View File

@ -17,8 +17,10 @@
</div>
<div id="app1">
{!! Form::model($dataset, [ 'method' => 'POST', 'route' => ['publish.workflow.editor.publishUpdate', $dataset->id],
'id' => 'publishForm', 'class' => 'pure-form', 'enctype' => 'multipart/form-data', 'v-on:submit.prevent' => 'checkForm'])
{!! Form::model($dataset, [ 'method' => 'POST', 'route' => ['publish.workflow.editor.publishUpdate',
$dataset->id],
'id' => 'publishForm', 'class' => 'pure-form', 'enctype' => 'multipart/form-data', 'v-on:submit.prevent' =>
'checkForm'])
!!}
<fieldset id="fieldset-General">
@ -35,43 +37,37 @@
</div>
@endforeach
<div class="authors">
@foreach($dataset->persons as $author)
{{ $author->full_name }}
@endforeach
@foreach($dataset->persons as $author)
{{ $author->full_name }}
@endforeach
</div>
<input type="hidden" name="selected[]" value="49">
</td>
</tr>
</tbody>
</table>
<div class="instruction">
<div class="pure-u-1 pure-u-md-1-2 pure-div">
{!! Form::label('publisher_name', 'Publisher Name') !!}
{!! Form::text('publisher_name', 'Geologische Bundesanstalt Österreich', ['readonly', 'class' =>
'pure-u-23-24', ]) !!}
</div>
<div class="pure-controls instruction ">
<p>
Are you sure you want to publish the selected dataset?
</div>
<table>
<tbody><tr>
<td>&nbsp;</td>
<td>
<button type="submit" class="pure-button">
<i class="fa fa-share"></i>
<span>Set published</span>
</button>
{{-- <input type="submit" name="sureno" value="No"> --}}
</td>
</tr>
</tbody>
</table>
</p>
<button type="submit" class="pure-button">
<i class="fa fa-share"></i>
<span>Set published</span>
</button>
{{-- <input type="submit" name="sureno" value="No"> --}}
</div>
</fieldset>
<br />
{{-- <div class="pure-controls">
<button type="submit" class="pure-button">
<i class="fa fa-share"></i>
<span>Set published</span>
</button>
</div> --}}
{!! Form::close() !!}
</div>