diff --git a/app/Http/Controllers/Oai/RequestController.php b/app/Http/Controllers/Oai/RequestController.php
index a8c7bda..d999ab2 100644
--- a/app/Http/Controllers/Oai/RequestController.php
+++ b/app/Http/Controllers/Oai/RequestController.php
@@ -145,7 +145,7 @@ class RequestController extends Controller
private function handleIdentify()
{
$email = "repository@geologie.ac.at";
- $repositoryName = "TETHYS - Data Research Repository";
+ $repositoryName = "TETHYS RDR";
$repIdentifier = "tethys.geologie.ac.at";
$sampleIdentifier = "oai:" . $repIdentifier . ":27";//$this->_configuration->getSampleIdentifier();
$earliestDateFromDb = optional(Dataset::earliestPublicationDate())->server_date_published;
diff --git a/app/Http/Controllers/Publish/EditorController.php b/app/Http/Controllers/Publish/EditorController.php
index 10f9682..e72adb5 100644
--- a/app/Http/Controllers/Publish/EditorController.php
+++ b/app/Http/Controllers/Publish/EditorController.php
@@ -52,7 +52,10 @@ class EditorController extends Controller
})
->orderBy('server_date_modified', 'desc')
->get();
- return View::make('workflow.editor.index', compact($datasets));
+ // return View::make('workflow.editor.index', compact('datasets'));
+ return View::make('workflow.editor.index', [
+ 'datasets' => $datasets,
+ ]);
}
/**
@@ -94,9 +97,14 @@ class EditorController extends Controller
*/
public function edit($id): \Illuminate\Contracts\View\View
{
- $dataset = Dataset::findOrFail($id);
- $dataset->load('licenses', 'titles', 'abstracts', 'files', 'coverage', 'subjects', 'references');
+ $dataset = Dataset::findOrFail($id);
+ $dataset->load('licenses', 'authors', 'contributors', 'titles', 'abstracts', 'files', 'coverage', 'subjects', 'references');
+ $titleTypes = ['Main' => 'Main', 'Sub' => 'Sub', 'Alternative' => 'Alternative', 'Translated' => 'Translated', 'Other' => 'Other'];
+ $descriptionTypes = ['Abstract' => 'Abstract', 'Methods' => 'Methods', 'Series_information' => 'Series_information', 'Technical_info' => 'Technical_info', 'Translated' => 'Translated', 'Other' => 'Other'];
+ $languages = DB::table('languages')
+ ->where('active', true)
+ ->pluck('part1', 'part1');
$projects = Project::pluck('label', 'id');
$datum = date('Y-m-d');
@@ -109,22 +117,20 @@ class EditorController extends Controller
$languages = DB::table('languages')
->where('active', true)
->pluck('part1', 'part1');
-
- //$options = License::all();
+
// $options = License::all('id', 'name_long');
$licenses = License::select('id', 'name_long', 'link_licence')
- ->orderBy('sort_order')
- ->get();
- //$checkeds = $dataset->licenses->pluck('id')->toArray();
+ ->orderBy('sort_order')
+ ->get();
+ // $checkeds = $dataset->licenses->pluck('id')->toArray();
$checkeds = $dataset->licenses->first()->id;
-
+
$keywordTypes = ['uncontrolled' => 'uncontrolled', 'swd' => 'swd'];
- $referenceTypes = ["rdr-id", "arXiv", "bibcode", "DOI", "EAN13", "EISSN", "Handle", "IGSN", "ISBN", "ISSN", "ISTC", "LISSN", "LSID", "PMID", "PURL", "UPC", "URL", "URN"];
+ $referenceTypes = ["rdr-id", "doi", "handle", "isbn", "issn", "url", "urn"];
$referenceTypes = array_combine($referenceTypes, $referenceTypes);
- $relationTypes = ["IsCitedBy", "Cites", "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", "HasMetadata", "IsMetadataFor","IsNewVersionOf", "IsPreviousVersionOf", "IsPartOf", "HasPart", "IsReferencedBy", "References"];
- // "IsDocumentedBy", "Documents", "IsCompiledBy", "Compiles", "IsVariantFormOf", "IsOriginalFormOf", "IsIdenticalTo", "IsReviewedBy", "Reviews", "IsDerivedFrom", "IsSourceOf"];
+ $relationTypes = ["IsCitedBy", "Cites", "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", "HasMetadata", "IsMetadataFor", "IsNewVersionOf", "IsPreviousVersionOf", "IsPartOf", "HasPart", "IsReferencedBy", "References", "IsDocumentedBy", "Documents", "IsCompiledBy", "Compiles", "IsVariantFormOf", "IsOriginalFormOf", "IsIdenticalTo", "IsReviewedBy", "Reviews", "IsDerivedFrom", "IsSourceOf"];
$relationTypes = array_combine($relationTypes, $relationTypes);
@@ -132,6 +138,9 @@ class EditorController extends Controller
'workflow.editor.edit',
compact(
'dataset',
+ 'titleTypes',
+ 'descriptionTypes',
+ 'languages',
'projects',
'licenses',
'checkeds',
@@ -156,42 +165,127 @@ class EditorController extends Controller
public function update(DocumentRequest $request, $id): RedirectResponse
{
$rules = [
- 'type' => 'required|min:5',
- 'coverage.xmin' => [
- 'nullable',
+ 'type' => 'required|min:3',
+ 'titles.*.value' => 'required|min:4|max:255',
+ 'titles.*.language' => 'required',
+ 'descriptions.*.value' => 'required|min:4|max:2500',
+ 'descriptions.*.language' => 'required',
+ 'coverage.x_min' => [
+ 'required',
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
],
- 'coverage.ymin' => [
- 'nullable',
+ 'coverage.y_min' => [
+ 'required',
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
],
- 'coverage.xmax' => [
- 'nullable',
+ 'coverage.x_max' => [
+ 'required',
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
],
- 'coverage.ymax' => [
- 'nullable',
+ 'coverage.y_max' => [
+ 'required',
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
],
+ 'subjects' => 'required|array|min:3',
+ 'subjects.*.value' => 'required|string',
+ 'subjects.*.type' => 'required|string',
+ 'files' => 'required|array|min:1',
+ 'files.*.label' => 'required|string',
];
- $validator = Validator::make($request->all(), $rules);
+ $customMessages = [
+ 'subjects.min' => 'Minimal three keywords are required.',
+ 'subjects.*.type.required' => 'The types of all keywords are required.',
+ 'files.min' => 'Minimal one file is required.',
+ ];
+ if (null != $request->file('files')) {
+ $data = $request->all();
+ $files = count($request->input('files')) - 1;
+ foreach (range(0, $files) as $index) {
+ // $rules['files.' . $index] = 'image|max:2048';
+ $rules['files.' . $index . '.file'] = [new RdrFilesize($index + 1), 'file', new RdrFiletypes()];
+ }
+ }
+ $validator = Validator::make($request->all(), $rules, $customMessages);
if (!$validator->fails()) {
$dataset = Dataset::findOrFail($id);
$data = $request->all();
- $input = $request->except('abstracts', 'licenses', 'titles', 'coverage', '_method', '_token');
-
+ $input = $request->except(
+ 'abstracts',
+ 'licenses',
+ 'authors',
+ 'contributors',
+ 'titles',
+ 'coverage',
+ 'subjects',
+ 'references',
+ 'files'
+ );
+
$licenses = $request->input('licenses');
//$licenses = $input['licenses'];
$dataset->licenses()->sync($licenses);
+ $dataset->authors()->sync([]);
+ //store authors
+ if (isset($data['authors'])) {
+ // $data_to_sync = [];
+ $index = 0;
+ foreach ($request->get('authors') as $key => $person) {
+ $pivot_data = ['role' => 'author', 'sort_order' => $index + 1, 'allow_email_contact' => false];
+ // if ($galery_id == $request->get('mainPicture')) $pivot_data = ['main' => 1];
+ if (isset($person['id'])) {
+ // $data_to_sync[$person['id']] = $pivot_data;
+ $dataset->persons()->attach($person['id'], $pivot_data);
+ } else {
+ $dataPerson = new Person($person);
+ $dataPerson->status = true;
+ $dataPerson->name_type = "Organizational";
+ $dataset->persons()->save($dataPerson, $pivot_data);
+ }
+ $index++;
+ }
+ // $dataset->persons()->sync($data_to_sync);
+ }
+
+ $dataset->contributors()->sync([]);
+ //store contributors
+ if (isset($data['contributors'])) {
+ // $data_to_sync = [];
+ $index = 0;
+ foreach ($request->get('contributors') as $key => $person) {
+ $pivot_data = ['role' => 'contributor', 'sort_order' => $index + 1, 'allow_email_contact' => false];
+ // if ($galery_id == $request->get('mainPicture')) $pivot_data = ['main' => 1];
+ if (isset($person['id'])) {
+ // $data_to_sync[$person['id']] = $pivot_data;
+ $dataset->persons()->attach($person['id'], $pivot_data);
+ } else {
+ $dataPerson = new Person($person);
+ $dataPerson->status = true;
+ $dataPerson->name_type = "Organizational";
+ $dataset->persons()->save($dataPerson, $pivot_data);
+ }
+ $index++;
+ }
+ // $dataset->persons()->sync($data_to_sync);
+ }
+
//save the titles:
$titles = $request->input('titles');
if (is_array($titles) && count($titles) > 0) {
foreach ($titles as $key => $formTitle) {
- $title = Title::findOrFail($key);
- $title->value = $formTitle['value'];
- $title->language = $formTitle['language'];
- $title->save();
+ // if (isset($key) && $key != 'undefined') {
+ if (isset($formTitle['id'])) {
+ $title = Title::findOrFail($formTitle['id']);
+ $title->value = $formTitle['value'];
+ $title->language = $formTitle['language'];
+ $title->type = $formTitle['type'];
+ if ($title->isDirty()) {
+ $title->save();
+ }
+ } else {
+ $title = new Title($formTitle);
+ $dataset->titles()->save($title);
+ }
}
}
@@ -199,10 +293,18 @@ class EditorController extends Controller
$abstracts = $request->input('abstracts');
if (is_array($abstracts) && count($abstracts) > 0) {
foreach ($abstracts as $key => $formAbstract) {
- $abstract = Description::findOrFail($key);
- $abstract->value = $formAbstract['value'];
- $abstract->language = $formAbstract['language'];
- $abstract->save();
+ // if (isset($key) && $key != 'undefined') {
+ if (isset($formAbstract['id'])) {
+ $abstract = Description::findOrFail($formAbstract['id']);
+ $abstract->value = $formAbstract['value'];
+ $abstract->language = $formAbstract['language'];
+ if ($abstract->isDirty()) {
+ $abstract->save();
+ }
+ } else {
+ $abstract = new Description($formAbstract);
+ $dataset->abstracts()->save($abstract);
+ }
}
}
@@ -210,46 +312,102 @@ class EditorController extends Controller
$references = $request->input('references');
if (is_array($references) && count($references) > 0) {
foreach ($references as $key => $formReference) {
- $reference = DatasetReference::findOrFail($key);
- $reference->value = $formReference['value'];
- $reference->label = $formReference['label'];
- $reference->type = $formReference['type'];
- $reference->relation = $formReference['relation'];
- $reference->save();
+ // if (isset($key) && $key != 'undefined') {
+ if (isset($formReference['id'])) {
+ $reference = DatasetReference::findOrFail($formReference['id']);
+ $reference->value = $formReference['value'];
+ $reference->label = $formReference['label'];
+ $reference->type = $formReference['type'];
+ $reference->relation = $formReference['relation'];
+ if ($reference->isDirty()) {
+ $reference->save();
+ }
+ } else {
+ $reference = new DatasetReference($formReference);
+ $dataset->references()->save($reference);
+ }
}
}
//save the keywords:
- $keywords = $request->input('keywords');
+ $keywords = $request->input('subjects');
if (is_array($keywords) && count($keywords) > 0) {
foreach ($keywords as $key => $formKeyword) {
- $subject = Subject::findOrFail($key);
- $subject->value = $formKeyword['value'];
- $subject->type = $formKeyword['type'];
- $subject->save();
+ if (isset($formKeyword['id'])) {
+ $subject = Subject::findOrFail($formKeyword['id']);
+ $subject->value = $formKeyword['value'];
+ $subject->type = $formKeyword['type'];
+ if ($subject->isDirty()) {
+ $subject->save();
+ }
+ } else {
+ $subject = new Subject($formKeyword);
+ $dataset->subjects()->save($subject);
+ }
}
}
//save the files:
- $files = $request->input('files');
+ $files = $request->get('files');
+ // $files = $request->file('files');
if (is_array($files) && count($files) > 0) {
+ $index = 1;
foreach ($files as $key => $formFile) {
- $file = File::findOrFail($key);
- $file->label = $formFile['label'];
- $file->save();
+ // if (isset($key) && $key != 'undefined') {
+ if (isset($formFile['id'])) {
+ $file = File::findOrFail($formFile['id']);
+ $file->label = $formFile['label'];
+ if ($file->isDirty()) {
+ $file->save();
+ }
+ } else {
+ $uploads = $request->file('uploads');
+ $fileIndex = $formFile['file'];
+ $file = $uploads[$fileIndex];
+
+
+ // $file = new \Illuminate\Http\UploadedFile($file);
+ $label = urldecode($formFile['label']);
+ $sort_order = $index;//$formFile['sort_order'];
+ $fileName = "file-" . time() . '.' . $file->getClientOriginalExtension();
+ $mimeType = $file->getMimeType();
+ $datasetFolder = 'files/' . $dataset->id;
+ $path = $file->storeAs($datasetFolder, $fileName);
+ $size = Storage::size($path);
+ //$path = Storage::putFile('files', $image, $fileName);
+ $fileDb = new File([
+ 'path_name' => $path,
+ 'file_size' => $size,
+ 'mime_type' => $mimeType,
+ 'label' => $label,
+ 'sort_order' => $sort_order,
+ 'visible_in_frontdoor' => 1,
+ 'visible_in_oai' => 1
+ ]);
+ //$test = $file->path_name;
+ $dataset->files()->save($fileDb);
+ $fileDb->createHashValues();
+ }
+ $index++;
}
}
// save coverage
- if (isset($data['coverage'])) {
+ if (isset($data['coverage']) && !$this->containsOnlyNull($data['coverage'])) {
$formCoverage = $request->input('coverage');
$coverage = $dataset->coverage()->updateOrCreate(
['dataset_id' => $dataset->id],
$formCoverage
);
+ } elseif (isset($data['coverage']) && $this->containsOnlyNull($data['coverage'])
+ && !is_null($dataset->coverage)) {
+ $dataset->coverage()->delete();
}
- if (!$dataset->isDirty(dataset::UPDATED_AT)) {
+ $dataset->fill($input);
+ // $dataset->creating_corporation = "Peter";
+
+ if (!$dataset->isDirty()) {
$time = new \Illuminate\Support\Carbon();
$dataset->setUpdatedAt($time);
}
@@ -266,12 +424,31 @@ class EditorController extends Controller
// 'success' => false,
// 'errors' => $validator->errors()->all(),
// ], 422);
- return back()
- ->withErrors($validator->errors()->all());
+ // $errors = $validator->errors();
+ return back()->withErrors($validator);
+ // return redirect()->route('publish.workflow.submit.edit', ['id' => $id])->withInput()
+ // ->withErrors($validator);
}
throw new GeneralException(trans('exceptions.backend.dataset.update_error'));
}
+ private function containsOnlyNull($input)
+ {
+ return empty(array_filter($input, function ($a) {
+ return $a !== null;
+ }));
+ }
+
+ public function download($id)
+ {
+ //$report = $this->report->find($id);
+ $file = File::findOrFail($id);
+ $file_path = public_path('storage/' . $file->path_name);
+ $ext = \Illuminate\Support\Facades\File::extension($file_path);
+ return response()->download($file_path, $file->label . "." . $ext, ['Content-Type:' . $file->mime_type]);
+ // return response()->download($file_path, $file->label, ['Content-Type:' . $file->mime_type]);
+ }
+
/**
* Display the specified resource.
*
diff --git a/app/Http/Controllers/Publish/IndexController.php b/app/Http/Controllers/Publish/IndexController.php
index 2efdcf5..d7a37a4 100644
--- a/app/Http/Controllers/Publish/IndexController.php
+++ b/app/Http/Controllers/Publish/IndexController.php
@@ -55,7 +55,7 @@ class IndexController extends Controller
->pluck('part1', 'part1');
// ->toArray();
- // $projects = Project::pluck('label', 'id');
+ $projects = Project::pluck('label', 'id');
$relatedIdentifierTypes = ["doi", "handle", "isbn", "issn", "url", "urn"];
$relatedIdentifierTypes = array_combine($relatedIdentifierTypes, $relatedIdentifierTypes);
@@ -73,7 +73,7 @@ class IndexController extends Controller
//$relationTypes = array('updates' => 'updates', 'updated-by' => 'updated-by', 'other' => 'other');
return view(
'publish.create-step1',
- compact('licenses', 'languages', 'relatedIdentifierTypes', 'relationTypes', 'titleTypes', 'keywordTypes', 'descriptionTypes', 'page')
+ compact('licenses', 'languages', 'projects', 'relatedIdentifierTypes', 'relationTypes', 'titleTypes', 'keywordTypes', 'descriptionTypes', 'page')
);
}
@@ -246,26 +246,38 @@ class IndexController extends Controller
'type' => 'required|min:5',
'rights' => 'required|boolean|in:1',
'belongs_to_bibliography' => 'required|boolean',
- 'title_main.value' => 'required|min:4',
+ 'title_main.value' => 'required|min:4|max:255',
'title_main.language' => 'required',
- 'abstract_main.value' => 'required|min:4',
+ 'titles.*.value' => 'required|min:4|max:255',
+ 'abstract_main.value' => 'required|min:4|max:2500',
'abstract_main.language' => 'required',
+ 'descriptions.*.value' => 'required|min:4|max:2500',
'coverage.x_min' => [
- 'nullable',
+ 'required',
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
],
'coverage.y_min' => [
- 'nullable',
+ 'required',
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
],
'coverage.x_max' => [
- 'nullable',
+ 'required',
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
],
'coverage.y_max' => [
- 'nullable',
+ 'required',
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
],
+ 'keywords' => 'required|array|min:3',
+ 'keywords.*.value' => 'required|string',
+ 'keywords.*.type' => 'required|string',
+ 'files' => 'required|array|min:1',
+ 'files.*.label' => 'required|string',
+ ];
+ $customMessages = [
+ 'keywords.required' => 'Minimal three keywords are required.',
+ 'keywords.*.type.required' => 'The types of all keywords are required.',
+ 'files.min' => 'Minimal one file is required.',
];
if (null != $request->file('files')) {
$files = count($request->file('files')) - 1;
@@ -274,7 +286,7 @@ class IndexController extends Controller
$rules['files.' . $index . '.file'] = [new RdrFilesize($index + 1), 'file', 'required', new RdrFiletypes()];
}
}
- $validator = Validator::make($request->all(), $rules);
+ $validator = Validator::make($request->all(), $rules, $customMessages);
if (!$validator->fails()) {
//store dataset todo
//$data = $request->all();
@@ -501,7 +513,7 @@ class IndexController extends Controller
$errors = $validator->errors();
return response()->json([
'success' => false,
- 'errors' => $errors->all(),
+ 'errors' => $errors,
], 422);
}
}
diff --git a/app/Http/Controllers/Publish/SubmitController.php b/app/Http/Controllers/Publish/SubmitController.php
index f58e6ed..751ad3b 100644
--- a/app/Http/Controllers/Publish/SubmitController.php
+++ b/app/Http/Controllers/Publish/SubmitController.php
@@ -129,29 +129,37 @@ class SubmitController extends Controller
public function update(DocumentRequest $request, $id): RedirectResponse
{
$rules = [
- 'type' => 'required|min:5',
- 'coverage.xmin' => [
- 'nullable',
- 'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/',
+ 'type' => 'required|min:3',
+ 'titles.*.value' => 'required|min:4|max:255',
+ 'titles.*.language' => 'required',
+ 'descriptions.*.value' => 'required|min:4|max:2500',
+ 'descriptions.*.language' => 'required',
+ 'coverage.x_min' => [
+ 'required',
+ 'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
],
- 'coverage.ymin' => [
- 'nullable',
- 'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/',
+ 'coverage.y_min' => [
+ 'required',
+ 'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
],
- 'coverage.xmax' => [
- 'nullable',
- 'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/',
+ 'coverage.x_max' => [
+ 'required',
+ 'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
],
- 'coverage.ymax' => [
- 'nullable',
- 'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/',
+ 'coverage.y_max' => [
+ 'required',
+ 'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
],
- 'keywords.*.value' => 'required|string',
- 'keywords.*.type' => 'required|string',
+ 'subjects' => 'required|array|min:3',
+ 'subjects.*.value' => 'required|string',
+ 'subjects.*.type' => 'required|string',
+ 'files' => 'required|array|min:1',
'files.*.label' => 'required|string',
];
$customMessages = [
- 'keywords.*.type.required' => 'The types of all keywords are required.',
+ 'subjects.min' => 'Minimal three keywords are required.',
+ 'subjects.*.type.required' => 'The types of all keywords are required.',
+ 'files.min' => 'Minimal one file is required.',
];
if (null != $request->file('files')) {
$data = $request->all();
@@ -168,6 +176,8 @@ class SubmitController extends Controller
$input = $request->except(
'abstracts',
'licenses',
+ 'authors',
+ 'contributors',
'titles',
'coverage',
'subjects',
@@ -303,6 +313,7 @@ class SubmitController extends Controller
//save the files:
$files = $request->get('files');
+ // $files = $request->file('files');
if (is_array($files) && count($files) > 0) {
$index = 1;
foreach ($files as $key => $formFile) {
@@ -314,7 +325,12 @@ class SubmitController extends Controller
$file->save();
}
} else {
- $file = $formFile['file'];
+ $uploads = $request->file('uploads');
+ $fileIndex = $formFile['file'];
+ $file = $uploads[$fileIndex];
+
+
+ // $file = new \Illuminate\Http\UploadedFile($file);
$label = urldecode($formFile['label']);
$sort_order = $index;//$formFile['sort_order'];
$fileName = "file-" . time() . '.' . $file->getClientOriginalExtension();
@@ -372,8 +388,10 @@ class SubmitController extends Controller
// 'success' => false,
// 'errors' => $validator->errors()->all(),
// ], 422);
- return back()->withInput()
- ->withErrors($validator->errors()->all());
+ // $errors = $validator->errors();
+ return back()->withErrors($validator);
+ // return redirect()->route('publish.workflow.submit.edit', ['id' => $id])->withInput()
+ // ->withErrors($validator);
}
throw new GeneralException(trans('exceptions.backend.dataset.update_error'));
}
@@ -425,6 +443,9 @@ class SubmitController extends Controller
if ($dataset->reject_editor_note != null) {
$input['reject_editor_note'] = null;
}
+ if ($dataset->reviewer_id !== null) {
+ $input['reviewer_id'] = null;
+ }
if ($dataset->reject_reviewer_note != null) {
$input['reject_reviewer_note'] = null;
}
diff --git a/app/Http/Requests/DocumentRequest.php b/app/Http/Requests/DocumentRequest.php
index 140bad0..0ad0e59 100644
--- a/app/Http/Requests/DocumentRequest.php
+++ b/app/Http/Requests/DocumentRequest.php
@@ -24,7 +24,7 @@ class DocumentRequest extends Request
public function rules()
{
return [
- 'type' => 'required|min:5',
+ 'type' => 'required|min:3',
'server_state' => 'required',
// 'author' => 'required|min:4',
// 'stock' => 'required|integer',
diff --git a/app/Models/Coverage.php b/app/Models/Coverage.php
index 7258513..aaf95b2 100644
--- a/app/Models/Coverage.php
+++ b/app/Models/Coverage.php
@@ -21,7 +21,7 @@ class Coverage extends Model
'time_min',
'time_max',
'time_absolut',
- 'x_min', 'x_max', 'y_min', 'y_max'
+ 'x_min', 'x_max', 'y_min', 'y_max',
];
/**
@@ -35,17 +35,17 @@ class Coverage extends Model
'time_absolut',
];
- public function setTimeAbsolutAttribute($value)
+ public function setTimeAbsolutAttribute($date)
{
- $this->attributes['time_absolut'] = \Illuminate\Support\Carbon::createFromFormat('d-m-Y H:i:s', $value);
+ $this->attributes['time_absolut'] = empty($date) ? null : \Illuminate\Support\Carbon::createFromFormat('Y-m-d H:i:s', $date);
}
- public function setTimeMinAttribute($value)
+ public function setTimeMinAttribute($date)
{
- $this->attributes['time_min'] = \Illuminate\Support\Carbon::createFromFormat('d-m-Y H:i:s', $value);
+ $this->attributes['time_min'] = empty($date) ? null : \Illuminate\Support\Carbon::createFromFormat('Y-m-d H:i:s', $date);
}
- public function setTimeMaxAttribute($value)
+ public function setTimeMaxAttribute($date)
{
- $this->attributes['time_max'] = \Illuminate\Support\Carbon::createFromFormat('d-m-Y H:i:s', $value);
+ $this->attributes['time_max'] = empty($date) ? null : \Illuminate\Support\Carbon::createFromFormat('Y-m-d H:i:s', $date);
}
/**
diff --git a/composer.lock b/composer.lock
index ab3aa0e..2e9b21f 100755
--- a/composer.lock
+++ b/composer.lock
@@ -347,21 +347,22 @@
},
{
"name": "egulias/email-validator",
- "version": "2.1.13",
+ "version": "2.1.15",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
- "reference": "834593d5900615639208417760ba6a17299e2497"
+ "reference": "e834eea5306d85d67de5a05db5882911d5b29357"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/834593d5900615639208417760ba6a17299e2497",
- "reference": "834593d5900615639208417760ba6a17299e2497",
+ "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e834eea5306d85d67de5a05db5882911d5b29357",
+ "reference": "e834eea5306d85d67de5a05db5882911d5b29357",
"shasum": ""
},
"require": {
"doctrine/lexer": "^1.0.1",
- "php": ">=5.5"
+ "php": ">=5.5",
+ "symfony/polyfill-intl-idn": "^1.10"
},
"require-dev": {
"dominicsayers/isemail": "^3.0.7",
@@ -400,7 +401,7 @@
"validation",
"validator"
],
- "time": "2019-12-30T08:14:25+00:00"
+ "time": "2020-01-20T21:40:59+00:00"
},
{
"name": "erusev/parsedown",
@@ -1192,16 +1193,16 @@
},
{
"name": "nesbot/carbon",
- "version": "2.28.0",
+ "version": "2.29.1",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
- "reference": "e2bcbcd43e67ee6101d321d5de916251d2870ca8"
+ "reference": "e509be5bf2d703390e69e14496d9a1168452b0a2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e2bcbcd43e67ee6101d321d5de916251d2870ca8",
- "reference": "e2bcbcd43e67ee6101d321d5de916251d2870ca8",
+ "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e509be5bf2d703390e69e14496d9a1168452b0a2",
+ "reference": "e509be5bf2d703390e69e14496d9a1168452b0a2",
"shasum": ""
},
"require": {
@@ -1212,7 +1213,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.14 || ^3.0",
"kylekatarnls/multi-tester": "^1.1",
- "phpmd/phpmd": "dev-php-7.1-compatibility",
+ "phpmd/phpmd": "^2.8",
"phpstan/phpstan": "^0.11",
"phpunit/phpunit": "^7.5 || ^8.0",
"squizlabs/php_codesniffer": "^3.4"
@@ -1258,7 +1259,7 @@
"datetime",
"time"
],
- "time": "2019-12-16T16:30:25+00:00"
+ "time": "2020-01-21T09:36:43+00:00"
},
{
"name": "nikic/php-parser",
@@ -1900,16 +1901,16 @@
},
{
"name": "symfony/console",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "82437719dab1e6bdd28726af14cb345c2ec816d0"
+ "reference": "e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/82437719dab1e6bdd28726af14cb345c2ec816d0",
- "reference": "82437719dab1e6bdd28726af14cb345c2ec816d0",
+ "url": "https://api.github.com/repos/symfony/console/zipball/e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f",
+ "reference": "e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f",
"shasum": ""
},
"require": {
@@ -1972,20 +1973,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2019-12-17T10:32:23+00:00"
+ "time": "2020-01-10T21:54:01+00:00"
},
{
"name": "symfony/css-selector",
- "version": "v5.0.2",
+ "version": "v5.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "19d29e7098b7b2c3313cb03902ca30f100dcb837"
+ "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/19d29e7098b7b2c3313cb03902ca30f100dcb837",
- "reference": "19d29e7098b7b2c3313cb03902ca30f100dcb837",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/ff60c90cb7950b592ebc84ad1289d0345bf24f9f",
+ "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f",
"shasum": ""
},
"require": {
@@ -2025,20 +2026,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
- "time": "2019-11-18T17:27:11+00:00"
+ "time": "2020-01-04T14:08:26+00:00"
},
{
"name": "symfony/debug",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "5c4c1db977dc70bb3250e1308d3e8c6341aa38f5"
+ "reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/5c4c1db977dc70bb3250e1308d3e8c6341aa38f5",
- "reference": "5c4c1db977dc70bb3250e1308d3e8c6341aa38f5",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/89c3fd5c299b940333bc6fe9f1b8db1b0912c759",
+ "reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759",
"shasum": ""
},
"require": {
@@ -2081,20 +2082,20 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "time": "2019-12-16T14:46:54+00:00"
+ "time": "2020-01-08T17:29:02+00:00"
},
{
"name": "symfony/error-handler",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
- "reference": "6d7d7712a6ff5215ec26215672293b154f1db8c1"
+ "reference": "a59789092e40ad08465dc2cdc55651be503d0d5a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/error-handler/zipball/6d7d7712a6ff5215ec26215672293b154f1db8c1",
- "reference": "6d7d7712a6ff5215ec26215672293b154f1db8c1",
+ "url": "https://api.github.com/repos/symfony/error-handler/zipball/a59789092e40ad08465dc2cdc55651be503d0d5a",
+ "reference": "a59789092e40ad08465dc2cdc55651be503d0d5a",
"shasum": ""
},
"require": {
@@ -2137,20 +2138,20 @@
],
"description": "Symfony ErrorHandler Component",
"homepage": "https://symfony.com",
- "time": "2019-12-16T14:46:54+00:00"
+ "time": "2020-01-08T17:29:02+00:00"
},
{
"name": "symfony/event-dispatcher",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "b3c3068a72623287550fe20b84a2b01dcba2686f"
+ "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b3c3068a72623287550fe20b84a2b01dcba2686f",
- "reference": "b3c3068a72623287550fe20b84a2b01dcba2686f",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9e3de195e5bc301704dd6915df55892f6dfc208b",
+ "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b",
"shasum": ""
},
"require": {
@@ -2207,7 +2208,7 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2019-11-28T13:33:56+00:00"
+ "time": "2020-01-10T21:54:01+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
@@ -2269,16 +2270,16 @@
},
{
"name": "symfony/finder",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "ce8743441da64c41e2a667b8eb66070444ed911e"
+ "reference": "3a50be43515590faf812fbd7708200aabc327ec3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e",
- "reference": "ce8743441da64c41e2a667b8eb66070444ed911e",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/3a50be43515590faf812fbd7708200aabc327ec3",
+ "reference": "3a50be43515590faf812fbd7708200aabc327ec3",
"shasum": ""
},
"require": {
@@ -2314,20 +2315,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2019-11-17T21:56:56+00:00"
+ "time": "2020-01-04T13:00:46+00:00"
},
{
"name": "symfony/http-foundation",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "fcae1cff5b57b2a9c3aabefeb1527678705ddb62"
+ "reference": "c33998709f3fe9b8e27e0277535b07fbf6fde37a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/fcae1cff5b57b2a9c3aabefeb1527678705ddb62",
- "reference": "fcae1cff5b57b2a9c3aabefeb1527678705ddb62",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/c33998709f3fe9b8e27e0277535b07fbf6fde37a",
+ "reference": "c33998709f3fe9b8e27e0277535b07fbf6fde37a",
"shasum": ""
},
"require": {
@@ -2369,20 +2370,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
- "time": "2019-12-19T15:57:49+00:00"
+ "time": "2020-01-04T13:00:46+00:00"
},
{
"name": "symfony/http-kernel",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "fe310d2e95cd4c356836c8ecb0895a46d97fede2"
+ "reference": "16f2aa3c54b08483fba5375938f60b1ff83b6bd2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/fe310d2e95cd4c356836c8ecb0895a46d97fede2",
- "reference": "fe310d2e95cd4c356836c8ecb0895a46d97fede2",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/16f2aa3c54b08483fba5375938f60b1ff83b6bd2",
+ "reference": "16f2aa3c54b08483fba5375938f60b1ff83b6bd2",
"shasum": ""
},
"require": {
@@ -2459,20 +2460,20 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
- "time": "2019-12-19T16:23:40+00:00"
+ "time": "2020-01-21T13:23:17+00:00"
},
{
"name": "symfony/mime",
- "version": "v5.0.2",
+ "version": "v5.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
- "reference": "0e6a4ced216e49d457eddcefb61132173a876d79"
+ "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/mime/zipball/0e6a4ced216e49d457eddcefb61132173a876d79",
- "reference": "0e6a4ced216e49d457eddcefb61132173a876d79",
+ "url": "https://api.github.com/repos/symfony/mime/zipball/2a3c7fee1f1a0961fa9cf360d5da553d05095e59",
+ "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59",
"shasum": ""
},
"require": {
@@ -2521,7 +2522,7 @@
"mime",
"mime-type"
],
- "time": "2019-11-30T14:12:50+00:00"
+ "time": "2020-01-04T14:08:26+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -2876,16 +2877,16 @@
},
{
"name": "symfony/process",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b"
+ "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/b84501ad50adb72a94fb460a5b5c91f693e99c9b",
- "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b",
+ "url": "https://api.github.com/repos/symfony/process/zipball/f5697ab4cb14a5deed7473819e63141bf5352c36",
+ "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36",
"shasum": ""
},
"require": {
@@ -2921,20 +2922,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2019-12-06T10:06:46+00:00"
+ "time": "2020-01-09T09:50:08+00:00"
},
{
"name": "symfony/routing",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
- "reference": "628bcafae1b2043969378dcfbf9c196539a38722"
+ "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/routing/zipball/628bcafae1b2043969378dcfbf9c196539a38722",
- "reference": "628bcafae1b2043969378dcfbf9c196539a38722",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/7bf4e38573728e317b926ca4482ad30470d0e86a",
+ "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a",
"shasum": ""
},
"require": {
@@ -2997,7 +2998,7 @@
"uri",
"url"
],
- "time": "2019-12-12T12:53:52+00:00"
+ "time": "2020-01-08T17:29:02+00:00"
},
{
"name": "symfony/service-contracts",
@@ -3059,16 +3060,16 @@
},
{
"name": "symfony/translation",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "f7669f48a9633bf8139bc026c755e894b7206677"
+ "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/f7669f48a9633bf8139bc026c755e894b7206677",
- "reference": "f7669f48a9633bf8139bc026c755e894b7206677",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/f5d2ac46930238b30a9c2f1b17c905f3697d808c",
+ "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c",
"shasum": ""
},
"require": {
@@ -3131,7 +3132,7 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
- "time": "2019-12-12T12:53:52+00:00"
+ "time": "2020-01-15T13:29:06+00:00"
},
{
"name": "symfony/translation-contracts",
@@ -3192,16 +3193,16 @@
},
{
"name": "symfony/var-dumper",
- "version": "v4.4.2",
+ "version": "v4.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "be330f919bdb395d1e0c3f2bfb8948512d6bdd99"
+ "reference": "7cfa470bc3b1887a7b2a47c0a702a84ad614fa92"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/be330f919bdb395d1e0c3f2bfb8948512d6bdd99",
- "reference": "be330f919bdb395d1e0c3f2bfb8948512d6bdd99",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/7cfa470bc3b1887a7b2a47c0a702a84ad614fa92",
+ "reference": "7cfa470bc3b1887a7b2a47c0a702a84ad614fa92",
"shasum": ""
},
"require": {
@@ -3264,7 +3265,7 @@
"debug",
"dump"
],
- "time": "2019-12-18T13:41:29+00:00"
+ "time": "2020-01-04T13:00:46+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
@@ -3631,16 +3632,16 @@
},
{
"name": "myclabs/deep-copy",
- "version": "1.9.4",
+ "version": "1.9.5",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7"
+ "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7",
- "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef",
+ "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef",
"shasum": ""
},
"require": {
@@ -3675,7 +3676,7 @@
"object",
"object graph"
],
- "time": "2019-12-15T19:12:40+00:00"
+ "time": "2020-01-17T21:11:47+00:00"
},
{
"name": "phar-io/manifest",
@@ -3932,24 +3933,24 @@
},
{
"name": "phpspec/prophecy",
- "version": "1.10.1",
+ "version": "v1.10.2",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc"
+ "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/cbe1df668b3fe136bcc909126a0f529a78d4cbbc",
- "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9",
+ "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
- "sebastian/comparator": "^1.2.3|^2.0|^3.0",
- "sebastian/recursion-context": "^1.0|^2.0|^3.0"
+ "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
+ "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
},
"require-dev": {
"phpspec/phpspec": "^2.5 || ^3.2",
@@ -3991,7 +3992,7 @@
"spy",
"stub"
],
- "time": "2019-12-22T21:05:45+00:00"
+ "time": "2020-01-20T15:57:02+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -4247,16 +4248,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "7.5.19",
+ "version": "7.5.20",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "4263f76a3fc65385e242ef7357b99f3bed36707e"
+ "reference": "9467db479d1b0487c99733bb1e7944d32deded2c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4263f76a3fc65385e242ef7357b99f3bed36707e",
- "reference": "4263f76a3fc65385e242ef7357b99f3bed36707e",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c",
+ "reference": "9467db479d1b0487c99733bb1e7944d32deded2c",
"shasum": ""
},
"require": {
@@ -4327,7 +4328,7 @@
"testing",
"xunit"
],
- "time": "2020-01-06T16:53:05+00:00"
+ "time": "2020-01-08T08:45:45+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
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 8fe1268..f235d5c 100644
--- a/database/migrations/2019_08_28_083836_create_documents_table.php
+++ b/database/migrations/2019_08_28_083836_create_documents_table.php
@@ -24,7 +24,8 @@ class CreateDocumentsTable extends Migration
$table->foreign('project_id')->references('id')->on('projects');
$table->enum(
'type',
- ['analysisdata', 'interpreteddata', 'measurementdata', 'models', 'rawdata', 'supplementarydata', 'mixedtype']
+ // ['analysisdata', 'interpreteddata', 'measurementdata', 'models', 'rawdata', 'supplementarydata', 'mixedtype']
+ ['analysisdata', 'measurementdata', 'monitoring', 'remotesensing', 'gis', 'models', 'mixedtype']
);
$table->string('language', 10);
$table->enum(
diff --git a/public/backend/ckeditor.js b/public/backend/ckeditor.js
index 5de5e8f..4efbb41 100644
--- a/public/backend/ckeditor.js
+++ b/public/backend/ckeditor.js
@@ -1 +1 @@
-!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=178)}({120:function(t,e,n){var i;(i=window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})).en=Object.assign(i.en||{},{a:"Cannot upload file:",b:"Image toolbar",c:"Table toolbar",d:"Bold",e:"Italic",f:"Block quote",g:"Insert image or file",h:"Choose heading",i:"Heading",j:"image widget",k:"Full size image",l:"Side image",m:"Left aligned image",n:"Centered image",o:"Right aligned image",p:"Insert image",q:"Numbered List",r:"Bulleted List",s:"Insert table",t:"Header column",u:"Insert column left",v:"Insert column right",w:"Delete column",x:"Column",y:"Header row",z:"Insert row below",aa:"Insert row above",ab:"Delete row",ac:"Row",ad:"Merge cell up",ae:"Merge cell right",af:"Merge cell down",ag:"Merge cell left",ah:"Split cell vertically",ai:"Split cell horizontally",aj:"Merge cells",ak:"Enter image caption",al:"Upload failed",am:"media widget",an:"Insert media",ao:"The URL must not be empty.",ap:"This media URL is not supported.",aq:"Link",ar:"Could not obtain resized image URL.",as:"Selecting resized image failed",at:"Could not insert image at the current position.",au:"Inserting image failed",av:"Widget toolbar",aw:"Upload in progress",ax:"Open in a new tab",ay:"Downloadable",az:"Unlink",ba:"Edit link",bb:"Open link in new tab",bc:"This link has no URL",bd:"Save",be:"Cancel",bf:"Link URL",bg:"Paste the media URL in the input.",bh:"Tip: Paste the URL into the content to embed faster.",bi:"Media URL",bj:"Undo",bk:"Redo",bl:"Editor toolbar",bm:"Rich Text Editor, %0",bn:"Rich Text Editor",bo:"Dropdown toolbar",bp:"%0 of %1",bq:"Previous",br:"Next",bs:"Change image text alternative",bt:"Paragraph",bu:"Heading 1",bv:"Heading 2",bw:"Heading 3",bx:"Heading 4",by:"Heading 5",bz:"Heading 6",ca:"Text alternative"}),window,t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=91)}([function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return r}));const i="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class o extends Error{constructor(t,e,n){t=r(t),n&&(t+=" "+JSON.stringify(n)),super(t),this.name="CKEditorError",this.context=e,this.data=n}is(t){return"CKEditorError"===t}}function r(t){const e=t.match(/^([^:]+):/);return e?t+` Read more: ${i}#error-${e[1]}\n`:t}},function(t,e,n){"use strict";var i={},o=function(){var t;return function(){return void 0===t&&(t=Boolean(window&&document&&document.all&&!window.atob)),t}}(),r=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}();function s(t,e){for(var n=[],i={},o=0;o
").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).indexOf("
")>-1&&(t=`
${t}
`),t}(i.getData("text/plain"))),o=this._htmlDataProcessor.toView(o),this.fire("inputTransformation",{content:o,dataTransfer:i}),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,e)=>{if(!e.content.isEmpty){const t=this.editor.data,n=this.editor.model,i=t.toModel(e.content,"$clipboardHolder");if(0==i.childCount)return;n.insertContent(i)}},{priority:"low"}),this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",(e,n)=>{t.isReadOnly?n.preventDefault():o(e,n)},{priority:"low"}),this.listenTo(i,"clipboardOutput",(n,i)=>{i.content.isEmpty||(i.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",function t(e){let n="";if(e.is("text")||e.is("textProxy"))n=e.data;else if(e.is("img")&&e.hasAttribute("alt"))n=e.getAttribute("alt");else{let i=null;for(const o of e.getChildren()){const e=t(o);i&&(i.is("containerElement")||o.is("containerElement"))&&(za.includes(i.name)||za.includes(o.name)?n+="\n":n+="\n\n"),n+=e,i=o}}return n}(i.content))),"cut"==i.method&&t.model.deleteContent(e.selection)},{priority:"low"})}}class Fa{constructor(t){this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",Ua,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",Ua),this.refresh())}execute(){}destroy(){this.stopListening()}}function Ua(t){t.return=!1,t.stop()}function*Ha(t,e){for(const n of e)n&&t.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}Ie(Fa,sn);class qa extends Fa{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,n,i){const o=n.isCollapsed,r=n.getFirstRange(),s=r.start.parent,a=r.end.parent;if(i.isLimit(s)||i.isLimit(a))o||s!=a||t.deleteContent(n);else if(o){const t=Ha(e.model.schema,n.getAttributes());Wa(e,r.start),e.setSelectionAttribute(t)}else{const i=!(r.start.isAtStart&&r.end.isAtEnd),o=s==a;t.deleteContent(n,{leaveUnmerged:i}),i&&(o?Wa(e,n.focus):e.setSelection(a,0))}}(this.editor.model,n,e.selection,t.schema),this.fire("afterExecute",{writer:n})})}}function Wa(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}class Ya extends Mi{constructor(t){super(t);const e=this.document;e.on("keydown",(t,n)=>{if(this.isEnabled&&n.keyCode==Dn.enter){let i;e.once("enter",t=>i=t,{priority:"highest"}),e.fire("enter",new Gi(e,n.domEvent,{isSoft:n.shiftKey})),i&&i.stop.called&&t.stop()}})}observe(){}}class $a extends La{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,n=e.document;e.addObserver(Ya),t.commands.add("enter",new qa(t)),this.listenTo(n,"enter",(n,i)=>{i.preventDefault(),i.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class Ga extends Fa{execute(){const t=this.editor.model,e=t.document;t.change(n=>{!function(t,e,n){const i=n.isCollapsed,o=n.getFirstRange(),r=o.start.parent,s=o.end.parent,a=r==s;if(i){const i=Ha(t.schema,n.getAttributes());Qa(e,o.end),e.removeSelectionAttribute(n.getAttributeKeys()),e.setSelectionAttribute(i)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:i}),a?Qa(e,n.focus):i&&e.setSelection(s,0)}}(t,n,e.selection),this.fire("afterExecute",{writer:n})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const n=e.anchor;if(!n||!t.checkChild(n,"softBreak"))return!1;const i=e.getFirstRange(),o=i.start.parent,r=i.end.parent;return!Ka(o,t)&&!Ka(r,t)||o===r}(t.schema,e.selection)}}function Qa(t,e){const n=t.createElement("softBreak");t.insert(n,e),t.setSelection(n,"after")}function Ka(t,e){return!t.is("rootElement")&&(e.isLimit(t)||Ka(t.parent,e))}class Ja extends La{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,n=t.conversion,i=t.editing.view,o=i.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(t,e)=>e.createEmptyElement("br")}),i.addObserver(Ya),t.commands.add("shiftEnter",new Ga(t)),this.listenTo(o,"enter",(e,n)=>{n.preventDefault(),n.isSoft&&(t.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class Za{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=(t,e)=>{"transparent"!=e.type&&e!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(t){this.size+=t,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t){this.isLocked&&!t||(this._batch=null,this.size=0)}}class Xa extends Fa{constructor(t,e){super(t),this._buffer=new Za(t.model,e),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,n=e.document,i=t.text||"",o=i.length,r=t.range||n.selection.getFirstRange(),s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{const a=r.isCollapsed;this._buffer.lock(),e.deleteContent(e.createSelection(r)),i&&e.insertContent(t.createText(i,n.selection.getAttributes()),r.start),s?t.setSelection(s):a&&t.setSelection(r.start.getShiftedBy(o)),this._buffer.unlock(),this._buffer.input(o),this._batches.add(this._buffer.batch)})}}const tc=[Ln("arrowUp"),Ln("arrowRight"),Ln("arrowDown"),Ln("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let t=112;t<=135;t++)tc.push(t);function ec(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const n=[];let i,o=0;return t.forEach(t=>{"equal"==t?(r(),o++):"insert"==t?(s("insert")?i.values.push(e[o]):(r(),i={type:"insert",index:o,values:[e[o]]}),o++):s("delete")?i.howMany++:(r(),i={type:"delete",index:o,howMany:1})}),r(),n;function r(){i&&(n.push(i),i=null)}function s(t){return i&&i.type==t}}(ui(t.oldChildren,t.newChildren,nc),t.newChildren);if(e.length>1)return;const n=e[0];return n.values[0]&&n.values[0].is("text")?n:void 0}function nc(t,e){return t&&t.is("text")&&e&&e.is("text")?t.data===e.data:t===e}class ic{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(function(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!ec(e))return!0;return!1}(t))this._handleContainerChildrenMutations(t,e);else for(const n of t)this._handleTextMutation(n,e),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(t,e){const n=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(e)return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!n)return;const i=this.editor.editing.view.domConverter.mapViewToDom(n),o=new yi,r=this.editor.data.toModel(o.domToView(i)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;const a=Array.from(r.getChildren()),c=Array.from(s.getChildren()),l=a[a.length-1],d=c[c.length-1];l&&l.is("softBreak")&&d&&!d.is("softBreak")&&a.pop();const h=this.editor.model.schema;if(!oc(a,h)||!oc(c,h))return;const u=a.map(t=>t.is("text")?t.data:"@").join("").replace(/\u00A0/g," "),f=c.map(t=>t.is("text")?t.data:"@").join("").replace(/\u00A0/g," ");if(f===u)return;const g=ui(f,u),{firstChangeAt:m,insertions:p,deletions:b}=rc(g);let w=null;e&&(w=this.editing.mapper.toModelRange(e.getFirstRange()));const k=u.substr(m,p),_=this.editor.model.createRange(this.editor.model.createPositionAt(s,m),this.editor.model.createPositionAt(s,m+b));this.editor.execute("input",{text:k,range:_,resultRange:w})}_handleTextMutation(t,e){if("text"!=t.type)return;const n=t.newText.replace(/\u00A0/g," "),i=t.oldText.replace(/\u00A0/g," ");if(i===n)return;const o=ui(i,n),{firstChangeAt:r,insertions:s,deletions:a}=rc(o);let c=null;e&&(c=this.editing.mapper.toModelRange(e.getFirstRange()));const l=this.editing.view.createPositionAt(t.node,r),d=this.editing.mapper.toModelPosition(l),h=this.editor.model.createRange(d,d.getShiftedBy(a)),u=n.substr(r,s);this.editor.execute("input",{text:u,range:h,resultRange:c})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=ec(t),n=this.editing.view.createPositionAt(t.node,e.index),i=this.editing.mapper.toModelPosition(n),o=e.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(i)})}}function oc(t,e){return t.every(t=>e.isInline(t))}function rc(t){let e=null,n=null;for(let i=0;i