- 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:
Arno Kaimbacher 2020-02-25 13:09:49 +01:00
parent 25f3175a92
commit 6d0638e201
12 changed files with 139 additions and 184 deletions

View File

@ -122,7 +122,7 @@ class HomeController extends Controller
}
}
public function php_info()
public function phpInfo()
{
dd(phpinfo());
}

View File

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

View File

@ -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
{
@ -104,7 +104,8 @@ 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');
@ -137,10 +138,12 @@ class EditorController 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(
'workflow.editor.edit',
compact(
@ -180,19 +183,19 @@ 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.*.value' => 'required|string',
@ -373,7 +376,6 @@ class EditorController extends Controller
$fileIndex = $formFile['file'];
$file = $uploads[$fileIndex];
// $file = new \Illuminate\Http\UploadedFile($file);
$label = urldecode($formFile['label']);
$sort_order = $index; //$formFile['sort_order'];
@ -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);
@ -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();
@ -552,7 +554,7 @@ class EditorController extends Controller
'titles',
'persons' => function ($query) {
$query->wherePivot('role', 'author');
}
},
])->findOrFail($id);
return View::make('workflow.editor.publish', [

View File

@ -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
{
@ -62,14 +62,18 @@ class IndexController extends Controller
$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,19 +261,19 @@ 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.*.value' => 'required|string',
@ -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);
@ -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');
@ -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');

View File

@ -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,7 +65,8 @@ 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');
@ -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,19 +144,19 @@ 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.*.value' => 'required|string',
@ -333,7 +337,6 @@ class SubmitController extends Controller
$fileIndex = $formFile['file'];
$file = $uploads[$fileIndex];
// $file = new \Illuminate\Http\UploadedFile($file);
$label = urldecode($formFile['label']);
$sort_order = $index; //$formFile['sort_order'];
@ -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);

View File

@ -23,8 +23,7 @@
},
"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
View File

@ -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",

View File

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

View File

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

View File

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