Merge remote-tracking branch 'origin/master'

This commit is contained in:
alex
2018-05-16 11:52:52 +02:00
18 changed files with 628 additions and 59 deletions
+3
View File
@@ -10,6 +10,8 @@ documents/
.project
.buildpath
application/config/development/
application/config/testing/
application/config/production
application/extensions/
application/controllers/extensions/
application/config/extensions/
@@ -30,3 +32,4 @@ tests/codeception/tests/acceptance.suite.yml
tests/codeception/tests/unit.suite.yml
/sparks/*
/webdav/google.php
system/sql/
+1 -1
View File
@@ -56,7 +56,7 @@ $config['roles'] = array
'basis/adresse','basis/akte','basis/kontakt','basis/log','basis/nation','basis/notiz','basis/notizzuordnung',
'basis/person','basis/prestudent','basis/prestudentstatus','basis/status','basis/zgv','basis/zgvmaster',
'lehre/studienplan','system/filters','fs/dms','basis/message','basis/benutzerrolle', 'basis/sprache',
'system/personlock','basis/benutzerfunktion','system/vorlagestudiengang'
'system/personlock','basis/benutzerfunktion','system/vorlagestudiengang', 'basis/bewerbungstermine'
)
)
);
+36
View File
@@ -4,6 +4,10 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
class FHC_Controller extends CI_Controller
{
const FHC_CONTROLLER_ID = 'fhc_controller_id'; // name of the parameter used to identify uniquely a call to a controller
private $_controllerId; // contains the unique identifier of a call to a controller
/**
* Standard construct for all the controllers, loads the authentication system
*/
@@ -11,6 +15,8 @@ class FHC_Controller extends CI_Controller
{
parent::__construct();
$this->_controllerId = null; // set _controllerId as null by default
$this->load->helper('fhcauth');
}
@@ -23,4 +29,34 @@ class FHC_Controller extends CI_Controller
{
$this->load->library('PhrasesLib', array($categories, $language), 'p');
}
/**
* Sets the unique id for the called controller
* NOTE: it is only working with HTTP GET request, not neeaded with POST
* because the first call to the controller is via HTTP GET,
* therefore a fhc_controller_id is already generated
*/
protected function setControllerId()
{
if ($_SERVER['REQUEST_METHOD'] === 'GET')
{
$this->_controllerId = $this->input->get(self::FHC_CONTROLLER_ID);
if (!isset($this->_controllerId) || empty($this->_controllerId))
{
$this->_controllerId = uniqid(); // generate a unique id
// Redirect to the same URL, but giving FHC_CONTROLLER_ID as HTTP GET parameter
header(sprintf('Location: %s?%s=%s', $_SERVER['REQUEST_URI'], self::FHC_CONTROLLER_ID, $this->_controllerId));
exit; // terminate immediately the execution of this controller
}
}
}
/**
* Return the value of the property _controllerId
*/
protected function getControllerId()
{
return $this->_controllerId;
}
}
+13 -2
View File
@@ -57,8 +57,19 @@ class DocumentLib
case 'application/vnd.ms-word':
case 'application/vnd.oasis.opendocument.text':
case 'text/plain':
$this->convert($filename, $outFile, 'pdf');
return success($outFile);
// Unoconv Version 0.6 seems to fail on converting TXT Files
if ($this->unoconv_version == '0.6')
return error();
$ret = $this->convert($filename, $outFile, 'pdf');
if(isSuccess($ret))
{
return success($outFile);
}
else
{
return error($ret->retval);
}
case 'application/pdf':
return success($filename);
default:
@@ -14,7 +14,7 @@
SELECT zeitpunkt
FROM system.tbl_log
WHERE taetigkeit_kurzbz IN(\'bewerbung\',\'kommunikation\')
AND logdata->>\'name\' NOT IN (\'Login with code\', \'New application\')
AND logdata->>\'name\' NOT IN (\'Login with code\', \'New application\', \'Interessent rejected\')
AND person_id = p.person_id
ORDER BY zeitpunkt DESC
LIMIT 1
@@ -23,7 +23,7 @@
SELECT insertvon
FROM system.tbl_log
WHERE taetigkeit_kurzbz IN(\'bewerbung\',\'kommunikation\')
AND logdata->>\'name\' NOT IN (\'Login with code\', \'New application\')
AND logdata->>\'name\' NOT IN (\'Login with code\', \'New application\', \'Interessent rejected\')
AND person_id = p.person_id
ORDER BY zeitpunkt DESC
LIMIT 1
+17 -10
View File
@@ -2,7 +2,7 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
// Retrives the URL path of the called controller + controller method
// Retrives the URL path of the called controller + called controller method
// NOTE: placed here because it doesn't work inside functions
$calledPath = $this->router->directory.$this->router->class;
$calledMethod = $this->router->method;
@@ -15,6 +15,7 @@ $customJSs = isset($customJSs) ? $customJSs : null;
// By default set the parameters to false
$jquery = isset($jquery) ? $jquery : false;
$jqueryui = isset($jqueryui) ? $jqueryui : false;
$ajaxlib = isset($ajaxlib) ? $ajaxlib : false;
$bootstrap = isset($bootstrap) ? $bootstrap : false;
$fontawesome = isset($fontawesome) ? $fontawesome : false;
$tablesorter = isset($tablesorter) ? $tablesorter : false;
@@ -141,12 +142,15 @@ function _generateAddonsJSsInclude($calledFrom)
// jQuery UI CSS
if ($jqueryui === true) _generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css');
// bootstrap CSS
// Bootstrap CSS
if ($bootstrap === true) _generateCSSsInclude('vendor/twbs/bootstrap/dist/css/bootstrap.min.css');
// font awesome CSS
// Font Awesome CSS
if ($fontawesome === true) _generateCSSsInclude('vendor/components/font-awesome/css/font-awesome.min.css');
// AjaxLib CSS
if ($ajaxlib === true) _generateCSSsInclude('public/css/AjaxLib.css');
// Table sorter CSS
if ($tablesorter === true)
{
@@ -154,7 +158,7 @@ function _generateAddonsJSsInclude($calledFrom)
_generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css');
}
// sb admin template CSS
// SB Admin 2 template CSS
if ($sbadmintemplate === true)
{
_generateCSSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.css');
@@ -164,10 +168,11 @@ function _generateAddonsJSsInclude($calledFrom)
// Eventually required CSS
_generateCSSsInclude($customCSSs); // Eventually required CSS
// --------------------------------------------------------------------------------------------------------
// Javascripts
// Generates the global object to pass useful parms to the other javascripts
// Generates the global object to pass useful parameters to other javascripts
// NOTE: must be called before any other JS include
_generateJSDataStorageObject($calledPath, $calledMethod);
@@ -178,11 +183,13 @@ function _generateAddonsJSsInclude($calledFrom)
if ($jqueryui === true)
{
_generateJSsInclude('vendor/components/jqueryui/jquery-ui.min.js');
//datepicker german language file
_generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js');
_generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); // datepicker german language file
}
// bootstrap JS
// AjaxLib JS
if ($ajaxlib === true) _generateJSsInclude('public/js/AjaxLib.js');
// Bootstrap JS
if ($bootstrap === true) _generateJSsInclude('vendor/twbs/bootstrap/dist/js/bootstrap.min.js');
// Table sorter JS
@@ -193,10 +200,10 @@ function _generateAddonsJSsInclude($calledFrom)
_generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js');
}
//tinymce JS
// Tinymce JS
if($tinymce === true) _generateJSsInclude('vendor/tinymce/tinymce/tinymce.min.js') ;
// sb admin template JS
// SB Admin 2 template JS
if ($sbadmintemplate === true)
{
_generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/vendor/metisMenu/metisMenu.min.js');
+6 -6
View File
@@ -288,10 +288,6 @@ else
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/student/rdf#matrikelnummer" onclick="StudentTreeSort()"/>
<splitter class="tree-splitter"/>
<treecol id="student-treecol-prestudent_id" label="PreStudentID" flex="1" hidden="false" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/student/rdf#prestudent_id" onclick="StudentTreeSort()"/>
<splitter class="tree-splitter"/>
<treecol id="student-treecol-person_id" label="PersonID" flex="1" hidden="false" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/student/rdf#person_id" onclick="StudentTreeSort()"/>
@@ -379,7 +375,11 @@ else
<treecol id="student-treecol-studienplan" label="Studienplan" flex="1" hidden="false" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/student/rdf#studienplan_bezeichnung" onclick="StudentTreeSort()"/>
<splitter class="tree-splitter"/>
<splitter class="tree-splitter"/>
<treecol id="student-treecol-prestudent_id" label="PreStudentID" flex="1" hidden="false" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/student/rdf#prestudent_id" onclick="StudentTreeSort()"/>
<splitter class="tree-splitter"/>
<treecol id="student-treecol-mentor" label="Mentor" flex="1" hidden="true" persist="hidden, width, ordinal"
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/student/rdf#mentor" onclick="StudentTreeSort()"/>
@@ -414,7 +414,6 @@ else
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#studiengang" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#studiengang_kz" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#matrikelnummer" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#prestudent_id" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#person_id" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#status" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#status_datum" />
@@ -439,6 +438,7 @@ else
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#dual_bezeichnung" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#matr_nr" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#studienplan_bezeichnung" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#prestudent_id" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#mentor" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#aktiv" />
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/student/rdf#aktiv" label="rdf:http://www.technikum-wien.at/student/rdf#geburtsdatum_iso" />
+13 -8
View File
@@ -832,16 +832,21 @@ class dokument extends basis_db
if($result = $this->db_query($qry))
{
while($row = $this->db_fetch_object($result))
if ($this->db_num_rows($result) > 0)
{
$stg_obj = new basis_db();
$stg_obj->kuerzel = $row->kuerzel;
$stg_obj->bezeichnung = $row->bezeichnung;
$stg_obj->studiengang_kz = $row->studiengang_kz;
$this->result[] = $stg_obj;
while($row = $this->db_fetch_object($result))
{
$stg_obj = new basis_db();
$stg_obj->kuerzel = $row->kuerzel;
$stg_obj->bezeichnung = $row->bezeichnung;
$stg_obj->studiengang_kz = $row->studiengang_kz;
$this->result[] = $stg_obj;
}
return $stg_obj;
}
return $stg_obj;
else
return false;
}
else
{
+32 -7
View File
@@ -45,13 +45,13 @@ class personlog extends basis_db
/**
* Erstellt einen Log Eintrag zu einer Person
* @param $person_id ID der Person.
* @param $logtype_kurzbz Typ des Logeintrages
* @param $logdata Array mit den zusaetzlichen Logdaten zu diesem Typ.
* @param $taetigkeit_kurzbz Kurzbz der Verarbeitungstaetigkeit.
* @param $app Applikation von der dieser Logeintrag stammt.
* @param $oe_kurzbz Kurzbz der Organisationseinheit. (optional)
* @param $user User der die Aktion durchgefuehrt hat. (optional)
* @param integer $person_id ID der Person.
* @param string $logtype_kurzbz Typ des Logeintrages
* @param array $logdata Array mit den zusaetzlichen Logdaten zu diesem Typ.
* @param string $taetigkeit_kurzbz Kurzbz der Verarbeitungstaetigkeit.
* @param string $app Applikation von der dieser Logeintrag stammt.
* @param string $oe_kurzbz Kurzbz der Organisationseinheit. (optional)
* @param string $user User der die Aktion durchgefuehrt hat. (optional)
* @return boolean true wenn erfolgreich, false im Fehlerfall.
*/
public function log($person_id, $logtype_kurzbz, $logdata, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
@@ -77,5 +77,30 @@ class personlog extends basis_db
return false;
}
}
/**
* Löscht alle Logeinträge vom Typ "Precessstate" mit Namen "Parked" der übergebenen Person_id, die in der Zukunft liegen.
* @param integer $person_id ID der Person, deren geparkter Logeintrag gelöscht werden soll.
* @return boolean true wenn erfolgreich, false im Fehlerfall.
*/
public function deleteParked($person_id)
{
$qry = "DELETE
FROM system.tbl_log
WHERE logtype_kurzbz = 'Processstate'
AND person_id = ".$this->db_add_param($person_id)."
AND logdata ->> 'name' = 'Parked'
AND zeitpunkt >= now();";
if($this->db_query($qry))
{
return true;
}
else
{
$this->errormsg = 'Fehler beim Löschen des geparkten Logeintrages';
return false;
}
}
}
?>
+16 -3
View File
@@ -634,24 +634,37 @@ or not exists
FROM
lehre.tbl_lehreinheitmitarbeiter m,
lehre.tbl_lehreinheit l
JOIN
lehre.tbl_lehrveranstaltung lv using (lehrveranstaltung_id)
JOIN
public.tbl_studiengang s using (studiengang_kz)
WHERE
$where AND
$where_sem AND
l.lehreinheit_id = m.lehreinheit_id AND
m.stundensatz * m.semesterstunden > 0
m.stundensatz * m.semesterstunden > 0 AND
s.typ not in ('l') AND
lv.studiengang_kz > 0
UNION
SELECT sum(pb.stunden) AS semstunden
FROM
lehre.tbl_projektarbeit pa,
lehre.tbl_projektbetreuer pb,
lehre.tbl_lehreinheit l,
public.tbl_benutzer b
public.tbl_benutzer b,
lehre.tbl_lehreinheit l
JOIN
lehre.tbl_lehrveranstaltung lv using (lehrveranstaltung_id)
JOIN
public.tbl_studiengang s using (studiengang_kz)
WHERE
pa.lehreinheit_id = l.lehreinheit_id AND
pb.projektarbeit_id = pa.projektarbeit_id AND
pb.person_id = b.person_id AND
b.uid = ".$this->db_add_param($user)." AND
pb.stunden * pb.stundensatz > 0 AND
s.typ not in ('l') AND
lv.studiengang_kz > 0 AND
$where_sem
) AS semstunden
";
View File
+14
View File
@@ -0,0 +1,14 @@
.veil {
position: absolute;
top: 0;
left: 0;
height: 98%;
width: 99%;
background-color: white;
border-width: 1px;
border-style: solid;
border-color: black;
background-image: url("/public/imgages/loader.gif");
background-repeat: no-repeat;
background-position: center;
}
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+449
View File
@@ -0,0 +1,449 @@
/**
* FH-Complete
*
* @package
* @author
* @copyright Copyright (c) 2016 fhcomplete.org
* @license GPLv3
* @link https://fhcomplete.org
* @since Version 1.0.0
*/
//--------------------------------------------------------------------------------------------------------------------
// Configs
// To see debug messages into the browser console set this parameter as true
const DEBUG = false;
// Default veil timeout (milliseconds)
const VEIL_TIMEOUT = 1000;
//--------------------------------------------------------------------------------------------------------------------
// Constants
// Success
const SUCCESS = 0;
// Properties present in a response
const CODE = "error";
const RESPONSE = "retval";
// HTTP method parameters
const HTTP_GET_METHOD = "GET";
const HTTP_POST_METHOD = "POST";
const REMOTE_CONTROLLER = "remoteController";
const FHC_CONTROLLER_ID = "fhc_controller_id";
/**
* Definition and initialization of object FHC_Ajax_Client
*/
var FHC_Ajax_Client = {
//------------------------------------------------------------------------------------------------------------------
// Properties
_veilCallersCounter: 0, // count the number of callers that want to activate the veil
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Performs a call using the HTTP GET method
* controllerParameters is an object
* ajaxCallParameters is an object
*/
ajaxCallGet: function(remoteController, controllerParameters, ajaxCallParameters) {
FHC_Ajax_Client._ajaxCall(remoteController, controllerParameters, HTTP_GET_METHOD, ajaxCallParameters);
},
/**
* Performs a call using the HTTP POST method
* controllerParameters is an object
* ajaxCallParameters is an object
*/
ajaxCallPost: function(remoteController, controllerParameters, ajaxCallParameters) {
FHC_Ajax_Client._ajaxCall(remoteController, controllerParameters, HTTP_POST_METHOD, ajaxCallParameters);
},
/**
* Checks if the response is a success
*/
isSuccess: function(response) {
var isSuccess = false;
if (jQuery.type(response) == "object" && response.hasOwnProperty(CODE) && response.hasOwnProperty(RESPONSE))
{
if (response.error == SUCCESS)
{
isSuccess = true;
}
}
return isSuccess;
},
/**
* Checks if the response is an error
*/
isError: function(response) {
return !FHC_Ajax_Client.isSuccess(response);
},
/**
* Checks if the response has data
*/
hasData: function(response) {
var hasData = false;
if (FHC_Ajax_Client.isSuccess(response))
{
if ((jQuery.type(response.retval) == "object" && !jQuery.isEmptyObject(response.retval))
|| (jQuery.isArray(response.retval) && response.retval.length > 0)
|| (jQuery.type(response.retval) == "string" && response.retval.trim() != "")
|| jQuery.type(response.retval) == "number")
{
hasData = true;
}
}
return hasData;
},
/**
* Retrives data from response object
*/
getData: function(response) {
var data = null;
if (FHC_Ajax_Client.hasData(response))
{
data = response.retval;
}
return data;
},
/**
* Retrives code from response object
*/
getCode: function(response) {
var code = 1; // Generic error
if (jQuery.type(response) == "object" && response.hasOwnProperty(CODE))
{
if (response.error == SUCCESS)
{
isSuccess = true;
}
}
return code;
},
/**
* Show a veil
*/
showVeil: function(veilTimeout) {
if (typeof veilTimeout == "number")
{
FHC_Ajax_Client._veilTimeout = veilTimeout;
}
else
{
FHC_Ajax_Client._veilTimeout = VEIL_TIMEOUT;
}
FHC_Ajax_Client._showVeil();
},
/**
* Hide a veil that was shown before
*/
hideVeil: function() {
FHC_Ajax_Client._hideVeil();
},
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Generate the router URI using the connection parameters
*/
_generateRouterURI: function(remoteController) {
var uri = null;
// Checks if global JS object FHC_JS_DATA_STORAGE_OBJECT exists
if (typeof FHC_JS_DATA_STORAGE_OBJECT !== "undefined")
{
uri = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/" + remoteController;
}
return uri;
},
/**
* Method to print debug info after a controller has been called
*/
_printDebug: function(parameters, response, errorThrown) {
if (DEBUG === true) // If global const DEBUG is true, but really true!
{
// Print info about called controller
console.log("Called controller: " + parameters.remoteController);
console.log("Call parameters:"); // parameters given to this call
console.log(parameters);
if (response != null) // if there is a response...
{
console.log("Controller Response:");
console.log(response); // ...print it
}
if (errorThrown != null) // if there is a jQuery error...
{
console.log("jQuery error:");
console.log(errorThrown); // ...print it
}
console.log("--------------------------------------------------------------------------------------------");
}
},
/**
* Method to call if the ajax call has succeeded
*/
_onSuccess: function(response, textStatus, jqXHR) {
FHC_Ajax_Client._printDebug(this._data, response); // debug time!
// Call the success callback saved in _successCallback property
// NOTE: this is not referred to FHC_Ajax_Client but to the ajax object
this._successCallback(response);
},
/**
* Method to call if the ajax call has raised an error
*/
_onError: function(jqXHR, textStatus, errorThrown) {
FHC_Ajax_Client._printDebug(this._data, null, errorThrown); // debug time!
// Call the error callback saved in _errorCallback property
// NOTE: this is not referred to FHC_Ajax_Client but to the ajax object
this._errorCallback(jqXHR, textStatus, errorThrown);
},
/**
* Instantiate a new object and copy in it the properties from the parameter
*/
_cpObjProps: function(obj) {
var returnObj = {};
for (var prop in obj)
{
returnObj[prop] = obj[prop];
}
return returnObj;
},
/**
* Method to show the veil
*/
_showVeil: function() {
if (FHC_Ajax_Client._veilCallersCounter == 0)
{
$("<div class=\"veil\"></div>").appendTo('body');
}
FHC_Ajax_Client._veilCallersCounter++;
},
/**
* Method to hide the veil
*/
_hideVeil: function() {
window.setTimeout(function() {
if (FHC_Ajax_Client._veilCallersCounter >= 0)
{
if (FHC_Ajax_Client._veilCallersCounter > 0)
{
FHC_Ajax_Client._veilCallersCounter--;
}
if (FHC_Ajax_Client._veilCallersCounter == 0)
{
$(".veil").remove();
}
}
},
this._veilTimeout);
},
/**
* Retrives parameters from URL query string (HTTP GET parameters)
*/
_getUrlParameter: function(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++)
{
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam)
{
return sParameterName[1];
}
}
},
/**
* Checks call parameters, if they are present and are valid
* It generates and returns all the parameters needed to perform an ajax remote call
* NOTE: console.error is used here because those are not messages for the final user,
* but for the web interface developer
*/
_checkAndGenerateAjaxParams: function(remoteController, controllerParameters, type, ajaxCallParameters) {
var valid = true; // by default they are ok (we want to trust you, please do not betray it)
// Returned parameters
var ajaxParameters = {
cache: false, // data are never cached by the browser
dataType: "json", // always json!
type: type // set HTTP method, GET or POST
};
// remoteController must be a NON-empty string
if (typeof remoteController == "string" && remoteController.trim() != "")
{
// Is it possible to generate the URL
if ((url = FHC_Ajax_Client._generateRouterURI(remoteController)) != null)
{
ajaxParameters.url = url;
}
else // but it could fail
{
console.error("FHC_JS_DATA_STORAGE_OBJECT is not present");
valid = false;
}
}
else // otherwise is NOT possible to generate the URL
{
console.error("Invalid remoteController parameter");
valid = false;
}
// controllerParameters must be an object
if (typeof controllerParameters == "object")
{
// Copy the properties of controllerParameters into a new object
var data = FHC_Ajax_Client._cpObjProps(controllerParameters);
// Remote controller
data[REMOTE_CONTROLLER] = remoteController;
// fhc_controller_id is given if present
data[FHC_CONTROLLER_ID] = FHC_Ajax_Client._getUrlParameter(FHC_CONTROLLER_ID);
// Stores them into ajaxParameters
// NOTE: property data is not possible to get later,
// so the variable data is saved also in _data and it will be used later
ajaxParameters.data = data;
ajaxParameters._data = data;
}
else
{
console.error("Invalid controller parameters, must be an object");
valid = false;
}
// Checks if ajaxCallParameters is an object
if (typeof ajaxCallParameters == "object")
{
// If present, errorCallback must be a function
if (ajaxCallParameters.hasOwnProperty("errorCallback"))
{
if (typeof ajaxCallParameters.errorCallback == "function")
{
ajaxParameters._errorCallback = ajaxCallParameters.errorCallback; // save as property the callback error
ajaxParameters.error = FHC_Ajax_Client._onError; // function to call if an error occurred
}
else
{
console.error("Invalid errorCallback, it must be a function");
valid = false;
}
}
// If present, successCallback must be a function
if (ajaxCallParameters.hasOwnProperty("successCallback"))
{
if (typeof ajaxCallParameters.successCallback == "function")
{
ajaxParameters._successCallback = ajaxCallParameters.successCallback; // save as property the callback success
ajaxParameters.success = FHC_Ajax_Client._onSuccess; // function to call if succeeded
}
else
{
console.error("Invalid successCallback, it must be a function");
valid = false;
}
}
// If present, veilTimeout must be a number and cannot be less then 0 or greater then 60000
if (ajaxCallParameters.hasOwnProperty("veilTimeout") && typeof ajaxCallParameters.veilTimeout == "number")
{
if (ajaxCallParameters.veilTimeout > 0 && ajaxCallParameters.veilTimeout < 60000)
{
ajaxParameters._veilTimeout = ajaxCallParameters.veilTimeout;
ajaxParameters.beforeSend = FHC_Ajax_Client._showVeil;
ajaxParameters.complete = FHC_Ajax_Client._hideVeil;
}
else if(ajaxCallParameters.veilTimeout == 0)
{
// veil is disabled
}
else
{
console.error("Invalid veilTimeout parameter, must be a number >= 0 and <= 60000");
valid = false;
}
}
else // is not present or the value is invalid
{
ajaxParameters._veilTimeout = VEIL_TIMEOUT;
ajaxParameters.beforeSend = FHC_Ajax_Client._showVeil;
ajaxParameters.complete = FHC_Ajax_Client._hideVeil;
}
}
if (valid === false)
{
ajaxParameters = null;
}
return ajaxParameters;
},
/**
* Performs a call to the server were the CI PHP layer is running
* - remoteController: alias of the core controller to call
* - controllerParameters: parameters to give to the called controller
* - type: POST or GET HTTP method
* - ajaxCallParameters is an object and could contains:
* - errorCallback: function to call after an error has been raised
* - successCallback: function to call after succeeded
* - veilTimeout: veil timeout
*/
_ajaxCall: function(remoteController, controllerParameters, type, ajaxCallParameters) {
// Retrives the parameters for the ajax call
var ajaxParameters = FHC_Ajax_Client._checkAndGenerateAjaxParams(remoteController, controllerParameters, type, ajaxCallParameters);
// Checks the given parameters if they are present and are valid
if (ajaxParameters != null)
{
$.ajax(ajaxParameters); // ajax call
}
}
};
+4 -6
View File
@@ -1,10 +1,8 @@
/*
file for adding bootstrap classes, e.g. in case usage of non-bootstrap widgets in a bootstrap page
AVOID USING THIS IF POSSIBLE
/**
* To add bootstrap classes, e.g. in case usage of non-bootstrap widgets in a bootstrap page
* NOTE: avoid using this if possible
*/
$(document).ready(
function()
{
$(document).ready(function() {
$("input[type=text], select").addClass("form-control");
$("button, input[type=button]").addClass("btn btn-default");
$("table").addClass("table-condensed");
+8 -3
View File
@@ -94,6 +94,7 @@ if (($files = glob($slq_import_path.'/*.sql')) != false)
{
$mailcontent .= '<h3>Die Abfrage der Datei "'.$filename.'" hat folgenden Fehler geliefert:</h3>';
$mailcontent .= '<span class="error">'.$db->db_last_error () . '</span><br>';
$mailcontent .= '<pre>'.$sql.'</pre><br>';
continue;
}
@@ -101,18 +102,22 @@ if (($files = glob($slq_import_path.'/*.sql')) != false)
if ($db->db_num_rows($result) > 0)
{
$mailcontent .= '<h3>Die Abfrage der Datei "'.$filename.'" hat folgendes Ergebnis geliefert:</h3>';
// Wenn zu viele Datensätze retourniert werden, abbrechen und Meldung ausgeben
if ($db->db_num_rows($result) > 1000)
$mailcontent .= '<span class="error">ACHTUNG! Es wurden mehr als 1000 Datensätze zurückgegeben</span><br>';
$mailcontent .= '<table class="table"><thead><tr>';
foreach($db->db_fetch_object($result) AS $key => $value)
$array = array();
$object = $db->db_fetch_object($result);
$row_array = get_object_vars($object);
foreach($row_array AS $key => $value)
{
$mailcontent .= '<th>'.$key.'</th>';
continue;
}
$mailcontent .= '</tr></thead><tbody>';
$counter = 0; // Wenn mehr als 1000 Datensätze retourniert werden, abbrechen
$result = $db->db_query ($sql);
while($row = $db->db_fetch_object($result))
{
if ($counter == 1000)
@@ -126,7 +131,7 @@ if (($files = glob($slq_import_path.'/*.sql')) != false)
$mailcontent .= '</tr>';
$counter++;
}
$mailcontent .= '</tr></tbody></table>';
$mailcontent .= '</tbody></table>';
}
}
}
+14 -11
View File
@@ -49,7 +49,7 @@ $rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('assistenz'))
die('Sie haben keine Berechtigung fuer diese Seite');
die($rechte->errormsg);
if(isset($_GET['studiengang_kz']))
$stg_kz = $_GET['studiengang_kz'];
@@ -62,7 +62,7 @@ if(isset($_GET['action']) && $_GET['action']=='save')
$studiengang = new studiengang();
$studiengang->load($studiengang_kz);
if(!$rechte->isBerechtigt('assistenz', $studiengang->oe_kurzbz, 'suid'))
die('Sie haben keine Berechtigung fuer diese Seite');
die($rechte->errormsg);
$bezeichnung = $_POST['bezeichnung'];
$english = $_POST['english'];
@@ -127,15 +127,18 @@ echo '<form method="GET">
Studiengang: <SELECT name="studiengang_kz">';
foreach($stg->result as $row)
{
if($stg_kz=='')
$stg_kz=$row->studiengang_kz;
if($stg_kz==$row->studiengang_kz)
$selected='selected';
else
$selected='';
echo '<OPTION value="'.$row->studiengang_kz.'" '.$selected.'>'.$row->kuerzel.' - '.$row->kurzbzlang.'</OPTION>';
if (in_array($row->studiengang_kz, $stg_arr))
{
if($stg_kz=='')
$stg_kz=$row->studiengang_kz;
if($stg_kz==$row->studiengang_kz)
$selected='selected';
else
$selected='';
echo '<OPTION value="'.$row->studiengang_kz.'" '.$selected.'>'.$row->kuerzel.' - '.$row->bezeichnung.'</OPTION>';
}
}
echo '</SELECT><input type="submit" value="Anzeigen" /></form>';