diff --git a/.gitignore b/.gitignore index 269134a25..5d327cef7 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ tests/codeception/codeception.yml tests/codeception/tests/api.suite.yml tests/codeception/tests/functional.suite.yml tests/codeception/tests/acceptance.suite.yml +tests/codeception/tests/unit.suite.yml /submodules/d3 composer.lock bin diff --git a/.gitmodules b/.gitmodules index 0679e5b2c..41511b610 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "submodules/pivottable"] path = submodules/pivottable url = https://github.com/nicolaskruchten/pivottable.git -[submodule "submodules/angular-tablesort"] - path = vendor/FHC-vendor/angular-tablesort - url = https://github.com/mattiash/angular-tablesort.git diff --git a/CHANGELOG.md b/CHANGELOG.md index ad9601ddb..5a9a78ea3 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ ### Updateinfo - **[FAS]** Für Lehraufträge muss eine Unoconv-Vorlage erstellt werden, da der für xsl-fo notwendige Seitenumbruch-Tag aus dem RDF entfernt wurde. - **[FAS]** Mehrsprachigkeitsspalte tbl_status.bezeichnung_mehrsprachig wird durch das Updatescript automatisch in den ersten beiden Sprachen mit der status_kurzbz vorbefüllt. Übersetzungen sind anzupassen. +- **[MOODLE]** Neue Webservicefunktion core_user_update_users wird benötigt ## [3.1.0] - 2015-11-12 ### Added diff --git a/application/controllers/api/v1/Example.php b/application/controllers/api/v1/Example.php deleted file mode 100644 index ca6643e31..000000000 --- a/application/controllers/api/v1/Example.php +++ /dev/null @@ -1,150 +0,0 @@ -methods['user_get']['limit'] = 500; // 500 requests per hour per user/key - $this->methods['user_post']['limit'] = 100; // 100 requests per hour per user/key - $this->methods['user_delete']['limit'] = 50; // 50 requests per hour per user/key - } - - /** - * @return void - */ - public function users_get() - { - // Users from a data store e.g. database - $users = [ - ['id' => 1, 'name' => 'John', 'email' => 'john@example.com', 'fact' => 'Loves coding'], - ['id' => 2, 'name' => 'Jim', 'email' => 'jim@example.com', 'fact' => 'Developed on CodeIgniter'], - ['id' => 3, 'name' => 'Jane', 'email' => 'jane@example.com', 'fact' => 'Lives in the USA', ['hobbies' => ['guitar', 'cycling']]], - ]; - - $id = $this->get('id'); - - // If the id parameter doesn't exist return all the users - - if ($id === null) - { - // Check if the users data store contains users (in case the database result returns null) - if ($users) - { - // Set the response and exit - $this->response($users, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code - } - else - { - // Set the response and exit - $this->response([ - 'status' => false, - 'message' => 'No users were found' - ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code - } - } - - // Find and return a single record for a particular user. - - $id = (int)$id; - - // Validate the id. - if ($id <= 0) - { - // Invalid id, set the response and exit. - $this->response(null, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400) being the HTTP response code - } - - // Get the user from the array, using the id as key for retreival. - // Usually a model is to be used for this. - - $user = null; - - if (!empty($users)) - { - foreach ($users as $key => $value) - { - if (isset($value['id']) && $value['id'] === $id) - { - $user = $value; - } - } - } - - if (!empty($user)) - { - $this->set_response($user, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code - } - else - { - $this->set_response([ - 'status' => false, - 'message' => 'User could not be found' - ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code - } - } - - /** - * @return void - */ - public function users_post() - { - // $this->some_model->update_user( ... ); - $message = [ - 'id' => 100, // Automatically generated by the model - 'name' => $this->post('name'), - 'email' => $this->post('email'), - 'message' => 'Added a resource' - ]; - - $this->set_response($message, REST_Controller::HTTP_CREATED); // CREATED (201) being the HTTP response code - } - - /** - * @return void - */ - public function users_delete() - { - $id = (int)$this->get('id'); - - // Validate the id. - if ($id <= 0) - { - // Set the response and exit - $this->response(null, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400) being the HTTP response code - } - - // $this->some_model->delete_something($id); - $message = [ - 'id' => $id, - 'message' => 'Deleted the resource' - ]; - - // NO_CONTENT (204) being the HTTP response code - $this->set_response($message, REST_Controller::HTTP_NO_CONTENT); - } -} diff --git a/application/controllers/api/v1/Ping.php b/application/controllers/api/v1/Ping.php deleted file mode 100644 index a4ca0d4a1..000000000 --- a/application/controllers/api/v1/Ping.php +++ /dev/null @@ -1,56 +0,0 @@ -methods['ping_get']['limit'] = 500; // 500 requests per hour per user/key - } - - /** - * Responds to ping attempts of applications - * @return string JSON which acknowledges the ping attempt - * @example http://wsp.fortyseeds.at/backend/api/ping - */ - public function index_get() - { - $payload = [ - 'success' => true, - 'message' => 'ping received' - ]; - - // Set the response and exit - $this->response($payload, REST_Controller::HTTP_OK); - } -} diff --git a/application/controllers/api/v1/Test.php b/application/controllers/api/v1/Test.php index c036973f5..1b4dc5c82 100644 --- a/application/controllers/api/v1/Test.php +++ b/application/controllers/api/v1/Test.php @@ -25,7 +25,8 @@ class Test extends APIv1_Controller { $payload = [ 'success' => TRUE, - 'message' => 'API HTTP GET call test succeed' + 'message' => 'API HTTP GET call test succeed', + 'error' => 0 ]; $httpstatus = REST_Controller::HTTP_OK; $this->response($payload, $httpstatus); @@ -42,7 +43,8 @@ class Test extends APIv1_Controller { $payload = [ 'success' => TRUE, - 'message' => 'API HTTP POST call test succeed' + 'message' => 'API HTTP POST call test succeed', + 'error' => 0 ]; $httpstatus = REST_Controller::HTTP_OK; $this->response($payload, $httpstatus); diff --git a/application/libraries/MessageLib.php b/application/libraries/MessageLib.php index 6f7686161..41dd2cc40 100644 --- a/application/libraries/MessageLib.php +++ b/application/libraries/MessageLib.php @@ -837,7 +837,6 @@ class MessageLib { $this->ci->db->trans_rollback(); $result = $this->_error($result->msg, EXIT_ERROR); - break; } else { @@ -863,4 +862,4 @@ class MessageLib { return success($retval, $code, MessageLib::MSG_INDX_PREFIX); } -} \ No newline at end of file +} diff --git a/application/models/testtool/Kriterien_model.php b/application/models/testtool/Kriterien_model.php index cd9a7c874..83d0fb97c 100644 --- a/application/models/testtool/Kriterien_model.php +++ b/application/models/testtool/Kriterien_model.php @@ -9,6 +9,6 @@ class Kriterien_model extends DB_Model { parent::__construct(); $this->dbTable = 'testtool.tbl_kriterien'; - $this->pk = ''; + $this->pk = 'kategorie_kurzbz'; } } 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()
|
| - - + + + + |
'.$p->t("tools/partnerhochschulenEinleitung").'
'; + +$stg_kz = (isset($_GET['stg_kz'])?$_GET['stg_kz']:''); + +$firma = new firma(); +echo ''; + +if($stg_kz!='') +{ + $studiengaenge->load($stg_kz); + $firma->get_firmaorganisationseinheit('', $studiengaenge->oe_kurzbz, 'Partneruniversität'); +} +else +{ + if(!$firma->getFirmen('Partneruniversität', true)) + die($firma->errormsg); +} +if ($firma->result) +{ + echo '| '.$p->t("global/bezeichnung").' | + +|||
|---|---|---|---|
| ',$row->name,' | '; + /*echo ''.($row->content_id!=''?''.$row->bezeichnung.'':$row->bezeichnung).' | '; + echo '',$row->beschreibung,' | '; + echo ''.($row->content_id!=''?'Details':'').' | ';*/ + echo '
';
+ echo '
';
elseif($row['parent']->betrag>0)
{
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 '';
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 '| - | '.$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 ' | '; + + echo ''; + $beschreibung = $row->beschreibung[$sprache]; + if($beschreibung=='' && isset($row->beschreibung[DEFAULT_LANGUAGE])) + $beschreibung = $row->beschreibung[DEFAULT_LANGUAGE]; + echo 'verpflichtend=='t'?'style="background-color: #EF8A88"':'').'>'.$beschreibung.' | '; + echo ''.$datum_obj->formatDatum($row->deadline,'d.m.Y').' | '; + + // echo "".date('d.m.Y',$ts_now)." | "; + // echo "".date('d.m.Y',$ts_vorlaufzeit)." | "; + // echo "".date('d.m.Y',$ts_deadline)." | "; + echo '';
- if(!$bestaetigt)
- //echo ''.$p->t('tools/ampelBestaetigen').'';
- echo '';
- else
- //echo $p->t('tools/ampelBestaetigt');
- //echo ' ';
- echo '';
- 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 '|
';
+ 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 ' | '; + + echo ''; + $beschreibung = $row->beschreibung[$sprache]; + if($beschreibung=='' && isset($row->beschreibung[DEFAULT_LANGUAGE])) + $beschreibung = $row->beschreibung[DEFAULT_LANGUAGE]; + echo 'verpflichtend=='t'?'style="background-color: #EF8A88"':'').'>'.$beschreibung.' | '; + echo ''.$datum_obj->formatDatum($row->deadline,'d.m.Y').' | '; - echo ''; - $beschreibung = $row->beschreibung[$sprache]; - if($beschreibung=='' && isset($row->beschreibung[DEFAULT_LANGUAGE])) - $beschreibung = $row->beschreibung[DEFAULT_LANGUAGE]; - echo ''.$beschreibung.' | '; - echo ''.$datum_obj->formatDatum($row->deadline,'d.m.Y').' | '; - -// echo "".date('d.m.Y',$ts_now)." | "; -// echo "".date('d.m.Y',$ts_vorlaufzeit)." | "; -// echo "".date('d.m.Y',$ts_deadline)." | "; - echo '".date('d.m.Y',$ts_now)." | "; + // echo "".date('d.m.Y',$ts_vorlaufzeit)." | "; + // echo "".date('d.m.Y',$ts_deadline)." | "; + echo ''; + } } echo '