public function __construct() { $this->department = $this->getDepartment(); $this->middleware('paperArchive', ['except' => ['index', 'create', 'store']]); $this->middleware('lockPaper:' . $this->department->id, ['only' => ['create', 'store', 'edit', 'update', 'destroy', 'getInvoice', 'postInvoice']]); $this->paper = new PaperClass(); $statuses = new PaperStatus(); view()->share(['categories' => getNomenclatureSelect($this->getCategories(), true), 'statuses' => $statuses->getStatuses()]); }
/** * Bootstrap any application services. * * @return void */ public function boot() { $this->app->bind('ConferenceBaseController', function () { return new ConferenceBaseController(); }); $departmentsSelect = getNomenclatureSelect(Department::with(['langs' => function ($query) { $query->lang(); }])->sort()->active()->get(), true); view()->share('departmentsSelect', $departmentsSelect); }
public function __construct() { $this->middleware('departmentAccess:4'); $this->middleware('adminDepartmentObject:News', ['only' => ['edit', 'update', 'delete']]); $this->systemAdmin = false; $departments = []; if (systemAccess(100)) { $this->systemAdmin = true; $departments = getNomenclatureSelect($this->getDepartmentsAdmin(), true); } view()->share(['systemAdmin' => $this->systemAdmin, 'departments' => $departments]); }
public function categories() { $records = []; $first = true; if (request()->has('first') && request('first') == 0) { $first = false; } $categories = getNomenclatureSelect($this->getCategories(request()->get('department_id')), $first); foreach ($categories as $id => $value) { $records[] = [$id => $value]; } return $records; }
public function __construct() { $this->middleware('departmentAccess:6'); $this->middleware('adminDepartmentObject:Criteria', ['only' => ['edit', 'update', 'delete']]); $this->systemAdmin = false; $departments = []; $types = new CriteriaType(); if (systemAccess(100)) { $this->systemAdmin = true; $departments = getNomenclatureSelect($this->getDepartmentsAdmin(), true); } view()->share(['systemAdmin' => $this->systemAdmin, 'departments' => $departments, 'types' => $types->getTypes()]); }
public function getProfile(Rank $rank, Country $country) { $data = ['reviewer' => false, 'ranks' => $rank->getRanks(), 'countries' => $country->getCountries(), 'categories' => getNomenclatureSelect($this->getCategories())]; $settings = $this->getDepartment()->settings()->key('user_data'); $disabled = ''; if (isset($settings->value) && $settings->value) { session()->put('warning', 'lock-data'); $disabled = 'disabled'; } if (auth()->user()->is_reviewer || systemAccess(2)) { $data['reviewer'] = true; $data['selectedCategories'] = auth()->user()->categories()->lists('id')->toArray(); } $data['disabled'] = $disabled; return view('conference.profile', $data); }
/** * Show the form for editing the specified resource. * * @param Paper $paper * @return \Illuminate\Http\Response */ public function edit(Paper $paper) { return view('admin.paper.edit', ['paper' => $paper, 'force' => true, 'authors' => simpleSelect(User::getAuthors($paper->department_id), true), 'reviewers' => simpleSelect(User::getReviewers($paper->department_id, $paper->category_id), true), 'categories' => getNomenclatureSelect($this->getCategories($paper->department_id), true)]); }
/** * Show the form for editing the specified resource. * * @param User $user * @param \App\Classes\Rank $rank, * @param \App\Classes\Country $country, * @return \Illuminate\Http\Response */ public function edit(User $user, Rank $rank, Country $country) { $user->load('categories'); return view('admin.user.edit', ['user' => $user, 'ranks' => $rank->getRanks(), 'countries' => $country->getCountries(), 'reviewer' => 1, 'selectedCategories' => $user->categories->lists('id')->toArray(), 'categories' => getNomenclatureSelect($this->getCategories($user->department_id))]); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { return view('admin.archive.create', ['departments' => getNomenclatureSelect($this->getDepartmentsAdmin(), true)]); }
public function getEmail() { $departmentId = null; if ($this->systemAdmin) { if (session('department_filter_id')) { $departmentId = session('department_filter_id'); } } else { $departmentId = auth()->user()->department_id; } $users = $templates = []; if ($departmentId) { $users = simpleSelect(User::where('department_id', $departmentId)->get()); $templates = simpleSelect(EmailTemplate::where('department_id', $departmentId)->where('system', 0)->get(), true); } return view('admin.template.email', ['departments' => getNomenclatureSelect($this->getDepartmentsAdmin(), true), 'user_types' => simpleSelect(UserType::active()->get(), true, 'title'), 'users' => $users, 'templates' => $templates]); }
public function getRegister(Rank $rank, Country $country) { $lock = $this->getDepartment()->settings()->key('registrations'); if (isset($lock->value) && $lock->value) { return redirect()->back()->with('error', 'lock-registrations'); } return view('auth.register', ['ranks' => $rank->getRanks(), 'countries' => $country->getCountries(), 'categories' => getNomenclatureSelect($this->getCategories())]); }