diff --git a/application/controllers/system/UDF.php b/application/controllers/system/FAS_UDF.php similarity index 66% rename from application/controllers/system/UDF.php rename to application/controllers/system/FAS_UDF.php index dafa3f8f7..cd78d64d2 100644 --- a/application/controllers/system/UDF.php +++ b/application/controllers/system/FAS_UDF.php @@ -2,8 +2,10 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class UDF extends Auth_Controller +class FAS_UDF extends Auth_Controller { + const FAS_UDF_SESSION_NAME = 'fasUdfSessionName'; + public function __construct() { parent::__construct( @@ -22,31 +24,33 @@ class UDF extends Auth_Controller */ public function index() { + $fasUdfSession = getSession(self::FAS_UDF_SESSION_NAME); + $person_id = $this->input->get('person_id'); - if (isset($this->session->person_id)) + if (isset($fasUdfSession['person_id'])) { if (!isset($person_id)) { - $person_id = $this->session->person_id; + $person_id = $fasUdfSession['person_id']; } - unset($this->session->person_id); + unset($fasUdfSession['person_id']); } $prestudent_id = $this->input->get('prestudent_id'); - if (isset($this->session->prestudent_id)) + if (isset($fasUdfSession['prestudent_id'])) { if (!isset($prestudent_id)) { - $prestudent_id = $this->session->prestudent_id; + $prestudent_id = $fasUdfSession['prestudent_id']; } - unset($this->session->prestudent_id); + unset($fasUdfSession['prestudent_id']); } $result = null; - if (isset($this->session->result)) + if (isset($fasUdfSession['result'])) { - $result = clone $this->session->result; - $this->session->set_userdata('result', null); + $result = clone $fasUdfSession['result']; + setSessionElement(self::FAS_UDF_SESSION_NAME, 'result', null); } $data = array('result' => $result); @@ -71,7 +75,7 @@ class UDF extends Auth_Controller } } - $this->load->view('system/udf', $data); + $this->load->view('system/fas_udf', $data); } /** @@ -90,9 +94,9 @@ class UDF extends Auth_Controller if (isSuccess($validation)) { // Load model UDF_model - $this->load->model('system/UDF_model', 'UDFModel'); + $this->load->model('system/FAS_UDF_model', 'FASUDFModel'); - $result = $this->UDFModel->saveUDFs($udfs); + $result = $this->FASUDFModel->saveUDFs($udfs); $userdata['result'] = $result; } @@ -101,8 +105,11 @@ class UDF extends Auth_Controller $userdata['result'] = $validation; } - $this->session->set_userdata($userdata); - redirect('system/UDF'); + setSessionElement(self::FAS_UDF_SESSION_NAME, 'person_id', $userdata['person_id']); + setSessionElement(self::FAS_UDF_SESSION_NAME, 'prestudent_id', $userdata['prestudent_id']); + setSessionElement(self::FAS_UDF_SESSION_NAME, 'result', $userdata['result']); + + redirect('system/FAS_UDF'); } /** diff --git a/application/models/codex/Bisiozweck_model.php b/application/models/codex/Bisiozweck_model.php new file mode 100644 index 000000000..b456f412d --- /dev/null +++ b/application/models/codex/Bisiozweck_model.php @@ -0,0 +1,15 @@ +dbTable = 'bis.tbl_bisio_zweck'; + $this->pk = array('bisio_id', 'zweck_code'); + $this->hasSequence = false; + } +} diff --git a/application/models/system/FAS_UDF_model.php b/application/models/system/FAS_UDF_model.php new file mode 100644 index 000000000..aee49d431 --- /dev/null +++ b/application/models/system/FAS_UDF_model.php @@ -0,0 +1,169 @@ +load->model('person/Person_model', 'PersonModel'); + + $result = $this->load(array('public', 'tbl_person')); + if (isSuccess($result) && count($result->retval) == 1) + { + $jsons = json_decode($result->retval[0]->jsons); + } + + $udfs = $this->_fillMissingTextUDF($udfs, $jsons); + $udfs = $this->_fillMissingChkboxUDF($udfs, $jsons); + $udfs = $this->_fillMissingDropdownUDF($udfs, $jsons); + + $resultPerson = $this->PersonModel->update($person_id, $udfs); + } + + // + if (isset($prestudent_id)) + { + // Load model Prestudent_model + $this->load->model('crm/Prestudent_model', 'PrestudentModel'); + + $result = $this->load(array('public', 'tbl_prestudent')); + if (isSuccess($result) && count($result->retval) == 1) + { + $jsons = json_decode($result->retval[0]->jsons); + } + + $udfs = $this->_fillMissingTextUDF($udfs, $jsons); + $udfs = $this->_fillMissingChkboxUDF($udfs, $jsons); + $udfs = $this->_fillMissingDropdownUDF($udfs, $jsons); + + $resultPrestudent = $this->PrestudentModel->update($prestudent_id, $udfs); + } + + if (isSuccess($resultPerson) && isSuccess($resultPrestudent)) + { + $result = success(array($resultPerson->retval, $resultPrestudent->retval)); + } + else if(isError($resultPerson)) + { + $result = $resultPerson; + } + else if(isError($resultPrestudent)) + { + $result = $resultPrestudent; + } + + return $result; + } + + /** + * + */ + private function _fillMissingChkboxUDF($udfs, $jsons) + { + $_fillMissingChkboxUDF = $udfs; + + foreach($jsons as $udfDescription) + { + if ($udfDescription->{UDFLib::TYPE} == UDFLib::CHKBOX_TYPE) + { + if (!isset($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}])) + { + $_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = false; + } + else + { + if ($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_FALSE) + { + $_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = false; + } + else if ($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_TRUE) + { + $_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = true; + } + } + } + } + + return $_fillMissingChkboxUDF; + } + + /** + * + */ + private function _fillMissingDropdownUDF($udfs, $jsons) + { + $_fillMissingDropdownUDF = $udfs; + + foreach($jsons as $udfDescription) + { + if ($udfDescription->{UDFLib::TYPE} == UDF_model::UDF_DROPDOWN_TYPE + || $udfDescription->{UDFLib::TYPE} == UDF_model::UDF_MULTIPLEDROPDOWN_TYPE) + { + if (!isset($_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}])) + { + $_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] = null; + } + else if($_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_NULL) + { + $_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] = null; + } + } + } + + return $_fillMissingDropdownUDF; + } + + /** + * + */ + private function _fillMissingTextUDF($udfs, $jsons) + { + $_fillMissingTextUDF = $udfs; + + foreach($jsons as $udfDescription) + { + if ($udfDescription->{UDFLib::TYPE} == 'textarea' + || $udfDescription->{UDFLib::TYPE} == 'textfield') + { + if (!isset($_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}])) + { + $_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}] = null; + } + else if(trim($_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}]) == '') + { + $_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}] = null; + } + } + } + + return $_fillMissingTextUDF; + } +} diff --git a/application/models/system/UDF_model.php b/application/models/system/UDF_model.php index 5efb061d1..6923d1733 100644 --- a/application/models/system/UDF_model.php +++ b/application/models/system/UDF_model.php @@ -2,14 +2,6 @@ class UDF_model extends DB_Model { - // String values of booleans - const STRING_NULL = 'null'; - const STRING_TRUE = 'true'; - const STRING_FALSE = 'false'; - - const UDF_DROPDOWN_TYPE = 'dropdown'; - const UDF_MULTIPLEDROPDOWN_TYPE = 'multipledropdown'; - /** * Constructor */ @@ -38,164 +30,4 @@ class UDF_model extends DB_Model return $udfResults; } - - // ------------------------------------------------------------------------------------ - // These methods work only with the this version of FAS, not with the future versions - - /** - * Methods to save data from FAS - */ - public function saveUDFs($udfs) - { - $result = error('No way man!'); - $resultPerson = success('person'); - $resultPrestudent = success('prestudent'); - - $person_id = null; - if (isset($udfs['person_id'])) $person_id = $udfs['person_id']; - unset($udfs['person_id']); - - $prestudent_id = null; - if (isset($udfs['prestudent_id'])) $prestudent_id = $udfs['prestudent_id']; - unset($udfs['prestudent_id']); - - $jsons = array(); - - // - if (isset($person_id)) - { - // Load model Person_model - $this->load->model('person/Person_model', 'PersonModel'); - - $result = $this->load(array('public', 'tbl_person')); - if (isSuccess($result) && count($result->retval) == 1) - { - $jsons = json_decode($result->retval[0]->jsons); - } - - $udfs = $this->_fillMissingTextUDF($udfs, $jsons); - $udfs = $this->_fillMissingChkboxUDF($udfs, $jsons); - $udfs = $this->_fillMissingDropdownUDF($udfs, $jsons); - - $resultPerson = $this->PersonModel->update($person_id, $udfs); - } - - // - if (isset($prestudent_id)) - { - // Load model Prestudent_model - $this->load->model('crm/Prestudent_model', 'PrestudentModel'); - - $result = $this->load(array('public', 'tbl_prestudent')); - if (isSuccess($result) && count($result->retval) == 1) - { - $jsons = json_decode($result->retval[0]->jsons); - } - - $udfs = $this->_fillMissingTextUDF($udfs, $jsons); - $udfs = $this->_fillMissingChkboxUDF($udfs, $jsons); - $udfs = $this->_fillMissingDropdownUDF($udfs, $jsons); - - $resultPrestudent = $this->PrestudentModel->update($prestudent_id, $udfs); - } - - if (isSuccess($resultPerson) && isSuccess($resultPrestudent)) - { - $result = success(array($resultPerson->retval, $resultPrestudent->retval)); - } - else if(isError($resultPerson)) - { - $result = $resultPerson; - } - else if(isError($resultPrestudent)) - { - $result = $resultPrestudent; - } - - return $result; - } - - /** - * - */ - private function _fillMissingChkboxUDF($udfs, $jsons) - { - $_fillMissingChkboxUDF = $udfs; - - foreach($jsons as $udfDescription) - { - if ($udfDescription->{UDFLib::TYPE} == UDFLib::CHKBOX_TYPE) - { - if (!isset($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}])) - { - $_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = false; - } - else - { - if ($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_FALSE) - { - $_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = false; - } - else if ($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_TRUE) - { - $_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = true; - } - } - } - } - - return $_fillMissingChkboxUDF; - } - - /** - * - */ - private function _fillMissingDropdownUDF($udfs, $jsons) - { - $_fillMissingDropdownUDF = $udfs; - - foreach($jsons as $udfDescription) - { - if ($udfDescription->{UDFLib::TYPE} == UDF_model::UDF_DROPDOWN_TYPE - || $udfDescription->{UDFLib::TYPE} == UDF_model::UDF_MULTIPLEDROPDOWN_TYPE) - { - if (!isset($_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}])) - { - $_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] = null; - } - else if($_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_NULL) - { - $_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] = null; - } - } - } - - return $_fillMissingDropdownUDF; - } - - /** - * - */ - private function _fillMissingTextUDF($udfs, $jsons) - { - $_fillMissingTextUDF = $udfs; - - foreach($jsons as $udfDescription) - { - if ($udfDescription->{UDFLib::TYPE} == 'textarea' - || $udfDescription->{UDFLib::TYPE} == 'textfield') - { - if (!isset($_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}])) - { - $_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}] = null; - } - else if(trim($_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}]) == '') - { - $_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}] = null; - } - } - } - - return $_fillMissingTextUDF; - } } diff --git a/application/views/system/udf.php b/application/views/system/fas_udf.php similarity index 91% rename from application/views/system/udf.php rename to application/views/system/fas_udf.php index 10ba15698..d4a01b9e9 100644 --- a/application/views/system/udf.php +++ b/application/views/system/fas_udf.php @@ -47,7 +47,7 @@ } } ?> -
+
diff --git a/cis/infoterminal/index.php b/cis/infoterminal/index.php index d11ce070b..a3a7dfb91 100644 --- a/cis/infoterminal/index.php +++ b/cis/infoterminal/index.php @@ -1974,6 +1974,9 @@ function personen_id_read_mitarbeiter_oder_student($db,$person_id) */ function read_create_html_news($db,$fachbereich_kurzbz,$studiengang_kz,$semester) { + if(defined('CIS_INFOSCREEN_NEWS_ANZEIGEN') && CIS_INFOSCREEN_NEWS_ANZEIGEN==false) + return ''; + // ------------------------------------------------------------------------------------------ // Lesen Newstickerzeilen // ------------------------------------------------------------------------------------------ diff --git a/cis/private/lehre/notenliste.php b/cis/private/lehre/notenliste.php index 33221ac1a..56fd4a36d 100644 --- a/cis/private/lehre/notenliste.php +++ b/cis/private/lehre/notenliste.php @@ -308,8 +308,12 @@ else // Nur Noten, die aufs Zeugnis gedruckt werden für Durchschnittsberechnung addieren if ($row->zeugnis == true) { - $notenSummenArray[$row->lehrveranstaltung_id]['notenwert'] = (isset($notenarr[$row->note]['notenwert']) ? $notenarr[$row->note]['notenwert'] : ''); - $notenSummenArray[$row->lehrveranstaltung_id]['ects'] = $row->ects; + // Noten ohne Wert werden entfernen + if(isset($notenarr[$row->note]['notenwert'])) + { + $notenSummenArray[$row->lehrveranstaltung_id]['notenwert'] = $notenarr[$row->note]['notenwert']; + $notenSummenArray[$row->lehrveranstaltung_id]['ects'] = $row->ects; + } } } $tblBody .= ""; @@ -379,13 +383,10 @@ else $anzahlLv = 0; foreach ($notenSummenArray AS $key => $value) { - if ($value['notenwert'] != '') - { - $anzahlLv++; - $notenSumme += $value['notenwert']; - $ectsSumme += $value['ects']; - $notenSummeGewichtet += $value['notenwert'] * $value['ects']; - } + $anzahlLv++; + $notenSumme += $value['notenwert']; + $ectsSumme += $value['ects']; + $notenSummeGewichtet += $value['notenwert'] * $value['ects']; } $tblBody .= ""; diff --git a/cis/private/lehre/pruefung/pruefung.js.php b/cis/private/lehre/pruefung/pruefung.js.php index 5662898d9..9ef84e889 100644 --- a/cis/private/lehre/pruefung/pruefung.js.php +++ b/cis/private/lehre/pruefung/pruefung.js.php @@ -352,7 +352,9 @@ function writePruefungsTable(e, data, anmeldung) var termin = d.von.split(" "); var time = termin[1].substring(0,5); termin = termin[0].split("-"); - termin = new Date(termin[0], termin[1]-1,termin[2]); + var minimumFrist = new Date(termin[0], termin[1]-1,termin[2]); + minimumFrist.setMonth(minimumFrist.getMonth() - 2); + termin = new Date(termin[0], termin[1]-1,termin[2]); var frist = termin; termin = termin.getDate()+"."+(termin.getMonth()+1)+"."+termin.getFullYear(); frist = frist.getTime(); @@ -374,26 +376,29 @@ function writePruefungsTable(e, data, anmeldung) button = "

"+frist+"'>

"; } - else + else if(new Date() > minimumFrist) { button = "

"+frist+"'>

"; } } else - { + { button = "

' onclick='openAnmeldung(\""+e.lehrveranstaltung[0].lehrveranstaltung_id+"\", \""+e.pruefung.studiensemester_kurzbz+"\");'>

"; } row += button; - if(d.max === null) - { - teilnehmer += "t('pruefung/unbegrenzt'); ?>
"; - } - else - { - teilnehmer += "

"+(d.max - d.teilnehmer)+"/"+d.max+"

"; - } + if(new Date() > minimumFrist) + { + if(d.max === null) + { + teilnehmer += "t('pruefung/unbegrenzt'); ?>
"; + } + else + { + teilnehmer += "

"+(d.max - d.teilnehmer)+"/"+d.max+"

"; + } + } }); row += ""+teilnehmer+""; return row; diff --git a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php index a446c73e2..df053bb94 100644 --- a/cis/private/lehre/pruefung/pruefungsanmeldung.json.php +++ b/cis/private/lehre/pruefung/pruefungsanmeldung.json.php @@ -178,7 +178,10 @@ function getPruefungByLv($aktStudiensemester = null, $uid = null) $lveranstaltung = new lehrveranstaltung($lehreinheiten[0]->lehrfach_id); $oe = new organisationseinheit($lveranstaltung->oe_kurzbz); $prf->organisationseinheit = $oe->bezeichnung; - array_push($pruefungen, $prf); + + // nur hinzufügen wenn zumindest 1 Termin vorhanden ist + if (!empty($prf->pruefung->termine)) + array_push($pruefungen, $prf); } } $anmeldung = new pruefungsanmeldung(); @@ -265,7 +268,10 @@ function getPruefungByLvFromStudiengang($aktStudiensemester = null, $uid = null) $lveranstaltung = new lehrveranstaltung($lehreinheiten[0]->lehrfach_id); $oe = new organisationseinheit($lveranstaltung->oe_kurzbz); $prf->organisationseinheit = $oe->bezeichnung; - array_push($pruefungen, $prf); + + // nur hinzufügen wenn zumindest 1 Termin vorhanden ist + if (!empty($prf->pruefung->termine)) + array_push($pruefungen, $prf); } } @@ -805,7 +811,10 @@ function getAllPruefungen($aktStudiensemester = null, $uid = null) $lveranstaltung = new lehrveranstaltung($lehreinheiten[0]->lehrfach_id); $oe = new organisationseinheit($lveranstaltung->oe_kurzbz); $prf->organisationseinheit = $oe->bezeichnung; - array_push($pruefungen, $prf); + + // nur hinzufügen wenn zumindest 1 Termin vorhanden ist + if (!empty($prf->pruefung->termine)) + array_push($pruefungen, $prf); } } diff --git a/cis/private/lehre/pruefung/pruefungsanmeldung.php b/cis/private/lehre/pruefung/pruefungsanmeldung.php index cd3b49621..f32c508e7 100644 --- a/cis/private/lehre/pruefung/pruefungsanmeldung.php +++ b/cis/private/lehre/pruefung/pruefungsanmeldung.php @@ -150,8 +150,8 @@ $studiensemester->getAll(); { $("#accordion").accordion({ header: "h2", - autoHeight: false - }); + heightStyle: "content" + }); $("#accordion").attr("style", "visibility: visible;"); } }); diff --git a/cis/private/lvplan/stpl_week.php b/cis/private/lvplan/stpl_week.php index edc50e8c2..c7da148dd 100644 --- a/cis/private/lvplan/stpl_week.php +++ b/cis/private/lvplan/stpl_week.php @@ -362,7 +362,7 @@ if (isset($reservtodelete)) $reservierung = new reservierung(); $reservdelcount = 0; - $reservberechtigt = $rechte->isBerechtigt('lehre/reservierung', null, 'suid'); + $reservberechtigt = $rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 'suid'); foreach ($reservtodelete as $delete_id) { diff --git a/cis/private/tools/notebook_registration.php b/cis/private/tools/notebook_registration.php index 5674415bc..cd557431e 100644 --- a/cis/private/tools/notebook_registration.php +++ b/cis/private/tools/notebook_registration.php @@ -69,8 +69,8 @@ function ip_increment($ip = "") - Wollen Sie als Mitarbeiter ein Notebook registrieren wenden Sie sich bitte an den Support '; + echo 'Die Notebook Registrierung steht nur für Studierende zur Verfügung.
+ Wollen Sie als Mitarbeiter ein Notebook registrieren, wenden Sie sich bitte an den Support.'; echo '
'; exit; } diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index 94251ce12..acc5f83d0 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -82,7 +82,7 @@ else { $datum = new datum(); $fieldheadings = array( - 'id' => $p->t("zeitaufzeichnung/id"), 'user' => $p->t("zeitaufzeichnung/user"), 'projekt' => $p->t("zeitaufzeichnung/projekt"), + 'id' => $p->t("zeitaufzeichnung/id"), 'user' => $p->t("zeitaufzeichnung/user"), 'projekt' => $p->t("zeitaufzeichnung/projekt"), 'ap' => $p->t("zeitaufzeichnung/projektphase"), 'oe1' => $p->t("zeitaufzeichnung/oe"), 'oe2' => $p->t("zeitaufzeichnung/oe").'2', 'aktivitaet' => $p->t("zeitaufzeichnung/aktivitaet"), 'service' => $p->t("zeitaufzeichnung/service"), 'start' => $p->t("zeitaufzeichnung/start"), 'ende' => $p->t("zeitaufzeichnung/ende"), 'dauer' => $p->t("zeitaufzeichnung/dauer"), 'kunde' => $p->t("zeitaufzeichnung/kunde"), 'beschreibung' => $p->t("global/beschreibung"), 'aktion' => $p->t("global/aktion"), @@ -251,7 +251,7 @@ echo ' $("#kunde_uid").val(ui.item.uid); } }); - + $("#projekt").change( function() { @@ -496,7 +496,7 @@ echo ' } return true; } - + function getProjektphasen(projekt_kurzbz) { $.ajax @@ -505,7 +505,7 @@ echo ' type: "GET", url: "zeitaufzeichnung_projektphasen.php", dataType: "json", - data: + data: { "projekt_kurzbz":projekt_kurzbz }, @@ -517,7 +517,7 @@ echo ' { if ($(this).prop("id") !== "projektphasekeineausw") $(this).remove(); - } + } ); //append Projektphasen if any if (json.length > 0) @@ -527,13 +527,13 @@ echo ' { projphasenhtml += "'; $trennlinie = false; } - echo ''; + echo ''; } echo '     '; if($za_simple == 0) @@ -1202,7 +1257,7 @@ if($projekt->getProjekteMitarbeiter($user, true)) { //Uebersichtstabelle $woche=date('W'); - $colspan=($za_simple)?11:13; + $colspan=($za_simple)?12:14; echo ' @@ -1285,7 +1340,7 @@ if($projekt->getProjekteMitarbeiter($user, true)) $tagessaldo = $tagessaldo-$pausesumme; $tagessaldo = date('H:i', ($tagessaldo)); - $colspan = ($za_simple)?5:7; + $colspan = ($za_simple)?6:8; echo ' @@ -1382,7 +1437,7 @@ if($projekt->getProjekteMitarbeiter($user, true)) // Diestreisen NEU if (array_key_exists($datumtag, $dr_arr)) { - $colspan=($za_simple)?5:7; + $colspan=($za_simple)?6:8; echo ''; + echo ''; echo ''; if(!$za_simple) { @@ -1519,6 +1577,7 @@ function printTableHeadings($fieldheadings, $za_simple = false){ + '; if (!$za_simple) { @@ -1578,8 +1637,8 @@ function getDataForCSV($rawdata, $fieldheadings, $za_simple = false) $datum = new datum(); $csvData = array(); //headers schreiben - $csvData[] = ($za_simple) ? array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['oe1'], $fieldheadings['aktivitaet'], $fieldheadings['beschreibung']) - : array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['oe1'], $fieldheadings['oe2'], $fieldheadings['aktivitaet'], $fieldheadings['service'], $fieldheadings['kunde'], $fieldheadings['beschreibung']); + $csvData[] = ($za_simple) ? array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['ap'], $fieldheadings['oe1'], $fieldheadings['aktivitaet'], $fieldheadings['beschreibung']) + : array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['ap'], $fieldheadings['oe1'], $fieldheadings['oe2'], $fieldheadings['aktivitaet'], $fieldheadings['service'], $fieldheadings['kunde'], $fieldheadings['beschreibung']); foreach ($rawdata as $zeitauf) { //Newline characters bei Beschreibung ersetzen @@ -1592,13 +1651,13 @@ function getDataForCSV($rawdata, $fieldheadings, $za_simple = false) if($za_simple) { $csvData[] = array($zeitauf->uid, $hauptdatum, $datum->formatDatum($zeitauf->start, 'H:i'), - $bisdatum, $zeitauf->projekt_kurzbz, $zeitauf->oe_kurzbz_1, $zeitauf->aktivitaet_kurzbz, $beschreibung); + $bisdatum, $zeitauf->projekt_kurzbz, $zeitauf->projektphase_id, $zeitauf->oe_kurzbz_1, $zeitauf->aktivitaet_kurzbz, $beschreibung); } else { $servicebez = ($service->load($zeitauf->service_id))?$service->bezeichnung:""; $csvData[] = array($zeitauf->uid, $hauptdatum, $datum->formatDatum($zeitauf->start, 'H:i'), $bisdatum, - $zeitauf->projekt_kurzbz, $zeitauf->oe_kurzbz_1, $zeitauf->oe_kurzbz_2, $zeitauf->aktivitaet_kurzbz, $servicebez, $zeitauf->kunde_uid, $beschreibung); + $zeitauf->projekt_kurzbz, $zeitauf->projektphase_id, $zeitauf->oe_kurzbz_1, $zeitauf->oe_kurzbz_2, $zeitauf->aktivitaet_kurzbz, $servicebez, $zeitauf->kunde_uid, $beschreibung); } } return $csvData; diff --git a/cis/testtool/frage.php b/cis/testtool/frage.php index 5dfe3b437..f15c2c2d2 100644 --- a/cis/testtool/frage.php +++ b/cis/testtool/frage.php @@ -160,7 +160,7 @@ $gebiet = new gebiet($gebiet_id); if($gebiet->level_start!='') $levelgebiet=true; -else +else $levelgebiet=false; list($stunde, $minute, $sekunde) = explode(':',$gebiet->zeit); @@ -178,20 +178,20 @@ if(isset($_GET['start']) && !$gestartet) $frage = new frage(); if(!$frage->generateFragenpool($_SESSION['pruefling_id'], $gebiet_id)) die($p->t('testtool/fehlerBeimGenerierenDesFragenpools').':'.$frage->errormsg); - + //Erste Frage des Pools holen if(!$frage_id = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'])) die($p->t('testtool/esWurdeKeineFrageGefunden')); - + //Beginnzeit Speichern $prueflingfrage = new frage(); if(!$prueflingfrage->getPrueflingfrage($_SESSION['pruefling_id'], $frage_id)) die($p->t('testtool/fehler').':'.$prueflingfrage->errormsg); - + $prueflingfrage->begintime = date('Y-m-d H:i:s'); if(!$prueflingfrage->save_prueflingfrage(false)) die($p->t('testtool/fehlerBeimStartvorgang')); - + echo ''; } @@ -201,46 +201,46 @@ if(isset($_POST['submitantwort']) && isset($_GET['frage_id'])) // vor dem Speichern der Antworten, alle Antworten zu der Frage loeschen // und die Antworten neu anlegen // Unterscheidung ob mehrere oder nur eine Antwort uebergeben wird - + if($levelgebiet && !isset($_POST['vorschlag_id'])) { echo ''.$p->t('testtool/beiDiesemGebietMuessenSieJedeFrageBeantworten').''; } else { - + $error=false; - + $db->db_query('BEGIN;'); - + // alle vorhandenen Antworten zu dieser Frage loeschen $qry = "DELETE FROM testtool.tbl_antwort WHERE antwort_id in( SELECT antwort_id FROM testtool.tbl_antwort JOIN testtool.tbl_vorschlag USING(vorschlag_id) WHERE frage_id=".$db->db_add_param($_GET['frage_id'])." AND pruefling_id=".$db->db_add_param($_SESSION['pruefling_id']).")"; - + $db->db_query($qry); - - // Antwort nur Speichern wenn eine Antwort gewaehlt wurde + + // Antwort nur Speichern wenn eine Antwort gewaehlt wurde if(isset($_POST['vorschlag_id']) && $_POST['vorschlag_id']!='') { $vorschlaege = array(); //Falls nur eine einzelne Antwort kommt, diese auch in ein Array packen if(!is_array($_POST['vorschlag_id'])) $vorschlaege[0]=$_POST['vorschlag_id']; - else + else $vorschlaege = $_POST['vorschlag_id']; - + //alle Antworten Speichern - foreach ($vorschlaege as $vorschlag_id) + foreach ($vorschlaege as $vorschlag_id) { if($vorschlag_id!='') { $antwort = new antwort(); - + $antwort->new = true; $antwort->vorschlag_id = $vorschlag_id; $antwort->pruefling_id = $_SESSION['pruefling_id']; - + if(!$antwort->save()) { $errormsg = $antwort->errormsg; @@ -248,7 +248,7 @@ if(isset($_POST['submitantwort']) && isset($_GET['frage_id'])) } } } - + if(!$error) { //Endzeit der Frage eintragen @@ -259,7 +259,7 @@ if(isset($_POST['submitantwort']) && isset($_GET['frage_id'])) $error = true; } $prueflingfrage->endtime = date('Y-m-d H:i:s'); - + if(!$prueflingfrage->save_prueflingfrage(false)) { $errormsg = $prueflingfrage->errormsg; @@ -267,32 +267,32 @@ if(isset($_POST['submitantwort']) && isset($_GET['frage_id'])) } } } - + if($error) { $db->db_query('ROLLBACK;'); die($p->t('testtool/fehler').':'.$errormsg); } - else + else { $db->db_query('COMMIT;'); } - + $frage = new frage(); - + if($levelgebiet) { //bei gelevelten Fragen die naechste Frage holen $frage->generateFragenpool($_SESSION['pruefling_id'], $gebiet_id); } - + $frage_id = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], $frage_id); } } //Schauen ob dieses Gebiet schon gestartet wurde $qry = "SELECT begintime - FROM + FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id) WHERE pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER)." AND gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)." ORDER BY begintime ASC LIMIT 1"; @@ -321,7 +321,7 @@ else $info=''; //Name und Studiengang anzeigen -$qry_pruefling = "SELECT vorname, nachname, stg_bez, tbl_studiengangstyp.bezeichnung FROM testtool.vw_pruefling +$qry_pruefling = "SELECT vorname, nachname, stg_bez, tbl_studiengangstyp.bezeichnung FROM testtool.vw_pruefling JOIN public.tbl_studiengang USING (studiengang_kz) JOIN public.tbl_studiengangstyp USING (typ) WHERE pruefling_id=".$db->db_add_param($_SESSION['pruefling_id']); @@ -342,7 +342,7 @@ if($levelgebiet) $qry = "SELECT count(*) as anzahl FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id) WHERE pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER)." AND gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER); - + if($result_aktuell = $db->db_query($qry)) { if($row_aktuell = $db->db_fetch_object($result_aktuell)) @@ -402,8 +402,8 @@ if($demo) else { //Wenn es sich um eine Testfrage handelt, dann wird die verbleibende Zeit angezeigt - $qry = "SELECT '$gebiet->zeit'-(now()-min(begintime)) as time - FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id) + $qry = "SELECT '$gebiet->zeit'-(now()-min(begintime)) as time + FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id) WHERE gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)." AND pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER); $result = $db->db_query($qry); $row = $db->db_fetch_object($result); @@ -419,7 +419,7 @@ else echo $p->t('testtool/bearbeitungszeit').': '; echo ""; - + if($zeit<0) die('
'; // Zusaetzlicher span fuer Addon Informationen @@ -1360,7 +1415,7 @@ if($projekt->getProjekteMitarbeiter($user, true)) '; - $colspan=($za_simple)?11:13; + $colspan=($za_simple)?12:14; echo '
 
'.$p->t('zeitaufzeichnung/dienstreise'); if (array_key_exists('start', $dr_arr[$datumtag]) && !array_key_exists('ende', $dr_arr[$datumtag])) echo ' '.$p->t('global/beginn'); @@ -1436,10 +1491,13 @@ if($projekt->getProjekteMitarbeiter($user, true)) $summe = $row->summe; $service = new service(); $service->load($row->service_id); + $projektphase = new projektphase($row->projektphase_id); + $ap = $projektphase->bezeichnung; echo '
'.$db->convert_html_chars($row->zeitaufzeichnung_id).' '.$db->convert_html_chars($row->uid).' '.$db->convert_html_chars($row->projekt_kurzbz).' '.$db->convert_html_chars($ap).' '.$db->convert_html_chars($row->oe_kurzbz_1).''.$fieldheadings['id'].' '.$fieldheadings['user'].' '.$fieldheadings['projekt'].''.$fieldheadings['ap'].' '.$fieldheadings['oe1'].'
'.$p->t('testtool/dieZeitIstAbgelaufen').'
'); } @@ -439,17 +439,17 @@ else { // wenn keine Frage uebergeben wurde und die maximale Fragenanzahl erreicht wurde // dann ist das Gebiet fertig - $qry = "SELECT count(*) as anzahl FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id) + $qry = "SELECT count(*) as anzahl FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id) WHERE gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)." AND pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER)." AND tbl_pruefling_frage.endtime is not null"; $result = $db->db_query($qry); $row = $db->db_fetch_object($result); - + if($row->anzahl>=$gebiet->maxfragen) { die(""); } } - + $frage_id = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], null, $demo, $levelgebiet); $frage->load($frage_id); } @@ -471,7 +471,7 @@ if($frage->frage_id!='') $prueflingfrage = new frage(); if(!$prueflingfrage->getPrueflingfrage($_SESSION['pruefling_id'], $frage_id)) die($p->t('testtool/dieseFrageIstNichtFuerSieBestimmt')); - + if($prueflingfrage->begintime=='') { $prueflingfrage->begintime = date('Y-m-d H:i:s'); @@ -484,8 +484,8 @@ if($frage->frage_id!='') //Kopfzeile mit Weiter Button und Sprung direkt zu einer Frage if(!$demo && !$levelgebiet) { - $qry = "SELECT tbl_pruefling_frage.nummer, tbl_pruefling_frage.frage_id - FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id) + $qry = "SELECT tbl_pruefling_frage.nummer, tbl_pruefling_frage.frage_id + FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id) WHERE gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)." AND pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER)." AND demo=false ORDER BY nummer"; echo " @@ -515,9 +515,9 @@ if($frage->frage_id!='') { if($demo) $value=''; - else + else $value=$p->t('testtool/blaettern').' >>'; - + echo " $value"; } else @@ -543,8 +543,8 @@ if($frage->frage_id!='') { echo '
-


-
+


+
'; } $timestamp = time(); @@ -552,13 +552,13 @@ if($frage->frage_id!='') //Sound einbinden if($frage->audio!='') { - echo ' + echo '
+
'; } @@ -566,10 +566,10 @@ if($frage->frage_id!='') $display_well = $frage->nummer == 0 ? '' : 'well'; // don't style frage 0 because this is always the introduction to gebiet echo '
-
+
'. $frage->text. '
-
-
+
+ '; //Vorschlaege laden @@ -586,22 +586,22 @@ if($frage->frage_id!='') $beantwortet = false; $cnt = 0; // counter für foreach-Schleife $len = count($vs->result); - + //Antworten laden falls bereits vorhanden $antwort = new antwort(); $antwort->getAntwort($_SESSION['pruefling_id'],$frage->frage_id); - + //Vorschlaege anzeigen foreach ($vs->result as $vorschlag) { echo ""; - + //Bei multipleresponse checkboxen anzeigen ansonsten radiobuttons if($gebiet->multipleresponse) $type='checkbox'; - else + else $type='radio'; - + //Antworten markieren wenn die Frage bereits beantwortet wurde $checked=false; reset($antwort->result); @@ -613,9 +613,9 @@ if($frage->frage_id!='') $beantwortet = true; } } - + echo ''; - + echo '
'; if($vorschlag->bild!='') echo "
"; @@ -641,7 +641,7 @@ if($frage->frage_id!='') $cnt++; } - //wenn singleresponse und keine Levels und vorschlaege vorhanden sind, dann gibt es auch die + //wenn singleresponse und keine Levels und vorschlaege vorhanden sind, dann gibt es auch die //moeglichkeit fuer keine Antwort if(!$gebiet->multipleresponse && !$levelgebiet && count($vs->result)>0) { @@ -668,8 +668,8 @@ if($frage->frage_id!='') //Naechste Frage holen und Weiter-Button anzeigen //$frage = new frage(); //$nextfrage = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], $frage_id, $demo); - - $qry = "SELECT count(*) as anzahl FROM testtool.tbl_frage + + $qry = "SELECT count(*) as anzahl FROM testtool.tbl_frage WHERE tbl_frage.gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)." AND demo "; if($row = $db->db_fetch_object($db->db_query($qry))) @@ -682,10 +682,11 @@ if($frage->frage_id!='') } } } - echo ' + echo ' '; echo "
"; + echo ''; echo '




'; } else @@ -694,7 +695,5 @@ else echo "

".$p->t("testtool/startDrueckenUmZuBeginnen")."
"; } ?> - - diff --git a/cis/testtool/login.php b/cis/testtool/login.php index f18aa4492..e42a623b2 100644 --- a/cis/testtool/login.php +++ b/cis/testtool/login.php @@ -56,7 +56,7 @@ if (isset($_GET['logout']) && $_GET['logout'] == true) echo ' '; @@ -326,12 +326,12 @@ if(isset($_POST['save']) && isset($_SESSION['prestudent_id'])) - + - - - - + + + +