This commit is contained in:
@@ -27,4 +27,9 @@ class Feature extends BaseConfig
|
||||
* Use improved new auto routing instead of the default legacy version.
|
||||
*/
|
||||
public bool $autoRoutesImproved = false;
|
||||
|
||||
/**
|
||||
* Show the global school-year selector in authenticated admin layouts.
|
||||
*/
|
||||
public bool $globalSchoolYearSelector = true;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ class Filters extends BaseConfig
|
||||
'permission' => \App\Filters\PermissionFilter::class,
|
||||
'timezone' => \App\Filters\TimezoneFilter::class,
|
||||
'schoolYear' => \App\Filters\RequireSchoolYearFilter::class,
|
||||
'schoolYearWritable'=> \App\Filters\SchoolYearWritableFilter::class,
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ $routes->setAutoRoute(false);
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
$routes->post('api/proofread', 'ProofreadController::check', ['filter' => 'auth']);
|
||||
$routes->post('school-year/select', 'View\SchoolYearSelectionController::select', ['filter' => 'auth']);
|
||||
$routes->post('school-year/reset', 'View\SchoolYearSelectionController::reset', ['filter' => 'auth']);
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------
|
||||
|
||||
+24
-1
@@ -188,7 +188,29 @@ class Services extends BaseService
|
||||
}
|
||||
|
||||
return new \App\Services\SchoolYearContextService(
|
||||
model(\App\Models\SchoolYearModel::class)
|
||||
model(\App\Models\SchoolYearModel::class),
|
||||
static::schoolYearAccessPolicy()
|
||||
);
|
||||
}
|
||||
|
||||
public static function schoolYearAccessPolicy(bool $getShared = true): \App\Services\SchoolYearAccessPolicy
|
||||
{
|
||||
if ($getShared) {
|
||||
return static::getSharedInstance('schoolYearAccessPolicy');
|
||||
}
|
||||
|
||||
return new \App\Services\SchoolYearAccessPolicy();
|
||||
}
|
||||
|
||||
public static function schoolYearViewData(bool $getShared = true): \App\Services\SchoolYearViewDataService
|
||||
{
|
||||
if ($getShared) {
|
||||
return static::getSharedInstance('schoolYearViewData');
|
||||
}
|
||||
|
||||
return new \App\Services\SchoolYearViewDataService(
|
||||
static::schoolYearContext(),
|
||||
static::schoolYearAccessPolicy()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -238,6 +260,7 @@ class Services extends BaseService
|
||||
model(\App\Models\SchoolYearModel::class),
|
||||
model(\App\Models\SchoolYearClosingBatchModel::class),
|
||||
model(\App\Models\SchoolYearClosingItemModel::class),
|
||||
model(\App\Models\ConfigurationModel::class),
|
||||
static::schoolYearManagement(),
|
||||
\Config\Database::connect()
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user