diff --git a/FHC-vendor/jquery-tablesorter/package.json b/FHC-vendor/jquery-tablesorter/package.json index b16fcb45e..110042959 100644 --- a/FHC-vendor/jquery-tablesorter/package.json +++ b/FHC-vendor/jquery-tablesorter/package.json @@ -56,7 +56,7 @@ ] }, "devDependencies": { - "grunt": "^0.4.5", + "grunt": "^1.3.0", "grunt-cli": "~0.1.13", "grunt-contrib-clean": "^0.7.0", "grunt-contrib-concat": "^0.5.1", diff --git a/application/controllers/jobs/LehrauftragJob.php b/application/controllers/jobs/LehrauftragJob.php index 4ba327a2f..7f5754595 100644 --- a/application/controllers/jobs/LehrauftragJob.php +++ b/application/controllers/jobs/LehrauftragJob.php @@ -383,8 +383,8 @@ class LehrauftragJob extends JOB_Controller } // Else if UID exists else { - // Search if studiensemester exists - $ss_index = array_search($data['studiensemester_kurzbz'], array_column($mail_data_arr, 'studiensemester_kurzbz')); + // Search if studiensemester exists inside the existing UID array + $ss_index = array_search($data['studiensemester_kurzbz'], array_column($mail_data_arr[$uid_index], 'studiensemester_kurzbz')); // If studiensemester is new, add studiensemester to existing UID if ($ss_index === false) @@ -394,13 +394,6 @@ class LehrauftragJob extends JOB_Controller $data[$i] ); } - // Else if studiensemester exists - else - { - // Add corresponding data to existing studiensemester of UID - $mail_data_arr[$uid_index]['studiensemester_kurbz'][] = $data[$i]; - } - } } } diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 43de8bb60..7d36690e7 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -70,6 +70,7 @@ class InfoCenter extends Auth_Controller const INTERESSENTSTATUS = 'Interessent'; const ABGEWIESENERSTATUS = 'Abgewiesener'; const BEWERBERSTATUS = 'Bewerber'; + const WARTENDER = 'Wartender'; // Statusgruende for which no Studiengangsfreigabemessage should be sent private $_statusgruendeNoStgFreigabeMessage = array('FIT Programm', 'FIT program', 'FIT programme'); @@ -108,7 +109,9 @@ class InfoCenter extends Auth_Controller 'setOnHold' => 'infocenter:rw', 'removeOnHold' => 'infocenter:rw', 'getStudienjahrEnd' => 'infocenter:r', - 'setNavigationMenuArrayJson' => 'infocenter:r' + 'setNavigationMenuArrayJson' => 'infocenter:r', + 'getAbsageData' => 'infocenter:r', + 'saveAbsageForAll' => 'infocenter:rw' ) ); @@ -433,11 +436,14 @@ class InfoCenter extends Auth_Controller * Saves Absage for Prestudent including the reason for the Absage (statusgrund). * inserts Studiensemester and Ausbildungssemester for the new Absage of (chronologically) last status. */ - public function saveAbsage() + public function saveAbsage($prestudent_id = null, $statusgrund = null) { $json = null; - $prestudent_id = $this->input->post('prestudent_id'); - $statusgrund = $this->input->post('statusgrund'); + if (is_null($prestudent_id)) + $prestudent_id = $this->input->post('prestudent_id'); + + if (is_null($statusgrund)) + $statusgrund = $this->input->post('statusgrund'); $lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id); @@ -446,8 +452,10 @@ class InfoCenter extends Auth_Controller if (hasData($lastStatus) && hasData($statusgrresult)) { - //check if still Interessent and not freigegeben yet - if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS && !isset($lastStatus->retval[0]->bestaetigtam)) + //check if still Interessent + if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS + || $lastStatus->retval[0]->status_kurzbz === self::BEWERBERSTATUS + || $lastStatus->retval[0]->status_kurzbz === self::WARTENDER) { $result = $this->PrestudentstatusModel->insert( array( @@ -1358,6 +1366,8 @@ class InfoCenter extends Auth_Controller || isset($zgvpruefung->prestudentstatus->bestaetigtam) || $zgvpruefung->prestudentstatus->status_kurzbz != self::INTERESSENTSTATUS; + $zgvpruefung->abgewiesener = $zgvpruefung->prestudentstatus->status_kurzbz === self::ABGEWIESENERSTATUS; + //wether prestudent was freigegeben for RT/Stg $zgvpruefung->isRtFreigegeben = false; $zgvpruefung->isStgFreigegeben = false; @@ -1427,8 +1437,8 @@ class InfoCenter extends Auth_Controller $this->_sortPrestudents($zgvpruefungen); - $abwstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::ABGEWIESENERSTATUS))->retval; - $intstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::INTERESSENTSTATUS))->retval; + $abwstatusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $intstatusgruende = $this->StatusgrundModel->getStatus(self::INTERESSENTSTATUS)->retval; $data = array ( 'zgvpruefungen' => $zgvpruefungen, @@ -1687,4 +1697,45 @@ class InfoCenter extends Auth_Controller $this->loglib->logError('Studiengang has no mail for sending Freigabe mail'); } } + + public function getAbsageData() + { + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + + $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); + $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm'], $studienSemester); + + $data = array ( + 'statusgruende' => $statusgruende, + 'studiengaenge' => $studiengaenge->retval + ); + + $this->outputJsonSuccess($data); + } + + public function saveAbsageForAll() + { + $statusgrund = $this->input->post('statusgrund'); + $studiengang = $this->input->post('studiengang'); + $personen = $this->input->post('personen'); + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); + + if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen)) + $this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen."); + + foreach($personen as $person) + { + $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester); + + if(!hasData($prestudent)) + continue; + + $prestudentData = getData($prestudent); + + $this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund); + } + + $this->outputJsonSuccess("Success"); + } } diff --git a/application/models/CL/Messages_model.php b/application/models/CL/Messages_model.php index 9ffd12cf6..4975af382 100644 --- a/application/models/CL/Messages_model.php +++ b/application/models/CL/Messages_model.php @@ -612,9 +612,9 @@ class Messages_model extends CI_Model if (!isEmptyString($vorlage_kurzbz)) { $this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel'); - $this->VorlagestudiengangModel->addOrder('version','DESC'); + $this->VorlagestudiengangModel->addOrder('version', 'DESC'); - $getVorlage = $this->VorlagestudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz)); + $getVorlage = $this->VorlagestudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz, 'aktiv' => true)); } return $getVorlage; diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 2e014800c..52ba4d9f3 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -581,4 +581,19 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($person_id)); } + + public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester) + { + $query = "SELECT ps.prestudent_id + FROM public.tbl_prestudentstatus pss + JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) + WHERE ps.person_id = ? + AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ? + AND pss.studiensemester_kurzbz = ? + "; + + return $this->execQuery($query, array($person, $studiengang, $studienSemester)); + } } diff --git a/application/models/crm/Statusgrund_model.php b/application/models/crm/Statusgrund_model.php index 4717a7571..7ab17a45b 100644 --- a/application/models/crm/Statusgrund_model.php +++ b/application/models/crm/Statusgrund_model.php @@ -11,4 +11,18 @@ class Statusgrund_model extends DB_Model $this->dbTable = "public.tbl_status_grund"; $this->pk = "statusgrund_id"; } + + public function getStatus($status_kurzbz = null, $aktiv = null) + { + $this->addOrder('bezeichnung_mehrsprachig'); + $where = array(); + if (!is_null($status_kurzbz)) + $where['status_kurzbz'] = $status_kurzbz; + if (!is_null($aktiv)) + $where['aktiv'] = $aktiv; + + $status = $this->loadWhere($where); + + return success($status->retval); + } } diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 8b8be0366..41bdabd11 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -481,4 +481,18 @@ class Studiengang_model extends DB_Model return $this->loadWhere($condition); } + + public function getStudiengaengeWithOrgForm($typ, $semester) + { + $query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang + FROM public.tbl_studiengang sg + JOIN lehre.tbl_studienordnung USING (studiengang_kz) + JOIN lehre.tbl_studienplan sp USING (studienordnung_id) + JOIN lehre.tbl_studienplan_semester spsem USING (studienplan_id) + WHERE sp.aktiv = TRUE AND sg.aktiv = TRUE AND sg.typ IN ? + AND spsem.studiensemester_kurzbz = ? + ORDER BY Studiengang"; + + return $this->execQuery($query, array($typ, $semester)); + } } diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php index e87f0945c..521883452 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php @@ -189,7 +189,7 @@ $this->load->view(
- + diff --git a/application/views/lehre/pruefungsprotokollUebersicht.php b/application/views/lehre/pruefungsprotokollUebersicht.php index 35bea7963..c7de8fcd0 100644 --- a/application/views/lehre/pruefungsprotokollUebersicht.php +++ b/application/views/lehre/pruefungsprotokollUebersicht.php @@ -48,6 +48,8 @@ name="period" value="today">p->t('ui','heute'); ?> +
diff --git a/application/views/lehre/pruefungsprotokollUebersichtData.php b/application/views/lehre/pruefungsprotokollUebersichtData.php index dd247c2eb..ff2caa774 100644 --- a/application/views/lehre/pruefungsprotokollUebersichtData.php +++ b/application/views/lehre/pruefungsprotokollUebersichtData.php @@ -19,9 +19,10 @@ FROM WHERE vorsitz='".$UID."' AND ( - '". $PERIOD. "' = 'today' AND datum = NOW()::date OR - '". $PERIOD. "' = 'lastWeek' AND datum = (NOW() - interval '1 week')::date OR - '". $PERIOD. "' = 'all' AND datum >= '2020-05-27' + ('". $PERIOD. "' = 'today' AND datum = NOW()::date) OR + ('". $PERIOD. "' = 'lastWeek' AND datum >= (NOW() - interval '1 week')::date AND datum < NOW()::date) OR + ('". $PERIOD. "' = 'upcoming' AND datum > NOW()::date) OR + ('". $PERIOD. "' = 'all' AND datum >= '2020-05-27') ) ORDER BY datum, nachname, vorname "; diff --git a/application/views/system/infocenter/absageModal.php b/application/views/system/infocenter/absageModal.php new file mode 100644 index 000000000..00298945e --- /dev/null +++ b/application/views/system/infocenter/absageModal.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index 4005518a1..38e644846 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), @@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterData.php'); ?> + load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index 15e73f1b6..4855e5cd6 100644 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), @@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterFreigegebenData.php'); ?> + load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index aab69b651..3e14e7323 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -114,6 +114,12 @@ sg.studiengang_kz in('.$ADDITIONAL_STG.') ) AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' + AND NOT EXISTS ( + SELECT 1 + FROM tbl_prestudentstatus spss + WHERE spss.prestudent_id = ps.prestudent_id + AND spss.status_kurzbz = '.$REJECTED_STATUS.' + ) LIMIT 1 ) AS "StgAbgeschickt", ( diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php index 79f75885b..f2d838fac 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), @@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterReihungstestAbsolviertData.php'); ?> + load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 22b122bb0..beb4887ae 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -83,10 +83,11 @@ LIMIT 1 ) AS "AnzahlAbgeschickt", ( - SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sg.orgform_kurzbz)), \', \') + SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sp.orgform_kurzbz)), \', \') FROM public.tbl_prestudentstatus pss JOIN public.tbl_prestudent ps USING(prestudent_id) JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bewerbung_abgeschicktamum IS NOT NULL AND ps.person_id = p.person_id diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 41b549616..2d00a789d 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -344,7 +344,7 @@ prestudentstatus->status_kurzbz) && in_array($zgvpruefung->prestudentstatus->status_kurzbz, ['Bewerber', 'Wartender']))) : ?> - prestudentstatus->bewerbung_abgeschicktamum)) - { - $disabled = $disabledStg = 'disabled'; - $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); - } + prestudentstatus->bewerbung_abgeschicktamum)) + { + $disabled = $disabledStg = 'disabled'; + $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); + } - if ($studiengangtyp !== 'b') - { - $disabled = 'disabled'; - $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); + if ($studiengangtyp !== 'b') + { + $disabled = 'disabled'; + $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); - // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter - if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) - { - $disabledStg = 'disabled'; - $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); - } + // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter + if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) + { + $disabledStg = 'disabled'; + $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); } - ?> -
-
-
- - - + +
+
+ - -
-
- +
- - + + prestudentstatus->status_kurzbz) && $zgvpruefung->prestudentstatus->status_kurzbz === 'Interessent'): ?> @@ -508,9 +475,69 @@ +
+
+
+ + + + +
+
+
- + + + + -
Powered by FH Complete
+
Powered by FH Complete


