From 625a662648a4cf8a7f3f1128f7a0af812985aa1e Mon Sep 17 00:00:00 2001 From: oesi Date: Tue, 20 Sep 2016 16:15:00 +0200 Subject: [PATCH 01/20] 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 02/20] 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 03/20] 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 04/20] =?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 05/20] 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 06/20] 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 07/20] 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 08/20] =?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 09/20] 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 10/20] =?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 11/20] 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 12/20] =?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 13/20] 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 14/20] =?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 15/20] 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 16/20] 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 17/20] 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 18/20] 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 19/20] 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 20/20] 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; } }
    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 '