diff --git a/application/models/crm/Prestudentstatus_model.php b/application/models/crm/Prestudentstatus_model.php index ddeeba20c..6405569db 100644 --- a/application/models/crm/Prestudentstatus_model.php +++ b/application/models/crm/Prestudentstatus_model.php @@ -24,15 +24,6 @@ class Prestudentstatus_model extends DB_Model $this->dbTable = 'public.tbl_prestudentstatus'; $this->pk = array('ausbildungssemester', 'studiensemester_kurzbz', 'status_kurzbz', 'prestudent_id'); $this->hasSequence = false; - -/* $CI =& get_instance(); - - $CI->load->library('PhrasesLib'); - - // Load language phrases - $CI->loadPhrases([ - 'ui', 'lehre' - ]);*/ } /** @@ -390,20 +381,6 @@ class Prestudentstatus_model extends DB_Model return success(false, $this->p->t('lehre', 'anzahl_existingRoles', ['anzahl' => $anzahl])); } - /** - * Check if there is only one "Student" prestudentstatus left - * - * @param integer $prestudent_id - * - * @return stdClass - */ - public function checkIfLastStudentStatusEntry($prestudent_id) - { - $this->db->where('status_kurzbz', self::STATUS_STUDENT); - - return $this->checkIfLastStatusEntry($prestudent_id); - } - public function getAllPrestudentstatiWithStudiensemester($prestudent_id) { $qry = " diff --git a/application/models/crm/Student_model.php b/application/models/crm/Student_model.php index fec72cbfc..adeef07fc 100644 --- a/application/models/crm/Student_model.php +++ b/application/models/crm/Student_model.php @@ -176,34 +176,6 @@ class Student_model extends DB_Model return $result->retval[0]->student_uid; } - /** - * Get students UID by PrestudentID. - * @param $prestudent_id - * @return mixed - */ - public function checkIfUID($prestudent_id) - { - $this->addSelect('student_uid'); - - $result = $this->loadWhere( - array('prestudent_id' => $prestudent_id) - ); - - if(isError($result)) - { - return error("Error while checking student_uid"); - } - - if (!hasData($result)) - { - return success("0", "Keine Student_uid vorhanden"); - } - - $student_uid = $result->retval[0]->student_uid; - - return success($student_uid); - } - public function searchStudent($filter) { $this->addSelect('vorname, nachname, gebdatum, person.person_id, student_uid'); diff --git a/application/models/education/Studentlehrverband_model.php b/application/models/education/Studentlehrverband_model.php index e3c96c2ac..e4eabe89d 100644 --- a/application/models/education/Studentlehrverband_model.php +++ b/application/models/education/Studentlehrverband_model.php @@ -15,42 +15,6 @@ class Studentlehrverband_model extends DB_Model $this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel'); } - /** - * Check if Studentlehrverband already exists - * - * @param string $student_id - * - * @param string $studiensemester_kurzbz - * - * @return 1: if Studentlehrverband exists, 0: if it doesn't - */ - public function checkIfStudentlehrverbandExists($student_uid, $studiensemester_kurzbz) - { - $qry = "SELECT - * - FROM - public.tbl_studentlehrverband - WHERE - student_uid = ? - AND - studiensemester_kurzbz = ?"; - - $result = $this->execQuery($qry, array($student_uid, $studiensemester_kurzbz)); - - if (isError($result)) - { - return error($result); - } - elseif (!hasData($result)) - { - return success("0", $this->p->t('lehre', 'error_noStudentlehrverband')); - } - else - { - return success("1", $this->p->t('lehre', 'error_updateStudentlehrverband')); - } - } - /** * update Lehrverband and Studenlehrverband * diff --git a/application/models/organisation/Standort_model.php b/application/models/organisation/Standort_model.php index d46dad1c6..aeeab4497 100644 --- a/application/models/organisation/Standort_model.php +++ b/application/models/organisation/Standort_model.php @@ -29,23 +29,6 @@ class Standort_model extends DB_Model return $this->execQuery($qry); } -/* public function searchStandorteByFirma($filter) - { - $filter = strtoLower($filter); - $qry = " - SELECT - s.kurzbz, s.standort_id - FROM - public.tbl_firma f - LEFT JOIN - public.tbl_standort s ON(f.firma_id = s.firma_id) - WHERE - f.firma_id = '". $this->db->escape_like_str($filter)."'"; - - - return $this->execQuery($qry); - }*/ - public function getStandorteByFirma($firma_id) { $this->addSelect("DISTINCT ON (standort_id) bezeichnung, standort_id"); diff --git a/application/models/person/Adresse_model.php b/application/models/person/Adresse_model.php index cc6d68673..4dd03ea6b 100644 --- a/application/models/person/Adresse_model.php +++ b/application/models/person/Adresse_model.php @@ -24,51 +24,4 @@ class Adresse_model extends DB_Model $this->addSelect($select); return $this->loadWhere(array('person_id' => $person_id, 'zustelladresse'=> true)); } - - /** - * Get Array of Names of Gemeinden having Postleitzahl - * @param integer $plz Postleitzahl - * @return array $result[] - */ - public function getGemeinden($plz) - { - $qry = " - SELECT distinct - g.name - FROM bis.tbl_gemeinde g - WHERE g.plz=? - ORDER BY g.name - "; - - return $this->execQuery($qry, array($plz)); - } - - /** - * Get Array of Names of Ortschaften having Postleitzahl - * @param integer $plz Postleitzahl - * @param String $gemeindename Name Gemeinde - * @return array $result[] - */ - public function getOrtschaften($plz, $gemeinde=null) - { - $params = array($plz); - $qry = " - SELECT distinct - g.ortschaftsname - FROM bis.tbl_gemeinde g - WHERE g.plz=? "; - - if (isset($gemeinde)) - { - $qry .= "AND g.name=?"; - $params[] = $gemeinde; - } - - $qry .= "ORDER BY g.ortschaftsname"; - - return $this->execQuery($qry, $params); - } -} - - - +} \ No newline at end of file diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index d3bed7e56..349eaac60 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -133,141 +133,6 @@ class Notiz_model extends DB_Model return $result; } - /** - * Add a Notiz with Notizuordnung for a given type - * @param type type of id for Notizzuordnung (example: person, prestudent, mitarbeiter, projekt, projektphase, projekttask, - * bestellung, lehreinheit, anrechnung) - * @param id for Dokumentzuordnung (person_id, prestudent_id, uid, projekt_id...) - * @param titel, text, start, ende, erledigt, verfasser_uid, bearbeiter_uid, insertvon Parameter for notiz - */ - public function addNotizForType( - $type, - $id, - $titel, - $text, - $insertvon, - $start = null, - $ende = null, - $erledigt = false, - $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'); - - //check if valid type - $result = $this->NotizzuordnungModel->isValidType($type); - if (isError($result)) - { - $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - return error($type . ' ist kein gültiger ID_TYP!'); - } - - // Start DB transaction - $this->db->trans_start(false); - - $result = $this->insert(array('titel' => $titel, 'text' => $text, 'erledigt' => $erledigt, 'verfasser_uid' => $verfasser_uid, - "insertvon" => $insertvon, 'start' => $start, 'ende' => $ende, 'bearbeiter_uid' => $bearbeiter_uid)); - - if (isSuccess($result)) - { - $notiz_id = $result->retval; - - if($type == "software_id") - { - // Loads extension Model - $this->load->model('extensions/FHC-Core-Softwarebereitstellung/Softwarenotizzuordnung_model', 'ExtensionnotizzuordnungModel'); - $result = $this->ExtensionnotizzuordnungModel->insert([ - 'notiz_id' => $notiz_id, - 'id' => $id, - 'type_id' => $type - ]); - } - else - { - $result = $this->NotizzuordnungModel->insert(array('notiz_id' => $notiz_id, $type => $id)); - } - if (isError($result)) - { - $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); - return error('Fehler Insert Zuordnungstabelle'); - } - } - - - // 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; - } - - /** - * Add a Notiz for a given person with DMS_id - * - */ - //Todo(manu) deprecated? -/* public function addNotizForPersonWithDoc($person_id, $titel, $text, $erledigt, $verfasser_uid, $von, $bis, $dms_id = null) - { - // 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, 'start' => $von, 'ende' => $bis)); - - if (isSuccess($result)) - { - $notiz_id = $result->retval; - $result = $this->NotizzuordnungModel->insert(array('notiz_id' => $notiz_id, 'person_id' => $person_id)); - - if($dms_id) - { - // Loads model Notizdokument_model - $this->load->model('person/Notizdokument_model', 'NotizdokumentModel'); - - $result = $this->NotizdokumentModel->insert(array('notiz_id' => $notiz_id, 'dms_id' => $dms_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 diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 31b7b03b7..88813220e 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -374,6 +374,5 @@ class Person_model extends DB_Model 'prestudent_id' => $prestudent_id ]); } - }