diff --git a/cis/index_login.php b/cis/index_login.php index 4c4d75f93..74c87f649 100644 --- a/cis/index_login.php +++ b/cis/index_login.php @@ -69,7 +69,7 @@ if(isset($_GET['login'])) -
Powered by FH Complete
+
Powered by FH Complete


diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php index dd39cf301..80062a932 100644 --- a/cis/private/profile/index.php +++ b/cis/private/profile/index.php @@ -44,6 +44,7 @@ require_once('../../../include/addon.class.php'); require_once('../../../include/gruppe.class.php'); require_once('../../../include/adresse.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/bisverwendung.class.php'); $sprache = getSprache(); $p = new phrasen($sprache); @@ -271,6 +272,22 @@ if (!$ansicht) } +if (!$ansicht) +{ + if ($is_employee) + { + $verwendung = new bisverwendung(); + if($verwendung->getLastVerwendung($uid)) + { + if (!$verwendung->hauptberuflich) + { + echo 'Hauptberuf: '. $verwendung->hauptberuf; + } + } + echo "

"; + } +} + if (!$ansicht) { $adresse = new adresse(); diff --git a/cms/menu.inc.php b/cms/menu.inc.php index 136187f70..7375ee849 100644 --- a/cms/menu.inc.php +++ b/cms/menu.inc.php @@ -19,7 +19,7 @@ */ /** * Dieses File enthaelt Hilfsklassen zur Anzeige des CMS-Menues - * + * * mit drawSubmenu($id) wird das enstprechende Menue gezeichnet. */ require_once(dirname(__FILE__).'/../include/functions.inc.php'); @@ -30,13 +30,14 @@ $params = array(); foreach($_REQUEST as $key=>$value) $params[$key]=$value; +$user = null; //Parameter fuer Include Addons $includeparams = array(); $contentobjects=array(); $chldsobject = array(); /** * Zeichnet einen Menueeintrag aus dem CMS System - * + * * @param $content_id */ function drawSubmenu($content_id) @@ -47,16 +48,16 @@ function drawSubmenu($content_id) global $contentobjects; $content = new content(); $sprache = getSprache(); - + // Daten Laden - + // Alle Kindelemente des Contents holen $ids = $content->getAllChilds($content_id); - // Alle vorkommenden Contenteintraege laden + // Alle vorkommenden Contenteintraege laden $content->loadArray($ids, $sprache, true); $contentobjects = $content->result; - + // Baumstruktur laden $childsobject = $content->getChildArray($content_id); @@ -91,7 +92,7 @@ function drawSubmenu1($content_id) drawEntry($contentobj); } } - + } } @@ -101,12 +102,13 @@ function drawSubmenu1($content_id) */ function drawEntry($item) { - global $childsobject; + global $childsobject, $user; //pruefen ob der Content eine Berechtigung erfordert if($item->locked) { - $user = get_uid(); + if(is_null($user)) + $user = get_uid(); $content = new content(); //wenn der User nicht berechtigt ist, dann wird der Eintrag nicht angezeigt if(!$content->berechtigt($item->content_id, $user)) @@ -139,7 +141,7 @@ function drawEntry($item) Redirect($item); else DrawLink(APP_ROOT.'cms/content.php?content_id='.$item->content_id,'content',$item->titel); - + echo ""; } } @@ -155,7 +157,7 @@ function DrawLink($link, $target, $name, $content_id=null, $open=null) { if($target=='') $target='content'; - + if($open) $class='class="selected"'; else @@ -167,7 +169,7 @@ function DrawLink($link, $target, $name, $content_id=null, $open=null) * Redirects sind Links Seiten ausserhalb des CMS * die URL kann Variablen enthalten. Diese werden hier ersetzt. * Danach wird der Link angezeigt. - * + * * @param $content_id ContentID des Redirects * @param $name Anzeigename des Links * @param $content_id_Submenu ID des Submenues das geoeffnet werden soll (optional) @@ -175,42 +177,42 @@ function DrawLink($link, $target, $name, $content_id=null, $open=null) function Redirect($content, $content_id_Submenu=null) { global $sprache, $params; - + $xml = new DOMDocument(); if($content->content!='') { $xml->loadXML($content->content); } - + if($xml->getElementsByTagName('url')->item(0)) $url = $xml->getElementsByTagName('url')->item(0)->nodeValue; else $url=''; - + //Variablen Ersetzen foreach($params as $key=>$value) { $url = str_replace('$'.$key,addslashes($value),$url); } - + if($xml->getElementsByTagName('target')->item(0)) $target = $xml->getElementsByTagName('target')->item(0)->nodeValue; else $target=''; - + DrawLink($url, $target, $content->titel, $content_id_Submenu, $content->menu_open); } /** - * Bei Content mit Include Templates wird + * Bei Content mit Include Templates wird * das entsprechende Menu-Addon geladen und inkludiert - * + * * @param $content_id */ function IncludeMenuAddon($content) { global $sprache, $includeparams; - + $xml = new DOMDocument(); if($content->content!='') { @@ -223,6 +225,6 @@ function IncludeMenuAddon($content) if($url!='') { $includeparams['content']=$content; - include(dirname(__FILE__).'/menu/'.$url); + include(dirname(__FILE__).'/menu/'.$url); } } diff --git a/content/fasoverlay.js.php b/content/fasoverlay.js.php index f7a30158f..9504285ce 100644 --- a/content/fasoverlay.js.php +++ b/content/fasoverlay.js.php @@ -1539,7 +1539,7 @@ function OpenAboutDialog() // **** function OpenManual() { - window.open('https://wiki.fhcomplete.org/doku.php?','_blank'); + window.open('https://wiki.fhcomplete.info/','_blank'); } // **** diff --git a/content/tempus.js.php b/content/tempus.js.php index e4dad5e43..5a734ebf3 100644 --- a/content/tempus.js.php +++ b/content/tempus.js.php @@ -473,7 +473,7 @@ function SyncLVPlan() // **** function OpenManualTempus() { - window.open('https://wiki.fhcomplete.org/doku.php?id=tempus:allgemeines','Manual'); + window.open('https://wiki.fhcomplete.info/doku.php?id=tempus:allgemeines','Manual'); } // **** diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index 799cfc93e..07f2a74de 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -524,12 +524,13 @@ class bisverwendung extends basis_db { //laden des Datensatzes $qry = "SELECT - * + *, tbl_hauptberuf.bezeichnung as hauptberuf FROM bis.tbl_bisverwendung + LEFT JOIN bis.tbl_hauptberuf USING(hauptberufcode) WHERE mitarbeiter_uid=".$this->db_add_param($uid)." - ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;"; + ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;"; if($this->db_query($qry)) { @@ -543,6 +544,7 @@ class bisverwendung extends basis_db $this->mitarbeiter_uid = $row->mitarbeiter_uid; $this->hauptberufcode = $row->hauptberufcode; $this->hauptberuflich = $this->db_parse_bool($row->hauptberuflich); + $this->hauptberuf = $row->hauptberuf; $this->habilitation = $this->db_parse_bool($row->habilitation); $this->beginn = $row->beginn; $this->ende = $row->ende; @@ -582,7 +584,7 @@ class bisverwendung extends basis_db (beginn<=now() OR beginn IS NULL) AND (ende>=now() OR ende IS NULL) - ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;"; + ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;"; if($this->db_query($qry)) { diff --git a/include/notiz.class.php b/include/notiz.class.php index 459bdc6a6..5d237e2b8 100644 --- a/include/notiz.class.php +++ b/include/notiz.class.php @@ -1,618 +1,619 @@ - and - */ -require_once(dirname(__FILE__).'/basis_db.class.php'); -require_once(dirname(__FILE__).'/dms.class.php'); - -class notiz extends basis_db -{ - public $new; - public $result=array(); - public $dokumente=array(); - - //Tabellenspalten - public $notiz_id; - public $titel; - public $text; - public $verfasser_uid; - public $bearbeiter_uid; - public $start; - public $ende; - public $erledigt; - public $insertamum; - public $insertvon; - public $updateamum; - public $updatevon; - - public $projekt_kurzbz; - public $projektphase_id; - public $projekttask_id; - public $uid; - public $person_id; - public $prestudent_id; - public $bestellung_id; - public $lehreinheit_id; - public $anrechnung_id; - - /** - * Konstruktor - * @param $notiz_id - */ - public function __construct($notiz_id = null) - { - parent::__construct(); - - if($notiz_id != null) - $this->load($notiz_id); - } - - /** - * Laedt eine Notiz - * @param $notiz_id - * @return true wenn ok, false im Fehlerfall - */ - public function load($notiz_id) - { - if(!is_numeric($notiz_id)) - { - $this->errormsg = 'NotizID ist ungueltig'; - return false; - } - - $qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if($this->db_query($qry)) - { - if($row = $this->db_fetch_object()) - { - $this->notiz_id=$row->notiz_id; - $this->titel=$row->titel; - $this->text=$row->text; - $this->verfasser_uid=$row->verfasser_uid; - $this->bearbeiter_uid=$row->bearbeiter_uid; - $this->start=$row->start; - $this->ende=$row->ende; - $this->erledigt=$this->db_parse_bool($row->erledigt); - $this->insertamum=$row->insertamum; - $this->insertvon=$row->insertvon; - $this->updateamum=$row->updateamum; - $this->updatevon=$row->updatevon; - $this->getDokumente($row->notiz_id); - - return true; - } - else - { - $this->errormsg = 'Datensatz wurde nicht gefunden'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Löscht eine Notiz - * @param $notiz_id - * @return true wenn ok, false im Fehlerfall - */ - public function delete($notiz_id) - { - if(!is_numeric($notiz_id)) - { - $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); - } - } - - $qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if(!$this->db_query($qry)) - { - $this->errormsg = 'Fehler beim Loeschen der Daten'; - return false; - } - return true; - } - - /** - * Prueft die Daten vor dem Speichern - * auf Gueltigkeit - */ - public function validate() - { - return true; - } - - /** - * Speichert den aktuellen Datensatz in die Datenbank - * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt - * andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert - * @return true wenn ok, false im Fehlerfall - */ - public function save($new=null) - { - if($new==null) - $new=$this->new; - - if(!$this->validate()) - return false; - - if($new) - { - //Neuen Datensatz einfuegen - $qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid, - bearbeiter_uid, start, ende, erledigt, insertamum, insertvon, - updateamum, updatevon) VALUES('. - $this->db_add_param($this->titel).', '. - $this->db_add_param($this->text).', '. - $this->db_add_param($this->verfasser_uid).','. - $this->db_add_param($this->bearbeiter_uid).','. - $this->db_add_param($this->start).','. - $this->db_add_param($this->ende).','. - $this->db_add_param($this->erledigt,FHC_BOOLEAN).','. - $this->db_add_param($this->insertamum).','. - $this->db_add_param($this->insertvon).','. - $this->db_add_param($this->updateamum).','. - $this->db_add_param($this->updatevon).');'; - } - else - { - $qry='UPDATE public.tbl_notiz SET '. - 'titel='.$this->db_add_param($this->titel).', '. - 'text='.$this->db_add_param($this->text).', '. - 'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '. - 'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '. - 'start='.$this->db_add_param($this->start).', '. - 'ende='.$this->db_add_param($this->ende).', '. - 'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '. - 'updateamum='.$this->db_add_param($this->updateamum).', '. - 'updatevon='.$this->db_add_param($this->updatevon).' '. - 'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';'; - } - - if($this->db_query($qry)) - { - if($new) - { - $qry="SELECT currval('seq_notiz_notiz_id') as id;"; - if($result = $this->db_query($qry)) - { - if($row = $this->db_fetch_object($result)) - { - $this->notiz_id = $row->id; - $this->db_query('COMMIT;'); - return true; - } - else - { - $this->errormsg = 'Fehler beim Lesen der Sequence'; - $this->db_query('ROLLBACK'); - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Lesen der Sequence'; - $this->db_query('ROLLBACK'); - return false; - } - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern des Datensatzes'; - return false; - } - } - - /** - * Speichert die Zuordnung einer Notiz - * - */ - public function saveZuordnung() - { - $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).','. - $this->db_add_param($this->projektphase_id, FHC_INTEGER).','. - $this->db_add_param($this->projekttask_id, FHC_INTEGER).','. - $this->db_add_param($this->uid).','. - $this->db_add_param($this->person_id, FHC_INTEGER).','. - $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. - $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; - } - else - { - $this->errormsg = 'Fehler beim Speichern der Daten'; - return false; - } - } - - /** - * Speichert ein Dokument zur Notiz - * @param int $dms_id - * @return boolean - */ - 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; - } - else - { - $this->errormsg = 'Fehler beim Speichern der Daten'; - return false; - } - } - - /** - * - * Laedt die Notizen - * @param $erledigt - * @param $projekt_kurzbz - * @param $projektphase_id - * @param $projekttask_id - * @param $uid - * @param $person_id - * @param $prestudent_id - * @param $bestellung_id - * @param $user - * @param $lehreinheit_id - * @param $anrechnung_id - * @return boolean - */ - public function getNotiz( - $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, - $stundenplandev_id=null, - $anrechnung_id=null, - $titel=null) - { - $qry = "SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE 1=1"; - - if(!is_null($erledigt)) - { - if($erledigt) - $qry.=" AND erledigt=true"; - else - $qry.=" AND erledigt=false"; - } - if($projekt_kurzbz!='') - $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); - if($projektphase_id!='') - $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); - if($projekttask_id!='') - $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); - if($uid!='') - $qry.=" AND uid=".$this->db_add_param($uid); - if($person_id!='') - $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); - if($prestudent_id!='') - $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); - if($bestellung_id!='') - $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); - if($user!='') - $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; - if($lehreinheit_id!='') - $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($titel!='') - $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; - $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; - $obj->getDokumente($row->notiz_id); - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * - * Laedt die Notizen vom Bewerbungstool - * @param integer $person_id - * @param integer $prestudent_id - * @return boolean - */ - public function getBewerbungstoolNotizen($person_id, $prestudent_id = null) - { - $qry = "SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE (insertvon = 'online' OR insertvon = 'online_notiz') - AND person_id = ".$this->db_add_param($person_id, FHC_INTEGER); - if ($prestudent_id != '') - { - $qry .= " AND prestudent_id = ".$this->db_add_param($prestudent_id, FHC_INTEGER); - } - - $qry .= " 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; - } - } - - - /** - * 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 - * @param $projekt_kurzbz - * @param $projektphase_id - * @param $projekttask_id - * @param $uid - * @param $person_id - * @param $prestudent_id - * @param $bestellung_id - * @param $user - * @param $lehreinheit_id - * @param $anrechnung_id - * @return boolean - */ - 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 - count(*) as anzahl - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE 1=1"; - - if(!is_null($erledigt)) - { - if($erledigt) - $qry.=" AND erledigt=true"; - else - $qry.=" AND erledigt=false"; - } - if($projekt_kurzbz!='') - $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); - if($projektphase_id!='') - $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); - if($projekttask_id!='') - $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); - if($uid!='') - $qry.=" AND uid=".$this->db_add_param($uid); - if($person_id!='') - $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); - if($prestudent_id!='') - $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); - if($bestellung_id!='') - $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); - if($user!='') - $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; - if($lehreinheit_id!='') - $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)) - return $row->anzahl; - else - { - $this->errormsg='Fehler beim Laden der Daten'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Laedt die Dokumente der Notiz - * @return boolean - */ - 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); - - if($this->db_query($qry)) - { - while($row = $this->db_fetch_object()) - { - $this->dokumente[] = $row->dms_id; - } - - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Prueft ob das Dokument an einer Notiz haengt - * @param $dms_id DMS id des Dokuments. - * @return boolean true wenn das Dokument an einer Notiz hängt, sonst false. - */ - public function isNotizDokument($dms_id) - { - $qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER); - - if($result = $this->db_query($qry)) - { - if($this->db_num_rows($result)>0) - return true; - else - return false; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } -} + and + */ +require_once(dirname(__FILE__).'/basis_db.class.php'); +require_once(dirname(__FILE__).'/dms.class.php'); + +class notiz extends basis_db +{ + public $new; + public $result=array(); + public $dokumente=array(); + + //Tabellenspalten + public $notiz_id; + public $titel; + public $text; + public $verfasser_uid; + public $bearbeiter_uid; + public $start; + public $ende; + public $erledigt; + public $insertamum; + public $insertvon; + public $updateamum; + public $updatevon; + + public $projekt_kurzbz; + public $projektphase_id; + public $projekttask_id; + public $uid; + public $person_id; + public $prestudent_id; + public $bestellung_id; + public $lehreinheit_id; + public $anrechnung_id; + + /** + * Konstruktor + * @param $notiz_id + */ + public function __construct($notiz_id = null) + { + parent::__construct(); + + if($notiz_id != null) + $this->load($notiz_id); + } + + /** + * Laedt eine Notiz + * @param $notiz_id + * @return true wenn ok, false im Fehlerfall + */ + public function load($notiz_id) + { + if(!is_numeric($notiz_id)) + { + $this->errormsg = 'NotizID ist ungueltig'; + return false; + } + + $qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $this->notiz_id=$row->notiz_id; + $this->titel=$row->titel; + $this->text=$row->text; + $this->verfasser_uid=$row->verfasser_uid; + $this->bearbeiter_uid=$row->bearbeiter_uid; + $this->start=$row->start; + $this->ende=$row->ende; + $this->erledigt=$this->db_parse_bool($row->erledigt); + $this->insertamum=$row->insertamum; + $this->insertvon=$row->insertvon; + $this->updateamum=$row->updateamum; + $this->updatevon=$row->updatevon; + $this->getDokumente($row->notiz_id); + + return true; + } + else + { + $this->errormsg = 'Datensatz wurde nicht gefunden'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Löscht eine Notiz + * @param $notiz_id + * @return true wenn ok, false im Fehlerfall + */ + public function delete($notiz_id) + { + if(!is_numeric($notiz_id)) + { + $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); + } + } + + $qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if(!$this->db_query($qry)) + { + $this->errormsg = 'Fehler beim Loeschen der Daten'; + return false; + } + return true; + } + + /** + * Prueft die Daten vor dem Speichern + * auf Gueltigkeit + */ + public function validate() + { + return true; + } + + /** + * Speichert den aktuellen Datensatz in die Datenbank + * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt + * andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert + * @return true wenn ok, false im Fehlerfall + */ + public function save($new=null) + { + if($new==null) + $new=$this->new; + + if(!$this->validate()) + return false; + + if($new) + { + //Neuen Datensatz einfuegen + $qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid, + bearbeiter_uid, start, ende, erledigt, insertamum, insertvon, + updateamum, updatevon) VALUES('. + $this->db_add_param($this->titel).', '. + $this->db_add_param($this->text).', '. + $this->db_add_param($this->verfasser_uid).','. + $this->db_add_param($this->bearbeiter_uid).','. + $this->db_add_param($this->start).','. + $this->db_add_param($this->ende).','. + $this->db_add_param($this->erledigt,FHC_BOOLEAN).','. + $this->db_add_param($this->insertamum).','. + $this->db_add_param($this->insertvon).','. + $this->db_add_param($this->updateamum).','. + $this->db_add_param($this->updatevon).');'; + } + else + { + $qry='UPDATE public.tbl_notiz SET '. + 'titel='.$this->db_add_param($this->titel).', '. + 'text='.$this->db_add_param($this->text).', '. + 'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '. + 'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '. + 'start='.$this->db_add_param($this->start).', '. + 'ende='.$this->db_add_param($this->ende).', '. + 'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '. + 'updateamum='.$this->db_add_param($this->updateamum).', '. + 'updatevon='.$this->db_add_param($this->updatevon).' '. + 'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';'; + } + + if($this->db_query($qry)) + { + if($new) + { + $qry="SELECT currval('seq_notiz_notiz_id') as id;"; + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + $this->notiz_id = $row->id; + $this->db_query('COMMIT;'); + return true; + } + else + { + $this->errormsg = 'Fehler beim Lesen der Sequence'; + $this->db_query('ROLLBACK'); + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Lesen der Sequence'; + $this->db_query('ROLLBACK'); + return false; + } + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern des Datensatzes'; + return false; + } + } + + /** + * Speichert die Zuordnung einer Notiz + * + */ + public function saveZuordnung() + { + $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).','. + $this->db_add_param($this->projektphase_id, FHC_INTEGER).','. + $this->db_add_param($this->projekttask_id, FHC_INTEGER).','. + $this->db_add_param($this->uid).','. + $this->db_add_param($this->person_id, FHC_INTEGER).','. + $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. + $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; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * Speichert ein Dokument zur Notiz + * @param int $dms_id + * @return boolean + */ + 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; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * + * Laedt die Notizen + * @param $erledigt + * @param $projekt_kurzbz + * @param $projektphase_id + * @param $projekttask_id + * @param $uid + * @param $person_id + * @param $prestudent_id + * @param $bestellung_id + * @param $user + * @param $lehreinheit_id + * @param $anrechnung_id + * @return boolean + */ + public function getNotiz( + $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, + $stundenplandev_id=null, + $anrechnung_id=null, + $titel=null) + { + $qry = "SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE 1=1"; + + if(!is_null($erledigt)) + { + if($erledigt) + $qry.=" AND erledigt=true"; + else + $qry.=" AND erledigt=false"; + } + if($projekt_kurzbz!='') + $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); + if($projektphase_id!='') + $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); + if($projekttask_id!='') + $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); + if($uid!='') + $qry.=" AND uid=".$this->db_add_param($uid); + if($person_id!='') + $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); + if($prestudent_id!='') + $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); + if($bestellung_id!='') + $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); + if($user!='') + $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; + if($lehreinheit_id!='') + $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($titel!='') + $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; + $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; + $obj->getDokumente($row->notiz_id); + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * + * Laedt die Notizen vom Bewerbungstool + * @param integer $person_id + * @param integer $prestudent_id + * @param string $order Sorting order. Default: "notiz_id" + * @return boolean + */ + public function getBewerbungstoolNotizen($person_id, $prestudent_id = null, $order = 'notiz_id') + { + $qry = "SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE (insertvon = 'online' OR insertvon = 'online_notiz') + AND person_id = ".$this->db_add_param($person_id, FHC_INTEGER); + if ($prestudent_id != '') + { + $qry .= " AND prestudent_id = ".$this->db_add_param($prestudent_id, FHC_INTEGER); + } + + $qry .= " ORDER BY ".$order; + + 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; + } + } + + + /** + * 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 + * @param $projekt_kurzbz + * @param $projektphase_id + * @param $projekttask_id + * @param $uid + * @param $person_id + * @param $prestudent_id + * @param $bestellung_id + * @param $user + * @param $lehreinheit_id + * @param $anrechnung_id + * @return boolean + */ + 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 + count(*) as anzahl + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE 1=1"; + + if(!is_null($erledigt)) + { + if($erledigt) + $qry.=" AND erledigt=true"; + else + $qry.=" AND erledigt=false"; + } + if($projekt_kurzbz!='') + $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); + if($projektphase_id!='') + $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); + if($projekttask_id!='') + $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); + if($uid!='') + $qry.=" AND uid=".$this->db_add_param($uid); + if($person_id!='') + $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); + if($prestudent_id!='') + $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); + if($bestellung_id!='') + $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); + if($user!='') + $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; + if($lehreinheit_id!='') + $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)) + return $row->anzahl; + else + { + $this->errormsg='Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Laedt die Dokumente der Notiz + * @return boolean + */ + 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); + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $this->dokumente[] = $row->dms_id; + } + + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Prueft ob das Dokument an einer Notiz haengt + * @param $dms_id DMS id des Dokuments. + * @return boolean true wenn das Dokument an einer Notiz hängt, sonst false. + */ + public function isNotizDokument($dms_id) + { + $qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER); + + if($result = $this->db_query($qry)) + { + if($this->db_num_rows($result)>0) + return true; + else + return false; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } +} diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 87a40c0f1..efdd7dc99 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -31,6 +31,20 @@ var InfocenterPersonDataset = { var formHtml = '
'; $("#datasetActionsTop").before(formHtml); + var auswahlAbsageToggle = + 'Erweiterte Einstellungen'; + + var auswahlAbsage = + '' + + '' + + ''; + + InfocenterPersonDataset.getAbsageData(); + var studienSemesterHtml = ' ' + @@ -60,6 +74,14 @@ var InfocenterPersonDataset = { "
"+studienSemesterHtml+"
"+ "

"); + $("#datasetActionsBottom").append( + "
"+ + "
"+auswahlAbsageToggle+"
"+ + ""+ + "
" + + "
" + + "
" + ) $("button.incStudiensemester").click(function() { InfocenterPersonDataset.changeStudiensemesterUservar(1); }); @@ -68,6 +90,29 @@ var InfocenterPersonDataset = { InfocenterPersonDataset.changeStudiensemesterUservar(-1); }); + $('button.auswahlAbsageBtn').click(function() + { + var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); + + if(idsel.length <= 0) + return FHC_DialogLib.alertInfo("Bitte wählen Sie die Personen aus."); + + if($('.absgstatusgrund').val() === 'null' || $('.auswahlAbsageStg').val() === 'null') + return FHC_DialogLib.alertInfo("Bitte den Absagegrund und Studiengang auswählen."); + + $(".absageModalForAll").modal("show"); + }); + + $('#saveAbsageForAll').click(function() + { + InfocenterPersonDataset.saveAbsageForAll(); + }); + + $('a.absageToggle').click(function() + { + $('#absagePunkte').toggle(); + }) + var personcount = 0; FHC_AjaxClient.ajaxCallGet( @@ -203,6 +248,75 @@ var InfocenterPersonDataset = { ); }, + saveAbsageForAll: function() + { + var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); + + var statusgrund = $('.absgstatusgrund').val(); + var studiengang = $('.auswahlAbsageStg').val(); + + var personen = []; + + for (var i = 0; i < idsel.length; i++) + { + personen.push($(idsel[i]).val()); + } + + FHC_AjaxClient.ajaxCallPost( + 'system/infocenter/InfoCenter/saveAbsageForAll', + { + 'statusgrund': statusgrund, + 'studiengang': studiengang, + 'personen' : personen + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + + if (FHC_AjaxClient.hasData(data)) + FHC_DialogLib.alertSuccess("Erfolgreich gespeichert.") + + $(".absageModalForAll").modal("hide"); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + FHC_DialogLib.alertError(textStatus); + } + } + ); + }, + + getAbsageData: function() + { + FHC_AjaxClient.ajaxCallGet( + 'system/infocenter/InfoCenter/getAbsageData', + {}, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + data = FHC_AjaxClient.getData(data); + $.each(data.statusgruende, function(key, value){ + $('.absgstatusgrund').append($("