Compare commits

..

No commits in common. "7d1406ee5cfa18f45505362e246f4fb7193df4ea" and "6156bdf0c63f27a9642ec2b457e6ac99933a3c01" have entirely different histories.

32 changed files with 145 additions and 161 deletions

View File

@ -53,7 +53,7 @@ class SitelinkController extends Controller
->whereYear('server_date_published', '>=', $from) ->whereYear('server_date_published', '>=', $from)
->whereYear('server_date_published', '<', $until); ->whereYear('server_date_published', '<', $until);
$documents = $select->orderBy('publish_id') $documents = $select->orderBy('publish_id', 'asc')
->get(); ->get();
//$this->years = Dataset::select(DB::raw('YEAR(server_date_modified) as server_date_modified')) //$this->years = Dataset::select(DB::raw('YEAR(server_date_modified) as server_date_modified'))

View File

@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use \Exception; use \Exception;
// use Illuminate\Support\Carbon; // use Carbon\Carbon;
use \Illuminate\Support\Carbon; use \Illuminate\Support\Carbon;
class RequestController extends Controller class RequestController extends Controller

View File

@ -64,7 +64,7 @@ class DoiController extends Controller
{ {
$datasets = Dataset::query() $datasets = Dataset::query()
->has('identifier') ->has('identifier')
->orderByDesc('server_date_modified') ->orderBy('server_date_modified', 'desc')
->get(); ->get();
return View::make('workflow.doi.index', [ return View::make('workflow.doi.index', [
'datasets' => $datasets, 'datasets' => $datasets,

View File

@ -18,7 +18,7 @@ use App\Models\User;
use App\Rules\RdrFilesize; use App\Rules\RdrFilesize;
use App\Rules\RdrFiletypes; use App\Rules\RdrFiletypes;
// use Illuminate\View\View; // use Illuminate\View\View;
use Illuminate\Support\Carbon; use Carbon\Carbon;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@ -87,7 +87,7 @@ class EditorController extends Controller
$query->whereIn('server_state', ['editor_accepted', 'rejected_reviewer', 'reviewed', 'published']) $query->whereIn('server_state', ['editor_accepted', 'rejected_reviewer', 'reviewed', 'published'])
->where('editor_id', $user_id)->doesntHave('identifier', 'and'); ->where('editor_id', $user_id)->doesntHave('identifier', 'and');
}) })
->orderByDesc('server_date_modified') ->orderBy('server_date_modified', 'desc')
->get(); ->get();
// return View::make('workflow.editor.index', compact('datasets')); // return View::make('workflow.editor.index', compact('datasets'));
return View::make('workflow.editor.index', [ return View::make('workflow.editor.index', [

View File

@ -82,7 +82,7 @@ class ReviewController extends Controller
$fieldval = $fieldValue->{$property_name}; $fieldval = $fieldValue->{$property_name};
$value = $value . $fieldName . ": " . $fieldval . "; "; $value = $value . $fieldName . ": " . $fieldval . "; ";
} }
} elseif ($fieldValue instanceof \Illuminate\Support\Carbon) { } elseif ($fieldValue instanceof \Carbon\Carbon) {
$value = $value . " Year " . $fieldValue->year; $value = $value . " Year " . $fieldValue->year;
$value = $value . " Month " . $fieldValue->month; $value = $value . " Month " . $fieldValue->month;
$value = $value . " Day " . $fieldValue->day; $value = $value . " Day " . $fieldValue->day;

View File

@ -47,7 +47,7 @@ class SubmitController extends Controller
'released', 'editor_accepted', 'approved', 'reviewed', 'rejected_editor', 'rejected_reviewer']) 'released', 'editor_accepted', 'approved', 'reviewed', 'rejected_editor', 'rejected_reviewer'])
->where('account_id', $user_id) ->where('account_id', $user_id)
->with('user:id,login') ->with('user:id,login')
->orderByDesc('server_date_modified') ->orderBy('server_date_modified', 'desc')
->get(); ->get();
return View::make('workflow.submitter.index', [ return View::make('workflow.submitter.index', [
'datasets' => $myDatasets, 'datasets' => $myDatasets,

View File

@ -30,7 +30,7 @@ class UserController extends Controller
//} //}
$users = User::with('roles') $users = User::with('roles')
->orderByDesc('id') ->orderBy('id', 'DESC')
->paginate(5); ->paginate(5);
return view('settings.access.user.user', compact('users')) return view('settings.access.user.user', compact('users'))
->with('i', ($request->input('page', 1) - 1) * 5); ->with('i', ($request->input('page', 1) - 1) * 5);

View File

@ -27,13 +27,8 @@ class CollectionRequest extends Request
public function rules() public function rules()
{ {
return [ return [
'name' => [ 'name' => 'required|max:255',
'required', 'role_id' => 'required',
'max:255',
],
'role_id' => [
'required',
],
]; ];
} }
} }

View File

@ -24,13 +24,8 @@ class DocumentRequest extends Request
public function rules() public function rules()
{ {
return [ return [
'type' => [ 'type' => 'required|min:3',
'required', 'server_state' => 'required',
'min:3',
],
'server_state' => [
'required',
],
// 'author' => 'required|min:4', // 'author' => 'required|min:4',
// 'stock' => 'required|integer', // 'stock' => 'required|integer',
// 'year' => 'required|integer|min:4' // 'year' => 'required|integer|min:4'

View File

@ -24,40 +24,15 @@ class LicenseRequest extends Request
public function rules() public function rules()
{ {
return [ return [
'desc_text' => [ 'desc_text' => 'max:4000',
'max:4000', 'language' => 'max:3',
], 'link_licence' => 'required|url:max:255',
'language' => [ 'link_logo' => 'url|max:255',
'max:3', 'mime_type' => 'max:30',
], 'name_long' => 'required|min:5|max:255',
'link_licence' => [ 'sort_order' => 'required|integer',
'required', 'active' => 'required|boolean',
'url:max:255', 'pod_allowed' => 'required|boolean'
],
'link_logo' => [
'url',
'max:255',
],
'mime_type' => [
'max:30',
],
'name_long' => [
'required',
'min:5',
'max:255',
],
'sort_order' => [
'required',
'integer',
],
'active' => [
'required',
'boolean',
],
'pod_allowed' => [
'required',
'boolean',
],
]; ];
} }
} }

View File

@ -28,10 +28,7 @@ class UpdatePageRequest extends Request
public function rules() public function rules()
{ {
return [ return [
'en_title' => [ 'en_title' => 'required|max:191'
'required',
'max:191',
],
// 'description_en' => 'required' // 'description_en' => 'required'
]; ];
} }

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class PeminjamanRequest 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 [
//
];
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class PeriodeRequest 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 [
'days' => 'required|integer'
];
}
}

View File

@ -24,45 +24,17 @@ class CreatePersonRequest extends Request
public function rules() public function rules()
{ {
return [ return [
'academic_title' => [ 'academic_title' => 'nullable|min:2|max:255',
'nullable', 'last_name' => 'required|min:3|max:255|unique_with:persons,first_name,date_of_birth',
'min:2', 'first_name' => 'required|min:3|max:255',
'max:255', 'email' => 'required|email|max:50|unique:persons,email',
],
'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' => [ // 'email' => [
// 'required', 'email', 'max:100', // 'required', 'email', 'max:100',
// Rule::unique('persons')->ignore($user->id), // Rule::unique('persons')->ignore($user->id),
// ], // ],
'identifier_orcid' => [ 'identifier_orcid' => 'nullable|min:19|max:50',
'nullable', 'status' => 'required|boolean',
'min:19', 'date_of_birth' => 'nullable|date'
'max:50',
],
'status' => [
'required',
'boolean',
],
'date_of_birth' => [
'nullable',
'date',
],
]; ];
} }
} }

View File

@ -26,45 +26,17 @@ class EditPersonRequest extends Request
public function rules() public function rules()
{ {
return [ return [
'academic_title' => [ 'academic_title' => 'nullable|min:2|max:255',
'nullable', 'last_name' => 'required|min:3|max:255|unique_with:persons,first_name,date_of_birth',
'min:2', 'first_name' => 'required|min:3|max:255',
'max:255', 'email' => 'required|email|max:50|unique:persons,email',
],
'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' => [ // 'email' => [
// 'required', 'email', 'max:100', // 'required', 'email', 'max:100',
// Rule::unique('persons')->ignore($user->id), // Rule::unique('persons')->ignore($user->id),
// ], // ],
'identifier_orcid' => [ 'identifier_orcid' => 'nullable|min:19|max:50',
'nullable', 'status' => 'required|boolean',
'min:19', 'date_of_birth' => 'nullable|date'
'max:50',
],
'status' => [
'required',
'boolean',
],
'date_of_birth' => [
'nullable',
'date',
],
]; ];
} }
} }

