diff --git a/application/controllers/system/infocenter/InfocenterDetails.php b/application/controllers/system/infocenter/InfocenterDetails.php index b10c2ec24..8c0c231a9 100644 --- a/application/controllers/system/infocenter/InfocenterDetails.php +++ b/application/controllers/system/infocenter/InfocenterDetails.php @@ -125,21 +125,36 @@ class InfocenterDetails extends VileSci_Controller show_error($prestudent->retval); } - $zgvpruefungen[] = $prestudent->retval[0]; + $zgvpruefung = $prestudent->retval[0]; + + //if prestudent is not interessent or is already bestaetigt, then show only as information, non-editable + $zgvpruefung->infoonly = !isset($zgvpruefung->prestudentstatus) || isset($zgvpruefung->prestudentstatus->bestaetigtam) || $zgvpruefung->prestudentstatus->status_kurzbz != 'Interessent'; + + $zgvpruefungen[] = $zgvpruefung; } //Interessenten come first - usort($zgvpruefungen, function ($a, $b){ - if($a->prestudentstatus->status_kurzbz === 'Interessent') + usort($zgvpruefungen, function ($a, $b) + { + if(!isset($a->prestudentstatus->status_kurzbz) || !isset($b->prestudentstatus->status_kurzbz)) + return 0; + elseif($a->prestudentstatus->status_kurzbz === 'Interessent' && $b->prestudentstatus->status_kurzbz === 'Interessent') + { + //infoonly Interessenten are behind new Interessenten + if($a->infoonly) + return 1; + elseif($b->infoonly) + return -1; + } + elseif($a->prestudentstatus->status_kurzbz === 'Interessent') return -1; - else if($b->prestudentstatus->status_kurzbz === 'Interessent') + elseif($b->prestudentstatus->status_kurzbz === 'Interessent') return 1; else return 0; }); - //TODO replace with widget - $statusgruende = $this->StatusgrundModel->load()->retval; + $statusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => 'Abgewiesener'))->retval; $data = array ( 'zgvpruefungen' => $zgvpruefungen, @@ -303,7 +318,12 @@ class InfocenterDetails extends VileSci_Controller $text = $this->input->post('notiz'); $erledigt = false; - $this->NotizModel->addNotizForPerson($person_id, $titel, $text, $erledigt, $this->uid); + $result = $this->NotizModel->addNotizForPerson($person_id, $titel, $text, $erledigt, $this->uid); + + if ($result->error) + { + show_error($result->retval); + } $this->personloglib->log($person_id, 'Action', array('name' => 'Notiz hinzugefügt', 'message' => 'Notiz mit Titel '.$titel.' wurde hinzugefügt', 'success' => 'true'), $this::APP, null, $this->uid); diff --git a/application/models/crm/Akte_model.php b/application/models/crm/Akte_model.php index 39f3cb29e..8eba43521 100644 --- a/application/models/crm/Akte_model.php +++ b/application/models/crm/Akte_model.php @@ -175,7 +175,7 @@ class Akte_model extends DB_Model } /** - * gets Akten together with Documenttype info, mainly bezeichnung fields + * gets Akten together with documenttype info, mainly bezeichnung fields * @param $person_id * @param null $dokument_kurzbz * @param bool $nachgereicht if true, retrieves only nachgereichte Dokumente. if false, only not nachgereichte. default: null, all Dokumente @@ -185,8 +185,9 @@ class Akte_model extends DB_Model { if (isError($ent = $this->isEntitled($this->dbTable, PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR))) return $ent; - $this->addSelect('public.tbl_akte.*, bezeichnung_mehrsprachig, dokumentbeschreibung_mehrsprachig, public.tbl_dokument.bezeichnung as dokument_bezeichnung', 'ausstellungsdetails'); + $this->addSelect('public.tbl_akte.*, bezeichnung_mehrsprachig, dokumentbeschreibung_mehrsprachig, public.tbl_dokument.bezeichnung as dokument_bezeichnung, bis.tbl_nation.*, ausstellungsdetails'); $this->addJoin('public.tbl_dokument', 'dokument_kurzbz'); + $this->addJoin('bis.tbl_nation', 'ausstellungsnation = nation_code', 'LEFT'); $where = array(); $where['person_id'] = $person_id; diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 99e5d4613..ff4dd95a4 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -195,18 +195,20 @@ class Prestudent_model extends DB_Model /** - * gets extended zgv data (with bezeichnung) for a prestudent + * gets extended zgv data (with zgv bezeichnung) for a prestudent * includes last status, Studiengang, zgv, zgv master * @param $prestudent_id */ public function getPrestudentWithZgv($prestudent_id) { $this->addSelect('tbl_prestudent.*, tbl_studiengang.kurzbzlang as studiengang, tbl_studiengang.typ as studiengangtyp, tbl_zgv.zgv_code, tbl_zgv.zgv_bez, - tbl_prestudent.zgvort, tbl_prestudent.zgvdatum, tbl_prestudent.zgvnation as zgvnation_code, - tbl_zgvmaster.zgvmas_code, tbl_zgvmaster.zgvmas_bez, tbl_prestudent.zgvmaort, tbl_prestudent.zgvmadatum, tbl_prestudent.zgvmanation as zgvmanation_code'); + tbl_prestudent.zgvort, tbl_prestudent.zgvdatum, tbl_prestudent.zgvnation as zgvnation_code, zgvnat.kurztext as zgvnation_kurzbez, zgvnat.langtext as zgvnation_bez, zgvnat.engltext as zgvnation_englbez, + tbl_zgvmaster.zgvmas_code, tbl_zgvmaster.zgvmas_bez, tbl_prestudent.zgvmaort, tbl_prestudent.zgvmadatum, tbl_prestudent.zgvmanation as zgvmanation_code, zgvmanat.kurztext as zgvmanation_kurzbez, zgvmanat.langtext as zgvmanation_bez, zgvmanat.engltext as zgvmanation_englbez'); $this->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT'); $this->addJoin('bis.tbl_zgv', 'zgv_code', 'LEFT'); $this->addJoin('bis.tbl_zgvmaster', 'zgvmas_code', 'LEFT'); + $this->addJoin('bis.tbl_nation zgvnat', 'zgvnation = zgvnat.nation_code', 'LEFT'); + $this->addJoin('bis.tbl_nation zgvmanat', 'zgvmanation = zgvmanat.nation_code', 'LEFT'); $prestudent = $this->load($prestudent_id); if($prestudent->error) @@ -221,7 +223,8 @@ class Prestudent_model extends DB_Model return error($lastStatus->retval); } - $prestudent->retval[0]->prestudentstatus = $lastStatus->retval[0]; + if(count($lastStatus->retval) > 0) + $prestudent->retval[0]->prestudentstatus = $lastStatus->retval[0]; return success($prestudent->retval); } diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index 3ec142ca4..61f935d19 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -108,9 +108,10 @@ class Notiz_model extends DB_Model $result = $this->insert(array('titel' => $titel, 'text' => $text, 'erledigt' => $erledigt, 'verfasser_uid' => $verfasser_uid, "insertvon" => $verfasser_uid)); - $notiz_id = $result->retval; + if (isSuccess($result)) { + $notiz_id = $result->retval; $result = $this->NotizzuordnungModel->insert(array('notiz_id' => $notiz_id, 'person_id' => $person_id)); } diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index d52cba6ce..19e9dc1d9 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -1,12 +1,12 @@ load->view('templates/FHC-Header', array('title' => 'InfocenterDetails', 'jquery3' => true, 'bootstrap' => true, 'fontawesome' => true, 'bootstrapdatepicker' => true, 'datatables' => true, 'customCSSs' => 'vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/css/sb-admin-2.min.css')); +$this->load->view('templates/FHC-Header', array('title' => 'InfocenterDetails', 'jquery3' => true, 'bootstrap' => true, 'fontawesome' => true, 'bootstrapdatepicker' => true, 'datatables' => true, 'sbadmintemplate' => true)); ?>
-Nachzureichende Dokumente:
-| Typ | -Eintragsdatum | -Nachzureichen am | -Anmerkung | - - - -
|---|---|---|---|
| dokument_bezeichnung ?> | -erstelltam), 'd.m.Y') ?> | -- nachgereicht_am) ? date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : ''; ?> - | -- anmerkung; ?> - | -
Nachzureichende Dokumente:
+| Typ | +Nachzureichen am | +Ausstellungsnation | +Anmerkung | + + + +
|---|---|---|---|
| dokument_bezeichnung ?> | ++ nachgereicht_am) ? date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : ''; ?> + | ++ langtext ?> + | + ++ anmerkung; ?> + | +