Liste 2 Ausbesserungen
This commit is contained in:
parent
3b005f4555
commit
0e88d76bdc
11 changed files with 246 additions and 139 deletions
|
@ -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'));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<?php
|
||||
namespace App\Http\Requests;
|
||||
namespace App\Http\Requests\Person;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class PersonRequest extends Request
|
||||
class CreatePersonRequest extends Request
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
|
@ -24,11 +25,16 @@ class PersonRequest extends Request
|
|||
{
|
||||
return [
|
||||
'academic_title' => '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'
|
||||
];
|
||||
}
|
||||
}
|
42
app/Http/Requests/Person/EditPersonRequest.php
Normal file
42
app/Http/Requests/Person/EditPersonRequest.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
namespace App\Http\Requests\Person;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
//https://packagist.org/packages/felixkiss/uniquewith-validator
|
||||
|
||||
class CreatePersonRequest extends Request
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'academic_title' => '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'
|
||||
];
|
||||
}
|
||||
}
|
|
@ -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];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue