[Operator] Pembaruan Laman Operator
This commit is contained in:
@@ -483,6 +483,7 @@ trait FakesLegacyDatabase
|
||||
$table->string('namaruang');
|
||||
$table->integer('idgedung')->nullable();
|
||||
$table->integer('kapasitaskuliah')->default(0);
|
||||
$table->integer('kapasitasujian')->default(0);
|
||||
$table->integer('idbagian')->nullable();
|
||||
$table->smallInteger('lantai')->nullable();
|
||||
});
|
||||
@@ -1269,6 +1270,33 @@ trait FakesLegacyDatabase
|
||||
* dan C (FMIPA, ruang C.1.1); Lab Komputer 1 milik prodi 21 tanpa gedung; wilayah, biodata, pegawai, kurikulum 900
|
||||
* dengan konsentrasi SI/RPL dan kelompok MK (MKK ganda beda huruf, MKP). Mandiri (insertOrIgnore pada tabel bersama).
|
||||
*/
|
||||
/**
|
||||
* Menu SIAKAD lama (t_menu) untuk kode yang diberikan beserta modul induknya (M01–M09), lalu diberikan ke otoritas
|
||||
* ($otoritas) di t_menuotoritas, agar sidebar akun operator lama (LegacyMenu) menautkan halaman yang diuji. Aman dipanggil berulang.
|
||||
*
|
||||
* @param list<string> $codes kdmenu, mis. ['M0103', 'M0402']
|
||||
*/
|
||||
protected function seedLegacyMenus(array $codes, int $otoritas = 7): void
|
||||
{
|
||||
$db = DB::connection('untan');
|
||||
$modules = ['M01' => 'Organisasi', 'M02' => 'Kurikulum', 'M03' => 'Jadwal', 'M04' => 'Mahasiswa', 'M05' => 'Registrasi Administrasi', 'M06' => 'Registrasi Akademik', 'M07' => 'Perkuliahan', 'M08' => 'Evaluasi Perkuliahan', 'M09' => 'Administrasi'];
|
||||
|
||||
foreach ($codes as $code) {
|
||||
$module = substr($code, 0, 3);
|
||||
$moduleId = 9000 + (int) substr($module, 1);
|
||||
$db->table('t_menu')->insertOrIgnore(['idmenu' => $moduleId, 'kdmenu' => $module, 'menu' => $modules[$module] ?? $module, 'idmenuinduk' => null, 'islink' => false]);
|
||||
|
||||
$id = $db->table('t_menu')->where('kdmenu', $code)->value('idmenu');
|
||||
if ($id === null) {
|
||||
$id = max(9100, (int) $db->table('t_menu')->max('idmenu') + 1);
|
||||
$db->table('t_menu')->insert(['idmenu' => $id, 'kdmenu' => $code, 'menu' => 'Menu '.$code, 'idmenuinduk' => $moduleId, 'islink' => true]);
|
||||
}
|
||||
if (! $db->table('t_menuotoritas')->where('idmenu', $id)->where('idotoritas', $otoritas)->exists()) {
|
||||
$db->table('t_menuotoritas')->insert(['idmenu' => (int) $id, 'idotoritas' => $otoritas, 'bybagian' => true]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function seedLegacyReference(): void
|
||||
{
|
||||
$db = DB::connection('untan');
|
||||
|
||||
Reference in New Issue
Block a user