diff --git a/app/Http/Controllers/Publish/IndexController.php b/app/Http/Controllers/Publish/IndexController.php index 9b7a573..8d3fc61 100644 --- a/app/Http/Controllers/Publish/IndexController.php +++ b/app/Http/Controllers/Publish/IndexController.php @@ -43,7 +43,9 @@ class IndexController extends Controller public function createStep1(Request $request) { #$dataset = $request->session()->get('dataset'); - $licenses = License::all('id', 'name_long'); + $licenses = License::select('id', 'name_long') + ->orderBy('sort_order') + ->get(); $languages = DB::table('languages') ->where('active', true) ->pluck('part2_t', 'part2_t'); @@ -52,8 +54,10 @@ class IndexController extends Controller // $persons = Person::where('status', 1) // ->pluck('last_name', 'id'); $projects = Project::pluck('label', 'id'); - $types = array('doi' => 'doi', 'handle' => 'handle', 'urn' => 'urn', 'std-doi' => 'std-doi', - 'url' => 'url', 'isbn' => 'isbn', 'issn' => 'issn', 'rdr-id' => 'rdr-id'); + $types = array( + 'doi' => 'doi', 'handle' => 'handle', 'urn' => 'urn', 'std-doi' => 'std-doi', + 'url' => 'url', 'isbn' => 'isbn', 'issn' => 'issn', 'rdr-id' => 'rdr-id' + ); $relations = array('updates' => 'updates', 'updated-by' => 'updated-by', 'other' => 'other'); return view('publish.create-step1', compact('licenses', 'languages', 'projects', 'types', 'relations')); diff --git a/app/Http/Controllers/Settings/PersonController.php b/app/Http/Controllers/Settings/PersonController.php index bf20374..67545c2 100644 --- a/app/Http/Controllers/Settings/PersonController.php +++ b/app/Http/Controllers/Settings/PersonController.php @@ -3,7 +3,7 @@ namespace App\Http\Controllers\Settings; use App\Http\Controllers\Controller; use App\Models\Person; -use App\Http\Requests\PersonRequest; +use App\Http\Requests\Person\CreatePersonRequest; use Illuminate\Http\Request; use Illuminate\View\View; use Illuminate\Http\RedirectResponse; @@ -45,7 +45,7 @@ class PersonController extends Controller * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ - public function store(PersonRequest $request) + public function store(CreatePersonRequest $request) { $input = $request->all(); $input['registered_at'] = time(); @@ -73,8 +73,17 @@ class PersonController extends Controller * @param int $id * @return \Illuminate\Http\Response */ - public function update(PersonRequest $request, $id) + public function update(Request $request, $id) { + $this->validate(request(), [ + 'academic_title' => 'nullable|min:2|max:255', + 'last_name' => 'required|min:3|max:255|unique_with:persons,first_name,date_of_birth,' . $id, + 'first_name' => 'required|min:3|max:255', + 'email' => 'required|email|unique:persons,email,' . $id, + 'identifier_orcid' => 'nullable|min:19|max:50', + 'status' => 'required|boolean', + 'date_of_birth' => 'required|date' + ]); $person = Person::findOrFail($id); $input = $request->all(); $person->update($input); diff --git a/app/Http/Requests/PersonRequest.php b/app/Http/Requests/Person/CreatePersonRequest.php similarity index 51% rename from app/Http/Requests/PersonRequest.php rename to app/Http/Requests/Person/CreatePersonRequest.php index cfb9daf..f6f5d74 100644 --- a/app/Http/Requests/PersonRequest.php +++ b/app/Http/Requests/Person/CreatePersonRequest.php @@ -1,9 +1,10 @@ 'nullable|min:2|max:255', - 'last_name' => 'required|min:3|max:255', + 'last_name' => 'required|min:3|max:255|unique_with:persons,first_name,date_of_birth', 'first_name' => 'required|min:3|max:255', - 'email' => 'nullable|email|max:100', + 'email' => 'required|email|max:50|unique:persons,email', + // 'email' => [ + // 'required', 'email', 'max:100', + // Rule::unique('persons')->ignore($user->id), + // ], 'identifier_orcid' => 'nullable|min:19|max:50', - 'status' => 'required|boolean' + 'status' => 'required|boolean', + 'date_of_birth' => 'required|date' ]; } } diff --git a/app/Http/Requests/Person/EditPersonRequest.php b/app/Http/Requests/Person/EditPersonRequest.php new file mode 100644 index 0000000..21ce4b9 --- /dev/null +++ b/app/Http/Requests/Person/EditPersonRequest.php @@ -0,0 +1,42 @@ + 'nullable|min:2|max:255', + 'last_name' => 'required|min:3|max:255|unique_with:persons,first_name,date_of_birth', + 'first_name' => 'required|min:3|max:255', + 'email' => 'required|email|max:50|unique:persons,email', + // 'email' => [ + // 'required', 'email', 'max:100', + // Rule::unique('persons')->ignore($user->id), + // ], + 'identifier_orcid' => 'nullable|min:19|max:50', + 'status' => 'required|boolean', + 'date_of_birth' => 'required|date' + ]; + } +} diff --git a/app/Providers/SolariumServiceProvider.php b/app/Providers/SolariumServiceProvider.php index e857b46..b611101 100644 --- a/app/Providers/SolariumServiceProvider.php +++ b/app/Providers/SolariumServiceProvider.php @@ -17,13 +17,13 @@ class SolariumServiceProvider extends ServiceProvider */ public function register() { - $this->app->bind(Client::class, function ($app) { + $this->app->bind(Client::class, function ($app) { // $config = config('solarium'); $config = array( 'endpoint' => array( 'localhost' => array( - 'host' => '127.0.0.1', - 'port' => '8983', + 'host' => '127.0.0.1', + 'port' => '8983', 'path' => '/solr/', 'core' => 'opus4' ) @@ -39,5 +39,4 @@ class SolariumServiceProvider extends ServiceProvider { return [Client::class]; } - } diff --git a/composer.json b/composer.json index 319c527..5e92d13 100755 --- a/composer.json +++ b/composer.json @@ -10,6 +10,8 @@ "require": { "php": ">=7.0.0", "davejamesmiller/laravel-breadcrumbs": "4.x", + "dimsav/laravel-translatable": "8.*", + "felixkiss/uniquewith-validator": "^3.1", "fideloper/proxy": "~3.3", "hieu-le/active": "^3.5", "laravel/framework": "5.5.*", @@ -17,8 +19,7 @@ "laravelcollective/html": "^5.5.0", "solarium/solarium": "^3.8", "yajra/laravel-datatables-oracle": "^8.8", - "zizaco/entrust": "^1.9", - "dimsav/laravel-translatable": "8.*" + "zizaco/entrust": "^1.9" }, "require-dev": { "fzaninotto/faker": "^1.8", diff --git a/composer.lock b/composer.lock index de92302..d3c84df 100755 --- a/composer.lock +++ b/composer.lock @@ -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": "77d562b002d6678573038e1e2101911c", + "content-hash": "4342eadf905adb22061f8d3fe0bf6d97", "packages": [ { "name": "davejamesmiller/laravel-breadcrumbs", @@ -380,6 +380,59 @@ ], "time": "2018-03-08T01:11:30+00:00" }, + { + "name": "felixkiss/uniquewith-validator", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/felixkiss/uniquewith-validator.git", + "reference": "a27d5823bcf52dac6760638c8d987760212dbf5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixkiss/uniquewith-validator/zipball/a27d5823bcf52dac6760638c8d987760212dbf5c", + "reference": "a27d5823bcf52dac6760638c8d987760212dbf5c", + "shasum": "" + }, + "require": { + "illuminate/support": "5.*", + "illuminate/validation": "5.*", + "php": ">=5.4.0" + }, + "require-dev": { + "bossa/phpspec2-expect": "dev-phpspec-3.2", + "phpspec/phpspec": "^3.2" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Felixkiss\\UniqueWithValidator\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-0": { + "Felixkiss\\UniqueWithValidator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Felix Kiss", + "email": "felix@felixkiss.com" + } + ], + "description": "Custom Laravel Validator for combined unique indexes", + "homepage": "https://github.com/felixkiss/uniquewith-validator", + "keywords": [ + "laravel" + ], + "time": "2017-08-06T23:28:53+00:00" + }, { "name": "fideloper/proxy", "version": "3.3.4", @@ -939,16 +992,16 @@ }, { "name": "monolog/monolog", - "version": "1.23.0", + "version": "1.24.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4" + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4", - "reference": "fd8c787753b3a2ad11bc60c063cff1358a32a3b4", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", "shasum": "" }, "require": { @@ -1013,7 +1066,7 @@ "logging", "psr-3" ], - "time": "2017-06-19T01:22:40+00:00" + "time": "2018-11-05T09:00:11+00:00" }, { "name": "mtdowling/cron-expression", @@ -1061,16 +1114,16 @@ }, { "name": "nesbot/carbon", - "version": "1.34.0", + "version": "1.34.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "1dbd3cb01c5645f3e7deda7aa46ef780d95fcc33" + "reference": "19201b87f7dba2a7cbf1cccdf0e1da13c04ee9c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/1dbd3cb01c5645f3e7deda7aa46ef780d95fcc33", - "reference": "1dbd3cb01c5645f3e7deda7aa46ef780d95fcc33", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/19201b87f7dba2a7cbf1cccdf0e1da13c04ee9c9", + "reference": "19201b87f7dba2a7cbf1cccdf0e1da13c04ee9c9", "shasum": "" }, "require": { @@ -1112,7 +1165,7 @@ "datetime", "time" ], - "time": "2018-09-20T19:36:25+00:00" + "time": "2018-11-08T13:33:47+00:00" }, { "name": "nikic/php-parser", @@ -1629,16 +1682,16 @@ }, { "name": "symfony/console", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803", + "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803", "shasum": "" }, "require": { @@ -1694,11 +1747,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/css-selector", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -1751,16 +1804,16 @@ }, { "name": "symfony/debug", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" + "reference": "fe9793af008b651c5441bdeab21ede8172dab097" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", + "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097", + "reference": "fe9793af008b651c5441bdeab21ede8172dab097", "shasum": "" }, "require": { @@ -1803,20 +1856,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2018-10-31T09:06:03+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", + "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14", "shasum": "" }, "require": { @@ -1866,11 +1919,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2018-10-30T16:50:50+00:00" }, { "name": "symfony/finder", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -1919,16 +1972,16 @@ }, { "name": "symfony/http-foundation", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "3a4498236ade473c52b92d509303e5fd1b211ab1" + "reference": "5aea7a86ca3203dd7a257e765b4b9c9cfd01c6c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3a4498236ade473c52b92d509303e5fd1b211ab1", - "reference": "3a4498236ade473c52b92d509303e5fd1b211ab1", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/5aea7a86ca3203dd7a257e765b4b9c9cfd01c6c0", + "reference": "5aea7a86ca3203dd7a257e765b4b9c9cfd01c6c0", "shasum": "" }, "require": { @@ -1969,20 +2022,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:48:18+00:00" + "time": "2018-10-31T08:57:11+00:00" }, { "name": "symfony/http-kernel", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "a0944a9a1d8845da724236cde9a310964acadb1c" + "reference": "4bf0be7c7fe63eff6a5eae2f21c83e77e31a56fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a0944a9a1d8845da724236cde9a310964acadb1c", - "reference": "a0944a9a1d8845da724236cde9a310964acadb1c", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/4bf0be7c7fe63eff6a5eae2f21c83e77e31a56fb", + "reference": "4bf0be7c7fe63eff6a5eae2f21c83e77e31a56fb", "shasum": "" }, "require": { @@ -2058,11 +2111,11 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-10-03T12:03:34+00:00" + "time": "2018-11-03T10:03:02+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -2120,16 +2173,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -2175,20 +2228,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", + "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", "shasum": "" }, "require": { @@ -2234,20 +2287,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2018-09-21T06:26:08+00:00" }, { "name": "symfony/process", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", + "url": "https://api.github.com/repos/symfony/process/zipball/35c2914a9f50519bd207164c353ae4d59182c2cb", + "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb", "shasum": "" }, "require": { @@ -2283,11 +2336,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2018-10-14T17:33:21+00:00" }, { "name": "symfony/routing", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", @@ -2364,16 +2417,16 @@ }, { "name": "symfony/translation", - "version": "v4.1.6", + "version": "v4.1.7", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "9f0b61e339160a466ebcde167a6c5521c810e304" + "reference": "aa04dc1c75b7d3da7bd7003104cd0cfc5dff635c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/9f0b61e339160a466ebcde167a6c5521c810e304", - "reference": "9f0b61e339160a466ebcde167a6c5521c810e304", + "url": "https://api.github.com/repos/symfony/translation/zipball/aa04dc1c75b7d3da7bd7003104cd0cfc5dff635c", + "reference": "aa04dc1c75b7d3da7bd7003104cd0cfc5dff635c", "shasum": "" }, "require": { @@ -2429,11 +2482,11 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:36:10+00:00" + "time": "2018-10-28T18:38:52+00:00" }, { "name": "symfony/var-dumper", - "version": "v3.4.17", + "version": "v3.4.18", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", @@ -2599,16 +2652,16 @@ }, { "name": "yajra/laravel-datatables-oracle", - "version": "v8.9.1", + "version": "v8.9.2", "source": { "type": "git", "url": "https://github.com/yajra/laravel-datatables.git", - "reference": "851c4d4d307a66a4f8ab5c12444c1eb0104ecc80" + "reference": "3b084b9b7b4aac46f0bfc2d71b9b3a67d794f4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/851c4d4d307a66a4f8ab5c12444c1eb0104ecc80", - "reference": "851c4d4d307a66a4f8ab5c12444c1eb0104ecc80", + "url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/3b084b9b7b4aac46f0bfc2d71b9b3a67d794f4e9", + "reference": "3b084b9b7b4aac46f0bfc2d71b9b3a67d794f4e9", "shasum": "" }, "require": { @@ -2666,7 +2719,7 @@ "jquery", "laravel" ], - "time": "2018-10-05T06:10:33+00:00" + "time": "2018-10-30T14:23:18+00:00" }, { "name": "zizaco/entrust", diff --git a/resources/views/publish/create-step1.blade.php b/resources/views/publish/create-step1.blade.php index d591613..1d5d7e5 100644 --- a/resources/views/publish/create-step1.blade.php +++ b/resources/views/publish/create-step1.blade.php @@ -35,24 +35,23 @@
+ + +
- Ich habe diese rechtlichen Hinweise gelesen und bin damit einverstanden. - * - {{-- --}} - + + +Dataset Title | ID | Server State | - - @foreach($datasets as $dataset) -|
---|---|---|---|
- @if ($dataset->titles()->first()) - {{ $dataset->titles()->first()->value }} - @else - no title - @endif - | -- {{ $dataset->id }} - | -- {{ $dataset->server_state }} - | - -- @if ($dataset->server_state == "unpublished") - Publish - Restrict - @else - Finish - @endif - | -
+ @if ($dataset->titles()->first()) + {{ $dataset->titles()->first()->value }} + @else + no title + @endif + | ++ {{ $dataset->id }} + | ++ {{ $dataset->server_state }} + | ++ @if ($dataset->server_state == "unpublished") + Publish + Restrict + @else + Finish + @endif + | +