View File

@ -24,19 +24,9 @@ class ProjectRequest extends Request
{ {
return [ return [
'name' => [ 'name' => 'required|min:3|max:255',
'required', 'label' => 'required|min:3|max:20',
'min:3', 'description' => 'required'
'max:255',
],
'label' => [
'required',
'min:3',
'max:20',
],
'description' => [
'required',
],
]; ];
} }
} }

View File

@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class ShelfRequest 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 [
'shelf' => 'required'
];
}
}

View File

@ -1,7 +1,7 @@
<?php <?php
namespace App\Library\Util; namespace App\Library\Util;
use Illuminate\Support\Carbon; use Carbon\Carbon;
/** /**
* Describes local document as a match in context of a related search query. * Describes local document as a match in context of a related search query.

View File

@ -234,7 +234,7 @@ trait DatasetExtension
if (true === empty($fieldval)) { if (true === empty($fieldval)) {
$fieldval = null; $fieldval = null;
} else { } else {
$fieldval = new \Illuminate\Support\Carbon($fieldval); $fieldval = new \Carbon\Carbon($fieldval);
} }
} }

View File

@ -157,7 +157,7 @@ class Strategy
if ($value instanceof \Illuminate\Database\Eloquent\Model) { if ($value instanceof \Illuminate\Database\Eloquent\Model) {
$this->_mapModelAttributes($value, $dom, $childNode); $this->_mapModelAttributes($value, $dom, $childNode);
} elseif ($value instanceof \Illuminate\Support\Carbon) { } elseif ($value instanceof \Carbon\Carbon) {
$this->_mapDateAttributes($value, $dom, $childNode); $this->_mapDateAttributes($value, $dom, $childNode);
} elseif (is_array($value)) { } elseif (is_array($value)) {
$this->_mapArrayAttributes($value, $dom, $childNode); $this->_mapArrayAttributes($value, $dom, $childNode);
@ -181,7 +181,7 @@ class Strategy
return $dom->createElement($fieldName); return $dom->createElement($fieldName);
} }
protected function _mapDateAttributes(\Illuminate\Support\Carbon $model, DOMDocument $dom, \DOMNode $rootNode) protected function _mapDateAttributes(\Carbon\Carbon $model, DOMDocument $dom, \DOMNode $rootNode)
{ {
$rootNode->setAttribute("Year", $model->year); $rootNode->setAttribute("Year", $model->year);
$rootNode->setAttribute("Month", $model->month); $rootNode->setAttribute("Month", $model->month);

View File

@ -15,7 +15,7 @@ use App\Models\Title;
use App\Models\User; use App\Models\User;
use App\Models\XmlCache; use App\Models\XmlCache;
use App\Models\DatasetIdentifier; use App\Models\DatasetIdentifier;
use Illuminate\Support\Carbon; use Carbon\Carbon;
// use App\Models\GeolocationBox; // use App\Models\GeolocationBox;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
@ -301,7 +301,7 @@ class Dataset extends Model
$result = Dataset::select('server_date_published') $result = Dataset::select('server_date_published')
->where('server_date_published', '<>', null) ->where('server_date_published', '<>', null)
->where('server_state', 'published') ->where('server_state', 'published')
->orderBy('server_date_published') ->orderBy('server_date_published', 'asc')
->first(); ->first();
//->server_date_published; //->server_date_published;
return $result; return $result;

View File

@ -2,7 +2,6 @@
namespace App\Rules; namespace App\Rules;
use Illuminate\Support\Arr;
use Illuminate\Contracts\Validation\Rule; use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Config;
@ -103,7 +102,7 @@ class RdrFilesize implements Rule
private function getSize($attribute, $value) private function getSize($attribute, $value)
{ {
if (is_numeric($value) && $hasNumeric) { if (is_numeric($value) && $hasNumeric) {
return Arr::get($this->data, $attribute); return array_get($this->data, $attribute);
} elseif (is_array($value)) { } elseif (is_array($value)) {
return count($value); return count($value);
} elseif ($value instanceof File) { } elseif ($value instanceof File) {

View File

@ -2,7 +2,7 @@
namespace Database\Seeders; namespace Database\Seeders;
// use Illuminate\Support\Carbon; // use Carbon\Carbon;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;

View File

@ -2,7 +2,7 @@
namespace Database\Seeders; namespace Database\Seeders;
// use Illuminate\Support\Carbon; // use Carbon\Carbon;
// use Database\DisableForeignKeys; // use Database\DisableForeignKeys;
// use Database\TruncateTable; // use Database\TruncateTable;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;

View File

@ -2,7 +2,7 @@
namespace Database\Seeders; namespace Database\Seeders;
use Illuminate\Support\Carbon; use Carbon\Carbon;
// use Database\DisableForeignKeys; // use Database\DisableForeignKeys;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;

View File

@ -2,7 +2,7 @@
namespace Database\Seeders; namespace Database\Seeders;
use Illuminate\Support\Carbon; use Carbon\Carbon;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;

View File

@ -2,7 +2,7 @@
namespace Database\Seeders; namespace Database\Seeders;
use Illuminate\Support\Carbon; use Carbon\Carbon;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;

View File

@ -2,7 +2,7 @@
namespace Database\Seeders; namespace Database\Seeders;
use Illuminate\Support\Carbon; use Carbon\Carbon;
// use Database\DisableForeignKeys; // use Database\DisableForeignKeys;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;

View File

@ -93,7 +93,7 @@
{{-- <div class="form-group"> {{-- <div class="form-group">
{!! Form::label('licenses[]', 'Licenses..') !!} {!! Form::label('licenses[]', 'Licenses..') !!}
{!! Form::select('licenses[]', $options, Arr::pluck($document->licenses, 'id'), ['multiple' ]) !!} {!! Form::select('licenses[]', $options, array_pluck($document->licenses, 'id'), ['multiple' ]) !!}
</div> --}} </div> --}}
<div class="pure-control-group checkboxlist"> <div class="pure-control-group checkboxlist">

View File

@ -48,7 +48,7 @@
<td> <td>
{{-- @php {{-- @php
$dateDiff = $dataset['server_date_modified']->addDays(14); $dateDiff = $dataset['server_date_modified']->addDays(14);
$remainingDays = Illuminate\Support\Carbon::now()->diffInDays($dateDiff, false); $remainingDays = Carbon\Carbon::now()->diffInDays($dateDiff, false);
@endphp --}} @endphp --}}
{{ $dataset->remaining_time . ' days' }} {{ $dataset->remaining_time . ' days' }}

View File

@ -70,7 +70,7 @@ $appRoutes = function () {
->whereYear('server_date_published', '>=', $from) ->whereYear('server_date_published', '>=', $from)
->whereYear('server_date_published', '<', $until); ->whereYear('server_date_published', '<', $until);
$documents = $select->orderBy('publish_id') $documents = $select->orderBy('publish_id', 'asc')
->get(); ->get();
return response() return response()
->json($documents) ->json($documents)
@ -118,7 +118,7 @@ $appRoutes = function () {
$query = $query->orderBy($sortCol, $sortDir); $query = $query->orderBy($sortCol, $sortDir);
} }
} else { } else {
$query = $query->orderBy('id'); $query = $query->orderBy('id', 'asc');
} }
//handle filter //handle filter