diff --git a/app/Http/Controllers/Oai/RequestController.php b/app/Http/Controllers/Oai/RequestController.php index 4dea1da..25e545b 100644 --- a/app/Http/Controllers/Oai/RequestController.php +++ b/app/Http/Controllers/Oai/RequestController.php @@ -125,6 +125,7 @@ class RequestController extends Controller $this->proc->setParameter('', 'baseURL', url('/') . $uri[0]); $this->proc->setParameter('', 'repURL', url('/')); $this->proc->setParameter('', 'downloadLink', url('/') . '/file/download/'); + $this->proc->setParameter('', 'doiLink', 'https://doi.org/'); // $resumptionPath = $this->configuration->getResumptionTokenPath(); diff --git a/app/Http/Controllers/Publish/EditorController.php b/app/Http/Controllers/Publish/EditorController.php index 6b9a647..32a2e09 100644 --- a/app/Http/Controllers/Publish/EditorController.php +++ b/app/Http/Controllers/Publish/EditorController.php @@ -386,15 +386,21 @@ class EditorController extends Controller if (is_array($keywords) && count($keywords) > 0) { foreach ($keywords as $key => $formKeyword) { if (isset($formKeyword['id'])) { + // is readonly $subject = Subject::findOrFail($formKeyword['id']); - $subject->value = $formKeyword['value']; - $subject->type = $formKeyword['type']; - if ($subject->isDirty()) { - $subject->save(); - } + // $subject->value = $formKeyword['value']; + // $subject->type = $formKeyword['type']; + // if ($subject->isDirty()) { + // $subject->save(); + // } } else { - $subject = new Subject($formKeyword); - $dataset->subjects()->save($subject); + // $subject = new Subject($formKeyword); + // $dataset->subjects()->save($subject); + $keyword = Subject::firstOrCreate( + ['value' => $formKeyword['value'], 'language' => $formKeyword['language']], + $formKeyword + ); + $dataset->subjects()->attach($keyword); } } } diff --git a/app/Http/Controllers/Publish/SubmitController.php b/app/Http/Controllers/Publish/SubmitController.php index 58780c9..040feef 100644 --- a/app/Http/Controllers/Publish/SubmitController.php +++ b/app/Http/Controllers/Publish/SubmitController.php @@ -317,14 +317,19 @@ class SubmitController extends Controller foreach ($keywords as $key => $formKeyword) { if (isset($formKeyword['id'])) { $subject = Subject::findOrFail($formKeyword['id']); - $subject->value = $formKeyword['value']; - $subject->type = $formKeyword['type']; - if ($subject->isDirty()) { - $subject->save(); - } + // $subject->value = $formKeyword['value']; + // $subject->type = $formKeyword['type']; + // if ($subject->isDirty()) { + // $subject->save(); + // } } else { - $subject = new Subject($formKeyword); - $dataset->subjects()->save($subject); + // $subject = new Subject($formKeyword); + // $dataset->subjects()->save($subject); + $keyword = Subject::firstOrCreate( + ['value' => $formKeyword['value'], 'language' => $formKeyword['language']], + $formKeyword + ); + $dataset->subjects()->attach($keyword); } } } diff --git a/public/datasetxml2oai-pmh.xslt b/public/datasetxml2oai-pmh.xslt index f62274c..bcf8f34 100644 --- a/public/datasetxml2oai-pmh.xslt +++ b/public/datasetxml2oai-pmh.xslt @@ -24,6 +24,7 @@ + @@ -370,6 +371,9 @@ + + + @@ -561,6 +565,12 @@ + + + + + + diff --git a/resources/views/workflow/editor/_form.blade.php b/resources/views/workflow/editor/_form.blade.php index 8aaf968..05268c8 100644 --- a/resources/views/workflow/editor/_form.blade.php +++ b/resources/views/workflow/editor/_form.blade.php @@ -546,7 +546,7 @@ - {{-- {{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }} --}} diff --git a/resources/views/workflow/submitter/_form.blade.php b/resources/views/workflow/submitter/_form.blade.php index 44424ab..be2856e 100644 --- a/resources/views/workflow/submitter/_form.blade.php +++ b/resources/views/workflow/submitter/_form.blade.php @@ -542,7 +542,7 @@ - {{-- {{ Form::text('keywords['.$keyword->id.'][value]', $keyword->value, ['class' => 'form-control', 'placeholder' => '[KEYWORD VALUE]']) }} --}}