mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
Adaptierung Notizcomponent: teleport datepicker, tinymce mount conditionally, fehlerhandling missing id and type
This commit is contained in:
@@ -100,21 +100,6 @@ class Notiz extends FHC_Controller
|
||||
}
|
||||
}
|
||||
|
||||
//Überprüfung ob type übergeben wurde (via Funktions- oder Postparameter)
|
||||
$type = null;
|
||||
if ($paramTyp)
|
||||
$type = $paramTyp;
|
||||
if(isset($_POST['typeId']))
|
||||
$type = $this->input->post('typeId');
|
||||
|
||||
if(!$type)
|
||||
{
|
||||
$result = error('kein Type für ID vorhanden', ERROR);
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
//Form Validation
|
||||
$this->form_validation->set_rules('titel', 'titel', 'callback_titel_required');
|
||||
$this->form_validation->set_rules('text', 'text', 'callback_text_required');
|
||||
|
||||
@@ -152,6 +152,13 @@ class Notiz_model extends DB_Model
|
||||
$verfasser_uid = null,
|
||||
$bearbeiter_uid = null
|
||||
) {
|
||||
|
||||
//check, ob id und type valid
|
||||
if (!isset($id) || ($id == "undefined")) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return error("Id(". $id. ') ist keine gültige ID!');
|
||||
}
|
||||
|
||||
// Loads model Notizzuordnung_model
|
||||
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
|
||||
|
||||
@@ -160,17 +167,8 @@ class Notiz_model extends DB_Model
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
|
||||
$result = error($result->retval, EXIT_ERROR);
|
||||
return $result;
|
||||
return error($type . ' ist kein gültiger ID_TYP!');
|
||||
}
|
||||
/*
|
||||
if(!$isValidType)
|
||||
{
|
||||
//Todo manu (correct return to controller)
|
||||
$msg = "datatype " . $type . " not implemented for notes";
|
||||
return error($msg, EXIT_ERROR);
|
||||
}*/
|
||||
|
||||
// Start DB transaction
|
||||
$this->db->trans_start(false);
|
||||
|
||||
Reference in New Issue
Block a user