- ORCID upper case in creator table
- PS2 formating for EditorController, IndexController, SubmitController - all function camel case in HomeController - composer update
This commit is contained in:
parent
25f3175a92
commit
6d0638e201
|
@ -122,7 +122,7 @@ class HomeController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
public function php_info()
|
||||
public function phpInfo()
|
||||
{
|
||||
dd(phpinfo());
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ namespace App\Http\Controllers\Frontend;
|
|||
use App\Models\Dataset;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use DateTime;
|
||||
|
||||
class SitelinkController extends Controller
|
||||
{
|
||||
|
|
|
@ -2,30 +2,30 @@
|
|||
namespace App\Http\Controllers\Publish;
|
||||
|
||||
use App\Exceptions\GeneralException;
|
||||
use App\Http\Requests\DocumentRequest;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\DocumentRequest;
|
||||
use App\Models\Dataset;
|
||||
use App\Models\Project;
|
||||
use App\Models\License;
|
||||
use App\Models\User;
|
||||
use App\Models\Title;
|
||||
use App\Models\Description;
|
||||
use App\Models\DatasetReference;
|
||||
use App\Models\Subject;
|
||||
use App\Models\Description;
|
||||
use App\Models\File;
|
||||
use App\Models\License;
|
||||
use App\Models\Person;
|
||||
use App\Models\Project;
|
||||
use App\Models\Subject;
|
||||
use App\Models\Title;
|
||||
use App\Models\User;
|
||||
use App\Rules\RdrFilesize;
|
||||
use App\Rules\RdrFiletypes;
|
||||
// use Illuminate\View\View;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
// use Illuminate\View\View;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use \Exception;
|
||||
use App\Rules\RdrFiletypes;
|
||||
use App\Rules\RdrFilesize;
|
||||
use App\Models\Person;
|
||||
|
||||
class EditorController extends Controller
|
||||
{
|
||||
|
@ -47,14 +47,14 @@ class EditorController extends Controller
|
|||
$builder = Dataset::query();
|
||||
//"select * from [documents] where [server_state] in (?) or ([server_state] = ? and [editor_id] = ?)"
|
||||
$datasets = $builder
|
||||
->where('server_state', 'released')
|
||||
// ->whereIn('server_state', ['released'])
|
||||
->orWhere(function ($query) use ($user_id) {
|
||||
$query->whereIn('server_state', ['editor_accepted', 'rejected_reviewer', 'reviewed'])
|
||||
->where('editor_id', $user_id);
|
||||
})
|
||||
->orderBy('server_date_modified', 'desc')
|
||||
->get();
|
||||
->where('server_state', 'released')
|
||||
// ->whereIn('server_state', ['released'])
|
||||
->orWhere(function ($query) use ($user_id) {
|
||||
$query->whereIn('server_state', ['editor_accepted', 'rejected_reviewer', 'reviewed'])
|
||||
->where('editor_id', $user_id);
|
||||
})
|
||||
->orderBy('server_date_modified', 'desc')
|
||||
->get();
|
||||
// return View::make('workflow.editor.index', compact('datasets'));
|
||||
return View::make('workflow.editor.index', [
|
||||
'datasets' => $datasets,
|
||||
|
@ -79,7 +79,7 @@ class EditorController extends Controller
|
|||
public function receiveUpdate(Request $request, $id)
|
||||
{
|
||||
$dataset = Dataset::findOrFail($id);
|
||||
|
||||
|
||||
try {
|
||||
$dataset->setServerState("editor_accepted");
|
||||
$user = Auth::user();
|
||||
|
@ -104,13 +104,14 @@ class EditorController extends Controller
|
|||
$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'];
|
||||
$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');
|
||||
|
||||
$messages = DB::table('messages')
|
||||
->pluck('help_text', 'metadata_element');
|
||||
->pluck('help_text', 'metadata_element');
|
||||
|
||||
$projects = Project::pluck('label', 'id');
|
||||
|
||||
|
@ -124,23 +125,25 @@ class EditorController extends Controller
|
|||
$languages = DB::table('languages')
|
||||
->where('active', true)
|
||||
->pluck('part1', 'part1');
|
||||
|
||||
|
||||
// $options = License::all('id', 'name_long');
|
||||
$licenses = License::select('id', 'name_long', 'link_licence')
|
||||
->orderBy('sort_order')
|
||||
->get();
|
||||
// $checkeds = $dataset->licenses->pluck('id')->toArray();
|
||||
$checkeds = $dataset->licenses->first()->id;
|
||||
|
||||
|
||||
$keywordTypes = ['uncontrolled' => 'uncontrolled', 'swd' => 'swd'];
|
||||
|
||||
$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);
|
||||
|
||||
|
||||
return View::make(
|
||||
'workflow.editor.edit',
|
||||
compact(
|
||||
|
@ -180,24 +183,24 @@ class EditorController extends Controller
|
|||
'descriptions.*.language' => 'required',
|
||||
'coverage.x_min' => [
|
||||
'required',
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/',
|
||||
],
|
||||
'coverage.y_min' => [
|
||||
'required',
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/',
|
||||
],
|
||||
'coverage.x_max' => [
|
||||
'required',
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/',
|
||||
],
|
||||
'coverage.y_max' => [
|
||||
'required',
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/',
|
||||
],
|
||||
'subjects' => 'required|array|min:3',
|
||||
'subjects' => 'required|array|min:3',
|
||||
'subjects.*.value' => 'required|string',
|
||||
'subjects.*.type' => 'required|string',
|
||||
'files' => 'required|array|min:1',
|
||||
'files' => 'required|array|min:1',
|
||||
'files.*.label' => 'required|string',
|
||||
];
|
||||
$customMessages = [
|
||||
|
@ -372,11 +375,10 @@ class EditorController extends Controller
|
|||
$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'];
|
||||
$sort_order = $index; //$formFile['sort_order'];
|
||||
$fileName = "file-" . time() . '.' . $file->getClientOriginalExtension();
|
||||
$mimeType = $file->getMimeType();
|
||||
$datasetFolder = 'files/' . $dataset->id;
|
||||
|
@ -390,7 +392,7 @@ class EditorController extends Controller
|
|||
'label' => $label,
|
||||
'sort_order' => $sort_order,
|
||||
'visible_in_frontdoor' => 1,
|
||||
'visible_in_oai' => 1
|
||||
'visible_in_oai' => 1,
|
||||
]);
|
||||
//$test = $file->path_name;
|
||||
$dataset->files()->save($fileDb);
|
||||
|
@ -434,8 +436,8 @@ class EditorController extends Controller
|
|||
// ], 422);
|
||||
// $errors = $validator->errors();
|
||||
return back()->withErrors($validator);
|
||||
// return redirect()->route('publish.workflow.submit.edit', ['id' => $id])->withInput()
|
||||
// ->withErrors($validator);
|
||||
// return redirect()->route('publish.workflow.submit.edit', ['id' => $id])->withInput()
|
||||
// ->withErrors($validator);
|
||||
}
|
||||
throw new GeneralException(trans('exceptions.backend.dataset.update_error'));
|
||||
}
|
||||
|
@ -466,7 +468,7 @@ class EditorController extends Controller
|
|||
public function approve($id): \Illuminate\Contracts\View\View
|
||||
{
|
||||
$dataset = Dataset::with('user:id,login')->findOrFail($id);
|
||||
|
||||
|
||||
$reviewers = User::whereHas('roles', function ($q) {
|
||||
$q->where('name', 'reviewer');
|
||||
})->pluck('login', 'id');
|
||||
|
@ -506,7 +508,7 @@ class EditorController extends Controller
|
|||
throw new GeneralException(trans('exceptions.publish.approve.update_error'));
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Reject dataset back to editor
|
||||
*
|
||||
* @param int $id
|
||||
|
@ -524,7 +526,7 @@ class EditorController extends Controller
|
|||
{
|
||||
$this->validate($request, [
|
||||
'reject_editor_note' => 'required|min:10|max:500',
|
||||
'server_state' => 'required'
|
||||
'server_state' => 'required',
|
||||
]);
|
||||
$dataset = Dataset::findOrFail($id);
|
||||
$input = $request->all();
|
||||
|
@ -548,12 +550,12 @@ class EditorController extends Controller
|
|||
public function publish($id): \Illuminate\Contracts\View\View
|
||||
{
|
||||
$dataset = Dataset::query()
|
||||
->with([
|
||||
'titles',
|
||||
'persons' => function ($query) {
|
||||
$query->wherePivot('role', 'author');
|
||||
}
|
||||
])->findOrFail($id);
|
||||
->with([
|
||||
'titles',
|
||||
'persons' => function ($query) {
|
||||
$query->wherePivot('role', 'author');
|
||||
},
|
||||
])->findOrFail($id);
|
||||
|
||||
return View::make('workflow.editor.publish', [
|
||||
'dataset' => $dataset,
|
||||
|
@ -567,7 +569,7 @@ class EditorController extends Controller
|
|||
$max = Dataset::max('publish_id');
|
||||
$publish_id = 0;
|
||||
if ($max != null) {
|
||||
$publish_id = $max +1;
|
||||
$publish_id = $max + 1;
|
||||
} else {
|
||||
$publish_id = $publish_id + 1;
|
||||
}
|
||||
|
|
|
@ -2,25 +2,25 @@
|
|||
//https://www.5balloons.info/multi-page-step-form-in-laravel-with-validation/
|
||||
namespace App\Http\Controllers\Publish;
|
||||
|
||||
use App\Models\Dataset;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\License;
|
||||
use App\Models\File;
|
||||
use App\Models\Project;
|
||||
use App\Models\Title;
|
||||
use App\Models\Coverage;
|
||||
use App\Models\Dataset;
|
||||
use App\Models\DatasetReference;
|
||||
use App\Models\Description;
|
||||
use App\Rules\RdrFiletypes;
|
||||
use App\Models\File;
|
||||
use App\Models\License;
|
||||
use App\Models\Page;
|
||||
use App\Models\Person;
|
||||
use App\Models\Project;
|
||||
use App\Models\Subject;
|
||||
use App\Models\Title;
|
||||
use App\Rules\RdrFilesize;
|
||||
use App\Rules\RdrFiletypes;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Models\DatasetReference;
|
||||
use App\Models\Subject;
|
||||
use App\Models\Page;
|
||||
use App\Models\Person;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Models\Coverage;
|
||||
|
||||
class IndexController extends Controller
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ class IndexController extends Controller
|
|||
$datasets = $builder
|
||||
//->where('server_state', 'inprogress')
|
||||
->whereIn('server_state', ['inprogress', 'unpublished'])
|
||||
->get();
|
||||
->get();
|
||||
return view('publish.index', compact('datasets'));
|
||||
}
|
||||
|
||||
|
@ -59,17 +59,21 @@ class IndexController extends Controller
|
|||
->pluck('help_text', 'metadata_element');
|
||||
|
||||
$projects = Project::pluck('label', 'id');
|
||||
$relatedIdentifierTypes = ["doi", "handle", "isbn", "issn", "url", "urn"];
|
||||
$relatedIdentifierTypes = ["doi", "handle", "isbn", "issn", "url", "urn"];
|
||||
$relatedIdentifierTypes = array_combine($relatedIdentifierTypes, $relatedIdentifierTypes);
|
||||
|
||||
$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);
|
||||
|
||||
$titleTypes = ['Sub' => 'Sub', 'Alternative' => 'Alternative', 'Translated' => 'Translated', 'Other' => 'Other'];
|
||||
|
||||
$keywordTypes = ['uncontrolled' => 'uncontrolled'];
|
||||
|
||||
$descriptionTypes = ['Methods' => 'Methods', 'Series_information' => 'Series_information', 'Technical_info' => 'Technical_info', 'Translated' => 'Translated', 'Other' => 'Other'];
|
||||
$descriptionTypes = ['Methods' => 'Methods', 'Series_information' => 'Series_information',
|
||||
'Technical_info' => 'Technical_info', 'Translated' => 'Translated', 'Other' => 'Other'];
|
||||
|
||||
$page = Page::query()->where('page_slug', 'terms-and-conditions')->firstOrFail();
|
||||
|
||||
|
@ -257,24 +261,24 @@ class IndexController extends Controller
|
|||
'descriptions.*.value' => 'required|min:4|max:2500',
|
||||
'coverage.x_min' => [
|
||||
'required',
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/',
|
||||
],
|
||||
'coverage.y_min' => [
|
||||
'required',
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/',
|
||||
],
|
||||
'coverage.x_max' => [
|
||||
'required',
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/',
|
||||
],
|
||||
'coverage.y_max' => [
|
||||
'required',
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/',
|
||||
],
|
||||
'keywords' => 'required|array|min:3',
|
||||
'keywords' => 'required|array|min:3',
|
||||
'keywords.*.value' => 'required|string',
|
||||
'keywords.*.type' => 'required|string',
|
||||
'files' => 'required|array|min:1',
|
||||
'files' => 'required|array|min:1',
|
||||
'files.*.label' => 'required|string',
|
||||
// 'authors.*.email' => 'required|email|max:50|unique:persons,email',
|
||||
];
|
||||
|
@ -316,7 +320,7 @@ class IndexController extends Controller
|
|||
DB::beginTransaction(); //Start transaction!
|
||||
try {
|
||||
$dataset->save();
|
||||
|
||||
|
||||
//store related files
|
||||
if (isset($data['files'])) {
|
||||
foreach ($data['files'] as $uploadedFile) {
|
||||
|
@ -336,7 +340,7 @@ class IndexController extends Controller
|
|||
'label' => $label,
|
||||
'sort_order' => $sorting,
|
||||
'visible_in_frontdoor' => 1,
|
||||
'visible_in_oai' => 1
|
||||
'visible_in_oai' => 1,
|
||||
]);
|
||||
//$test = $file->path_name;
|
||||
$dataset->files()->save($file);
|
||||
|
@ -344,11 +348,11 @@ class IndexController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
//store licenses:
|
||||
$licenses = $request->input('licenses');
|
||||
$dataset->licenses()->sync($licenses);
|
||||
//store licenses:
|
||||
$licenses = $request->input('licenses');
|
||||
$dataset->licenses()->sync($licenses);
|
||||
|
||||
$data_to_sync = [];
|
||||
$data_to_sync = [];
|
||||
//store authors
|
||||
if (isset($data['authors'])) {
|
||||
//$data_to_sync = [];
|
||||
|
@ -393,7 +397,7 @@ class IndexController extends Controller
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//store submitters
|
||||
// if (isset($data['submitters'])) {
|
||||
// //$data_to_sync = [];
|
||||
|
@ -405,7 +409,6 @@ class IndexController extends Controller
|
|||
// }
|
||||
//$dataset->persons()->sync($data_to_sync);
|
||||
|
||||
|
||||
//save main title:
|
||||
if (isset($data['title_main'])) {
|
||||
$formTitle = $request->input('title_main');
|
||||
|
@ -417,7 +420,7 @@ class IndexController extends Controller
|
|||
$dataset->titles()->save($title);
|
||||
}
|
||||
|
||||
//save additional titles
|
||||
//save additional titles
|
||||
if (isset($data['titles'])) {
|
||||
foreach ($request->get('titles') as $key => $title) {
|
||||
$titleReference = new Title($title);
|
||||
|
@ -480,7 +483,7 @@ class IndexController extends Controller
|
|||
// Create relation between Dataset and actual User.
|
||||
$user = Auth::user();
|
||||
$dataset->user()->associate($user)->save();
|
||||
|
||||
|
||||
// $error = 'Always throw this error';
|
||||
// throw new \Exception($error);
|
||||
|
||||
|
@ -516,9 +519,9 @@ class IndexController extends Controller
|
|||
|
||||
return response()->json(array(
|
||||
'success' => true,
|
||||
'edit' => route('publish.workflow.submit.edit', ['id' => $dataset->id]),
|
||||
'release' => route('publish.workflow.submit.release', ['id' => $dataset->id]),
|
||||
'delete' => route('publish.workflow.submit.delete', ['id' => $dataset->id]),
|
||||
'edit' => route('publish.workflow.submit.edit', ['id' => $dataset->id]),
|
||||
'release' => route('publish.workflow.submit.release', ['id' => $dataset->id]),
|
||||
'delete' => route('publish.workflow.submit.delete', ['id' => $dataset->id]),
|
||||
));
|
||||
} else {
|
||||
//TODO Handle validation error
|
||||
|
@ -549,7 +552,7 @@ class IndexController extends Controller
|
|||
'abstract_main.language' => 'required',
|
||||
];
|
||||
if (null != $request->file('files')) {
|
||||
$files = count($request->file('files')) -1;
|
||||
$files = count($request->file('files')) - 1;
|
||||
foreach (range(0, $files) as $index) {
|
||||
// $rules['files.' . $index] = 'image|max:2048';
|
||||
$rules['files.' . $index . '.file'] = ['required', 'file', new RdrFiletypes(), new RdrFilesize($index)];
|
||||
|
@ -566,7 +569,7 @@ class IndexController extends Controller
|
|||
DB::beginTransaction(); //Start transaction!
|
||||
try {
|
||||
// $dataset->save();
|
||||
|
||||
|
||||
//store related files
|
||||
if (isset($data['files'])) {
|
||||
foreach ($data['files'] as $uploadedFile) {
|
||||
|
@ -594,8 +597,8 @@ class IndexController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
//store licenses:
|
||||
$licenses = $request->input('licenses');
|
||||
//store licenses:
|
||||
$licenses = $request->input('licenses');
|
||||
// $dataset->licenses()->sync($licenses);
|
||||
|
||||
//store authors
|
||||
|
@ -618,7 +621,7 @@ class IndexController extends Controller
|
|||
}
|
||||
// $dataset->persons()->sync($data_to_sync);
|
||||
}
|
||||
|
||||
|
||||
//store submitters
|
||||
if (isset($data['submitters'])) {
|
||||
$data_to_sync = [];
|
||||
|
@ -629,7 +632,6 @@ class IndexController extends Controller
|
|||
// $dataset->persons()->sync($data_to_sync);
|
||||
}
|
||||
|
||||
|
||||
//save main title:
|
||||
if (isset($data['title_main'])) {
|
||||
$formTitle = $request->input('title_main');
|
||||
|
@ -655,7 +657,7 @@ class IndexController extends Controller
|
|||
// $dataset->references()->save($dataReference);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// $error = 'Always throw this error';
|
||||
// throw new \Exception($error);
|
||||
|
||||
|
@ -691,7 +693,7 @@ class IndexController extends Controller
|
|||
|
||||
return response()->json(array(
|
||||
'success' => true,
|
||||
'redirect' => route('settings.document.edit', ['id' => $dataset->server_state]),
|
||||
'redirect' => route('settings.document.edit', ['id' => $dataset->server_state]),
|
||||
));
|
||||
} else {
|
||||
//TODO Handle validation error
|
||||
|
|
|
@ -16,6 +16,8 @@ use App\Models\Project;
|
|||
use App\Models\Subject;
|
||||
use App\Models\Title;
|
||||
use App\Models\User;
|
||||
use App\Rules\RdrFilesize;
|
||||
use App\Rules\RdrFiletypes;
|
||||
use Exception;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
@ -24,8 +26,6 @@ use Illuminate\Support\Facades\DB;
|
|||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use App\Rules\RdrFiletypes;
|
||||
use App\Rules\RdrFilesize;
|
||||
|
||||
class SubmitController extends Controller
|
||||
{
|
||||
|
@ -65,13 +65,14 @@ class SubmitController extends Controller
|
|||
$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'];
|
||||
$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');
|
||||
|
||||
|
||||
$messages = DB::table('messages')
|
||||
->pluck('help_text', 'metadata_element');
|
||||
->pluck('help_text', 'metadata_element');
|
||||
|
||||
$projects = Project::pluck('label', 'id');
|
||||
|
||||
|
@ -98,7 +99,10 @@ class SubmitController extends Controller
|
|||
$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);
|
||||
|
||||
return View::make(
|
||||
|
@ -140,24 +144,24 @@ class SubmitController extends Controller
|
|||
'descriptions.*.language' => 'required',
|
||||
'coverage.x_min' => [
|
||||
'required',
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/',
|
||||
],
|
||||
'coverage.y_min' => [
|
||||
'required',
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/',
|
||||
],
|
||||
'coverage.x_max' => [
|
||||
'required',
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'
|
||||
'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/',
|
||||
],
|
||||
'coverage.y_max' => [
|
||||
'required',
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'
|
||||
'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/',
|
||||
],
|
||||
'subjects' => 'required|array|min:3',
|
||||
'subjects' => 'required|array|min:3',
|
||||
'subjects.*.value' => 'required|string',
|
||||
'subjects.*.type' => 'required|string',
|
||||
'files' => 'required|array|min:1',
|
||||
'files' => 'required|array|min:1',
|
||||
'files.*.label' => 'required|string',
|
||||
];
|
||||
$customMessages = [
|
||||
|
@ -332,11 +336,10 @@ class SubmitController extends Controller
|
|||
$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'];
|
||||
$sort_order = $index; //$formFile['sort_order'];
|
||||
$fileName = "file-" . time() . '.' . $file->getClientOriginalExtension();
|
||||
$mimeType = $file->getMimeType();
|
||||
$datasetFolder = 'files/' . $dataset->id;
|
||||
|
@ -350,7 +353,7 @@ class SubmitController extends Controller
|
|||
'label' => $label,
|
||||
'sort_order' => $sort_order,
|
||||
'visible_in_frontdoor' => 1,
|
||||
'visible_in_oai' => 1
|
||||
'visible_in_oai' => 1,
|
||||
]);
|
||||
//$test = $file->path_name;
|
||||
$dataset->files()->save($fileDb);
|
||||
|
@ -394,8 +397,8 @@ class SubmitController extends Controller
|
|||
// ], 422);
|
||||
// $errors = $validator->errors();
|
||||
return back()->withErrors($validator);
|
||||
// return redirect()->route('publish.workflow.submit.edit', ['id' => $id])->withInput()
|
||||
// ->withErrors($validator);
|
||||
// return redirect()->route('publish.workflow.submit.edit', ['id' => $id])->withInput()
|
||||
// ->withErrors($validator);
|
||||
}
|
||||
throw new GeneralException(trans('exceptions.backend.dataset.update_error'));
|
||||
}
|
||||
|
|
|
@ -21,10 +21,9 @@
|
|||
"yajra/laravel-datatables-oracle": "^9.0",
|
||||
"zizaco/entrust": "^1.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"require-dev": {
|
||||
"fzaninotto/faker": "^1.8",
|
||||
"phpunit/phpunit": "^7.0",
|
||||
"squizlabs/php_codesniffer": "^3.4"
|
||||
"phpunit/phpunit": "^7.0"
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
|
|
77
composer.lock
generated
77
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "211b7ec765465de1612277be49ffc92f",
|
||||
"content-hash": "8bb6d0c35adaea7dda9a8f822bafa019",
|
||||
"packages": [
|
||||
{
|
||||
"name": "astrotomic/laravel-translatable",
|
||||
|
@ -548,24 +548,24 @@
|
|||
},
|
||||
{
|
||||
"name": "fideloper/proxy",
|
||||
"version": "4.2.2",
|
||||
"version": "4.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fideloper/TrustedProxy.git",
|
||||
"reference": "790194d5d3da89a713478875d2e2d05855a90a81"
|
||||
"reference": "ec38ad69ee378a1eec04fb0e417a97cfaf7ed11a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/790194d5d3da89a713478875d2e2d05855a90a81",
|
||||
"reference": "790194d5d3da89a713478875d2e2d05855a90a81",
|
||||
"url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/ec38ad69ee378a1eec04fb0e417a97cfaf7ed11a",
|
||||
"reference": "ec38ad69ee378a1eec04fb0e417a97cfaf7ed11a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/contracts": "^5.0|^6.0|^7.0",
|
||||
"illuminate/contracts": "^5.0|^6.0|^7.0|^8.0",
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"illuminate/http": "^5.0|^6.0|^7.0",
|
||||
"illuminate/http": "^5.0|^6.0|^7.0|^8.0",
|
||||
"mockery/mockery": "^1.0",
|
||||
"phpunit/phpunit": "^6.0"
|
||||
},
|
||||
|
@ -598,7 +598,7 @@
|
|||
"proxy",
|
||||
"trusted proxy"
|
||||
],
|
||||
"time": "2019-12-20T13:11:11+00:00"
|
||||
"time": "2020-02-22T01:51:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jakub-onderka/php-console-color",
|
||||
|
@ -1694,16 +1694,16 @@
|
|||
},
|
||||
{
|
||||
"name": "ramsey/uuid",
|
||||
"version": "3.9.2",
|
||||
"version": "3.9.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ramsey/uuid.git",
|
||||
"reference": "7779489a47d443f845271badbdcedfe4df8e06fb"
|
||||
"reference": "7e1633a6964b48589b142d60542f9ed31bd37a92"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ramsey/uuid/zipball/7779489a47d443f845271badbdcedfe4df8e06fb",
|
||||
"reference": "7779489a47d443f845271badbdcedfe4df8e06fb",
|
||||
"url": "https://api.github.com/repos/ramsey/uuid/zipball/7e1633a6964b48589b142d60542f9ed31bd37a92",
|
||||
"reference": "7e1633a6964b48589b142d60542f9ed31bd37a92",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1777,7 +1777,7 @@
|
|||
"identifier",
|
||||
"uuid"
|
||||
],
|
||||
"time": "2019-12-17T08:18:51+00:00"
|
||||
"time": "2020-02-21T04:36:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "solarium/solarium",
|
||||
|
@ -4897,57 +4897,6 @@
|
|||
"homepage": "https://github.com/sebastianbergmann/version",
|
||||
"time": "2016-10-03T07:35:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "squizlabs/php_codesniffer",
|
||||
"version": "3.5.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
|
||||
"reference": "dceec07328401de6211037abbb18bda423677e26"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dceec07328401de6211037abbb18bda423677e26",
|
||||
"reference": "dceec07328401de6211037abbb18bda423677e26",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-simplexml": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"ext-xmlwriter": "*",
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
|
||||
},
|
||||
"bin": [
|
||||
"bin/phpcs",
|
||||
"bin/phpcbf"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Greg Sherwood",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
|
||||
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
|
||||
"keywords": [
|
||||
"phpcs",
|
||||
"standards"
|
||||
],
|
||||
"time": "2020-01-30T22:20:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "theseer/tokenizer",
|
||||
"version": "1.1.3",
|
||||
|
|
|
@ -18,7 +18,8 @@ class MessagesTableSeeder extends Seeder
|
|||
[
|
||||
// 1
|
||||
'metadata_element' => 'dataset_language',
|
||||
'help_text' => 'In Abhängigkeit der Publikationssprache sollten die Metadaten in Englisch oder Deutsch eingegeben werden.',
|
||||
'help_text' => 'In Abhängigkeit der Publikationssprache sollten
|
||||
die Metadaten in Englisch oder Deutsch eingegeben werden.',
|
||||
'created_at' => Carbon::now(),
|
||||
'updated_at' => Carbon::now(),
|
||||
],
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -12,7 +12,7 @@
|
|||
<th scope="col">
|
||||
<label for="language">
|
||||
<span>
|
||||
Orcid <i
|
||||
ORCID <i
|
||||
v-tooltip="{ content: messages.orcid, class: 'tooltip-custom tooltip-other-custom' }"
|
||||
class="far fa-lg fa-question-circle"
|
||||
></i>
|
||||
|
|
|
@ -454,7 +454,7 @@ Route::group(['namespace' => 'Frontend', 'as' => 'frontend.'], function () {
|
|||
'as' => 'home.help', 'uses' => 'HomeController@help',
|
||||
]);
|
||||
Route::get('/info', [
|
||||
'as' => 'home.php_info', 'uses' => 'HomeController@php_info',
|
||||
'as' => 'home.php_info', 'uses' => 'HomeController@phpInfo',
|
||||
]);
|
||||
|
||||
//=================================================Crawlers====================================================
|
||||
|
|
Loading…
Reference in New Issue
Block a user