Created infocenter details page showing Person Stammdaten, Dokumente, Prestudent ZGVs, Logs and Notizen.

This commit is contained in:
alex
2017-12-18 14:01:42 +01:00
parent 024035e890
commit fa3daa7a57
10 changed files with 896 additions and 0 deletions
+37
View File
@@ -94,5 +94,42 @@ class Notiz_model extends DB_Model
return $result;
}
/**
* Add a Notiz for a given person
*/
public function addNotizForPerson($person_id, $titel, $text, $erledigt, $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' => $erledigt, 'verfasser_uid' => $verfasser_uid,
"insertvon" => $verfasser_uid));
$notiz_id = $result->retval;
if (isSuccess($result))
{
$result = $this->NotizzuordnungModel->insert(array('notiz_id' => $notiz_id, 'person_id' => $person_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;
}
// ------------------------------------------------------------------------------------------------------
}
@@ -58,4 +58,30 @@ class PersonLog_model extends CI_Model
return success($result->result());
}
/**
* Load logs for a person, filtered by parameters
* @param int $person_id ID of the Person.
* @param string $app Name of the App.
* @param string $oe_kurzbz Organisations Unit.
* @return object $result
*/
public function filterLog($person_id, $app = null, $oe_kurzbz = null)
{
// Check Permissions
$this->load->library('PermissionLib');
if(!$this->permissionlib->isEntitled('system.tbl_log',PermissionLib::SELECT_RIGHT))
show_error('Permission denied - You need Access to system.tbl_log');
$this->db->order_by('zeitpunkt', 'DESC');
$this->db->order_by('log_id', 'DESC');
if (!is_null($app))
$this->db->where('app='.$this->db->escape($app));
if (!is_null($oe_kurzbz))
$this->db->where('oe_kurzbz='.$this->db->escape($oe_kurzbz));
$result = $this->db->get_where($this->dbTable, "person_id=".$this->db->escape($person_id));
return success($result->result());
}
}