Merge branch 'merge_FHC4_55354_55991_55992_60874_60876_60875_61229_61230_61231' into demo-cis40

This commit is contained in:
Harald Bamberger
2025-08-13 07:05:21 +02:00
18 changed files with 407 additions and 181 deletions
+4
View File
@@ -58,6 +58,10 @@ $config['tabs'] =
//if true, Anrechnungen can be added and edited in tab Anrechnungen
'editableAnrechnungen' => false,
],
'notes' => [
//if true, the count of Messages will be shown in the header of the Tab Messages
'showCountNotes' => true
]
];
// List of fields to show when ZGV_DOKTOR_ANZEIGEN is defined
@@ -62,10 +62,15 @@ class Config extends FHCAPI_Controller
'component' => './Stv/Studentenverwaltung/Details/Details.js',
'config' => $config['details']
];
$showSuffix = $config['notes']['showCountNotes'] ?? false;
$result['notes'] = [
'title' => $this->p->t('stv', 'tab_notes'),
'component' => './Stv/Studentenverwaltung/Details/Notizen.js'
'component' => './Stv/Studentenverwaltung/Details/Notizen.js',
'config' => $config['notes'],
'showSuffix' => $showSuffix && ($config['notes']['showCountNotes'] ?? false)
];
$result['contact'] = [
'title' => $this->p->t('stv', 'tab_contact'),
'component' => './Stv/Studentenverwaltung/Details/Kontakt.js',
@@ -35,8 +35,6 @@ class Favorites extends FHCAPI_Controller
// Load models
$this->load->model('system/Variable_model', 'VariableModel');
// TODO(chris): variable table might be to small to store favorites!
}
public function index()
@@ -62,6 +60,17 @@ class Favorites extends FHCAPI_Controller
$favorites = $this->input->post('favorites');
$removed = [];
while (strlen($favorites) > 64) {
$favObj = json_decode($favorites);
if (!$favObj->list)
break;
$removed[] = array_shift($favObj->list);
$favorites = json_encode($favObj);
}
if ($removed)
$this->addMeta('removed', $removed);
$result = $this->VariableModel->setVariable(getAuthUID(), 'stv_favorites', $favorites);
$this->getDataOrTerminateWithError($result);
@@ -24,7 +24,6 @@ class Status extends FHCAPI_Controller
'updateStatus' => ['admin:rw', 'assistenz:rw'],
'advanceStatus' => ['admin:rw', 'assistenz:rw'],
'confirmStatus' => ['admin:rw', 'assistenz:rw'],
]);
//Load Models
@@ -440,9 +439,10 @@ class Status extends FHCAPI_Controller
]);
if (!$this->form_validation->run())
{
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$this->load->library('PrestudentLib');
$this->db->trans_start();
@@ -628,8 +628,9 @@ class Status extends FHCAPI_Controller
]);
if (!$this->form_validation->run())
{
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
// Start DB transaction
$this->db->trans_start();
@@ -106,6 +106,7 @@ class Student extends FHCAPI_Controller
$this->PrestudentModel->addSelect('p.staatsbuergerschaft');
$this->PrestudentModel->addSelect('p.matr_nr');
$this->PrestudentModel->addSelect('p.anrede');
$this->PrestudentModel->addSelect('p.zugangscode');
if (defined('ACTIVE_ADDONS') && strpos(ACTIVE_ADDONS, 'bewerbung') !== false) {
$this->PrestudentModel->addSelect(
+17
View File
@@ -21,6 +21,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller
'loadDokumente' => self::DEFAULT_PERMISSION_R,
'getMitarbeiter' => self::DEFAULT_PERMISSION_R,
'isBerechtigt' => self::DEFAULT_PERMISSION_R,
'getCountNotes' => self::DEFAULT_PERMISSION_R,
];
if(!is_array($permissions))
@@ -459,4 +460,20 @@ abstract class Notiz_Controller extends FHCAPI_Controller
return $this->terminateWithSuccess($result);
}
public function getCountNotes($person_id)
{
$this->NotizzuordnungModel->addSelect('COUNT(*) AS anzahl', false);
$result = $this->NotizzuordnungModel->loadWhere(
array('person_id' => $person_id)
);
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$anzahl = current(getData($result));
return $this->terminateWithSuccess($anzahl->anzahl ?: 0);
}
}