mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 16:32:20 +00:00
Change Font-Size in Tabulator 5, Start Dateiupload
This commit is contained in:
@@ -23,7 +23,7 @@ class Notiz extends FHC_Controller
|
||||
{
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
|
||||
$result = $this->NotizModel->getNotiz($person_id, true);
|
||||
$result = $this->NotizModel->getNotizWithDocEntries($person_id);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
@@ -62,7 +62,9 @@ class Notiz extends FHC_Controller
|
||||
|
||||
public function addNewNotiz($person_id)
|
||||
{
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
var_dump($this->input->post('titel'));
|
||||
var_dump($this->input->post('anhang'));
|
||||
var_dump($_FILES);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
|
||||
@@ -79,17 +81,11 @@ class Notiz extends FHC_Controller
|
||||
$uid = getAuthUID();
|
||||
$titel = isset($_POST['titel']) ? $_POST['titel'] : null;
|
||||
$text = isset($_POST['text']) ? $_POST['text'] : null;
|
||||
//$verfasser_uid = isset($_POST['verfasser_uid']) ? $_POST['verfasser_uid'] : null;
|
||||
$verfasser_uid = $uid;
|
||||
$start = isset($_POST['von']) ? $_POST['von'] : null;
|
||||
$ende = isset($_POST['bis']) ? $_POST['bis'] : null;
|
||||
$erledigt = $_POST['erledigt'];
|
||||
|
||||
/* $dms_id = isset($_POST['dms_id']) ? $_POST['dms_id'] : null;
|
||||
$bearbeiter_uid = isset($_POST['bearbeiter_uid']) ? $_POST['bearbeiter_uid'] : null;
|
||||
|
||||
*/
|
||||
|
||||
$result = $this->NotizModel->addNotizForPersonWithDoc($person_id, $titel, $text, $erledigt, $verfasser_uid, $start, $ende);
|
||||
|
||||
// var_dump($result);
|
||||
@@ -191,4 +187,32 @@ class Notiz extends FHC_Controller
|
||||
return $this->outputJsonSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
public function loadDokumente($notiz_id)
|
||||
{
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
|
||||
//TODO(manu) check, ob mehr Dateien bzw. -versionen
|
||||
//warum nur ein Eintrag???
|
||||
$this->NotizModel->addSelect('campus.tbl_dms_version.*');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_dokument','ON (public.tbl_notiz_dokument.notiz_id = public.tbl_notiz.notiz_id)');
|
||||
$this->NotizModel->addJoin('campus.tbl_dms_version','ON (public.tbl_notiz_dokument.dms_id = campus.tbl_dms_version.dms_id)');
|
||||
|
||||
$result = $this->NotizModel->loadWhere(
|
||||
array('public.tbl_notiz.notiz_id' => $notiz_id)
|
||||
);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
elseif (!hasData($result)) {
|
||||
$this->outputJson($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -175,17 +175,41 @@ class Notiz_model extends DB_Model
|
||||
* gets all Notizen for a person
|
||||
* @param $person_id
|
||||
*/
|
||||
public function getNotiz($person_id, $withDoc=false)
|
||||
public function getNotiz($person_id)
|
||||
{
|
||||
// Join with the table public.tbl_notizzuordnung using notiz_id
|
||||
$this->addSelect('public.tbl_notiz.*');
|
||||
$this->addJoin('public.tbl_notizzuordnung', 'notiz_id');
|
||||
|
||||
if($withDoc)
|
||||
$this->addJoin('public.tbl_notiz_dokument', 'notiz_id', 'LEFT');
|
||||
|
||||
return $this->loadWhere(array('person_id' => $person_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all Notizen with Documententries for a person
|
||||
* @param $person_id
|
||||
*/
|
||||
public function getNotizWithDocEntries($person_id)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
n.*, count(dms_id) as countDoc
|
||||
FROM
|
||||
public.tbl_notiz n
|
||||
JOIN
|
||||
public.tbl_notizzuordnung z USING (notiz_id)
|
||||
LEFT JOIN
|
||||
public.tbl_notiz_dokument dok USING (notiz_id)
|
||||
LEFT JOIN
|
||||
campus.tbl_dms_version USING (dms_id)
|
||||
WHERE
|
||||
z.person_id = ?
|
||||
GROUP BY
|
||||
notiz_id
|
||||
";
|
||||
|
||||
return $this->execQuery($qry, array($person_id));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all Notizen for a person with a specific title
|
||||
* @param $person_id
|
||||
|
||||
Reference in New Issue
Block a user