From 868fc0feaaaef60f6117a68542562322453c09bb Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Mon, 19 Sep 2016 13:38:53 +0200 Subject: [PATCH 01/85] fixed bug at registration for exam --- .../pruefung/pruefungsanmeldung.json.php | 207 ++++++++++-------- 1 file changed, 115 insertions(+), 92 deletions(-) diff --git a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php index 7a1dbbf6d..85bd6cc16 100755 --- a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php +++ b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php @@ -409,27 +409,30 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null) } } $i=0; + $stdsem_lv_besuch = null; do { - $lehrveranstaltung->load_lva_student($uid, $stdsem); - foreach($lehrveranstaltung->lehrveranstaltungen as $lv) - { - if($lv->lehrveranstaltung_id === $lehrveranstaltung->lehrveranstaltung_id) - { - $lv_besucht = true; - } - } - $stdsem = $studiensemester->getPreviousFrom($stdsem); - $lehrveranstaltung->lehrveranstaltungen = array(); - $i++; + $lehrveranstaltung->load_lva_student($uid, $stdsem); + foreach($lehrveranstaltung->lehrveranstaltungen as $lv) + { + if($lv->lehrveranstaltung_id === $lehrveranstaltung->lehrveranstaltung_id) + { + $lv_besucht = true; + $stdsem_lv_besuch = $stdsem; + } + } + + $stdsem = $studiensemester->getPreviousFrom($stdsem); + $lehrveranstaltung->lehrveranstaltungen = array(); + $i++; } while($i<=$semCounter && $lv_besucht === FALSE); if(!$lv_besucht) { - $data['error']='true'; - $data['errormsg']='Besuch der Lehrveranstaltung liegt zu weit in der Vergangenheit.'; - return $data; + $data['error']='true'; + $data['errormsg']='Besuch der Lehrveranstaltung liegt zu weit in der Vergangenheit.'; + return $data; } $pruefung->getPruefungen($uid, NULL, $lehrveranstaltung->lehrveranstaltung_id); @@ -555,95 +558,115 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null) if(count($prestudent->result) > 0) { - $prestudent_id = ""; - foreach($prestudent->result as $ps) - { - if($ps->getLaststatus($ps->prestudent_id, $stdsem)) - { - if(($ps->status_kurzbz == "Student")) + $prestudent_id = ""; + foreach($prestudent->result as $ps) { - $prestudent_id = $ps->prestudent_id; + if($ps->getLaststatus($ps->prestudent_id, $stdsem)) + { + if(($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher")) + { + $prestudent_id = $ps->prestudent_id; + } + else + { + if($ps->getLaststatus($ps->prestudent_id, $stdsem_lv_besuch)) + { + if(($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher")) + { + $prestudent_id = $ps->prestudent_id; + } + } + } + } + else + { + if($ps->getLaststatus($ps->prestudent_id, $stdsem_lv_besuch)) + { + if(($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher")) + { + $prestudent_id = $ps->prestudent_id; + } + } + } } - } - } - if($prestudent_id != "") - { - $anrechungSaveResult = false; - if(!defined('CIS_PRUEFUNGSANMELDUNG_ANRECHNUNG') || CIS_PRUEFUNGSANMELDUNG_ANRECHNUNG == true) - { - if($lv_komp->lehrveranstaltung_id != null && ($lv_komp->lehrveranstaltung_id != $lehrveranstaltung->lehrveranstaltung_id)) - { - $anrechnung->lehrveranstaltung_id = $lv_komp->lehrveranstaltung_id; - $anrechnung->lehrveranstaltung_id_kompatibel = $lehrveranstaltung->lehrveranstaltung_id; - $anrechnung->prestudent_id = $prestudent_id; - $anrechnung->begruendung_id = "2"; - $anrechnung->genehmigt_von = CIS_PRUEFUNGSANMELDUNG_USER; - $anrechnung->new = true; - $anrechungSaveResult = $anrechnung->save(); - } - else - { - $anrechungSaveResult = true; - } - } - else - { - $anrechungSaveResult = true; - } + if($prestudent_id != "") + { + $anrechungSaveResult = false; + if(!defined('CIS_PRUEFUNGSANMELDUNG_ANRECHNUNG') || CIS_PRUEFUNGSANMELDUNG_ANRECHNUNG == true) + { + if($lv_komp->lehrveranstaltung_id != null && ($lv_komp->lehrveranstaltung_id != $lehrveranstaltung->lehrveranstaltung_id)) + { + $anrechnung->lehrveranstaltung_id = $lv_komp->lehrveranstaltung_id; + $anrechnung->lehrveranstaltung_id_kompatibel = $lehrveranstaltung->lehrveranstaltung_id; + $anrechnung->prestudent_id = $prestudent_id; + $anrechnung->begruendung_id = "2"; + $anrechnung->genehmigt_von = CIS_PRUEFUNGSANMELDUNG_USER; + $anrechnung->new = true; + $anrechungSaveResult = $anrechnung->save(); + } + else + { + $anrechungSaveResult = true; + } + } + else + { + $anrechungSaveResult = true; + } - if($anrechungSaveResult) - { - if($anrechnung->anrechnung_id == "") - $anmeldung->anrechnung_id = null; - else - $anmeldung->anrechnung_id = $anrechnung->anrechnung_id; + if($anrechungSaveResult) + { + if($anrechnung->anrechnung_id == "") + $anmeldung->anrechnung_id = null; + else + $anmeldung->anrechnung_id = $anrechnung->anrechnung_id; - if($anmeldung->save(true)) - { - $pruefung = new pruefungCis($termin->pruefung_id); - if(defined('CIS_PRUEFUNG_MAIL_EMPFAENGER_ANMEDLUNG') && (CIS_PRUEFUNG_MAIL_EMPFAENGER_ANMEDLUNG !== "")) - $to = CIS_PRUEFUNG_MAIL_EMPFAENGER_ANMEDLUNG."@".DOMAIN; - else - $to = $pruefung->mitarbeiter_uid."@".DOMAIN; - $from = "noreply@".DOMAIN; - $subject = $p->t('pruefung/emailLektorSubjectAnmeldung'); - $mail = new mail($to, $from, $subject, $p->t('pruefung/emailBodyBitteHtmlSicht')); + if($anmeldung->save(true)) + { + $pruefung = new pruefungCis($termin->pruefung_id); + if(defined('CIS_PRUEFUNG_MAIL_EMPFAENGER_ANMEDLUNG') && (CIS_PRUEFUNG_MAIL_EMPFAENGER_ANMEDLUNG !== "")) + $to = CIS_PRUEFUNG_MAIL_EMPFAENGER_ANMEDLUNG."@".DOMAIN; + else + $to = $pruefung->mitarbeiter_uid."@".DOMAIN; + $from = "noreply@".DOMAIN; + $subject = $p->t('pruefung/emailLektorSubjectAnmeldung'); + $mail = new mail($to, $from, $subject, $p->t('pruefung/emailBodyBitteHtmlSicht')); - $student = new student($uid); - $datum = new datum(); + $student = new student($uid); + $datum = new datum(); - $lv = new lehrveranstaltung($anmeldung->lehrveranstaltung_id); + $lv = new lehrveranstaltung($anmeldung->lehrveranstaltung_id); - $html = $p->t('pruefung/emailLektorStudentIn')." ".$student->vorname." ".$student->nachname." ".$p->t('pruefung/emailLektorHatSichZurPruefung')." ".$lv->bezeichnung." ".$p->t('pruefung/emailLektorAm')." ".$datum->formatDatum($termin->von, "d.m.Y")." ".$p->t('pruefung/emailLektorVon')." ".$datum->formatDatum($termin->von,"H:i")." ".$p->t('pruefung/emailLektorUhrBis')." ".$datum->formatDatum($termin->bis,"H:i")." ".$p->t('pruefung/emailLektorUhrAngemeldet'); - $mail->setHTMLContent($html); - $mail->send(); + $html = $p->t('pruefung/emailLektorStudentIn')." ".$student->vorname." ".$student->nachname." ".$p->t('pruefung/emailLektorHatSichZurPruefung')." ".$lv->bezeichnung." ".$p->t('pruefung/emailLektorAm')." ".$datum->formatDatum($termin->von, "d.m.Y")." ".$p->t('pruefung/emailLektorVon')." ".$datum->formatDatum($termin->von,"H:i")." ".$p->t('pruefung/emailLektorUhrBis')." ".$datum->formatDatum($termin->bis,"H:i")." ".$p->t('pruefung/emailLektorUhrAngemeldet'); + $mail->setHTMLContent($html); + $mail->send(); - $data['result'] = $p->t('pruefung/anmeldungErfolgreich'); - $data['error']='false'; - $data['errormsg']=''; - } - else - { - $data['error']='true'; - $data['errormsg']=$anmeldung->errormsg; - } - } - else - { - $data['error']='true'; - $data['errormsg']=$anrechnung->errormsg; - } - } - else - { - $data['error']='true'; - $data['errormsg']=$p->t('pruefung/prestudentNichtGefunden'); - } + $data['result'] = $p->t('pruefung/anmeldungErfolgreich'); + $data['error']='false'; + $data['errormsg']=''; + } + else + { + $data['error']='true'; + $data['errormsg']=$anmeldung->errormsg; + } + } + else + { + $data['error']='true'; + $data['errormsg']=$anrechnung->errormsg; + } + } + else + { + $data['error']='true'; + $data['errormsg']=$p->t('pruefung/prestudentNichtGefunden'); + } } else { - $data['error']='true'; - $data['errormsg']=$p->t('pruefung/prestudentNichtGefunden'); + $data['error']='true'; + $data['errormsg']=$p->t('pruefung/prestudentNichtGefunden'); } return $data; } From 625a662648a4cf8a7f3f1128f7a0af812985aa1e Mon Sep 17 00:00:00 2001 From: oesi Date: Tue, 20 Sep 2016 16:15:00 +0200 Subject: [PATCH 02/85] Fehler behoben wodurch bei Lehreinheiten keine Gruppen mehr angezeigt wurden wenn die Gruppe eines inaktiven Studiengangs zu einer Lehreinheit zugeteilt wird --- rdf/lehreinheitgruppe.rdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdf/lehreinheitgruppe.rdf.php b/rdf/lehreinheitgruppe.rdf.php index 64a047a75..49329e8a6 100644 --- a/rdf/lehreinheitgruppe.rdf.php +++ b/rdf/lehreinheitgruppe.rdf.php @@ -47,7 +47,7 @@ $DAO_obj = new lehreinheitgruppe(); $DAO_obj->getLehreinheitgruppe($lehreinheit_id); $stg_obj = new studiengang(); -$stg_obj->getAll(); +$stg_obj->getAll(null,null); $stg = array(); foreach ($stg_obj->result as $row) $stg[$row->studiengang_kz]=$row->kuerzel; From 931c4ded3fbdc94926e40150d487d928ad526dee Mon Sep 17 00:00:00 2001 From: oesi Date: Tue, 20 Sep 2016 16:27:27 +0200 Subject: [PATCH 03/85] LVs unter MeineLV sortiert --- cms/menu/menu_addon_meinelv.inc.php | 80 +++++++++++++++++++---------- 1 file changed, 53 insertions(+), 27 deletions(-) diff --git a/cms/menu/menu_addon_meinelv.inc.php b/cms/menu/menu_addon_meinelv.inc.php index 188945aab..4b0773842 100755 --- a/cms/menu/menu_addon_meinelv.inc.php +++ b/cms/menu/menu_addon_meinelv.inc.php @@ -46,9 +46,6 @@ class menu_addon_meinelv extends menu_addon //Meine LVs Student if(!$is_lector) { - $studiengang_obj = new studiengang(); - $studiengang_obj->getAll(); - $stsemobj = new studiensemester(); $stsem_arr=array(); @@ -57,10 +54,30 @@ class menu_addon_meinelv extends menu_addon foreach($stsem_arr as $stsem) { - $qry = "SELECT distinct lehrveranstaltung_id, bezeichnung, studiengang_kz, semester, lehre, - lehreverzeichnis, studiensemester_kurzbz from campus.vw_student_lehrveranstaltung - WHERE uid=".$this->db_add_param($user)." AND studiensemester_kurzbz=".$this->db_add_param($stsem)." - AND lehre=true AND lehreverzeichnis<>'' ORDER BY studiengang_kz, semester, bezeichnung"; + $qry = "SELECT + distinct + tbl_studiengang.typ, + tbl_studiengang.kurzbz, + vw_student_lehrveranstaltung.lehrveranstaltung_id, + vw_student_lehrveranstaltung.bezeichnung, + vw_student_lehrveranstaltung.studiengang_kz, + vw_student_lehrveranstaltung.semester, + vw_student_lehrveranstaltung.lehre, + vw_student_lehrveranstaltung.lehreverzeichnis, + vw_student_lehrveranstaltung.studiensemester_kurzbz + FROM + campus.vw_student_lehrveranstaltung + JOIN public.tbl_studiengang USING(studiengang_kz) + WHERE + uid=".$this->db_add_param($user)." + AND studiensemester_kurzbz=".$this->db_add_param($stsem)." + AND lehre=true + AND lehreverzeichnis<>'' + ORDER BY + tbl_studiengang.typ, + tbl_studiengang.kurzbz, + semester, + bezeichnung"; if($result = $this->db_query($qry)) { if($this->db_num_rows($result)>0) @@ -88,7 +105,7 @@ class menu_addon_meinelv extends menu_addon $this->items[] = array('title'=>$lv_obj->bezeichnung_arr[$sprache], 'target'=>'content', 'link'=>'private/lehre/lesson.php?lvid='.$row->lehrveranstaltung_id.'&studiensemester_kurzbz='.$row->studiensemester_kurzbz, - 'name'=>$studiengang_obj->kuerzel_arr[$row->studiengang_kz].$row->semester.' '.$this->CutString($lv_obj->bezeichnung_arr[$sprache], $cutlength) + 'name'=>strtoupper($row->typ.$row->kurzbz).$row->semester.' '.$this->CutString($lv_obj->bezeichnung_arr[$sprache], $cutlength) ); } } @@ -96,7 +113,6 @@ class menu_addon_meinelv extends menu_addon } else echo "Fehler beim Auslesen der LV"; - } } @@ -117,11 +133,33 @@ class menu_addon_meinelv extends menu_addon foreach($stsem_arr as $stsem) { $stsementry=array(); - $qry = "SELECT distinct bezeichnung, studiengang_kz, semester, lehreverzeichnis, tbl_lehrveranstaltung.lehrveranstaltung_id, tbl_lehrveranstaltung.orgform_kurzbz, studiensemester_kurzbz FROM lehre.tbl_lehrveranstaltung, lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter - WHERE tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id AND - tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND - mitarbeiter_uid=".$this->db_add_param($user)." AND tbl_lehreinheit.studiensemester_kurzbz=".$this->db_add_param($stsem)." - ORDER BY studiengang_kz, semester, bezeichnung"; + $qry = "SELECT + distinct + tbl_studiengang.typ, + tbl_studiengang.kurzbz, + tbl_lehrveranstaltung.bezeichnung, + tbl_lehrveranstaltung.studiengang_kz, + tbl_lehrveranstaltung.semester, + tbl_lehrveranstaltung.lehreverzeichnis, + tbl_lehrveranstaltung.lehrveranstaltung_id, + tbl_lehrveranstaltung.orgform_kurzbz, + tbl_lehreinheit.studiensemester_kurzbz + FROM + lehre.tbl_lehrveranstaltung, + lehre.tbl_lehreinheit, + lehre.tbl_lehreinheitmitarbeiter, + public.tbl_studiengang + WHERE + tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id AND + tbl_studiengang.studiengang_kz=tbl_lehrveranstaltung.studiengang_kz AND + tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND + mitarbeiter_uid=".$this->db_add_param($user)." AND + tbl_lehreinheit.studiensemester_kurzbz=".$this->db_add_param($stsem)." + ORDER BY + tbl_studiengang.typ, + tbl_studiengang.kurzbz, + tbl_lehrveranstaltung.semester, + tbl_lehrveranstaltung.bezeichnung"; if($result = $this->db_query($qry)) { @@ -147,9 +185,7 @@ class menu_addon_meinelv extends menu_addon } else { - $stg_obj = new studiengang(); - $stg_obj->load($row->studiengang_kz); - $kurzbz = $stg_obj->kuerzel.'-'.$row->semester.' '.$row->orgform_kurzbz; + $kurzbz = strtoupper($row->typ.$row->kurzbz).'-'.$row->semester.' '.$row->orgform_kurzbz; $this->items[] = array('title'=>$lv_obj->bezeichnung_arr[$sprache], 'target'=>'content', @@ -162,16 +198,6 @@ class menu_addon_meinelv extends menu_addon } else echo "Fehler beim Auslesen des Lehrfaches"; -/* - if(count($stsementry)>0) - { - $this->items[] = array('title'=>$stsem, - 'target'=>'', - 'link'=>'#', - 'name'=>$stsem, - 'childs'=>$stsementry - ); - }*/ } } else From ed8053f700e81fd6197f757455a4d23cbae51309 Mon Sep 17 00:00:00 2001 From: oesi Date: Tue, 20 Sep 2016 16:44:54 +0200 Subject: [PATCH 04/85] Warning behoben bei Anzeige der LVs wenn der Studienplan keine Sprache oder Orgform eingetragen hat --- cms/menu/menu_addon_lehrveranstaltungen_studienplan.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cms/menu/menu_addon_lehrveranstaltungen_studienplan.inc.php b/cms/menu/menu_addon_lehrveranstaltungen_studienplan.inc.php index 0455b87c6..c5f68776e 100644 --- a/cms/menu/menu_addon_lehrveranstaltungen_studienplan.inc.php +++ b/cms/menu/menu_addon_lehrveranstaltungen_studienplan.inc.php @@ -72,7 +72,7 @@ class menu_addon_lehrveranstaltungen_studienplan extends menu_addon $sprachen_obj = new sprache(); $sprachen_obj->getAll(); $sprachen_arr=array(); - + $sprachen_arr['']=''; foreach($sprachen_obj->result as $row) { if(isset($row->bezeichnung_arr[$sprache])) @@ -84,6 +84,7 @@ class menu_addon_lehrveranstaltungen_studienplan extends menu_addon $orgform_obj = new organisationsform(); $orgform_obj->getAll(); $orgform_arr=array(); + $orgform_arr['']=''; foreach($orgform_obj->result as $row) $orgform_arr[$row->orgform_kurzbz]=$row->bezeichnung; @@ -329,7 +330,7 @@ class menu_addon_lehrveranstaltungen_studienplan extends menu_addon $bold='font-weight:bold;'; else $bold=''; - if(!$row->lehrauftrag && defined('CIS_LEHRVERANSTALTUNG_MODULE_LINK') && !CIS_LEHRVERANSTALTUNG_MODULE_LINK) + if(!$row->lehrauftrag && defined('CIS_LEHRVERANSTALTUNG_MODULE_LINK') && !CIS_LEHRVERANSTALTUNG_MODULE_LINK) $this->block.= "
  • ".$this->CutString($row->bezeichnung_arr[$sprache], 21).' '.$row->lehrform_kurzbz."
  • "; else $this->block.= "
  • bezeichnung_arr[$sprache]."\" href=\"private/lehre/lesson.php?lvid=$row->lehrveranstaltung_id&studiensemester_kurzbz=$studiensemester_kurzbz\" target=\"content\">".$this->CutString($row->bezeichnung_arr[$sprache], 21).' '.$row->lehrform_kurzbz."
  • "; From 46e2c967ab68954126a5c5d28ed34291948520c4 Mon Sep 17 00:00:00 2001 From: kindlm Date: Fri, 23 Sep 2016 11:08:56 +0200 Subject: [PATCH 05/85] =?UTF-8?q?Partnerhochschulen=20=C3=9Cbersicht=20CIS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/info/partnerhochschulen.php | 145 ++++++++++++++++++++++++ locale/de-AT/tools.php | 6 +- locale/en-US/tools.php | 6 +- 3 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 cis/private/info/partnerhochschulen.php diff --git a/cis/private/info/partnerhochschulen.php b/cis/private/info/partnerhochschulen.php new file mode 100644 index 000000000..1ade9d031 --- /dev/null +++ b/cis/private/info/partnerhochschulen.php @@ -0,0 +1,145 @@ + + * Manfred Kindl < manfred.kindl@technikum-wien.at > + */ +require_once('../../../config/cis.config.inc.php'); +require_once('../../../include/firma.class.php'); +require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/datum.class.php'); +require_once('../../../include/phrasen.class.php'); +require_once('../../../include/studiengang.class.php'); + +$user = get_uid(); +$sprache = getSprache(); +$p=new phrasen($sprache); + +//$rechte = new benutzerberechtigung(); +//$rechte->getBerechtigungen($user); + +//if(!$rechte->isBerechtigt('basis/service')) +// die('Sie haben keine Berechtigung fuer diese Seite'); + +$datum_obj = new datum(); + +echo ' + + + '.$p->t("services/service").' + + + + + + + + +

    '.$p->t("tools/partnerhochschulenUebersicht").'

    '; + +$stg_kz = (isset($_GET['stg_kz'])?$_GET['stg_kz']:''); + +$firma = new firma(); +echo '
    '; +echo $p->t("global/studiengang").': '; +echo ' + +
    '; + +if($stg_kz!='') +{ + $studiengaenge->load($stg_kz); + $firma->get_firmaorganisationseinheit('', $studiengaenge->oe_kurzbz); +} +else +{ + if(!$firma->getFirmen('Partneruniversität', true)) + die($firma->errormsg); +} +if ($firma->result) +{ + echo ' + + + + + + + + '; + + foreach($firma->result as $row) + { + echo ''; + echo ''; + /*echo ''; + echo ''; + echo '';*/ + echo ''; + } +} +else +{ + echo '

    Kein Eintrag vorhanden

    '; +} +echo ' +
    '.$p->t("global/bezeichnung").'
    ',$row->name,''.($row->content_id!=''?''.$row->bezeichnung.'':$row->bezeichnung).'',$row->beschreibung,''.($row->content_id!=''?'Details':'').'
    + +'; +?> \ No newline at end of file diff --git a/locale/de-AT/tools.php b/locale/de-AT/tools.php index 9756a3e51..afbbb25ea 100755 --- a/locale/de-AT/tools.php +++ b/locale/de-AT/tools.php @@ -46,7 +46,7 @@ $this->phrasen['tools/ampelMitarbeiter']='Mitarbeiter'; $this->phrasen['tools/ampelRestdauer']='Restdauer in Tagen'; $this->phrasen['tools/ampelBestaetigtAm']='Bestätigt am'; $this->phrasen['tools/ampelBereitsBestaetigt']='Diese Ampel wurde bereits bestätigt'; -$this->phrasen['tools/dasAmpelsystemIstEinErinnerungsystem']='Das Ampelsystem ist ein ERINNERUNGS- und BESTÄTIGUNGSSYSTEM, welches Sie auf ausstehende Aufgaben aufmerksam machen soll.
    Die Ampel überprüft NICHT, ob die Aufgabe tatsächlich erledigt wurde. Weitere Details entnehmen Sie bitte dem CIS-Handbuch'; +$this->phrasen['tools/dasAmpelsystemIstEinErinnerungsystem']='Das Ampelsystem ist ein ERINNERUNGS- und BESTÄTIGUNGSSYSTEM, welches Sie auf ausstehende Aufgaben aufmerksam machen soll.'; $this->phrasen['tools/waehlenSieEineOEoderAmpel']='Bitte wählen Sie ein Organisationseinheit und/oder eine Ampel aus dem Dropdown'; $this->phrasen['tools/uebersichtLeitung']='Ampel-Übersicht für LeiterInnen'; @@ -72,4 +72,8 @@ $this->phrasen['tools/telefonklappe']='Telefonklappe'; $this->phrasen['tools/reservieren']='Reservieren'; $this->phrasen['tools/maxPersonen']='Max. Personen'; $this->phrasen['tools/esWurdenKeineErgebnisseGefunden']='Es wurden keine Ergebnisse gefunden.'; + +//Partnerhochschulen +$this->phrasen['tools/partnerhochschulenUebersicht']='Übersicht der Partnerhochschulen'; +$this->phrasen['tools/partnerhochschulenKeinEintrag']='Für diesen Studiengang ist keine Partnerhochschule zugeordnet'; ?> diff --git a/locale/en-US/tools.php b/locale/en-US/tools.php index e5a4c0653..ce65ed007 100755 --- a/locale/en-US/tools.php +++ b/locale/en-US/tools.php @@ -46,7 +46,7 @@ $this->phrasen['tools/ampelMitarbeiter']='Employee'; $this->phrasen['tools/ampelRestdauer']='Remaining Days'; $this->phrasen['tools/ampelBestaetigtAm']='Confirmed on'; $this->phrasen['tools/ampelBereitsBestaetigt']='This notification has already been confirmed'; -$this->phrasen['tools/dasAmpelsystemIstEinErinnerungsystem']='The notification system is a REMINDER and CONFIRMATION SYSTEM that is provided to remind you of outstanding tasks.
    The system does NOT check if the task has actually been completed. For more information, please refer to the CIS Manual.'; +$this->phrasen['tools/dasAmpelsystemIstEinErinnerungsystem']='The notification system is a REMINDER and CONFIRMATION SYSTEM that is provided to remind you of outstanding tasks.'; $this->phrasen['tools/waehlenSieEineOEoderAmpel']='Please select an organizational unit and/or a notification from the drop down menu.'; $this->phrasen['tools/uebersichtLeitung']='Overview of notifications for Heads of Departments'; @@ -72,4 +72,8 @@ $this->phrasen['tools/telefonklappe']='Extension'; $this->phrasen['tools/reservieren']='Reserve room'; $this->phrasen['tools/maxPersonen']='Max. # of people'; $this->phrasen['tools/esWurdenKeineErgebnisseGefunden']='Your search did not return any results.'; + +//Partnerhochschulen +$this->phrasen['tools/partnerhochschulenUebersicht']='Partner Universities'; +$this->phrasen['tools/partnerhochschulenKeinEintrag']='No entry found'; ?> From af1646f9af3940a9436cbc9bd53d0f0f5ec65bdd Mon Sep 17 00:00:00 2001 From: bison-paolo Date: Wed, 28 Sep 2016 10:03:05 +0200 Subject: [PATCH 06/85] phpC(d)I fixes --- tests/codeception/_output/.placeholder | 0 tests/codeception/codeception.dist.yml | 20 + tests/{ => codeception}/codeception.yml | 0 .../tests/acceptance.suite.dist.yml | 21 + .../tests/acceptance/AcceptanceTester.php | 1601 +++++++++++++++++ .../tests/acceptance/CISLoginPageCept.php | 6 + .../tests/acceptance/_bootstrap.php | 2 + .../tests/functional.suite.dist.yml | 10 + .../tests/functional/FunctionalTester.php | 360 ++++ .../tests/functional/_bootstrap.php | 2 + tests/codeception/tests/unit.suite.dist.yml | 7 + .../tests/unit/BasisKlasseTest.php | 27 + tests/codeception/tests/unit/UnitTester.php | 268 +++ tests/codeception/tests/unit/_bootstrap.php | 2 + 14 files changed, 2326 insertions(+) create mode 100644 tests/codeception/_output/.placeholder create mode 100644 tests/codeception/codeception.dist.yml rename tests/{ => codeception}/codeception.yml (100%) create mode 100644 tests/codeception/tests/acceptance.suite.dist.yml create mode 100644 tests/codeception/tests/acceptance/AcceptanceTester.php create mode 100644 tests/codeception/tests/acceptance/CISLoginPageCept.php create mode 100644 tests/codeception/tests/acceptance/_bootstrap.php create mode 100644 tests/codeception/tests/functional.suite.dist.yml create mode 100644 tests/codeception/tests/functional/FunctionalTester.php create mode 100644 tests/codeception/tests/functional/_bootstrap.php create mode 100644 tests/codeception/tests/unit.suite.dist.yml create mode 100644 tests/codeception/tests/unit/BasisKlasseTest.php create mode 100644 tests/codeception/tests/unit/UnitTester.php create mode 100644 tests/codeception/tests/unit/_bootstrap.php diff --git a/tests/codeception/_output/.placeholder b/tests/codeception/_output/.placeholder new file mode 100644 index 000000000..e69de29bb diff --git a/tests/codeception/codeception.dist.yml b/tests/codeception/codeception.dist.yml new file mode 100644 index 000000000..ecf0baef5 --- /dev/null +++ b/tests/codeception/codeception.dist.yml @@ -0,0 +1,20 @@ +actor: Tester +paths: + tests: tests + log: _output + data: _data + helpers: _support +settings: + bootstrap: _bootstrap.php + colors: true + memory_limit: 1024M +modules: + enabled: + - Db: + dsn: 'pgsql:host=localhost;port=5432;dbname=fhctest' + user: 'fhcomplete' + password: 'fhcomplete' + dump: _data/dump.sql + populate: true + cleanup: false + reconnect: false diff --git a/tests/codeception.yml b/tests/codeception/codeception.yml similarity index 100% rename from tests/codeception.yml rename to tests/codeception/codeception.yml diff --git a/tests/codeception/tests/acceptance.suite.dist.yml b/tests/codeception/tests/acceptance.suite.dist.yml new file mode 100644 index 000000000..73a9bbf67 --- /dev/null +++ b/tests/codeception/tests/acceptance.suite.dist.yml @@ -0,0 +1,21 @@ +# Codeception Test Suite Configuration + +# suite for acceptance tests. +# perform tests in browser using the WebDriver or PhpBrowser. +# If you need both WebDriver and PHPBrowser tests - create a separate suite. + +class_name: AcceptanceTester +modules: + enabled: + - Db + - PhpBrowser: + url: 'http://admin:1q2w3@demo.fhcomplete.org/' + config: + Db: + dsn: 'pgsql:host=localhost;port=5432;dbname=fhctest' + user: 'fhcomplete' + password: 'fhcomplete' + dump: _data/dump.sql + populate: true + cleanup: false + reconnect: false diff --git a/tests/codeception/tests/acceptance/AcceptanceTester.php b/tests/codeception/tests/acceptance/AcceptanceTester.php new file mode 100644 index 000000000..9045754f8 --- /dev/null +++ b/tests/codeception/tests/acceptance/AcceptanceTester.php @@ -0,0 +1,1601 @@ +scenario->runStep(new \Codeception\Step\Action('setHeader', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Authenticates user for HTTP_AUTH + * + * @param $username + * @param $password + * @see \Codeception\Module\PhpBrowser::amHttpAuthenticated() + */ + public function amHttpAuthenticated($username, $password) { + return $this->scenario->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Opens the page for the given relative URI. + * + * ``` php + * amOnPage('/'); + * // opens /register page + * $I->amOnPage('/register'); + * ?> + * ``` + * + * @param $page + * @see \Codeception\Module\PhpBrowser::amOnPage() + */ + public function amOnPage($page) { + return $this->scenario->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Open web page at the given absolute URL and sets its hostname as the base host. + * + * ``` php + * amOnUrl('http://codeception.com'); + * $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart + * ?> + * ``` + * @see \Codeception\Module\PhpBrowser::amOnUrl() + */ + public function amOnUrl($url) { + return $this->scenario->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Changes the subdomain for the 'url' configuration parameter. + * Does not open a page; use `amOnPage` for that. + * + * ``` php + * amOnSubdomain('user'); + * $I->amOnPage('/'); + * // moves to http://user.mysite.com/ + * ?> + * ``` + * + * @param $subdomain + * + * @return mixed + * @see \Codeception\Module\PhpBrowser::amOnSubdomain() + */ + public function amOnSubdomain($subdomain) { + return $this->scenario->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Low-level API method. + * If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly + * + * Example: + * + * ``` php + * executeInGuzzle(function (\GuzzleHttp\Client $client) { + * $client->get('/get', ['query' => ['foo' => 'bar']]); + * }); + * ?> + * ``` + * + * It is not recommended to use this command on a regular basis. + * If Codeception lacks important Guzzle Client methods, implement them and submit patches. + * + * @param callable $function + * @see \Codeception\Module\PhpBrowser::executeInGuzzle() + */ + public function executeInGuzzle($function) { + return $this->scenario->runStep(new \Codeception\Step\Action('executeInGuzzle', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Perform a click on a link or a button, given by a locator. + * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. + * For buttons, the "value" attribute, "name" attribute, and inner text are searched. + * For links, the link text is searched. + * For images, the "alt" attribute and inner text of any parent links are searched. + * + * The second parameter is a context (CSS or XPath locator) to narrow the search. + * + * Note that if the locator matches a button of type `submit`, the form will be submitted. + * + * ``` php + * click('Logout'); + * // button of form + * $I->click('Submit'); + * // CSS button + * $I->click('#form input[type=submit]'); + * // XPath + * $I->click('//form/*[@type=submit]'); + * // link in context + * $I->click('Logout', '#nav'); + * // using strict locator + * $I->click(['link' => 'Login']); + * ?> + * ``` + * + * @param $link + * @param $context + * @see \Codeception\Lib\InnerBrowser::click() + */ + public function click($link, $context = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('click', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current page contains the given string. + * Specify a locator as the second parameter to match a specific region. + * + * ``` php + * see('Logout'); // I can suppose user is logged in + * $I->see('Sign Up','h1'); // I can suppose it's a signup page + * $I->see('Sign Up','//body/h1'); // with XPath + * ?> + * ``` + * + * @param $text + * @param null $selector + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::see() + */ + public function canSee($text, $selector = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current page contains the given string. + * Specify a locator as the second parameter to match a specific region. + * + * ``` php + * see('Logout'); // I can suppose user is logged in + * $I->see('Sign Up','h1'); // I can suppose it's a signup page + * $I->see('Sign Up','//body/h1'); // with XPath + * ?> + * ``` + * + * @param $text + * @param null $selector + * @see \Codeception\Lib\InnerBrowser::see() + */ + public function see($text, $selector = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('see', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current page doesn't contain the text specified. + * Give a locator as the second parameter to match a specific region. + * + * ```php + * dontSee('Login'); // I can suppose user is already logged in + * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page + * $I->dontSee('Sign Up','//body/h1'); // with XPath + * ?> + * ``` + * + * @param $text + * @param null $selector + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSee() + */ + public function cantSee($text, $selector = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current page doesn't contain the text specified. + * Give a locator as the second parameter to match a specific region. + * + * ```php + * dontSee('Login'); // I can suppose user is already logged in + * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page + * $I->dontSee('Sign Up','//body/h1'); // with XPath + * ?> + * ``` + * + * @param $text + * @param null $selector + * @see \Codeception\Lib\InnerBrowser::dontSee() + */ + public function dontSee($text, $selector = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that there's a link with the specified text. + * Give a full URL as the second parameter to match links with that exact URL. + * + * ``` php + * seeLink('Logout'); // matches Logout + * $I->seeLink('Logout','/logout'); // matches Logout + * ?> + * ``` + * + * @param $text + * @param null $url + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeLink() + */ + public function canSeeLink($text, $url = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that there's a link with the specified text. + * Give a full URL as the second parameter to match links with that exact URL. + * + * ``` php + * seeLink('Logout'); // matches Logout + * $I->seeLink('Logout','/logout'); // matches Logout + * ?> + * ``` + * + * @param $text + * @param null $url + * @see \Codeception\Lib\InnerBrowser::seeLink() + */ + public function seeLink($text, $url = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the page doesn't contain a link with the given string. + * If the second parameter is given, only links with a matching "href" attribute will be checked. + * + * ``` php + * dontSeeLink('Logout'); // I suppose user is not logged in + * $I->dontSeeLink('Checkout now', '/store/cart.php'); + * ?> + * ``` + * + * @param $text + * @param null $url + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeLink() + */ + public function cantSeeLink($text, $url = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the page doesn't contain a link with the given string. + * If the second parameter is given, only links with a matching "href" attribute will be checked. + * + * ``` php + * dontSeeLink('Logout'); // I suppose user is not logged in + * $I->dontSeeLink('Checkout now', '/store/cart.php'); + * ?> + * ``` + * + * @param $text + * @param null $url + * @see \Codeception\Lib\InnerBrowser::dontSeeLink() + */ + public function dontSeeLink($text, $url = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that current URI contains the given string. + * + * ``` php + * seeInCurrentUrl('home'); + * // to match: /users/1 + * $I->seeInCurrentUrl('/users/'); + * ?> + * ``` + * + * @param $uri + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() + */ + public function canSeeInCurrentUrl($uri) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that current URI contains the given string. + * + * ``` php + * seeInCurrentUrl('home'); + * // to match: /users/1 + * $I->seeInCurrentUrl('/users/'); + * ?> + * ``` + * + * @param $uri + * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() + */ + public function seeInCurrentUrl($uri) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current URI doesn't contain the given string. + * + * ``` php + * dontSeeInCurrentUrl('/users/'); + * ?> + * ``` + * + * @param $uri + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() + */ + public function cantSeeInCurrentUrl($uri) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current URI doesn't contain the given string. + * + * ``` php + * dontSeeInCurrentUrl('/users/'); + * ?> + * ``` + * + * @param $uri + * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() + */ + public function dontSeeInCurrentUrl($uri) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current URL is equal to the given string. + * Unlike `seeInCurrentUrl`, this only matches the full URL. + * + * ``` php + * seeCurrentUrlEquals('/'); + * ?> + * ``` + * + * @param $uri + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() + */ + public function canSeeCurrentUrlEquals($uri) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current URL is equal to the given string. + * Unlike `seeInCurrentUrl`, this only matches the full URL. + * + * ``` php + * seeCurrentUrlEquals('/'); + * ?> + * ``` + * + * @param $uri + * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() + */ + public function seeCurrentUrlEquals($uri) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current URL doesn't equal the given string. + * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. + * + * ``` php + * dontSeeCurrentUrlEquals('/'); + * ?> + * ``` + * + * @param $uri + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() + */ + public function cantSeeCurrentUrlEquals($uri) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current URL doesn't equal the given string. + * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. + * + * ``` php + * dontSeeCurrentUrlEquals('/'); + * ?> + * ``` + * + * @param $uri + * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() + */ + public function dontSeeCurrentUrlEquals($uri) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current URL matches the given regular expression. + * + * ``` php + * seeCurrentUrlMatches('~$/users/(\d+)~'); + * ?> + * ``` + * + * @param $uri + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() + */ + public function canSeeCurrentUrlMatches($uri) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current URL matches the given regular expression. + * + * ``` php + * seeCurrentUrlMatches('~$/users/(\d+)~'); + * ?> + * ``` + * + * @param $uri + * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() + */ + public function seeCurrentUrlMatches($uri) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that current url doesn't match the given regular expression. + * + * ``` php + * dontSeeCurrentUrlMatches('~$/users/(\d+)~'); + * ?> + * ``` + * + * @param $uri + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() + */ + public function cantSeeCurrentUrlMatches($uri) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that current url doesn't match the given regular expression. + * + * ``` php + * dontSeeCurrentUrlMatches('~$/users/(\d+)~'); + * ?> + * ``` + * + * @param $uri + * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() + */ + public function dontSeeCurrentUrlMatches($uri) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Executes the given regular expression against the current URI and returns the first match. + * If no parameters are provided, the full URI is returned. + * + * ``` php + * grabFromCurrentUrl('~$/user/(\d+)/~'); + * $uri = $I->grabFromCurrentUrl(); + * ?> + * ``` + * + * @param null $uri + * + * @internal param $url + * @return mixed + * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl() + */ + public function grabFromCurrentUrl($uri = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the specified checkbox is checked. + * + * ``` php + * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms + * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. + * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); + * ?> + * ``` + * + * @param $checkbox + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() + */ + public function canSeeCheckboxIsChecked($checkbox) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the specified checkbox is checked. + * + * ``` php + * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms + * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. + * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); + * ?> + * ``` + * + * @param $checkbox + * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() + */ + public function seeCheckboxIsChecked($checkbox) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Check that the specified checkbox is unchecked. + * + * ``` php + * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms + * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. + * ?> + * ``` + * + * @param $checkbox + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() + */ + public function cantSeeCheckboxIsChecked($checkbox) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Check that the specified checkbox is unchecked. + * + * ``` php + * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms + * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. + * ?> + * ``` + * + * @param $checkbox + * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() + */ + public function dontSeeCheckboxIsChecked($checkbox) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given input field or textarea contains the given value. + * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. + * + * ``` php + * seeInField('Body','Type your comment here'); + * $I->seeInField('form textarea[name=body]','Type your comment here'); + * $I->seeInField('form input[type=hidden]','hidden_value'); + * $I->seeInField('#searchform input','Search'); + * $I->seeInField('//form/*[@name=search]','Search'); + * $I->seeInField(['name' => 'search'], 'Search'); + * ?> + * ``` + * + * @param $field + * @param $value + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeInField() + */ + public function canSeeInField($field, $value) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given input field or textarea contains the given value. + * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. + * + * ``` php + * seeInField('Body','Type your comment here'); + * $I->seeInField('form textarea[name=body]','Type your comment here'); + * $I->seeInField('form input[type=hidden]','hidden_value'); + * $I->seeInField('#searchform input','Search'); + * $I->seeInField('//form/*[@name=search]','Search'); + * $I->seeInField(['name' => 'search'], 'Search'); + * ?> + * ``` + * + * @param $field + * @param $value + * @see \Codeception\Lib\InnerBrowser::seeInField() + */ + public function seeInField($field, $value) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that an input field or textarea doesn't contain the given value. + * For fuzzy locators, the field is matched by label text, CSS and XPath. + * + * ``` php + * dontSeeInField('Body','Type your comment here'); + * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); + * $I->dontSeeInField('form input[type=hidden]','hidden_value'); + * $I->dontSeeInField('#searchform input','Search'); + * $I->dontSeeInField('//form/*[@name=search]','Search'); + * $I->dontSeeInField(['name' => 'search'], 'Search'); + * ?> + * ``` + * + * @param $field + * @param $value + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeInField() + */ + public function cantSeeInField($field, $value) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that an input field or textarea doesn't contain the given value. + * For fuzzy locators, the field is matched by label text, CSS and XPath. + * + * ``` php + * dontSeeInField('Body','Type your comment here'); + * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); + * $I->dontSeeInField('form input[type=hidden]','hidden_value'); + * $I->dontSeeInField('#searchform input','Search'); + * $I->dontSeeInField('//form/*[@name=search]','Search'); + * $I->dontSeeInField(['name' => 'search'], 'Search'); + * ?> + * ``` + * + * @param $field + * @param $value + * @see \Codeception\Lib\InnerBrowser::dontSeeInField() + */ + public function dontSeeInField($field, $value) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Submits the given form on the page, optionally with the given form values. + * Give the form fields values as an array. + * + * Skipped fields will be filled by their values from the page. + * You don't need to click the 'Submit' button afterwards. + * This command itself triggers the request to form's action. + * + * You can optionally specify what button's value to include + * in the request with the last parameter as an alternative to + * explicitly setting its value in the second parameter, as + * button values are not otherwise included in the request. + * + * Examples: + * + * ``` php + * submitForm('#login', array('login' => 'davert', 'password' => '123456')); + * // or + * $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'), 'submitButtonName'); + * + * ``` + * + * For example, given this sample "Sign Up" form: + * + * ``` html + *
    + * Login:
    + * Password:
    + * Do you agree to out terms?
    + * Select pricing plan + * + *
    + * ``` + * + * You could write the following to submit it: + * + * ``` php + * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)), 'submitButton'); + * + * ``` + * Note that "2" will be the submitted value for the "plan" field, as it is the selected option. + * + * You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm. + * + * ```php + * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true))); + * + * ``` + * + * @param $selector + * @param $params + * @param $button + * @see \Codeception\Lib\InnerBrowser::submitForm() + */ + public function submitForm($selector, $params, $button = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Fills a text field or textarea with the given string. + * + * ``` php + * fillField("//input[@type='text']", "Hello World!"); + * $I->fillField(['name' => 'email'], 'jon@mail.com'); + * ?> + * ``` + * + * @param $field + * @param $value + * @see \Codeception\Lib\InnerBrowser::fillField() + */ + public function fillField($field, $value) { + return $this->scenario->runStep(new \Codeception\Step\Action('fillField', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Selects an option in a select tag or in radio button group. + * + * ``` php + * selectOption('form select[name=account]', 'Premium'); + * $I->selectOption('form input[name=payment]', 'Monthly'); + * $I->selectOption('//form/select[@name=account]', 'Monthly'); + * ?> + * ``` + * + * Provide an array for the second argument to select multiple options: + * + * ``` php + * selectOption('Which OS do you use?', array('Windows','Linux')); + * ?> + * ``` + * + * @param $select + * @param $option + * @see \Codeception\Lib\InnerBrowser::selectOption() + */ + public function selectOption($select, $option) { + return $this->scenario->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. + * + * ``` php + * checkOption('#agree'); + * ?> + * ``` + * + * @param $option + * @see \Codeception\Lib\InnerBrowser::checkOption() + */ + public function checkOption($option) { + return $this->scenario->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Unticks a checkbox. + * + * ``` php + * uncheckOption('#notify'); + * ?> + * ``` + * + * @param $option + * @see \Codeception\Lib\InnerBrowser::uncheckOption() + */ + public function uncheckOption($option) { + return $this->scenario->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Attaches a file relative to the Codeception data directory to the given file upload field. + * + * ``` php + * attachFile('input[@type="file"]', 'prices.xls'); + * ?> + * ``` + * + * @param $field + * @param $filename + * @see \Codeception\Lib\InnerBrowser::attachFile() + */ + public function attachFile($field, $filename) { + return $this->scenario->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * If your page triggers an ajax request, you can perform it manually. + * This action sends a GET ajax request with specified params. + * + * See ->sendAjaxPostRequest for examples. + * + * @param $uri + * @param $params + * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest() + */ + public function sendAjaxGetRequest($uri, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * If your page triggers an ajax request, you can perform it manually. + * This action sends a POST ajax request with specified params. + * Additional params can be passed as array. + * + * Example: + * + * Imagine that by clicking checkbox you trigger ajax request which updates user settings. + * We emulate that click by running this ajax request manually. + * + * ``` php + * sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST + * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET + * + * ``` + * + * @param $uri + * @param $params + * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest() + */ + public function sendAjaxPostRequest($uri, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * If your page triggers an ajax request, you can perform it manually. + * This action sends an ajax request with specified method and params. + * + * Example: + * + * You need to perform an ajax request specifying the HTTP method. + * + * ``` php + * sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title')); + * + * ``` + * + * @param $method + * @param $uri + * @param $params + * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest() + */ + public function sendAjaxRequest($method, $uri, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Finds and returns the text contents of the given element. + * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression. + * + * ``` php + * grabTextFrom('h1'); + * $heading = $I->grabTextFrom('descendant-or-self::h1'); + * $value = $I->grabTextFrom('~ + * ``` + * + * @param $cssOrXPathOrRegex + * + * @return mixed + * @see \Codeception\Lib\InnerBrowser::grabTextFrom() + */ + public function grabTextFrom($cssOrXPathOrRegex) { + return $this->scenario->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Grabs the value of the given attribute value from the given element. + * Fails if element is not found. + * + * ``` php + * grabAttributeFrom('#tooltip', 'title'); + * ?> + * ``` + * + * + * @param $cssOrXpath + * @param $attribute + * @internal param $element + * @return mixed + * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom() + */ + public function grabAttributeFrom($cssOrXpath, $attribute) { + return $this->scenario->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param $field + * + * @return array|mixed|null|string + * @see \Codeception\Lib\InnerBrowser::grabValueFrom() + */ + public function grabValueFrom($field) { + return $this->scenario->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Sets a cookie with the given name and value. + * You can set additional cookie params like `domain`, `path`, `expire`, `secure` in array passed as last argument. + * + * ``` php + * setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); + * ?> + * ``` + * + * @param $name + * @param $val + * @param array $params + * @internal param $cookie + * @internal param $value + * + * @return mixed + * @see \Codeception\Lib\InnerBrowser::setCookie() + */ + public function setCookie($name, $val, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Grabs a cookie value. + * You can set additional cookie params like `domain`, `path` in array passed as last argument. + * + * @param $cookie + * + * @param array $params + * @return mixed + * @see \Codeception\Lib\InnerBrowser::grabCookie() + */ + public function grabCookie($name, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that a cookie with the given name is set. + * You can set additional cookie params like `domain`, `path` as array passed in last argument. + * + * ``` php + * seeCookie('PHPSESSID'); + * ?> + * ``` + * + * @param $cookie + * @param array $params + * @return mixed + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeCookie() + */ + public function canSeeCookie($name, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that a cookie with the given name is set. + * You can set additional cookie params like `domain`, `path` as array passed in last argument. + * + * ``` php + * seeCookie('PHPSESSID'); + * ?> + * ``` + * + * @param $cookie + * @param array $params + * @return mixed + * @see \Codeception\Lib\InnerBrowser::seeCookie() + */ + public function seeCookie($name, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that there isn't a cookie with the given name. + * You can set additional cookie params like `domain`, `path` as array passed in last argument. + * + * @param $cookie + * + * @param array $params + * @return mixed + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() + */ + public function cantSeeCookie($name, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that there isn't a cookie with the given name. + * You can set additional cookie params like `domain`, `path` as array passed in last argument. + * + * @param $cookie + * + * @param array $params + * @return mixed + * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() + */ + public function dontSeeCookie($name, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Unsets cookie with the given name. + * You can set additional cookie params like `domain`, `path` in array passed as last argument. + * + * @param $cookie + * + * @param array $params + * @return mixed + * @see \Codeception\Lib\InnerBrowser::resetCookie() + */ + public function resetCookie($name, $params = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given element exists on the page and is visible. + * You can also specify expected attributes of this element. + * + * ``` php + * seeElement('.error'); + * $I->seeElement('//form/input[1]'); + * $I->seeElement('input', ['name' => 'login']); + * $I->seeElement('input', ['value' => '123456']); + * + * // strict locator in first arg, attributes in second + * $I->seeElement(['css' => 'form input'], ['name' => 'login']); + * ?> + * ``` + * + * @param $selector + * @param array $attributes + * @return + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeElement() + */ + public function canSeeElement($selector, $attributes = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given element exists on the page and is visible. + * You can also specify expected attributes of this element. + * + * ``` php + * seeElement('.error'); + * $I->seeElement('//form/input[1]'); + * $I->seeElement('input', ['name' => 'login']); + * $I->seeElement('input', ['value' => '123456']); + * + * // strict locator in first arg, attributes in second + * $I->seeElement(['css' => 'form input'], ['name' => 'login']); + * ?> + * ``` + * + * @param $selector + * @param array $attributes + * @return + * @see \Codeception\Lib\InnerBrowser::seeElement() + */ + public function seeElement($selector, $attributes = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given element is invisible or not present on the page. + * You can also specify expected attributes of this element. + * + * ``` php + * dontSeeElement('.error'); + * $I->dontSeeElement('//form/input[1]'); + * $I->dontSeeElement('input', ['name' => 'login']); + * $I->dontSeeElement('input', ['value' => '123456']); + * ?> + * ``` + * + * @param $selector + * @param array $attributes + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeElement() + */ + public function cantSeeElement($selector, $attributes = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given element is invisible or not present on the page. + * You can also specify expected attributes of this element. + * + * ``` php + * dontSeeElement('.error'); + * $I->dontSeeElement('//form/input[1]'); + * $I->dontSeeElement('input', ['name' => 'login']); + * $I->dontSeeElement('input', ['value' => '123456']); + * ?> + * ``` + * + * @param $selector + * @param array $attributes + * @see \Codeception\Lib\InnerBrowser::dontSeeElement() + */ + public function dontSeeElement($selector, $attributes = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that there are a certain number of elements matched by the given locator on the page. + * + * ``` php + * seeNumberOfElements('tr', 10); + * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements + * ?> + * ``` + * @param $selector + * @param mixed $expected: + * - string: strict number + * - array: range of numbers [0,10] + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() + */ + public function canSeeNumberOfElements($selector, $expected) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that there are a certain number of elements matched by the given locator on the page. + * + * ``` php + * seeNumberOfElements('tr', 10); + * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements + * ?> + * ``` + * @param $selector + * @param mixed $expected: + * - string: strict number + * - array: range of numbers [0,10] + * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() + */ + public function seeNumberOfElements($selector, $expected) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given option is selected. + * + * ``` php + * seeOptionIsSelected('#form input[name=payment]', 'Visa'); + * ?> + * ``` + * + * @param $selector + * @param $optionText + * + * @return mixed + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() + */ + public function canSeeOptionIsSelected($select, $optionText) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given option is selected. + * + * ``` php + * seeOptionIsSelected('#form input[name=payment]', 'Visa'); + * ?> + * ``` + * + * @param $selector + * @param $optionText + * + * @return mixed + * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() + */ + public function seeOptionIsSelected($select, $optionText) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given option is not selected. + * + * ``` php + * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); + * ?> + * ``` + * + * @param $selector + * @param $optionText + * + * @return mixed + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() + */ + public function cantSeeOptionIsSelected($select, $optionText) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the given option is not selected. + * + * ``` php + * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); + * ?> + * ``` + * + * @param $selector + * @param $optionText + * + * @return mixed + * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() + */ + public function dontSeeOptionIsSelected($select, $optionText) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that current page has 404 response status code. + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seePageNotFound() + */ + public function canSeePageNotFound() { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Asserts that current page has 404 response status code. + * @see \Codeception\Lib\InnerBrowser::seePageNotFound() + */ + public function seePageNotFound() { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that response code is equal to value provided. + * + * @param $code + * + * @return mixed + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() + */ + public function canSeeResponseCodeIs($code) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that response code is equal to value provided. + * + * @param $code + * + * @return mixed + * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() + */ + public function seeResponseCodeIs($code) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the page title contains the given string. + * + * ``` php + * seeInTitle('Blog - Post #1'); + * ?> + * ``` + * + * @param $title + * + * @return mixed + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::seeInTitle() + */ + public function canSeeInTitle($title) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the page title contains the given string. + * + * ``` php + * seeInTitle('Blog - Post #1'); + * ?> + * ``` + * + * @param $title + * + * @return mixed + * @see \Codeception\Lib\InnerBrowser::seeInTitle() + */ + public function seeInTitle($title) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the page title does not contain the given string. + * + * @param $title + * + * @return mixed + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() + */ + public function cantSeeInTitle($title) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the page title does not contain the given string. + * + * @param $title + * + * @return mixed + * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() + */ + public function dontSeeInTitle($title) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args())); + } +} diff --git a/tests/codeception/tests/acceptance/CISLoginPageCept.php b/tests/codeception/tests/acceptance/CISLoginPageCept.php new file mode 100644 index 000000000..14668afa1 --- /dev/null +++ b/tests/codeception/tests/acceptance/CISLoginPageCept.php @@ -0,0 +1,6 @@ +wantTo('CIS Startseite Testen'); +//$I->amOnPage('/cis/index.html'); +//$I->see('Powered by FH Complete'); +?> diff --git a/tests/codeception/tests/acceptance/_bootstrap.php b/tests/codeception/tests/acceptance/_bootstrap.php new file mode 100644 index 000000000..8a8855580 --- /dev/null +++ b/tests/codeception/tests/acceptance/_bootstrap.php @@ -0,0 +1,2 @@ +scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Opens a file and stores it's content. + * + * Usage: + * + * ``` php + * openFile('composer.json'); + * $I->seeInThisFile('codeception/codeception'); + * ?> + * ``` + * + * @param $filename + * @see \Codeception\Module\Filesystem::openFile() + */ + public function openFile($filename) { + return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Deletes a file + * + * ``` php + * deleteFile('composer.lock'); + * ?> + * ``` + * + * @param $filename + * @see \Codeception\Module\Filesystem::deleteFile() + */ + public function deleteFile($filename) { + return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Deletes directory with all subdirectories + * + * ``` php + * deleteDir('vendor'); + * ?> + * ``` + * + * @param $dirname + * @see \Codeception\Module\Filesystem::deleteDir() + */ + public function deleteDir($dirname) { + return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Copies directory with all contents + * + * ``` php + * copyDir('vendor','old_vendor'); + * ?> + * ``` + * + * @param $src + * @param $dst + * @see \Codeception\Module\Filesystem::copyDir() + */ + public function copyDir($src, $dst) { + return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks If opened file has `text` in it. + * + * Usage: + * + * ``` php + * openFile('composer.json'); + * $I->seeInThisFile('codeception/codeception'); + * ?> + * ``` + * + * @param $text + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Module\Filesystem::seeInThisFile() + */ + public function canSeeInThisFile($text) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks If opened file has `text` in it. + * + * Usage: + * + * ``` php + * openFile('composer.json'); + * $I->seeInThisFile('codeception/codeception'); + * ?> + * ``` + * + * @param $text + * @see \Codeception\Module\Filesystem::seeInThisFile() + */ + public function seeInThisFile($text) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks the strict matching of file contents. + * Unlike `seeInThisFile` will fail if file has something more than expected lines. + * Better to use with HEREDOC strings. + * Matching is done after removing "\r" chars from file content. + * + * ``` php + * openFile('process.pid'); + * $I->seeFileContentsEqual('3192'); + * ?> + * ``` + * + * @param $text + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Module\Filesystem::seeFileContentsEqual() + */ + public function canSeeFileContentsEqual($text) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks the strict matching of file contents. + * Unlike `seeInThisFile` will fail if file has something more than expected lines. + * Better to use with HEREDOC strings. + * Matching is done after removing "\r" chars from file content. + * + * ``` php + * openFile('process.pid'); + * $I->seeFileContentsEqual('3192'); + * ?> + * ``` + * + * @param $text + * @see \Codeception\Module\Filesystem::seeFileContentsEqual() + */ + public function seeFileContentsEqual($text) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks If opened file doesn't contain `text` in it + * + * ``` php + * openFile('composer.json'); + * $I->dontSeeInThisFile('codeception/codeception'); + * ?> + * ``` + * + * @param $text + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Module\Filesystem::dontSeeInThisFile() + */ + public function cantSeeInThisFile($text) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks If opened file doesn't contain `text` in it + * + * ``` php + * openFile('composer.json'); + * $I->dontSeeInThisFile('codeception/codeception'); + * ?> + * ``` + * + * @param $text + * @see \Codeception\Module\Filesystem::dontSeeInThisFile() + */ + public function dontSeeInThisFile($text) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Deletes a file + * @see \Codeception\Module\Filesystem::deleteThisFile() + */ + public function deleteThisFile() { + return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks if file exists in path. + * Opens a file when it's exists + * + * ``` php + * seeFileFound('UserModel.php','app/models'); + * ?> + * ``` + * + * @param $filename + * @param string $path + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Module\Filesystem::seeFileFound() + */ + public function canSeeFileFound($filename, $path = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks if file exists in path. + * Opens a file when it's exists + * + * ``` php + * seeFileFound('UserModel.php','app/models'); + * ?> + * ``` + * + * @param $filename + * @param string $path + * @see \Codeception\Module\Filesystem::seeFileFound() + */ + public function seeFileFound($filename, $path = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks if file does not exists in path + * + * @param $filename + * @param string $path + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Module\Filesystem::dontSeeFileFound() + */ + public function cantSeeFileFound($filename, $path = null) { + return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks if file does not exists in path + * + * @param $filename + * @param string $path + * @see \Codeception\Module\Filesystem::dontSeeFileFound() + */ + public function dontSeeFileFound($filename, $path = null) { + return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Erases directory contents + * + * ``` php + * cleanDir('logs'); + * ?> + * ``` + * + * @param $dirname + * @see \Codeception\Module\Filesystem::cleanDir() + */ + public function cleanDir($dirname) { + return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Saves contents to file + * + * @param $filename + * @param $contents + * @see \Codeception\Module\Filesystem::writeToFile() + */ + public function writeToFile($filename, $contents) { + return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args())); + } +} diff --git a/tests/codeception/tests/functional/_bootstrap.php b/tests/codeception/tests/functional/_bootstrap.php new file mode 100644 index 000000000..8a8855580 --- /dev/null +++ b/tests/codeception/tests/functional/_bootstrap.php @@ -0,0 +1,2 @@ +errormsg=true; + $this->assertTrue($bc->getErrorMsg()); + } + +} diff --git a/tests/codeception/tests/unit/UnitTester.php b/tests/codeception/tests/unit/UnitTester.php new file mode 100644 index 000000000..1b95ec3d2 --- /dev/null +++ b/tests/codeception/tests/unit/UnitTester.php @@ -0,0 +1,268 @@ +scenario->runStep(new \Codeception\Step\Action('assertEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that two variables are not equal + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertNotEquals() + */ + public function assertNotEquals($expected, $actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that expected is greater than actual + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertGreaterThan() + */ + public function assertGreaterThan($expected, $actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @deprecated + * @see \Codeception\Module\Asserts::assertGreaterThen() + */ + public function assertGreaterThen($expected, $actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThen', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that expected is greater or equal than actual + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertGreaterThanOrEqual() + */ + public function assertGreaterThanOrEqual($expected, $actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @deprecated + * @see \Codeception\Module\Asserts::assertGreaterThenOrEqual() + */ + public function assertGreaterThenOrEqual($expected, $actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThenOrEqual', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that expected is less than actual + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertLessThan() + */ + public function assertLessThan($expected, $actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that expected is less or equal than actual + * + * @param $expected + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertLessThanOrEqual() + */ + public function assertLessThanOrEqual($expected, $actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that haystack contains needle + * + * @param $needle + * @param $haystack + * @param string $message + * @see \Codeception\Module\Asserts::assertContains() + */ + public function assertContains($needle, $haystack, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertContains', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that haystack doesn't contain needle. + * + * @param $needle + * @param $haystack + * @param string $message + * @see \Codeception\Module\Asserts::assertNotContains() + */ + public function assertNotContains($needle, $haystack, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that variable is empty. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertEmpty() + */ + public function assertEmpty($actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that variable is not empty. + * + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertNotEmpty() + */ + public function assertNotEmpty($actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that variable is NULL + * + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertNull() + */ + public function assertNull($actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertNull', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that variable is not NULL + * + * @param $actual + * @param string $message + * @see \Codeception\Module\Asserts::assertNotNull() + */ + public function assertNotNull($actual, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that condition is positive. + * + * @param $condition + * @param string $message + * @see \Codeception\Module\Asserts::assertTrue() + */ + public function assertTrue($condition, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertTrue', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that condition is negative. + * + * @param $condition + * @param string $message + * @see \Codeception\Module\Asserts::assertFalse() + */ + public function assertFalse($condition, $message = null) { + return $this->scenario->runStep(new \Codeception\Step\Action('assertFalse', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Fails the test with message. + * + * @param $message + * @see \Codeception\Module\Asserts::fail() + */ + public function fail($message) { + return $this->scenario->runStep(new \Codeception\Step\Action('fail', func_get_args())); + } +} diff --git a/tests/codeception/tests/unit/_bootstrap.php b/tests/codeception/tests/unit/_bootstrap.php new file mode 100644 index 000000000..8a8855580 --- /dev/null +++ b/tests/codeception/tests/unit/_bootstrap.php @@ -0,0 +1,2 @@ + Date: Wed, 28 Sep 2016 11:17:18 +0200 Subject: [PATCH 07/85] phpC(i)D fixes II --- phpci.yml | 21 +- tests/codeception/acceptance.suite.yml | 14 - .../acceptance/AcceptanceTester.php | 1601 ----------------- .../acceptance/CISLoginPageCept.php | 6 - tests/codeception/acceptance/_bootstrap.php | 2 - tests/codeception/codeception.yml | 17 - tests/codeception/functional.suite.yml | 9 - .../functional/FunctionalTester.php | 360 ---- tests/codeception/functional/_bootstrap.php | 2 - tests/codeception/unit.suite.yml | 6 - tests/codeception/unit/BasisKlasseTest.php | 27 - tests/codeception/unit/UnitTester.php | 268 --- tests/codeception/unit/_bootstrap.php | 2 - 13 files changed, 9 insertions(+), 2326 deletions(-) delete mode 100644 tests/codeception/acceptance.suite.yml delete mode 100644 tests/codeception/acceptance/AcceptanceTester.php delete mode 100644 tests/codeception/acceptance/CISLoginPageCept.php delete mode 100644 tests/codeception/acceptance/_bootstrap.php delete mode 100644 tests/codeception/codeception.yml delete mode 100644 tests/codeception/functional.suite.yml delete mode 100644 tests/codeception/functional/FunctionalTester.php delete mode 100644 tests/codeception/functional/_bootstrap.php delete mode 100644 tests/codeception/unit.suite.yml delete mode 100644 tests/codeception/unit/BasisKlasseTest.php delete mode 100644 tests/codeception/unit/UnitTester.php delete mode 100644 tests/codeception/unit/_bootstrap.php diff --git a/phpci.yml b/phpci.yml index 32e465575..08ed79f51 100644 --- a/phpci.yml +++ b/phpci.yml @@ -1,22 +1,19 @@ build_settings: verbose: false prefer_symlink: false + ignore: + - "vendor" + - "tests" setup: test: - codeception: - config: "tests" lint: - php_loc: - php_docblock_checker: - allowed_warnings: -1 -# phing: -# build_file: 'build.xml' -# targets: -# - "deploy" -# php_unit: -# directory: "tests/phpunit/" -# args: "--bootstrap 'test/phpunit/bootstrap.php' --configuration 'tests/phpunit/phpunit.xml'" + directories: + - "application/" + recursive: true + codeception: + config: "tests/codeception/" + path: "tests/codeception/_output/" complete: diff --git a/tests/codeception/acceptance.suite.yml b/tests/codeception/acceptance.suite.yml deleted file mode 100644 index 8a84881eb..000000000 --- a/tests/codeception/acceptance.suite.yml +++ /dev/null @@ -1,14 +0,0 @@ -# Codeception Test Suite Configuration - -# suite for acceptance tests. -# perform tests in browser using the WebDriver or PhpBrowser. -# If you need both WebDriver and PHPBrowser tests - create a separate suite. - -class_name: AcceptanceTester -modules: - enabled: - - PhpBrowser - - AcceptanceHelper - config: - PhpBrowser: - url: 'http://localhost/myapp/' diff --git a/tests/codeception/acceptance/AcceptanceTester.php b/tests/codeception/acceptance/AcceptanceTester.php deleted file mode 100644 index 9045754f8..000000000 --- a/tests/codeception/acceptance/AcceptanceTester.php +++ /dev/null @@ -1,1601 +0,0 @@ -scenario->runStep(new \Codeception\Step\Action('setHeader', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Authenticates user for HTTP_AUTH - * - * @param $username - * @param $password - * @see \Codeception\Module\PhpBrowser::amHttpAuthenticated() - */ - public function amHttpAuthenticated($username, $password) { - return $this->scenario->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Opens the page for the given relative URI. - * - * ``` php - * amOnPage('/'); - * // opens /register page - * $I->amOnPage('/register'); - * ?> - * ``` - * - * @param $page - * @see \Codeception\Module\PhpBrowser::amOnPage() - */ - public function amOnPage($page) { - return $this->scenario->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Open web page at the given absolute URL and sets its hostname as the base host. - * - * ``` php - * amOnUrl('http://codeception.com'); - * $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart - * ?> - * ``` - * @see \Codeception\Module\PhpBrowser::amOnUrl() - */ - public function amOnUrl($url) { - return $this->scenario->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Changes the subdomain for the 'url' configuration parameter. - * Does not open a page; use `amOnPage` for that. - * - * ``` php - * amOnSubdomain('user'); - * $I->amOnPage('/'); - * // moves to http://user.mysite.com/ - * ?> - * ``` - * - * @param $subdomain - * - * @return mixed - * @see \Codeception\Module\PhpBrowser::amOnSubdomain() - */ - public function amOnSubdomain($subdomain) { - return $this->scenario->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Low-level API method. - * If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly - * - * Example: - * - * ``` php - * executeInGuzzle(function (\GuzzleHttp\Client $client) { - * $client->get('/get', ['query' => ['foo' => 'bar']]); - * }); - * ?> - * ``` - * - * It is not recommended to use this command on a regular basis. - * If Codeception lacks important Guzzle Client methods, implement them and submit patches. - * - * @param callable $function - * @see \Codeception\Module\PhpBrowser::executeInGuzzle() - */ - public function executeInGuzzle($function) { - return $this->scenario->runStep(new \Codeception\Step\Action('executeInGuzzle', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Perform a click on a link or a button, given by a locator. - * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. - * For buttons, the "value" attribute, "name" attribute, and inner text are searched. - * For links, the link text is searched. - * For images, the "alt" attribute and inner text of any parent links are searched. - * - * The second parameter is a context (CSS or XPath locator) to narrow the search. - * - * Note that if the locator matches a button of type `submit`, the form will be submitted. - * - * ``` php - * click('Logout'); - * // button of form - * $I->click('Submit'); - * // CSS button - * $I->click('#form input[type=submit]'); - * // XPath - * $I->click('//form/*[@type=submit]'); - * // link in context - * $I->click('Logout', '#nav'); - * // using strict locator - * $I->click(['link' => 'Login']); - * ?> - * ``` - * - * @param $link - * @param $context - * @see \Codeception\Lib\InnerBrowser::click() - */ - public function click($link, $context = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('click', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current page contains the given string. - * Specify a locator as the second parameter to match a specific region. - * - * ``` php - * see('Logout'); // I can suppose user is logged in - * $I->see('Sign Up','h1'); // I can suppose it's a signup page - * $I->see('Sign Up','//body/h1'); // with XPath - * ?> - * ``` - * - * @param $text - * @param null $selector - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::see() - */ - public function canSee($text, $selector = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current page contains the given string. - * Specify a locator as the second parameter to match a specific region. - * - * ``` php - * see('Logout'); // I can suppose user is logged in - * $I->see('Sign Up','h1'); // I can suppose it's a signup page - * $I->see('Sign Up','//body/h1'); // with XPath - * ?> - * ``` - * - * @param $text - * @param null $selector - * @see \Codeception\Lib\InnerBrowser::see() - */ - public function see($text, $selector = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('see', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current page doesn't contain the text specified. - * Give a locator as the second parameter to match a specific region. - * - * ```php - * dontSee('Login'); // I can suppose user is already logged in - * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page - * $I->dontSee('Sign Up','//body/h1'); // with XPath - * ?> - * ``` - * - * @param $text - * @param null $selector - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSee() - */ - public function cantSee($text, $selector = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current page doesn't contain the text specified. - * Give a locator as the second parameter to match a specific region. - * - * ```php - * dontSee('Login'); // I can suppose user is already logged in - * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page - * $I->dontSee('Sign Up','//body/h1'); // with XPath - * ?> - * ``` - * - * @param $text - * @param null $selector - * @see \Codeception\Lib\InnerBrowser::dontSee() - */ - public function dontSee($text, $selector = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that there's a link with the specified text. - * Give a full URL as the second parameter to match links with that exact URL. - * - * ``` php - * seeLink('Logout'); // matches Logout - * $I->seeLink('Logout','/logout'); // matches Logout - * ?> - * ``` - * - * @param $text - * @param null $url - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeLink() - */ - public function canSeeLink($text, $url = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that there's a link with the specified text. - * Give a full URL as the second parameter to match links with that exact URL. - * - * ``` php - * seeLink('Logout'); // matches Logout - * $I->seeLink('Logout','/logout'); // matches Logout - * ?> - * ``` - * - * @param $text - * @param null $url - * @see \Codeception\Lib\InnerBrowser::seeLink() - */ - public function seeLink($text, $url = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the page doesn't contain a link with the given string. - * If the second parameter is given, only links with a matching "href" attribute will be checked. - * - * ``` php - * dontSeeLink('Logout'); // I suppose user is not logged in - * $I->dontSeeLink('Checkout now', '/store/cart.php'); - * ?> - * ``` - * - * @param $text - * @param null $url - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeLink() - */ - public function cantSeeLink($text, $url = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the page doesn't contain a link with the given string. - * If the second parameter is given, only links with a matching "href" attribute will be checked. - * - * ``` php - * dontSeeLink('Logout'); // I suppose user is not logged in - * $I->dontSeeLink('Checkout now', '/store/cart.php'); - * ?> - * ``` - * - * @param $text - * @param null $url - * @see \Codeception\Lib\InnerBrowser::dontSeeLink() - */ - public function dontSeeLink($text, $url = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that current URI contains the given string. - * - * ``` php - * seeInCurrentUrl('home'); - * // to match: /users/1 - * $I->seeInCurrentUrl('/users/'); - * ?> - * ``` - * - * @param $uri - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() - */ - public function canSeeInCurrentUrl($uri) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that current URI contains the given string. - * - * ``` php - * seeInCurrentUrl('home'); - * // to match: /users/1 - * $I->seeInCurrentUrl('/users/'); - * ?> - * ``` - * - * @param $uri - * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() - */ - public function seeInCurrentUrl($uri) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URI doesn't contain the given string. - * - * ``` php - * dontSeeInCurrentUrl('/users/'); - * ?> - * ``` - * - * @param $uri - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() - */ - public function cantSeeInCurrentUrl($uri) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URI doesn't contain the given string. - * - * ``` php - * dontSeeInCurrentUrl('/users/'); - * ?> - * ``` - * - * @param $uri - * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() - */ - public function dontSeeInCurrentUrl($uri) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URL is equal to the given string. - * Unlike `seeInCurrentUrl`, this only matches the full URL. - * - * ``` php - * seeCurrentUrlEquals('/'); - * ?> - * ``` - * - * @param $uri - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() - */ - public function canSeeCurrentUrlEquals($uri) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URL is equal to the given string. - * Unlike `seeInCurrentUrl`, this only matches the full URL. - * - * ``` php - * seeCurrentUrlEquals('/'); - * ?> - * ``` - * - * @param $uri - * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() - */ - public function seeCurrentUrlEquals($uri) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URL doesn't equal the given string. - * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. - * - * ``` php - * dontSeeCurrentUrlEquals('/'); - * ?> - * ``` - * - * @param $uri - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() - */ - public function cantSeeCurrentUrlEquals($uri) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URL doesn't equal the given string. - * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. - * - * ``` php - * dontSeeCurrentUrlEquals('/'); - * ?> - * ``` - * - * @param $uri - * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() - */ - public function dontSeeCurrentUrlEquals($uri) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URL matches the given regular expression. - * - * ``` php - * seeCurrentUrlMatches('~$/users/(\d+)~'); - * ?> - * ``` - * - * @param $uri - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() - */ - public function canSeeCurrentUrlMatches($uri) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the current URL matches the given regular expression. - * - * ``` php - * seeCurrentUrlMatches('~$/users/(\d+)~'); - * ?> - * ``` - * - * @param $uri - * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() - */ - public function seeCurrentUrlMatches($uri) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that current url doesn't match the given regular expression. - * - * ``` php - * dontSeeCurrentUrlMatches('~$/users/(\d+)~'); - * ?> - * ``` - * - * @param $uri - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() - */ - public function cantSeeCurrentUrlMatches($uri) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that current url doesn't match the given regular expression. - * - * ``` php - * dontSeeCurrentUrlMatches('~$/users/(\d+)~'); - * ?> - * ``` - * - * @param $uri - * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() - */ - public function dontSeeCurrentUrlMatches($uri) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Executes the given regular expression against the current URI and returns the first match. - * If no parameters are provided, the full URI is returned. - * - * ``` php - * grabFromCurrentUrl('~$/user/(\d+)/~'); - * $uri = $I->grabFromCurrentUrl(); - * ?> - * ``` - * - * @param null $uri - * - * @internal param $url - * @return mixed - * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl() - */ - public function grabFromCurrentUrl($uri = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the specified checkbox is checked. - * - * ``` php - * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms - * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. - * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); - * ?> - * ``` - * - * @param $checkbox - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() - */ - public function canSeeCheckboxIsChecked($checkbox) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the specified checkbox is checked. - * - * ``` php - * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms - * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. - * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); - * ?> - * ``` - * - * @param $checkbox - * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() - */ - public function seeCheckboxIsChecked($checkbox) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Check that the specified checkbox is unchecked. - * - * ``` php - * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms - * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. - * ?> - * ``` - * - * @param $checkbox - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() - */ - public function cantSeeCheckboxIsChecked($checkbox) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Check that the specified checkbox is unchecked. - * - * ``` php - * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms - * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. - * ?> - * ``` - * - * @param $checkbox - * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() - */ - public function dontSeeCheckboxIsChecked($checkbox) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given input field or textarea contains the given value. - * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. - * - * ``` php - * seeInField('Body','Type your comment here'); - * $I->seeInField('form textarea[name=body]','Type your comment here'); - * $I->seeInField('form input[type=hidden]','hidden_value'); - * $I->seeInField('#searchform input','Search'); - * $I->seeInField('//form/*[@name=search]','Search'); - * $I->seeInField(['name' => 'search'], 'Search'); - * ?> - * ``` - * - * @param $field - * @param $value - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeInField() - */ - public function canSeeInField($field, $value) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given input field or textarea contains the given value. - * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. - * - * ``` php - * seeInField('Body','Type your comment here'); - * $I->seeInField('form textarea[name=body]','Type your comment here'); - * $I->seeInField('form input[type=hidden]','hidden_value'); - * $I->seeInField('#searchform input','Search'); - * $I->seeInField('//form/*[@name=search]','Search'); - * $I->seeInField(['name' => 'search'], 'Search'); - * ?> - * ``` - * - * @param $field - * @param $value - * @see \Codeception\Lib\InnerBrowser::seeInField() - */ - public function seeInField($field, $value) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that an input field or textarea doesn't contain the given value. - * For fuzzy locators, the field is matched by label text, CSS and XPath. - * - * ``` php - * dontSeeInField('Body','Type your comment here'); - * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); - * $I->dontSeeInField('form input[type=hidden]','hidden_value'); - * $I->dontSeeInField('#searchform input','Search'); - * $I->dontSeeInField('//form/*[@name=search]','Search'); - * $I->dontSeeInField(['name' => 'search'], 'Search'); - * ?> - * ``` - * - * @param $field - * @param $value - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeInField() - */ - public function cantSeeInField($field, $value) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that an input field or textarea doesn't contain the given value. - * For fuzzy locators, the field is matched by label text, CSS and XPath. - * - * ``` php - * dontSeeInField('Body','Type your comment here'); - * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); - * $I->dontSeeInField('form input[type=hidden]','hidden_value'); - * $I->dontSeeInField('#searchform input','Search'); - * $I->dontSeeInField('//form/*[@name=search]','Search'); - * $I->dontSeeInField(['name' => 'search'], 'Search'); - * ?> - * ``` - * - * @param $field - * @param $value - * @see \Codeception\Lib\InnerBrowser::dontSeeInField() - */ - public function dontSeeInField($field, $value) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Submits the given form on the page, optionally with the given form values. - * Give the form fields values as an array. - * - * Skipped fields will be filled by their values from the page. - * You don't need to click the 'Submit' button afterwards. - * This command itself triggers the request to form's action. - * - * You can optionally specify what button's value to include - * in the request with the last parameter as an alternative to - * explicitly setting its value in the second parameter, as - * button values are not otherwise included in the request. - * - * Examples: - * - * ``` php - * submitForm('#login', array('login' => 'davert', 'password' => '123456')); - * // or - * $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'), 'submitButtonName'); - * - * ``` - * - * For example, given this sample "Sign Up" form: - * - * ``` html - *
    - * Login:
    - * Password:
    - * Do you agree to out terms?
    - * Select pricing plan - * - *
    - * ``` - * - * You could write the following to submit it: - * - * ``` php - * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)), 'submitButton'); - * - * ``` - * Note that "2" will be the submitted value for the "plan" field, as it is the selected option. - * - * You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm. - * - * ```php - * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true))); - * - * ``` - * - * @param $selector - * @param $params - * @param $button - * @see \Codeception\Lib\InnerBrowser::submitForm() - */ - public function submitForm($selector, $params, $button = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Fills a text field or textarea with the given string. - * - * ``` php - * fillField("//input[@type='text']", "Hello World!"); - * $I->fillField(['name' => 'email'], 'jon@mail.com'); - * ?> - * ``` - * - * @param $field - * @param $value - * @see \Codeception\Lib\InnerBrowser::fillField() - */ - public function fillField($field, $value) { - return $this->scenario->runStep(new \Codeception\Step\Action('fillField', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Selects an option in a select tag or in radio button group. - * - * ``` php - * selectOption('form select[name=account]', 'Premium'); - * $I->selectOption('form input[name=payment]', 'Monthly'); - * $I->selectOption('//form/select[@name=account]', 'Monthly'); - * ?> - * ``` - * - * Provide an array for the second argument to select multiple options: - * - * ``` php - * selectOption('Which OS do you use?', array('Windows','Linux')); - * ?> - * ``` - * - * @param $select - * @param $option - * @see \Codeception\Lib\InnerBrowser::selectOption() - */ - public function selectOption($select, $option) { - return $this->scenario->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. - * - * ``` php - * checkOption('#agree'); - * ?> - * ``` - * - * @param $option - * @see \Codeception\Lib\InnerBrowser::checkOption() - */ - public function checkOption($option) { - return $this->scenario->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Unticks a checkbox. - * - * ``` php - * uncheckOption('#notify'); - * ?> - * ``` - * - * @param $option - * @see \Codeception\Lib\InnerBrowser::uncheckOption() - */ - public function uncheckOption($option) { - return $this->scenario->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Attaches a file relative to the Codeception data directory to the given file upload field. - * - * ``` php - * attachFile('input[@type="file"]', 'prices.xls'); - * ?> - * ``` - * - * @param $field - * @param $filename - * @see \Codeception\Lib\InnerBrowser::attachFile() - */ - public function attachFile($field, $filename) { - return $this->scenario->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * If your page triggers an ajax request, you can perform it manually. - * This action sends a GET ajax request with specified params. - * - * See ->sendAjaxPostRequest for examples. - * - * @param $uri - * @param $params - * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest() - */ - public function sendAjaxGetRequest($uri, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * If your page triggers an ajax request, you can perform it manually. - * This action sends a POST ajax request with specified params. - * Additional params can be passed as array. - * - * Example: - * - * Imagine that by clicking checkbox you trigger ajax request which updates user settings. - * We emulate that click by running this ajax request manually. - * - * ``` php - * sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST - * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET - * - * ``` - * - * @param $uri - * @param $params - * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest() - */ - public function sendAjaxPostRequest($uri, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * If your page triggers an ajax request, you can perform it manually. - * This action sends an ajax request with specified method and params. - * - * Example: - * - * You need to perform an ajax request specifying the HTTP method. - * - * ``` php - * sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title')); - * - * ``` - * - * @param $method - * @param $uri - * @param $params - * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest() - */ - public function sendAjaxRequest($method, $uri, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Finds and returns the text contents of the given element. - * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression. - * - * ``` php - * grabTextFrom('h1'); - * $heading = $I->grabTextFrom('descendant-or-self::h1'); - * $value = $I->grabTextFrom('~ - * ``` - * - * @param $cssOrXPathOrRegex - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::grabTextFrom() - */ - public function grabTextFrom($cssOrXPathOrRegex) { - return $this->scenario->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Grabs the value of the given attribute value from the given element. - * Fails if element is not found. - * - * ``` php - * grabAttributeFrom('#tooltip', 'title'); - * ?> - * ``` - * - * - * @param $cssOrXpath - * @param $attribute - * @internal param $element - * @return mixed - * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom() - */ - public function grabAttributeFrom($cssOrXpath, $attribute) { - return $this->scenario->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * @param $field - * - * @return array|mixed|null|string - * @see \Codeception\Lib\InnerBrowser::grabValueFrom() - */ - public function grabValueFrom($field) { - return $this->scenario->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Sets a cookie with the given name and value. - * You can set additional cookie params like `domain`, `path`, `expire`, `secure` in array passed as last argument. - * - * ``` php - * setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); - * ?> - * ``` - * - * @param $name - * @param $val - * @param array $params - * @internal param $cookie - * @internal param $value - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::setCookie() - */ - public function setCookie($name, $val, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Grabs a cookie value. - * You can set additional cookie params like `domain`, `path` in array passed as last argument. - * - * @param $cookie - * - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::grabCookie() - */ - public function grabCookie($name, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that a cookie with the given name is set. - * You can set additional cookie params like `domain`, `path` as array passed in last argument. - * - * ``` php - * seeCookie('PHPSESSID'); - * ?> - * ``` - * - * @param $cookie - * @param array $params - * @return mixed - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeCookie() - */ - public function canSeeCookie($name, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that a cookie with the given name is set. - * You can set additional cookie params like `domain`, `path` as array passed in last argument. - * - * ``` php - * seeCookie('PHPSESSID'); - * ?> - * ``` - * - * @param $cookie - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeCookie() - */ - public function seeCookie($name, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that there isn't a cookie with the given name. - * You can set additional cookie params like `domain`, `path` as array passed in last argument. - * - * @param $cookie - * - * @param array $params - * @return mixed - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() - */ - public function cantSeeCookie($name, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that there isn't a cookie with the given name. - * You can set additional cookie params like `domain`, `path` as array passed in last argument. - * - * @param $cookie - * - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() - */ - public function dontSeeCookie($name, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Unsets cookie with the given name. - * You can set additional cookie params like `domain`, `path` in array passed as last argument. - * - * @param $cookie - * - * @param array $params - * @return mixed - * @see \Codeception\Lib\InnerBrowser::resetCookie() - */ - public function resetCookie($name, $params = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given element exists on the page and is visible. - * You can also specify expected attributes of this element. - * - * ``` php - * seeElement('.error'); - * $I->seeElement('//form/input[1]'); - * $I->seeElement('input', ['name' => 'login']); - * $I->seeElement('input', ['value' => '123456']); - * - * // strict locator in first arg, attributes in second - * $I->seeElement(['css' => 'form input'], ['name' => 'login']); - * ?> - * ``` - * - * @param $selector - * @param array $attributes - * @return - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeElement() - */ - public function canSeeElement($selector, $attributes = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given element exists on the page and is visible. - * You can also specify expected attributes of this element. - * - * ``` php - * seeElement('.error'); - * $I->seeElement('//form/input[1]'); - * $I->seeElement('input', ['name' => 'login']); - * $I->seeElement('input', ['value' => '123456']); - * - * // strict locator in first arg, attributes in second - * $I->seeElement(['css' => 'form input'], ['name' => 'login']); - * ?> - * ``` - * - * @param $selector - * @param array $attributes - * @return - * @see \Codeception\Lib\InnerBrowser::seeElement() - */ - public function seeElement($selector, $attributes = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given element is invisible or not present on the page. - * You can also specify expected attributes of this element. - * - * ``` php - * dontSeeElement('.error'); - * $I->dontSeeElement('//form/input[1]'); - * $I->dontSeeElement('input', ['name' => 'login']); - * $I->dontSeeElement('input', ['value' => '123456']); - * ?> - * ``` - * - * @param $selector - * @param array $attributes - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeElement() - */ - public function cantSeeElement($selector, $attributes = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given element is invisible or not present on the page. - * You can also specify expected attributes of this element. - * - * ``` php - * dontSeeElement('.error'); - * $I->dontSeeElement('//form/input[1]'); - * $I->dontSeeElement('input', ['name' => 'login']); - * $I->dontSeeElement('input', ['value' => '123456']); - * ?> - * ``` - * - * @param $selector - * @param array $attributes - * @see \Codeception\Lib\InnerBrowser::dontSeeElement() - */ - public function dontSeeElement($selector, $attributes = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that there are a certain number of elements matched by the given locator on the page. - * - * ``` php - * seeNumberOfElements('tr', 10); - * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements - * ?> - * ``` - * @param $selector - * @param mixed $expected: - * - string: strict number - * - array: range of numbers [0,10] - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() - */ - public function canSeeNumberOfElements($selector, $expected) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that there are a certain number of elements matched by the given locator on the page. - * - * ``` php - * seeNumberOfElements('tr', 10); - * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements - * ?> - * ``` - * @param $selector - * @param mixed $expected: - * - string: strict number - * - array: range of numbers [0,10] - * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() - */ - public function seeNumberOfElements($selector, $expected) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given option is selected. - * - * ``` php - * seeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> - * ``` - * - * @param $selector - * @param $optionText - * - * @return mixed - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() - */ - public function canSeeOptionIsSelected($select, $optionText) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given option is selected. - * - * ``` php - * seeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> - * ``` - * - * @param $selector - * @param $optionText - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() - */ - public function seeOptionIsSelected($select, $optionText) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given option is not selected. - * - * ``` php - * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> - * ``` - * - * @param $selector - * @param $optionText - * - * @return mixed - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() - */ - public function cantSeeOptionIsSelected($select, $optionText) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the given option is not selected. - * - * ``` php - * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); - * ?> - * ``` - * - * @param $selector - * @param $optionText - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() - */ - public function dontSeeOptionIsSelected($select, $optionText) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Asserts that current page has 404 response status code. - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seePageNotFound() - */ - public function canSeePageNotFound() { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Asserts that current page has 404 response status code. - * @see \Codeception\Lib\InnerBrowser::seePageNotFound() - */ - public function seePageNotFound() { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that response code is equal to value provided. - * - * @param $code - * - * @return mixed - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() - */ - public function canSeeResponseCodeIs($code) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that response code is equal to value provided. - * - * @param $code - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() - */ - public function seeResponseCodeIs($code) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the page title contains the given string. - * - * ``` php - * seeInTitle('Blog - Post #1'); - * ?> - * ``` - * - * @param $title - * - * @return mixed - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::seeInTitle() - */ - public function canSeeInTitle($title) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the page title contains the given string. - * - * ``` php - * seeInTitle('Blog - Post #1'); - * ?> - * ``` - * - * @param $title - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::seeInTitle() - */ - public function seeInTitle($title) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the page title does not contain the given string. - * - * @param $title - * - * @return mixed - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() - */ - public function cantSeeInTitle($title) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that the page title does not contain the given string. - * - * @param $title - * - * @return mixed - * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() - */ - public function dontSeeInTitle($title) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args())); - } -} diff --git a/tests/codeception/acceptance/CISLoginPageCept.php b/tests/codeception/acceptance/CISLoginPageCept.php deleted file mode 100644 index 14668afa1..000000000 --- a/tests/codeception/acceptance/CISLoginPageCept.php +++ /dev/null @@ -1,6 +0,0 @@ -wantTo('CIS Startseite Testen'); -//$I->amOnPage('/cis/index.html'); -//$I->see('Powered by FH Complete'); -?> diff --git a/tests/codeception/acceptance/_bootstrap.php b/tests/codeception/acceptance/_bootstrap.php deleted file mode 100644 index 8a8855580..000000000 --- a/tests/codeception/acceptance/_bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ -scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Opens a file and stores it's content. - * - * Usage: - * - * ``` php - * openFile('composer.json'); - * $I->seeInThisFile('codeception/codeception'); - * ?> - * ``` - * - * @param $filename - * @see \Codeception\Module\Filesystem::openFile() - */ - public function openFile($filename) { - return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Deletes a file - * - * ``` php - * deleteFile('composer.lock'); - * ?> - * ``` - * - * @param $filename - * @see \Codeception\Module\Filesystem::deleteFile() - */ - public function deleteFile($filename) { - return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Deletes directory with all subdirectories - * - * ``` php - * deleteDir('vendor'); - * ?> - * ``` - * - * @param $dirname - * @see \Codeception\Module\Filesystem::deleteDir() - */ - public function deleteDir($dirname) { - return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Copies directory with all contents - * - * ``` php - * copyDir('vendor','old_vendor'); - * ?> - * ``` - * - * @param $src - * @param $dst - * @see \Codeception\Module\Filesystem::copyDir() - */ - public function copyDir($src, $dst) { - return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks If opened file has `text` in it. - * - * Usage: - * - * ``` php - * openFile('composer.json'); - * $I->seeInThisFile('codeception/codeception'); - * ?> - * ``` - * - * @param $text - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Module\Filesystem::seeInThisFile() - */ - public function canSeeInThisFile($text) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks If opened file has `text` in it. - * - * Usage: - * - * ``` php - * openFile('composer.json'); - * $I->seeInThisFile('codeception/codeception'); - * ?> - * ``` - * - * @param $text - * @see \Codeception\Module\Filesystem::seeInThisFile() - */ - public function seeInThisFile($text) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks the strict matching of file contents. - * Unlike `seeInThisFile` will fail if file has something more than expected lines. - * Better to use with HEREDOC strings. - * Matching is done after removing "\r" chars from file content. - * - * ``` php - * openFile('process.pid'); - * $I->seeFileContentsEqual('3192'); - * ?> - * ``` - * - * @param $text - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Module\Filesystem::seeFileContentsEqual() - */ - public function canSeeFileContentsEqual($text) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks the strict matching of file contents. - * Unlike `seeInThisFile` will fail if file has something more than expected lines. - * Better to use with HEREDOC strings. - * Matching is done after removing "\r" chars from file content. - * - * ``` php - * openFile('process.pid'); - * $I->seeFileContentsEqual('3192'); - * ?> - * ``` - * - * @param $text - * @see \Codeception\Module\Filesystem::seeFileContentsEqual() - */ - public function seeFileContentsEqual($text) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks If opened file doesn't contain `text` in it - * - * ``` php - * openFile('composer.json'); - * $I->dontSeeInThisFile('codeception/codeception'); - * ?> - * ``` - * - * @param $text - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Module\Filesystem::dontSeeInThisFile() - */ - public function cantSeeInThisFile($text) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks If opened file doesn't contain `text` in it - * - * ``` php - * openFile('composer.json'); - * $I->dontSeeInThisFile('codeception/codeception'); - * ?> - * ``` - * - * @param $text - * @see \Codeception\Module\Filesystem::dontSeeInThisFile() - */ - public function dontSeeInThisFile($text) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Deletes a file - * @see \Codeception\Module\Filesystem::deleteThisFile() - */ - public function deleteThisFile() { - return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks if file exists in path. - * Opens a file when it's exists - * - * ``` php - * seeFileFound('UserModel.php','app/models'); - * ?> - * ``` - * - * @param $filename - * @param string $path - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Module\Filesystem::seeFileFound() - */ - public function canSeeFileFound($filename, $path = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks if file exists in path. - * Opens a file when it's exists - * - * ``` php - * seeFileFound('UserModel.php','app/models'); - * ?> - * ``` - * - * @param $filename - * @param string $path - * @see \Codeception\Module\Filesystem::seeFileFound() - */ - public function seeFileFound($filename, $path = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks if file does not exists in path - * - * @param $filename - * @param string $path - * Conditional Assertion: Test won't be stopped on fail - * @see \Codeception\Module\Filesystem::dontSeeFileFound() - */ - public function cantSeeFileFound($filename, $path = null) { - return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args())); - } - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks if file does not exists in path - * - * @param $filename - * @param string $path - * @see \Codeception\Module\Filesystem::dontSeeFileFound() - */ - public function dontSeeFileFound($filename, $path = null) { - return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Erases directory contents - * - * ``` php - * cleanDir('logs'); - * ?> - * ``` - * - * @param $dirname - * @see \Codeception\Module\Filesystem::cleanDir() - */ - public function cleanDir($dirname) { - return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Saves contents to file - * - * @param $filename - * @param $contents - * @see \Codeception\Module\Filesystem::writeToFile() - */ - public function writeToFile($filename, $contents) { - return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args())); - } -} diff --git a/tests/codeception/functional/_bootstrap.php b/tests/codeception/functional/_bootstrap.php deleted file mode 100644 index 8a8855580..000000000 --- a/tests/codeception/functional/_bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ -errormsg=true; - $this->assertTrue($bc->getErrorMsg()); - } - -} diff --git a/tests/codeception/unit/UnitTester.php b/tests/codeception/unit/UnitTester.php deleted file mode 100644 index 1b95ec3d2..000000000 --- a/tests/codeception/unit/UnitTester.php +++ /dev/null @@ -1,268 +0,0 @@ -scenario->runStep(new \Codeception\Step\Action('assertEquals', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that two variables are not equal - * - * @param $expected - * @param $actual - * @param string $message - * @see \Codeception\Module\Asserts::assertNotEquals() - */ - public function assertNotEquals($expected, $actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that expected is greater than actual - * - * @param $expected - * @param $actual - * @param string $message - * @see \Codeception\Module\Asserts::assertGreaterThan() - */ - public function assertGreaterThan($expected, $actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * @deprecated - * @see \Codeception\Module\Asserts::assertGreaterThen() - */ - public function assertGreaterThen($expected, $actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThen', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that expected is greater or equal than actual - * - * @param $expected - * @param $actual - * @param string $message - * @see \Codeception\Module\Asserts::assertGreaterThanOrEqual() - */ - public function assertGreaterThanOrEqual($expected, $actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * @deprecated - * @see \Codeception\Module\Asserts::assertGreaterThenOrEqual() - */ - public function assertGreaterThenOrEqual($expected, $actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertGreaterThenOrEqual', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that expected is less than actual - * - * @param $expected - * @param $actual - * @param string $message - * @see \Codeception\Module\Asserts::assertLessThan() - */ - public function assertLessThan($expected, $actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that expected is less or equal than actual - * - * @param $expected - * @param $actual - * @param string $message - * @see \Codeception\Module\Asserts::assertLessThanOrEqual() - */ - public function assertLessThanOrEqual($expected, $actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that haystack contains needle - * - * @param $needle - * @param $haystack - * @param string $message - * @see \Codeception\Module\Asserts::assertContains() - */ - public function assertContains($needle, $haystack, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertContains', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that haystack doesn't contain needle. - * - * @param $needle - * @param $haystack - * @param string $message - * @see \Codeception\Module\Asserts::assertNotContains() - */ - public function assertNotContains($needle, $haystack, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that variable is empty. - * - * @param $actual - * @param string $message - * @see \Codeception\Module\Asserts::assertEmpty() - */ - public function assertEmpty($actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that variable is not empty. - * - * @param $actual - * @param string $message - * @see \Codeception\Module\Asserts::assertNotEmpty() - */ - public function assertNotEmpty($actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that variable is NULL - * - * @param $actual - * @param string $message - * @see \Codeception\Module\Asserts::assertNull() - */ - public function assertNull($actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertNull', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that variable is not NULL - * - * @param $actual - * @param string $message - * @see \Codeception\Module\Asserts::assertNotNull() - */ - public function assertNotNull($actual, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that condition is positive. - * - * @param $condition - * @param string $message - * @see \Codeception\Module\Asserts::assertTrue() - */ - public function assertTrue($condition, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertTrue', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Checks that condition is negative. - * - * @param $condition - * @param string $message - * @see \Codeception\Module\Asserts::assertFalse() - */ - public function assertFalse($condition, $message = null) { - return $this->scenario->runStep(new \Codeception\Step\Action('assertFalse', func_get_args())); - } - - - /** - * [!] Method is generated. Documentation taken from corresponding module. - * - * Fails the test with message. - * - * @param $message - * @see \Codeception\Module\Asserts::fail() - */ - public function fail($message) { - return $this->scenario->runStep(new \Codeception\Step\Action('fail', func_get_args())); - } -} diff --git a/tests/codeception/unit/_bootstrap.php b/tests/codeception/unit/_bootstrap.php deleted file mode 100644 index 8a8855580..000000000 --- a/tests/codeception/unit/_bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ - Date: Wed, 28 Sep 2016 11:21:14 +0200 Subject: [PATCH 08/85] phpC(d)I fixes III --- phpci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/phpci.yml b/phpci.yml index 08ed79f51..f945cf6e3 100644 --- a/phpci.yml +++ b/phpci.yml @@ -8,10 +8,6 @@ build_settings: setup: test: - lint: - directories: - - "application/" - recursive: true codeception: config: "tests/codeception/" path: "tests/codeception/_output/" From bb541041119a80bb6b35b043d1cb9f244402648f Mon Sep 17 00:00:00 2001 From: oesi Date: Wed, 28 Sep 2016 13:30:46 +0200 Subject: [PATCH 09/85] =?UTF-8?q?Caldav=20Schnittstelle=20korrigiert=20-?= =?UTF-8?q?=20Fehler=20behoben=20bei=20dem=20Reservierungen=20nicht=20korr?= =?UTF-8?q?ekt=20angezeigt=20wurden=20wenn=20diese=20in=20der=20Woche=20de?= =?UTF-8?q?r=20Zeitumstellung=20liegen=20-=20Fehler=20behoben=20wodurch=20?= =?UTF-8?q?es=20zu=20doppelten=20Eintr=C3=A4gen=20im=20Kalender=20kam=20we?= =?UTF-8?q?nn=20sich=20die=20Endezeit=20eines=20Termines=20=C3=A4ndert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/datum.class.php | 61 +++++++++-------- include/wochenplan.class.php | 6 +- webdav/Caldav_Backend.php | 126 ++++++++++++++++++----------------- 3 files changed, 97 insertions(+), 96 deletions(-) diff --git a/include/datum.class.php b/include/datum.class.php index bfeddc654..7440e9960 100644 --- a/include/datum.class.php +++ b/include/datum.class.php @@ -23,7 +23,7 @@ class datum { public $ts_day=86400; // Timestamp eines Tages - + /** * Konstruktor * @@ -103,13 +103,12 @@ class datum */ public function jump_week($datum, $wochen) { - $stunde_vor=date("G",$datum); - // Eine Woche sind 604800 Sekunden - $datum+=604800*$wochen; - $stunde_nach=date("G",$datum); - if ($stunde_nach!=$stunde_vor) - $datum+=3600; - return $datum; + $days = $wochen * 7; + + $datetime=new DateTime(); + $datetime->setTimestamp($datum); + $datetime->modify($days.' day'); + return $datetime->format("U"); } /** @@ -159,7 +158,7 @@ class datum else return false; } - + /** * Zieht ein Datum von einem anderen ab, und gibt die differenz in Tagen zurueck (mit Vorzeichen) * @param $datum1 @@ -196,7 +195,7 @@ class datum if($start=='' && $ende!='' && $dateende>=$dateref) return true; - // Ende nicht gesetzt; Start gesetzt + // Ende nicht gesetzt; Start gesetzt if($ende=='' && $start!='' && $datestart<=$dateref) return true; @@ -237,7 +236,7 @@ class datum return $h1.':'.$m1; } - + /** * Subtrahiert 2 Zeiten ($zeit1-$zeit2) Stunde:Minute * Es liefert keine Uhrzeit zurueck sondern Stunden und Minuten @@ -268,7 +267,7 @@ class datum return $h1.':'.$m1; } - + /** * Prueft und Liefert ein Datum im angegeben Format * fuer die Formatierung wird die Funktion formatDatum verwendet @@ -278,9 +277,9 @@ class datum * Eintraege wie zB 'last Monday' oder 'a' auch in ein Datum umgewandelt werden. * @return Formatierten Timestamp wenn ok, false im Fehlerfall */ - function checkformatDatum($datum, $format='Y-m-d H:i:s', $strict=false) + function checkformatDatum($datum, $format='Y-m-d H:i:s', $strict=false) { - + @list($day, $month, $year) = @explode(".", $datum); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); @@ -293,7 +292,7 @@ class datum @list($year, $month, $day) = @explode("-", $datum); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); - + if (strlen($datum)==6) { $year="20".substr($datum,0,2); @@ -301,7 +300,7 @@ class datum $day=substr($datum,4,2); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); - } + } else if (strlen($datum)==8) { $year=substr($datum,0,4); @@ -309,15 +308,15 @@ class datum $day=substr($datum, 6,2); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); - - $year=substr($datum,5,4); + + $year=substr($datum,5,4); $month=substr($datum,3,2); $day=substr($datum, 0,2); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); - } - return false; - } + } + return false; + } /** @@ -334,18 +333,18 @@ class datum { if(trim($datum)=='') return ''; - + $ts=''; $error=false; - + //2008-12-31 if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$datum, $regs)) $ts = mktime(0,0,0,$regs[2],$regs[3],$regs[1]); - + //2008-12-31 12:30 if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})",$datum, $regs)) $ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[3],$regs[1]); - + //2008-12-31 12:30:15 if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs)) $ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]); @@ -355,20 +354,20 @@ class datum //1.12.2008 if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})",$datum, $regs)) $ts = mktime(0,0,0,$regs[2],$regs[1],$regs[3]); - + //1.12.2008 12:30 if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2})",$datum, $regs)) $ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[1],$regs[3]); - + //1.12.2008 12:30:15 if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs)) $ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[1],$regs[3]); } - + if($ts=='' && !$strict) { $ts = strtotime($datum); - + if(!$ts || $ts==-1) { //wenn strtotime fehlschlaegt liefert diese -1 zurueck, ab php5.1.0 jedoch false @@ -378,9 +377,9 @@ class datum if($ts!='' && !$error) return date($format, $ts); - + return false; } - + } ?> diff --git a/include/wochenplan.class.php b/include/wochenplan.class.php index a76fdaaf4..aa9ec7b5a 100644 --- a/include/wochenplan.class.php +++ b/include/wochenplan.class.php @@ -2384,7 +2384,7 @@ class wochenplan extends basis_db /** * Unterricht der ueber mehrere Stunden geht wird nicht einzeln Exportiert, - * sondern zusammengeblockt. (in maximal 4er Bloecke) + * sondern zusammengeblockt. * * Es wird nur ein Eintrag geschrieben, die restlichen werden uebersprungen. * Vor dem Ueberspringen des Eintrages werden jedoch noch die dazu Gruppierten Eintraege @@ -2499,7 +2499,7 @@ class wochenplan extends basis_db $end_date_time_ical = $eda[2].$eda[1].$eda[0].'T'.sprintf('%02s',($eta[0])).$eta[1].$eta[2]; //neu gruppieren der Startzeit und des Startdatums echo $this->crlf.'BEGIN:VEVENT'.$this->crlf - .'UID:'.'FH'.str_replace(',',' ',$lvb.$this->std_plan[$i][$j][$idx]->ort.$this->std_plan[$i][$j][$idx]->lektor.$lehrfach[$idx].$start_date_time_ical.$this->crlf) + .'UID:'.'FH'.str_replace(',',' ',$lvb.$this->std_plan[$i][$j][$idx]->ort.$this->std_plan[$i][$j][$idx]->lektor.$lehrfach[$idx].$start_date_time_ical.$end_date_time_ical.$this->crlf) .'SUMMARY:'.str_replace(',',' ',$lehrfach[$idx].' '.$this->std_plan[$i][$j][$idx]->ort.' - '.$lvb.$this->crlf) .'DESCRIPTION:'.str_replace(',',' ',$lehrfach[$idx].'\n'.$this->std_plan[$i][$j][$idx]->lektor.'\n'.$lvb.'\n'.$this->std_plan[$i][$j][$idx]->ort.(LVPLAN_ANMERKUNG_ANZEIGEN?'\n'.$this->std_plan[$i][$j][$idx]->anmerkung:'').$this->crlf) .'LOCATION:'.$this->std_plan[$i][$j][$idx]->ort.$this->crlf @@ -2541,7 +2541,7 @@ class wochenplan extends basis_db $start_date_time_ical = $sda[2].$sda[1].$sda[0].'T'.sprintf('%02s',($sta[0])).$sta[1].$sta[2]; //neu gruppieren der Startzeit und des Startdatums $end_date_time_ical = $eda[2].$eda[1].$eda[0].'T'.sprintf('%02s',($eta[0])).$eta[1].$eta[2]; //neu gruppieren der Startzeit und des Startdatums - $UID = 'FH'.$lvb.$this->std_plan[$i][$j][$idx]->ort.$this->std_plan[$i][$j][$idx]->lektor.$lehrfach[$idx].$start_date_time_ical; + $UID = 'FH'.$lvb.$this->std_plan[$i][$j][$idx]->ort.$this->std_plan[$i][$j][$idx]->lektor.$lehrfach[$idx].$start_date_time_ical.$end_date_time_ical; $Summary = $lehrfach[$idx].' '.$this->std_plan[$i][$j][$idx]->ort.' - '.$lvb; $description = $lehrfach[$idx].'\n'.$this->std_plan[$i][$j][$idx]->lektor.'\n'.$lvb.'\n'.$this->std_plan[$i][$j][$idx]->ort; diff --git a/webdav/Caldav_Backend.php b/webdav/Caldav_Backend.php index d107341d2..bcb8edcb7 100644 --- a/webdav/Caldav_Backend.php +++ b/webdav/Caldav_Backend.php @@ -2,17 +2,18 @@ require_once(dirname(__FILE__).'/../include/wochenplan.class.php'); require_once(dirname(__FILE__).'/../include/functions.inc.php'); require_once(dirname(__FILE__).'/../include/mitarbeiter.class.php'); +require_once(dirname(__FILE__).'/../include/datum.class.php'); /** * CalDAV backend */ -class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend +class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend { /** - * Creates the backend - * + * Creates the backend + * * @param AuthBackend $auth */ - public function __construct($auth) + public function __construct($auth) { $this->auth = $auth; } @@ -31,18 +32,18 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend * Every project is an array with the following keys: * * id, a unique id that will be used by other functions to modify the * calendar. This can be the same as the uri or a database key. - * * uri, which the basename of the uri with which the calendar is + * * uri, which the basename of the uri with which the calendar is * accessed. * * principalUri. The owner of the calendar. Almost always the same as * principalUri passed to this method. * * Furthermore it can contain webdav properties in clark notation. A very - * common one is '{DAV:}displayname'. + * common one is '{DAV:}displayname'. * - * @param string $principalUri - * @return array + * @param string $principalUri + * @return array */ - public function getCalendarsForUser($principalUri) + public function getCalendarsForUser($principalUri) { //error_log("Caldav_Backend.php/getCalendarsForUser($principalUri)"); //$user = $this->getUser(); @@ -75,7 +76,7 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend * @param string $calendarUri * @param array $properties */ - public function createCalendar($principalUri,$calendarUri, array $properties) + public function createCalendar($principalUri,$calendarUri, array $properties) { throw new \Sabre\DAV\Exception('Not Implemented'); } @@ -108,43 +109,44 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend * ) * ) * - * In this example it was forbidden to update {DAV:}displayname. + * In this example it was forbidden to update {DAV:}displayname. * (403 Forbidden), which in turn also caused {DAV:}owner to fail * (424 Failed Dependency) because the request needs to be atomic. * * @param string $calendarId - * @param array $mutations - * @return bool|array + * @param array $mutations + * @return bool|array */ - public function updateCalendar($calendarId, array $mutations) + public function updateCalendar($calendarId, array $mutations) { return false; } /** - * Delete a calendar and all it's objects - * - * @param string $calendarId + * Delete a calendar and all it's objects + * + * @param string $calendarId * @return void */ - public function deleteCalendar($calendarId) + public function deleteCalendar($calendarId) { throw new \Sabre\DAV\Exception('Not Implemented'); } - + public function getCalendarData($user, $objectUri=null) { + $datum_obj = new datum(); $starttime = microtime(true); $bn = new benutzer(); if(!$bn->load($user)) die('User invalid'); - + if(check_lektor($user)) $type='lektor'; else $type='student'; - + // Stundenplanobjekt erzeugen $stdplan = new wochenplan($type); $stdplan->crlf="\n"; @@ -156,7 +158,7 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend } if(!is_null($objectUri)) { - $unr = mb_substr($objectUri, mb_strpos($objectUri,'-')+1); + $unr = mb_substr($objectUri, (mb_strpos($objectUri,'-')+1), mb_strpos($objectUri,'@')-(mb_strpos($objectUri,'-')+1)); $dtstart = mb_substr($objectUri,0,mb_strpos($objectUri,'-')); if(mb_strlen($dtstart)==15) @@ -170,14 +172,14 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend $sekunde = mb_substr($dtstart,13,2); $begin = mktime($stunde, $minute, $sekunde, $monat, $tag-1, $jahr); $ende = mktime($stunde, $minute, $sekunde, $monat, $tag+1, $jahr); - //error_log("getCalendarData unr: $unr dtstart: $dtstart"); + //error_log("getCalendarData unr: $unr dtstart: $dtstart size:".(mb_strlen($objectUri)-mb_strpos($objectUri,'@'))); //error_log($begin.'/'.$ende); } else { //error_log("dtstart laenge abnormal: $dtstart"); $begin = mktime(0,0,0,date('m'),date('d')-14,date('Y')); - $ende = mktime(0,0,0,date('m')+6,date('d'),date('Y')); + $ende = mktime(0,0,0,date('m')+6,date('d'),date('Y')); } } else @@ -195,10 +197,10 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend $i++; if(!date("w",$begin)) $begin=jump_day($begin,1); - + $stdplan->init_stdplan(); $datum=$begin; - $begin+=604800; // eine Woche + $begin = $datum_obj->jump_week($begin,1); // Stundenplan einer Woche laden if(!$stdplan->load_week($datum,$db_stpl_table)) @@ -224,7 +226,7 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend //error_log("\n\nDATA".print_r($data,true)); //error_log("getCalendarData time:".($endtime-$starttime)); //$data.="\nEND:VCALENDAR"; - return $data; + return $data; } public function makeCal($event) { @@ -250,28 +252,28 @@ END:STANDARD END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; } /** - * Returns all calendar objects within a calendar. + * Returns all calendar objects within a calendar. * * Every item contains an array with the following keys: * * id - unique identifier which will be used for subsequent updates * * calendardata - The iCalendar-compatible calnedar data * * uri - a unique key which will be used to construct the uri. This can be any arbitrary string. * * lastmodified - a timestamp of the last modification time - * * etag - An arbitrary string, surrounded by double-quotes. (e.g.: + * * etag - An arbitrary string, surrounded by double-quotes. (e.g.: * ' "abcdef"') * * calendarid - The calendarid as it was passed to this function. * - * Note that the etag is optional, but it's highly encouraged to return for + * Note that the etag is optional, but it's highly encouraged to return for * speed reasons. * - * The calendardata is also optional. If it's not returned - * 'getCalendarObject' will be called later, which *is* expected to return + * The calendardata is also optional. If it's not returned + * 'getCalendarObject' will be called later, which *is* expected to return * calendardata. - * - * @param string $calendarId - * @return array + * + * @param string $calendarId + * @return array */ - public function getCalendarObjects($calendarId) + public function getCalendarObjects($calendarId) { //$user = $this->getUser(); $user = $calendarId; @@ -290,7 +292,7 @@ END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; $return[] = array("id"=>$row['UID'], "calendardata"=>$this->makeCal($row['data']), - "uri"=>$uri, + "uri"=>$uri.'@'.md5($row['UID']), "lastmodified"=>$row['updateamum'], "etag"=>'"'.$row['UID'].'"', "calendarid"=>$calendarId); @@ -303,15 +305,15 @@ END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; * Returns information from a single calendar object, based on it's object * uri. * - * The returned array must have the same keys as getCalendarObjects. The - * 'calendardata' object is required here though, while it's not required + * The returned array must have the same keys as getCalendarObjects. The + * 'calendardata' object is required here though, while it's not required * for getCalendarObjects. - * - * @param string $calendarId - * @param string $objectUri - * @return array + * + * @param string $calendarId + * @param string $objectUri + * @return array */ - public function getCalendarObject($calendarId,$objectUri) + public function getCalendarObject($calendarId,$objectUri) { //error_log("Caldav_Backend.php/getCalendarObject($calendarId, $objectUri)"); //$user = $this->getUser(); @@ -330,7 +332,7 @@ END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; { $ret = array("id"=>$data['UID'], "calendardata"=>$this->makeCal($data['data']), - "uri"=>'principals/'.$user.'/LVPlan/'.$data['dtstart'].'-'.$data['unr'][0], + "uri"=>'principals/'.$user.'/LVPlan/'.$data['dtstart'].'-'.$data['unr'][0].'@'.md5($data['UID']), "lastmodified"=>$data['updateamum'], "etag"=>'"'.$data['UID'].'"', "calendarid"=>$calendarId); @@ -339,39 +341,39 @@ END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; } /** - * Creates a new calendar object. - * - * @param string $calendarId - * @param string $objectUri - * @param string $calendarData + * Creates a new calendar object. + * + * @param string $calendarId + * @param string $objectUri + * @param string $calendarData * @return void */ - public function createCalendarObject($calendarId,$objectUri,$calendarData) + public function createCalendarObject($calendarId,$objectUri,$calendarData) { throw new \Sabre\DAV\Exception('Not Implemented'); } /** - * Updates an existing calendarobject, based on it's uri. - * - * @param string $calendarId - * @param string $objectUri - * @param string $calendarData + * Updates an existing calendarobject, based on it's uri. + * + * @param string $calendarId + * @param string $objectUri + * @param string $calendarData * @return void */ - public function updateCalendarObject($calendarId,$objectUri,$calendarData) + public function updateCalendarObject($calendarId,$objectUri,$calendarData) { throw new \Sabre\DAV\Exception('Not Implemented'); } /** - * Deletes an existing calendar object. - * - * @param string $calendarId - * @param string $objectUri + * Deletes an existing calendar object. + * + * @param string $calendarId + * @param string $objectUri * @return void */ - public function deleteCalendarObject($calendarId,$objectUri) + public function deleteCalendarObject($calendarId,$objectUri) { throw new Sabre\DAV\Exception('Not Implemented'); } From 1af4938ab247e68c3b73183ffc114ec06739a9da Mon Sep 17 00:00:00 2001 From: kindlm Date: Thu, 29 Sep 2016 17:51:36 +0200 Subject: [PATCH 10/85] Ampelsystem: New attribute "verpflichtend" - New attributes "verpflichtend"(mandatory) and "buttontext" in the ampelsystem - Verpflichtende Ampeln are shown as div-popup on the CIS every time the page refreshes till the notification is confirmed. - Text of the confirm-button is changeable (fallback to default-phrase) - Only the notifications of the current semester are shown by default ("show all" as button) --- cis/ampel.php | 68 +++++++- cis/index.php | 16 +- cis/private/tools/ampelleiteruebersicht.php | 36 +++- cis/private/tools/ampelverwaltung.php | 175 ++++++++++++++------ include/ampel.class.php | 73 ++++++-- include/sprache.class.php | 6 +- locale/de-AT/tools.php | 3 + locale/en-US/tools.php | 3 + system/dbupdate_3.2.php | 14 +- vilesci/stammdaten/ampel_details.php | 64 +++++-- vilesci/stammdaten/ampel_uebersicht.php | 2 + 11 files changed, 366 insertions(+), 94 deletions(-) diff --git a/cis/ampel.php b/cis/ampel.php index eeca6f603..27b4571d2 100755 --- a/cis/ampel.php +++ b/cis/ampel.php @@ -7,7 +7,20 @@ require_once('../include/phrasen.class.php'); $sprache = getSprache(); $p = new phrasen($sprache); +?> + + +loadUserAmpel($user); $rot=0; $gelb=0; + $verpflichtend = false; $datum = new datum(); foreach($ampel->result as $row) { @@ -23,16 +37,19 @@ if(is_user_logged_in()) $vlz = "-".$row->vorlaufzeit." day"; $ts_vorlaufzeit = strtotime($vlz, $ts_deadline); $ts_now = $datum->mktime_fromdate(date('Y-m-d')); - if($ts_deadline < $ts_now) { $rot++; + if ($row->verpflichtend == 't') + $verpflichtend = true; } else { if($ts_vorlaufzeit<=$ts_now && $ts_now<=$ts_deadline) { $gelb++; + if ($row->verpflichtend == 't') + $verpflichtend = true; } } } @@ -41,12 +58,53 @@ if(is_user_logged_in()) if($rot>0 || $gelb>0) { - echo ''; - if($rot>0 && $gelb==0) + // Wenn es eine verpflichtende Ampel gibt, das Pupup im CIS anzeigen + if ($verpflichtend == true) + { + echo ' '; + + echo ' '; + } + if($rot>0) echo ''.$p->t("tools/ampelsystem").'  |  '; - if($gelb>0 && $rot==0) + elseif($gelb>0) echo ''.$p->t("tools/ampelsystem").'  |  '; - echo ' '; } } else diff --git a/cis/index.php b/cis/index.php index ec8d08160..4d6453788 100644 --- a/cis/index.php +++ b/cis/index.php @@ -159,7 +159,7 @@ function loadampel() - +
    @@ -192,12 +192,14 @@ function loadampel()
    - - + + + +
    diff --git a/cis/private/tools/ampelleiteruebersicht.php b/cis/private/tools/ampelleiteruebersicht.php index f7a9ee7ad..2e6d1f326 100755 --- a/cis/private/tools/ampelleiteruebersicht.php +++ b/cis/private/tools/ampelleiteruebersicht.php @@ -99,6 +99,25 @@ if(isset($_POST['ampel_id'])) else $ampel_id = ''; +if (isset($_GET['ampel_benutzer_bestaetigt_id']) && isset($_GET['delete'])) +{ + if ($rechte->isBerechtigt('admin', null, 'suid')) + { + $delete_bestaetigung = new ampel(); + if($delete_bestaetigung->deleteAmpelBenutzer($_GET['ampel_benutzer_bestaetigt_id'])) + { + echo 'Ampelbestaetigung erfolgreich geloescht'; + } + else + { + $action='new'; + echo ''.$delete_bestaetigung->errormsg.''; + } + } +} + + +echo '

    '.($p->t('tools/ampelsystem')).'

    '; echo '
    '; echo $p->t('global/organisationseinheit').': + +
    '; + else + echo ''; + + } echo ''; } echo ''; diff --git a/cis/private/tools/ampelverwaltung.php b/cis/private/tools/ampelverwaltung.php index d83c01765..b8132c55d 100755 --- a/cis/private/tools/ampelverwaltung.php +++ b/cis/private/tools/ampelverwaltung.php @@ -25,11 +25,14 @@ require_once('../../../include/phrasen.class.php'); require_once('../../../include/benutzerfunktion.class.php'); require_once('../../../include/organisationseinheit.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/studiensemester.class.php'); $user = get_uid(); $sprache = getSprache(); $p = new phrasen($sprache); +$show = (isset($_GET['show'])?$_GET['show']:'aktuell'); + //Leiter OEs holen $benutzerfunktion = new benutzerfunktion(); $benutzerfunktion->getBenutzerFunktionen('Leitung', '', '', $user); @@ -54,6 +57,8 @@ if($rechte->isBerechtigt('basis/ampeluebersicht')) array_unique($oes); +$studiensemester = new studiensemester(); +$ss_akt = $studiensemester->getakt(); echo ' @@ -73,7 +78,8 @@ echo ' @@ -86,6 +92,10 @@ if(count($oes)!=0) echo '

    '.$p->t('tools/dasAmpelsystemIstEinErinnerungsystem').'

    '; +if ($show == 'aktuell') + echo '

    '.$p->t('tools/ampelAlleAnzeigen').'

    '; +else + echo '

    '.$p->t('tools/ampelNurAktuellesStudiensemester').'

    '; $datum_obj = new datum(); @@ -126,78 +136,135 @@ if($type=='bestaetigen' && is_numeric($ampel_id)) echo $message; $ampel = new ampel(); -$ampel->loadUserAmpel($user, true, true); +$ampel->loadUserAmpel($user, false, true); echo ' - + '; +$beginn = new studiensemester($ss_akt); foreach($ampel->result as $row) { - $ts_deadline = $datum_obj->mktime_fromdate($row->deadline); - $vlz = "-".$row->vorlaufzeit." day"; - $ts_vorlaufzeit = strtotime($vlz, $ts_deadline); - $ts_now = $datum_obj->mktime_fromdate(date('Y-m-d')); - - if($ts_vorlaufzeit<=$ts_now && $ts_now<=$ts_deadline) - $ampelstatus='gelb'; - elseif($ts_now>$ts_deadline) - $ampelstatus='rot'; - elseif($ts_now<$ts_deadline && $ts_vorlaufzeit>=$ts_now) - $ampelstatus='gruen'; - - if($bestaetigt = $ampel->isBestaetigt($user,$row->ampel_id)) - $ampelstatus=''; - - echo ''; - echo ''; + echo ''; + + echo ''; + $beschreibung = $row->beschreibung[$sprache]; + if($beschreibung=='' && isset($row->beschreibung[DEFAULT_LANGUAGE])) + $beschreibung = $row->beschreibung[DEFAULT_LANGUAGE]; + echo ''; + echo ''; + + // echo ""; + // echo ""; + // echo ""; + echo ''; } - echo $status; + elseif ($show == 'alle') + { + $ts_deadline = $datum_obj->mktime_fromdate($row->deadline); + $vlz = "-".$row->vorlaufzeit." day"; + $ts_vorlaufzeit = strtotime($vlz, $ts_deadline); + $ts_now = $datum_obj->mktime_fromdate(date('Y-m-d')); - echo ''; + if($ts_vorlaufzeit<=$ts_now && $ts_now<=$ts_deadline) + $ampelstatus='gelb'; + elseif($ts_now>$ts_deadline) + $ampelstatus='rot'; + elseif($ts_now<$ts_deadline && $ts_vorlaufzeit>=$ts_now) + $ampelstatus='gruen'; + + if($bestaetigt = $ampel->isBestaetigt($user,$row->ampel_id)) + $ampelstatus=''; + + echo ''; + echo ''; + + echo ''; + $beschreibung = $row->beschreibung[$sprache]; + if($beschreibung=='' && isset($row->beschreibung[DEFAULT_LANGUAGE])) + $beschreibung = $row->beschreibung[DEFAULT_LANGUAGE]; + echo ''; + echo ''; - echo ''; - $beschreibung = $row->beschreibung[$sprache]; - if($beschreibung=='' && isset($row->beschreibung[DEFAULT_LANGUAGE])) - $beschreibung = $row->beschreibung[DEFAULT_LANGUAGE]; - echo ''; - echo ''; - -// echo ""; -// echo ""; -// echo ""; - echo ''; + // echo ""; + // echo ""; + // echo ""; + echo ''; + } } echo '
    '.$p->t('tools/ampelErledigt').' '.$p->t('tools/ampelBeschreibung').' '.$p->t('tools/ampelDeadline').'
    '; - switch($ampelstatus) + //Nur Ampeln laden, die im aktuellen Studiensemester liegen + if ($show == 'aktuell' && $row->deadline>=$beginn->start) { - case 'rot': - $status= ''; - break; - case 'gelb': - $status= ''; - break; - case 'gruen': - $status= ''; - break; - default: - $status= ''; - break; + $ts_deadline = $datum_obj->mktime_fromdate($row->deadline); + $vlz = "-".$row->vorlaufzeit." day"; + $ts_vorlaufzeit = strtotime($vlz, $ts_deadline); + $ts_now = $datum_obj->mktime_fromdate(date('Y-m-d')); + + if($ts_vorlaufzeit<=$ts_now && $ts_now<=$ts_deadline) + $ampelstatus='gelb'; + elseif($ts_now>$ts_deadline) + $ampelstatus='rot'; + elseif($ts_now<$ts_deadline && $ts_vorlaufzeit>=$ts_now) + $ampelstatus='gruen'; + + if($bestaetigt = $ampel->isBestaetigt($user,$row->ampel_id)) + $ampelstatus=''; + + echo '
    '; + switch($ampelstatus) + { + case 'rot': + $status= ''; + break; + case 'gelb': + $status= ''; + break; + case 'gruen': + $status= ''; + break; + default: + $status= ''; + break; + } + echo $status; + + echo ''; + if(!$bestaetigt) + echo '
    '; + else + echo ''; + echo '
    verpflichtend=='t'?'style="background-color: #EF8A88"':'').'>'.$beschreibung.''.$datum_obj->formatDatum($row->deadline,'d.m.Y').'".date('d.m.Y',$ts_now)."".date('d.m.Y',$ts_vorlaufzeit)."".date('d.m.Y',$ts_deadline)."
    '; - if(!$bestaetigt) - //echo ''.$p->t('tools/ampelBestaetigen').''; - echo ''; - else - //echo $p->t('tools/ampelBestaetigt'); - //echo ''; - echo ''; - echo '
    '; + switch($ampelstatus) + { + case 'rot': + $status= ''; + break; + case 'gelb': + $status= ''; + break; + case 'gruen': + $status= ''; + break; + default: + $status= ''; + break; + } + echo $status; + + echo ''; + if(!$bestaetigt) + echo '
    '; + else + echo ''; + echo '
    verpflichtend=='t'?'style="background-color: #EF8A88"':'').'>'.$beschreibung.''.$datum_obj->formatDatum($row->deadline,'d.m.Y').''.$beschreibung.''.$datum_obj->formatDatum($row->deadline,'d.m.Y').'".date('d.m.Y',$ts_now)."".date('d.m.Y',$ts_vorlaufzeit)."".date('d.m.Y',$ts_deadline)."
    ".date('d.m.Y',$ts_now)."".date('d.m.Y',$ts_vorlaufzeit)."".date('d.m.Y',$ts_deadline)."
    '; diff --git a/include/ampel.class.php b/include/ampel.class.php index 964a5c418..7473cca87 100755 --- a/include/ampel.class.php +++ b/include/ampel.class.php @@ -38,6 +38,8 @@ class ampel extends basis_db public $vorlaufzeit; // smallint public $verfallszeit; // smallint public $email; // boolean + public $verpflichtend; // boolean + public $buttontext; // varchar(64)[] public $insertamum; // timestamp public $insertvon; // varchar(32) public $updateamum; // timestamp @@ -74,8 +76,9 @@ class ampel extends basis_db $sprache = new sprache(); $beschreibung = $sprache->getSprachQuery('beschreibung'); + $buttontext = $sprache->getSprachQuery('buttontext'); - $qry = "SELECT *,".$beschreibung." FROM public.tbl_ampel WHERE ampel_id=".$this->db_add_param($ampel_id, FHC_INTEGER); + $qry = "SELECT *,".$beschreibung.", ".$buttontext." FROM public.tbl_ampel WHERE ampel_id=".$this->db_add_param($ampel_id, FHC_INTEGER); if($result = $this->db_query($qry)) { @@ -89,6 +92,8 @@ class ampel extends basis_db $this->vorlaufzeit = $row->vorlaufzeit; $this->verfallszeit = $row->verfallszeit; $this->email = $row->email; + $this->verpflichtend = $row->verpflichtend; + $this->buttontext = $sprache->parseSprachResult('buttontext', $row); $this->insertamum = $row->insertamum; $this->insertvon = $row->insertvon; $this->updateamum = $row->updateamum; @@ -117,8 +122,9 @@ class ampel extends basis_db { $sprache = new sprache(); $beschreibung = $sprache->getSprachQuery('beschreibung'); + $buttontext = $sprache->getSprachQuery('buttontext'); - $qry = "SELECT *,".$beschreibung." FROM public.tbl_ampel"; + $qry = "SELECT *,".$beschreibung.", ".$buttontext." FROM public.tbl_ampel"; if($aktiv) { $qry .= " WHERE (NOW()>(deadline-(vorlaufzeit || ' days')::interval)::date)"; @@ -140,6 +146,8 @@ class ampel extends basis_db $obj->vorlaufzeit = $row->vorlaufzeit; $obj->verfallszeit = $row->verfallszeit; $obj->email = $this->db_parse_bool($row->email); + $obj->verpflichtend = $this->db_parse_bool($row->verpflichtend); + $obj->buttontext = $sprache->parseSprachResult('buttontext', $row); $obj->insertamum = $row->insertamum; $obj->insertvon = $row->insertvon; @@ -212,20 +220,21 @@ class ampel extends basis_db /** * Laedt alle aktuellen Ampeln eines Users - * @param $user - * @param $zukuenftige_anzeigen + * @param string $user User, dessen Ampeln geladen werden sollen + * @param boolean $zukuenftige_anzeigen Default false * wenn true, werden alle zukuenftigen Ampeln geladen * wenn false, werden nur die Ampeln geladen die innerhalb der vorlaufzeit liegen - * @param $bestaetigt + * @param boolean $bestaetigt Default false * wenn true, werden alle Ampeln geladen - * wenn false, werden nur die Ampeln geladen die noch nicht bestaetigt wurden + * wenn false, werden nur die Ampeln geladen die noch NICHT bestaetigt wurden */ public function loadUserAmpel($user, $zukuenftige_anzeigen=false, $bestaetigt=false) { $sprache = new sprache(); $beschreibung = $sprache->getSprachQuery('beschreibung'); + $buttontext = $sprache->getSprachQuery('buttontext'); - $qry = "SELECT *,".$beschreibung." FROM public.tbl_ampel WHERE deadline+verfallszeit>now()"; + $qry = "SELECT *,".$beschreibung.", ".$buttontext." FROM public.tbl_ampel WHERE deadline+verfallszeit>now()"; if(!$zukuenftige_anzeigen) $qry.=" AND deadline-vorlaufzeitdb_query($qry)) { while($row = $this->db_fetch_object($result)) @@ -254,6 +263,8 @@ class ampel extends basis_db $obj->vorlaufzeit = $row->vorlaufzeit; $obj->verfallszeit = $row->verfallszeit; $obj->email = $row->email; + $obj->verpflichtend = $row->verpflichtend; + $obj->buttontext = $sprache->parseSprachResult('buttontext', $row); $obj->insertamum = $row->insertamum; $obj->insertvon = $row->insertvon; @@ -315,19 +326,28 @@ class ampel extends basis_db $idx = sprache::$index_arr[$key]; $qry.=" beschreibung[$idx],"; } + foreach($this->buttontext as $key=>$value) + { + $idx = sprache::$index_arr[$key]; + $qry.=" buttontext[$idx],"; + } $qry.=" benutzer_select, deadline, - vorlaufzeit, verfallszeit, email, insertamum, insertvon , updateamum, updatevon) VALUES(". + vorlaufzeit, verfallszeit, email, verpflichtend, insertamum, insertvon , updateamum, updatevon) VALUES(". $this->db_add_param($this->kurzbz).','; reset($this->beschreibung); foreach($this->beschreibung as $key=>$value) $qry.=$this->db_add_param($value).','; + reset($this->buttontext); + foreach($this->buttontext as $key=>$value) + $qry.=$this->db_add_param($value).','; $qry .= $this->db_add_param($this->benutzer_select).','. $this->db_add_param($this->deadline).','. $this->db_add_param($this->vorlaufzeit).','. $this->db_add_param($this->verfallszeit).','. $this->db_add_param($this->email, FHC_BOOLEAN).','. + $this->db_add_param($this->verpflichtend, FHC_BOOLEAN).','. $this->db_add_param($this->insertamum).','. $this->db_add_param($this->insertvon).','. $this->db_add_param($this->updateamum).','. @@ -343,12 +363,19 @@ class ampel extends basis_db $idx = sprache::$index_arr[$key]; $qry.=' beschreibung['.$idx.'] = '.$this->db_add_param($value).','; } + reset($this->buttontext); + foreach($this->buttontext as $key=>$value) + { + $idx = sprache::$index_arr[$key]; + $qry.=' buttontext['.$idx.'] = '.$this->db_add_param($value).','; + } $qry.= ' benutzer_select = '.$this->db_add_param($this->benutzer_select).','. ' deadline = '.$this->db_add_param($this->deadline).','. ' vorlaufzeit = '.$this->db_add_param($this->vorlaufzeit).','. ' verfallszeit = '.$this->db_add_param($this->verfallszeit).','. ' email = '.$this->db_add_param($this->email, FHC_BOOLEAN).','. + ' verpflichtend = '.$this->db_add_param($this->verpflichtend, FHC_BOOLEAN).','. ' updateamum ='.$this->db_add_param($this->updateamum).','. ' updatevon ='.$this->db_add_param($this->updatevon). ' WHERE ampel_id='.$this->db_add_param($this->ampel_id, FHC_INTEGER).';'; @@ -414,6 +441,29 @@ class ampel extends basis_db } } + /** + * Loescht eine Bestaetigung einer Ampel + + * @param $ampel_id + */ + public function deleteAmpelBenutzer($ampel_benutzer_bestaetigt_id) + { + if(!is_numeric($ampel_benutzer_bestaetigt_id)) + { + $this->errormsg='ID ist ungueltig'; + return false; + } + $qry = "DELETE FROM public.tbl_ampel_benutzer_bestaetigt WHERE ampel_benutzer_bestaetigt_id=".$this->db_add_param($ampel_benutzer_bestaetigt_id); + + if($this->db_query($qry)) + return true; + else + { + $this->errormsg = 'Fehler beim Loeschen der Bestaetigung'; + return false; + } + } + /** * Bestaetigt die Ampel eines Users * @param $user @@ -446,6 +496,7 @@ class ampel extends basis_db { $sprache = new sprache(); $beschreibung = $sprache->getSprachQuery('beschreibung'); + $buttontext = $sprache->getSprachQuery('buttontext'); if(!is_numeric($ampel_id) && $ampel_id!='') { @@ -454,7 +505,7 @@ class ampel extends basis_db } // Ampeln holen - $qry = "SELECT *,".$beschreibung." FROM public.tbl_ampel"; + $qry = "SELECT *,".$beschreibung.", ".$buttontext." FROM public.tbl_ampel"; if($ampel_id!='') $qry.=" WHERE ampel_id=".$this->db_add_param($ampel_id, FHC_INTEGER); @@ -500,6 +551,8 @@ class ampel extends basis_db $obj->vorlaufzeit = $row->vorlaufzeit; $obj->verfallszeit = $row->verfallszeit; $obj->email = $row->email; + $obj->verpflichtend = $row->verpflichtend; + $obj->buttontext = $sprache->parseSprachResult('buttontext', $row); $obj->insertamum = $row->insertamum; $obj->insertvon = $row->insertvon; diff --git a/include/sprache.class.php b/include/sprache.class.php index 74d866161..4bcc57212 100644 --- a/include/sprache.class.php +++ b/include/sprache.class.php @@ -85,15 +85,17 @@ class sprache extends basis_db /** * * Lädt alle verfügbaren Sprachen + * @param boolean $content Default:null Ist die Sprache relevant fuer die Sprachauswahl + * @param string $order Default:sprache Spalte, nach der die Ergebnisse sortiert werden * @return true bei Erfolg, false wenn ein Fehler aufgetreten ist. */ - public function getAll($content=null) + public function getAll($content=null, $order='sprache') { $qry = "SELECT *,".$this->getSprachQuery('bezeichnung')." FROM public.tbl_sprache"; if(!is_null($content)) $qry.= " WHERE content=".$this->db_add_param($content, FHC_BOOLEAN); - $qry.=" ORDER BY sprache"; + $qry.=" ORDER BY ".$order; if(!$this->db_query($qry)) { diff --git a/locale/de-AT/tools.php b/locale/de-AT/tools.php index afbbb25ea..e312051e8 100755 --- a/locale/de-AT/tools.php +++ b/locale/de-AT/tools.php @@ -49,6 +49,8 @@ $this->phrasen['tools/ampelBereitsBestaetigt']='Diese Ampel wurde bereits bestä $this->phrasen['tools/dasAmpelsystemIstEinErinnerungsystem']='Das Ampelsystem ist ein ERINNERUNGS- und BESTÄTIGUNGSSYSTEM, welches Sie auf ausstehende Aufgaben aufmerksam machen soll.'; $this->phrasen['tools/waehlenSieEineOEoderAmpel']='Bitte wählen Sie ein Organisationseinheit und/oder eine Ampel aus dem Dropdown'; $this->phrasen['tools/uebersichtLeitung']='Ampel-Übersicht für LeiterInnen'; +$this->phrasen['tools/ampelAlleAnzeigen']='Alle anzeigen'; +$this->phrasen['tools/ampelNurAktuellesStudiensemester']='Nur aktuelles Studiensemester anzeigen'; //Software fuer Lehre -> Softgrid $this->phrasen['tools/applikationsliste']='Applikationsliste'; @@ -76,4 +78,5 @@ $this->phrasen['tools/esWurdenKeineErgebnisseGefunden']='Es wurden keine Ergebni //Partnerhochschulen $this->phrasen['tools/partnerhochschulenUebersicht']='Übersicht der Partnerhochschulen'; $this->phrasen['tools/partnerhochschulenKeinEintrag']='Für diesen Studiengang ist keine Partnerhochschule zugeordnet'; +$this->phrasen['tools/partnerhochschulenEinleitung']='Sollten Sie an einer Partnerhochschule studieren wollen, die sich nicht auf dieser Liste befindet, kontaktieren Sie bitte das Center for International Relations (CIR).'; ?> diff --git a/locale/en-US/tools.php b/locale/en-US/tools.php index ce65ed007..832c9a97e 100755 --- a/locale/en-US/tools.php +++ b/locale/en-US/tools.php @@ -49,6 +49,8 @@ $this->phrasen['tools/ampelBereitsBestaetigt']='This notification has already be $this->phrasen['tools/dasAmpelsystemIstEinErinnerungsystem']='The notification system is a REMINDER and CONFIRMATION SYSTEM that is provided to remind you of outstanding tasks.'; $this->phrasen['tools/waehlenSieEineOEoderAmpel']='Please select an organizational unit and/or a notification from the drop down menu.'; $this->phrasen['tools/uebersichtLeitung']='Overview of notifications for Heads of Departments'; +$this->phrasen['tools/alleAnzeigen']='Show all'; +$this->phrasen['tools/nurAktuellesStudiensemester']='Show current semester only'; //Software fuer Lehre -> Softgrid $this->phrasen['tools/applikationsliste']='List of Applications'; @@ -76,4 +78,5 @@ $this->phrasen['tools/esWurdenKeineErgebnisseGefunden']='Your search did not ret //Partnerhochschulen $this->phrasen['tools/partnerhochschulenUebersicht']='Partner Universities'; $this->phrasen['tools/partnerhochschulenKeinEintrag']='No entry found'; +$this->phrasen['tools/partnerhochschulenEinleitung']='In case you would like to study at a partner university that isn´t listed - please contact the Center for International Relations (CIR).'; ?> diff --git a/system/dbupdate_3.2.php b/system/dbupdate_3.2.php index 9afc38257..44b5bcaab 100755 --- a/system/dbupdate_3.2.php +++ b/system/dbupdate_3.2.php @@ -1193,6 +1193,18 @@ if(!$result = @$db->db_query("SELECT studienplan_id FROM public.tbl_bewerbungste echo '
    Neue Spalte studienplan_id in Tabelle public.tbl_bewerbungstermine hinzugefügt
    '; } +// Attribute verpflichtend und buttontext in public.tbl_ampel +if(!$result = @$db->db_query("SELECT verpflichtend FROM public.tbl_ampel LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_ampel ADD COLUMN verpflichtend boolean NOT NULL DEFAULT FALSE; + ALTER TABLE public.tbl_ampel ADD COLUMN buttontext varchar(64)[];"; + + if(!$db->db_query($qry)) + echo 'public.tbl_ampel '.$db->db_last_error().'
    '; + else + echo '
    Neue Spalten "verpflichtend" und "buttontext" in Tabelle public.tbl_ampel hinzugefügt
    '; +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; @@ -1344,7 +1356,7 @@ $tabellen=array( "lehre.tbl_zeugnisnote" => array("lehrveranstaltung_id","student_uid","studiensemester_kurzbz","note","uebernahmedatum","benotungsdatum","bemerkung","updateamum","updatevon","insertamum","insertvon","ext_id","punkte"), "public.tbl_adresse" => array("adresse_id","person_id","name","strasse","plz","ort","gemeinde","nation","typ","heimatadresse","zustelladresse","firma_id","updateamum","updatevon","insertamum","insertvon","ext_id"), "public.tbl_akte" => array("akte_id","person_id","dokument_kurzbz","uid","inhalt","mimetype","erstelltam","gedruckt","titel","bezeichnung","updateamum","updatevon","insertamum","insertvon","ext_id","dms_id","nachgereicht","anmerkung","titel_intern","anmerkung_intern"), - "public.tbl_ampel" => array("ampel_id","kurzbz","beschreibung","benutzer_select","deadline","vorlaufzeit","verfallszeit","insertamum","insertvon","updateamum","updatevon","email"), + "public.tbl_ampel" => array("ampel_id","kurzbz","beschreibung","benutzer_select","deadline","vorlaufzeit","verfallszeit","insertamum","insertvon","updateamum","updatevon","email","verpflichtend"), "public.tbl_ampel_benutzer_bestaetigt" => array("ampel_benutzer_bestaetigt_id","ampel_id","uid","insertamum","insertvon"), "public.tbl_aufmerksamdurch" => array("aufmerksamdurch_kurzbz","beschreibung","ext_id","bezeichnung", "aktiv"), "public.tbl_aufnahmeschluessel" => array("aufnahmeschluessel"), diff --git a/vilesci/stammdaten/ampel_details.php b/vilesci/stammdaten/ampel_details.php index b42cd660f..a7d02704b 100755 --- a/vilesci/stammdaten/ampel_details.php +++ b/vilesci/stammdaten/ampel_details.php @@ -34,7 +34,7 @@ $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); if(!$rechte->isBerechtigt('basis/ampel')) - die('Sie haben keine Berechtigung fuer diese Seite'); + die($rechte->errormsg); $datum_obj = new datum(); ?> @@ -44,6 +44,18 @@ $datum_obj = new datum(); Ampel - Details + + + @@ -55,7 +67,8 @@ $datum_obj = new datum(); if($action=='save') { $kurzbz = (isset($_POST['kurzbz'])?$_POST['kurzbz']:die('Kurzbz fehlt')); - + $beschreibung = ''; + $buttontext = ''; foreach ($_POST as $key=>$value) { if(mb_strstr($key,'beschreibung')) @@ -63,12 +76,18 @@ $datum_obj = new datum(); $idx = mb_substr($key, mb_strlen('beschreibung')); $beschreibung[$idx] = $value; } + elseif(mb_strstr($key,'buttontext')) + { + $idx = mb_substr($key, mb_strlen('buttontext')); + $buttontext[$idx] = $value; + } } $benutzer_select = (isset($_POST['benutzer_select'])?$_POST['benutzer_select']:die('Benutzer_select fehlt')); $deadline = (isset($_POST['deadline'])?$_POST['deadline']:die('Deadline fehlt')); $vorlaufzeit = (isset($_POST['vorlaufzeit'])?$_POST['vorlaufzeit']:die('Vorlaufzeit fehlt')); $verfallszeit = (isset($_POST['verfallszeit'])?$_POST['verfallszeit']:die('verfallszeit fehlt')); $email = isset($_POST['email']); + $verpflichtend = isset($_POST['verpflichtend']); $new = (isset($_POST['new'])?$_POST['new']:'true'); if($new=='true') { @@ -91,6 +110,8 @@ $datum_obj = new datum(); $ampel->vorlaufzeit = $vorlaufzeit; $ampel->verfallszeit = $verfallszeit; $ampel->email = $email; + $ampel->verpflichtend = $verpflichtend; + $ampel->buttontext = $buttontext; $ampel->updateamum = date('Y-m-d H:i:s'); $ampel->updatevon = $user; @@ -140,46 +161,63 @@ $datum_obj = new datum(); - - + + - + - + - + - + + + + + + + + + + + + + + + + + + '; + $sprache = new sprache(); - $sprache->getAll(); + $sprache->getAll(null, 'index'); foreach($sprache->result as $lang) { echo ' - + + '; } echo ' - - - +
    KurzbzKurzbz (64) Deadline
    Benutzer Select Vorlaufzeit (in Tagen)
    Verfallszeit (in Tagen)
    Erinnerung per Email db_parse_bool($ampel->email)?'checked':'').'>
    Verpflichtenddb_parse_bool($ampel->verpflichtend)?'checked':'').'>
     
     Beschreibung Buttonbeschriftung (64) 
    Beschreibung '.$lang->sprache.''.$lang->sprache.'
    '; diff --git a/vilesci/stammdaten/ampel_uebersicht.php b/vilesci/stammdaten/ampel_uebersicht.php index feef9c311..2cdbfdc2d 100755 --- a/vilesci/stammdaten/ampel_uebersicht.php +++ b/vilesci/stammdaten/ampel_uebersicht.php @@ -93,6 +93,7 @@ echo ' + @@ -106,6 +107,7 @@ foreach($ampel->result as $row) echo ''; echo ''; echo ''; + echo ''; echo ''; echo ''; echo ''; From 11723a71e60f3bb3840c539222235693ba0965a8 Mon Sep 17 00:00:00 2001 From: kindlm Date: Thu, 29 Sep 2016 17:54:01 +0200 Subject: [PATCH 11/85] =?UTF-8?q?Ab-Datum=20f=C3=BCr=20Outgoings=20auf=20A?= =?UTF-8?q?nwesenheitsliste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bbei Outgoings wird zusätzlich das ab-Datum angezeigt, ab wann sie im Ausland sind. --- cis/private/lehre/anwesenheitsliste.pdf.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cis/private/lehre/anwesenheitsliste.pdf.php b/cis/private/lehre/anwesenheitsliste.pdf.php index 5a352cd18..33a3cb86e 100755 --- a/cis/private/lehre/anwesenheitsliste.pdf.php +++ b/cis/private/lehre/anwesenheitsliste.pdf.php @@ -27,6 +27,7 @@ require_once('../../../include/lehreinheitmitarbeiter.class.php'); require_once('../../../include/studiensemester.class.php'); require_once('../../../include/functions.inc.php'); require_once('../../../include/erhalter.class.php'); +require_once('../../../include/datum.class.php'); if (!$db = new basis_db()) die('Es konnte keine Verbindung zum Server aufgebaut werden.'); @@ -156,6 +157,8 @@ $erhalter->getAll(); $a_o_kz = '9'.sprintf("%03s", $erhalter->result[0]->erhalter_kz); //Stg_Kz AO-Studierende auslesen (9005 fuer FHTW) $anzahl_studierende = 0; +$datum = new datum(); +$zusatz = ''; if($result = $db->db_query($qry)) { @@ -171,7 +174,7 @@ if($result = $db->db_query($qry)) $zusatz=''; if($row->bisio_id!='' && $row->status!='Incoming' && ($row->bis > $stsemdatumvon || $row->bis=='') && $row->von < $stsemdatumbis) //Outgoing - $zusatz.='(o)'; + $zusatz.='(o)(ab '.$datum->formatDatum($row->von,'d.m.Y').')'; if($row->note==6) //angerechnet $zusatz.='(ar)'; From f99b3cc8bf26d2dee4dba2ce9086b464cbfa036c Mon Sep 17 00:00:00 2001 From: oesi Date: Fri, 30 Sep 2016 09:17:54 +0200 Subject: [PATCH 12/85] Moodle User werden nicht angelegt wenn zuvor bei der Abfrage des Users ein Netzwerkfehler auftrat --- include/moodle24_user.class.php | 132 +++++++++++++++++--------------- vilesci/moodle/user_sync24.php | 2 + 2 files changed, 74 insertions(+), 60 deletions(-) diff --git a/include/moodle24_user.class.php b/include/moodle24_user.class.php index e28bf7a21..a94278fcd 100644 --- a/include/moodle24_user.class.php +++ b/include/moodle24_user.class.php @@ -54,7 +54,7 @@ class moodle24_user extends basis_db * Laedt einen Moodle User * * @param $uid - * @return boolean + * @return boolean oder -1 bei SOAP Fehler */ public function loaduser($uid) { @@ -87,7 +87,7 @@ class moodle24_user extends basis_db catch (SoapFault $E) { $this->errormsg.="SOAP Fehler beim Laden des Users: ".$E->faultstring; - return false; + return -1; } } @@ -209,8 +209,9 @@ class moodle24_user extends basis_db if(!$user_zugeteilt) { + $retval = $this->loaduser($row_ma->mitarbeiter_uid); //MoodleID des Users holen bzw ggf neu anlegen - if(!$this->loaduser($row_ma->mitarbeiter_uid)) + if($retval===false) { //User anlegen if(!$this->createUser($row_ma->mitarbeiter_uid)) @@ -222,29 +223,32 @@ class moodle24_user extends basis_db $this->errormsg = ''; } - if($mitarbeiter!='') - $mitarbeiter.=','; - $mitarbeiter.=$this->mdl_user_id; - - //Mitarbeiter ist noch nicht zugeteilt. - $data = new stdClass(); - $data->roleid=3; // 3=Lektor - $data->userid=$this->mdl_user_id; - $data->courseid=$mdl_course_id; - - try + if($retval!==-1) { - $client = new SoapClient($this->serverurl); - $client->enrol_manual_enrol_users(array($data)); + if($mitarbeiter!='') + $mitarbeiter.=','; + $mitarbeiter.=$this->mdl_user_id; - $this->log.="\nLektorIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; - $this->log_public.="\nLektorIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; - $this->sync_create++; - } - catch (SoapFault $E) - { - $this->errormsg.="SOAP Fehler beim zuteilen der Teilnehmer des Kurses: ".$E->faultstring; - return false; + //Mitarbeiter ist noch nicht zugeteilt. + $data = new stdClass(); + $data->roleid=3; // 3=Lektor + $data->userid=$this->mdl_user_id; + $data->courseid=$mdl_course_id; + + try + { + $client = new SoapClient($this->serverurl); + $client->enrol_manual_enrol_users(array($data)); + + $this->log.="\nLektorIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; + $this->log_public.="\nLektorIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; + $this->sync_create++; + } + catch (SoapFault $E) + { + $this->errormsg.="SOAP Fehler beim zuteilen der Teilnehmer des Kurses: ".$E->faultstring; + return false; + } } } } @@ -369,8 +373,9 @@ class moodle24_user extends basis_db if(!$user_zugeteilt) { + $retval = $this->loaduser($row_user->student_uid); //MoodleID des Users holen bzw ggf neu anlegen - if(!$this->loaduser($row_user->student_uid)) + if($retval===false) { //User anlegen if(!$this->createUser($row_user->student_uid)) @@ -382,23 +387,26 @@ class moodle24_user extends basis_db $this->errormsg = ''; } - if($studenten!='') - $studenten.=','; - $studenten.=$this->mdl_user_id; + if($retval!==-1) + { + if($studenten!='') + $studenten.=','; + $studenten.=$this->mdl_user_id; - //Student ist noch nicht zugeteilt. + //Student ist noch nicht zugeteilt. - $data = new stdClass(); - $data->roleid=5; // 5=Teilnehmer/Student - $data->userid=$this->mdl_user_id; - $data->courseid=$mdl_course_id; + $data = new stdClass(); + $data->roleid=5; // 5=Teilnehmer/Student + $data->userid=$this->mdl_user_id; + $data->courseid=$mdl_course_id; - $userstoenroll[]=$data; + $userstoenroll[]=$data; - $this->log.="\nStudentIn $row_user->student_uid wurde zum Kurs hinzugefügt"; - $this->log_public.="\nStudentIn $row_user->student_uid wurde zum Kurs hinzugefügt"; - $this->sync_create++; + $this->log.="\nStudentIn $row_user->student_uid wurde zum Kurs hinzugefügt"; + $this->log_public.="\nStudentIn $row_user->student_uid wurde zum Kurs hinzugefügt"; + $this->sync_create++; + } } //Gruppenzuteilung @@ -685,8 +693,9 @@ class moodle24_user extends basis_db foreach ($users as $row_user) { + $retval = $this->loaduser($row_user); //MoodleID des Users holen - if(!$this->loaduser($row_user)) + if($retval!==true) { $this->errormsg = "Fehler beim Laden des Users $row_user: $this->errormsg"; return false; @@ -825,9 +834,9 @@ class moodle24_user extends basis_db if(!$user_zugeteilt) { - + $retval = $this->loaduser($row_ma->mitarbeiter_uid); //MoodleID des Users holen bzw ggf neu anlegen - if(!$this->loaduser($row_ma->mitarbeiter_uid)) + if($retval===false) { //User anlegen if(!$this->createUser($row_ma->mitarbeiter_uid)) @@ -839,29 +848,32 @@ class moodle24_user extends basis_db $this->errormsg = ''; } - if($mitarbeiter!='') - $mitarbeiter.=','; - $mitarbeiter.=$this->mdl_user_id; - - //Mitarbeiter ist noch nicht zugeteilt. - $data = new stdClass(); - $data->roleid=11; // 11=Fachbereichsleiter (selbst definierte rolle) - $data->userid=$this->mdl_user_id; - $data->courseid=$mdl_course_id; - - try + if($retval!==-1) { + if($mitarbeiter!='') + $mitarbeiter.=','; + $mitarbeiter.=$this->mdl_user_id; - $client = new SoapClient($this->serverurl); - $client->enrol_manual_enrol_users(array($data)); + //Mitarbeiter ist noch nicht zugeteilt. + $data = new stdClass(); + $data->roleid=11; // 11=Fachbereichsleiter (selbst definierte rolle) + $data->userid=$this->mdl_user_id; + $data->courseid=$mdl_course_id; - $this->log.="\nFachbereitsleiterIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; - $this->log_public.="\nFachbereichsleiterIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; - $this->sync_create++; - } - catch (SoapFault $E) - { - $this->log.="Fehler beim hinzufügen von FBL: ".$E->faultstring; + try + { + + $client = new SoapClient($this->serverurl); + $client->enrol_manual_enrol_users(array($data)); + + $this->log.="\nFachbereitsleiterIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; + $this->log_public.="\nFachbereichsleiterIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; + $this->sync_create++; + } + catch (SoapFault $E) + { + $this->log.="Fehler beim hinzufügen von FBL: ".$E->faultstring; + } } } } diff --git a/vilesci/moodle/user_sync24.php b/vilesci/moodle/user_sync24.php index a5e7adda1..dbddfae76 100755 --- a/vilesci/moodle/user_sync24.php +++ b/vilesci/moodle/user_sync24.php @@ -96,6 +96,8 @@ if(isset($_POST['sync'])) if($moodle->sync_studenten($mdl_course_id)) { echo $moodle->log; + echo '
    '; + echo $moodle->errormsg; } else echo 'Fehler bei der Zuteilung:'.$moodle->errormsg; From 24b18db39cd34ff903226b75168c6ec9ad2c04c2 Mon Sep 17 00:00:00 2001 From: oesi Date: Fri, 30 Sep 2016 10:08:39 +0200 Subject: [PATCH 13/85] =?UTF-8?q?Lieferbedingungen=20zu=20Tabelle=20public?= =?UTF-8?q?.tbl=5Ffirma=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/dbupdate_3.2.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/system/dbupdate_3.2.php b/system/dbupdate_3.2.php index 9afc38257..d04afa52d 100755 --- a/system/dbupdate_3.2.php +++ b/system/dbupdate_3.2.php @@ -1193,6 +1193,17 @@ if(!$result = @$db->db_query("SELECT studienplan_id FROM public.tbl_bewerbungste echo '
    Neue Spalte studienplan_id in Tabelle public.tbl_bewerbungstermine hinzugefügt
    '; } +// Neue Spalte studienplan_id in public.tbl_bewerbungstermine +if(!$result = @$db->db_query("SELECT lieferbedingungen FROM public.tbl_firma LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_firma ADD COLUMN lieferbedingungen varchar(256);"; + + if(!$db->db_query($qry)) + echo 'public.tbl_firma '.$db->db_last_error().'
    '; + else + echo '
    Neue Spalte lieferbedingungen in Tabelle public.tbl_firma hinzugefügt
    '; +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; From 240d87caaacf053c61be955c05653e1bdacd73b1 Mon Sep 17 00:00:00 2001 From: bison-paolo Date: Fri, 30 Sep 2016 10:48:52 +0200 Subject: [PATCH 14/85] phpC(d)I III --- .../{tests/acceptance => _support}/AcceptanceTester.php | 0 tests/codeception/{tests/unit => _support}/BasisKlasseTest.php | 0 .../{tests/functional => _support}/FunctionalTester.php | 0 tests/codeception/{tests/unit => _support}/UnitTester.php | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename tests/codeception/{tests/acceptance => _support}/AcceptanceTester.php (100%) rename tests/codeception/{tests/unit => _support}/BasisKlasseTest.php (100%) rename tests/codeception/{tests/functional => _support}/FunctionalTester.php (100%) rename tests/codeception/{tests/unit => _support}/UnitTester.php (100%) diff --git a/tests/codeception/tests/acceptance/AcceptanceTester.php b/tests/codeception/_support/AcceptanceTester.php similarity index 100% rename from tests/codeception/tests/acceptance/AcceptanceTester.php rename to tests/codeception/_support/AcceptanceTester.php diff --git a/tests/codeception/tests/unit/BasisKlasseTest.php b/tests/codeception/_support/BasisKlasseTest.php similarity index 100% rename from tests/codeception/tests/unit/BasisKlasseTest.php rename to tests/codeception/_support/BasisKlasseTest.php diff --git a/tests/codeception/tests/functional/FunctionalTester.php b/tests/codeception/_support/FunctionalTester.php similarity index 100% rename from tests/codeception/tests/functional/FunctionalTester.php rename to tests/codeception/_support/FunctionalTester.php diff --git a/tests/codeception/tests/unit/UnitTester.php b/tests/codeception/_support/UnitTester.php similarity index 100% rename from tests/codeception/tests/unit/UnitTester.php rename to tests/codeception/_support/UnitTester.php From fcce3c9f1072456ed98cfa8a225758a560d85cf7 Mon Sep 17 00:00:00 2001 From: oesi Date: Fri, 30 Sep 2016 11:21:42 +0200 Subject: [PATCH 15/85] =?UTF-8?q?Studiengangsseite=20erweitert=20damit=20f?= =?UTF-8?q?=C3=BCr=20den=20Studiengang=20334=20die=20Leitung=20ge=C3=A4nde?= =?UTF-8?q?rt=20werden=20kann?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vilesci/stammdaten/studiengang_edit.php | 91 +++++++++++++++++++++---- 1 file changed, 79 insertions(+), 12 deletions(-) diff --git a/vilesci/stammdaten/studiengang_edit.php b/vilesci/stammdaten/studiengang_edit.php index 1c0bc20de..5063d0c1e 100755 --- a/vilesci/stammdaten/studiengang_edit.php +++ b/vilesci/stammdaten/studiengang_edit.php @@ -20,16 +20,18 @@ /** * Seite zur Aenderung des Studiengangsnamens */ -require_once('../../config/vilesci.config.inc.php'); +require_once('../../config/vilesci.config.inc.php'); require_once('../../include/globals.inc.php'); require_once('../../include/functions.inc.php'); require_once('../../include/studiengang.class.php'); require_once('../../include/benutzerberechtigung.class.php'); require_once('../../include/organisationsform.class.php'); +require_once('../../include/benutzerfunktion.class.php'); +require_once('../../include/benutzer.class.php'); if (!$db = new basis_db()) die('Es konnte keine Verbindung zum Server aufgebaut werden.'); - + ?> @@ -53,7 +55,7 @@ if(isset($_GET['studiengang_kz'])) $stg_kz = $_GET['studiengang_kz']; else $stg_kz=''; - + if(isset($_GET['action']) && $_GET['action']=='save') { $studiengang_kz = $_POST['studiengang_kz']; @@ -61,13 +63,13 @@ if(isset($_GET['action']) && $_GET['action']=='save') $studiengang->load($studiengang_kz); if(!$rechte->isBerechtigt('assistenz', $studiengang->oe_kurzbz, 'suid')) die('Sie haben keine Berechtigung fuer diese Seite'); - + $bezeichnung = $_POST['bezeichnung']; $english = $_POST['english']; $max_semester = $_POST['max_semester']; $orgform_kurzbz = $_POST['orgform_kurzbz']; $stg_kz=$studiengang_kz; - + $stg = new studiengang(); if($stg->load($studiengang_kz)) { @@ -80,13 +82,46 @@ if(isset($_GET['action']) && $_GET['action']=='save') echo 'Erfolgreich geändert'; else echo 'Fehler beim Speichern: '.$stg->errormsg.''; - + + } + + if($studiengang_kz==334) + { + $benutzerfunktion = new benutzerfunktion(); + $benutzerfunktion->getOeFunktionen($stg->oe_kurzbz, 'Leitung'); + + foreach($benutzerfunktion->result as $row) + { + if(isset($_POST['ltg_'.$row->benutzerfunktion_id])) + { + // Leitung wird gesetzt + if($row->datum_bis!='') + { + $row->datum_bis=''; + $row->updateamum = date('Y-m-d H:i:s'); + $row->updatevon = $user; + $row->save(false); + } + } + else + { + // Leitung wird entfernt + if($row->datum_bis=='' || $row->datum_bis>date('Y-m-d')) + { + $row->datum_bis=date('Y-m-d',mktime(0, 0, 0, date("m"), date("d")-1, date("Y"))); + $row->updateamum = date('Y-m-d H:i:s'); + $row->updatevon = $user; + $row->save(false); + } + } + + } } } -$stg = new studiengang(); +$stg = new studiengang(); $stg_arr = $rechte->getStgKz('assistenz'); -$stg->loadArray($stg_arr,'typ, kurzbz',true); +$stg->loadArray($stg_arr,'typ, kurzbz',true); echo '
    Studiengang: '; @@ -136,15 +171,47 @@ foreach($orgform->result as $row) $selected='selected'; else $selected=''; - + echo ''; } echo ' -
    +'; +if($stg->studiengang_kz==334) +{ + // Studiengang MIT / MSC kann auch die Leitung aktivieren/deaktivieren + echo ''; + echo ''; + echo ''; + echo ''; +} + +echo ' + + + + From 8bd7674551ec62d17837259688e0ec8e0220cd31 Mon Sep 17 00:00:00 2001 From: oesi Date: Fri, 30 Sep 2016 16:27:08 +0200 Subject: [PATCH 16/85] Logo Pfad korrigert --- include/tw/abgabe_lektor_benotung.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tw/abgabe_lektor_benotung.php b/include/tw/abgabe_lektor_benotung.php index 5972d3a3b..a3bf39da8 100644 --- a/include/tw/abgabe_lektor_benotung.php +++ b/include/tw/abgabe_lektor_benotung.php @@ -168,7 +168,7 @@ else $pdf->SetXY(30,30); //Logo - $pdf->Image("../../skin/styles/tw/logo.jpg","400","25","150","78","jpg",""); + $pdf->Image("../../skin/styles/".DEFAULT_STYLE."/logo.jpg","400","25","150","78","jpg",""); $pdf->SetFont('Arial','',12); $pdf->SetFillColor(190,190,190); @@ -430,7 +430,7 @@ else $pdf->SetXY(30,30); //Logo - $pdf->Image("../../skin/images/logo.jpg","400","25","160","54","jpg",""); + $pdf->Image("../../skin/styles/".DEFAULT_STYLE."/logo.jpg","400","25","150","78","jpg",""); $pdf->SetFont('Arial','',12); $pdf->SetFillColor(190,190,190); $pdf->SetXY(30,110-$titelabzug); From 42757176b5af2310e2d31a38900950b7554c9e31 Mon Sep 17 00:00:00 2001 From: oesi Date: Fri, 30 Sep 2016 16:30:23 +0200 Subject: [PATCH 17/85] Fixed broken Update Script --- system/dbupdate_3.2.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/dbupdate_3.2.php b/system/dbupdate_3.2.php index fb1480a8a..28b018a91 100755 --- a/system/dbupdate_3.2.php +++ b/system/dbupdate_3.2.php @@ -1202,8 +1202,9 @@ if(!$result = @$db->db_query("SELECT verpflichtend FROM public.tbl_ampel LIMIT 1 if(!$db->db_query($qry)) echo 'public.tbl_ampel '.$db->db_last_error().'
    '; - else - echo '
    Neue Spalten "verpflichtend" und "buttontext" in Tabelle public.tbl_ampel hinzugefügt
    '; + else + echo '
    Neue Spalten "verpflichtend" und "buttontext" in Tabelle public.tbl_ampel hinzugefügt
    '; +} // Neue Spalte studienplan_id in public.tbl_bewerbungstermine if(!$result = @$db->db_query("SELECT lieferbedingungen FROM public.tbl_firma LIMIT 1")) From 70fd4a4dea42388472ed7d0c460f0c97106e2d95 Mon Sep 17 00:00:00 2001 From: kindlm Date: Fri, 30 Sep 2016 16:32:57 +0200 Subject: [PATCH 18/85] phpC(d)I --- phpci.yml | 17 +++++---------- tests/codeception.yml | 17 --------------- tests/codeception/_output/.placeholder | 0 .../AcceptanceTester.php | 0 .../{unit => _support}/BasisKlasseTest.php | 0 .../FunctionalTester.php | 0 .../{unit => _support}/UnitTester.php | 0 tests/codeception/acceptance.suite.yml | 14 ------------- tests/codeception/codeception.dist.yml | 20 ++++++++++++++++++ .../tests/acceptance.suite.dist.yml | 21 +++++++++++++++++++ .../acceptance/CISLoginPageCept.php | 0 .../{ => tests}/acceptance/_bootstrap.php | 0 .../functional.suite.dist.yml} | 3 ++- .../{ => tests}/functional/_bootstrap.php | 0 .../unit.suite.dist.yml} | 3 ++- .../{ => tests}/unit/_bootstrap.php | 0 16 files changed, 50 insertions(+), 45 deletions(-) delete mode 100644 tests/codeception.yml create mode 100644 tests/codeception/_output/.placeholder rename tests/codeception/{acceptance => _support}/AcceptanceTester.php (100%) rename tests/codeception/{unit => _support}/BasisKlasseTest.php (100%) rename tests/codeception/{functional => _support}/FunctionalTester.php (100%) rename tests/codeception/{unit => _support}/UnitTester.php (100%) delete mode 100644 tests/codeception/acceptance.suite.yml create mode 100644 tests/codeception/codeception.dist.yml create mode 100644 tests/codeception/tests/acceptance.suite.dist.yml rename tests/codeception/{ => tests}/acceptance/CISLoginPageCept.php (100%) rename tests/codeception/{ => tests}/acceptance/_bootstrap.php (100%) rename tests/codeception/{functional.suite.yml => tests/functional.suite.dist.yml} (85%) rename tests/codeception/{ => tests}/functional/_bootstrap.php (100%) rename tests/codeception/{unit.suite.yml => tests/unit.suite.dist.yml} (75%) rename tests/codeception/{ => tests}/unit/_bootstrap.php (100%) diff --git a/phpci.yml b/phpci.yml index 32e465575..f945cf6e3 100644 --- a/phpci.yml +++ b/phpci.yml @@ -1,22 +1,15 @@ build_settings: verbose: false prefer_symlink: false + ignore: + - "vendor" + - "tests" setup: test: codeception: - config: "tests" - lint: - php_loc: - php_docblock_checker: - allowed_warnings: -1 -# phing: -# build_file: 'build.xml' -# targets: -# - "deploy" -# php_unit: -# directory: "tests/phpunit/" -# args: "--bootstrap 'test/phpunit/bootstrap.php' --configuration 'tests/phpunit/phpunit.xml'" + config: "tests/codeception/" + path: "tests/codeception/_output/" complete: diff --git a/tests/codeception.yml b/tests/codeception.yml deleted file mode 100644 index f9c149984..000000000 --- a/tests/codeception.yml +++ /dev/null @@ -1,17 +0,0 @@ -actor: Tester -paths: - tests: codeception - log: codeception/_output - data: codeception/_data - helpers: codeception/_support -settings: - bootstrap: _bootstrap.php - colors: true - memory_limit: 1024M -modules: - config: - Db: - dsn: '' - user: '' - password: '' - dump: codeception/_data/dump.sql diff --git a/tests/codeception/_output/.placeholder b/tests/codeception/_output/.placeholder new file mode 100644 index 000000000..e69de29bb diff --git a/tests/codeception/acceptance/AcceptanceTester.php b/tests/codeception/_support/AcceptanceTester.php similarity index 100% rename from tests/codeception/acceptance/AcceptanceTester.php rename to tests/codeception/_support/AcceptanceTester.php diff --git a/tests/codeception/unit/BasisKlasseTest.php b/tests/codeception/_support/BasisKlasseTest.php similarity index 100% rename from tests/codeception/unit/BasisKlasseTest.php rename to tests/codeception/_support/BasisKlasseTest.php diff --git a/tests/codeception/functional/FunctionalTester.php b/tests/codeception/_support/FunctionalTester.php similarity index 100% rename from tests/codeception/functional/FunctionalTester.php rename to tests/codeception/_support/FunctionalTester.php diff --git a/tests/codeception/unit/UnitTester.php b/tests/codeception/_support/UnitTester.php similarity index 100% rename from tests/codeception/unit/UnitTester.php rename to tests/codeception/_support/UnitTester.php diff --git a/tests/codeception/acceptance.suite.yml b/tests/codeception/acceptance.suite.yml deleted file mode 100644 index 8a84881eb..000000000 --- a/tests/codeception/acceptance.suite.yml +++ /dev/null @@ -1,14 +0,0 @@ -# Codeception Test Suite Configuration - -# suite for acceptance tests. -# perform tests in browser using the WebDriver or PhpBrowser. -# If you need both WebDriver and PHPBrowser tests - create a separate suite. - -class_name: AcceptanceTester -modules: - enabled: - - PhpBrowser - - AcceptanceHelper - config: - PhpBrowser: - url: 'http://localhost/myapp/' diff --git a/tests/codeception/codeception.dist.yml b/tests/codeception/codeception.dist.yml new file mode 100644 index 000000000..ecf0baef5 --- /dev/null +++ b/tests/codeception/codeception.dist.yml @@ -0,0 +1,20 @@ +actor: Tester +paths: + tests: tests + log: _output + data: _data + helpers: _support +settings: + bootstrap: _bootstrap.php + colors: true + memory_limit: 1024M +modules: + enabled: + - Db: + dsn: 'pgsql:host=localhost;port=5432;dbname=fhctest' + user: 'fhcomplete' + password: 'fhcomplete' + dump: _data/dump.sql + populate: true + cleanup: false + reconnect: false diff --git a/tests/codeception/tests/acceptance.suite.dist.yml b/tests/codeception/tests/acceptance.suite.dist.yml new file mode 100644 index 000000000..73a9bbf67 --- /dev/null +++ b/tests/codeception/tests/acceptance.suite.dist.yml @@ -0,0 +1,21 @@ +# Codeception Test Suite Configuration + +# suite for acceptance tests. +# perform tests in browser using the WebDriver or PhpBrowser. +# If you need both WebDriver and PHPBrowser tests - create a separate suite. + +class_name: AcceptanceTester +modules: + enabled: + - Db + - PhpBrowser: + url: 'http://admin:1q2w3@demo.fhcomplete.org/' + config: + Db: + dsn: 'pgsql:host=localhost;port=5432;dbname=fhctest' + user: 'fhcomplete' + password: 'fhcomplete' + dump: _data/dump.sql + populate: true + cleanup: false + reconnect: false diff --git a/tests/codeception/acceptance/CISLoginPageCept.php b/tests/codeception/tests/acceptance/CISLoginPageCept.php similarity index 100% rename from tests/codeception/acceptance/CISLoginPageCept.php rename to tests/codeception/tests/acceptance/CISLoginPageCept.php diff --git a/tests/codeception/acceptance/_bootstrap.php b/tests/codeception/tests/acceptance/_bootstrap.php similarity index 100% rename from tests/codeception/acceptance/_bootstrap.php rename to tests/codeception/tests/acceptance/_bootstrap.php diff --git a/tests/codeception/functional.suite.yml b/tests/codeception/tests/functional.suite.dist.yml similarity index 85% rename from tests/codeception/functional.suite.yml rename to tests/codeception/tests/functional.suite.dist.yml index 3b17a39dc..1f7d83be2 100644 --- a/tests/codeception/functional.suite.yml +++ b/tests/codeception/tests/functional.suite.dist.yml @@ -6,4 +6,5 @@ class_name: FunctionalTester modules: - enabled: [Filesystem, FunctionalHelper] + enabled: + - Filesystem \ No newline at end of file diff --git a/tests/codeception/functional/_bootstrap.php b/tests/codeception/tests/functional/_bootstrap.php similarity index 100% rename from tests/codeception/functional/_bootstrap.php rename to tests/codeception/tests/functional/_bootstrap.php diff --git a/tests/codeception/unit.suite.yml b/tests/codeception/tests/unit.suite.dist.yml similarity index 75% rename from tests/codeception/unit.suite.yml rename to tests/codeception/tests/unit.suite.dist.yml index 4ffbf160e..9a79a8331 100644 --- a/tests/codeception/unit.suite.yml +++ b/tests/codeception/tests/unit.suite.dist.yml @@ -3,4 +3,5 @@ # suite for unit (internal) tests. class_name: UnitTester modules: - enabled: [Asserts, UnitHelper] + enabled: + - Asserts \ No newline at end of file diff --git a/tests/codeception/unit/_bootstrap.php b/tests/codeception/tests/unit/_bootstrap.php similarity index 100% rename from tests/codeception/unit/_bootstrap.php rename to tests/codeception/tests/unit/_bootstrap.php From 2e065086a20098e58b92b8f1faedc116a08b3f91 Mon Sep 17 00:00:00 2001 From: kindlm Date: Fri, 30 Sep 2016 16:38:32 +0200 Subject: [PATCH 19/85] Merge Commit --- include/datum.class.php | 61 ++++++----- include/moodle24_user.class.php | 132 +++++++++++++----------- include/wochenplan.class.php | 6 +- vilesci/moodle/user_sync24.php | 2 + vilesci/stammdaten/studiengang_edit.php | 91 +++++++++++++--- webdav/Caldav_Backend.php | 126 +++++++++++----------- 6 files changed, 250 insertions(+), 168 deletions(-) diff --git a/include/datum.class.php b/include/datum.class.php index bfeddc654..7440e9960 100644 --- a/include/datum.class.php +++ b/include/datum.class.php @@ -23,7 +23,7 @@ class datum { public $ts_day=86400; // Timestamp eines Tages - + /** * Konstruktor * @@ -103,13 +103,12 @@ class datum */ public function jump_week($datum, $wochen) { - $stunde_vor=date("G",$datum); - // Eine Woche sind 604800 Sekunden - $datum+=604800*$wochen; - $stunde_nach=date("G",$datum); - if ($stunde_nach!=$stunde_vor) - $datum+=3600; - return $datum; + $days = $wochen * 7; + + $datetime=new DateTime(); + $datetime->setTimestamp($datum); + $datetime->modify($days.' day'); + return $datetime->format("U"); } /** @@ -159,7 +158,7 @@ class datum else return false; } - + /** * Zieht ein Datum von einem anderen ab, und gibt die differenz in Tagen zurueck (mit Vorzeichen) * @param $datum1 @@ -196,7 +195,7 @@ class datum if($start=='' && $ende!='' && $dateende>=$dateref) return true; - // Ende nicht gesetzt; Start gesetzt + // Ende nicht gesetzt; Start gesetzt if($ende=='' && $start!='' && $datestart<=$dateref) return true; @@ -237,7 +236,7 @@ class datum return $h1.':'.$m1; } - + /** * Subtrahiert 2 Zeiten ($zeit1-$zeit2) Stunde:Minute * Es liefert keine Uhrzeit zurueck sondern Stunden und Minuten @@ -268,7 +267,7 @@ class datum return $h1.':'.$m1; } - + /** * Prueft und Liefert ein Datum im angegeben Format * fuer die Formatierung wird die Funktion formatDatum verwendet @@ -278,9 +277,9 @@ class datum * Eintraege wie zB 'last Monday' oder 'a' auch in ein Datum umgewandelt werden. * @return Formatierten Timestamp wenn ok, false im Fehlerfall */ - function checkformatDatum($datum, $format='Y-m-d H:i:s', $strict=false) + function checkformatDatum($datum, $format='Y-m-d H:i:s', $strict=false) { - + @list($day, $month, $year) = @explode(".", $datum); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); @@ -293,7 +292,7 @@ class datum @list($year, $month, $day) = @explode("-", $datum); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); - + if (strlen($datum)==6) { $year="20".substr($datum,0,2); @@ -301,7 +300,7 @@ class datum $day=substr($datum,4,2); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); - } + } else if (strlen($datum)==8) { $year=substr($datum,0,4); @@ -309,15 +308,15 @@ class datum $day=substr($datum, 6,2); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); - - $year=substr($datum,5,4); + + $year=substr($datum,5,4); $month=substr($datum,3,2); $day=substr($datum, 0,2); if (@checkdate($month, $day, $year)) return $this->formatDatum($datum, $format, $strict); - } - return false; - } + } + return false; + } /** @@ -334,18 +333,18 @@ class datum { if(trim($datum)=='') return ''; - + $ts=''; $error=false; - + //2008-12-31 if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})",$datum, $regs)) $ts = mktime(0,0,0,$regs[2],$regs[3],$regs[1]); - + //2008-12-31 12:30 if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2})",$datum, $regs)) $ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[3],$regs[1]); - + //2008-12-31 12:30:15 if(mb_ereg("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs)) $ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]); @@ -355,20 +354,20 @@ class datum //1.12.2008 if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})",$datum, $regs)) $ts = mktime(0,0,0,$regs[2],$regs[1],$regs[3]); - + //1.12.2008 12:30 if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2})",$datum, $regs)) $ts = mktime($regs[4],$regs[5],0,$regs[2],$regs[1],$regs[3]); - + //1.12.2008 12:30:15 if(mb_ereg("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4}) ([0-9]{2}):([0-9]{2}):([0-9]{2})",$datum, $regs)) $ts = mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[1],$regs[3]); } - + if($ts=='' && !$strict) { $ts = strtotime($datum); - + if(!$ts || $ts==-1) { //wenn strtotime fehlschlaegt liefert diese -1 zurueck, ab php5.1.0 jedoch false @@ -378,9 +377,9 @@ class datum if($ts!='' && !$error) return date($format, $ts); - + return false; } - + } ?> diff --git a/include/moodle24_user.class.php b/include/moodle24_user.class.php index e28bf7a21..a94278fcd 100644 --- a/include/moodle24_user.class.php +++ b/include/moodle24_user.class.php @@ -54,7 +54,7 @@ class moodle24_user extends basis_db * Laedt einen Moodle User * * @param $uid - * @return boolean + * @return boolean oder -1 bei SOAP Fehler */ public function loaduser($uid) { @@ -87,7 +87,7 @@ class moodle24_user extends basis_db catch (SoapFault $E) { $this->errormsg.="SOAP Fehler beim Laden des Users: ".$E->faultstring; - return false; + return -1; } } @@ -209,8 +209,9 @@ class moodle24_user extends basis_db if(!$user_zugeteilt) { + $retval = $this->loaduser($row_ma->mitarbeiter_uid); //MoodleID des Users holen bzw ggf neu anlegen - if(!$this->loaduser($row_ma->mitarbeiter_uid)) + if($retval===false) { //User anlegen if(!$this->createUser($row_ma->mitarbeiter_uid)) @@ -222,29 +223,32 @@ class moodle24_user extends basis_db $this->errormsg = ''; } - if($mitarbeiter!='') - $mitarbeiter.=','; - $mitarbeiter.=$this->mdl_user_id; - - //Mitarbeiter ist noch nicht zugeteilt. - $data = new stdClass(); - $data->roleid=3; // 3=Lektor - $data->userid=$this->mdl_user_id; - $data->courseid=$mdl_course_id; - - try + if($retval!==-1) { - $client = new SoapClient($this->serverurl); - $client->enrol_manual_enrol_users(array($data)); + if($mitarbeiter!='') + $mitarbeiter.=','; + $mitarbeiter.=$this->mdl_user_id; - $this->log.="\nLektorIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; - $this->log_public.="\nLektorIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; - $this->sync_create++; - } - catch (SoapFault $E) - { - $this->errormsg.="SOAP Fehler beim zuteilen der Teilnehmer des Kurses: ".$E->faultstring; - return false; + //Mitarbeiter ist noch nicht zugeteilt. + $data = new stdClass(); + $data->roleid=3; // 3=Lektor + $data->userid=$this->mdl_user_id; + $data->courseid=$mdl_course_id; + + try + { + $client = new SoapClient($this->serverurl); + $client->enrol_manual_enrol_users(array($data)); + + $this->log.="\nLektorIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; + $this->log_public.="\nLektorIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; + $this->sync_create++; + } + catch (SoapFault $E) + { + $this->errormsg.="SOAP Fehler beim zuteilen der Teilnehmer des Kurses: ".$E->faultstring; + return false; + } } } } @@ -369,8 +373,9 @@ class moodle24_user extends basis_db if(!$user_zugeteilt) { + $retval = $this->loaduser($row_user->student_uid); //MoodleID des Users holen bzw ggf neu anlegen - if(!$this->loaduser($row_user->student_uid)) + if($retval===false) { //User anlegen if(!$this->createUser($row_user->student_uid)) @@ -382,23 +387,26 @@ class moodle24_user extends basis_db $this->errormsg = ''; } - if($studenten!='') - $studenten.=','; - $studenten.=$this->mdl_user_id; + if($retval!==-1) + { + if($studenten!='') + $studenten.=','; + $studenten.=$this->mdl_user_id; - //Student ist noch nicht zugeteilt. + //Student ist noch nicht zugeteilt. - $data = new stdClass(); - $data->roleid=5; // 5=Teilnehmer/Student - $data->userid=$this->mdl_user_id; - $data->courseid=$mdl_course_id; + $data = new stdClass(); + $data->roleid=5; // 5=Teilnehmer/Student + $data->userid=$this->mdl_user_id; + $data->courseid=$mdl_course_id; - $userstoenroll[]=$data; + $userstoenroll[]=$data; - $this->log.="\nStudentIn $row_user->student_uid wurde zum Kurs hinzugefügt"; - $this->log_public.="\nStudentIn $row_user->student_uid wurde zum Kurs hinzugefügt"; - $this->sync_create++; + $this->log.="\nStudentIn $row_user->student_uid wurde zum Kurs hinzugefügt"; + $this->log_public.="\nStudentIn $row_user->student_uid wurde zum Kurs hinzugefügt"; + $this->sync_create++; + } } //Gruppenzuteilung @@ -685,8 +693,9 @@ class moodle24_user extends basis_db foreach ($users as $row_user) { + $retval = $this->loaduser($row_user); //MoodleID des Users holen - if(!$this->loaduser($row_user)) + if($retval!==true) { $this->errormsg = "Fehler beim Laden des Users $row_user: $this->errormsg"; return false; @@ -825,9 +834,9 @@ class moodle24_user extends basis_db if(!$user_zugeteilt) { - + $retval = $this->loaduser($row_ma->mitarbeiter_uid); //MoodleID des Users holen bzw ggf neu anlegen - if(!$this->loaduser($row_ma->mitarbeiter_uid)) + if($retval===false) { //User anlegen if(!$this->createUser($row_ma->mitarbeiter_uid)) @@ -839,29 +848,32 @@ class moodle24_user extends basis_db $this->errormsg = ''; } - if($mitarbeiter!='') - $mitarbeiter.=','; - $mitarbeiter.=$this->mdl_user_id; - - //Mitarbeiter ist noch nicht zugeteilt. - $data = new stdClass(); - $data->roleid=11; // 11=Fachbereichsleiter (selbst definierte rolle) - $data->userid=$this->mdl_user_id; - $data->courseid=$mdl_course_id; - - try + if($retval!==-1) { + if($mitarbeiter!='') + $mitarbeiter.=','; + $mitarbeiter.=$this->mdl_user_id; - $client = new SoapClient($this->serverurl); - $client->enrol_manual_enrol_users(array($data)); + //Mitarbeiter ist noch nicht zugeteilt. + $data = new stdClass(); + $data->roleid=11; // 11=Fachbereichsleiter (selbst definierte rolle) + $data->userid=$this->mdl_user_id; + $data->courseid=$mdl_course_id; - $this->log.="\nFachbereitsleiterIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; - $this->log_public.="\nFachbereichsleiterIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; - $this->sync_create++; - } - catch (SoapFault $E) - { - $this->log.="Fehler beim hinzufügen von FBL: ".$E->faultstring; + try + { + + $client = new SoapClient($this->serverurl); + $client->enrol_manual_enrol_users(array($data)); + + $this->log.="\nFachbereitsleiterIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; + $this->log_public.="\nFachbereichsleiterIn $this->mdl_user_firstname $this->mdl_user_lastname wurde zum Kurs hinzugefügt"; + $this->sync_create++; + } + catch (SoapFault $E) + { + $this->log.="Fehler beim hinzufügen von FBL: ".$E->faultstring; + } } } } diff --git a/include/wochenplan.class.php b/include/wochenplan.class.php index a76fdaaf4..aa9ec7b5a 100644 --- a/include/wochenplan.class.php +++ b/include/wochenplan.class.php @@ -2384,7 +2384,7 @@ class wochenplan extends basis_db /** * Unterricht der ueber mehrere Stunden geht wird nicht einzeln Exportiert, - * sondern zusammengeblockt. (in maximal 4er Bloecke) + * sondern zusammengeblockt. * * Es wird nur ein Eintrag geschrieben, die restlichen werden uebersprungen. * Vor dem Ueberspringen des Eintrages werden jedoch noch die dazu Gruppierten Eintraege @@ -2499,7 +2499,7 @@ class wochenplan extends basis_db $end_date_time_ical = $eda[2].$eda[1].$eda[0].'T'.sprintf('%02s',($eta[0])).$eta[1].$eta[2]; //neu gruppieren der Startzeit und des Startdatums echo $this->crlf.'BEGIN:VEVENT'.$this->crlf - .'UID:'.'FH'.str_replace(',',' ',$lvb.$this->std_plan[$i][$j][$idx]->ort.$this->std_plan[$i][$j][$idx]->lektor.$lehrfach[$idx].$start_date_time_ical.$this->crlf) + .'UID:'.'FH'.str_replace(',',' ',$lvb.$this->std_plan[$i][$j][$idx]->ort.$this->std_plan[$i][$j][$idx]->lektor.$lehrfach[$idx].$start_date_time_ical.$end_date_time_ical.$this->crlf) .'SUMMARY:'.str_replace(',',' ',$lehrfach[$idx].' '.$this->std_plan[$i][$j][$idx]->ort.' - '.$lvb.$this->crlf) .'DESCRIPTION:'.str_replace(',',' ',$lehrfach[$idx].'\n'.$this->std_plan[$i][$j][$idx]->lektor.'\n'.$lvb.'\n'.$this->std_plan[$i][$j][$idx]->ort.(LVPLAN_ANMERKUNG_ANZEIGEN?'\n'.$this->std_plan[$i][$j][$idx]->anmerkung:'').$this->crlf) .'LOCATION:'.$this->std_plan[$i][$j][$idx]->ort.$this->crlf @@ -2541,7 +2541,7 @@ class wochenplan extends basis_db $start_date_time_ical = $sda[2].$sda[1].$sda[0].'T'.sprintf('%02s',($sta[0])).$sta[1].$sta[2]; //neu gruppieren der Startzeit und des Startdatums $end_date_time_ical = $eda[2].$eda[1].$eda[0].'T'.sprintf('%02s',($eta[0])).$eta[1].$eta[2]; //neu gruppieren der Startzeit und des Startdatums - $UID = 'FH'.$lvb.$this->std_plan[$i][$j][$idx]->ort.$this->std_plan[$i][$j][$idx]->lektor.$lehrfach[$idx].$start_date_time_ical; + $UID = 'FH'.$lvb.$this->std_plan[$i][$j][$idx]->ort.$this->std_plan[$i][$j][$idx]->lektor.$lehrfach[$idx].$start_date_time_ical.$end_date_time_ical; $Summary = $lehrfach[$idx].' '.$this->std_plan[$i][$j][$idx]->ort.' - '.$lvb; $description = $lehrfach[$idx].'\n'.$this->std_plan[$i][$j][$idx]->lektor.'\n'.$lvb.'\n'.$this->std_plan[$i][$j][$idx]->ort; diff --git a/vilesci/moodle/user_sync24.php b/vilesci/moodle/user_sync24.php index a5e7adda1..dbddfae76 100755 --- a/vilesci/moodle/user_sync24.php +++ b/vilesci/moodle/user_sync24.php @@ -96,6 +96,8 @@ if(isset($_POST['sync'])) if($moodle->sync_studenten($mdl_course_id)) { echo $moodle->log; + echo '
    '; + echo $moodle->errormsg; } else echo 'Fehler bei der Zuteilung:'.$moodle->errormsg; diff --git a/vilesci/stammdaten/studiengang_edit.php b/vilesci/stammdaten/studiengang_edit.php index 1c0bc20de..5063d0c1e 100755 --- a/vilesci/stammdaten/studiengang_edit.php +++ b/vilesci/stammdaten/studiengang_edit.php @@ -20,16 +20,18 @@ /** * Seite zur Aenderung des Studiengangsnamens */ -require_once('../../config/vilesci.config.inc.php'); +require_once('../../config/vilesci.config.inc.php'); require_once('../../include/globals.inc.php'); require_once('../../include/functions.inc.php'); require_once('../../include/studiengang.class.php'); require_once('../../include/benutzerberechtigung.class.php'); require_once('../../include/organisationsform.class.php'); +require_once('../../include/benutzerfunktion.class.php'); +require_once('../../include/benutzer.class.php'); if (!$db = new basis_db()) die('Es konnte keine Verbindung zum Server aufgebaut werden.'); - + ?> @@ -53,7 +55,7 @@ if(isset($_GET['studiengang_kz'])) $stg_kz = $_GET['studiengang_kz']; else $stg_kz=''; - + if(isset($_GET['action']) && $_GET['action']=='save') { $studiengang_kz = $_POST['studiengang_kz']; @@ -61,13 +63,13 @@ if(isset($_GET['action']) && $_GET['action']=='save') $studiengang->load($studiengang_kz); if(!$rechte->isBerechtigt('assistenz', $studiengang->oe_kurzbz, 'suid')) die('Sie haben keine Berechtigung fuer diese Seite'); - + $bezeichnung = $_POST['bezeichnung']; $english = $_POST['english']; $max_semester = $_POST['max_semester']; $orgform_kurzbz = $_POST['orgform_kurzbz']; $stg_kz=$studiengang_kz; - + $stg = new studiengang(); if($stg->load($studiengang_kz)) { @@ -80,13 +82,46 @@ if(isset($_GET['action']) && $_GET['action']=='save') echo 'Erfolgreich geändert'; else echo 'Fehler beim Speichern: '.$stg->errormsg.''; - + + } + + if($studiengang_kz==334) + { + $benutzerfunktion = new benutzerfunktion(); + $benutzerfunktion->getOeFunktionen($stg->oe_kurzbz, 'Leitung'); + + foreach($benutzerfunktion->result as $row) + { + if(isset($_POST['ltg_'.$row->benutzerfunktion_id])) + { + // Leitung wird gesetzt + if($row->datum_bis!='') + { + $row->datum_bis=''; + $row->updateamum = date('Y-m-d H:i:s'); + $row->updatevon = $user; + $row->save(false); + } + } + else + { + // Leitung wird entfernt + if($row->datum_bis=='' || $row->datum_bis>date('Y-m-d')) + { + $row->datum_bis=date('Y-m-d',mktime(0, 0, 0, date("m"), date("d")-1, date("Y"))); + $row->updateamum = date('Y-m-d H:i:s'); + $row->updatevon = $user; + $row->save(false); + } + } + + } } } -$stg = new studiengang(); +$stg = new studiengang(); $stg_arr = $rechte->getStgKz('assistenz'); -$stg->loadArray($stg_arr,'typ, kurzbz',true); +$stg->loadArray($stg_arr,'typ, kurzbz',true); echo '
    Studiengang: '; @@ -136,15 +171,47 @@ foreach($orgform->result as $row) $selected='selected'; else $selected=''; - + echo ''; } echo ' -
    +'; +if($stg->studiengang_kz==334) +{ + // Studiengang MIT / MSC kann auch die Leitung aktivieren/deaktivieren + echo ''; + echo ''; + echo ''; + echo ''; +} + +echo ' + + + + diff --git a/webdav/Caldav_Backend.php b/webdav/Caldav_Backend.php index d107341d2..bcb8edcb7 100644 --- a/webdav/Caldav_Backend.php +++ b/webdav/Caldav_Backend.php @@ -2,17 +2,18 @@ require_once(dirname(__FILE__).'/../include/wochenplan.class.php'); require_once(dirname(__FILE__).'/../include/functions.inc.php'); require_once(dirname(__FILE__).'/../include/mitarbeiter.class.php'); +require_once(dirname(__FILE__).'/../include/datum.class.php'); /** * CalDAV backend */ -class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend +class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend { /** - * Creates the backend - * + * Creates the backend + * * @param AuthBackend $auth */ - public function __construct($auth) + public function __construct($auth) { $this->auth = $auth; } @@ -31,18 +32,18 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend * Every project is an array with the following keys: * * id, a unique id that will be used by other functions to modify the * calendar. This can be the same as the uri or a database key. - * * uri, which the basename of the uri with which the calendar is + * * uri, which the basename of the uri with which the calendar is * accessed. * * principalUri. The owner of the calendar. Almost always the same as * principalUri passed to this method. * * Furthermore it can contain webdav properties in clark notation. A very - * common one is '{DAV:}displayname'. + * common one is '{DAV:}displayname'. * - * @param string $principalUri - * @return array + * @param string $principalUri + * @return array */ - public function getCalendarsForUser($principalUri) + public function getCalendarsForUser($principalUri) { //error_log("Caldav_Backend.php/getCalendarsForUser($principalUri)"); //$user = $this->getUser(); @@ -75,7 +76,7 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend * @param string $calendarUri * @param array $properties */ - public function createCalendar($principalUri,$calendarUri, array $properties) + public function createCalendar($principalUri,$calendarUri, array $properties) { throw new \Sabre\DAV\Exception('Not Implemented'); } @@ -108,43 +109,44 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend * ) * ) * - * In this example it was forbidden to update {DAV:}displayname. + * In this example it was forbidden to update {DAV:}displayname. * (403 Forbidden), which in turn also caused {DAV:}owner to fail * (424 Failed Dependency) because the request needs to be atomic. * * @param string $calendarId - * @param array $mutations - * @return bool|array + * @param array $mutations + * @return bool|array */ - public function updateCalendar($calendarId, array $mutations) + public function updateCalendar($calendarId, array $mutations) { return false; } /** - * Delete a calendar and all it's objects - * - * @param string $calendarId + * Delete a calendar and all it's objects + * + * @param string $calendarId * @return void */ - public function deleteCalendar($calendarId) + public function deleteCalendar($calendarId) { throw new \Sabre\DAV\Exception('Not Implemented'); } - + public function getCalendarData($user, $objectUri=null) { + $datum_obj = new datum(); $starttime = microtime(true); $bn = new benutzer(); if(!$bn->load($user)) die('User invalid'); - + if(check_lektor($user)) $type='lektor'; else $type='student'; - + // Stundenplanobjekt erzeugen $stdplan = new wochenplan($type); $stdplan->crlf="\n"; @@ -156,7 +158,7 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend } if(!is_null($objectUri)) { - $unr = mb_substr($objectUri, mb_strpos($objectUri,'-')+1); + $unr = mb_substr($objectUri, (mb_strpos($objectUri,'-')+1), mb_strpos($objectUri,'@')-(mb_strpos($objectUri,'-')+1)); $dtstart = mb_substr($objectUri,0,mb_strpos($objectUri,'-')); if(mb_strlen($dtstart)==15) @@ -170,14 +172,14 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend $sekunde = mb_substr($dtstart,13,2); $begin = mktime($stunde, $minute, $sekunde, $monat, $tag-1, $jahr); $ende = mktime($stunde, $minute, $sekunde, $monat, $tag+1, $jahr); - //error_log("getCalendarData unr: $unr dtstart: $dtstart"); + //error_log("getCalendarData unr: $unr dtstart: $dtstart size:".(mb_strlen($objectUri)-mb_strpos($objectUri,'@'))); //error_log($begin.'/'.$ende); } else { //error_log("dtstart laenge abnormal: $dtstart"); $begin = mktime(0,0,0,date('m'),date('d')-14,date('Y')); - $ende = mktime(0,0,0,date('m')+6,date('d'),date('Y')); + $ende = mktime(0,0,0,date('m')+6,date('d'),date('Y')); } } else @@ -195,10 +197,10 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend $i++; if(!date("w",$begin)) $begin=jump_day($begin,1); - + $stdplan->init_stdplan(); $datum=$begin; - $begin+=604800; // eine Woche + $begin = $datum_obj->jump_week($begin,1); // Stundenplan einer Woche laden if(!$stdplan->load_week($datum,$db_stpl_table)) @@ -224,7 +226,7 @@ class MySabre_CalDAV_Backend extends \Sabre\CalDAV\Backend\AbstractBackend //error_log("\n\nDATA".print_r($data,true)); //error_log("getCalendarData time:".($endtime-$starttime)); //$data.="\nEND:VCALENDAR"; - return $data; + return $data; } public function makeCal($event) { @@ -250,28 +252,28 @@ END:STANDARD END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; } /** - * Returns all calendar objects within a calendar. + * Returns all calendar objects within a calendar. * * Every item contains an array with the following keys: * * id - unique identifier which will be used for subsequent updates * * calendardata - The iCalendar-compatible calnedar data * * uri - a unique key which will be used to construct the uri. This can be any arbitrary string. * * lastmodified - a timestamp of the last modification time - * * etag - An arbitrary string, surrounded by double-quotes. (e.g.: + * * etag - An arbitrary string, surrounded by double-quotes. (e.g.: * ' "abcdef"') * * calendarid - The calendarid as it was passed to this function. * - * Note that the etag is optional, but it's highly encouraged to return for + * Note that the etag is optional, but it's highly encouraged to return for * speed reasons. * - * The calendardata is also optional. If it's not returned - * 'getCalendarObject' will be called later, which *is* expected to return + * The calendardata is also optional. If it's not returned + * 'getCalendarObject' will be called later, which *is* expected to return * calendardata. - * - * @param string $calendarId - * @return array + * + * @param string $calendarId + * @return array */ - public function getCalendarObjects($calendarId) + public function getCalendarObjects($calendarId) { //$user = $this->getUser(); $user = $calendarId; @@ -290,7 +292,7 @@ END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; $return[] = array("id"=>$row['UID'], "calendardata"=>$this->makeCal($row['data']), - "uri"=>$uri, + "uri"=>$uri.'@'.md5($row['UID']), "lastmodified"=>$row['updateamum'], "etag"=>'"'.$row['UID'].'"', "calendarid"=>$calendarId); @@ -303,15 +305,15 @@ END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; * Returns information from a single calendar object, based on it's object * uri. * - * The returned array must have the same keys as getCalendarObjects. The - * 'calendardata' object is required here though, while it's not required + * The returned array must have the same keys as getCalendarObjects. The + * 'calendardata' object is required here though, while it's not required * for getCalendarObjects. - * - * @param string $calendarId - * @param string $objectUri - * @return array + * + * @param string $calendarId + * @param string $objectUri + * @return array */ - public function getCalendarObject($calendarId,$objectUri) + public function getCalendarObject($calendarId,$objectUri) { //error_log("Caldav_Backend.php/getCalendarObject($calendarId, $objectUri)"); //$user = $this->getUser(); @@ -330,7 +332,7 @@ END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; { $ret = array("id"=>$data['UID'], "calendardata"=>$this->makeCal($data['data']), - "uri"=>'principals/'.$user.'/LVPlan/'.$data['dtstart'].'-'.$data['unr'][0], + "uri"=>'principals/'.$user.'/LVPlan/'.$data['dtstart'].'-'.$data['unr'][0].'@'.md5($data['UID']), "lastmodified"=>$data['updateamum'], "etag"=>'"'.$data['UID'].'"', "calendarid"=>$calendarId); @@ -339,39 +341,39 @@ END:VTIMEZONE\n".$event."\nEND:VCALENDAR"; } /** - * Creates a new calendar object. - * - * @param string $calendarId - * @param string $objectUri - * @param string $calendarData + * Creates a new calendar object. + * + * @param string $calendarId + * @param string $objectUri + * @param string $calendarData * @return void */ - public function createCalendarObject($calendarId,$objectUri,$calendarData) + public function createCalendarObject($calendarId,$objectUri,$calendarData) { throw new \Sabre\DAV\Exception('Not Implemented'); } /** - * Updates an existing calendarobject, based on it's uri. - * - * @param string $calendarId - * @param string $objectUri - * @param string $calendarData + * Updates an existing calendarobject, based on it's uri. + * + * @param string $calendarId + * @param string $objectUri + * @param string $calendarData * @return void */ - public function updateCalendarObject($calendarId,$objectUri,$calendarData) + public function updateCalendarObject($calendarId,$objectUri,$calendarData) { throw new \Sabre\DAV\Exception('Not Implemented'); } /** - * Deletes an existing calendar object. - * - * @param string $calendarId - * @param string $objectUri + * Deletes an existing calendar object. + * + * @param string $calendarId + * @param string $objectUri * @return void */ - public function deleteCalendarObject($calendarId,$objectUri) + public function deleteCalendarObject($calendarId,$objectUri) { throw new Sabre\DAV\Exception('Not Implemented'); } From e321163bb0ba64f3c2a584ef78e2517b9818af1f Mon Sep 17 00:00:00 2001 From: oesi Date: Fri, 30 Sep 2016 16:56:02 +0200 Subject: [PATCH 20/85] Fixed wrong comment --- system/dbupdate_3.2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/dbupdate_3.2.php b/system/dbupdate_3.2.php index 28b018a91..39b69338d 100755 --- a/system/dbupdate_3.2.php +++ b/system/dbupdate_3.2.php @@ -1206,7 +1206,7 @@ if(!$result = @$db->db_query("SELECT verpflichtend FROM public.tbl_ampel LIMIT 1 echo '
    Neue Spalten "verpflichtend" und "buttontext" in Tabelle public.tbl_ampel hinzugefügt
    '; } -// Neue Spalte studienplan_id in public.tbl_bewerbungstermine +// Neue Spalte lieferbedingungen in public.tbl_firma if(!$result = @$db->db_query("SELECT lieferbedingungen FROM public.tbl_firma LIMIT 1")) { $qry = "ALTER TABLE public.tbl_firma ADD COLUMN lieferbedingungen varchar(256);"; From 33d3697f2ff99126a6a01f5bb64c007a3caac436 Mon Sep 17 00:00:00 2001 From: Andreas Moik Date: Mon, 3 Oct 2016 10:29:32 +0200 Subject: [PATCH 21/85] add statistik_kurzbz to errormsg --- include/statistik.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/statistik.class.php b/include/statistik.class.php index 85fb6e834..46fcef12f 100644 --- a/include/statistik.class.php +++ b/include/statistik.class.php @@ -108,7 +108,7 @@ class statistik extends basis_db } else { - $this->errormsg = 'Dieser Eintrag wurde nicht gefunden'; + $this->errormsg = 'Dieser Eintrag wurde nicht gefunden: ' . $statistik_kurzbz; return false; } } From b4ea35858caa8a3c2bc93f84c6eefe466d87159f Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Mon, 3 Oct 2016 13:11:51 +0200 Subject: [PATCH 22/85] fixed bug which end in an unterminated loop --- rdf/lehrveranstaltungszeugnis_ktu.rdf.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rdf/lehrveranstaltungszeugnis_ktu.rdf.php b/rdf/lehrveranstaltungszeugnis_ktu.rdf.php index 28b3036c6..d560bbf27 100755 --- a/rdf/lehrveranstaltungszeugnis_ktu.rdf.php +++ b/rdf/lehrveranstaltungszeugnis_ktu.rdf.php @@ -371,10 +371,11 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") { $studienplan->loadStudienplanLehrveranstaltung($studienplan_lehrveranstaltung_id); $lv = new lehrveranstaltung(); - while($lv->lehrtyp_kurzbz != "modul") + while(($lv->lehrtyp_kurzbz != "modul") && ($studienplan->lehrveranstaltung_id != $studienplan_lehrveranstaltung_id)) { - $lv->load($studienplan->lehrveranstaltung_id); - $studienplan->loadStudienplanLehrveranstaltung($studienplan->studienplan_lehrveranstaltung_id_parent); + $lv->load($studienplan->lehrveranstaltung_id); + $studienplan_lehrveranstaltung_id = $studienplan->lehrveranstaltung_id; + $studienplan->loadStudienplanLehrveranstaltung($studienplan->studienplan_lehrveranstaltung_id_parent); } $lehrveranstaltung->lehrveranstaltungen = array(0 => $lv); } From ceb2ef0dbf70e329c0d64927b7bf8b9d89da5190 Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Mon, 3 Oct 2016 13:48:21 +0200 Subject: [PATCH 23/85] updated phrasen --- cis/private/lehre/pruefung/pruefungsanmeldungen_liste.php | 2 +- locale/de-AT/pruefung.php | 1 + locale/en-US/pruefung.php | 1 + locale/it-IT/pruefung.php | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cis/private/lehre/pruefung/pruefungsanmeldungen_liste.php b/cis/private/lehre/pruefung/pruefungsanmeldungen_liste.php index ea07690bb..5810b0315 100755 --- a/cis/private/lehre/pruefung/pruefungsanmeldungen_liste.php +++ b/cis/private/lehre/pruefung/pruefungsanmeldungen_liste.php @@ -227,7 +227,7 @@ $rechte->getBerechtigungen($uid);
    - + diff --git a/locale/de-AT/pruefung.php b/locale/de-AT/pruefung.php index 1f127dfea..59c342b0c 100755 --- a/locale/de-AT/pruefung.php +++ b/locale/de-AT/pruefung.php @@ -108,6 +108,7 @@ $this->phrasen['pruefung/keineLehreinheitenVorhanden'] = 'Keine Lehreinheiten vo $this->phrasen['pruefung/keineAnmeldungenVorhanden'] = 'Keine Anmeldungen vorhanden.'; $this->phrasen['pruefung/derLektor'] = 'Lektor'; $this->phrasen['pruefung/dieKommission'] = 'Kommission'; +$this->phrasen['pruefung/matrikelnummer'] = 'Personenkennzeichen'; // anmeldungen Verwalten $this->phrasen['pruefung/anmeldungenVerwaltenTitle'] = 'Prüfungsanmeldung Verwaltung'; diff --git a/locale/en-US/pruefung.php b/locale/en-US/pruefung.php index e46fc9aef..8c586e854 100755 --- a/locale/en-US/pruefung.php +++ b/locale/en-US/pruefung.php @@ -108,6 +108,7 @@ $this->phrasen['pruefung/keineLehreinheitenVorhanden'] = 'Keine Lehreinheiten vo $this->phrasen['pruefung/keineAnmeldungenVorhanden'] = 'Keine Anmeldungen vorhanden.'; $this->phrasen['pruefung/derLektor'] = 'Lektor'; $this->phrasen['pruefung/dieKommission'] = 'Kommission'; +$this->phrasen['pruefung/matrikelnummer'] = 'Personenkennzeichen'; // anmeldungen Verwalten $this->phrasen['pruefung/anmeldungenVerwaltenTitle'] = 'Prüfungsanmeldung Verwaltung'; diff --git a/locale/it-IT/pruefung.php b/locale/it-IT/pruefung.php index 476b14ec0..3f7ff66b1 100755 --- a/locale/it-IT/pruefung.php +++ b/locale/it-IT/pruefung.php @@ -108,6 +108,7 @@ $this->phrasen['pruefung/keineLehreinheitenVorhanden'] = 'Nessun corso disponibi $this->phrasen['pruefung/keineAnmeldungenVorhanden'] = 'Nessun studente iscritto.'; $this->phrasen['pruefung/derLektor'] = 'Docente'; $this->phrasen['pruefung/dieKommission'] = 'Commissione'; +$this->phrasen['pruefung/matrikelnummer']='Matricola'; // anmeldungen Verwalten $this->phrasen['pruefung/anmeldungenVerwaltenTitle'] = 'Gestione delle prenotazioni degli appelli'; From 3bb86f6f055ce59f393c855fddfa93841f2b6971 Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Mon, 3 Oct 2016 14:53:02 +0200 Subject: [PATCH 24/85] fixed bug in calculation if course is completed --- cis/private/profile/studienplan.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/cis/private/profile/studienplan.php b/cis/private/profile/studienplan.php index 633da1faf..2343e780d 100755 --- a/cis/private/profile/studienplan.php +++ b/cis/private/profile/studienplan.php @@ -511,28 +511,40 @@ function drawTree($tree, $depth) if($found) { if($positiv) - echo ''.$p->t('studienplan/abgeschlossen').''; + { + echo ''.$p->t('studienplan/abgeschlossen').''; + } else + { echo ''.$p->t('studienplan/negativ').''; + } } elseif(!$found) { - if($abgeschlossen) - echo ''.$p->t('studienplan/regelabgeschlossen'),''; - elseif(!$row_tree->stpllv_pflicht) + if(!$row_tree->stpllv_pflicht) + { echo ''.$p->t('studienplan/optional').''; - else + } + else + { echo ''.$p->t('studienplan/offen').''; + } } } else { if($abgeschlossen) + { echo ''.$p->t('studienplan/regelabgeschlossen'),''; + } elseif(!$row_tree->stpllv_pflicht) + { echo ''.$p->t('studienplan/optional').''; + } else + { echo ''.$p->t('studienplan/offen').''; + } } echo ''; From a029a91789c1c8cdca1d0b41136730cff38f0a8d Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Tue, 4 Oct 2016 10:06:12 +0200 Subject: [PATCH 25/85] bug: registration not possible if rules are not fulfilled --- cis/private/profile/studienplan.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cis/private/profile/studienplan.php b/cis/private/profile/studienplan.php index 2343e780d..26cb18cd8 100755 --- a/cis/private/profile/studienplan.php +++ b/cis/private/profile/studienplan.php @@ -19,6 +19,7 @@ * * * Authors: Andreas Österreicher + * Stefan Puraner * * Zeigt den Studienplan eines Studierenden an * und bietet die Möglichkeit zur Anmeldung zu Lehrveranstaltungen. @@ -366,7 +367,7 @@ drawTree($tree,0); function drawTree($tree, $depth) { - global $uid, $stsem_arr, $noten_arr, $lvangebot_arr; + global $uid, $stsem_arr, $noten_arr, $lvangebot_arr, $aktornext; global $datum_obj, $db, $lv_arr, $p, $note_pruef_arr, $student; foreach($tree as $row_tree) @@ -622,12 +623,16 @@ function drawTree($tree, $depth) } else { - if(!$lvregel->isZugangsberechtigt($uid, $row_tree->studienplan_lehrveranstaltung_id, $stsem)) + //check if rules are fulfilled just for actual or next studiensemester + if($stsem === $aktornext) { - $regelerfuellt=false; + if($lvregel->isZugangsberechtigt($uid, $row_tree->studienplan_lehrveranstaltung_id, $stsem) !== true) + { + $regelerfuellt=false; + } } } - + foreach($lvkompatibel_arr as $row_lvid) { // Angebot der LV pruefen @@ -681,7 +686,7 @@ function drawTree($tree, $depth) $tdinhalt.= '-'; if(!$regelerfuellt) - $tdinhalt.= 'X'; + $tdinhalt= 'X'; } } else From f48e1e59a7ffab1506189730f7761f00a75a0903 Mon Sep 17 00:00:00 2001 From: oesi Date: Wed, 5 Oct 2016 12:57:41 +0200 Subject: [PATCH 26/85] =?UTF-8?q?Zahlungsbest=C3=A4tigungen=20drucken=20is?= =?UTF-8?q?t=20jetzt=20auch=20m=C3=B6glich=20wenn=20zu=20viel=20bezahlt=20?= =?UTF-8?q?wurde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/pdfExport.php | 2 +- cis/private/profile/zahlungen.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cis/private/pdfExport.php b/cis/private/pdfExport.php index fa818838e..03660bb92 100644 --- a/cis/private/pdfExport.php +++ b/cis/private/pdfExport.php @@ -152,7 +152,7 @@ if (($user == $_GET["uid"]) || $rechte->isBerechtigt('admin')) $konto->load($bnr); if($konto->person_id!=$user_obj->person_id) die('Sie haben keine Berechtigung fuer diese Buchung'); - if($konto->getDifferenz($bnr)!=0) + if($konto->getDifferenz($bnr)>0) die('Diese Zahlung wurde noch nicht beglichen'); } } diff --git a/cis/private/profile/zahlungen.php b/cis/private/profile/zahlungen.php index c1ab84f38..3680ae788 100644 --- a/cis/private/profile/zahlungen.php +++ b/cis/private/profile/zahlungen.php @@ -157,7 +157,7 @@ echo ''; echo ''; echo '
    Deadline Vorlaufzeit VerfallszeitVerpflichtend Aktion
    ',$datum_obj->formatDatum($row->deadline,'d.m.Y'),'',$row->vorlaufzeit,'',$row->verfallszeit,'',($row->verpflichtend=='t'?'Ja':'Nein'),'bearbeitenkopierenentfernen
    Leitung'; + + $benutzerfunktion = new benutzerfunktion(); + $benutzerfunktion->getOeFunktionen($stg->oe_kurzbz, 'Leitung'); + + foreach($benutzerfunktion->result as $row) + { + if($row->datum_bis=='' || $row->datum_bis>date('Y-m-d')) + $checked='checked="checked"'; + else + $checked=''; + + echo ''; + $bn = new benutzer(); + $bn->load($row->uid); + echo $bn->vorname.' '.$bn->nachname.'
    '; + } + + echo '
      
    Leitung'; + + $benutzerfunktion = new benutzerfunktion(); + $benutzerfunktion->getOeFunktionen($stg->oe_kurzbz, 'Leitung'); + + foreach($benutzerfunktion->result as $row) + { + if($row->datum_bis=='' || $row->datum_bis>date('Y-m-d')) + $checked='checked="checked"'; + else + $checked=''; + + echo ''; + $bn = new benutzer(); + $bn->load($row->uid); + echo $bn->vorname.' '.$bn->nachname.'
    '; + } + + echo '
      
    # t('global/vorname'); ?> t('global/nachname'); ?>t('global/matrikelnummer'); ?>t('pruefung/matrikelnummer'); ?> t('global/datum'); ?> t('benotungstool/note'); ?> t('global/anmerkung'); ?>'.$row['parent']->buchungstext.''.($betrag<0?'-':($betrag>0?'+':'')).sprintf('%.2f',abs($row['parent']->betrag)).' €'; - if($betrag==0 && $row['parent']->betrag<=0) + if($betrag>=0 && $row['parent']->betrag<=0) echo ''.$p->t('tools/bestaetigungDrucken').''; elseif($row['parent']->betrag>0) { From b4efb5aaa4285066161bfe8d07c1ec128d2b7957 Mon Sep 17 00:00:00 2001 From: Andreas Moik Date: Thu, 6 Oct 2016 09:15:18 +0200 Subject: [PATCH 27/85] new entry in tbl_webservicetyp (reports) --- system/dbupdate_3.2.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/system/dbupdate_3.2.php b/system/dbupdate_3.2.php index 39b69338d..56fb9086d 100755 --- a/system/dbupdate_3.2.php +++ b/system/dbupdate_3.2.php @@ -1218,6 +1218,17 @@ if(!$result = @$db->db_query("SELECT lieferbedingungen FROM public.tbl_firma LIM } +// 10.16 neuer webservicetyp reports +$result = $db->db_query("SELECT 1 FROM system.tbl_webservicetyp WHERE webservicetyp_kurzbz='reports'"); +if($db->db_num_rows($result) < 1) +{ + $qry = "INSERT INTO system.tbl_webservicetyp (webservicetyp_kurzbz, beschreibung) VALUES('reports', 'Logtyp fuer reports');"; + if(!$db->db_query($qry)) + echo 'system.tbl_webservicetyp '.$db->db_last_error().'
    '; + else + echo '
    Neuen Eintrag "reports" in Tabelle system.tbl_webservicetyp eingefuegt
    '; +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; From e1c19fa4de659e49aa85a3e66cab3175a7a6dbe1 Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Thu, 6 Oct 2016 17:04:52 +0200 Subject: [PATCH 28/85] moved credit points check from cours registration to exam registration --- .../pruefung/pruefungsanmeldung.json.php | 342 ++++++++++-------- cis/private/profile/studienplan.php | 34 +- include/konto.class.php | 45 +++ 3 files changed, 237 insertions(+), 184 deletions(-) diff --git a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php index 85bd6cc16..4ae16864e 100755 --- a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php +++ b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php @@ -67,20 +67,19 @@ switch($method) $data = loadTermine(); break; case 'saveAnmeldung': - $student_uid = filter_input(INPUT_POST,"uid"); - if($student_uid !== "" && !is_null($student_uid)) - { - $uid = $student_uid; - } - - if($student_uid === "") - { - $data['result']=""; - $data['error']='true'; - $data['errormsg']='Studenten UID fehlt.'; - break; - } + $student_uid = filter_input(INPUT_POST,"uid"); + if($student_uid !== "" && !is_null($student_uid)) + { + $uid = $student_uid; + } + if($student_uid === "") + { + $data['result']=""; + $data['error']='true'; + $data['errormsg']='Studenten UID fehlt.'; + break; + } $data = saveAnmeldung($aktStudiensemester, $uid); break; case 'getAllPruefungen': @@ -142,60 +141,60 @@ function getPruefungByLv($aktStudiensemester = null, $uid = null) $lvIds = array(); foreach($lehrveranstaltungen->lehrveranstaltungen as $lvs) { - array_push($lvIds, $lvs->lehrveranstaltung_id); + array_push($lvIds, $lvs->lehrveranstaltung_id); } $lehrveranstaltungen=$lvIds; $pruefung = new pruefungCis(); if($pruefung->getPruefungByLv($lehrveranstaltungen)) { - $pruefungen = array(); - foreach($pruefung->lehrveranstaltungen as $key=>$lv) - { - $lehrveranstaltung = new lehrveranstaltung($lv->lehrveranstaltung_id); - $lehrveranstaltung = $lehrveranstaltung->cleanResult(); - $lehreinheit = new lehreinheit(); - $lehreinheit->load_lehreinheiten($lehrveranstaltung[0]->lehrveranstaltung_id, $aktStudiensemester); - $lehreinheiten = $lehreinheit->lehreinheiten; - $prf = new stdClass(); - $temp = new pruefungCis($lv->pruefung_id); - $temp->getTermineByPruefung($lv->pruefung_id); - for($i=0; $i < sizeof($temp->termine); $i++) - { - $termin = new pruefungstermin($temp->termine[$i]->pruefungstermin_id); - $temp->termine[$i]->teilnehmer = $termin->getNumberOfParticipants(); - } - $prf->pruefung = $temp; - $prf->lehrveranstaltung = $lehrveranstaltung; - if(!empty($lehreinheiten)) - { - $lveranstaltung = new lehrveranstaltung($lehreinheiten[0]->lehrfach_id); - $oe = new organisationseinheit($lveranstaltung->oe_kurzbz); - $prf->organisationseinheit = $oe->bezeichnung; - array_push($pruefungen, $prf); - } - } - $anmeldung = new pruefungsanmeldung(); - $anmeldungen = $anmeldung->getAnmeldungenByStudent($uid, $aktStudiensemester); - $anmeldungsIds = array(); - foreach($anmeldungen as $anm) - { - $a = new stdClass(); - $a->pruefungsanmeldung_id = $anm->pruefungsanmeldung_id; - $a->pruefungstermin_id = $anm->pruefungstermin_id; - $a->lehrveranstaltung_id = $anm->lehrveranstaltung_id; - array_push($anmeldungsIds, $a); - } - $return = new stdClass(); - $return->pruefungen = $pruefungen; - $return->anmeldungen = $anmeldungsIds; - $data['result']=$return; - $data['error']='false'; - $data['errormsg']=''; + $pruefungen = array(); + foreach($pruefung->lehrveranstaltungen as $key=>$lv) + { + $lehrveranstaltung = new lehrveranstaltung($lv->lehrveranstaltung_id); + $lehrveranstaltung = $lehrveranstaltung->cleanResult(); + $lehreinheit = new lehreinheit(); + $lehreinheit->load_lehreinheiten($lehrveranstaltung[0]->lehrveranstaltung_id, $aktStudiensemester); + $lehreinheiten = $lehreinheit->lehreinheiten; + $prf = new stdClass(); + $temp = new pruefungCis($lv->pruefung_id); + $temp->getTermineByPruefung($lv->pruefung_id); + for($i=0; $i < sizeof($temp->termine); $i++) + { + $termin = new pruefungstermin($temp->termine[$i]->pruefungstermin_id); + $temp->termine[$i]->teilnehmer = $termin->getNumberOfParticipants(); + } + $prf->pruefung = $temp; + $prf->lehrveranstaltung = $lehrveranstaltung; + if(!empty($lehreinheiten)) + { + $lveranstaltung = new lehrveranstaltung($lehreinheiten[0]->lehrfach_id); + $oe = new organisationseinheit($lveranstaltung->oe_kurzbz); + $prf->organisationseinheit = $oe->bezeichnung; + array_push($pruefungen, $prf); + } + } + $anmeldung = new pruefungsanmeldung(); + $anmeldungen = $anmeldung->getAnmeldungenByStudent($uid, $aktStudiensemester); + $anmeldungsIds = array(); + foreach($anmeldungen as $anm) + { + $a = new stdClass(); + $a->pruefungsanmeldung_id = $anm->pruefungsanmeldung_id; + $a->pruefungstermin_id = $anm->pruefungstermin_id; + $a->lehrveranstaltung_id = $anm->lehrveranstaltung_id; + array_push($anmeldungsIds, $a); + } + $return = new stdClass(); + $return->pruefungen = $pruefungen; + $return->anmeldungen = $anmeldungsIds; + $data['result']=$return; + $data['error']='false'; + $data['errormsg']=''; } else { - $data['error']='true'; - $data['errormsg']=$pruefung->errormsg; + $data['error']='true'; + $data['errormsg']=$pruefung->errormsg; } return $data; } @@ -387,26 +386,26 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null) $addon = new addon(); foreach ($addon->aktive_addons as $a) { - if($a === "ku") - { - require '../../../../addons/'.$a.'/cis/prfVerwaltung_array.php'; - switch($lehrveranstaltung->oe_kurzbz) - { - case $fakultaeten[0]["fakultaet"]: - $semCounter = $fakultaeten[0]["sem"]; - break; - case $fakultaeten[1]["fakultaet"]: - $semCounter = $fakultaeten[1]["sem"]; - break; - default: - $semCounter = 2; - break; - } - } - else - { - $semCounter = 99; - } + if($a === "ku") + { + require '../../../../addons/'.$a.'/cis/prfVerwaltung_array.php'; + switch($lehrveranstaltung->oe_kurzbz) + { + case $fakultaeten[0]["fakultaet"]: + $semCounter = $fakultaeten[0]["sem"]; + break; + case $fakultaeten[1]["fakultaet"]: + $semCounter = $fakultaeten[1]["sem"]; + break; + default: + $semCounter = 2; + break; + } + } + else + { + $semCounter = 99; + } } $i=0; $stdsem_lv_besuch = null; @@ -442,107 +441,132 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null) // Defaulteinstellung für Prüfungstypen - schauen, ob bereits aus KTU-Addon geladen if(!isset($pruefungstyp_kurzbzArray)) $pruefungstyp_kurzbzArray = array("Termin1","Termin2","kommPruef"); + if(isset($pruefungstyp_kurzbzArray)) { - if($anzahlPruefungen < count($pruefungstyp_kurzbzArray)) - { - $pruefungstyp_kurzbz = $pruefungstyp_kurzbzArray[$anzahlPruefungen]; - } + if($anzahlPruefungen < count($pruefungstyp_kurzbzArray)) + { + $pruefungstyp_kurzbz = $pruefungstyp_kurzbzArray[$anzahlPruefungen]; + } } else { - $pruefungstyp_kurzbz = null; + $pruefungstyp_kurzbz = null; } foreach($pruefung->result as $prf) { - $note = new note($prf->note); - if($note->note === $noteCode_uef) - { - $pruefungsanmeldung = new pruefungsanmeldung($prf->pruefungsanmeldung_id); - $pruefungstermin = new pruefungstermin($pruefungsanmeldung->pruefungstermin_id); - $pf = new pruefungCis($pruefungstermin->pruefung_id); - $pruefungsfenster = new pruefungsfenster($pf->pruefungsfenster_id); - $studiensemester = new studiensemester(); - $stdsem = $studiensemester->getaktorNext(); - $i=0; - while($i<2) - { - if($stdsem === $pruefungsfenster->studiensemester_kurzbz) + $note = new note($prf->note); + if($note->note === $noteCode_uef) { - $anmeldung_moeglich = false; + $pruefungsanmeldung = new pruefungsanmeldung($prf->pruefungsanmeldung_id); + $pruefungstermin = new pruefungstermin($pruefungsanmeldung->pruefungstermin_id); + $pf = new pruefungCis($pruefungstermin->pruefung_id); + $pruefungsfenster = new pruefungsfenster($pf->pruefungsfenster_id); + $studiensemester = new studiensemester(); + $stdsem = $studiensemester->getaktorNext(); + $i=0; + while($i<2) + { + if($stdsem === $pruefungsfenster->studiensemester_kurzbz) + { + $anmeldung_moeglich = false; + } + $stdsem = $studiensemester->getPreviousFrom($stdsem); + $i++; + } + } + else + { + if($note->positiv === FALSE && $anzahlPruefungen >= $maxAnzahlVersuche) + { + $anmeldung_moeglich = false; + } } - $stdsem = $studiensemester->getPreviousFrom($stdsem); - $i++; - } - } - else - { - if($note->positiv === FALSE && $anzahlPruefungen >= $maxAnzahlVersuche) - { - $anmeldung_moeglich = false; - } - } } if($anmeldung_moeglich) { - if($termin->teilnehmer_max > $termin->getNumberOfParticipants() || $termin->teilnehmer_max == NULL) - { - $pruefung = new pruefungCis(); - $reihung = $pruefung->getLastOfReihung($_REQUEST["termin_id"]); - $anmeldung = new pruefungsanmeldung(); - $anmeldung->lehrveranstaltung_id = $_REQUEST["lehrveranstaltung_id"]; - $anmeldung->pruefungstermin_id = $_REQUEST["termin_id"]; - $anmeldung->wuensche = $_REQUEST["bemerkung"]; - $anmeldung->uid = $uid; - $anmeldung->reihung = $reihung+1; - $anmeldung->status_kurzbz = "angemeldet"; - $anmeldung->pruefungstyp_kurzbz = $pruefungstyp_kurzbz; - $lehrveranstaltung = new lehrveranstaltung($_REQUEST["lehrveranstaltung_id"]); - - $konto = new konto(); - $creditpoints = $konto->getCreditPoints($uid, $aktStudiensemester); - - if($creditpoints !== false) - { - if($creditpoints < $lehrveranstaltung->ects) + if($termin->teilnehmer_max > $termin->getNumberOfParticipants() || $termin->teilnehmer_max == NULL) { - $data['error'] = 'true'; - $data['errormsg'] = $p->t('pruefung/zuWenigeCreditPoints'); - return $data; - } - } + $pruefung = new pruefungCis(); + $reihung = $pruefung->getLastOfReihung($_REQUEST["termin_id"]); + $anmeldung = new pruefungsanmeldung(); + $anmeldung->lehrveranstaltung_id = $_REQUEST["lehrveranstaltung_id"]; + $anmeldung->pruefungstermin_id = $_REQUEST["termin_id"]; + $anmeldung->wuensche = $_REQUEST["bemerkung"]; + $anmeldung->uid = $uid; + $anmeldung->reihung = $reihung+1; + $anmeldung->status_kurzbz = "angemeldet"; + $anmeldung->pruefungstyp_kurzbz = $pruefungstyp_kurzbz; + $lehrveranstaltung = new lehrveranstaltung($_REQUEST["lehrveranstaltung_id"]); - //Kollisionsprüfung - $anmeldungen = $anmeldung->getAnmeldungenByStudent($uid, $aktStudiensemester); - foreach($anmeldungen as $temp) - { - $datum = new datum(); - if(($datum->between($termin->von, $termin->bis, $temp->von)) || ($datum->between($termin->von, $termin->bis, $temp->bis))) - { - $data['result'][$temp->pruefungstermin_id] = "true"; - $data['error'] = 'true'; - $data['errormsg'] = $p->t('pruefung/kollisionMitAndererAnmeldung'); +// $konto = new konto(); +// $creditpoints = $konto->getCreditPoints($uid, $aktStudiensemester); +// +// if($creditpoints !== false) +// { +// if($creditpoints <= $lehrveranstaltung->ects) +// { +// $data['error'] = 'true'; +// $data['errormsg'] = $p->t('pruefung/zuWenigeCreditPoints'); +// return $data; +// } +// } + + //Kollisionsprüfung und Prüfung auf ausreichen Creditpoints + $anmeldungen = $anmeldung->getAnmeldungenByStudent($uid, $aktStudiensemester); + + if($anmeldungen !== false) + { + $ects = 0; + foreach($anmeldungen as $temp) + { + $lehrveranstaltung = new lehrveranstaltung($temp->lehrveranstaltung_id); + $ects += $lehrveranstaltung->ects; + + $datum = new datum(); + if(($datum->between($termin->von, $termin->bis, $temp->von)) || ($datum->between($termin->von, $termin->bis, $temp->bis))) + { + $data['result'][$temp->pruefungstermin_id] = "true"; + $data['error'] = 'true'; + $data['errormsg'] = $p->t('pruefung/kollisionMitAndererAnmeldung'); + } + } + + $konto = new konto(); + $creditPoints = $konto->getCreditPointsOfStudiensemester($uid, $aktStudiensemester); + if(($creditPoints != false) && ($ects >= ($creditPoints - $ects))) + { + $data['error'] = 'true'; + $data['errormsg'] = $p->t('pruefung/zuWenigeCreditPoints'); + return $data; + } + + if(isset($data['error']) && $data['error'] = 'true') + { + return $data; + } + } + else + { + $data['error'] = 'true'; + $data['errormsg'] = $anmeldung->errormsg; + return $data; + } + } + else + { + $data['error']='true'; + $data['errormsg']=$p->t('pruefung/keineFreienPlaetzeVorhanden'); + return $data; } - } - if(isset($data['error']) && $data['error'] = 'true') - { - return $data; - } - } - else - { - $data['error']='true'; - $data['errormsg']=$p->t('pruefung/keineFreienPlaetzeVorhanden'); - return $data; - } } else { - $data['error']='true'; - $data['errormsg']=$p->t('pruefung/anmeldungAufgrundVonSperreNichtMoeglich'); - return $data; + $data['error']='true'; + $data['errormsg']=$p->t('pruefung/anmeldungAufgrundVonSperreNichtMoeglich'); + return $data; } $anrechnung = new anrechnung(); diff --git a/cis/private/profile/studienplan.php b/cis/private/profile/studienplan.php index 26cb18cd8..6a7a927f8 100755 --- a/cis/private/profile/studienplan.php +++ b/cis/private/profile/studienplan.php @@ -102,14 +102,7 @@ if(isset($_GET['getAnmeldung'])) if(!$bngruppe->load($uid, $lvangebot->result[0]->gruppe_kurzbz, $stsem)) { // User ist noch nicht angemeldet - //Pruefen ob genug Credit Points zur Verfuegung stehen zur Anmeldung - - $konto = new konto(); - $cp = $konto->getCreditPoints($uid, $stsem); - if($cp===false || $cp>=$lv->ects) - echo '
    '.$lv->bezeichnung.' (Anmeldung bis '.$datum->formatDatum($angebot->anmeldefenster_ende,"d.m.Y").')'; - else - echo '
    '.$lv->bezeichnung.''; + echo '
    '.$lv->bezeichnung.' (Anmeldung bis '.$datum->formatDatum($angebot->anmeldefenster_ende,"d.m.Y").')'; } else { @@ -201,25 +194,16 @@ if(isset($_POST['action']) && $_POST['action']=='anmeldung') if(!$bngruppe->load($uid, $lvangebot->result[0]->gruppe_kurzbz, $stsem)) { - - // Pruefen ob genug CP zur Verfuegung stehen falls diese reduziert sind - $konto = new konto(); - $cp = $konto->getCreditPoints($uid, $stsem); - if($cp===false || $cp>=$lv->ects) + $bngruppe->uid = $uid; + $bngruppe->gruppe_kurzbz = $lvangebot->result[0]->gruppe_kurzbz; + $bngruppe->studiensemester_kurzbz = $stsem; + $bngruppe->new=true; + if($bngruppe->save()) { - $bngruppe->uid = $uid; - $bngruppe->gruppe_kurzbz = $lvangebot->result[0]->gruppe_kurzbz; - $bngruppe->studiensemester_kurzbz = $stsem; - $bngruppe->new=true; - if($bngruppe->save()) - { - echo ''.$p->t('studienplan/einschreibungErfolgreich').''; - // Menue neu Laden damit die LV unter Meine LV gleich angezeigt wird - echo ''; - } + echo ''.$p->t('studienplan/einschreibungErfolgreich').''; + // Menue neu Laden damit die LV unter Meine LV gleich angezeigt wird + echo ''; } - else - echo ''.$p->t('studienplan/zuWenigCP').''; } else { diff --git a/include/konto.class.php b/include/konto.class.php index 396b7aa31..3255da3d6 100644 --- a/include/konto.class.php +++ b/include/konto.class.php @@ -800,6 +800,51 @@ class konto extends basis_db return false; } } + + /** + * Liefert die CreditPoints die ein Studierender für ein Studiensemester zur Verfügung hat + * falls dieser einschraenkungen eingetragen hat. Wenn keine Einschraenkung vorhanden ist, + * wird false zurueckgeliefert. Es werden die Creditpoint der Belastungen herangezogen. + * Die Gegenbuchung wird nicht beruecksichtigt. + * @return Anzahl der gekauften CreditPoints oder false falls unbeschraenkt + */ + public function getCreditPointsOfStudiensemester($uid, $studiensemester_kurzbz) + { + $qry = "SELECT sum(credit_points) as cp + FROM + public.tbl_konto + JOIN public.tbl_benutzer USING(person_id) + WHERE + uid=".$this->db_add_param($uid)." + AND studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz)." + AND buchungsnr_verweis is null + AND credit_points is not null"; + + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + $creditpoints = $row->cp; + + if($creditpoints!='') + { + return $creditpoints; + } + else + return false; + } + else + { + // keine Einschraenkung vorhanden + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } /** * Fügt zur erstellten Buchung eine Zahlungsreferenz hinzu From 8fd09dfef836b7e4828e7ebdfea182bfb20348a1 Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Fri, 7 Oct 2016 11:59:45 +0200 Subject: [PATCH 29/85] fixed credit points calculation --- cis/private/lehre/pruefung/pruefungsanmeldung.json.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php index 4ae16864e..520b2b23a 100755 --- a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php +++ b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php @@ -515,11 +515,14 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null) // } //Kollisionsprüfung und Prüfung auf ausreichen Creditpoints - $anmeldungen = $anmeldung->getAnmeldungenByStudent($uid, $aktStudiensemester); + $pruefungstermin = new pruefungstermin($_REQUEST["termin_id"]); + $pf = new pruefungCis($pruefungstermin->pruefung_id); + $pruefungsfenster = new pruefungsfenster($pf->pruefungsfenster_id); + $anmeldungen = $anmeldung->getAnmeldungenByStudent($uid, $pruefungsfenster->studiensemester_kurzbz); if($anmeldungen !== false) { - $ects = 0; + $ects = $lehrveranstaltung->ects; foreach($anmeldungen as $temp) { $lehrveranstaltung = new lehrveranstaltung($temp->lehrveranstaltung_id); @@ -535,7 +538,7 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null) } $konto = new konto(); - $creditPoints = $konto->getCreditPointsOfStudiensemester($uid, $aktStudiensemester); + $creditPoints = $konto->getCreditPointsOfStudiensemester($uid, $pruefungsfenster->studiensemester_kurzbz); if(($creditPoints != false) && ($ects >= ($creditPoints - $ects))) { $data['error'] = 'true'; From 993b3812823db4c6e99e76dfae89a746cb08f4b9 Mon Sep 17 00:00:00 2001 From: Stefan Puraner Date: Fri, 7 Oct 2016 12:22:19 +0200 Subject: [PATCH 30/85] fixed credit point calculation --- cis/private/lehre/pruefung/pruefungsanmeldung.json.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php index 520b2b23a..3b69bba8f 100755 --- a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php +++ b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php @@ -522,11 +522,11 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null) if($anmeldungen !== false) { - $ects = $lehrveranstaltung->ects; + $ects_verwendet = 0; foreach($anmeldungen as $temp) { $lehrveranstaltung = new lehrveranstaltung($temp->lehrveranstaltung_id); - $ects += $lehrveranstaltung->ects; + $ects_verwendet += $lehrveranstaltung->ects; $datum = new datum(); if(($datum->between($termin->von, $termin->bis, $temp->von)) || ($datum->between($termin->von, $termin->bis, $temp->bis))) @@ -539,7 +539,7 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null) $konto = new konto(); $creditPoints = $konto->getCreditPointsOfStudiensemester($uid, $pruefungsfenster->studiensemester_kurzbz); - if(($creditPoints != false) && ($ects >= ($creditPoints - $ects))) + if(($creditPoints != false) && ($lehrveranstaltung->ects > ($creditPoints - $ects_verwendet))) { $data['error'] = 'true'; $data['errormsg'] = $p->t('pruefung/zuWenigeCreditPoints'); From 51e9e071d5dc90b82795c5f4f3197134a9884532 Mon Sep 17 00:00:00 2001 From: oesi Date: Fri, 7 Oct 2016 13:57:06 +0200 Subject: [PATCH 31/85] Attribute Studienplan, Genemigung und Pflicht in die Liste aufgenommen --- include/lehrveranstaltung.class.php | 504 ++++++++++++++-------------- vilesci/lehre/studienordnung.js | 60 ++-- vilesci/lehre/studienordnung.php | 38 ++- 3 files changed, 296 insertions(+), 306 deletions(-) diff --git a/include/lehrveranstaltung.class.php b/include/lehrveranstaltung.class.php index 40b8f64f7..0879bada4 100755 --- a/include/lehrveranstaltung.class.php +++ b/include/lehrveranstaltung.class.php @@ -289,8 +289,6 @@ class lehrveranstaltung extends basis_db //Select Befehl zusammenbauen if (!is_null($lehreverzeichnis)) $qry .= " AND lehreverzeichnis=" . $this->db_add_param($lehreverzeichnis); -// else -// $qry .= " AND lehreverzeichnis<>'' "; if (!is_null($semester) && $semester != '') $qry .= " AND semester=" . $this->db_add_param($semester, FHC_INTEGER); @@ -425,8 +423,6 @@ class lehrveranstaltung extends basis_db //Select Befehl zusammenbauen if (!is_null($lehreverzeichnis)) $qry .= " AND lehreverzeichnis=" . $this->db_add_param($lehreverzeichnis); - //else - // $qry .= " AND lehreverzeichnis<>'' "; if (!is_null($semester) && $semester != '') $qry .= " AND semester=" . $this->db_add_param($semester); @@ -436,7 +432,6 @@ class lehrveranstaltung extends basis_db if (!is_null($studiensemester_kurzbz) && $studiensemester_kurzbz != '') $qry .= " AND tbl_lehreinheit.studiensemester_kurzbz=" . $this->db_add_param($studiensemester_kurzbz); - if (!is_null($lehre)) $qry .= " AND lehre=" . ($lehre ? 'true' : 'false'); @@ -527,10 +522,10 @@ class lehrveranstaltung extends basis_db WHERE lehrveranstaltung_id IN(SELECT lehrveranstaltung_id FROM campus.vw_student_lehrveranstaltung WHERE uid=" . $this->db_add_param($student_uid); if($studiensemester_kurzbz !== NULL) - $qry .= " AND studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz); + $qry .= " AND studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz); $qry .= ") OR lehrveranstaltung_id IN(SELECT lehrveranstaltung_id FROM lehre.tbl_zeugnisnote WHERE student_uid=" . $this->db_add_param($student_uid); if($studiensemester_kurzbz !== NULL) - $qry .= ' AND studiensemester_kurzbz='.$this->db_add_param ($studiensemester_kurzbz); + $qry .= ' AND studiensemester_kurzbz='.$this->db_add_param ($studiensemester_kurzbz); $qry .= ") ORDER BY semester, bezeichnung"; //Datensaetze laden @@ -608,16 +603,10 @@ class lehrveranstaltung extends basis_db $this->errormsg = 'studiengang_kz muss eine gueltige Zahl sein'; return false; } -/* - if(is_null($orgform_kurzbz) || $orgform_kurzbz=='') - { - $this->errormsg = 'keine orgform_kurzbz uebergeben'; - return false; - }*/ $qry='SELECT count(*) as count FROM lehre.tbl_lehrveranstaltung WHERE studiengang_kz='.$this->db_add_param($studiengang_kz).' AND orgform_kurzbz'.(is_null($orgform_kurzbz)?' is null':"=".$this->db_add_param($orgform_kurzbz)); - //echo $qry; + $return=array(); if($db_result=$this->db_query($qry)) { @@ -1072,9 +1061,9 @@ class lehrveranstaltung extends basis_db } $qry = "SELECT mdl_course_id FROM lehre.tbl_moodle - WHERE studiensemester_kurzbz = " . $this->db_add_param($semester) . " - AND (lehrveranstaltung_id = " . $this->db_add_param($lehrveranstaltung_id) . " - OR lehreinheit_id IN(SELECT lehreinheit_id FROM lehre.tbl_lehreinheit WHERE lehrveranstaltung_id = " . $this->db_add_param($lehrveranstaltung_id) . "));"; + WHERE studiensemester_kurzbz = " . $this->db_add_param($semester) . " + AND (lehrveranstaltung_id = " . $this->db_add_param($lehrveranstaltung_id) . " + OR lehreinheit_id IN(SELECT lehreinheit_id FROM lehre.tbl_lehreinheit WHERE lehrveranstaltung_id = " . $this->db_add_param($lehrveranstaltung_id) . "));"; $moodleArray = array(); @@ -1323,7 +1312,7 @@ class lehrveranstaltung extends basis_db return $childs; } - /** + /** * Generiert die Subtrees des Lehrveranstaltungstrees */ public function hasChildren($studienplan_lehrveranstaltung_id) @@ -1338,15 +1327,14 @@ class lehrveranstaltung extends basis_db } } if(count($childs) > 0) - { - return true; - } - else - { - return false; - } - - } + { + return true; + } + else + { + return false; + } + } /** * Baut die Datenstruktur für senden als JSON Objekt auf @@ -1453,6 +1441,7 @@ class lehrveranstaltung extends basis_db $obj->zeugnis = $lv->zeugnis; $obj->curriculum = $lv->curriculum; $obj->export = $lv->export; + $obj->genehmigung = $lv->genehmigung; $obj->lehrauftrag = $lv->lehrauftrag; $obj->lehre = $lv->lehre; $obj->children = array(); @@ -1511,7 +1500,8 @@ class lehrveranstaltung extends basis_db */ public function loadLVkompatibel($lehrveranstaltung_id) { - if (!is_numeric($lehrveranstaltung_id)) { + if (!is_numeric($lehrveranstaltung_id)) + { $this->errormsg = 'Lehrveranstaltung_id muss eine gueltige Zahl sein'; return false; } @@ -1536,7 +1526,8 @@ class lehrveranstaltung extends basis_db */ public function getLVkompatibel($lehrveranstaltung_id) { - if (!is_numeric($lehrveranstaltung_id)) { + if (!is_numeric($lehrveranstaltung_id)) + { $this->errormsg = 'Lehrveranstaltung_id muss eine gueltige Zahl sein'; return false; } @@ -1676,11 +1667,13 @@ class lehrveranstaltung extends basis_db public function load_lva_oe($oe_kurzbz, $aktiv=null, $lehrtyp=null, $sort=null, $semester=null) { - if (is_null($oe_kurzbz)) { + if (is_null($oe_kurzbz)) + { $this->errormsg = 'OE KurzBz darf nicht null sein'; return false; } - if (!is_null($aktiv) && !is_bool($aktiv)) { + if (!is_null($aktiv) && !is_bool($aktiv)) + { $this->errormsg = 'Aktivkz muss ein boolscher Wert sein'; return false; } @@ -1942,125 +1935,125 @@ class lehrveranstaltung extends basis_db } } - /** - * lädt die Lehrveranstaltungen zum zugehörigen Mitarbeiter - * @param String $uid User ID des Mitarbeiters - * @param String $studiensemster_kurzbz Kurzbezeichnung des Studiensemesters - */ - public function getLVByMitarbeiter($uid, $studiensemester_kurzbz = null) - { - $qry = 'SELECT DISTINCT tbl_lehrveranstaltung.* FROM lehre.tbl_lehrveranstaltung - JOIN lehre.tbl_lehreinheit USING(lehrveranstaltung_id) - JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id) - WHERE - mitarbeiter_uid='.$this->db_add_param($uid); + /** + * lädt die Lehrveranstaltungen zum zugehörigen Mitarbeiter + * @param String $uid User ID des Mitarbeiters + * @param String $studiensemster_kurzbz Kurzbezeichnung des Studiensemesters + */ + public function getLVByMitarbeiter($uid, $studiensemester_kurzbz = null) + { + $qry = 'SELECT DISTINCT tbl_lehrveranstaltung.* FROM lehre.tbl_lehrveranstaltung + JOIN lehre.tbl_lehreinheit USING(lehrveranstaltung_id) + JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id) + WHERE + mitarbeiter_uid='.$this->db_add_param($uid); - if($studiensemester_kurzbz != null) - { - $qry .= ' AND tbl_lehreinheit.studiensemester_kurzbz='.$this->db_add_param($studiensemester_kurzbz).';'; - } + if($studiensemester_kurzbz != null) + { + $qry .= ' AND tbl_lehreinheit.studiensemester_kurzbz='.$this->db_add_param($studiensemester_kurzbz).';'; + } - if($this->db_query($qry)) - { - while($row = $this->db_fetch_object()) - { - $lv_obj = new lehrveranstaltung(); + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $lv_obj = new lehrveranstaltung(); - $lv_obj->lehrveranstaltung_id = $row->lehrveranstaltung_id; - $lv_obj->studiengang_kz = $row->studiengang_kz; - $lv_obj->bezeichnung = $row->bezeichnung; - $lv_obj->kurzbz = $row->kurzbz; - $lv_obj->lehrform_kurzbz = $row->lehrform_kurzbz; - $lv_obj->semester = $row->semester; - $lv_obj->ects = $row->ects; - $lv_obj->semesterstunden = $row->semesterstunden; - $lv_obj->anmerkung = $row->anmerkung; - $lv_obj->lehre = $this->db_parse_bool($row->lehre); - $lv_obj->lehreverzeichnis = $row->lehreverzeichnis; - $lv_obj->aktiv = $this->db_parse_bool($row->aktiv); - $lv_obj->ext_id = $row->ext_id; - $lv_obj->insertamum = $row->insertamum; - $lv_obj->insertvon = $row->insertvon; - $lv_obj->planfaktor = $row->planfaktor; - $lv_obj->planlektoren = $row->planlektoren; - $lv_obj->planpersonalkosten = $row->planpersonalkosten; - $lv_obj->plankostenprolektor = $row->plankostenprolektor; - $lv_obj->updateamum = $row->updateamum; - $lv_obj->updatevon = $row->updatevon; - $lv_obj->sprache = $row->sprache; - $lv_obj->sort = $row->sort; - $lv_obj->incoming = $row->incoming; - $lv_obj->zeugnis = $this->db_parse_bool($row->zeugnis); - $lv_obj->projektarbeit = $this->db_parse_bool($row->projektarbeit); - $lv_obj->zeugnis = $row->koordinator; - $lv_obj->bezeichnung_english = $row->bezeichnung_english; - $lv_obj->orgform_kurzbz = $row->orgform_kurzbz; - $lv_obj->lehrtyp_kurzbz = $row->lehrtyp_kurzbz; - $lv_obj->oe_kurzbz = $row->oe_kurzbz; - $lv_obj->raumtyp_kurzbz = $row->raumtyp_kurzbz; - $lv_obj->anzahlsemester = $row->anzahlsemester; - $lv_obj->semesterwochen = $row->semesterwochen; - $lv_obj->lvnr = $row->lvnr; - $lv_obj->semester_alternativ = $row->semester_alternativ; - $lv_obj->farbe = $row->farbe; - $lv_obj->benotung = $this->db_parse_bool($row->benotung); - $lv_obj->lvinfo = $this->db_parse_bool($row->lvinfo); - $lv_obj->lehrauftrag = $this->db_parse_bool($row->lehrauftrag); + $lv_obj->lehrveranstaltung_id = $row->lehrveranstaltung_id; + $lv_obj->studiengang_kz = $row->studiengang_kz; + $lv_obj->bezeichnung = $row->bezeichnung; + $lv_obj->kurzbz = $row->kurzbz; + $lv_obj->lehrform_kurzbz = $row->lehrform_kurzbz; + $lv_obj->semester = $row->semester; + $lv_obj->ects = $row->ects; + $lv_obj->semesterstunden = $row->semesterstunden; + $lv_obj->anmerkung = $row->anmerkung; + $lv_obj->lehre = $this->db_parse_bool($row->lehre); + $lv_obj->lehreverzeichnis = $row->lehreverzeichnis; + $lv_obj->aktiv = $this->db_parse_bool($row->aktiv); + $lv_obj->ext_id = $row->ext_id; + $lv_obj->insertamum = $row->insertamum; + $lv_obj->insertvon = $row->insertvon; + $lv_obj->planfaktor = $row->planfaktor; + $lv_obj->planlektoren = $row->planlektoren; + $lv_obj->planpersonalkosten = $row->planpersonalkosten; + $lv_obj->plankostenprolektor = $row->plankostenprolektor; + $lv_obj->updateamum = $row->updateamum; + $lv_obj->updatevon = $row->updatevon; + $lv_obj->sprache = $row->sprache; + $lv_obj->sort = $row->sort; + $lv_obj->incoming = $row->incoming; + $lv_obj->zeugnis = $this->db_parse_bool($row->zeugnis); + $lv_obj->projektarbeit = $this->db_parse_bool($row->projektarbeit); + $lv_obj->zeugnis = $row->koordinator; + $lv_obj->bezeichnung_english = $row->bezeichnung_english; + $lv_obj->orgform_kurzbz = $row->orgform_kurzbz; + $lv_obj->lehrtyp_kurzbz = $row->lehrtyp_kurzbz; + $lv_obj->oe_kurzbz = $row->oe_kurzbz; + $lv_obj->raumtyp_kurzbz = $row->raumtyp_kurzbz; + $lv_obj->anzahlsemester = $row->anzahlsemester; + $lv_obj->semesterwochen = $row->semesterwochen; + $lv_obj->lvnr = $row->lvnr; + $lv_obj->semester_alternativ = $row->semester_alternativ; + $lv_obj->farbe = $row->farbe; + $lv_obj->benotung = $this->db_parse_bool($row->benotung); + $lv_obj->lvinfo = $this->db_parse_bool($row->lvinfo); + $lv_obj->lehrauftrag = $this->db_parse_bool($row->lehrauftrag); - $lv_obj->bezeichnung_arr['German'] = $row->bezeichnung; - $lv_obj->bezeichnung_arr['English'] = $row->bezeichnung_english; - if ($lv_obj->bezeichnung_arr['English'] == '') - $lv_obj->bezeichnung_arr['English'] = $lv_obj->bezeichnung_arr['German']; + $lv_obj->bezeichnung_arr['German'] = $row->bezeichnung; + $lv_obj->bezeichnung_arr['English'] = $row->bezeichnung_english; + if ($lv_obj->bezeichnung_arr['English'] == '') + $lv_obj->bezeichnung_arr['English'] = $lv_obj->bezeichnung_arr['German']; - $this->lehrveranstaltungen[] = $lv_obj; - } - return true; - } - else - { - $this->errormsg = "Lehrveranstaltungen konnten nicht geladen werden."; - } + $this->lehrveranstaltungen[] = $lv_obj; + } + return true; + } + else + { + $this->errormsg = "Lehrveranstaltungen konnten nicht geladen werden."; + } - } + } - /** - * Lädt alle Studenten UIDs die die angegebenen LV besuchen (optional mit Studiensemester) - * @param integer $lehrveranstaltung_id ID der Lehrveranstaltung - * @param string $studiensemester_kurzbz Kurzbezeichnung des Studiensemesters - * @return boolean|array false, wenn eine Fehler auftritt; Array mit UIDs wenn erfolgreich - */ - public function getStudentsOfLv($lehrveranstaltung_id, $studiensemester_kurzbz=null, $lehreinheit_id=null) - { - if(!is_numeric($lehrveranstaltung_id)) - { - $this->errormsg = "Lehrveranstaltung ID muss eine gültige Zahl sein."; - return false; - } + /** + * Lädt alle Studenten UIDs die die angegebenen LV besuchen (optional mit Studiensemester) + * @param integer $lehrveranstaltung_id ID der Lehrveranstaltung + * @param string $studiensemester_kurzbz Kurzbezeichnung des Studiensemesters + * @return boolean|array false, wenn eine Fehler auftritt; Array mit UIDs wenn erfolgreich + */ + public function getStudentsOfLv($lehrveranstaltung_id, $studiensemester_kurzbz=null, $lehreinheit_id=null) + { + if(!is_numeric($lehrveranstaltung_id)) + { + $this->errormsg = "Lehrveranstaltung ID muss eine gültige Zahl sein."; + return false; + } - $qry = 'SELECT distinct uid FROM campus.vw_student_lehrveranstaltung WHERE ' - . 'lehrveranstaltung_id='.$this->db_add_param($lehrveranstaltung_id); + $qry = 'SELECT distinct uid FROM campus.vw_student_lehrveranstaltung WHERE ' + . 'lehrveranstaltung_id='.$this->db_add_param($lehrveranstaltung_id); - if(!is_null($studiensemester_kurzbz)) - { - $qry .= ' AND studiensemester_kurzbz='.$this->db_add_param($studiensemester_kurzbz); - } - if(!is_null($lehreinheit_id)) - { - $qry .= ' AND lehreinheit_id='.$this->db_add_param($lehreinheit_id); - } - $qry .= ';'; + if(!is_null($studiensemester_kurzbz)) + { + $qry .= ' AND studiensemester_kurzbz='.$this->db_add_param($studiensemester_kurzbz); + } + if(!is_null($lehreinheit_id)) + { + $qry .= ' AND lehreinheit_id='.$this->db_add_param($lehreinheit_id); + } + $qry .= ';'; - if($this->db_query($qry)) - { - $result = array(); - while($row = $this->db_fetch_object()) - { - array_push($result, $row->uid); - } - return $result; - } - return false; - } + if($this->db_query($qry)) + { + $result = array(); + while($row = $this->db_fetch_object()) + { + array_push($result, $row->uid); + } + return $result; + } + return false; + } /** * @@ -2097,7 +2090,7 @@ class lehrveranstaltung extends basis_db } - $qry_alvs = "SELECT sum(lm.semesterstunden) as alvs + $qry_alvs = "SELECT sum(lm.semesterstunden) as alvs FROM lehre.tbl_lehrveranstaltung JOIN lehre.tbl_lehreinheit USING (lehrveranstaltung_id) JOIN lehre.tbl_lehreinheitmitarbeiter lm USING (lehreinheit_id) @@ -2167,14 +2160,13 @@ class lehrveranstaltung extends basis_db public function lehreverzeichnisExists($lehreverzeichnis, $studiengang_kz, $semester) { $qry = 'SELECT - 1 - FROM - lehre.tbl_lehrveranstaltung - WHERE - lehreverzeichnis='.$this->db_add_param($lehreverzeichnis).' - AND studiengang_kz='.$this->db_add_param($studiengang_kz).' - AND semester='.$this->db_add_param($semester).';'; - + 1 + FROM + lehre.tbl_lehrveranstaltung + WHERE + lehreverzeichnis='.$this->db_add_param($lehreverzeichnis).' + AND studiengang_kz='.$this->db_add_param($studiengang_kz).' + AND semester='.$this->db_add_param($semester).';'; if($this->db_query($qry)) { @@ -2201,117 +2193,117 @@ class lehrveranstaltung extends basis_db */ public function getLVFromStudienplanByLehrtyp($studienplan_id, $lehrtyp_kurzbz=NULL, $semester=NULL) { - if (!is_numeric($studienplan_id) || $studienplan_id === '') - { - $this->errormsg = 'StudienplanID ist ungueltig'; - return false; - } + if (!is_numeric($studienplan_id) || $studienplan_id === '') + { + $this->errormsg = 'StudienplanID ist ungueltig'; + return false; + } - $qry = "SELECT DISTINCT tbl_lehrveranstaltung.* + $qry = "SELECT DISTINCT tbl_lehrveranstaltung.* FROM lehre.tbl_lehrveranstaltung JOIN lehre.tbl_studienplan_lehrveranstaltung USING(lehrveranstaltung_id) WHERE tbl_studienplan_lehrveranstaltung.studienplan_id=" . $this->db_add_param($studienplan_id, FHC_INTEGER); - if (!is_null($lehrtyp_kurzbz)) - { - $qry.=" AND tbl_lehrveranstaltung.lehrtyp_kurzbz=" . $this->db_add_param($lehrtyp_kurzbz, FHC_STRING); - } - - if (!is_null($semester)) - { - $qry.=" AND tbl_studienplan_lehrveranstaltung.semester=" . $this->db_add_param($semester, FHC_INTEGER); - } - $qry.=" ORDER BY bezeichnung;"; - - $this->lehrveranstaltungen = array(); - if ($result = $this->db_query($qry)) - { - while ($row = $this->db_fetch_object($result)) + if (!is_null($lehrtyp_kurzbz)) { - $obj = new lehrveranstaltung(); - - $obj->lehrveranstaltung_id = $row->lehrveranstaltung_id; - $obj->studiengang_kz = $row->studiengang_kz; - $obj->bezeichnung = $row->bezeichnung; - $obj->kurzbz = $row->kurzbz; - $obj->lehrform_kurzbz = $row->lehrform_kurzbz; - $obj->semester = $row->semester; - $obj->ects = $row->ects; - $obj->semesterstunden = $row->semesterstunden; - $obj->anmerkung = $row->anmerkung; - $obj->lehre = $this->db_parse_bool($row->lehre); - $obj->lehreverzeichnis = $row->lehreverzeichnis; - $obj->aktiv = $this->db_parse_bool($row->aktiv); - $obj->ext_id = $row->ext_id; - $obj->insertamum = $row->insertamum; - $obj->insertvon = $row->insertvon; - $obj->planfaktor = $row->planfaktor; - $obj->planlektoren = $row->planlektoren; - $obj->planpersonalkosten = $row->planpersonalkosten; - $obj->plankostenprolektor = $row->plankostenprolektor; - $obj->updateamum = $row->updateamum; - $obj->updatevon = $row->updatevon; - $obj->sprache = $row->sprache; - $obj->sort = $row->sort; - $obj->incoming = $row->incoming; - $obj->zeugnis = $this->db_parse_bool($row->zeugnis); - $obj->projektarbeit = $this->db_parse_bool($row->projektarbeit); - $obj->koordinator = $row->koordinator; - $obj->bezeichnung_english = $row->bezeichnung_english; - $obj->orgform_kurzbz = $row->orgform_kurzbz; - $obj->lehrtyp_kurzbz = $row->lehrtyp_kurzbz; - $obj->oe_kurzbz = $row->oe_kurzbz; - $obj->raumtyp_kurzbz = $row->raumtyp_kurzbz; - $obj->anzahlsemester = $row->anzahlsemester; - $obj->semesterwochen = $row->semesterwochen; - $obj->lvnr = $row->lvnr; - $obj->semester_alternativ = $row->semester_alternativ; - $obj->farbe = $row->farbe; - $obj->benotung = $this->db_parse_bool($row->benotung); - $obj->lvinfo = $this->db_parse_bool($row->lvinfo); - $obj->lehrauftrag = $this->db_parse_bool($row->lehrauftrag); - - $obj->bezeichnung_arr['German'] = $row->bezeichnung; - $obj->bezeichnung_arr['English'] = $row->bezeichnung_english; - if ($obj->bezeichnung_arr['English'] == '') - $obj->bezeichnung_arr['English'] = $obj->bezeichnung_arr['German']; - - $obj->new = false; - - $this->lehrveranstaltungen[] = $obj; + $qry.=" AND tbl_lehrveranstaltung.lehrtyp_kurzbz=" . $this->db_add_param($lehrtyp_kurzbz, FHC_STRING); } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - /** - * Gibt alle Organisationseinheiten der Studiengänge zurück, mit denen - * die Lehrveranstaltung über Studienpläne verknüpft ist - * @return boolean|array false im Fehlerfall, sonst ein Array - */ - public function getAllOe() - { - $oe = array(); + if (!is_null($semester)) + { + $qry.=" AND tbl_studienplan_lehrveranstaltung.semester=" . $this->db_add_param($semester, FHC_INTEGER); + } + $qry.=" ORDER BY bezeichnung;"; - $qry = 'SELECT DISTINCT oe_kurzbz - FROM lehre.tbl_studienplan_lehrveranstaltung - JOIN lehre.tbl_studienplan USING(studienplan_id) - JOIN lehre.tbl_studienordnung USING(studienordnung_id) - JOIN public.tbl_studiengang USING(studiengang_kz) - WHERE lehrveranstaltung_id = '.$this->db_add_param($this->lehrveranstaltung_id); - - if($result = $this->db_query($qry)) + $this->lehrveranstaltungen = array(); + if ($result = $this->db_query($qry)) { while ($row = $this->db_fetch_object($result)) - { - $oe[] = $row->oe_kurzbz; - } + { + $obj = new lehrveranstaltung(); + + $obj->lehrveranstaltung_id = $row->lehrveranstaltung_id; + $obj->studiengang_kz = $row->studiengang_kz; + $obj->bezeichnung = $row->bezeichnung; + $obj->kurzbz = $row->kurzbz; + $obj->lehrform_kurzbz = $row->lehrform_kurzbz; + $obj->semester = $row->semester; + $obj->ects = $row->ects; + $obj->semesterstunden = $row->semesterstunden; + $obj->anmerkung = $row->anmerkung; + $obj->lehre = $this->db_parse_bool($row->lehre); + $obj->lehreverzeichnis = $row->lehreverzeichnis; + $obj->aktiv = $this->db_parse_bool($row->aktiv); + $obj->ext_id = $row->ext_id; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->planfaktor = $row->planfaktor; + $obj->planlektoren = $row->planlektoren; + $obj->planpersonalkosten = $row->planpersonalkosten; + $obj->plankostenprolektor = $row->plankostenprolektor; + $obj->updateamum = $row->updateamum; + $obj->updatevon = $row->updatevon; + $obj->sprache = $row->sprache; + $obj->sort = $row->sort; + $obj->incoming = $row->incoming; + $obj->zeugnis = $this->db_parse_bool($row->zeugnis); + $obj->projektarbeit = $this->db_parse_bool($row->projektarbeit); + $obj->koordinator = $row->koordinator; + $obj->bezeichnung_english = $row->bezeichnung_english; + $obj->orgform_kurzbz = $row->orgform_kurzbz; + $obj->lehrtyp_kurzbz = $row->lehrtyp_kurzbz; + $obj->oe_kurzbz = $row->oe_kurzbz; + $obj->raumtyp_kurzbz = $row->raumtyp_kurzbz; + $obj->anzahlsemester = $row->anzahlsemester; + $obj->semesterwochen = $row->semesterwochen; + $obj->lvnr = $row->lvnr; + $obj->semester_alternativ = $row->semester_alternativ; + $obj->farbe = $row->farbe; + $obj->benotung = $this->db_parse_bool($row->benotung); + $obj->lvinfo = $this->db_parse_bool($row->lvinfo); + $obj->lehrauftrag = $this->db_parse_bool($row->lehrauftrag); + + $obj->bezeichnung_arr['German'] = $row->bezeichnung; + $obj->bezeichnung_arr['English'] = $row->bezeichnung_english; + if ($obj->bezeichnung_arr['English'] == '') + $obj->bezeichnung_arr['English'] = $obj->bezeichnung_arr['German']; + + $obj->new = false; + + $this->lehrveranstaltungen[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Gibt alle Organisationseinheiten der Studiengänge zurück, mit denen + * die Lehrveranstaltung über Studienpläne verknüpft ist + * @return boolean|array false im Fehlerfall, sonst ein Array + */ + public function getAllOe() + { + $oe = array(); + + $qry = 'SELECT DISTINCT oe_kurzbz + FROM lehre.tbl_studienplan_lehrveranstaltung + JOIN lehre.tbl_studienplan USING(studienplan_id) + JOIN lehre.tbl_studienordnung USING(studienordnung_id) + JOIN public.tbl_studiengang USING(studiengang_kz) + WHERE lehrveranstaltung_id = '.$this->db_add_param($this->lehrveranstaltung_id); + + if($result = $this->db_query($qry)) + { + while ($row = $this->db_fetch_object($result)) + { + $oe[] = $row->oe_kurzbz; + } } else { @@ -2319,16 +2311,16 @@ class lehrveranstaltung extends basis_db return false; } - // oe_kurzbz des Studiengangs der LVA hinzufügen - $stg = new studiengang($this->studiengang_kz); + // oe_kurzbz des Studiengangs der LVA hinzufügen + $stg = new studiengang($this->studiengang_kz); - if(!in_array($stg->oe_kurzbz, $oe)) - { - $oe[] = $this->oe_kurzbz; - } + if(!in_array($stg->oe_kurzbz, $oe)) + { + $oe[] = $this->oe_kurzbz; + } - return $oe; - } + return $oe; + } /** * Laedt den LV-Leiter einer Lehrveranstaltung, wenn keiner der Lektoren als LVLeiter eingetragen ist, diff --git a/vilesci/lehre/studienordnung.js b/vilesci/lehre/studienordnung.js index 39c28dcd0..879af29af 100755 --- a/vilesci/lehre/studienordnung.js +++ b/vilesci/lehre/studienordnung.js @@ -245,7 +245,7 @@ function GenerateTreeChilds(data) } var obj = { "data":data.bezeichnung, - "metadata": {"lehrveranstaltung_id":data.lehrveranstaltung_id,"bezeichnung":data.bezeichnung,"ects":data.ects,"semesterstunden":data.semesterstunden,"lehrform_kurzbz":data.lehrform_kurzbz,"lvnr":data.lvnr,"sortierung":data.stpllv_sort}, + "metadata": {"lehrveranstaltung_id":data.lehrveranstaltung_id,"bezeichnung":data.bezeichnung,"ects":data.ects,"semesterstunden":data.semesterstunden,"lehrform_kurzbz":data.lehrform_kurzbz,"lvnr":data.lvnr,"sortierung":data.stpllv_sort,"pflicht":data.stpllv_pflicht,"export":data.export,"genehmigung":data.genehmigung}, "attr":{"id":data.studienplan_lehrveranstaltung_id,"rel":data.lehrtyp_kurzbz,"lvID":data.lehrveranstaltung_id,"studienplan_lehrveranstaltung_id":data.studienplan_lehrveranstaltung_id}, "children":children }; @@ -423,10 +423,13 @@ function loadLehrveranstaltungSTPL(studienplan_id, bezeichnung, max_semester) columns: [ {width: 300, header: "Lehrveranstaltung", value: "bezeichnung", source: "metadata", headerClass: "header_lv"}, {width: 50, header: "ECTS", value: "ects", source: "metadata", wideCellClass: "col_ects", headerClass: "header_ects"}, - {width: 120, header: "Semesterstunden", value: "semesterstunden", source: "metadata", cellClass: "col_semesterstunden"}, + {width: 60, header: "SemStd", value: "semesterstunden", source: "metadata", cellClass: "col_left"}, {width: 80, header: "Lehrform", value: "lehrform_kurzbz", source: "metadata", cellClass: "col_lehrform"}, - {width: 80, header: "LVNR", value: "lvnr", source: "metadata", cellClass: "col_lvnr"}, - {width: 80, header: "Sortierung", value: "sortierung", source: "metadata", cellClass: "col_sortierung"}, + {width: 60, header: "StudPlan", value: "export", source: "metadata", cellClass: "col_left"}, + {width: 60, header: "Pflicht", value: "pflicht", source: "metadata", cellClass: "col_left"}, + {width: 60, header: "Gen", value: "genehmigung", source: "metadata", cellClass: "col_left"}, + {width: 80, header: "LVNR", value: "lvnr", source: "metadata", cellClass: "col_left"}, + {width: 60, header: "Sort", value: "sortierung", source: "metadata", cellClass: "col_left"}, ], resizable: true }, @@ -486,39 +489,31 @@ function loadLehrveranstaltungSTPL(studienplan_id, bezeichnung, max_semester) plugins: ["themes", "ui", "dnd", "grid", "json_data", "crrm", "types", "sort", "contextmenu"] }).bind("move_node.jstree", function(event, data) { -// if(searchTree(data.rslt.r, data.rslt.o.attr("id"))) -// { -// $("#treeData").jstree("remove", "#"+data.rslt.oc.attr("id")); -// alert("Lehrveranstaltung bereits vorhanden"); -// } -// else -// { - // Verschieben eines Eintrages + // Verschieben eines Eintrages - // Studienplan_lehrveranstaltung_id ermitteln - var studienplan_lehrveranstaltung_id=''; - if(data.rslt.o[0].attributes.studienplan_lehrveranstaltung_id){ - studienplan_lehrveranstaltung_id=data.rslt.o[0].attributes.studienplan_lehrveranstaltung_id.value; - //$("#treeData").jstree('refresh'); - } + // Studienplan_lehrveranstaltung_id ermitteln + var studienplan_lehrveranstaltung_id=''; + if(data.rslt.o[0].attributes.studienplan_lehrveranstaltung_id){ + studienplan_lehrveranstaltung_id=data.rslt.o[0].attributes.studienplan_lehrveranstaltung_id.value; + //$("#treeData").jstree('refresh'); + } - // Aenderung speichern - saveJsondataFromTree(data.rslt.o[0].id, global_studienplan_id, studienplan_lehrveranstaltung_id); + // Aenderung speichern + saveJsondataFromTree(data.rslt.o[0].id, global_studienplan_id, studienplan_lehrveranstaltung_id); - // ECTS Summen neu berechnen - var root = data.inst.get_container_ul(); - var nodes = root[0].childNodes; - for(var i=0; i * Stefan Puraner @@ -48,37 +48,41 @@ echo ' - + - + - + - +
      @@ -242,7 +246,7 @@ echo '
    + + + loadAddons(); foreach($addon_obj->result as $addon) { - if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php')) - echo ''; + if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php')) + echo ''; } // Wenn Seite fertig geladen ist Addons aufrufen @@ -139,31 +191,71 @@ $( document ).ready(function() $("#t1").tablesorter( { sortList: [[1,0],[3,0],[4,0]], - widgets: ["zebra"] + widgets: ["zebra"], + headers: {0:{sorter:false}, 9:{sorter:false}} }); $("#t2").tablesorter( - { - sortList: [[0,0]], - widgets: ["zebra"] - }); + { + sortList: [[0,0]], + widgets: ["zebra"] + }); $("#t3").tablesorter( - { - sortList: [[1,0],[3,0],[4,0],[5,0]], - widgets: ["zebra"] - }); + { + sortList: [[1,0],[3,0],[4,0],[5,0]], + widgets: ["zebra"], + headers: {9:{sorter:false}} + }); }); - + - - - - + +
    Administration titelpre." ".$person->vorname." ".$person->nachname." ".$person->titelpost?> - +
    + + + + + + echo ''.$p->t("global/englisch").' | + '.$p->t("global/deutsch").'
    ';?>
    t("incoming/hauptmenue") ?> titelpre." ".$person->vorname." ".$person->nachname." ".$person->titelpost?>
    + Logout
    t("global/sprache")." "; - echo ''.$p->t("global/englisch").' | - '.$p->t("global/deutsch").'
    ';?>
    - +
    + + + - - - - - + - + @@ -238,10 +329,6 @@ if($method =="austauschprogram") - - - -

    '.$p->t('incoming/austauschprogram').'

    @@ -214,17 +309,13 @@ if($method =="austauschprogram") } echo '
    '.$p->t('global/code').'*
    '.$p->t('incoming/studiertvon').' (dd.mm.yyyy) (dd.mm.yyyy)
    '.$p->t('incoming/studiertbis').' (dd.mm.yyyy) (dd.mm.yyyy)
       
    * '.$p->t('incoming/wennVorhanden').'
    '; @@ -255,9 +342,9 @@ else if($method=="lehrveranstaltungen") $id= $_GET['id']; if($preincoming->addLehrveranstaltung($preincoming->preincoming_id, $_GET['id'], date('Y-m-d H:i:s'))) - echo $p->t('global/erfolgreichgespeichert'); + $message = ''.($p->t('global/erfolgreichgespeichert')).''; else - echo $p->t('global/fehleraufgetreten'); + $message = ''.($p->t('global/fehleraufgetreten')).''; } // löschen der LV-ID if($_GET['mode'] == "delete") @@ -265,9 +352,9 @@ else if($method=="lehrveranstaltungen") $id= $_GET['id']; if($preincoming->deleteLehrveranstaltung($preincoming->preincoming_id, $_GET['id'])) - echo $p->t('global/erfolgreichgelöscht'); + $message = ''.($p->t('global/erfolgreichgelöscht')).''; else - echo $p->t('global/fehleraufgetreten'); + $message = ''.($p->t('global/fehleraufgetreten')).''; } } if(isset($_GET['mode']) && $_GET['mode'] == "thesis") @@ -329,14 +416,16 @@ else if($method=="lehrveranstaltungen") { $lvs = $preincoming->getLehrveranstaltungen($preincoming->preincoming_id); echo '


    - - - - - - - - +
    '.$p->t('incoming/übersichtlehrveranstaltungen').''.$p->t('incoming/eigenelehrveranstaltungen').'
     
    + + + + + + + + +

    '.$p->t('incoming/eigenelehrveranstaltungen').'

    '.$p->t('incoming/übersichtlehrveranstaltungen').'
     
    '; /* Wird laut Telefonat mit Giedre Jukneviciute am 14.10.2015 derzeit nicht benötigt und soll daher ausgeblendet werden. @@ -381,18 +470,21 @@ else if($method=="lehrveranstaltungen") echo '


    '; }*/ - + echo '
    '.$message.'
    '; echo ' - +
    + - + + + '; @@ -409,31 +501,36 @@ else if($method=="lehrveranstaltungen") else if ($studiengang->typ == 'm') $typ = 'MA'; echo ''; - echo ''; - echo ''; + //echo ''; + echo ''; echo ''; echo ''; + echo ''; echo ''; echo ''; echo ''; + echo ''; + echo ''; echo ''; echo ''; } + echo '
    '.$p->t('global/studiengang').' '.$p->t('abgabetool/typ').''.$p->t('incoming/orgform').' '.$p->t('global/semester').' '.$p->t('global/lehrveranstaltung').' '.$p->t('global/lehrveranstaltung').' '.$p->t('global/englisch').'Info'.$p->t('incoming/ects').''.$p->t('courseInformation/unterrichtssprache').''.$p->t('incoming/lvInfo').'
    '.$lehrveranstaltung->lehrveranstaltung_id.' '.$p->t('global/löschen').''.$lehrveranstaltung->lehrveranstaltung_id.' '.$p->t('global/löschen').'',$studiengang_language,'',$typ,'',$lehrveranstaltung->orgform_kurzbz,'',$lehrveranstaltung->semester,'',$lehrveranstaltung->bezeichnung,'',$lehrveranstaltung->bezeichnung_english,'',$lehrveranstaltung->ects,'',($lehrveranstaltung->sprache=='German'?$p->t("global/deutsch"):$p->t("global/englisch")),' - Deutsch  - Englisch + '.$p->t("global/deutsch").'  + '.$p->t("global/englisch").'
    '; } } // Übersicht aller LVs else { - echo '


    - + echo '
    + + + - - - + +

    '.$p->t('incoming/übersichtlehrveranstaltungen').'

    '.$p->t('incoming/übersichtlehrveranstaltungen').''.$p->t('incoming/eigenelehrveranstaltungen').''.$p->t('incoming/eigenelehrveranstaltungen').'


    '; @@ -515,12 +612,12 @@ else if($method=="lehrveranstaltungen")

    ';*/ - echo ' + /*echo '
    -
    Course application is currently disabled. Please contact the office to apply for courses.
    '; - /*echo ' -
    +
    ';*/ + echo ' + @@ -530,7 +627,7 @@ else if($method=="lehrveranstaltungen")
    '.$p->t('incoming/studentenImWS').'
    '.$p->t('incoming/filter').': - '; // Vorauswahl der Übergebenen Filter @@ -548,7 +645,7 @@ else if($method=="lehrveranstaltungen") echo ''; echo'
    '; - echo $p->t('courseInformation/unterrichtssprache').': '; // Vorauswahl der Übergebenen Filter @@ -561,30 +658,48 @@ else if($method=="lehrveranstaltungen") elseif($_GET['unterrichtssprache']=='English') $EnglishSelected='selected'; - echo ''; + echo ''; - echo ''; + echo ''; echo'
    '; - echo $p->t('global/studiengang').': '; - // Vorauswahl der Übergebenen Filter + // Vorauswahl der Übergebenen Filter - $studiengang = new studiengang(); - $studiengang->getAll('typ,kurzbz', true); + $studiengang = new studiengang(); + $studiengang->getAll('typ,kurzbz', true); + $type = array('b' => 'Bachelor', 'm' => 'Master', 'e' => 'Other'); + $typ = ''; - foreach ($studiengang->result as $row) + foreach ($studiengang->result as $row) + { + //Nur Bachelor, Master und CIR-Studiengang + if ($row->typ == 'b' || $row->typ == 'm' || $row->studiengang_kz == '10006') { $selected = ''; + + if ($typ != $row->typ || $typ=='') + { + if ($typ!='') + echo ''; + echo ''; + } + if(isset($_GET['studiengang']) && $_GET['studiengang'] == $row->studiengang_kz) $selected='selected'; $studiengang_language = ($sprache == 'German') ? $row->bezeichnung : $row->english; echo ''; + $typ = $row->typ; } + } - echo''; + echo'

    '; + echo ''; + //echo ''; + echo ''; echo '
    @@ -616,9 +731,9 @@ else if($method=="lehrveranstaltungen") if(isset($_GET['unterrichtssprache']) && $_GET['unterrichtssprache']!='') $filterqry .= " AND tbl_lehrveranstaltung.sprache='".$_GET['unterrichtssprache']."'"; - + //Uebersicht LVs - /* Erklaerung der Datumszeitraeume ab Zeile 650: + /* Erklaerung der Datumszeitraeume ab Zeile 663: * |=============== Studiensemester ===============| * |--------------| Incoming beginnt vor SS-Beginn und endet VOR SS-Ende jedoch ueberwiegend innerhalb SS * |--------------| Incoming beginnt VOR SS-Ende und endet NACH SS-Ende, jedoch ueberwiegend innerhalb SS @@ -629,131 +744,159 @@ else if($method=="lehrveranstaltungen") * |----------------------- Bis ist NULL und von innerhalb SS */ - /*$qry = "SELECT - tbl_lehrveranstaltung.lehrveranstaltung_id, tbl_lehrveranstaltung.studiengang_kz, tbl_lehrveranstaltung.ects, - tbl_lehrveranstaltung.bezeichnung, tbl_lehrveranstaltung.semester, tbl_lehrveranstaltung.sprache, - tbl_lehrveranstaltung.bezeichnung_english, tbl_lehrveranstaltung.incoming, tbl_lehrveranstaltung.orgform_kurzbz, - ( - Select count(*) - FROM ( - SELECT - person_id - FROM - campus.vw_student_lehrveranstaltung - JOIN public.tbl_benutzer using(uid) - JOIN public.tbl_student ON(uid=student_uid) - JOIN public.tbl_prestudentstatus USING(prestudent_id) - WHERE - lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id - AND - lehreinheit_id in (SELECT lehreinheit_id FROM lehre.tbl_lehreinheit - WHERE lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id - AND - tbl_lehreinheit.studiensemester_kurzbz='$stsem->studiensemester_kurzbz') - AND - tbl_prestudentstatus.status_kurzbz='Incoming' - AND tbl_prestudentstatus.studiensemester_kurzbz='$stsem->studiensemester_kurzbz' - UNION - SELECT - person_id - FROM - public.tbl_preincoming_lehrveranstaltung - JOIN public.tbl_preincoming using(preincoming_id) - WHERE lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id - AND - ( - (bis - '$stsem->start' > '$stsem->start' - von) OR - ('$stsem->start' <= von AND bis >= '$stsem->ende' AND '$stsem->ende' - von > bis - '$stsem->ende') OR - (von >= '$stsem->start' AND bis <= '$stsem->ende') OR - (von <= '$stsem->start' AND bis >= '$stsem->ende') OR - (von IS NULL AND bis IS NULL) OR - (von IS NULL AND bis <= '$stsem->ende' AND bis > '$stsem->start') OR - (bis IS NULL AND von < '$stsem->ende' AND von >= '$stsem->start') - ) - AND aktiv = true - )a ) as anzahl - FROM - lehre.tbl_lehrveranstaltung - JOIN - public.tbl_studiengang USING(studiengang_kz) - WHERE - tbl_lehrveranstaltung.incoming>0 AND - tbl_lehrveranstaltung.aktiv AND - tbl_lehrveranstaltung.lehre AND - tbl_lehrveranstaltung.lehrveranstaltung_id IN ( - SELECT lehrveranstaltung_id FROM lehre.tbl_studienplan_lehrveranstaltung - JOIN lehre.tbl_studienplan USING (studienplan_id) - JOIN lehre.tbl_studienordnung USING (studienordnung_id) - WHERE tbl_studienordnung.status_kurzbz='approved' - AND tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_studienplan_lehrveranstaltung.lehrveranstaltung_id) AND - ((tbl_lehrveranstaltung.studiengang_kz>0 AND tbl_lehrveranstaltung.studiengang_kz<10000) OR tbl_lehrveranstaltung.studiengang_kz=10006)"; + $studiensemester_array = array(); + $studiensemester = new studiensemester(); + $studiensemester_array[] = $studiensemester->getakt(); - if (isset($_GET['studiengang']) && $_GET['studiengang'] !='') - $qry .= "AND tbl_lehrveranstaltung.studiengang_kz=".$_GET['studiengang']; - - $qry .= "AND tbl_studiengang.aktiv ".$filterqry." order by studiengang_kz - "; - - echo ' - - - - - - - - - - - - - - - - '; - if($result = $db->db_query($qry)) + $studiensemester->getFutureStudiensemester('',2); + foreach ($studiensemester->studiensemester AS $row) + $studiensemester_array[] = $row->studiensemester_kurzbz; + + if(isset($_GET['go'])) { - while($row = $db->db_fetch_object($result)) + $qry = "SELECT + tbl_lehrveranstaltung.lehrveranstaltung_id, tbl_lehrveranstaltung.studiengang_kz, tbl_lehrveranstaltung.ects, + tbl_lehrveranstaltung.bezeichnung, tbl_lehrveranstaltung.semester, tbl_lehrveranstaltung.sprache, + tbl_lehrveranstaltung.bezeichnung_english, tbl_lehrveranstaltung.incoming, tbl_lehrveranstaltung.orgform_kurzbz, + ( + Select count(*) + FROM ( + SELECT + person_id + FROM + campus.vw_student_lehrveranstaltung + JOIN public.tbl_benutzer using(uid) + JOIN public.tbl_student ON(uid=student_uid) + JOIN public.tbl_prestudentstatus USING(prestudent_id) + WHERE + lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id + AND + lehreinheit_id in (SELECT lehreinheit_id FROM lehre.tbl_lehreinheit + WHERE lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id + AND + tbl_lehreinheit.studiensemester_kurzbz='$stsem->studiensemester_kurzbz') + AND + tbl_prestudentstatus.status_kurzbz='Incoming' + AND tbl_prestudentstatus.studiensemester_kurzbz='$stsem->studiensemester_kurzbz' + UNION + SELECT + person_id + FROM + public.tbl_preincoming_lehrveranstaltung + JOIN public.tbl_preincoming using(preincoming_id) + WHERE lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id + AND + ( + (bis - '$stsem->start' > '$stsem->start' - von) OR + ('$stsem->start' <= von AND bis >= '$stsem->ende' AND '$stsem->ende' - von > bis - '$stsem->ende') OR + (von >= '$stsem->start' AND bis <= '$stsem->ende') OR + (von <= '$stsem->start' AND bis >= '$stsem->ende') OR + (von IS NULL AND bis IS NULL) OR + (von IS NULL AND bis <= '$stsem->ende' AND bis > '$stsem->start') OR + (bis IS NULL AND von < '$stsem->ende' AND von >= '$stsem->start') + ) + AND aktiv = true + )a ) as anzahl + FROM + lehre.tbl_lehrveranstaltung + JOIN + public.tbl_studiengang USING(studiengang_kz) + WHERE + tbl_lehrveranstaltung.incoming>0 AND + tbl_lehrveranstaltung.aktiv AND + tbl_lehrveranstaltung.lehre AND + tbl_lehrveranstaltung.lehrveranstaltung_id IN ( + SELECT lehrveranstaltung_id FROM lehre.tbl_studienplan_lehrveranstaltung + JOIN lehre.tbl_studienplan USING (studienplan_id) + JOIN lehre.tbl_studienordnung USING (studienordnung_id) + JOIN lehre.tbl_studienplan_semester USING (studienplan_id) + WHERE tbl_studienordnung.status_kurzbz='approved' + AND tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_studienplan_lehrveranstaltung.lehrveranstaltung_id + AND tbl_studienplan_semester.studiensemester_kurzbz IN ('".implode("','", $studiensemester_array)."')) + AND ((tbl_lehrveranstaltung.studiengang_kz>0 AND tbl_lehrveranstaltung.studiengang_kz<10000) OR tbl_lehrveranstaltung.studiengang_kz=10006)"; + + if (isset($_GET['studiengang']) && $_GET['studiengang'] !='') + $qry .= " AND tbl_lehrveranstaltung.studiengang_kz=".$_GET['studiengang']; + + $qry .= " AND tbl_studiengang.aktiv ".$filterqry." order by studiengang_kz + "; + + if($result = $db->db_query($qry)) { - $freieplaetze = $row->incoming - $row->anzahl; - //if($freieplaetze>0) - //{ - $studiengang = new studiengang(); - $studiengang->load($row->studiengang_kz); - $studiengang_language = ($sprache == 'German') ? $studiengang->bezeichnung : $studiengang->english; - $typ = $studiengang->typ; - if ($studiengang->typ == 'b') - $typ = 'BA'; - else if ($studiengang->typ == 'm') - $typ = 'MA'; - else - $typ = '-'; - echo ''; - echo ''; - if(!$preincoming->checkLehrveranstaltung($preincoming->preincoming_id, $row->lehrveranstaltung_id) && $freieplaetze>0) - echo ''; - elseif (!$preincoming->checkLehrveranstaltung($preincoming->preincoming_id, $row->lehrveranstaltung_id) && $freieplaetze==0) - echo ''; - else - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - //} + if ($db->db_affected_rows($result)>0) + { + echo '
    '.$message.'
    '; + echo '

    '.$p->t('incoming/tabelleSortierinformation').'

    '; + echo '
    '.$p->t('global/studiengang').''.$p->t('abgabetool/typ').''.$p->t('incoming/orgform').''.$p->t('global/semester').''.$p->t('global/lehrveranstaltung').''.$p->t('global/lehrveranstaltung').' '.$p->t('global/englisch').''.$p->t('incoming/ects').''.$p->t('courseInformation/unterrichtssprache').'Info'.$p->t('incoming/freieplätze').'
    '.$row->lehrveranstaltung_id.''.$p->t('global/anmelden').''.$p->t('incoming/noVacancies').''.$p->t('global/angemeldet').'',$studiengang_language,'',$typ,'',$row->orgform_kurzbz,'',$row->semester,'',$row->bezeichnung,'',$row->bezeichnung_english,'',$row->ects,'',$row->sprache,' - Deutsch  - Englisch - ',($freieplaetze<$row->incoming?''.$freieplaetze.'/'.$row->incoming.'':$freieplaetze.'/'.$row->incoming),'
    + + + + + + + + + + + + + + + + '; + while($row = $db->db_fetch_object($result)) + { + $freieplaetze = $row->incoming - $row->anzahl; + $style = ''; + + if ($preincoming->checkLehrveranstaltung($preincoming->preincoming_id, $row->lehrveranstaltung_id)) + $style = 'style="background-color: #88DD88"'; + elseif ($freieplaetze==0) + $style = 'style="background-color: #FF8888"'; + //if($freieplaetze>0) + //{ + $studiengang = new studiengang(); + $studiengang->load($row->studiengang_kz); + $studiengang_language = ($sprache == 'German') ? $studiengang->bezeichnung : $studiengang->english; + $typ = $studiengang->typ; + if ($studiengang->typ == 'b') + $typ = 'Bachelor'; + else if ($studiengang->typ == 'm') + $typ = 'Master'; + else + $typ = '-'; + echo ''; + //echo '';If not commented, tablesorter is not working correct + if(!$preincoming->checkLehrveranstaltung($preincoming->preincoming_id, $row->lehrveranstaltung_id) && $freieplaetze>0) + echo ''; + elseif (!$preincoming->checkLehrveranstaltung($preincoming->preincoming_id, $row->lehrveranstaltung_id) && $freieplaetze==0) + echo ''; + else + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + //} + } + echo '
    '.$p->t('global/studiengang').''.$p->t('abgabetool/typ').''.$p->t('incoming/orgform').''.$p->t('global/semester').''.$p->t('global/lehrveranstaltung').''.$p->t('global/lehrveranstaltung').' '.$p->t('global/englisch').''.$p->t('incoming/ects').''.$p->t('courseInformation/unterrichtssprache').''.$p->t('incoming/lvInfo').''.$p->t('incoming/freieplätze').'
    '.$row->lehrveranstaltung_id.''.$p->t('global/anmelden').''.$p->t('incoming/noVacancies').''.$p->t('global/angemeldet').'',$studiengang_language,'',$typ,'',$row->orgform_kurzbz,'',$row->semester,'',$row->bezeichnung,'',$row->bezeichnung_english,'',$row->ects,'',($row->sprache=='German'?$p->t("global/deutsch"):$p->t("global/englisch")),' + '.$p->t("global/deutsch").'  + '.$p->t("global/englisch").' + ',($freieplaetze<$row->incoming?''.$freieplaetze.' ('.$p->t('incoming/von').' '.$row->incoming.')':$freieplaetze.' ('.$p->t('incoming/von').' '.$row->incoming.')').'
    '; + } + else + echo '
    '.$p->t('incoming/derzeitKeineLehrveranstaltungen').'
    '; } } - echo '';*/ + else + echo '
    '.$p->t('incoming/waehlenSieAusDenOptionen').'
    '; } } else if ($method == "university") @@ -1211,7 +1354,10 @@ else if ($method == "university") } echo ' - +
    + + + +  '.$p->t('incoming/downloadLearningAgreementErasmus').'
    +  '.$p->t('incoming/downloadLearningAgreement').'


    + ',$p->t('incoming/fileupload'),'

    '; $akte->getAkten($person->person_id); if(count($akte->result)>0) { - echo '

    '.$p->t('incoming/eigeneuniversitaet').'

    @@ -1553,7 +1699,10 @@ else if ($method == "profil") } // Ausgabe Profil Formular echo' -
    +
    + + + @@ -1731,7 +1879,10 @@ echo' - +

    '.$p->t('incoming/persönlichedateneditieren').'

    @@ -1591,7 +1740,7 @@ else if ($method == "profil") - + @@ -1602,7 +1751,7 @@ else if ($method == "profil") - + @@ -1614,13 +1763,13 @@ else if ($method == "profil") - + - - - +
    '.$p->t('global/titel').' Pre '.$p->t('incoming/zugangsvoraussetzungmaster').''.$p->t('incoming/zugangsvoraussetzungmaster').'²
    '.$p->t('global/nachname').' '.$p->t('incoming/abgelegtinort').'
    '.$p->t('global/geburtsdatum').' (dd.mm.yyyy) (dd.mm.yyyy)  
    '.$p->t('global/staatsbuergerschaft').'
    '.$p->t('incoming/nation').'
    -
    ¹ '.$p->t('incoming/zugangsvoraussetzungFussnote').' + ¹ '.$p->t('incoming/zugangsvoraussetzungFussnote').'
    + ² '.$p->t('incoming/zugangsvoraussetzungMasterFussnote').' +
    @@ -1773,84 +1924,153 @@ echo' else if($method == 'files') { $akte = new akte(); - + $message = ''; if(isset($_GET['id'])) { if($_GET['mode']=="delete") { if($akte->delete($_GET['id'])) - echo($p->t('global/erfolgreichgelöscht')); + $message = ''.($p->t('global/erfolgreichgelöscht')).''; else - echo($p->t('global/fehleraufgetreten')); + $message = ''.($p->t('global/fehleraufgetreten')).''; } } echo ' -


    +
    + + + + + + + +

    '.$p->t('incoming/uploadvondateien').'

    - ',$p->t('incoming/fileupload'),'
    + echo '
    '.$message.'
    '; + echo '
    + - - '; + + + '; foreach ($akte->result as $ak) { echo ' - + - + '; } - echo '
    '.$p->t('incoming/name').''.$p->t('global/bezeichnung').'
    '.$ak->titel.''.$ak->bezeichnung.'
    '; + echo ''; } + else + echo 'foo'; +} +else if($method == 'ende') +{ + $message = ''; + // Profil speichern + if(isset($_POST['submit_ende'])) + { + // sende Nachricht an Assistenz + //$emailtext= "Dies ist eine automatisch generierte E-Mail.

    "; + $emailtext.= "Der/Die Incoming ".$person->vorname.' '.$person->nachname.' hat seine Registration abgeschlossen'; + + $emailtext = wordwrap($emailtext,70); //Bricht den Code um, da es sonst zu Anzeigefehlern im Mail kommen kann + + $mail = new mail(MAIL_INTERNATIONAL, 'no-reply', 'Incoming '.$person->vorname.' '.$person->nachname.' vollstaendig', 'Bitte sehen Sie sich die Nachricht in HTML Sicht an, um den Link vollständig darzustellen.'); + $mail->setHTMLContent($emailtext); + if(!$mail->send()) + $message = ''.($p->t('incoming/fehlerBeimSenden')).''; + else + $message = ''.($p->t('incoming/erfolgreichAbgeschickt')).''; + + } + echo '
    '.$message.'
    '; + echo '


    + + + + + + + + + + +




    '.$p->t('incoming/dankeFuerIhreAnmeldung').'

    +

    +
    + '; } // Ausgabe Menü else { - echo '



    -
    - - - - - - - - - - - - - - - - - - - - - - -
    1. '.$p->t('incoming/persönlichedateneditieren').'
    2. '.$p->t("incoming/eigeneuniversitaet").'
    3. '.$p->t('incoming/austauschprogram').'
    4. '.$p->t('incoming/lehrveranstaltungenauswählen').'
    5. '.$p->t('incoming/downloadLearningAgreement').'
    6. '.$p->t("incoming/uploadLearningAgreement").'
    7. '.$p->t("incoming/uploadvondateien").'
    - - - - -
    Logout
    '; + echo ' + + + +

    '.$p->t('incoming/hauptmenue').'

    + + + + + + + + + + + + + + + + + +
    1. '.$p->t('incoming/persönlichedateneditieren').'
    2. '.$p->t("incoming/eigeneuniversitaet").'
    3. '.$p->t('incoming/austauschprogram').'
    4. '.$p->t('incoming/lehrveranstaltungenauswählen').'
    5. '.$p->t("incoming/uploadvondateien").'
    '; echo ' @@ -159,7 +159,7 @@ require_once('../../../include/addon.class.php'); echo '
    '; if ($num_rows>0) { - + echo '

    '.$p->t('lvaliste/lehrveranstaltungen').'

    '; echo $p->t('lvaliste/anzahl').': '.$num_rows; echo ' @@ -174,9 +174,10 @@ require_once('../../../include/addon.class.php'); echo ''.$p->t('lvaliste/lvinfo').''; echo ' + '.$p->t('lvaliste/id').' '.$p->t('lvaliste/lehrfach').' '.$p->t('lvaliste/lehrform').' - '.$p->t('lvaliste/lvBezeichnung').' + '.$p->t('lvaliste/lvBezeichnung').' '.$p->t('lvaliste/lektor').' '.$p->t('lvaliste/studiengang').' '.$p->t('lvaliste/semester').' @@ -196,7 +197,7 @@ require_once('../../../include/addon.class.php'); $stg_obj = new studiengang(); $stg_obj->getAll(null,null); $summe_std=0; - + for ($i=0; $i<$num_rows; $i++) { $row=$db->db_fetch_object($result); @@ -208,16 +209,17 @@ require_once('../../../include/addon.class.php'); if($lvinfo) echo ''.$p->t('lvaliste/lvinfo').''; + echo ''.$row->lehreinheit_id.''; echo ''.$row->lehrfach.''; - echo ''.$row->le_lehrform_kurzbz.''; - if ($row->lehrfach_bez!=$row->lv_bezeichnung) + echo ''.$row->le_lehrform_kurzbz.''; + if ($row->lehrfach_bez!=$row->lv_bezeichnung) echo ''.$row->lv_bezeichnung.' ('.$p->t('lvaliste/lehrfach').': '.$row->lehrfach_bez.')'; - else + else echo ''.$row->lv_bezeichnung.''; echo ''.$row->lektor.''; echo ''.$row->stg_kurzbz.''; echo ''.$row->semester.''; - + $qry ="SELECT * FROM lehre.tbl_lehreinheitgruppe WHERE lehreinheit_id='".addslashes($row->lehreinheit_id)."'"; $gruppe=''; if($result_grp = $db->db_query($qry)) @@ -226,7 +228,7 @@ require_once('../../../include/addon.class.php'); { if($row_grp->gruppe_kurzbz!='') $gruppe.= $row_grp->gruppe_kurzbz.'
    '; - else + else $gruppe.= $stg_obj->kuerzel_arr[$row->studiengang_kz].'-'.$row_grp->semester.$row_grp->verband.$row_grp->gruppe.'
    '; } } @@ -237,7 +239,7 @@ require_once('../../../include/addon.class.php'); echo ''.$row->wochenrythmus.''; echo ''.$row->semesterstunden.''; echo ''.$row->start_kw.''; - + $lvangebot->getAllFromLvId($row->lehrveranstaltung_id, $row->studiensemester_kurzbz); if(!empty($lvangebot->result)) { @@ -282,18 +284,18 @@ require_once('../../../include/addon.class.php'); } else echo $p->t('lvaliste/keineDatensaetze').'
    '; - + //Betreuungen $mitarbeiter = new benutzer(); $mitarbeiter->load($uid); - - $qry = "SELECT - tbl_lehrveranstaltung.bezeichnung, tbl_projektarbeit.titel, - (SELECT nachname || ' ' || vorname FROM public.tbl_benutzer JOIN public.tbl_person USING(person_id) + + $qry = "SELECT + tbl_lehrveranstaltung.bezeichnung, tbl_projektarbeit.titel, + (SELECT nachname || ' ' || vorname FROM public.tbl_benutzer JOIN public.tbl_person USING(person_id) WHERE uid=student_uid) as student, tbl_lehrveranstaltung.studiengang_kz, tbl_lehrveranstaltung.semester, tbl_studiengang.email - FROM + FROM lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_projektarbeit, lehre.tbl_projektbetreuer, public.tbl_studiengang WHERE tbl_lehreinheit.lehreinheit_id=tbl_projektarbeit.lehreinheit_id AND @@ -302,10 +304,10 @@ require_once('../../../include/addon.class.php'); tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id AND tbl_lehrveranstaltung.studiengang_kz=tbl_studiengang.studiengang_kz AND tbl_projektbetreuer.person_id=".$db->db_add_param($mitarbeiter->person_id, FHC_INTEGER); - + $stg_obj = new studiengang(); $stg_obj->getAll(null,null); - + if($result = $db->db_query($qry)) { if($db->db_num_rows($result)>0) @@ -322,29 +324,29 @@ require_once('../../../include/addon.class.php'); echo ''; while($row = $db->db_fetch_object($result)) { - echo ''; + echo ''; echo ''.$stg_obj->kuerzel_arr[$row->studiengang_kz].''; echo ''.$row->semester.''; echo ''.$row->bezeichnung.''; echo ''.$row->student.''; echo ''.$row->titel.''; - + echo ''; } echo ''; } } - - + + //Koordination - - $qry = "SELECT + + $qry = "SELECT distinct - tbl_lehrveranstaltung.studiengang_kz, tbl_fachbereich.fachbereich_kurzbz, tbl_lehrveranstaltung.bezeichnung, + tbl_lehrveranstaltung.studiengang_kz, tbl_fachbereich.fachbereich_kurzbz, tbl_lehrveranstaltung.bezeichnung, tbl_lehrveranstaltung.lehrveranstaltung_id, tbl_lehrveranstaltung.semester,tbl_lehrveranstaltung.koordinator, tbl_studiengang.email - FROM - lehre.tbl_lehrveranstaltung, + FROM + lehre.tbl_lehrveranstaltung, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung as lehrfach, public.tbl_studiengang, @@ -355,18 +357,18 @@ require_once('../../../include/addon.class.php'); tbl_fachbereich.oe_kurzbz=lehrfach.oe_kurzbz AND tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($stdsem)." AND (tbl_lehrveranstaltung.koordinator=".$db->db_add_param($uid)." - OR - ( tbl_lehrveranstaltung.koordinator is null and (tbl_lehrveranstaltung.studiengang_kz, fachbereich_kurzbz) IN (SELECT studiengang_kz, fachbereich_kurzbz + OR + ( tbl_lehrveranstaltung.koordinator is null and (tbl_lehrveranstaltung.studiengang_kz, fachbereich_kurzbz) IN (SELECT studiengang_kz, fachbereich_kurzbz FROM public.tbl_benutzerfunktion JOIN public.tbl_studiengang USING(oe_kurzbz) - WHERE funktion_kurzbz='fbk' AND uid=".$db->db_add_param($uid)." + WHERE funktion_kurzbz='fbk' AND uid=".$db->db_add_param($uid)." and ( tbl_benutzerfunktion.datum_bis is null or now() between tbl_benutzerfunktion.datum_von and tbl_benutzerfunktion.datum_bis ) )) ) AND tbl_lehrveranstaltung.studiengang_kz=tbl_studiengang.studiengang_kz order by tbl_lehrveranstaltung.studiengang_kz,tbl_lehrveranstaltung.semester ,tbl_lehrveranstaltung.bezeichnung "; - - + + if($result = $db->db_query($qry)) { if($db->db_num_rows($result)>0) @@ -386,12 +388,12 @@ require_once('../../../include/addon.class.php'); //Fachbereichskoordinatoren holen $qry = "SELECT distinct uid,titelpre, titelpost, vorname, nachname - FROM + FROM lehre.tbl_lehreinheitmitarbeiter, public.tbl_benutzer, public.tbl_person, lehre.tbl_lehreinheit - WHERE + WHERE tbl_lehreinheitmitarbeiter.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND tbl_lehreinheit.lehrveranstaltung_id=".$db->db_add_param($row->lehrveranstaltung_id, FHC_INTEGER)." AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid=tbl_benutzer.uid AND @@ -407,7 +409,7 @@ require_once('../../../include/addon.class.php'); $lektoren.=trim($row_lkt->titelpre.' '.$row_lkt->vorname.' '.$row_lkt->nachname.' '.$row_lkt->titelpost); } } - + echo ''; echo ''.$stg_obj->kuerzel_arr[$row->studiengang_kz].''; echo ''.$row->semester.''; diff --git a/locale/de-AT/lvaliste.php b/locale/de-AT/lvaliste.php index aa4087528..48189aee6 100755 --- a/locale/de-AT/lvaliste.php +++ b/locale/de-AT/lvaliste.php @@ -31,3 +31,4 @@ $this->phrasen['lvaliste/gesamtnote']='Noten eintragen'; $this->phrasen['lvaliste/anzahl']='Anzahl'; $this->phrasen['lvaliste/summe']='Summe'; $this->phrasen['lvaliste/lvinfo']='LV-Info'; +$this->phrasen['lvaliste/id']='ID'; \ No newline at end of file diff --git a/locale/en-US/lvaliste.php b/locale/en-US/lvaliste.php index a42c58421..a2530ff48 100755 --- a/locale/en-US/lvaliste.php +++ b/locale/en-US/lvaliste.php @@ -31,3 +31,4 @@ $this->phrasen['lvaliste/betreuungen']='Supervisor'; $this->phrasen['lvaliste/koordination']='Coordination'; $this->phrasen['lvaliste/anzahl']='Number'; $this->phrasen['lvaliste/summe']='Total'; +$this->phrasen['lvaliste/id']='ID'; From 562a183098fe008906b35005b9b15e7d234c735d Mon Sep 17 00:00:00 2001 From: oesi Date: Tue, 18 Oct 2016 14:35:37 +0200 Subject: [PATCH 38/85] =?UTF-8?q?Neuen=20Karteireiter=20im=20FAS=20zur=20E?= =?UTF-8?q?rfassung=20von=20Gemeinsamen=20Studien=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/student/studentDBDML.php | 129 +++++++ content/student/studentdetailoverlay.xul.php | 72 ++-- content/student/studentenoverlay.xul.php | 3 + .../student/studentmobilitaetoverlay.js.php | 317 +++++++++++++++++ .../student/studentmobilitaetoverlay.xul.php | 228 ++++++++++++ content/student/studentoverlay.js.php | 76 ++-- include/firma.class.php | 78 ++++- include/gsprogramm.class.php | 209 +++++++++++ include/mobilitaet.class.php | 330 ++++++++++++++++++ include/prestudent.class.php | 46 ++- include/tw/vilesci_menu_main.inc.php | 9 +- rdf/firma.rdf.php | 19 +- rdf/gsprogramm.rdf.php | 43 +++ rdf/gsstudientyp.rdf.php | 42 +++ rdf/lehrverbandsgruppe.rdf.php | 105 +++--- rdf/mobilitaet.rdf.php | 89 +++++ rdf/mobilitaetsprogramm.rdf.php | 29 +- rdf/mobilitaetstyp.rdf.php | 41 +++ rdf/status.rdf.php | 41 +++ rdf/student.rdf.php | 46 ++- system/dbupdate_3.2.php | 119 ++++++- vilesci/bis/studentenmeldung.php | 271 ++++++++------ vilesci/stammdaten/firma_details.php | 165 ++++----- vilesci/stammdaten/gsprogramm.php | 207 +++++++++++ 24 files changed, 2354 insertions(+), 360 deletions(-) create mode 100644 content/student/studentmobilitaetoverlay.js.php create mode 100644 content/student/studentmobilitaetoverlay.xul.php create mode 100644 include/gsprogramm.class.php create mode 100644 include/mobilitaet.class.php create mode 100644 rdf/gsprogramm.rdf.php create mode 100644 rdf/gsstudientyp.rdf.php create mode 100644 rdf/mobilitaet.rdf.php create mode 100644 rdf/mobilitaetstyp.rdf.php create mode 100644 rdf/status.rdf.php create mode 100644 vilesci/stammdaten/gsprogramm.php diff --git a/content/student/studentDBDML.php b/content/student/studentDBDML.php index 1cac12397..a0d9c8518 100644 --- a/content/student/studentDBDML.php +++ b/content/student/studentDBDML.php @@ -70,6 +70,7 @@ require_once('../../include/benutzerfunktion.class.php'); require_once('../../include/note.class.php'); require_once('../../include/standort.class.php'); require_once('../../include/adresse.class.php'); +require_once('../../include/mobilitaet.class.php'); $user = get_uid(); $db = new basis_db(); @@ -589,6 +590,7 @@ if(!$error) $prestudent->dual = ($_POST['dual']=='true'?true:false); $prestudent->anmerkung = $_POST['anmerkung']; $prestudent->mentor = $_POST['mentor']; + $prestudent->gsstudientyp_kurzbz = $_POST['gsstudientyp_kurzbz']; //$prestudent->insertamum = date('Y-m-d H:i:s'); //$prestudent->insertvon = $user; $prestudent->updateamum = date('Y-m-d H:i:s'); @@ -3840,6 +3842,133 @@ if(!$error) $errormsg = 'Fehlerhafte Parameteruebergabe'; } } + elseif(isset($_POST['type']) && $_POST['type']=='savemobilitaet') + { + // Speichert Mobilitaet/Gemeinsames Studium + $prestudent_id = $_POST['prestudent_id']; + $prestudent_obj = new prestudent(); + $prestudent_obj->load($prestudent_id); + + if(!$rechte->isBerechtigt('student/stammdaten', $prestudent_obj->studiengang_kz, 'suid')) + { + $return = false; + $error = true; + $errormsg = 'Sie haben keine Berechtigung'; + } + else + { + $mob = new mobilitaet(); + + $error = false; + if(isset($_POST['mobilitaet_id'])) + { + $mobilitaet_id = $_POST['mobilitaet_id']; + if(!$mob->load($mobilitaet_id)) + { + $error=true; + $errormsg = $mob->errormsg; + } + } + else + { + $mob->new = true; + $mob->inservon = $user; + } + + if(isset($_POST['studiensemester_kurzbz']) + && isset($_POST['mobilitaetsprogramm_code']) + && isset($_POST['gsprogramm_id']) + && isset($_POST['mobilitaetstyp_kurzbz']) + && isset($_POST['firma_id']) + && isset($_POST['status_kurzbz']) + && isset($_POST['ausbildungssemester'])) + { + $studiensemester_kurzbz = $_POST['studiensemester_kurzbz']; + $mobilitaetsprogramm_code = $_POST['mobilitaetsprogramm_code']; + $gsprogramm_id = $_POST['gsprogramm_id']; + $mobilitaetstyp_kurzbz = $_POST['mobilitaetstyp_kurzbz']; + $firma_id = $_POST['firma_id']; + $status_kurzbz = $_POST['status_kurzbz']; + $ausbildungssemester = $_POST['ausbildungssemester']; + } + else + { + $error = true; + $errormsg = 'Fehlerhafte Parameteruebergabe'; + $return = false; + } + + if(!$error) + { + $mob->prestudent_id = $prestudent_id; + $mob->studiensemester_kurzbz = $studiensemester_kurzbz; + $mob->mobilitaetsprogramm_code = $mobilitaetsprogramm_code; + $mob->gsprogramm_id = $gsprogramm_id; + $mob->mobilitaetstyp_kurzbz = $mobilitaetstyp_kurzbz; + $mob->firma_id = $firma_id; + $mob->status_kurzbz = $status_kurzbz; + $mob->ausbildungssemester = $ausbildungssemester; + $mob->updatevon = $user; + + if($mob->save()) + { + $return = true; + $data = $mob->mobilitaet_id; + } + else + { + $return = false; + $error = true; + $errormsg = $mob->errormsg; + } + } + else + { + $return = false; + } + } + } + elseif(isset($_POST['type']) && $_POST['type']=='deletemobilitaet') + { + $mobilitaet_id = $_POST['mobilitaet_id']; + $mob = new mobilitaet(); + if($mob->load($mobilitaet_id)) + { + $prestudent = new prestudent(); + if($prestudent->load($mob->prestudent_id)) + { + if(!$rechte->isBerechtigt('student/stammdaten',$prestudent->studiengang_kz,'suid')) + { + $error = true; + $return = false; + $errormsg = 'Sie haben keine Berechtigung'; + } + else + { + if($mob->delete($mobilitaet_id)) + { + $return = true; + } + else + { + $errormsg = $mob->errormsg; + $return = false; + } + } + } + else + { + $error = true; + $return = false; + $errormsg = $prestudent->errormsg; + } + } + else + { + $return = false; + $errormsg = $mob->errormsg; + } + } else { $return = false; diff --git a/content/student/studentdetailoverlay.xul.php b/content/student/studentdetailoverlay.xul.php index dc9a47555..0d0094cc5 100644 --- a/content/student/studentdetailoverlay.xul.php +++ b/content/student/studentdetailoverlay.xul.php @@ -47,9 +47,9 @@ echo ''; @@ -100,7 +100,7 @@ echo ''; - +