From 04038a09a652e193f35abc990c8d2c017bcc9805 Mon Sep 17 00:00:00 2001 From: Gerald Raab Date: Sun, 26 Feb 2017 17:57:38 +0100 Subject: [PATCH 01/11] Additional Funcion for Bewerbertool-Notiz: Ausbildung --- include/notiz.class.php | 120 +++++++++++++++++++++++++++++----------- 1 file changed, 87 insertions(+), 33 deletions(-) mode change 100644 => 100755 include/notiz.class.php diff --git a/include/notiz.class.php b/include/notiz.class.php old mode 100644 new mode 100755 index d68e3f254..08ba10e41 --- a/include/notiz.class.php +++ b/include/notiz.class.php @@ -49,7 +49,7 @@ class notiz extends basis_db public $bestellung_id; public $lehreinheit_id; public $anrechnung_id; - + /** * Konstruktor * @param $notiz_id @@ -94,7 +94,7 @@ class notiz extends basis_db $this->updateamum=$row->updateamum; $this->updatevon=$row->updatevon; $this->getDokumente($row->notiz_id); - + return true; } else @@ -109,7 +109,7 @@ class notiz extends basis_db return false; } } - + /** * Löscht eine Notiz * @param $notiz_id @@ -122,13 +122,13 @@ class notiz extends basis_db $this->errormsg = 'NotizID ist ungueltig'; return false; } - + // Dokumente der Notiz löschen $this->getDokumente($notiz_id); if(!empty($this->dokumente)) { $dms = new dms(); - + foreach($this->dokumente as $dms_id) { $dms->deleteDms($dms_id); @@ -142,8 +142,8 @@ class notiz extends basis_db $this->errormsg = 'Fehler beim Loeschen der Daten'; return false; } - return true; - } + return true; + } /** * Prueft die Daten vor dem Speichern @@ -152,7 +152,7 @@ class notiz extends basis_db public function validate() { return true; - } + } /** * Speichert den aktuellen Datensatz in die Datenbank @@ -239,11 +239,11 @@ class notiz extends basis_db /** * Speichert die Zuordnung einer Notiz - * + * */ public function saveZuordnung() { - $qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id, + $qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id, uid, person_id, prestudent_id, bestellung_id, lehreinheit_id, anrechnung_id) VALUES(". $this->db_add_param($this->notiz_id, FHC_INTEGER).','. $this->db_add_param($this->projekt_kurzbz).','. @@ -255,7 +255,7 @@ class notiz extends basis_db $this->db_add_param($this->bestellung_id, FHC_INTEGER).','. $this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','. $this->db_add_param($this->anrechnung_id, FHC_INTEGER).');'; - + if($this->db_query($qry)) { return true; @@ -266,18 +266,18 @@ class notiz extends basis_db return false; } } - + /** * Speichert ein Dokument zur Notiz * @param int $dms_id * @return boolean */ - public function saveDokument($dms_id) + public function saveDokument($dms_id) { $qry = "INSERT INTO public.tbl_notiz_dokument(notiz_id, dms_id) VALUES(". $this->db_add_param($this->notiz_id, FHC_INTEGER).','. $this->db_add_param($dms_id, FHC_INTEGER).');'; - + if($this->db_query($qry)) { return true; @@ -290,7 +290,7 @@ class notiz extends basis_db } /** - * + * * Laedt die Notizen * @param $erledigt * @param $projekt_kurzbz @@ -320,13 +320,13 @@ class notiz extends basis_db $anrechnung_id=null, $titel=null) { - $qry = "SELECT - * - FROM - public.tbl_notiz + $qry = "SELECT + * + FROM + public.tbl_notiz LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) WHERE 1=1"; - + if(!is_null($erledigt)) { if($erledigt) @@ -358,13 +358,13 @@ class notiz extends basis_db $qry.=" AND titel=".$this->db_add_param($titel); $qry.=' ORDER BY start, ende, titel'; - + if($result = $this->db_query($qry)) { while($row = $this->db_fetch_object($result)) { $obj = new notiz(); - + $obj->notiz_id=$row->notiz_id; $obj->titel=$row->titel; $obj->text=$row->text; @@ -378,7 +378,7 @@ class notiz extends basis_db $obj->updateamum=$row->updateamum; $obj->updatevon=$row->updatevon; $obj->getDokumente($row->notiz_id); - + $this->result[] = $obj; } return true; @@ -405,7 +405,7 @@ class notiz extends basis_db LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) . ' AND (insertvon = ' . $this->db_add_param('online') .' OR insertvon = ' . $this->db_add_param('online_notiz').') - + ORDER BY notiz_id'; if($result = $this->db_query($qry)) @@ -438,9 +438,63 @@ class notiz extends basis_db } } + + /** + * TEMPORARY: kurzfristig wird für das Onlinebewerbungstool die Ausbildung + * (Name und Adresse der besuchten Schule) in eine Notiz mit + * insertvon = online_ausbildung gespeichert. + * Wird auf UDF umgebaut! + * + * Laedt die Notizen zur Ausbilund vom Bewerbungstool + * @param $person_id int + * @return boolean + */ + public function getBewerbungstoolNotizenAusbildung($person_id) + { + $qry = 'SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) . + ' AND insertvon = ' . $this->db_add_param('online_ausbildung') . + ' ORDER BY notiz_id'; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + + /** - * + * * Laedt die Notizen * @param $erledigt @@ -458,13 +512,13 @@ class notiz extends basis_db */ public function getAnzahlNotizen($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $anrechnung_id=null) { - $qry = "SELECT + $qry = "SELECT count(*) as anzahl - FROM - public.tbl_notiz + FROM + public.tbl_notiz LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) WHERE 1=1"; - + if(!is_null($erledigt)) { if($erledigt) @@ -492,7 +546,7 @@ class notiz extends basis_db $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); if($anrechnung_id!='') $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); - + if($result = $this->db_query($qry)) { if($row = $this->db_fetch_object($result)) @@ -509,12 +563,12 @@ class notiz extends basis_db return false; } } - + /** * Laedt die Dokumente der Notiz * @return boolean */ - public function getDokumente($notiz_id) + public function getDokumente($notiz_id) { $qry = "SELECT dms_id FROM public.tbl_notiz_dokument WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); @@ -524,7 +578,7 @@ class notiz extends basis_db { $this->dokumente[] = $row->dms_id; } - + return true; } else From 8578ee8ace4d7443d958cf23e33cd043be58e221 Mon Sep 17 00:00:00 2001 From: oesi Date: Mon, 27 Feb 2017 13:31:36 +0100 Subject: [PATCH 02/11] =?UTF-8?q?Reihungstests:=20-=20Punkteingabe=20bei?= =?UTF-8?q?=20Gesamtpunkte=20und=20RTPunkte=20mit=20,=20m=C3=B6glich=20sta?= =?UTF-8?q?tt=20mit=20.=20-=20Punkte=C3=BCbernahme=20rundet=20die=20Punkte?= =?UTF-8?q?=20auf=202=20Nachkommastellen=20Pr=C3=BCfung:=20-=20Punkteeinga?= =?UTF-8?q?be=20mit=20,=20statt=20.=20m=C3=B6glich?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/student/studentDBDML.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/content/student/studentDBDML.php b/content/student/studentDBDML.php index f8936b0b3..f9bd57117 100644 --- a/content/student/studentDBDML.php +++ b/content/student/studentDBDML.php @@ -3254,7 +3254,7 @@ if(!$error) $pruefung->mitarbeiter_uid = $_POST['mitarbeiter_uid']; $pruefung->note = $_POST['note']; if(isset($_POST['punkte'])) - $pruefung->punkte = $_POST['punkte']; + $pruefung->punkte = str_replace(',','.',$_POST['punkte']); $pruefung->pruefungstyp_kurzbz = $_POST['pruefungstyp_kurzbz']; $pruefung->datum = $_POST['datum']; $pruefung->anmerkung = $_POST['anmerkung']; @@ -3331,7 +3331,7 @@ if(!$error) $zeugnisnote->studiensemester_kurzbz = $studiensemester_kurzbz; $zeugnisnote->note = $_POST['note']; if(isset($_POST['punkte'])) - $zeugnisnote->punkte = $_POST['punkte']; + $zeugnisnote->punkte = str_replace(',','.',$_POST['punkte']); else $zeugnisnote->punkte=''; $zeugnisnote->uebernahmedatum = date('Y-m-d H:i:s'); @@ -3774,6 +3774,9 @@ if(!$error) $data = $pruefling->getReihungstestErgebnisPerson($_POST['person_id'], true, $_POST['reihungstest_id']); else $data = $pruefling->getReihungstestErgebnisPerson($_POST['person_id'], false, $_POST['reihungstest_id']); + + // Runden auf 2 Nachkommastellen + $data = number_format($data, 2, '.',''); $return = true; } else @@ -3892,7 +3895,7 @@ if(!$error) $person_id = $_POST['person_id']; if($person_id=='') $person_id=$prestudent->person_id; - $punkte = $_POST['punkte']; + $punkte = str_replace(',','.',$_POST['punkte']); $teilgenommen = ($_POST['teilgenommen']=='true'?true:false); $anmeldedatum = $_POST['anmeldedatum']; $studienplan_id = $_POST['studienplan_id']; @@ -4049,7 +4052,7 @@ if(!$error) } else { - $punkte = $_POST['punkte']; + $punkte = str_replace(',','.',$_POST['punkte']); $reihungstestangetreten = ($_POST['reihungstestangetreten']=='true'?true:false); $prestudent->punkte = $punkte; $prestudent->reihungstestangetreten = $reihungstestangetreten; From c8b4f56b40bb7194af198cca5a2f561bc15c794e Mon Sep 17 00:00:00 2001 From: oesi Date: Mon, 27 Feb 2017 16:44:45 +0100 Subject: [PATCH 03/11] Corrected Addon Template Install permissions --- addons/template/dbcheck.php | 4 ++-- addons/template/install.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/template/dbcheck.php b/addons/template/dbcheck.php index 46fc9dc22..a5f9e8b30 100644 --- a/addons/template/dbcheck.php +++ b/addons/template/dbcheck.php @@ -45,7 +45,7 @@ $uid = get_uid(); $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($uid); -if(!$rechte->isBerechtigt('basis/addon')) +if(!$rechte->isBerechtigt('basis/addon', null, 'suid')) { exit('Sie haben keine Berechtigung für die Verwaltung von Addons'); } @@ -66,7 +66,7 @@ if(!$result = @$db->db_query("SELECT 1 FROM addon.tbl_template_items")) if(!$db->db_query($qry)) echo 'addon.tbl_template_items: '.$db->db_last_error().'
'; - else + else echo ' addon.tbl_template_items: Tabelle addon.template_items hinzugefuegt!
'; } diff --git a/addons/template/install.php b/addons/template/install.php index e0b328291..d9644bd3e 100644 --- a/addons/template/install.php +++ b/addons/template/install.php @@ -43,7 +43,7 @@ $uid = get_uid(); $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($uid); -if(!$rechte->isBerechtigt('basis/addon')) +if(!$rechte->isBerechtigt('basis/addon', null, 'suid')) { exit('Sie haben keine Berechtigung für die Verwaltung von Addons'); } From ae9557fb25facc5bbb8b52238eeb567908c1b84a Mon Sep 17 00:00:00 2001 From: oesi Date: Wed, 1 Mar 2017 15:12:36 +0100 Subject: [PATCH 04/11] =?UTF-8?q?Im=20Profil=20wird=20das=20Personenkennze?= =?UTF-8?q?ichen=20bei=20Dummy=20Studieng=C3=A4ngen=20(stgkz=20>=2010000)?= =?UTF-8?q?=20nicht=20mehr=20angezeigt=20da=20es=20sich=20hierbei=20um=20k?= =?UTF-8?q?ein=20offizielles=20Perskz=20handelt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/profile/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php index 3800f8124..1fe096d0c 100644 --- a/cis/private/profile/index.php +++ b/cis/private/profile/index.php @@ -291,8 +291,10 @@ if ($type=='student' && (!defined('CIS_PROFIL_STUDIENINFORMATION_ANZEIGEN') || C ".$p->t('global/studiengang').": $studiengang->bezeichnung
".$p->t('global/semester').": $user->semester ".$p->t('benotungstool/liste')."
".$p->t('global/verband').": $user->verband ".($user->verband!=' '?"".$p->t('benotungstool/liste')."":"")."
- ".$p->t('global/gruppe').": $user->gruppe ".($user->gruppe!=' '?"".$p->t('benotungstool/liste')."":"")."
- ".$p->t('profil/martrikelnummer').": $user->matrikelnr
"; + ".$p->t('global/gruppe').": $user->gruppe ".($user->gruppe!=' '?"".$p->t('benotungstool/liste')."":"")."
"; + + if($user->studiengang_kz<10000) + echo $p->t('profil/martrikelnummer').": $user->matrikelnr
"; } if ($type=='mitarbeiter') From 1c8a5bc836e6f447c3d6e4a178409f621898a213 Mon Sep 17 00:00:00 2001 From: bison-paolo Date: Wed, 1 Mar 2017 16:12:56 +0100 Subject: [PATCH 05/11] - Removed message_model_old.php - Bug fix in MessageLib - Now is possible to send a message to more recipients from FAS - Can be used the variables substitution from FAS --- .../models/system/message_model_old.php | 511 ------------------ 1 file changed, 511 deletions(-) delete mode 100644 application/models/system/message_model_old.php diff --git a/application/models/system/message_model_old.php b/application/models/system/message_model_old.php deleted file mode 100644 index 8b564ed4e..000000000 --- a/application/models/system/message_model_old.php +++ /dev/null @@ -1,511 +0,0 @@ -db->trans_start(); - - $thread_id = $this->_insert_thread($subject); - $msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority); - - // Create batch inserts - $participants[] = array('thread_id' => $thread_id,'user_id' => $sender_id); - $statuses[] = array('message_id' => $msg_id, 'user_id' => $sender_id,'status' => MSG_STATUS_READ); - - if ( ! is_array($recipients)) - { - $participants[] = array('thread_id' => $thread_id,'user_id' => $recipients); - $statuses[] = array('message_id' => $msg_id, 'user_id' => $recipients, 'status' => MSG_STATUS_UNREAD); - } - else - { - foreach ($recipients as $recipient) - { - $participants[] = array('thread_id' => $thread_id,'user_id' => $recipient); - $statuses[] = array('message_id' => $msg_id, 'user_id' => $recipient, 'status' => MSG_STATUS_UNREAD); - } - } - - $this->_insert_participants($participants); - $this->_insert_statuses($statuses); - - $this->db->trans_complete(); - - if ($this->db->trans_status() === FALSE) - { - $this->db->trans_rollback(); - return FALSE; - } - - return $thread_id; - } - - // ------------------------------------------------------------------------ - - /** - * Reply to Message - * - * @param integer $reply_msg_id - * @param integer $sender_id - * @param string $body - * @param integer $priority - * @return integer $new_msg_id - */ - function reply_to_message($reply_msg_id, $sender_id, $body, $priority) - { - $this->db->trans_start(); - - // Get the thread id to keep messages together - if ( ! $thread_id = $this->_get_thread_id_from_message($reply_msg_id)) - { - return FALSE; - } - - // Add this message - $msg_id = $this->_insert_message($thread_id, $sender_id, $body, $priority); - - if ($recipients = $this->_get_thread_participants($thread_id, $sender_id)) - { - $statuses[] = array('message_id' => $msg_id, 'user_id' => $sender_id,'status' => MSG_STATUS_READ); - - foreach ($recipients as $recipient) - { - $statuses[] = array('message_id' => $msg_id, 'user_id' => $recipient['user_id'], 'status' => MSG_STATUS_UNREAD); - } - - $this->_insert_statuses($statuses); - } - - $this->db->trans_complete(); - - if ($this->db->trans_status() === FALSE) - { - $this->db->trans_rollback(); - return FALSE; - } - - return $msg_id; - } - - // ------------------------------------------------------------------------ - - /** - * Get a Single Message - * - * @param integer $msg_id - * @param integer $user_id - * @return array - */ - function get_message($msg_id, $user_id) - { - $sql = 'SELECT m.*, s.status, t.subject, ' . USER_TABLE_USERNAME . - ' FROM ' . $this->db->dbprefix . 'msg_messages m ' . - ' JOIN ' . $this->db->dbprefix . 'msg_threads t ON (m.thread_id = t.id) ' . - ' JOIN ' . $this->db->dbprefix . USER_TABLE_TABLENAME . ' ON (' . USER_TABLE_ID . ' = m.sender_id) '. - ' JOIN ' . $this->db->dbprefix . 'msg_status s ON (s.message_id = m.id AND s.user_id = ? ) ' . - ' WHERE m.id = ? ' ; - - $query = $this->db->query($sql, array($user_id, $msg_id)); - - return $query->result_array(); - } - - // ------------------------------------------------------------------------ - - /** - * Get a Full Thread - * - * @param integer $thread_id - * @param integer $user_id - * @param boolean $full_thread - * @param string $order_by - * @return array - */ - function get_full_thread($thread_id, $user_id, $full_thread = FALSE, $order_by = 'asc') - { - $sql = 'SELECT m.*, s.status, t.subject, '.USER_TABLE_USERNAME . - ' FROM ' . $this->db->dbprefix . 'msg_participants p ' . - ' JOIN ' . $this->db->dbprefix . 'msg_threads t ON (t.id = p.thread_id) ' . - ' JOIN ' . $this->db->dbprefix . 'msg_messages m ON (m.thread_id = t.id) ' . - ' JOIN ' . $this->db->dbprefix . USER_TABLE_TABLENAME . ' ON (' . USER_TABLE_ID . ' = m.sender_id) '. - ' JOIN ' . $this->db->dbprefix . 'msg_status s ON (s.message_id = m.id AND s.user_id = ? ) ' . - ' WHERE p.user_id = ? ' . - ' AND p.thread_id = ? '; - - if ( ! $full_thread) - { - $sql .= ' AND m.cdate >= p.cdate'; - } - - $sql .= ' ORDER BY m.cdate ' . $order_by; - - $query = $this->db->query($sql, array($user_id, $user_id, $thread_id)); - - return $query->result_array(); - } - - // ------------------------------------------------------------------------ - - /** - * Get All Threads - * - * @param integer $user_id - * @param boolean $full_thread - * @param string $order_by - * @return array - */ - function get_all_threads($user_id, $full_thread = FALSE, $order_by = 'asc') - { - $sql = 'SELECT m.*, s.status, t.subject, '.USER_TABLE_USERNAME . - ' FROM ' . $this->db->dbprefix . 'msg_participants p ' . - ' JOIN ' . $this->db->dbprefix . 'msg_threads t ON (t.id = p.thread_id) ' . - ' JOIN ' . $this->db->dbprefix . 'msg_messages m ON (m.thread_id = t.id) ' . - ' JOIN ' . $this->db->dbprefix . USER_TABLE_TABLENAME . ' ON (' . USER_TABLE_ID . ' = m.sender_id) '. - ' JOIN ' . $this->db->dbprefix . 'msg_status s ON (s.message_id = m.id AND s.user_id = ? ) ' . - ' WHERE p.user_id = ? ' ; - - if (!$full_thread) - { - $sql .= ' AND m.cdate >= p.cdate'; - } - - $sql .= ' ORDER BY t.id ' . $order_by. ', m.cdate '. $order_by; - - $query = $this->db->query($sql, array($user_id, $user_id)); - - return $query->result_array(); - } - - // ------------------------------------------------------------------------ - - /** - * Change Message Status - * - * @param integer $msg_id - * @param integer $user_id - * @param integer $status_id - * @return integer - */ - function update_message_status($msg_id, $user_id, $status_id) - { - $this->db->where(array('message_id' => $msg_id, 'user_id' => $user_id )); - $this->db->update('msg_status', array('status' => $status_id )); - - return $this->db->affected_rows(); - } - - // ------------------------------------------------------------------------ - - /** - * Add a Participant - * - * @param integer $thread_id - * @param integer $user_id - * @return boolean - */ - function add_participant($thread_id, $user_id) - { - $this->db->trans_start(); - - $participants[] = array('thread_id' => $thread_id,'user_id' => $user_id); - - $this->_insert_participants($participants); - - // Get Messages by Thread - $messages = $this->_get_messages_by_thread_id($thread_id); - - foreach ($messages as $message) - { - $statuses[] = array('message_id' => $message['id'], 'user_id' => $user_id, 'status' => MSG_STATUS_UNREAD); - } - - $this->_insert_statuses($statuses); - - $this->db->trans_complete(); - - if ($this->db->trans_status() === FALSE) - { - $this->db->trans_rollback(); - return FALSE; - } - - return TRUE; - } - - // ------------------------------------------------------------------------ - - /** - * Remove a Participant - * - * @param integer $thread_id - * @param integer $user_id - * @return boolean - */ - function remove_participant($thread_id, $user_id) - { - $this->db->trans_start(); - - $this->_delete_participant($thread_id, $user_id); - $this->_delete_statuses($thread_id, $user_id); - - $this->db->trans_complete(); - - if ($this->db->trans_status() === FALSE) - { - $this->db->trans_rollback(); - return FALSE; - } - - return TRUE; - } - - // ------------------------------------------------------------------------ - - /** - * Valid New Participant - because of CodeIgniter's DB Class return style, - * it is safer to check for uniqueness first - * - * @param integer $thread_id - * @param integer $user_id - * @return boolean - */ - function valid_new_participant($thread_id, $user_id) - { - $sql = 'SELECT COUNT(*) AS count ' . - ' FROM ' . $this->db->dbprefix . 'msg_participants p ' . - ' WHERE p.thread_id = ? ' . - ' AND p.user_id = ? '; - - $query = $this->db->query($sql, array($thread_id, $user_id)); - - if ($query->row()->count) - { - return FALSE; - } - - return TRUE; - } - - // ------------------------------------------------------------------------ - - /** - * Application User - * - * @param integer $user_id` - * @return boolean - */ - function application_user($user_id) - { - $sql = 'SELECT COUNT(*) AS count ' . - ' FROM ' . $this->db->dbprefix . USER_TABLE_TABLENAME . - ' WHERE ' . USER_TABLE_ID . ' = ?' ; - - $query = $this->db->query($sql, array($user_id)); - - if ($query->row()->count) - { - return TRUE; - } - - return FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Get Participant List - * - * @param integer $thread_id - * @param integer $sender_id - * @return mixed - */ - function get_participant_list($thread_id, $sender_id = 0) - { - if ($results = $this->_get_thread_participants($thread_id, $sender_id)) - { - return $results; - } - return FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Get Message Count - * - * @param integer $user_id - * @param integer $status_id - * @return integer - */ - function get_msg_count($user_id, $status_id = MSG_STATUS_UNREAD) - { - $query = $this->db->select('COUNT(*) AS msg_count')->where(array('user_id' => $user_id, 'status' => $status_id ))->get('msg_status'); - - return $query->row()->msg_count; - } - - // ------------------------------------------------------------------------ - // Private Functions from here out! - // ------------------------------------------------------------------------ - - /** - * Insert Thread - * - * @param string $subject - * @return integer - */ - private function _insert_thread($subject) - { - $insert_id = $this->db->insert('msg_threads', array('subject' => $subject)); - - return $this->db->insert_id(); - } - - /** - * Insert Message - * - * @param integer $thread_id - * @param integer $sender_id - * @param string $body - * @param integer $priority - * @return integer - */ - private function _insert_message($thread_id, $sender_id, $body, $priority) - { - $insert['thread_id'] = $thread_id; - $insert['sender_id'] = $sender_id; - $insert['body'] = $body; - $insert['priority'] = $priority; - - $insert_id = $this->db->insert('msg_messages', $insert); - - return $this->db->insert_id(); - } - - /** - * Insert Participants - * - * @param array $participants - * @return bool - */ - private function _insert_participants($participants) - { - return $this->db->insert_batch('msg_participants', $participants); - } - - /** - * Insert Statuses - * - * @param array $statuses - * @return bool - */ - private function _insert_statuses($statuses) - { - return $this->db->insert_batch('msg_status', $statuses); - } - - /** - * Get Thread ID from Message - * - * @param integer $msg_id - * @return integer - */ - private function _get_thread_id_from_message($msg_id) - { - $query = $this->db->select('thread_id')->get_where('msg_messages', array('id' => $msg_id)); - - if ($query->num_rows()) - { - return $query->row()->thread_id; - } - return 0; - } - - /** - * Get Messages by Thread - * - * @param integer $thread_id - * @return array - */ - private function _get_messages_by_thread_id($thread_id) - { - $query = $this->db->get_where('msg_messages', array('thread_id' => $thread_id)); - - return $query->result_array(); - } - - - /** - * Get Thread Particpiants - * - * @param integer $thread_id - * @param integer $sender_id - * @return array - */ - private function _get_thread_participants($thread_id, $sender_id = 0) - { - $array['thread_id'] = $thread_id; - - if ($sender_id) // If $sender_id 0, no one to exclude - { - $array['msg_participants.user_id != '] = $sender_id; - } - - $this->db->select('msg_participants.user_id, '.USER_TABLE_USERNAME, FALSE); - $this->db->join(USER_TABLE_TABLENAME, 'msg_participants.user_id = ' . USER_TABLE_ID); - - $query = $this->db->get_where('msg_participants', $array); - - return $query->result_array(); - } - - /** - * Delete Participant - * - * @param integer $thread_id - * @param integer $user_id - * @return boolean - */ - private function _delete_participant($thread_id, $user_id) - { - $this->db->delete('msg_participants', array('thread_id' => $thread_id, 'user_id' => $user_id)); - - if ($this->db->affected_rows() > 0) - { - return TRUE; - } - return FALSE; - } - - /** - * Delete Statuses - * - * @param integer $thread_id - * @param integer $user_id - * @return boolean - */ - private function _delete_statuses($thread_id, $user_id) - { - $sql = 'DELETE s FROM msg_status s ' . - ' JOIN ' . $this->db->dbprefix . 'msg_messages m ON (m.id = s.message_id) ' . - ' WHERE m.thread_id = ? ' . - ' AND s.user_id = ? '; - - $query = $this->db->query($sql, array($thread_id, $user_id)); - - return TRUE; - } -} - -/* end of file mahana_model.php */ From 0048d458b1652e29ac530c508474d76cfe5da03d Mon Sep 17 00:00:00 2001 From: oesi Date: Wed, 1 Mar 2017 16:15:49 +0100 Subject: [PATCH 06/11] Fehlerhafte HTTP Header korrigiert damit FAS mit Apache 2.4.10-10+deb8u8 funktioniert --- content/about.xul.php | 4 +- content/adressedialog.xul.php | 2 +- content/anwesenheit.xul.php | 8 +- content/bankverbindungdialog.xul.php | 14 +- content/betriebsmitteloverlay.xul.php | 6 +- content/funktionen.xul.php | 12 +- content/kontakt.xul.php | 2 +- content/kontaktdialog.xul.php | 18 +- .../lehrveranstaltungdetailoverlay.xul.php | 2 +- .../lehrveranstaltungnotenoverlay.xul.php | 2 +- .../lehrveranstaltungoverlay.xul.php | 10 +- content/lvplanung/ressourcedialog.xul.php | 2 +- content/lvplanung/stpl-details-dialog.xul.php | 40 +- .../lvplanung/stpl-details-overlay.xul.php | 46 +- content/messages.xul.php | 2 +- .../mitarbeiterbuchungoverlay.xul.php | 10 +- .../mitarbeiterdetailoverlay.xul.php | 18 +- .../mitarbeiterfunktionoverlay.xul.php | 16 +- .../mitarbeiter/mitarbeiteroverlay.xul.php | 2 +- .../mitarbeitervertragneudialog.xul.php | 24 +- .../mitarbeitervertragoverlay.xul.php | 2 +- .../mitarbeiterverwendungdialog.xul.php | 2 +- content/notizdialog.xul.php | 26 +- content/projekt/bestellung.overlay.xul.php | 2 +- content/projekt/gantt.overlay.xul.php | 12 +- content/projekt/gantt.svg.php | 456 +++++++++--------- content/projekt/mantisdetail.overlay.xul.php | 16 +- content/projekt/projekt.overlay.xul.php | 2 +- .../projekt/projekt_ressource.window.xul.php | 2 +- content/projekt/projektdetail.overlay.xul.php | 6 +- .../projekt/projektdokument.overlay.xul.php | 6 +- .../projekt/projektdokument.window.xul.php | 8 +- content/projekt/projektphase.overlay.xul.php | 4 +- .../projektphasedetail.overlay.xul.php | 24 +- content/projekt/projekttask.overlay.xul.php | 8 +- .../projekt/projekttaskdetail.overlay.xul.php | 8 +- content/projekt/ressource.overlay.xul.php | 8 +- content/projekt/ressource.window.xul.php | 12 +- content/student/aufnahmetermine.xul.php | 2 +- .../interessentdokumentedialog.xul.php | 14 +- .../interessentdokumenteoverlay.xul.php | 14 +- .../studentabschlusspruefungoverlay.xul.php | 2 +- .../studentanrechnungenoverlay.xul.php | 12 +- content/student/studentdetailoverlay.xul.php | 2 +- content/student/studentenoverlay.xul.php | 2 +- content/student/studentgruppenoverlay.xul.php | 6 +- content/student/studentiooverlay.xul.php | 20 +- content/student/studentkontoneudialog.xul.php | 22 +- content/student/studentkontooverlay.xul.php | 32 +- content/student/studentnotenoverlay.xul.php | 22 +- .../studentprojektarbeitoverlay.xul.php | 20 +- .../student/studentpruefungoverlay.xul.php | 2 +- content/student/studentrolledialog.xul.php | 2 +- content/student/studentzeugnisoverlay.xul.php | 2 +- content/termine.xul.php | 2 +- include/rdf.class.php | 36 +- rdf/abschlussbeurteilung.rdf.php | 4 +- rdf/abschlusspruefung.rdf.php | 2 +- rdf/akadgrad.rdf.php | 8 +- rdf/akte.rdf.php | 10 +- rdf/anrechnung.rdf.php | 2 +- rdf/anrechnungbegruendung.rdf.php | 2 +- rdf/anzahlAnwesenheitenStudenplan.rdf.php | 2 +- rdf/aufmerksamdurch.rdf.php | 6 +- rdf/aufnahmeschluessel.rdf.php | 2 +- rdf/ausbildung.rdf.php | 4 +- rdf/bankverbindung.rdf.php | 18 +- rdf/benutzerfunktion.rdf.php | 8 +- rdf/berufstaetigkeit.rdf.php | 4 +- rdf/beschaeftigungsart1.rdf.php | 4 +- rdf/beschaeftigungsart2.rdf.php | 4 +- rdf/beschaeftigungsausmass.rdf.php | 4 +- rdf/besonderequalifikation.rdf.php | 4 +- rdf/bestelldetail.rdf.php | 62 +-- rdf/betriebsmittel.rdf.php | 18 +- rdf/betriebsmittelperson.rdf.php | 38 +- rdf/betriebsmitteltyp.rdf.php | 4 +- rdf/bisfunktion.rdf.php | 8 +- rdf/bisio.rdf.php | 24 +- rdf/bisverwendung.rdf.php | 2 +- rdf/buchungstyp.rdf.php | 4 +- rdf/dokument.rdf.php | 60 +-- rdf/dokumentprestudent.rdf.php | 34 +- rdf/entwicklungsteam.rdf.php | 8 +- rdf/fachbereich.rdf.php | 6 +- rdf/fachbereich_menue.rdf.php | 24 +- rdf/firma.rdf.php | 2 +- rdf/funktion.rdf.php | 4 +- rdf/gemeinde.rdf.php | 8 +- rdf/hauptberuf.rdf.php | 4 +- rdf/interessentenbewerber.rdf.php | 24 +- rdf/kontakt.rdf.php | 12 +- rdf/kontakttyp.rdf.php | 10 +- rdf/konto.rdf.php | 2 +- rdf/lehrauftrag.xml.php | 82 ++-- rdf/lehreinheit-lvplan.rdf.php | 22 +- rdf/lehreinheit.rdf.php | 2 +- rdf/lehreinheitgruppe.rdf.php | 2 +- rdf/lehreinheitmitarbeiter.rdf.php | 2 +- rdf/lehrfach.rdf.php | 24 +- rdf/lehrform.rdf.php | 2 +- rdf/lehrfunktion.rdf.php | 2 +- rdf/lehrstunde.rdf.php | 18 +- rdf/lehrveranstaltung.rdf.php | 2 +- rdf/lehrveranstaltung_einheiten.rdf.php | 2 +- rdf/lektoren.rdf.php | 12 +- rdf/lvangebot.rdf.php | 2 +- rdf/lvgesamtnote.rdf.php | 18 +- rdf/lvinfo.rdf.php | 46 +- rdf/mantis.rdf.php | 2 +- rdf/mitarbeiter.rdf.php | 40 +- rdf/mobilitaetsprogramm.rdf.php | 2 +- rdf/nation.rdf.php | 2 +- rdf/note.rdf.php | 6 +- rdf/notiz.rdf.php | 8 +- rdf/organisationseinheit.rdf.php | 2 +- rdf/ort.rdf.php | 4 +- rdf/orte.rdf.php | 8 +- rdf/person.rdf.php | 8 +- rdf/personal.rdf.php | 2 +- rdf/prestudent.rdf.php | 2 +- rdf/projektarbeit.rdf.php | 14 +- rdf/projektbetreuer.rdf.php | 12 +- rdf/projekttyp.rdf.php | 6 +- rdf/pruefung.rdf.php | 2 +- rdf/pruefungstyp.rdf.php | 8 +- rdf/raumtyp.rdf.php | 2 +- rdf/ressource.rdf.php | 50 +- rdf/sprache.rdf.php | 4 +- rdf/standort.rdf.php | 24 +- rdf/student.rdf.php | 2 +- rdf/studiengang.rdf.php | 2 +- rdf/studiensemester.rdf.php | 2 +- rdf/undo.rdf.php | 2 +- rdf/verwendung.rdf.php | 4 +- rdf/zeugnis.rdf.php | 2 +- rdf/zeugnisnote.rdf.php | 22 +- rdf/zgv.rdf.php | 2 +- rdf/zgvmaster.rdf.php | 4 +- rdf/zweck.rdf.php | 4 +- skin/style.css.php | 11 +- soap/notiz.soap.php | 62 +-- soap/projekt.soap.php | 34 +- soap/projektphase.soap.php | 36 +- soap/projekttask.soap.php | 94 ++-- soap/ressource.soap.php | 24 +- soap/ressource_projekt.soap.php | 54 +-- soap/test.soap.php | 6 +- 148 files changed, 1158 insertions(+), 1159 deletions(-) diff --git a/content/about.xul.php b/content/about.xul.php index bb94a0dad..896e4a005 100644 --- a/content/about.xul.php +++ b/content/about.xul.php @@ -22,7 +22,7 @@ header("Cache-Control: no-cache"); header("Cache-Control: post-check=0, pre-check=0",false); -header("Expires Mon, 26 Jul 1997 05:00:00 GMT"); +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Pragma: no-cache"); header("Content-type: application/vnd.mozilla.xul+xml"); @@ -67,7 +67,7 @@ echo ''; You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - + Authors: Christian Paminger <christian.paminger@technikum-wien.at>, Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>, Rudolf Hangl <rudolf.hangl@technikum-wien.at>, diff --git a/content/adressedialog.xul.php b/content/adressedialog.xul.php index 11dfdd915..9cac357de 100644 --- a/content/adressedialog.xul.php +++ b/content/adressedialog.xul.php @@ -22,7 +22,7 @@ header("Cache-Control: no-cache"); header("Cache-Control: post-check=0, pre-check=0",false); -header("Expires Mon, 26 Jul 1997 05:00:00 GMT"); +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Pragma: no-cache"); header("Content-type: application/vnd.mozilla.xul+xml"); diff --git a/content/anwesenheit.xul.php b/content/anwesenheit.xul.php index 7fc6f177e..f38044865 100644 --- a/content/anwesenheit.xul.php +++ b/content/anwesenheit.xul.php @@ -19,7 +19,7 @@ */ header("Cache-Control: no-cache"); header("Cache-Control: post-check=0, pre-check=0",false); -header("Expires Mon, 26 Jul 1997 05:00:00 GMT"); +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Pragma: no-cache"); header("Content-type: application/vnd.mozilla.xul+xml"); @@ -32,7 +32,7 @@ echo ' $student_uid = filter_input(INPUT_GET,'student_uid'); $lehrveranstaltung_id= filter_input(INPUT_GET,'lehrveranstaltung_id'); - + ?> - +