mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 00:42:15 +00:00
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:
@@ -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));
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user