Added GUI/functionality to add begruendung for 'NICHT EMPFEHLEN' in lectors overview

. Begruendung is added as Notiz
. GUI to attach begruendung will slide down the moment 'Nicht Empfehlen'
is clicked
. added phrases

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-02-02 13:50:32 +01:00
committed by cris-technikum
parent da3720e65d
commit 8fc338ccb4
6 changed files with 381 additions and 38 deletions
+59
View File
@@ -158,6 +158,65 @@ class Notiz_model extends DB_Model
return $this->loadWhere(array('person_id' => $person_id, 'titel LIKE' => $titel));
}
/**
* Add a Notiz for a given Anrechnung
* @param $anrechnung_id
* @param $titel
* @param $text
* @param $verfasser_uid
* @return array
*/
public function addNotizForAnrechnung($anrechnung_id, $titel, $text, $verfasser_uid)
{
// Loads model Notizzuordnung_model
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
// Start DB transaction
$this->db->trans_start(false);
$result = $this->insert(array(
'titel' => $titel,
'text' => $text,
'erledigt' => true,
'verfasser_uid' => $verfasser_uid,
"insertvon" => $verfasser_uid
));
if (isSuccess($result))
{
$notiz_id = $result->retval;
$result = $this->NotizzuordnungModel->insert(array('notiz_id' => $notiz_id, 'anrechnung_id' => $anrechnung_id));
}
// Transaction complete!
$this->db->trans_complete();
// Check if everything went ok during the transaction
if ($this->db->trans_status() === false || isError($result))
{
$this->db->trans_rollback();
$result = error($result->msg, EXIT_ERROR);
}
else
{
$this->db->trans_commit();
$result = success($notiz_id);
}
return $result;
}
/**
* gets all Notizen for a person
* @param $person_id
*/
public function getNotizByAnrechnung($anrechnung_id)
{
$this->addJoin('public.tbl_notizzuordnung', 'notiz_id');
return $this->loadWhere(array('anrechnung' => $anrechnung_id));
}
// ------------------------------------------------------------------------------------------------------
}