Merge branch 'master' into dbskel

This commit is contained in:
Paolo
2020-11-13 20:55:57 +01:00
172 changed files with 15744 additions and 6090 deletions
+7
View File
@@ -31,6 +31,13 @@ define('EXIT_VALIDATION_UDF_NOT_VALID_VAL', 17); // UDF validation has been fail
define('EXIT_AUTO_MIN', 1000); // lowest automatically-assigned error code
define('EXIT_AUTO_MAX', 2000); // highest automatically-assigned error code
/*
|--------------------------------------------------------------------------
| General purpose
|--------------------------------------------------------------------------
*/
define('BEGINNING_OF_TIME', '1970-01-01');
/*
|--------------------------------------------------------------------------
| Authentication constants
+14
View File
@@ -0,0 +1,14 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
// White list of permissions (write mode have to be set) that are able to store a specific job type in database
$config['job_type_permissions_white_list'] = array(
'SAPStammdatenUpdate' => array(
'admin:rw',
'developer:rw'
),
'OEHPayment' => 'developer:rw',
'SAPPayment' => 'developer:rw'
);
+7
View File
@@ -109,6 +109,13 @@ $config['navigation_header'] = array(
'expand' => true,
'sort' => 20,
'requiredPermissions' => 'system/developer:r'
),
'jobsqueueviewer' => array(
'link' => site_url('system/jq/JobsQueueViewer'),
'description' => 'Jobs Queue Viewer',
'expand' => true,
'sort' => 20,
'requiredPermissions' => 'system/developer:r'
)
)
)
+44 -43
View File
@@ -20,31 +20,31 @@ class LehrauftragJob extends JOB_Controller
{
const BERECHTIGUNG_LEHRAUFTRAG_ERTEILEN = 'lehre/lehrauftrag_erteilen';
const BERECHTIGUNG_LEHRAUFTRAG_AKZEPTIEREN = 'lehre/lehrauftrag_akzeptieren';
const LEHRAUFTRAG_ERTEILEN_URI = 'lehre/lehrauftrag/LehrauftragErteilen';
const LEHRAUFTRAG_AKZEPTIEREN_URI = '/lehre/lehrauftrag/LehrauftragAkzeptieren';
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
// Load models
$this->load->model('accounting/Vertrag_model', 'VertragModel');
$this->load->model('accounting/Vertragvertragsstatus_model', 'VertragvertragsstatusModel');
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
$this->load->model('system/Benutzerrolle_model', 'BenutzerrolleModel');
// Load libraries
$this->load->library('PermissionLib');
// Load helpers
$this->load->helper('hlp_sancho_helper');
}
/**
* This daily job sends information about all lehr-/projektauftraege ordered (and not approved) the day bofore.
* Receivers: Department-/Kompetenzfeldleiter
@@ -62,7 +62,7 @@ class LehrauftragJob extends JOB_Controller
foreach ($vertrag_arr as $vertrag)
{
$result = $this->VertragModel->getLehreinheitData($vertrag->vertrag_id, 'lehrveranstaltung_id, studiensemester_kurzbz');
if (hasData($result))
{
$obj = new StdClass();
@@ -72,7 +72,7 @@ class LehrauftragJob extends JOB_Controller
}
}
}
/**
* Build the data array to be used in the email. Data array is clustered as follows:
* Array
@@ -90,7 +90,7 @@ class LehrauftragJob extends JOB_Controller
foreach ($lehreinheit_data_arr as $lehreinheit_data)
{
$result = $this->_getLVData($lehreinheit_data->lehrveranstaltung_id);
if (hasData($result))
{
// Search if studiensemester exists in data_arr
@@ -102,12 +102,12 @@ class LehrauftragJob extends JOB_Controller
$data = array(
'studiensemester_kurzbz' => $lehreinheit_data->studiensemester_kurzbz
);
$data []= array(
'oe_kurzbz' => $result->retval[0]->oe_kurzbz,
'oe_bezeichnung' => $result->retval[0]->lv_oe_bezeichnung
);
// Add stg data to oe, start amount with 1
$data[0][] = array(
'stg_kz' => $result->retval[0]->studiengang_kz,
@@ -115,7 +115,7 @@ class LehrauftragJob extends JOB_Controller
'stg_bezeichnung' => $result->retval[0]->lv_stg_bezeichnung,
'amount' => 1
);
// Push to final data_arr
$data_arr []= $data;
}
@@ -124,7 +124,7 @@ class LehrauftragJob extends JOB_Controller
{
// Search if oe exists inside existing studiensemester of data_arr
$oe_index = array_search($result->retval[0]->oe_kurzbz, array_column($data_arr[$ss_index], 'oe_kurzbz'));
// If oe is new, add oe and stg to studiensemester
if ($oe_index === false)
{
@@ -132,7 +132,7 @@ class LehrauftragJob extends JOB_Controller
$data_arr[$ss_index][] = array(
'oe_kurzbz' => $result->retval[0]->oe_kurzbz,
'oe_bezeichnung' => $result->retval[0]->lv_oe_bezeichnung,
// Add stg data to oe, start amount with 1
array(
'stg_kz' => $result->retval[0]->studiengang_kz,
@@ -147,7 +147,7 @@ class LehrauftragJob extends JOB_Controller
{
// Search if stg exists inside existing oe of data_arr
$stg_index = array_search($result->retval[0]->studiengang_kz, array_column($data_arr[$ss_index][$oe_index], 'stg_kz'));
// If stg is new, add stg to oe, start amount with 1
if ($stg_index === false)
{
@@ -168,7 +168,7 @@ class LehrauftragJob extends JOB_Controller
}
}
}
/**
* Cluster data by uid of entitled mail receivers.
* Returning array is clustered as follows:
@@ -186,7 +186,7 @@ class LehrauftragJob extends JOB_Controller
* [amount] // amount of new ordered lehrauftraege of that stg
*/
$data_arr = $this->_clusterData_byReceiver($data_arr);
// Send email
if(!$this->_sendMail_toApprove($data_arr))
{
@@ -197,7 +197,7 @@ class LehrauftragJob extends JOB_Controller
$this->logError('Error when sending emails in job MailLehrauftragToApprove');
}
}
/**
* This daily job sends information about all lehr-/projektauftraege approved the day bofore.
* Receivers: lectors
@@ -208,7 +208,7 @@ class LehrauftragJob extends JOB_Controller
$this->VertragvertragsstatusModel->addSelect('vertrag_id, uid');
$this->VertragvertragsstatusModel->addOrder('uid');
$result = $this->VertragvertragsstatusModel->getApproved_fromDate('YESTERDAY');
/**
* Build the data array to be used in the email. Data array is clustered as follows:
* Array
@@ -228,10 +228,10 @@ class LehrauftragJob extends JOB_Controller
{
$studiensemester = $studiensemester[0]->vertragsstunden_studiensemester_kurzbz;
}
// Search if uid exists in data_arr
$uid_index = array_search($vertrag->uid, array_column($data_arr, 'uid'));
// If uid is new, add uid, studiensemester and start amount with 1
if ($uid_index === false)
{
@@ -249,7 +249,7 @@ class LehrauftragJob extends JOB_Controller
{
$data_arr[$uid_index]['studiensemester'] .= ' und '. $studiensemester;
}
// Increase amount +1
$data_arr[$uid_index]['amount']++;
}
@@ -266,11 +266,11 @@ class LehrauftragJob extends JOB_Controller
$this->logError('Error when sending emails in job MailLehrauftragToAccept');
}
}
//******************************************************************************************************************
// PRIVATE FUNCTIONS
//******************************************************************************************************************
/**
* Get data of given lehrveranstaltung.
* @param $lehrveranstaltung_id
@@ -286,7 +286,7 @@ class LehrauftragJob extends JOB_Controller
stg.typ AS "stg_typ",
stg.kurzbz AS "stg_kurzbz"
');
$this->LehrveranstaltungModel->addJoin('lehre.tbl_studienplan_lehrveranstaltung stpllv', 'lehrveranstaltung_id');
$this->LehrveranstaltungModel->addJoin('lehre.tbl_studienplan stpl', 'studienplan_id');
$this->LehrveranstaltungModel->addJoin('lehre.tbl_studienordnung sto', 'studienordnung_id');
@@ -294,10 +294,10 @@ class LehrauftragJob extends JOB_Controller
$this->LehrveranstaltungModel->addJoin('public.tbl_organisationseinheit oe', 'ON oe.oe_kurzbz = tbl_lehrveranstaltung.oe_kurzbz');
$this->LehrveranstaltungModel->addOrder('stpllv.insertamum', 'DESC');
$this->LehrveranstaltungModel->addLimit(1);
return $this->LehrveranstaltungModel->load($lehrveranstaltung_id);
}
/**
* Send Sancho eMail about ordered Lehrauftraege.
* @param $data_arr
@@ -310,12 +310,12 @@ class LehrauftragJob extends JOB_Controller
// Set mail recipients (department assistance/leader)
$to = $data['uid']. '@'. DOMAIN;
$html_table = $this->_renderData_LehrauftraegeToApprove($data);
// Prepare mail content
$content_data_arr = array(
'table' => $html_table
);
sendSanchoMail(
'LehrauftragNeueBestellungen',
$content_data_arr,
@@ -326,7 +326,7 @@ class LehrauftragJob extends JOB_Controller
);
}
}
/**
* Cluster the data array by entitled mail receiver.
* Returning array is clustered as follows:
@@ -409,7 +409,7 @@ class LehrauftragJob extends JOB_Controller
return $mail_data_arr;
}
/**
* Render the data array for the mail template returing a HTML table.
* @param $data_arr Data to be used in HTML table
@@ -425,11 +425,11 @@ class LehrauftragJob extends JOB_Controller
if (isset($studiensemester_container['studiensemester_kurzbz']))
{
$studiensemester = $studiensemester_container['studiensemester_kurzbz'];
// Link to LehrauftragErteilen
$url = site_url(self::LEHRAUFTRAG_ERTEILEN_URI).'?studiensemester='. $studiensemester;
}
// HTML table header
$html .= '
<br>
@@ -446,7 +446,7 @@ class LehrauftragJob extends JOB_Controller
</thead>
<tbody>'
;
// HTML table body
foreach ($studiensemester_container as $oe_container)
{
@@ -456,7 +456,7 @@ class LehrauftragJob extends JOB_Controller
{
$oe_bezeichnung = $oe_container['oe_bezeichnung'];
}
foreach ($oe_container as $stg_data)
{
if (is_array($stg_data)) // is_array 'trims' the outer associative keys [oe_kurzbz] and [oe_bezeichnung]
@@ -473,7 +473,7 @@ class LehrauftragJob extends JOB_Controller
}
}
}
// HTML table body end and link
$html .= '
</tbody>
@@ -484,10 +484,10 @@ class LehrauftragJob extends JOB_Controller
';
}
}
return $html;
}
/**
* Send Sancho eMail about ordered Lehrauftraege.
* @param $data_arr
@@ -499,24 +499,24 @@ class LehrauftragJob extends JOB_Controller
{
// Set mail recipient (lector)
$to = $data['uid']. '@'. DOMAIN;
// Link to LehrauftragAkzeptieren
$url = CIS_ROOT. 'cis/index.php?menu='.
CIS_ROOT. 'cis/menu.php?content_id=&content='.
CIS_ROOT. index_page(). self::LEHRAUFTRAG_AKZEPTIEREN_URI;
// Get first name
$first_name = '';
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$this->BenutzerModel->addSelect('vorname');
$this->BenutzerModel->addJoin('public.tbl_person', 'person_id');
$result = $this->BenutzerModel->loadWhere(array('uid' => $data['uid']));
if (hasData($result))
{
$first_name = $result->retval[0]->vorname;
}
// Prepare mail content
$content_data_arr = array(
'vorname' => $first_name,
@@ -524,7 +524,7 @@ class LehrauftragJob extends JOB_Controller
'anzahl' => $data['amount'],
'link' => anchor($url, 'Lehraufträge Übersicht')
);
sendSanchoMail(
'LehrauftragNeueErteilte',
$content_data_arr,
@@ -532,5 +532,6 @@ class LehrauftragJob extends JOB_Controller
'Neu erteilte Lehraufträge zum Annehmen bereit'
);
}
return true;
}
}
@@ -27,11 +27,11 @@ class OneTimeMessages extends JOB_Controller
* - Status set as "Wartender"
* - The given study course type (b = bachelor, m = master)
* - The given semester (ex WS2020)
* - How long since applicant (months)
* - How long since applicant (days)
* - The given template id to be used as message subject and body (vorlage_kurzbz)
* The sender of all the messages is specified by the parameter senderId (sender person_id)
*/
public function sendMessageToApplicantsStillWaiting($senderId, $studyCourseType, $semester, $months, $messageTemplate)
public function sendMessageToApplicantsStillWaiting($senderId, $studyCourseType, $semester, $days, $messageTemplate)
{
$this->logInfo('Send message to applicants still waiting start');
@@ -47,13 +47,13 @@ class OneTimeMessages extends JOB_Controller
$dbModel = new DB_Model();
$dbPrestudents = $dbModel->execReadOnlyQuery(
'SELECT p.prestudent_id
'SELECT distinct on(person_id) p.prestudent_id
FROM public.tbl_prestudent p
JOIN public.tbl_prestudentstatus ps USING (prestudent_id)
JOIN public.tbl_studiengang s USING (studiengang_kz)
WHERE ps.status_kurzbz = \'Wartender\'
AND ps.studiensemester_kurzbz = ?
AND ps.datum <= NOW() - \''.$months.' months\'::interval
AND ps.datum <= NOW() - \''.$days.' days\'::interval
AND s.typ = ?
AND NOT EXISTS (
SELECT pp.person_id
@@ -0,0 +1,232 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*/
class Pruefungsprotokoll extends Auth_Controller
{
private $_uid; // uid of the logged user
/**
* Constructor
*/
public function __construct()
{
// Set required permissions
parent::__construct(
array(
'index' => 'lehre/pruefungsbeurteilung:r',
'Protokoll' => 'lehre/pruefungsbeurteilung:r',
'saveProtokoll' => 'lehre/pruefungsbeurteilung:rw',
)
);
// Load models
$this->load->model('education/Abschlusspruefung_model', 'AbschlusspruefungModel');
$this->load->model('education/Abschlussbeurteilung_model', 'AbschlussbeurteilungModel');
$this->load->library('PermissionLib');
$this->load->library('AuthLib');
// Load language phrases
$this->loadPhrases(
array(
'ui',
'global',
'person',
'abschlusspruefung',
'password',
'lehre'
)
);
$this->_setAuthUID(); // sets property uid
$this->setControllerId(); // sets the controller id
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
public function index()
{
$this->load->library('WidgetLib');
// Protokolle anzeigen seit heute / letzte Woche / alle
$period = $this->input->post('period');
$period = (!is_null($period)) ? $period : 'today';
$data = array('period' => $period);
$this->load->view('lehre/pruefungsprotokollUebersicht.php', $data);
}
/**
* Show Pruefungsprotokoll.
*/
public function Protokoll()
{
$abschlusspruefung_id = $this->input->get('abschlusspruefung_id');
if (!is_numeric($abschlusspruefung_id))
show_error('invalid abschlusspruefung');
$abschlusspruefung_saved = false;
$abschlusspruefung = $this->_getAbschlusspruefungBerechtigt($abschlusspruefung_id);
if (isError($abschlusspruefung))
show_error(getError($abschlusspruefung));
else
{
$abschlusspruefung = getData($abschlusspruefung);
$abschlusspruefung_saved = isset($abschlusspruefung->protokoll) && isset($abschlusspruefung->abschlussbeurteilung_kurzbz);
}
$this->AbschlussbeurteilungModel->addOrder("sort", "ASC");
$this->AbschlussbeurteilungModel->addOrder("(CASE WHEN abschlussbeurteilung_kurzbz = 'ausgezeichnet' THEN 1
WHEN abschlussbeurteilung_kurzbz = 'gut' THEN 2
WHEN abschlussbeurteilung_kurzbz = 'bestanden' THEN 3
WHEN abschlussbeurteilung_kurzbz = 'angerechnet' THEN 4
ELSE 5
END
)");
$abschlussbeurteilung = $this->AbschlussbeurteilungModel->load();
if (isError($abschlussbeurteilung))
show_error(getError($abschlussbeurteilung));
else
$abschlussbeurteilung = getData($abschlussbeurteilung);
$language = getUserLanguage();
$data = array(
'abschlusspruefung' => $abschlusspruefung,
'abschlussbeurteilung' => $abschlussbeurteilung,
'abschlusspruefung_saved' => $abschlusspruefung_saved,
'language' => $language
);
$this->load->view('lehre/pruefungsprotokoll.php', $data);
}
/**
* Save Pruefungsprotokoll (including possible Freigabe)
*/
public function saveProtokoll()
{
$abschlusspruefung_id = $this->input->post('abschlusspruefung_id');
$freigebendata = $this->input->post('freigebendata');
$protocoldata = $this->input->post('protocoldata');
if (isset($abschlusspruefung_id) && is_numeric($abschlusspruefung_id)
&& isset($freigebendata['freigeben']) && isset($protocoldata))
{
// check permission
$berechtigt = $this->_getAbschlusspruefungBerechtigt($abschlusspruefung_id);
if (isError($berechtigt))
$this->outputJsonError(getError($berechtigt));
else
{
$freigabe = $freigebendata['freigeben'] === 'true';
if ($freigabe)
{
// Verify password
if (isset($freigebendata['password']) && !isEmptyString($freigebendata['password']))
{
$password = $freigebendata['password'];
$result = $this->authlib->checkUserAuthByUsernamePassword($this->_uid, $password);
if (isError($result))
{
return $this->outputJsonError($this->p->t('password', 'wrongPassword')); // exit if password is incorrect
}
}
else
{
return $this->outputJsonError($this->p->t('password', 'passwordMissing'));
}
}
$data = $this->_prepareAbschlusspruefungDataForSave($protocoldata, $freigabe);
$result = $this->AbschlusspruefungModel->update($abschlusspruefung_id, $data);
if (hasData($result))
{
$abschlusspruefung_id = getData($result);
$updateresult = array('abschlusspruefung_id' => $abschlusspruefung_id);
if ($freigabe)
$updateresult['freigabedatum'] = date_format(date_create($data['freigabedatum']), 'd.m.Y');
$this->outputJsonSuccess($updateresult);
}
else
$this->outputJsonError('Fehler beim Speichern des Prüfungsprotokolls');
}
}
else
$this->outputJsonError($this->p->t('ui', 'ungueltigeParameter'));
}
// -----------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Retrieve the UID of the logged user and checks if it is valid
*/
private function _setAuthUID()
{
$this->_uid = getAuthUID();
if (!$this->_uid) show_error('User authentification failed');
}
/**
* Retrieves an Abschlussprüfung, with permission check
* permission: admin, assistance of study programe or Vorsitz of the Prüfung
* @param $abschlusspruefung_id
* @return object success or error
*/
private function _getAbschlusspruefungBerechtigt($abschlusspruefung_id)
{
$result = error('Error when getting Abschlusspruefung');
if (isset($this->_uid))
{
$abschlusspruefung = $this->AbschlusspruefungModel->getAbschlusspruefung($abschlusspruefung_id);
if (hasData($abschlusspruefung))
{
$abschlusspruefung_data = getData($abschlusspruefung);
if ($this->permissionlib->isBerechtigt('admin') ||
(isset($abschlusspruefung_data->studiengang_kz) && $this->permissionlib->isBerechtigt('assistenz', 'suid', $abschlusspruefung_data->studiengang_kz))
|| $this->_uid === $abschlusspruefung_data->uid_vorsitz)
$result = $abschlusspruefung;
else
$result = error('Permission denied');
}
}
return $result;
}
/**
* Prepares Abschlussprüfung for save in database, replaces '' with null, sets Freigabedatum
* @param $data
* @return array
*/
private function _prepareAbschlusspruefungDataForSave($data, $freigabe)
{
$nullfields = array('uhrzeit', 'endezeit', 'abschlussbeurteilung_kurzbz', 'protokoll');
foreach ($data as $idx => $item)
{
if (in_array($idx, $nullfields) & $item === '')
$data[$idx] = null;
}
if ($freigabe === true)
$data['freigabedatum'] = date('Y-m-d');
return $data;
}
}
@@ -52,7 +52,8 @@ class Lehrauftrag extends Auth_Controller
array(
'global',
'ui',
'lehre'
'lehre',
'table'
)
);
@@ -8,180 +8,196 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
*/
class LehrauftragAkzeptieren extends Auth_Controller
{
const APP = 'lehrauftrag';
const LEHRAUFTRAG_URI = 'lehre/lehrauftrag/LehrauftragAkzeptieren'; // URL prefix for this controller
const BERECHTIGUNG_LEHRAUFTRAG_AKZEPTIEREN = 'lehre/lehrauftrag_akzeptieren';
const APP = 'lehrauftrag';
const LEHRAUFTRAG_URI = 'lehre/lehrauftrag/LehrauftragAkzeptieren'; // URL prefix for this controller
const BERECHTIGUNG_LEHRAUFTRAG_AKZEPTIEREN = 'lehre/lehrauftrag_akzeptieren';
private $_uid; // uid of the logged user
private $_uid; // uid of the logged user
/**
* Constructor
*/
public function __construct()
{
// Set required permissions
parent::__construct(
array(
'index' => 'lehre/lehrauftrag_akzeptieren:r',
'acceptLehrauftrag' => 'lehre/lehrauftrag_akzeptieren:rw',
/**
* Constructor
*/
public function __construct()
{
// Set required permissions
parent::__construct(
array(
'index' => 'lehre/lehrauftrag_akzeptieren:r',
'acceptLehrauftrag' => 'lehre/lehrauftrag_akzeptieren:rw',
'checkInkludierteLehre' => 'lehre/lehrauftrag_akzeptieren:rw'
)
);
)
);
// Load models
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$this->load->model('accounting/Vertrag_model', 'VertragModel');
$this->load->model('accounting/Vertragvertragsstatus_model', 'VertragvertragsstatusModel');
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('codex/Bisverwendung_model', 'BisverwendungModel');
$this->load->model('person/Benutzer_model', 'BenutzerModel');
// Load models
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$this->load->model('accounting/Vertrag_model', 'VertragModel');
$this->load->model('accounting/Vertragvertragsstatus_model', 'VertragvertragsstatusModel');
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('codex/Bisverwendung_model', 'BisverwendungModel');
$this->load->model('person/Benutzer_model', 'BenutzerModel');
// Load libraries
$this->load->library('WidgetLib');
$this->load->library('PermissionLib');
$this->load->library('AuthLib');
// Load libraries
$this->load->library('WidgetLib');
$this->load->library('PermissionLib');
$this->load->library('AuthLib');
// Load helpers
$this->load->helper('array');
$this->load->helper('url');
// Load helpers
$this->load->helper('array');
$this->load->helper('url');
// Load language phrases
$this->loadPhrases(
array(
'global',
'ui',
'lehre'
)
);
// Load language phrases
$this->loadPhrases(
array(
'global',
'ui',
'lehre',
'password',
'dms',
'table'
)
);
$this->_setAuthUID(); // sets property uid
$this->_setAuthUID(); // sets property uid
$this->setControllerId(); // sets the controller id
}
$this->setControllerId(); // sets the controller id
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Main page of Lehrauftrag
*/
public function index()
{
// Set studiensemester selected for studiengang dropdown
$studiensemester_kurzbz = $this->input->get('studiensemester'); // if provided by selected studiensemester
if (is_null($studiensemester_kurzbz)) // else set next studiensemester as default value
{
$studiensemester = $this->StudiensemesterModel->getAktOrNextSemester();
if (hasData($studiensemester))
{
$studiensemester_kurzbz = $studiensemester->retval[0]->studiensemester_kurzbz;
}
elseif (isError($studiensemester))
{
show_error(getError($studiensemester));
}
}
/**
* Main page of Lehrauftrag
*/
public function index()
{
// Set studiensemester selected for studiengang dropdown
$studiensemester_kurzbz = $this->input->get('studiensemester'); // if provided by selected studiensemester
if (is_null($studiensemester_kurzbz)) // else set next studiensemester as default value
{
$studiensemester = $this->StudiensemesterModel->getAktOrNextSemester();
if (hasData($studiensemester))
{
$studiensemester_kurzbz = $studiensemester->retval[0]->studiensemester_kurzbz;
}
elseif (isError($studiensemester))
{
show_error(getError($studiensemester));
}
}
$view_data = array(
'studiensemester_selected' => $studiensemester_kurzbz
);
// Check if user is external lector
$this->MitarbeiterModel->addJoin('public.tbl_benutzer', 'uid = mitarbeiter_uid');
$result = $this->MitarbeiterModel->loadWhere(array(
'uid' => $this->_uid,
'fixangestellt' => false,
'personalnummer > ' => 0,
'lektor' => true,
'aktiv' => true
));
$is_external_lector = hasData($result) ? true : false;
$view_data = array(
'studiensemester_selected' => $studiensemester_kurzbz,
'is_external_lector' => $is_external_lector
);
$this->load->view('lehre/lehrauftrag/acceptLehrauftrag.php', $view_data);
}
$this->load->view('lehre/lehrauftrag/acceptLehrauftrag.php', $view_data);
}
/**
* Set the contract status of Lehrauftrag to 'akzeptiert'.
* Performed on ajax call.
*/
public function acceptLehrauftrag()
{
// Verify password
$password = $this->input->post('password');
if (!isEmptyString($password))
{
$result = $this->authlib->checkUserAuthByUsernamePassword($this->_uid, $password);
if (isError($result))
{
return $this->outputJsonError('Passwort ist inkorrekt'); // exit if password is incorrect
}
}
else
{
/**
* Set the contract status of Lehrauftrag to 'akzeptiert'.
* Performed on ajax call.
*/
public function acceptLehrauftrag()
{
// Verify password
$password = $this->input->post('password');
if (!isEmptyString($password))
{
$result = $this->authlib->checkUserAuthByUsernamePassword($this->_uid, $password);
if (isError($result))
{
return $this->outputJsonError('Passwort ist inkorrekt'); // exit if password is incorrect
}
}
else
{
return $this->outputJsonError('Passwort fehlt');
}
}
// Loop through lehraufträge
$lehrauftrag_arr = $this->input->post('selected_data');
// Loop through lehraufträge
$lehrauftrag_arr = $this->input->post('selected_data');
if(is_array($lehrauftrag_arr))
{
foreach($lehrauftrag_arr as $lehrauftrag)
{
$vertrag_id = (!is_null($lehrauftrag['vertrag_id'])) ? $lehrauftrag['vertrag_id'] : null;
if(is_array($lehrauftrag_arr))
{
foreach($lehrauftrag_arr as $lehrauftrag)
{
$vertrag_id = (!is_null($lehrauftrag['vertrag_id'])) ? $lehrauftrag['vertrag_id'] : null;
// Check if user is entitled to accept this Lehrauftrag
// * first retrieve person_id of the contract
$this->VertragModel->addSelect('person_id');
// Check if user is entitled to accept this Lehrauftrag
// * first retrieve person_id of the contract
$this->VertragModel->addSelect('person_id');
if ($result = getData($this->VertragModel->load($vertrag_id)))
{
// * then find the uid of that contracts person_id
$this->BenutzerModel->addSelect('uid');
if ($result = getData($this->VertragModel->load($vertrag_id)))
{
// * then find the uid of that contracts person_id
$this->BenutzerModel->addSelect('uid');
if ($result = getData($this->BenutzerModel->getFromPersonId($result[0]->person_id)))
{
// * finally check uid of contract against the logged in user
if ($result = getData($this->BenutzerModel->getFromPersonId($result[0]->person_id)))
{
// * finally check uid of contract against the logged in user
$account_found = false;
foreach($result as $row_accounts)
foreach ($result as $row_accounts)
{
if($row_accounts->uid == $this->_uid)
if ($row_accounts->uid == $this->_uid)
{
$account_found = true;
}
}
if (!$account_found)
{
if (!$account_found)
{
return $this->outputJsonError('Sie haben keine Berechtigung für einen Vertrag');
}
}
else
{
}
}
else
{
return $this->outputJsonError('Fehler beim Laden der Benutzerdaten');
}
}
else
{
}
}
else
{
return $this->outputJsonError('Fehler beim Laden des Vertrags');
}
}
// Set status to accepted
$result = $this->VertragvertragsstatusModel->setStatus($vertrag_id, $this->_uid, 'akzeptiert');
// Set status to accepted
$result = $this->VertragvertragsstatusModel->setStatus($vertrag_id, $this->_uid, 'akzeptiert');
if ($result->retval)
{
$json []= array(
'row_index' => $lehrauftrag['row_index'],
'akzeptiert' => date('Y-m-d')
);
}
if ($result->retval)
{
$json []= array(
'row_index' => $lehrauftrag['row_index'],
'akzeptiert' => date('Y-m-d')
);
}
else
{
return $this->outputJsonError($result->retval);
}
}
}
// Output json to ajax
if (isset($json) && !isEmptyArray($json))
{
$this->outputJsonSuccess($json);
}
}
// Output json to ajax
if (isset($json) && !isEmptyArray($json))
{
$this->outputJsonSuccess($json);
}
}
else
{
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
}
}
}
/**
* Check if lectors latest Verwendung has inkludierte Lehre
@@ -189,7 +205,7 @@ class LehrauftragAkzeptieren extends Auth_Controller
* - inkludierte_lehre -1: fix employed lector -> has inkludierte Lehre (all inclusive)
* - inkludierte_lehre > 0: fix employed lector -> has inkludierte Lehre (value is amount of hours included)
*/
public function checkInkludierteLehre()
public function checkInkludierteLehre()
{
$result = $this->BisverwendungModel->getLast($this->_uid, false);
@@ -203,17 +219,17 @@ class LehrauftragAkzeptieren extends Auth_Controller
}
}
// -----------------------------------------------------------------------------------------------------------------
// Private methods
// -----------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Retrieve the UID of the logged user and checks if it is valid
*/
private function _setAuthUID()
{
$this->_uid = getAuthUID();
/**
* Retrieve the UID of the logged user and checks if it is valid
*/
private function _setAuthUID()
{
$this->_uid = getAuthUID();
if (!$this->_uid) show_error('User authentification failed');
}
if (!$this->_uid) show_error('User authentification failed');
}
}
@@ -50,7 +50,8 @@ class LehrauftragErteilen extends Auth_Controller
array(
'global',
'ui',
'lehre'
'lehre',
'table'
)
);
+8 -83
View File
@@ -7,60 +7,34 @@ class FAS_UDF extends Auth_Controller
const FAS_UDF_SESSION_NAME = 'fasUdfSessionName';
public function __construct()
{
parent::__construct(
{
parent::__construct(
array(
'index' => 'basis/person:r',
'saveUDF' => 'basis/person:rw'
)
);
$this->load->model('person/Person_model', 'PersonModel');
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
}
}
/**
*
*/
public function index()
{
$fasUdfSession = getSession(self::FAS_UDF_SESSION_NAME);
$person_id = $this->input->get('person_id');
if (isset($fasUdfSession['person_id']))
{
if (!isset($person_id))
{
$person_id = $fasUdfSession['person_id'];
}
unset($fasUdfSession['person_id']);
}
$prestudent_id = $this->input->get('prestudent_id');
if (isset($fasUdfSession['prestudent_id']))
{
if (!isset($prestudent_id))
{
$prestudent_id = $fasUdfSession['prestudent_id'];
}
unset($fasUdfSession['prestudent_id']);
}
$result = null;
if (isset($fasUdfSession['result']))
{
$result = clone $fasUdfSession['result'];
setSessionElement(self::FAS_UDF_SESSION_NAME, 'result', null);
}
$data = array('result' => $result);
$data = array();
if (isset($person_id) && is_numeric($person_id))
{
if ($this->PersonModel->hasUDF())
{
$personUdfs = $this->PersonModel->getUDFs($person_id);
$personUdfs['person_id'] = $person_id;
$data['person_id'] = $person_id;
$data['personUdfs'] = $personUdfs;
}
}
@@ -70,61 +44,12 @@ class FAS_UDF extends Auth_Controller
if ($this->PrestudentModel->hasUDF())
{
$prestudentUdfs = $this->PrestudentModel->getUDFs($prestudent_id);
$prestudentUdfs['prestudent_id'] = $prestudent_id;
$data['prestudent_id'] = $prestudent_id;
$data['prestudentUdfs'] = $prestudentUdfs;
}
}
$this->load->view('system/fas_udf', $data);
}
/**
*
*/
public function saveUDF()
{
$udfs = $this->input->post();
$validation = $this->_validate($udfs);
$userdata = array(
'person_id' => $this->input->post('person_id'),
'prestudent_id' => $this->input->post('prestudent_id')
);
if (isSuccess($validation))
{
// Load model UDF_model
$this->load->model('system/FAS_UDF_model', 'FASUDFModel');
$result = $this->FASUDFModel->saveUDFs($udfs);
$userdata['result'] = $result;
}
else
{
$userdata['result'] = $validation;
}
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');
}
/**
*
*/
private function _validate($udfs)
{
$validation = error('person_id or prestudent_id is missing');
if((isset($udfs['person_id']) && !(is_null($udfs['person_id'])) && ($udfs['person_id'] != ''))
|| (isset($udfs['prestudent_id']) && !(is_null($udfs['prestudent_id'])) && ($udfs['prestudent_id'] != '')))
{
$validation = success(true);
}
return $validation;
}
}
@@ -35,7 +35,7 @@ class LogsViewer extends Auth_Controller
// Public methods
/**
* Main page of the InfoCenter tool
* Everything has a beginning
*/
public function index()
{
@@ -1337,7 +1337,7 @@ class InfoCenter extends Auth_Controller
show_error(getError($prestudentWithZgv));
}
$zgvpruefung = $prestudentWithZgv->retval[0];
$zgvpruefung = getData($prestudentWithZgv);
if (isset($zgvpruefung->prestudentstatus))
{
@@ -1362,11 +1362,15 @@ class InfoCenter extends Auth_Controller
$zgvpruefung->isRtFreigegeben = false;
$zgvpruefung->isStgFreigegeben = false;
$zgvpruefung->sendStgFreigabeMsg = true;//wether Stgudiengangfreigabemessage can be sent (for "exceptions", Studiengänge with no message sending)
$this->PrestudentstatusModel->addSelect('bestaetigtam, statusgrund_id, tbl_status_grund.bezeichnung_mehrsprachig AS bezeichnung_statusgrund');
$this->PrestudentstatusModel->addJoin('public.tbl_status_grund', 'statusgrund_id', 'LEFT');
$isFreigegeben = $this->PrestudentstatusModel->loadWhere(array('studiensemester_kurzbz' => $zgvpruefung->prestudentstatus->studiensemester_kurzbz,
'tbl_prestudentstatus.status_kurzbz' => self::INTERESSENTSTATUS, 'prestudent_id' => $prestudent->prestudent_id));
$isFreigegeben = null;
if (isset($zgvpruefung->prestudentstatus->studiensemester_kurzbz))
{
$this->PrestudentstatusModel->addSelect('bestaetigtam, statusgrund_id, tbl_status_grund.bezeichnung_mehrsprachig AS bezeichnung_statusgrund');
$this->PrestudentstatusModel->addJoin('public.tbl_status_grund', 'statusgrund_id', 'LEFT');
$isFreigegeben = $this->PrestudentstatusModel->loadWhere(array('studiensemester_kurzbz' => $zgvpruefung->prestudentstatus->studiensemester_kurzbz,
'tbl_prestudentstatus.status_kurzbz' => self::INTERESSENTSTATUS, 'prestudent_id' => $prestudent->prestudent_id));
}
if (hasData($isFreigegeben))
{
@@ -1537,9 +1541,10 @@ class InfoCenter extends Auth_Controller
show_error(getError($prestudent));
}
$person_id = $prestudent->retval[0]->person_id;
$studiengang_kurzbz = $prestudent->retval[0]->studiengang;
$studiengang_bezeichnung = $prestudent->retval[0]->studiengangbezeichnung;
$prestudentdata = getData($prestudent);
$person_id = $prestudentdata->person_id;
$studiengang_kurzbz = $prestudentdata->studiengang;
$studiengang_bezeichnung = $prestudentdata->studiengangbezeichnung;
return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung);
}
@@ -1582,7 +1587,8 @@ class InfoCenter extends Auth_Controller
private function _sendFreigabeMail($prestudent_id)
{
//get data
$prestudent = $this->PrestudentModel->getPrestudentWithZgv($prestudent_id)->retval[0];
$prestudent = $this->PrestudentModel->getPrestudentWithZgv($prestudent_id);
$prestudent = getData($prestudent);
$prestudentstatus = $prestudent->prestudentstatus;
$person_id = $prestudent->person_id;
$person = $this->PersonModel->getPersonStammdaten($person_id, true)->retval;
@@ -0,0 +1,130 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller acts as REST JSON interface between the JobsQueueLib, that contains all the needed functionalities to
* operate with the Jobs Queue System, and other tools that cannot access directly to such library
*/
class JobsQueueManager extends Auth_Controller
{
// Config entry name for White list of permissions...
const JOB_TYPE_PERMISSIONS_WHITE_LIST = 'job_type_permissions_white_list';
// Parameter names
const PARAM_JOBS = 'jobs';
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'getLastJobs' => 'admin:r',
'addNewJobsToQueue' => 'admin:rw',
'updateJobsQueue' => 'admin:rw'
)
);
// Loading config file jqm
$this->config->load('jqm');
// Loads JobsQueueLib
$this->load->library('JobsQueueLib');
// Loads permission lib
$this->load->library('PermissionLib');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* To get all the most recently added jobs using the given job type
*/
public function getLastJobs()
{
$type = $this->input->get(JobsQueueLib::PROPERTY_TYPE);
$this->_checkPermissions($type);
$this->outputJson($this->jobsqueuelib->getLastJobs($type));
}
/**
* Add new jobs in the jobs queue with the given type
* jobs is an array of job objects
*/
public function addNewJobsToQueue()
{
$type = $this->input->post(JobsQueueLib::PROPERTY_TYPE);
$jobs = $this->input->post(self::PARAM_JOBS);
$this->_checkPermissions($type);
// Otherwise convert jobs from json to php and call JobsQueueLib library
$this->outputJson($this->jobsqueuelib->addNewJobsToQueue($type, $this->_convertJobs($jobs)));
}
/**
* Add new jobs in the jobs queue with the given type
* jobs is an array of job objects
*/
public function updateJobsQueue()
{
$type = $this->input->post(JobsQueueLib::PROPERTY_TYPE);
$jobs = $this->input->post(self::PARAM_JOBS);
$this->_checkPermissions($type);
// Otherwise convert jobs from json to php and call JobsQueueLib library
$this->outputJson($this->jobsqueuelib->updateJobsQueue($type, $this->_convertJobs($jobs)));
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
*
*/
private function _checkPermissions($type)
{
// Checks if the caller has the permissions to add new jobs with the given type in the queue
if (!$this->permissionlib->isEntitled($this->config->item(self::JOB_TYPE_PERMISSIONS_WHITE_LIST), $type))
{
// Permissions NOT valid
$this->terminateWithJsonError('You are not allowed to access to this content');
}
}
/**
*
*/
private function _convertJobs($jobs)
{
if (isEmptyArray($jobs)) return null; // if not a valid array then return null
$convertedJobsArray = array(); // returned values
// Loops through all the provided jobs
foreach ($jobs as $job)
{
$tmpObj = json_decode($job); // Try to decode json to php
// If decode was a success
if ($tmpObj != null)
{
$convertedJobsArray[] = $tmpObj; // then store the decoded object in the result array
}
else // otherwise
{
// Create a new object and store the error message in it
$tmpObj = new stdClass();
$tmpObj->{JobsQueueLib::PROPERTY_ERROR} = 'A not valid json was provided';
$convertedJobsArray[] = $tmpObj; // store this object into the result array
}
}
return $convertedJobsArray;
}
}
@@ -0,0 +1,51 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Jobs Queue Viewer
*
* This controller renders a FilterWidget to monitor the current status of the Jobs Queue System
*/
class JobsQueueViewer extends Auth_Controller
{
const PARAM_START_DATE = 'startDate';
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'index' => 'system/developer:r'
)
);
// Loads WidgetLib
$this->load->library('WidgetLib');
// Loads JobsQueueLib
$this->load->library('JobsQueueLib');
// Loads phrases system
$this->loadPhrases(
array(
'global',
'ui',
'filter'
)
);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Everything has a beginning
*/
public function index()
{
$this->load->view('system/jq/jobsQueueViewer.php');
}
}
+2 -2
View File
@@ -4,7 +4,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the FilterWidgetLib (back-end)
* Provides data to the ajax get calls about the filter
* Provides data to the ajax get calls about the filter widget
* Accepts ajax post calls to change the filter data
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
* NOTE: extends the FHC_Controller instead of the Auth_Controller because the FilterWidget has its
@@ -12,7 +12,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
*/
class Filters extends FHC_Controller
{
const FILTER_UNIQUE_ID = 'filterUniqueId';
const FILTER_UNIQUE_ID = 'filterUniqueId'; // Name of the filter widget unique id
/**
* Calls the parent's constructor and loads the FilterWidgetLib
+2 -2
View File
@@ -4,7 +4,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the tablewidgetlib (back-end)
* Provides data to the ajax get calls about the filter
* Provides data to the ajax get calls about the table widget
* Accepts ajax post calls to change the filter data
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
* NOTE: extends the FHC_Controller instead of the Auth_Controller because the TableWidget has its
@@ -12,7 +12,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
*/
class Tables extends FHC_Controller
{
const TABLE_UNIQUE_ID = 'tableUniqueId';
const TABLE_UNIQUE_ID = 'tableUniqueId'; // Name of the table widget unique id
/**
* Calls the parent's constructor and loads the tablewidgetlib
+107
View File
@@ -0,0 +1,107 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the UDFLib (back-end)
* Provides data to the ajax get calls about the UDF widget
* Accepts ajax post calls to save UDFs
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
* NOTE: extends the FHC_Controller instead of the Auth_Controller because the UDFWidget has its
* own permissions check
*/
class UDF extends FHC_Controller
{
const UDF_UNIQUE_ID = 'udfUniqueId'; // Name of the udf widget unique id
/**
* Calls the parent's constructor and loads the UDFLib
*/
public function __construct()
{
parent::__construct();
// Loads authentication library and starts authentication
$this->load->library('AuthLib');
// Loads the UDFLib with HTTP GET/POST parameters
$this->_loadUDFLib();
// Checks if the caller is allow to use this UDF widget
$this->_isAllowed();
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Save data about the current UDFs and the result will be written on the output in JSON format
*/
public function saveUDFs()
{
$udfUniqueId = $this->input->post(self::UDF_UNIQUE_ID);
$udfs = $this->input->post(UDFLib::UDFS_ARG_NAME);
if (!isEmptyString($udfs))
{
$jsonDecodedUDF = json_decode($udfs);
if ($jsonDecodedUDF != null)
{
$this->outputJson($this->udflib->saveUDFs($udfUniqueId, $jsonDecodedUDF));
}
else
{
$this->outputJsonError('No valid JSON format for UDF values');
}
}
else
{
$this->outputJsonError('UDFUniqueId, schema, table name, primary key name and primary key value are mandatory paramenters');
}
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Checks if the user is allowed to use this UDFWidget
*/
private function _isAllowed()
{
if (!$this->udflib->isAllowed())
{
$this->terminateWithJsonError('You are not allowed to access to this content');
}
}
/**
* Loads the UDFLib with the UDF_UNIQUE_ID parameter
* If the parameter UDF_UNIQUE_ID is not given then the execution of the controller is terminated and
* an error message is printed
*/
private function _loadUDFLib()
{
// If the parameter UDF_UNIQUE_ID is present in the HTTP GET or POST
if (isset($_GET[self::UDF_UNIQUE_ID]) || isset($_POST[self::UDF_UNIQUE_ID]))
{
// If it is present in the HTTP GET
if (isset($_GET[self::UDF_UNIQUE_ID]))
{
$udfUniqueId = $this->input->get(self::UDF_UNIQUE_ID); // is retrieved from the HTTP GET
}
elseif (isset($_POST[self::UDF_UNIQUE_ID])) // Else if it is present in the HTTP POST
{
$udfUniqueId = $this->input->post(self::UDF_UNIQUE_ID); // is retrieved from the HTTP POST
}
// Loads the UDFLib that contains all the used logic
$this->load->library('UDFLib');
$this->udflib->setUDFUniqueId($udfUniqueId);
}
else // Otherwise an error will be written in the output
{
$this->terminateWithJsonError('Parameter "'.self::UDF_UNIQUE_ID.'" not provided!');
}
}
}
+5 -3
View File
@@ -3,7 +3,8 @@
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
*
* This is the super class for all those controllers that can only be called from command line
* It provides also an helper to display the possible calls
*/
abstract class CLI_Controller extends FHC_Controller
{
@@ -15,9 +16,9 @@ abstract class CLI_Controller extends FHC_Controller
/**
* Constructor
*/
public function __construct()
public function __construct()
{
parent::__construct();
parent::__construct();
// Checks if the controller is called from command line
$this->_isAllowed();
@@ -103,3 +104,4 @@ abstract class CLI_Controller extends FHC_Controller
}
}
}
+17 -3
View File
@@ -60,6 +60,20 @@ class DB_Model extends CI_Model
// ------------------------------------------------------------------------------------------
// Public methods
/**
* This method provides a way to setup a database model without declaring one that extends this class
*/
public function setup($schema, $table, $primaryKey, $hasSequence = true)
{
//
if (!isEmptyString($schema) && !isEmptyString($table) && !isEmptyString($primaryKey) && is_bool($hasSequence))
{
$this->dbTable = $schema.'.'.$table;
$this->pk = $primaryKey;
$this->hasSequence = $hasSequence;
}
}
/**
* Insert Data into DB-Table
*
@@ -690,7 +704,7 @@ class DB_Model extends CI_Model
*/
public function hasUDF()
{
if($this->fieldExists(UDFLib::COLUMN_NAME))
if ($this->fieldExists(UDFLib::COLUMN_NAME))
{
$resultUDFsDefinitions = $this->UDFModel->getUDFsDefinitions($this->dbTable);
if (hasData($resultUDFsDefinitions))
@@ -727,8 +741,8 @@ class DB_Model extends CI_Model
$cleanedQuery = trim(preg_replace('/\t|\n|\r|;/', '', $query)); //
//
if (stripos($cleanedQuery, 'SELECT') == 0
&& (stripos($cleanedQuery, 'INSERT') > 0 || stripos($cleanedQuery, 'INSERT') == false)
if (
(stripos($cleanedQuery, 'INSERT') > 0 || stripos($cleanedQuery, 'INSERT') == false)
&& (stripos($cleanedQuery, 'UPDATE') > 0 || stripos($cleanedQuery, 'UPDATE') == false)
&& (stripos($cleanedQuery, 'CREATE') > 0 || stripos($cleanedQuery, 'CREATE') == false)
&& (stripos($cleanedQuery, 'DELETE') > 0 || stripos($cleanedQuery, 'DELETE') == false)
+30 -19
View File
@@ -3,26 +3,36 @@
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
*
* This is the super class for a job.
* All the controllers that extends this class can only be called from command line.
* Provides utility methods to log into database
*/
abstract class JOB_Controller extends CLI_Controller
{
/**
* Constructor
*/
public function __construct()
public function __construct()
{
parent::__construct();
parent::__construct();
// Loads LogLib with different debug trace levels to get data of the job that extends this class
// It also specify parameters to set database fields
$this->load->library('LogLib', array(
'classIndex' => 5,
'functionIndex' => 5,
'lineIndex' => 4,
'dbLogType' => 'job', // required
'dbExecuteUser' => 'Cronjob system'
));
$this->load->library(
'LogLib',
array(
'classIndex' => 5,
'functionIndex' => 5,
'lineIndex' => 4,
'dbLogType' => 'job', // required
'dbExecuteUser' => 'Cronjob system',
'requestId' => 'JOB',
'requestDataFormatter' => function($data) {
return json_encode($data);
}
),
'LogLibJob' // library alias case sensitive
);
}
//------------------------------------------------------------------------------------------------------------------
@@ -33,7 +43,7 @@ abstract class JOB_Controller extends CLI_Controller
*/
protected function logInfo($response, $parameters = null)
{
$this->_log(LogLib::INFO, 'Cronjob info', $response, $parameters);
$this->_log(LogLib::INFO, $response, $parameters);
}
/**
@@ -41,7 +51,7 @@ abstract class JOB_Controller extends CLI_Controller
*/
protected function logDebug($response, $parameters = null)
{
$this->_log(LogLib::DEBUG, 'Cronjob debug', $response, $parameters);
$this->_log(LogLib::DEBUG, $response, $parameters);
}
/**
@@ -49,7 +59,7 @@ abstract class JOB_Controller extends CLI_Controller
*/
protected function logWarning($response, $parameters = null)
{
$this->_log(LogLib::WARNING, 'Cronjob warning', $response, $parameters);
$this->_log(LogLib::WARNING, $response, $parameters);
}
/**
@@ -57,7 +67,7 @@ abstract class JOB_Controller extends CLI_Controller
*/
protected function logError($response, $parameters = null)
{
$this->_log(LogLib::ERROR, 'Cronjob error', $response, $parameters);
$this->_log(LogLib::ERROR, $response, $parameters);
}
//------------------------------------------------------------------------------------------------------------------
@@ -66,7 +76,7 @@ abstract class JOB_Controller extends CLI_Controller
/**
* Writes a log to database
*/
private function _log($level, $requestId, $response, $parameters)
private function _log($level, $response, $parameters)
{
$data = new stdClass();
@@ -76,17 +86,18 @@ abstract class JOB_Controller extends CLI_Controller
switch($level)
{
case LogLib::INFO:
$this->loglib->logInfoDB($requestId, json_encode(success($data, LogLib::INFO)));
$this->LogLibJob->logInfoDB($data);
break;
case LogLib::DEBUG:
$this->loglib->logDebugDB($requestId, json_encode(success($data, LogLib::DEBUG)));
$this->LogLibJob->logDebugDB($data);
break;
case LogLib::WARNING:
$this->loglib->logWarningDB($requestId, json_encode(error($data, LogLib::WARNING)));
$this->LogLibJob->logWarningDB($data);
break;
case LogLib::ERROR:
$this->loglib->logErrorDB($requestId, json_encode(error($data, LogLib::ERROR)));
$this->LogLibJob->logErrorDB($data);
break;
}
}
}
+129
View File
@@ -0,0 +1,129 @@
<?php
if (!defined("BASEPATH")) exit("No direct script access allowed");
/**
* Job Queue Worker
*
* This controller acts as interface of the JobsQueueLib that contains
* all the needed functionalities to operate with the Jobs Queue System
* This is an abstract class that provide basic functionalities,
* it has to be extended to broaden its logic
*/
abstract class JQW_Controller extends JOB_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
// Changes the needed configs for LogLib
$this->LogLibJob->setConfigs(
array(
'dbExecuteUser' => 'Jobs queue system',
'requestId' => 'JQW'
)
);
// Loads JobsQueueLib library
$this->load->library('JobsQueueLib');
}
//------------------------------------------------------------------------------------------------------------------
// Protected methods
/**
* To get all the most recently added jobs using the given job type
*/
protected function getLastJobs($type)
{
$jobs = $this->jobsqueuelib->getLastJobs($type);
// If an error occurred then log it in database
if (isError($jobs)) $this->logError(getError($jobs), $type);
return $jobs;
}
/**
* To get all the jobs specified by the given parameters
*/
protected function getJobsByTypeStatusInput($type, $status, $input)
{
$jobs = $this->jobsqueuelib->getJobsByTypeStatusInput($type, $status, $input);
// If an error occurred then log it in database
if (isError($jobs)) $this->logError(getError($jobs), array($type, $status, $input));
return $jobs;
}
/**
* Add new jobs in the jobs queue with the given type
* jobs is an array of job objects
*/
protected function addNewJobsToQueue($type, $jobs)
{
$result = $this->jobsqueuelib->addNewJobsToQueue($type, $jobs);
// If an error occurred then log it in database
if (isError($result)) $this->logError(getError($result), $type);
return $result;
}
/**
* Updates jobs already present in the jobs queue
* jobs is an array of job objects
*/
protected function updateJobsQueue($type, $jobs)
{
$result = $this->jobsqueuelib->updateJobsQueue($type, $jobs);
// If an error occurred then log it in database
if (isError($result)) $this->logError(getError($result), $type);
return $result;
}
/**
* Utility method to update the specified properties of the given jobs with the given values
*/
protected function updateJobs($jobs, $properties, $values)
{
// If not valid arrays of properties and values arrays are not of the same size then exit
if (isEmptyArray($jobs) || isEmptyArray($properties) || isEmptyArray($values)) return;
if (count($properties) != count($values)) return;
// For each job
foreach ($jobs as $job)
{
// For each propery of the job
for ($pI = 0; $pI < count($properties); $pI++)
{
// If this property is present in the job object
if (property_exists($job, $properties[$pI]))
{
$job->{$properties[$pI]} = $values[$pI]; // set a new value
}
}
}
}
/**
* Utility method to generate a job with the given parameters and return it inside an array
* ready to be used by addNewJobsToQueue and updateJobsQueue
*/
protected function generateJobs($status, $input)
{
$job = new stdClass();
$job->{JobsQueueLib::PROPERTY_STATUS} = $status;
$job->{JobsQueueLib::PROPERTY_INPUT} = $input;
return array($job);
}
}
+42
View File
@@ -301,3 +301,45 @@ function isLogged()
return isset($ci->authlib) && $ci->authlib->getAuthObj() != null;
}
/**
* Konvertiert Problematische Sonderzeichen in Strings fuer
* Accountnamen und EMail-Aliase
*
* @param $str
* @return bereinigter String
*/
function sanitizeProblemChars($str)
{
$enc = 'UTF-8';
$acentos = array(
'A' => '/&Agrave;|&Aacute;|&Acirc;|&Atilde;|&Aring;/',
'Ae' => '/&Auml;/',
'a' => '/&agrave;|&aacute;|&acirc;|&atilde;|&aring;/',
'ae'=> '/&auml;/',
'C' => '/&Ccedil;/',
'c' => '/&ccedil;/',
'E' => '/&Egrave;|&Eacute;|&Ecirc;|&Euml;/',
'e' => '/&egrave;|&eacute;|&ecirc;|&euml;/',
'I' => '/&Igrave;|&Iacute;|&Icirc;|&Iuml;/',
'i' => '/&igrave;|&iacute;|&icirc;|&iuml;/',
'N' => '/&Ntilde;/',
'n' => '/&ntilde;/',
'O' => '/&Ograve;|&Oacute;|&Ocirc;|&Otilde;/',
'Oe' => '/&Ouml;/',
'o' => '/&ograve;|&oacute;|&ocirc;|&otilde;/',
'oe' => '/&ouml;/',
'U' => '/&Ugrave;|&Uacute;|&Ucirc;/',
'Ue' => '/&Uuml;/',
'u' => '/&ugrave;|&uacute;|&ucirc;/',
'ue' => '/&uuml;/',
'Y' => '/&Yacute;/',
'y' => '/&yacute;|&yuml;/',
'a.' => '/&ordf;/',
'o.' => '/&ordm;/',
'ss' => '/&szlig;/'
);
return preg_replace($acentos, array_keys($acentos), htmlentities($str,ENT_NOQUOTES, $enc));
}
@@ -69,6 +69,8 @@ function generateCSSsInclude($CSSs)
*/
function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
{
$user_language = getUserLanguage();
$toPrint = "\n";
$toPrint .= '<script type="text/javascript">';
$toPrint .= '
@@ -35,6 +35,12 @@ function getUserLanguage($language = null)
{
$language = $_SESSION[LANG_SESSION_CURRENT_LANGUAGE]; // then use it
}
// Else if the language is present in the cookie and it is valid
elseif (isset($_COOKIE[LANG_SESSION_CURRENT_LANGUAGE]) && !isEmptyString($_COOKIE[LANG_SESSION_CURRENT_LANGUAGE]))
{
$language = $_COOKIE[LANG_SESSION_CURRENT_LANGUAGE];
}
// Otherwise checks if the user is authenticated to retrieve the users's language
// NOTE: this helper could be called when the user is NOT logged in the system
// therefore is checked if the user is logged
+10 -4
View File
@@ -93,6 +93,8 @@ class FilterWidgetLib
const OP_NOT_SET = 'nset';
// Filter options values
const OPT_MINUTES = 'minutes';
const OPT_HOURS = 'hours';
const OPT_DAYS = 'days';
const OPT_MONTHS = 'months';
@@ -884,8 +886,10 @@ class FilterWidgetLib
// It it's a date type
if (is_numeric($filterDefinition->condition)
&& isset($filterDefinition->option)
&& ($filterDefinition->option == self::OPT_DAYS
|| $filterDefinition->option == self::OPT_MONTHS))
&& ($filterDefinition->option == self::OPT_HOURS
|| $filterDefinition->option == self::OPT_DAYS
|| $filterDefinition->option == self::OPT_MONTHS
|| $filterDefinition->option == self::OPT_MINUTES))
{
$condition = '< (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)';
}
@@ -899,8 +903,10 @@ class FilterWidgetLib
// It it's a date type
if (is_numeric($filterDefinition->condition)
&& isset($filterDefinition->option)
&& ($filterDefinition->option == self::OPT_DAYS
|| $filterDefinition->option == self::OPT_MONTHS))
&& ($filterDefinition->option == self::OPT_HOURS
|| $filterDefinition->option == self::OPT_DAYS
|| $filterDefinition->option == self::OPT_MONTHS
|| $filterDefinition->option == self::OPT_MINUTES))
{
$condition = '> (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)';
}
+370
View File
@@ -0,0 +1,370 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Library that contains all the needed functionalities to operate with the Jobs Queue System
*/
class JobsQueueLib
{
// Job statuses
const STATUS_NEW = 'new';
const STATUS_RUNNING = 'running';
const STATUS_DONE = 'done';
const STATUS_FAILED = 'failed';
// Job object properties
const PROPERTY_JOBID = 'jobid';
const PROPERTY_CREATIONTIME = 'creationtime';
const PROPERTY_TYPE = 'type';
const PROPERTY_STATUS = 'status';
const PROPERTY_INPUT = 'input';
const PROPERTY_OUTPUT = 'output';
const PROPERTY_START_TIME = 'starttime';
const PROPERTY_END_TIME = 'endtime';
const PROPERTY_ERROR = 'error';
private $_ci; // CI instance
/**
* Constructor
*/
public function __construct($authenticate = true)
{
// Gets CI instance
$this->_ci =& get_instance();
// Loads all needed models
$this->_ci->load->model('system/JobsQueue_model', 'JobsQueueModel');
$this->_ci->load->model('system/JobTypes_model', 'JobTypesModel');
$this->_ci->load->model('system/JobStatuses_model', 'JobStatusesModel');
$this->_ci->load->model('system/JobTriggers_model', 'JobTriggersModel');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* To get all the most recently added jobs using the given job type
*/
public function getLastJobs($type)
{
$this->_ci->JobsQueueModel->resetQuery();
$this->_ci->JobsQueueModel->addOrder('creationtime', 'DESC');
return $this->_ci->JobsQueueModel->loadWhere(array('status' => self::STATUS_NEW, 'type' => $type));
}
/**
* To get all the jobs specified by the given parameters
*/
public function getJobsByTypeStatusInput($type, $status, $input)
{
$this->_ci->JobsQueueModel->resetQuery();
$this->_ci->JobsQueueModel->addOrder('creationtime', 'DESC');
return $this->_ci->JobsQueueModel->loadWhere(array('status' => $status, 'type' => $type, 'input' => $input));
}
/**
* Add new jobs in the jobs queue with the given type
* jobs is an array of job objects
*/
public function addNewJobsToQueue($type, $jobs)
{
// Checks parameters
if (isEmptyString($type)) return error('The provided type parameter is not a valid string');
if (isEmptyArray($jobs)) return error('The provided jobs parameter is not a valid array');
// Get all the job types
$dbResult = $this->_ci->JobTypesModel->load();
if (isError($dbResult)) return $dbResult;
$types = getData($dbResult);
// If the given type is not present in database
if (!$this->_checkJobType($type, $types)) return error('The provided type parameter is not valid');
$results = $jobs; // returned values
$errorOccurred = false; // very optimistic
// Get all the job statuses
$dbResult = $this->_ci->JobStatusesModel->load();
if (isError($dbResult)) return $dbResult;
$statuses = getData($dbResult);
// Loops through all the provided jobs
foreach ($results as $job)
{
// If the structure of the job object is valid AND the type is valid AND the status is valid
if ($this->_checkNewJobStructure($job) && $this->_checkJobStatus($job, $statuses))
{
$this->_dropNotAllowedPropertiesNewJob($job); // remove the black listed properties from this object
$job->{self::PROPERTY_TYPE} = $type; // What you asked is what you get!
// Try to insert the single job into database
$dbNewJobResult = $this->_ci->JobsQueueModel->insert($job);
// If an error occurred during while inserting in database
if (isError($dbNewJobResult))
{
$job->{self::PROPERTY_ERROR} = getError($dbNewJobResult); // retrieve the cause and store it in job object
$errorOccurred = true; // set error occurred flag
}
else // otherwise
{
$job->{self::PROPERTY_JOBID} = getData($dbNewJobResult); // get the jobid and store it in job object
$dbNewTriggeredJobResult = $this->_addNewTriggeredJobToQueue($type, $job, array(self::STATUS_NEW));
// If an error occurred during while inserting in database
if (isError($dbNewTriggeredJobResult)) return $dbNewTriggeredJobResult;
}
}
else // otherwise
{
$errorOccurred = true; // set error occurred flag
}
}
// If an error occurred then returns the results in an error object
if ($errorOccurred) return error($results);
return success($results); // otherwise return results in a success object
}
/**
* Updates jobs already present in the jobs queue
* jobs is an array of job objects
*/
public function updateJobsQueue($type, $jobs)
{
// Checks parameters
if (isEmptyArray($jobs)) return error('The provided jobs parameter is not a valid array');
$results = $jobs; // returned values
$errorOccurred = false; // very optimistic
// Get all the job statuses
$dbResultStatuses = $this->_ci->JobStatusesModel->load();
if (isError($dbResultStatuses)) return $dbResultStatuses;
$statuses = getData($dbResultStatuses);
// Loops through all the provided jobs
foreach ($results as $job)
{
// Check if the required job is present in the database
$dbResultJobs = $this->_ci->JobsQueueModel->load($job->{self::PROPERTY_JOBID});
if (isError($dbResultJobs))
{
$job->{self::PROPERTY_ERROR} = getError($dbResultJobs); // retrieve the cause and store it in job object
$errorOccurred = true; // set error occurred flag
}
elseif (!hasData($dbResultJobs)) // if no jobs were found
{
$job->{self::PROPERTY_ERROR} = 'The required job is not present';
$errorOccurred = true; // set error occurred flag
}
else // if a job was found then it could be updated
{
// If the structure of the job object is valid
if ($this->_checkUpdateJobStructure($job) && $this->_checkJobStatus($job, $statuses))
{
$this->_dropNotAllowedPropertiesUpdateJob($job); // remove the black listed properties from this object
$job->{self::PROPERTY_TYPE} = $type; // What you asked is what you get!
// Try to update the single job into database
$dbResult = $this->_ci->JobsQueueModel->update($job->{self::PROPERTY_JOBID}, (array)$job);
// If an error occurred during while updating in database
if (isError($dbResult))
{
$job->{self::PROPERTY_ERROR} = getError($dbResult); // retrieve the cause and store it in job object
$errorOccurred = true; // set error occurred flag
}
else // otherwise
{
$dbNewTriggeredJobResult = $this->_addNewTriggeredJobToQueue(
$type,
$job,
array($job->status)
);
// If an error occurred during while inserting in database
if (isError($dbNewTriggeredJobResult)) return $dbNewTriggeredJobResult;
}
}
else // otherwise
{
$errorOccurred = true; // set error occurred flag
}
}
}
// If an error occurred then returns the results in an error object
if ($errorOccurred) return error($results);
return success($results); // otherwise return results in a success object
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Checks the job object structure when needed for insert
*/
private function _checkNewJobStructure(&$job)
{
// If job is a valid object and contains the required properties AND does NOT already contain the property error
if (is_object($job)
&& property_exists($job, self::PROPERTY_STATUS)
&& !property_exists($job, self::PROPERTY_ERROR))
{
return true; // it is valid!
}
// If not object then object it!
if (!is_object($job)) $job = new stdClass();
// If an error property was not already previously stored then store an error message in job object
if (!property_exists($job, self::PROPERTY_ERROR))
{
$job->{self::PROPERTY_ERROR} = 'The structure of the provided job is not valid';
}
return false; // better sorry than wrong
}
/**
* Checks the job object structure when needed for update
*/
private function _checkUpdateJobStructure(&$job)
{
// If job is a valid object
if (is_object($job) && property_exists($job, self::PROPERTY_JOBID)) return true; // it is valid!
// If not object then object it!
if (!is_object($job)) $job = new stdClass();
// If an error property was not already previously stored then store an error message in job object
if (!property_exists($job, self::PROPERTY_ERROR))
{
$job->{self::PROPERTY_ERROR} = 'The structure of the provided job is not valid';
}
return false; // better sorry than wrong
}
/**
* Checks if the given job contains a valid type
*/
private function _checkJobType($type, $types)
{
return $this->_inArray($type, $types, self::PROPERTY_TYPE);
}
/**
* Checks if the given job contains a valid status
*/
private function _checkJobStatus(&$job, $statuses)
{
// If the given job doesn't have the property status then it is not valid
if (!isset($job->{self::PROPERTY_STATUS}))
{
$found = false;
}
else // otherwise test if it valid
{
$found = $this->_inArray($job->{self::PROPERTY_STATUS}, $statuses, self::PROPERTY_STATUS);
}
// No status was found and does NOT already contain the property error
if (!$found && !property_exists($job, self::PROPERTY_ERROR))
{
$job->{self::PROPERTY_ERROR} = 'The provided status of this job is not valid'; // store the error message in the object
}
return $found;
}
/**
* Search in an array the given value
* The elements of the given array are objects
* The given value is compared with the property specified by the $propertyName parameter of each object of the given array
*/
private function _inArray($value, $array, $propertyName)
{
$found = false;
foreach ($array as $element)
{
if ($value == $element->{$propertyName})
{
$found = true;
break;
}
}
return $found;
}
/**
* Drop not allowed properties from the given job
*/
private function _dropNotAllowedPropertiesNewJob(&$job)
{
unset($job->{self::PROPERTY_JOBID});
unset($job->{self::PROPERTY_CREATIONTIME});
unset($job->{self::PROPERTY_TYPE});
}
/**
* Drop not allowed properties from the given job
*/
private function _dropNotAllowedPropertiesUpdateJob(&$job)
{
unset($job->{self::PROPERTY_CREATIONTIME});
unset($job->{self::PROPERTY_TYPE});
}
/**
* Add e new triggered job to the jobs queue
* NOTE:
* - In this method there are less checks compared to addNewJobsToQueue method because
* the new jobs that will be added are generate in this method
* - Job ids in this case are not returned, therefore the caller is not going to be informed about these new jobs
*/
private function _addNewTriggeredJobToQueue($type, $job, $triggeredStatuses)
{
// Get all the job trigggers for the given type and for the given statuses
$dbTriggersResult = $this->_ci->JobTriggersModel->getJobtriggersByTypeStatuses($type, $triggeredStatuses);
// If an error occurred while getting job triggers from database then return it
if (isError($dbTriggersResult)) return $dbTriggersResult;
if (hasData($dbTriggersResult)) // If triggers were retrieved
{
// The output of the trigging job is the input of the trigged job
$triggeredJobInput = null;
if (isset($job->{self::PROPERTY_OUTPUT})) $triggeredJobInput = $job->{self::PROPERTY_OUTPUT};
// For each trigger
foreach (getData($dbTriggersResult) as $trigger)
{
$triggeredJob = array(
self::PROPERTY_TYPE => $trigger->following_type, // the new type is the one defined in tbl_jobtriggers
self::PROPERTY_STATUS => self::STATUS_NEW, // new job status is new
self::PROPERTY_INPUT => $triggeredJobInput // new job input
);
// Try to insert the single job into database
$dbNewJob = $this->_ci->JobsQueueModel->insert($triggeredJob);
// If an error occurred during while inserting in database
if (isError($dbNewJob)) return $dbNewJob;
}
}
return success(); // if here then it was a success!
}
}
+45 -12
View File
@@ -42,6 +42,8 @@ class LogLib
const P_NAME_LINE_INDEX = 'lineIndex';
const P_NAME_DB_LOG_TYPE = 'dbLogType';
const P_NAME_DB_EXECUTE_USER = 'dbExecuteUser';
const P_NAME_REQUEST_ID = 'requestId';
const P_NAME_REQUEST_DATA_FORMATTER = 'requestDataFormatter';
// Properties used to retrieve caller data
private $_classIndex;
@@ -52,6 +54,9 @@ class LogLib
private $_dbLogType;
private $_dbExecuteUser;
private $_requestId; // is it possible to specify a request id when loading this library
private $_requestDataFormatter; // is possible to provide a function to format request data
/**
* Set properties to a default value or overwrites them with the given parameters
*/
@@ -63,7 +68,18 @@ class LogLib
$this->_lineIndex = self::LINE_INDEX;
$this->_dbLogType = null;
$this->_dbExecuteUser = self::DB_EXECUTE_USER;
$this->_requestId = null;
$this->_requestDataFormatter = null;
// If parameters are given then overwrite the default values
if (!isEmptyArray($params)) $this->setConfigs($params);
}
/**
* Store configuration parameters for this lib
*/
public function setConfigs($params)
{
// If parameters are given then overwrite the default values
if (!isEmptyArray($params))
{
@@ -72,6 +88,8 @@ class LogLib
if (isset($params[self::P_NAME_LINE_INDEX])) $this->_lineIndex = $params[self::P_NAME_LINE_INDEX];
if (isset($params[self::P_NAME_DB_LOG_TYPE])) $this->_dbLogType = $params[self::P_NAME_DB_LOG_TYPE];
if (isset($params[self::P_NAME_DB_EXECUTE_USER])) $this->_dbExecuteUser = $params[self::P_NAME_DB_EXECUTE_USER];
if (isset($params[self::P_NAME_REQUEST_ID])) $this->_requestId = $params[self::P_NAME_REQUEST_ID];
if (isset($params[self::P_NAME_REQUEST_DATA_FORMATTER])) $this->_requestDataFormatter = $params[self::P_NAME_REQUEST_DATA_FORMATTER];
}
}
@@ -108,33 +126,33 @@ class LogLib
/**
* Writes an info log to database
*/
public function logInfoDB($requestId, $data)
public function logInfoDB($data, $requestId = null)
{
$this->_logDB(self::INFO, $requestId, $data);
$this->_logDB(self::INFO, $data, $requestId);
}
/**
* Writes a debug log to database
*/
public function logDebugDB($requestId, $data)
public function logDebugDB($data, $requestId = null)
{
$this->_logDB(self::DEBUG, $requestId, $data);
$this->_logDB(self::DEBUG, $data, $requestId);
}
/**
* Writes an warning log to database
*/
public function logWarningDB($requestId, $data)
public function logWarningDB($data, $requestId = null)
{
$this->_logDB(self::WARNING, $requestId, $data);
$this->_logDB(self::WARNING, $data, $requestId);
}
/**
* Writes an error log to database
*/
public function logErrorDB($requestId, $data)
public function logErrorDB($data, $requestId = null)
{
$this->_logDB(self::ERROR, $requestId, $data);
$this->_logDB(self::ERROR, $data, $requestId);
}
// --------------------------------------------------------------------------------------------------------------
@@ -151,8 +169,15 @@ class LogLib
/**
* Writes logs to database
*/
private function _logDB($level, $requestId, $data)
private function _logDB($level, $data, $requestId, $executionTime = null)
{
// If there isn't a valid request id provided during the loading of this library or when any log to db method is called
// NOTE: this message will be displayed only to the developer AND stops the execution
if (isEmptyString($this->_requestId) && isEmptyString($requestId))
{
show_error('To log to database you need to specify or give the "'.self::P_NAME_REQUEST_ID.'" parameter when the LogLib is loaded or when log'.ucfirst($level).'DB is called');
}
// If the _dbLogType parameter was not given when this library was loaded
// NOTE: this message will be displayed only to the developer AND stops the execution
if ($this->_dbLogType == null)
@@ -175,14 +200,21 @@ class LogLib
// Get caller data
$callerData = $this->_getCaller();
// If a request data formatter was defined then use it
$request_data = $data;
if ($this->_requestDataFormatter != null && is_callable($this->_requestDataFormatter))
{
$request_data = call_user_func_array($this->_requestDataFormatter, array($data));
}
// Writes a log to database
$ci->WebservicelogModel->insert(array(
'webservicetyp_kurzbz' => $this->_dbLogType,
'request_id' => $requestId,
'request_id' => (!isEmptyString($requestId) ? $requestId : $this->_requestId).' - '.$level,
'beschreibung' => $this->_getDatabaseDescription($callerData),
'request_data' => $data,
'request_data' => $request_data,
'execute_user' => $this->_dbExecuteUser,
'execute_time' => 'NOW()' // current time
'execute_time' => $executionTime == null ? 'NOW()' : $executionTime // default current time, if not otherwise specified
));
}
}
@@ -251,3 +283,4 @@ class LogLib
return $formatted;
}
}
+3 -3
View File
@@ -147,7 +147,7 @@ class PermissionLib
$accessType = '';
// Checks if the required access type is compliant with the HTTP method (GET => r, POST => w)
// Set the access type
if (strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false)
{
$accessType = PermissionLib::SELECT_RIGHT; // S
@@ -184,12 +184,12 @@ class PermissionLib
}
else
{
show_error('The given permission array does not contain the called method or is not correctly set');
show_error('The given permission array does not contain the given method or is not correctly set');
}
}
else
{
show_error('You must give the permissions array as parameter to the constructor of the controller');
show_error('The given permissions is not a valid array or it is an empty one');
}
return $checkPermissions;
+284 -119
View File
@@ -3,15 +3,20 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Library to manage UDF
* Library to manage UDFs
*/
class UDFLib
{
const WIDGET_NAME = 'UDFWidget';
const SCHEMA_ARG_NAME = 'schema';
const TABLE_ARG_NAME = 'table';
const FIELD_ARG_NAME = 'field';
const UDFS_ARG_NAME = 'udfs';
const UDF_UNIQUE_ID = 'udfUniqueId'; // Name of the UDF widget unique id
const SESSION_NAME = 'FHC_UDF_WIDGET'; // Name of the session area used for UDFs
// Parameters names
const WIDGET_NAME = 'UDFWidget'; // UDFWidget name
const SCHEMA_ARG_NAME = 'schema'; // Schema parameter name
const TABLE_ARG_NAME = 'table'; // Table parameter name
const FIELD_ARG_NAME = 'field'; // Field parameter name
const UDFS_ARG_NAME = 'udfs'; // UDFs parameter name
// UDF json schema attributes
const NAME = 'name'; // UDF name attribute
@@ -22,6 +27,16 @@ class UDFLib
const FE_REGEX_LANGUAGE = 'js'; // UDF javascript regex language attribute (front end)
const BE_REGEX_LANGUAGE = 'php'; // UDF php regex language attribute (back end)
// ...to specify permissions that are needed to use this TableWidget
const REQUIRED_PERMISSIONS_PARAMETER = 'requiredPermissions';
// ...to specify the primary key name and value
const PRIMARY_KEY_NAME = 'primaryKeyName';
const PRIMARY_KEY_VALUE = 'primaryKeyValue';
const PERMISSION_TABLE_METHOD = 'UDFWidget'; // Name for fake method to be checked by the PermissionLib
const PERMISSION_TYPE = 'rw';
// HTML components
const LABEL = 'title';
const TITLE = 'description';
@@ -47,8 +62,10 @@ class UDFLib
private $_ci; // Code igniter instance
private $_udfUniqueId; // Property that contains the UDF widget unique id
/**
* Loads fhc helper
* Gets CI instance
*/
public function __construct()
{
@@ -63,8 +80,8 @@ class UDFLib
*/
public function UDFWidget($args, $htmlArgs = array())
{
if ((isset($args[UDFLib::SCHEMA_ARG_NAME]) && !isEmptyString($args[UDFLib::SCHEMA_ARG_NAME]))
&& (isset($args[UDFLib::TABLE_ARG_NAME]) && !isEmptyString($args[UDFLib::TABLE_ARG_NAME])))
if ((isset($args[self::SCHEMA_ARG_NAME]) && !isEmptyString($args[self::SCHEMA_ARG_NAME]))
&& (isset($args[self::TABLE_ARG_NAME]) && !isEmptyString($args[self::TABLE_ARG_NAME])))
{
// Loads the widget library
$this->_ci->load->library('WidgetLib');
@@ -73,26 +90,26 @@ class UDFLib
loadResource(APPPATH.'widgets/udf');
// Default external block is true
if (!isset($args[UDFLib::FIELD_ARG_NAME]) && !isset($htmlArgs[HTMLWidget::EXTERNAL_BLOCK]))
if (!isset($args[self::FIELD_ARG_NAME]) && !isset($htmlArgs[HTMLWidget::EXTERNAL_BLOCK]))
{
$htmlArgs[HTMLWidget::EXTERNAL_BLOCK] = true;
}
return $this->_ci->widgetlib->widget(
UDFLib::WIDGET_NAME,
self::WIDGET_NAME,
$args,
$htmlArgs
);
}
else
{
if (!isset($args[UDFLib::SCHEMA_ARG_NAME]) || isEmptyString($args[UDFLib::SCHEMA_ARG_NAME]))
if (!isset($args[self::SCHEMA_ARG_NAME]) || isEmptyString($args[self::SCHEMA_ARG_NAME]))
{
show_error(UDFLib::SCHEMA_ARG_NAME.' parameter is missing!');
show_error(self::SCHEMA_ARG_NAME.' parameter is missing!');
}
if (!isset($args[UDFLib::TABLE_ARG_NAME]) || isEmptyString($args[UDFLib::TABLE_ARG_NAME]))
if (!isset($args[self::TABLE_ARG_NAME]) || isEmptyString($args[self::TABLE_ARG_NAME]))
{
show_error(UDFLib::TABLE_ARG_NAME.' parameter is missing!');
show_error(self::TABLE_ARG_NAME.' parameter is missing!');
}
}
}
@@ -105,12 +122,12 @@ class UDFLib
*/
public function displayUDFWidget(&$widgetData)
{
$schema = $widgetData[UDFLib::SCHEMA_ARG_NAME]; // schema attribute
$table = $widgetData[UDFLib::TABLE_ARG_NAME]; // table attribute
$schema = $widgetData[self::SCHEMA_ARG_NAME]; // schema attribute
$table = $widgetData[self::TABLE_ARG_NAME]; // table attribute
if (isset($widgetData[UDFLib::FIELD_ARG_NAME]))
if (isset($widgetData[self::FIELD_ARG_NAME]))
{
$field = $widgetData[UDFLib::FIELD_ARG_NAME]; // UDF name
$field = $widgetData[self::FIELD_ARG_NAME]; // UDF name
}
$udfResults = $this->_loadUDF($schema, $table); // loads UDF definition
@@ -122,6 +139,9 @@ class UDFLib
$jsonSchemas = json_decode($udf->jsons); // decode the json schema
if (is_object($jsonSchemas) || is_array($jsonSchemas))
{
//
$this->_printStartUDFBlock($widgetData);
// If the schema is an object then convert it into an array
if (is_object($jsonSchemas))
{
@@ -140,18 +160,18 @@ class UDFLib
foreach ($jsonSchemasArray as $jsonSchema)
{
// If the type property is not present then show an error
if (!isset($jsonSchema->{UDFLib::TYPE}))
if (!isset($jsonSchema->{self::TYPE}))
{
show_error(sprintf('%s.%s: Attribute "type" not present in the json schema', $schema, $table));
}
// If the name property is not present then show an error
if (!isset($jsonSchema->{UDFLib::NAME}))
if (!isset($jsonSchema->{self::NAME}))
{
show_error(sprintf('%s.%s: Attribute "name" not present in the json schema', $schema, $table));
}
// If a UDF is specified and is present in the json schemas list or no UDF is specified
if ((isset($field) && $field == $jsonSchema->{UDFLib::NAME}) || !isset($field))
if ((isset($field) && $field == $jsonSchema->{self::NAME}) || !isset($field))
{
// Set attributes using phrases
$this->_setAttributesWithPhrases($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]);
@@ -166,7 +186,7 @@ class UDFLib
$this->_render($jsonSchema, $widgetData);
// If a UDf is specified and it was found then stop looking through this list
if (isset($field) && $field == $jsonSchema->{UDFLib::NAME})
if (isset($field) && $field == $jsonSchema->{self::NAME})
{
$found = true;
break;
@@ -179,6 +199,9 @@ class UDFLib
{
show_error(sprintf('%s.%s: No schema present for field: %s', $schema, $table, $field));
}
//
$this->_printEndUDFBlock();
}
else // not a valid schema
{
@@ -218,7 +241,7 @@ class UDFLib
// Decodes json that define the UDFs for this table
$decodedUDFDefinitions = json_decode(
$resultUDFsDefinitions->retval[0]->{UDFLib::COLUMN_JSON_DESCRIPTION}
$resultUDFsDefinitions->retval[0]->{self::COLUMN_JSON_DESCRIPTION}
);
// Loops through the UDFs definitions
@@ -232,28 +255,28 @@ class UDFLib
$tmpValidate = success(true); // temporary variable used to store the returned value from _validateUDFs
// If this is the definition of this UDF
if ($decodedUDFDefinition->{UDFLib::NAME} == $key)
if ($decodedUDFDefinition->{self::NAME} == $key)
{
if (isset($decodedUDFDefinition->{UDFLib::VALIDATION})) // If validation rules are present for this UDF
if (isset($decodedUDFDefinition->{self::VALIDATION})) // If validation rules are present for this UDF
{
// Checks if the given UDF is required and the result will be stored in $chkRequiredPassed
// If $chkRequiredPassed == true => required check passed
// If $chkRequiredPassed == false => required check NOT passed
$chkRequiredPassed = true;
// If required property is present in the UDF description and it is true
if (isset($decodedUDFDefinition->{UDFLib::VALIDATION}->{UDFLib::REQUIRED})
&& $decodedUDFDefinition->{UDFLib::VALIDATION}->{UDFLib::REQUIRED} === true)
if (isset($decodedUDFDefinition->{self::VALIDATION}->{self::REQUIRED})
&& $decodedUDFDefinition->{self::VALIDATION}->{self::REQUIRED} === true)
{
// If this UDF is a checkbox and the given value is false
// OR
// if this UDF is NOT a checkbox and the given value is null
if (($decodedUDFDefinition->{UDFLib::TYPE} == UDFLib::CHKBOX_TYPE && $val === false)
|| ($decodedUDFDefinition->{UDFLib::TYPE} != UDFLib::CHKBOX_TYPE && $val == null))
// if this UD7F is NOT a checkbox and the given value is null
if (($decodedUDFDefinition->{self::TYPE} == self::CHKBOX_TYPE && $val === false)
|| ($decodedUDFDefinition->{self::TYPE} != self::CHKBOX_TYPE && $val == null))
{
$chkRequiredPassed = false; // not passed
// A new error is generated and added to array $requiredUDFsArray
$requiredUDFsArray[$decodedUDFDefinition->{UDFLib::NAME}] = error(
$decodedUDFDefinition->{UDFLib::NAME},
$requiredUDFsArray[$decodedUDFDefinition->{self::NAME}] = error(
$decodedUDFDefinition->{self::NAME},
EXIT_VALIDATION_UDF_REQUIRED
);
}
@@ -267,22 +290,22 @@ class UDFLib
// If $toBeValidated == false => validation is NOT performed
$toBeValidated = false;
// If this UDF is NOT a checkbox
if ($decodedUDFDefinition->{UDFLib::TYPE} != UDFLib::CHKBOX_TYPE)
if ($decodedUDFDefinition->{self::TYPE} != self::CHKBOX_TYPE)
{
// If required property is NOT present in the UDF description
if (!isset($decodedUDFDefinition->{UDFLib::VALIDATION}->{UDFLib::REQUIRED}))
if (!isset($decodedUDFDefinition->{self::VALIDATION}->{self::REQUIRED}))
{
$toBeValidated = true;
}
// If required property is present in the UDF description and it is true
if (isset($decodedUDFDefinition->{UDFLib::VALIDATION}->{UDFLib::REQUIRED})
&& $decodedUDFDefinition->{UDFLib::VALIDATION}->{UDFLib::REQUIRED} === true)
if (isset($decodedUDFDefinition->{self::VALIDATION}->{self::REQUIRED})
&& $decodedUDFDefinition->{self::VALIDATION}->{self::REQUIRED} === true)
{
$toBeValidated = true;
}
// If required property is present in the UDF description and it is true and the given value is null
if (isset($decodedUDFDefinition->{UDFLib::VALIDATION}->{UDFLib::REQUIRED})
&& $decodedUDFDefinition->{UDFLib::VALIDATION}->{UDFLib::REQUIRED} === false
if (isset($decodedUDFDefinition->{self::VALIDATION}->{self::REQUIRED})
&& $decodedUDFDefinition->{self::VALIDATION}->{self::REQUIRED} === false
&& $val != null)
{
$toBeValidated = true;
@@ -292,8 +315,8 @@ class UDFLib
if ($toBeValidated === true) // Checks if validation should be performed
{
$tmpValidate = $this->_validateUDFs(
$decodedUDFDefinition->{UDFLib::VALIDATION},
$decodedUDFDefinition->{UDFLib::NAME},
$decodedUDFDefinition->{self::VALIDATION},
$decodedUDFDefinition->{self::NAME},
$val
);
}
@@ -341,7 +364,7 @@ class UDFLib
if ($encodedToBeStoredUDFs !== false) // if encode was ok
{
// Save the supplied UDFs values
$data[UDFLib::COLUMN_NAME] = $encodedToBeStoredUDFs;
$data[self::COLUMN_NAME] = $encodedToBeStoredUDFs;
}
}
else // otherwise the returning value will be the list of UDFs validation errors
@@ -360,8 +383,8 @@ class UDFLib
{
$isUDFColumn = false;
if (substr($columnName, 0, strlen(UDFLib::COLUMN_PREFIX)) == UDFLib::COLUMN_PREFIX
&& $columnType == UDFLib::COLUMN_TYPE)
if (substr($columnName, 0, strlen(self::COLUMN_PREFIX)) == self::COLUMN_PREFIX
&& $columnType == self::COLUMN_TYPE)
{
$isUDFColumn = true;
}
@@ -369,9 +392,151 @@ class UDFLib
return $isUDFColumn;
}
/**
* Set the _udfUniqueId property
*/
public function setUDFUniqueId($udfUniqueId)
{
$this->_udfUniqueId = $udfUniqueId;
}
/**
* Return an unique string that identify this UDF widget
* NOTE: The default value is the URI where the FilterWidget is called
* If the fhc_controller_id is present then is also used
*/
public function setUDFUniqueIdByParams($params)
{
if ($params != null
&& is_array($params)
&& isset($params[self::UDF_UNIQUE_ID])
&& !isEmptyString($params[self::UDF_UNIQUE_ID]))
{
$udfUniqueId = $this->_ci->router->directory.$this->_ci->router->class.'/'.
$this->_ci->router->method.'/'.
$params[self::UDF_UNIQUE_ID];
$this->setUDFUniqueId($udfUniqueId);
}
}
/**
* Wrapper method to the session helper funtions to retrieve the whole session for this UDF widget
*/
public function getSession()
{
return getSessionElement(self::SESSION_NAME, $this->_udfUniqueId);
}
/**
* Wrapper method to the session helper funtions to retrieve one element from the session of this UDF widget
*/
public function getSessionElement($name)
{
$session = getSessionElement(self::SESSION_NAME, $this->_udfUniqueId);
if (isset($session[$name]))
{
return $session[$name];
}
return null;
}
/**
* Wrapper method to the session helper funtions to set the whole session for this UDF widget
*/
public function setSession($data)
{
setSessionElement(self::SESSION_NAME, $this->_udfUniqueId, $data);
}
/**
* Wrapper method to the session helper funtions to set one element in the session for this UDF widget
*/
public function setSessionElement($name, $value)
{
$session = getSessionElement(self::SESSION_NAME, $this->_udfUniqueId);
$session[$name] = $value;
setSessionElement(self::SESSION_NAME, $this->_udfUniqueId, $session); // stores the single value
}
/**
* Save UDFs
*/
public function saveUDFs($udfUniqueId, $udfs)
{
// Read the all session for this udf widget
$session = $this->getSession();
// If session is empty then return an error
if ($session == null) return error('No UDFWidget loaded');
// Workaround to load CI
$this->_ci->load->model('system/UDF_model', 'UDFModel');
// Initialize a new DB_Model
$dbModel = new DB_Model();
// Setup the new dbModel object with...
$dbModel->setup(
$session[self::SCHEMA_ARG_NAME], // ... schema...
$session[self::TABLE_ARG_NAME], // ...table...
$session[self::PRIMARY_KEY_NAME] // ...and primary key name
);
// Returns the result of the database update operation to save UDFs
return $dbModel->update(
array($session[self::PRIMARY_KEY_NAME] => $session[self::PRIMARY_KEY_VALUE]),
(array)$udfs
);
}
/**
* Checks if at least one of the permissions given as parameter (requiredPermissions) belongs
* to the authenticated user, if confirmed then is allowed to use this UDFWidget.
* If the parameter requiredPermissions is NOT given or is not present in the session,
* then NO one is allow to use this UDFWidget
* Wrapper method to permissionlib->hasAtLeastOne
*/
public function isAllowed($requiredPermissions = null)
{
$this->_ci->load->library('PermissionLib'); // Load permission library
// Gets the required permissions from the session if they are not provided as parameter
$rq = $requiredPermissions;
if ($rq == null) $rq = $this->getSessionElement(self::REQUIRED_PERMISSIONS_PARAMETER);
return $this->_ci->permissionlib->hasAtLeastOne($rq, self::PERMISSION_TABLE_METHOD, self::PERMISSION_TYPE);
}
// -------------------------------------------------------------------------------------------------
// Private methods
/**
* Print the block for UDFs
*/
private function _printStartUDFBlock($widgetData)
{
$startBlock = '<div type="%s" udfUniqueId="%s">'."\n";
echo sprintf(
$startBlock,
self::WIDGET_NAME,
$widgetData[self::UDF_UNIQUE_ID]
);
}
/**
* Print the end of the UDFs block
*/
private function _printEndUDFBlock()
{
echo '</div>'."\n";
}
/**
* Move UDFs from $data to $UDFs
*/
@@ -381,7 +546,7 @@ class UDFLib
foreach ($data as $key => $val)
{
if (substr($key, 0, 4) == UDFLib::COLUMN_PREFIX)
if (substr($key, 0, 4) == self::COLUMN_PREFIX)
{
$udfsParameters[$key] = $val; // stores UDF value into property UDFs
unset($data[$key]); // remove from data
@@ -416,8 +581,8 @@ class UDFLib
{
// If min value attribute is present in the validation for this UDF,
// then checks if the value of this UDF is compliant to this attribute
if (isset($decodedUDFValidation->{UDFLib::MIN_VALUE})
&& $udfVal < $decodedUDFValidation->{UDFLib::MIN_VALUE})
if (isset($decodedUDFValidation->{self::MIN_VALUE})
&& $udfVal < $decodedUDFValidation->{self::MIN_VALUE})
{
// validation is failed and the error is stored in $returnArrayValidation
$returnArrayValidation[] = error($udfName, EXIT_VALIDATION_UDF_MIN_VALUE);
@@ -425,8 +590,8 @@ class UDFLib
// If max value attribute is present in the validation for this UDF,
// then checks if the value of this UDF is compliant to this attribute
if (isset($decodedUDFValidation->{UDFLib::MAX_VALUE})
&& $udfVal > $decodedUDFValidation->{UDFLib::MAX_VALUE})
if (isset($decodedUDFValidation->{self::MAX_VALUE})
&& $udfVal > $decodedUDFValidation->{self::MAX_VALUE})
{
// validation is failed and the error is stored in $returnArrayValidation
$returnArrayValidation[] = error($udfName, EXIT_VALIDATION_UDF_MAX_VALUE);
@@ -436,8 +601,8 @@ class UDFLib
$strUdfVal = strval($udfVal); // store in $strUdfVal the string conversion of $udfVal
// If min length attribute is present in the validation for this UDF,
// then checks if the value of this UDF is compliant to this attribute
if (isset($decodedUDFValidation->{UDFLib::MIN_LENGTH}) && isset($strUdfVal)
&& strlen($strUdfVal) < $decodedUDFValidation->{UDFLib::MIN_LENGTH})
if (isset($decodedUDFValidation->{self::MIN_LENGTH}) && isset($strUdfVal)
&& strlen($strUdfVal) < $decodedUDFValidation->{self::MIN_LENGTH})
{
// validation is failed and the error is stored in $returnArrayValidation
$returnArrayValidation[] = error($udfName, EXIT_VALIDATION_UDF_MIN_LENGTH);
@@ -445,8 +610,8 @@ class UDFLib
// If max length attribute is present in the validation for this UDF,
// then checks if the value of this UDF is compliant to this attribute
if (isset($decodedUDFValidation->{UDFLib::MAX_LENGTH}) && isset($strUdfVal)
&& strlen($strUdfVal) > $decodedUDFValidation->{UDFLib::MAX_LENGTH})
if (isset($decodedUDFValidation->{self::MAX_LENGTH}) && isset($strUdfVal)
&& strlen($strUdfVal) > $decodedUDFValidation->{self::MAX_LENGTH})
{
// validation is failed and the error is stored in $returnArrayValidation
$returnArrayValidation[] = error($udfName, EXIT_VALIDATION_UDF_MAX_LENGTH);
@@ -457,12 +622,12 @@ class UDFLib
{
// Search for a php regular expression in the validation of this UDF, if one is found
// then checks if the value of this UDF is compliant to this attribute
if (isset($decodedUDFValidation->{UDFLib::REGEX})
&& is_array($decodedUDFValidation->{UDFLib::REGEX}))
if (isset($decodedUDFValidation->{self::REGEX})
&& is_array($decodedUDFValidation->{self::REGEX}))
{
foreach ($decodedUDFValidation->{UDFLib::REGEX} as $regexIndx => $regex)
foreach ($decodedUDFValidation->{self::REGEX} as $regexIndx => $regex)
{
if ($regex->language == UDFLib::BE_REGEX_LANGUAGE)
if ($regex->language == self::BE_REGEX_LANGUAGE)
{
if (preg_match($regex->expression, $udfVal) != 1)
{
@@ -494,8 +659,8 @@ class UDFLib
*/
private function _setNameAndId($jsonSchema, &$htmlParameters)
{
$htmlParameters[HTMLWidget::HTML_ID] = $jsonSchema->{UDFLib::NAME};
$htmlParameters[HTMLWidget::HTML_NAME] = $jsonSchema->{UDFLib::NAME};
$htmlParameters[HTMLWidget::HTML_ID] = $jsonSchema->{self::NAME};
$htmlParameters[HTMLWidget::HTML_NAME] = $jsonSchema->{self::NAME};
}
/**
@@ -504,20 +669,20 @@ class UDFLib
private function _sortJsonSchemas(&$jsonSchemasArray)
{
usort($jsonSchemasArray, function ($a, $b) {
if (!isset($a->{UDFLib::SORT}))
if (!isset($a->{self::SORT}))
{
$a->{UDFLib::SORT} = 9999;
$a->{self::SORT} = 9999;
}
if (!isset($b->{UDFLib::SORT}))
if (!isset($b->{self::SORT}))
{
$b->{UDFLib::SORT} = 9999;
$b->{self::SORT} = 9999;
}
if ($a->{UDFLib::SORT} == $b->{UDFLib::SORT})
if ($a->{self::SORT} == $b->{self::SORT})
{
return 0;
}
return ($a->{UDFLib::SORT} < $b->{UDFLib::SORT}) ? -1 : 1;
return ($a->{self::SORT} < $b->{self::SORT}) ? -1 : 1;
});
}
@@ -565,32 +730,32 @@ class UDFLib
private function _render($jsonSchema, &$widgetData)
{
// Checkbox
if ($jsonSchema->{UDFLib::TYPE} == 'checkbox')
if ($jsonSchema->{self::TYPE} == 'checkbox')
{
$this->_renderCheckbox($jsonSchema, $widgetData);
}
// Textfield
elseif ($jsonSchema->{UDFLib::TYPE} == 'textfield')
elseif ($jsonSchema->{self::TYPE} == 'textfield')
{
$this->_renderTextfield($jsonSchema, $widgetData);
}
// Textarea
elseif ($jsonSchema->{UDFLib::TYPE} == 'textarea')
elseif ($jsonSchema->{self::TYPE} == 'textarea')
{
$this->_renderTextarea($jsonSchema, $widgetData);
}
// Date
elseif ($jsonSchema->{UDFLib::TYPE} == 'date')
elseif ($jsonSchema->{self::TYPE} == 'date')
{
// To be done
}
// Dropdown
elseif ($jsonSchema->{UDFLib::TYPE} == 'dropdown')
elseif ($jsonSchema->{self::TYPE} == 'dropdown')
{
$this->_renderDropdown($jsonSchema, $widgetData);
}
// Multiple dropdown
elseif ($jsonSchema->{UDFLib::TYPE} == 'multipledropdown')
elseif ($jsonSchema->{self::TYPE} == 'multipledropdown')
{
$this->_renderDropdown($jsonSchema, $widgetData, true);
}
@@ -602,29 +767,29 @@ class UDFLib
private function _renderDropdown($jsonSchema, &$widgetData, $multiple = false)
{
// Selected element/s
if (isset($widgetData[UDFLib::UDFS_ARG_NAME])
&& isset($widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}]))
if (isset($widgetData[self::UDFS_ARG_NAME])
&& isset($widgetData[self::UDFS_ARG_NAME][$jsonSchema->{self::NAME}]))
{
$widgetData[DropdownWidget::SELECTED_ELEMENT] = $widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}];
$widgetData[DropdownWidget::SELECTED_ELEMENT] = $widgetData[self::UDFS_ARG_NAME][$jsonSchema->{self::NAME}];
}
else
{
$widgetData[DropdownWidget::SELECTED_ELEMENT] = null;
}
$dropdownWidgetUDF = new DropdownWidgetUDF(UDFLib::WIDGET_NAME, $widgetData);
$dropdownWidgetUDF = new DropdownWidgetUDF(self::WIDGET_NAME, $widgetData);
$parameters = array();
// If the list of values to show is an array
if (isset($jsonSchema->{UDFLib::LIST_VALUES}->enum))
if (isset($jsonSchema->{self::LIST_VALUES}->enum))
{
$parameters = $jsonSchema->{UDFLib::LIST_VALUES}->enum;
$parameters = $jsonSchema->{self::LIST_VALUES}->enum;
}
// If the list of values to show should be retrieved with a SQL statement
elseif (isset($jsonSchema->{UDFLib::LIST_VALUES}->sql))
elseif (isset($jsonSchema->{self::LIST_VALUES}->sql))
{
// UDFModel is loaded in method _loadUDF that is called before the current method
$queryResult = $this->_ci->UDFModel->execReadOnlyQuery($jsonSchema->{UDFLib::LIST_VALUES}->sql);
$queryResult = $this->_ci->UDFModel->execReadOnlyQuery($jsonSchema->{self::LIST_VALUES}->sql);
if (hasData($queryResult))
{
$parameters = $queryResult->retval;
@@ -645,13 +810,13 @@ class UDFLib
private function _renderTextarea($jsonSchema, &$widgetData)
{
$text = null; // text value
$textareaUDF = new TextareaWidgetUDF(UDFLib::WIDGET_NAME, $widgetData);
$textareaUDF = new TextareaWidgetUDF(self::WIDGET_NAME, $widgetData);
// Set text value if present in the DB
if (isset($widgetData[UDFLib::UDFS_ARG_NAME])
&& isset($widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}]))
if (isset($widgetData[self::UDFS_ARG_NAME])
&& isset($widgetData[self::UDFS_ARG_NAME][$jsonSchema->{self::NAME}]))
{
$text = $widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}];
$text = $widgetData[self::UDFS_ARG_NAME][$jsonSchema->{self::NAME}];
}
$textareaUDF->render($text);
@@ -663,13 +828,13 @@ class UDFLib
private function _renderTextfield($jsonSchema, &$widgetData)
{
$text = null; // text value
$textareaUDF = new TextfieldWidgetUDF(UDFLib::WIDGET_NAME, $widgetData);
$textareaUDF = new TextfieldWidgetUDF(self::WIDGET_NAME, $widgetData);
// Set text value if present in the DB
if (isset($widgetData[UDFLib::UDFS_ARG_NAME])
&& isset($widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}]))
if (isset($widgetData[self::UDFS_ARG_NAME])
&& isset($widgetData[self::UDFS_ARG_NAME][$jsonSchema->{self::NAME}]))
{
$text = $widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}];
$text = $widgetData[self::UDFS_ARG_NAME][$jsonSchema->{self::NAME}];
}
$textareaUDF->render($text);
@@ -681,17 +846,17 @@ class UDFLib
private function _renderCheckbox($jsonSchema, &$widgetData)
{
// Set checkbox value if present in the DB
if (isset($widgetData[UDFLib::UDFS_ARG_NAME])
&& isset($widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}]))
if (isset($widgetData[self::UDFS_ARG_NAME])
&& isset($widgetData[self::UDFS_ARG_NAME][$jsonSchema->{self::NAME}]))
{
$widgetData[CheckboxWidget::VALUE_FIELD] = $widgetData[UDFLib::UDFS_ARG_NAME][$jsonSchema->{UDFLib::NAME}];
$widgetData[CheckboxWidget::VALUE_FIELD] = $widgetData[self::UDFS_ARG_NAME][$jsonSchema->{self::NAME}];
}
else
{
$widgetData[CheckboxWidget::VALUE_FIELD] = CheckboxWidget::HTML_DEFAULT_VALUE;
}
$checkboxWidgetUDF = new CheckboxWidgetUDF(UDFLib::WIDGET_NAME, $widgetData);
$checkboxWidgetUDF = new CheckboxWidgetUDF(self::WIDGET_NAME, $widgetData);
$checkboxWidgetUDF->render();
}
@@ -707,21 +872,21 @@ class UDFLib
$htmlParameters[HTMLWidget::PLACEHOLDER] = null;
// Description, title and placeholder
if (isset($jsonSchema->{UDFLib::LABEL})
|| isset($jsonSchema->{UDFLib::TITLE})
|| isset($jsonSchema->{UDFLib::PLACEHOLDER}))
if (isset($jsonSchema->{self::LABEL})
|| isset($jsonSchema->{self::TITLE})
|| isset($jsonSchema->{self::PLACEHOLDER}))
{
// Loads phrases library
$this->_ci->load->library('PhrasesLib');
// If is set the label property in the json schema
if (isset($jsonSchema->{UDFLib::LABEL}))
if (isset($jsonSchema->{self::LABEL}))
{
// Load the related phrase
$tmpResult = $this->_ci->phraseslib->getPhrases(
UDFLib::PHRASES_APP_NAME,
self::PHRASES_APP_NAME,
getUserLanguage(),
$jsonSchema->{UDFLib::LABEL},
$jsonSchema->{self::LABEL},
null,
null,
'no'
@@ -733,13 +898,13 @@ class UDFLib
}
// If is set the title property in the json schema
if (isset($jsonSchema->{UDFLib::TITLE}))
if (isset($jsonSchema->{self::TITLE}))
{
// Load the related phrase
$tmpResult = $this->_ci->phraseslib->getPhrases(
UDFLib::PHRASES_APP_NAME,
self::PHRASES_APP_NAME,
getUserLanguage(),
$jsonSchema->{UDFLib::TITLE},
$jsonSchema->{self::TITLE},
null,
null,
'no'
@@ -751,13 +916,13 @@ class UDFLib
}
// If is set the placeholder property in the json schema
if (isset($jsonSchema->{UDFLib::PLACEHOLDER}))
if (isset($jsonSchema->{self::PLACEHOLDER}))
{
// Load the related phrase
$tmpResult = $this->_ci->phraseslib->getPhrases(
UDFLib::PHRASES_APP_NAME,
self::PHRASES_APP_NAME,
getUserLanguage(),
$jsonSchema->{UDFLib::PLACEHOLDER},
$jsonSchema->{self::PLACEHOLDER},
null,
null,
'no'
@@ -784,17 +949,17 @@ class UDFLib
$htmlParameters[HTMLWidget::MAX_LENGTH] = null;
// If validation property is present in the json schema
if (isset($jsonSchema->{UDFLib::VALIDATION}))
if (isset($jsonSchema->{self::VALIDATION}))
{
$jsonSchemaValidation =& $jsonSchema->{UDFLib::VALIDATION}; // Reference for a better code readability
$jsonSchemaValidation =& $jsonSchema->{self::VALIDATION}; // Reference for a better code readability
// Front-end regex
if (isset($jsonSchemaValidation->{UDFLib::REGEX})
&& is_array($jsonSchemaValidation->{UDFLib::REGEX}))
if (isset($jsonSchemaValidation->{self::REGEX})
&& is_array($jsonSchemaValidation->{self::REGEX}))
{
foreach ($jsonSchemaValidation->{UDFLib::REGEX} as $regex)
foreach ($jsonSchemaValidation->{self::REGEX} as $regex)
{
if ($regex->language === UDFLib::FE_REGEX_LANGUAGE)
if ($regex->language === self::FE_REGEX_LANGUAGE)
{
$htmlParameters[HTMLWidget::REGEX] = $regex->expression;
}
@@ -802,33 +967,33 @@ class UDFLib
}
// Required
if (isset($jsonSchemaValidation->{UDFLib::REQUIRED}))
if (isset($jsonSchemaValidation->{self::REQUIRED}))
{
$htmlParameters[HTMLWidget::REQUIRED] = $jsonSchemaValidation->{UDFLib::REQUIRED};
$htmlParameters[HTMLWidget::REQUIRED] = $jsonSchemaValidation->{self::REQUIRED};
}
// Min value
if (isset($jsonSchemaValidation->{UDFLib::MIN_VALUE}))
if (isset($jsonSchemaValidation->{self::MIN_VALUE}))
{
$htmlParameters[HTMLWidget::MIN_VALUE] = $jsonSchemaValidation->{UDFLib::MIN_VALUE};
$htmlParameters[HTMLWidget::MIN_VALUE] = $jsonSchemaValidation->{self::MIN_VALUE};
}
// Max value
if (isset($jsonSchemaValidation->{UDFLib::MAX_VALUE}))
if (isset($jsonSchemaValidation->{self::MAX_VALUE}))
{
$htmlParameters[HTMLWidget::MAX_VALUE] = $jsonSchemaValidation->{UDFLib::MAX_VALUE};
$htmlParameters[HTMLWidget::MAX_VALUE] = $jsonSchemaValidation->{self::MAX_VALUE};
}
// Min length
if (isset($jsonSchemaValidation->{UDFLib::MIN_LENGTH}))
if (isset($jsonSchemaValidation->{self::MIN_LENGTH}))
{
$htmlParameters[HTMLWidget::MIN_LENGTH] = $jsonSchemaValidation->{UDFLib::MIN_LENGTH};
$htmlParameters[HTMLWidget::MIN_LENGTH] = $jsonSchemaValidation->{self::MIN_LENGTH};
}
// Max length
if (isset($jsonSchemaValidation->{UDFLib::MAX_LENGTH}))
if (isset($jsonSchemaValidation->{self::MAX_LENGTH}))
{
$htmlParameters[HTMLWidget::MAX_LENGTH] = $jsonSchemaValidation->{UDFLib::MAX_LENGTH};
$htmlParameters[HTMLWidget::MAX_LENGTH] = $jsonSchemaValidation->{self::MAX_LENGTH};
}
}
}
+19 -13
View File
@@ -284,9 +284,11 @@ class Messages_model extends CI_Model
$sender = getData($senderResult)[0]; // Found sender data
// If the sender is not the system sender and are present configurations to reply
// If the sender is not the system sender and the receiver is not the system sender
// and are present configurations to reply
$hrefReply = '';
if ($message->sender_id != $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID)
&& $message->receiver_id != $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID)
&& !isEmptyString($this->config->item(MessageLib::CFG_REDIRECT_VIEW_MESSAGE_URL)))
{
$hrefReply = $this->config->item(MessageLib::CFG_MESSAGE_SERVER).
@@ -294,6 +296,13 @@ class Messages_model extends CI_Model
$token;
}
// If the receiver is the system sender (the message was sent to an organization unit)
// redirect the reply to an authenticated controller to reply
if ($message->receiver_id == $this->config->item(MessageLib::CFG_SYSTEM_PERSON_ID))
{
$hrefReply = site_url('system/messages/MessageClient/writeReply?token='.$token);
}
return array (
'sender' => $sender,
'message' => $message,
@@ -411,23 +420,20 @@ class Messages_model extends CI_Model
$message = $this->messagelib->sendMessageUser(
$msgVarsDataArray['person_id'], // receiverPersonId
$parsedSubject, // subject
$parsedBody, // body
$sender_id, // sender_id
$senderOU, // senderOU
$relationmessage_id, // relationmessage_id
MSG_PRIORITY_NORMAL // priority
$parsedSubject, // subject
$parsedBody, // body
$sender_id, // sender_id
$senderOU, // senderOU
$relationmessage_id, // relationmessage_id
MSG_PRIORITY_NORMAL // priority
);
if (isError($message)) return $message;
if (!hasData($message)) return error('No messages were saved in database');
// Write log entry only if persons were given
if ($type == self::TYPE_PERSONS)
{
$personLog = $this->_personLog($sender_id, $msgVarsDataArray['person_id'], getData($message)[0]);
if (isError($personLog)) return $personLog;
}
// Write log entry only
$personLog = $this->_personLog($sender_id, $msgVarsDataArray['person_id'], getData($message)[0]);
if (isError($personLog)) return $personLog;
$receiversCounter++; // increment the counter
}
@@ -41,4 +41,35 @@ class Bisverwendung_model extends DB_Model
return $this->loadWhere($condition);
}
/**
* Gets Verwendungen of the user, optionally in a time span.
* @param string $uid
* @param string $beginn
* @param string $ende
* @return array
*/
public function getVerwendungen($uid, $beginn = null, $ende = null)
{
$params = array($uid);
$qry = 'SELECT * FROM bis.tbl_bisverwendung
WHERE mitarbeiter_uid = ?';
if (isset($beginn))
{
$qry .= ' AND ( ende >= ? OR ende IS NULL )';
$params[] = $beginn;
}
if (isset($ende))
{
$qry .= ' AND ( beginn <= ? OR beginn IS NULL )';
$params[] = $ende;
}
$qry .= ' ORDER BY beginn, ende';
return $this->execQuery($qry, $params);
}
}
+57
View File
@@ -11,4 +11,61 @@ class Konto_model extends DB_Model
$this->dbTable = 'public.tbl_konto';
$this->pk = 'buchungsnr';
}
/**
* Sets a Payment as paid
*/
public function setPaid($buchungsnr)
{
// get payment
$buchungResult = $this->loadWhere(array('buchungsnr' => $buchungsnr));
if(isSuccess($buchungResult) && hasData($buchungResult))
{
// get already paid amount
$this->addSelect('sum(betrag) as bezahlt');
$this->addGroupBy('buchungsnr_verweis');
$buchungVerweisResult = $this->loadWhere(array('buchungsnr_verweis' => $buchungsnr));
if(isSuccess($buchungVerweisResult))
{
if(hasData($buchungVerweisResult))
{
$betragBezahltResult = getData($buchungVerweisResult);
$betragBezahlt = $betragBezahltResult->bezahlt;
}
else
$betragBezahlt = 0;
$buchung = getData($buchungResult);
$buchung = $buchung[0];
// calculate open amount
$betragOffen = $betragBezahlt - $buchung->betrag*(-1);
$data = array(
'person_id' => $buchung->person_id,
'studiengang_kz' => $buchung->studiengang_kz,
'studiensemester_kurzbz' => $buchung->studiensemester_kurzbz,
'buchungsnr_verweis' => $buchungsnr,
'betrag' => str_replace(',','.',$betragOffen*(-1)),
'buchungsdatum' => date('Y-m-d'),
'buchungstext' => $buchung->buchungstext,
'insertamum' => date('Y-m-d H:i:s'),
'insertvon' => '',
'buchungstyp_kurzbz' => $buchung->buchungstyp_kurzbz,
);
return $this->insert($data);
}
else
{
return error('Failed to load Payment');
}
}
else
{
return error('Failed to load Payment');
}
}
}
+56 -27
View File
@@ -196,7 +196,7 @@ class Prestudent_model extends DB_Model
{
$this->addSelect('tbl_prestudent.*, tbl_studiengang.studiengang_kz, tbl_studiengang.kurzbzlang as studiengang, tbl_studiengang.bezeichnung as studiengangbezeichnung, tbl_studiengang.english as studiengangenglish,
tbl_studiengang.email as studiengangmail, tbl_studiengang.typ as studiengangtyp, tbl_studiengangstyp.bezeichnung as studiengangtyp_bez,
tbl_zgv.zgv_code, tbl_zgv.zgv_bez, tbl_prestudent.zgvnation as zgvnation_code, zgvnat.kurztext as zgvnation_kurzbez, zgvnat.langtext as zgvnation_bez, zgvnat.engltext as zgvnation_englbez,
tbl_zgv.zgv_code, tbl_zgv.zgv_bez, tbl_prestudent.zgvnation as zgvnation_code, zgvnat.kurztext as zgvnation_kurzbez, zgvnat.langtext as zgvnation_bez, zgvnat.engltext as zgvnation_englbez, zgvnat.nationengruppe_kurzbz as zgvnation_nationengruppe,
tbl_zgvmaster.zgvmas_code, tbl_zgvmaster.zgvmas_bez, tbl_prestudent.zgvmanation as zgvmanation_code, zgvmanat.kurztext as zgvmanation_kurzbez, zgvmanat.langtext as zgvmanation_bez, zgvmanat.engltext as zgvmanation_englbez');
$this->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
$this->addJoin('public.tbl_studiengangstyp', 'typ', 'LEFT');
@@ -209,66 +209,95 @@ class Prestudent_model extends DB_Model
if (!hasData($prestudent))
return error('prestudent could not be loaded');
$prestudentdata = getData($prestudent);
$prestudentdata = $prestudentdata[0];
//Prestudentstatus
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
if ($lastStatus->error)
if (isError($lastStatus))
{
return $lastStatus;
}
if (count($lastStatus->retval) > 0)
if (hasData($lastStatus))
{
$lastStatusData = getData($lastStatus);
$lastStatusData = $lastStatusData[0];
//get Studiengangname from Studienplan and -ordnung
$studienordnung = $this->PrestudentstatusModel->getStudienordnungFromPrestudent($prestudent_id);
if ($studienordnung->error)
if (isError($studienordnung))
return $studienordnung;
if (count($studienordnung->retval) > 0)
if (hasData($studienordnung))
{
$lastStatus->retval[0]->studiengang_kz = $studienordnung->retval[0]->studiengang_kz;
$lastStatus->retval[0]->studiengangkurzbzlang = $studienordnung->retval[0]->studiengangkurzbzlang;
$lastStatus->retval[0]->studiengangbezeichnung = $studienordnung->retval[0]->studiengangbezeichnung;
$lastStatus->retval[0]->studiengangbezeichnung_englisch = $studienordnung->retval[0]->studiengangbezeichnung_englisch;
$lastStatus->retval[0]->regelstudiendauer = $studienordnung->retval[0]->regelstudiendauer;
$studienordnungdata = getData($studienordnung);
$studienordnungdata = $studienordnungdata[0];
$lastStatusData->studiengang_kz = $studienordnungdata->studiengang_kz;
$lastStatusData->studiengangkurzbzlang = $studienordnungdata->studiengangkurzbzlang;
$lastStatusData->studiengangbezeichnung = $studienordnungdata->studiengangbezeichnung;
$lastStatusData->studiengangbezeichnung_englisch = $studienordnungdata->studiengangbezeichnung_englisch;
$lastStatusData->regelstudiendauer = $studienordnungdata->regelstudiendauer;
}
//get Sprache
$this->load->model('system/sprache_model', 'SpracheModel');
$this->SpracheModel->addSelect('sprache, locale, bezeichnung');
$language = $this->SpracheModel->load($lastStatus->retval[0]->sprache);
$language = $this->SpracheModel->load($lastStatusData->sprache);
if ($language->error)
if (isError($language))
return $language;
if (count($language->retval) > 0)
$lastStatus->retval[0]->sprachedetails = $language->retval[0];
if (hasData($language))
{
$languagedata = getData($language);
$languagedata = $languagedata[0];
$lastStatusData->sprachedetails = $languagedata;
}
//get Bewerbungsfrist
$this->load->model('crm/bewerbungstermine_model', 'BewerbungstermineModel');
$this->BewerbungstermineModel->addSelect('ende, nachfrist_ende');
$this->BewerbungstermineModel->addOrder('ende', 'DESC');
$this->BewerbungstermineModel->addOrder('updateamum', 'DESC');
$this->BewerbungstermineModel->addOrder('insertamum', 'DESC');
$this->BewerbungstermineModel->addOrder('ende');
$this->BewerbungstermineModel->addLimit(1);
$bewerbungstermin = $this->BewerbungstermineModel->loadWhere(
array(
'studienplan_id' => $lastStatus->retval[0]->studienplan_id,
'studiensemester_kurzbz' => $lastStatus->retval[0]->studiensemester_kurzbz,
'studiengang_kz' => $prestudent->retval[0]->studiengang_kz
)
$fristparams = array(
'studienplan_id' => $lastStatusData->studienplan_id,
'studiensemester_kurzbz' => $lastStatusData->studiensemester_kurzbz,
'studiengang_kz' => $prestudentdata->studiengang_kz
);
if (isset($prestudentdata->zgvnation_nationengruppe))
$fristparams['nationengruppe_kurzbz'] = $prestudentdata->zgvnation_nationengruppe;
$bewerbungstermin = $this->BewerbungstermineModel->loadWhere(
$fristparams
);
if ($bewerbungstermin->error)
if (isError($bewerbungstermin))
return $bewerbungstermin;
if (count($bewerbungstermin->retval) > 0)
if (hasData($bewerbungstermin))
{
$lastStatus->retval[0]->bewerbungstermin = $bewerbungstermin->retval[0]->ende;
$lastStatus->retval[0]->bewerbungsnachfrist = $bewerbungstermin->retval[0]->nachfrist_ende;
$bewerbungstermindata = getData($bewerbungstermin);
$bewerbungstermindata = $bewerbungstermindata[0];
$lastStatusData->bewerbungstermin = $bewerbungstermindata->ende;
$lastStatusData->bewerbungsnachfrist = $bewerbungstermindata->nachfrist_ende;
}
$prestudent->retval[0]->prestudentstatus = $lastStatus->retval[0];
$prestudentdata->prestudentstatus = $lastStatusData;
if ($this->hasUDF())
{
$prestudentdata->prestudentUdfs = $this->getUDFs($prestudent_id);
}
}
return success($prestudent->retval);
return success($prestudentdata);
}
/**
@@ -182,4 +182,30 @@ class Prestudentstatus_model extends DB_Model
return success(array());
}
}
/**
* getLastStatuses
*/
public function getLastStatusPerson($person_id, $studiensemester_kurzbz = null)
{
$query = 'SELECT *
FROM public.tbl_prestudent p
JOIN (
SELECT DISTINCT ON(prestudent_id) *
FROM public.tbl_prestudentstatus
WHERE prestudent_id IN (SELECT prestudent_id FROM public.tbl_prestudent WHERE person_id = ?)
ORDER BY prestudent_id, datum desc, insertamum desc
) ps USING(prestudent_id)
JOIN public.tbl_status USING(status_kurzbz)';
$parametersArray = array($person_id);
if ($studiensemester_kurzbz != '')
{
array_push($parametersArray, $studiensemester_kurzbz);
$query .= ' AND ps.studiensemester_kurzbz = ?';
}
return $this->execQuery($query, $parametersArray);
}
}
@@ -11,4 +11,106 @@ class Abschlusspruefung_model extends DB_Model
$this->dbTable = 'lehre.tbl_abschlusspruefung';
$this->pk = 'abschlusspruefung_id';
}
/**
* Gets data of an Abschlusspruefung, including Abschlussarbeit.
* @param $abschlusspruefung_id
* @return object
*/
public function getAbschlusspruefung($abschlusspruefung_id)
{
$this->load->model('crm/Student_model', 'StudentModel');
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
$abschlusspruefungdata = array();
$this->addSelect('tbl_abschlusspruefung.abschlusspruefung_id, tbl_abschlusspruefung.datum, tbl_abschlusspruefung.pruefungstyp_kurzbz AS studiengangstyp, tbl_abschlusspruefung.abschlussbeurteilung_kurzbz, tbl_abschlusspruefung.uhrzeit AS pruefungsbeginn, tbl_abschlusspruefung.endezeit AS pruefungsende,
tbl_abschlusspruefung.freigabedatum, tbl_abschlusspruefung_antritt.bezeichnung AS pruefungsantritt_bezeichnung, tbl_abschlusspruefung_antritt.bezeichnung_english AS pruefungsantritt_bezeichnung_english, tbl_abschlusspruefung.protokoll,
studentpers.vorname AS vorname_student, studentpers.nachname AS nachname_student, studentpers.titelpre AS titelpre_student, studentpers.titelpost AS titelpost_student, studentben.uid AS uid_student, matrikelnr,
vorsitzenderben.uid AS uid_vorsitz, vorsitzenderpers.vorname AS vorname_vorsitz, vorsitzenderpers.nachname AS nachname_vorsitz, vorsitzenderpers.titelpre AS titelpre_vorsitz, vorsitzenderpers.titelpost AS titelpost_vorsitz,
erstprueferpers.vorname AS vorname_erstpruefer, erstprueferpers.nachname AS nachname_erstpruefer, erstprueferpers.titelpre AS titelpre_erstpruefer, erstprueferpers.titelpost AS titelpost_erstpruefer,
zweitprueferpers.vorname AS vorname_zweitpruefer, zweitprueferpers.nachname AS nachname_zweitpruefer, zweitprueferpers.titelpre AS titelpre_zweitpruefer, zweitprueferpers.titelpost AS titelpost_zweitpruefer
');
$this->addJoin('lehre.tbl_abschlusspruefung_antritt', 'pruefungsantritt_kurzbz', 'LEFT');
$this->addJoin('public.tbl_benutzer studentben', 'tbl_abschlusspruefung.student_uid = studentben.uid');
$this->addJoin('public.tbl_person studentpers', 'studentben.person_id = studentpers.person_id');
$this->addJoin('public.tbl_student', 'studentben.uid = tbl_student.student_uid');
$this->addJoin('public.tbl_benutzer vorsitzenderben', 'vorsitz = vorsitzenderben.uid', 'LEFT');
$this->addJoin('public.tbl_person vorsitzenderpers', 'vorsitzenderben.person_id = vorsitzenderpers.person_id', 'LEFT');
$this->addJoin('public.tbl_person erstprueferpers', 'pruefer1 = erstprueferpers.person_id', 'LEFT');
$this->addJoin('public.tbl_person zweitprueferpers', 'pruefer2 = zweitprueferpers.person_id', 'LEFT');
$abschlusspruefung = $this->load($abschlusspruefung_id);
if (isError($abschlusspruefung))
return $abschlusspruefung;
elseif (hasData($abschlusspruefung))
{
$abschlusspruefungdata = getData($abschlusspruefung)[0];
// get Studiengang of Student
$student_uid = $abschlusspruefungdata->uid_student;
$this->StudentModel->addSelect('prestudent_id');
$prestudent_id = $this->StudentModel->load(array('student_uid' => $student_uid));
if (isError($prestudent_id))
return $prestudent_id;
elseif (hasData($prestudent_id))
{
//get Studiengangname from Studienplan and -ordnung
$studienordnung = $this->PrestudentstatusModel->getStudienordnungFromPrestudent(getData($prestudent_id)[0]->prestudent_id);
if (isError($studienordnung))
return $studienordnung;
elseif (hasData($studienordnung))
{
$studienordnungdata = getData($studienordnung)[0];
$abschlusspruefungdata->studiengang_kz = $studienordnungdata->studiengang_kz;
$abschlusspruefungdata->studiengangbezeichnung = $studienordnungdata->studiengangbezeichnung;
$abschlusspruefungdata->studiengangbezeichnung_englisch = $studienordnungdata->studiengangbezeichnung_englisch;
}
// if no Studienordnung available (e.g. Incomings), use Studiengangname provided by table student
elseif (!hasData($studienordnung))
{
$this->resetQuery();
$this->load->model('crm/Student_model', 'StudentModel');
$this->addSelect('studiengang_kz, bezeichnung, english');
$this->addJoin('public.tbl_studiengang', 'studiengang_kz');
$result = $this->StudentModel->load(array(
'student_uid' => $student_uid)
);
if ($result = getData($result)[0])
{
$abschlusspruefungdata->studiengang_kz = $result->studiengang_kz;
$abschlusspruefungdata->studiengangbezeichnung = $result->bezeichnung;
$abschlusspruefungdata->studiengangbezeichnung_englisch = $result->english;
}
}
// get Abschlussarbeit
if (isset($abschlusspruefungdata->studiengang_kz) && !empty($abschlusspruefungdata->studiengang_kz))
{
$projekttyp = array('Bachelor','Diplom','Master','Dissertation','Lizenziat','Magister');
$abschlussarbeit = $this->ProjektarbeitModel->getProjektarbeit($student_uid, $abschlusspruefungdata->studiengang_kz, null, $projekttyp, true);
if (isError($abschlussarbeit))
return $abschlussarbeit;
if (hasData($abschlussarbeit))
{
$abschlussarbeit = getData($abschlussarbeit)[0];
$abschlusspruefungdata->projektarbeit_studiengangstyp_name = $abschlussarbeit->projekttyp_kurzbz;
$abschlusspruefungdata->abschlussarbeit_titel = $abschlussarbeit->titel;
$abschlusspruefungdata->abschlussarbeit_note = $abschlussarbeit->note;
}
}
}
}
return success($abschlusspruefungdata);
}
}
@@ -119,9 +119,10 @@ class Lehrveranstaltung_model extends DB_Model
* Gets all students of a Lehrveranstaltung
* @param $studiensemester_kurzbz
* @param $lehrveranstaltung_id
* @param $active optional, if true, only active students retrieved, false - only inactive, all students otherwise
* @return array|null
*/
public function getStudentsByLv($studiensemester_kurzbz, $lehrveranstaltung_id)
public function getStudentsByLv($studiensemester_kurzbz, $lehrveranstaltung_id, $active = null)
{
$query = "SELECT
distinct on(nachname, vorname, person_id) vorname, nachname, matrikelnr,
@@ -144,8 +145,18 @@ class Lehrveranstaltung_model extends DB_Model
WHERE
vw_student_lehrveranstaltung.studiensemester_kurzbz=?
AND
vw_student_lehrveranstaltung.lehrveranstaltung_id=?
ORDER BY nachname, vorname, person_id, tbl_bisio.bis DESC";
vw_student_lehrveranstaltung.lehrveranstaltung_id=?";
if (isset($active))
{
if ($active === true)
$query .= " AND tbl_benutzer.aktiv";
elseif ($active === false)
$query .= " AND tbl_benutzer.aktiv = false";
}
$query .=
" ORDER BY nachname, vorname, person_id, tbl_bisio.bis DESC";
return $this->execQuery($query, array($studiensemester_kurzbz, $lehrveranstaltung_id));
}
@@ -11,4 +11,62 @@ class Projektarbeit_model extends DB_Model
$this->dbTable = 'lehre.tbl_projektarbeit';
$this->pk = 'projektarbeit_id';
}
/**
* Gets Projektarbeit(en) of a student for a Studiengang, Semester, Projekttyp, final.
* @param $student_uid
* @param $studiengang_kz
* @param $studiensemester_kurzbz
* @param $projekttyp
* @param $final
* @return object
*/
public function getProjektarbeit($student_uid, $studiengang_kz = null, $studiensemester_kurzbz = null, $projekttyp = null, $final = null)
{
$qry = "SELECT
tbl_projektarbeit.* , tbl_projekttyp.bezeichnung
FROM
lehre.tbl_projektarbeit
JOIN
lehre.tbl_projekttyp USING (projekttyp_kurzbz), lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung
WHERE
tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_projektarbeit.student_uid = ?";
$params = array($student_uid);
if (isset($studiengang_kz))
{
$qry .= ' AND tbl_lehrveranstaltung.studiengang_kz=?';
$params[] = $studiengang_kz;
}
if (isset($studiensemester_kurzbz))
{
$qry .= ' AND tbl_lehreinheit.studiensemester_kurzbz=?';
$params[] = $studiensemester_kurzbz;
}
if (isset($projekttyp))
{
if (is_array($projekttyp))
$qry .= ' AND tbl_projektarbeit.projekttyp_kurzbz IN ?';
else
$qry .= ' AND tbl_projektarbeit.projekttyp_kurzbz=?';
$params[] = $projekttyp;
}
if (isset($final))
{
$qry .= ' AND tbl_projektarbeit.final=?';
$params[] = $final;
}
$qry .= ' ORDER BY beginn DESC, projektarbeit_id DESC';
return $this->execQuery($qry, $params);
}
}
@@ -33,7 +33,7 @@ class Organisationseinheit_model extends DB_Model
FROM tree JOIN tbl_organisationseinheit oe ON (tree.oe_kurzbz = oe.oe_parent_kurzbz)
)
SELECT oe_kurzbz AS id,
SUBSTRING(REGEXP_REPLACE(path, '[A-z]+\|', '-', 'g') || bezeichnung, 2) AS description
SUBSTRING(REGEXP_REPLACE(path, '[A-z0-9]+\|', '-', 'g') || bezeichnung, 2) AS description
FROM tree";
$parametersArray = array();
@@ -14,7 +14,7 @@ class Studienjahr_model extends DB_Model
}
/**
* Gets current Studienjahr, as determined by its start and enddate
* Gets current Studienjahr, as determined by start and enddate of current semester
* @return array|null
*/
public function getCurrStudienjahr()
@@ -39,7 +39,7 @@ class Studiensemester_model extends DB_Model
$days = 60;
}
$query = 'SELECT studiensemester_kurzbz
$query = 'SELECT studiensemester_kurzbz, start, ende
FROM public.tbl_studiensemester
WHERE start < NOW() - \'' . $days . ' DAYS\'::INTERVAL
ORDER BY start DESC
@@ -59,7 +59,7 @@ class Studiensemester_model extends DB_Model
$days = 62;
}
$query = 'SELECT studiensemester_kurzbz
$query = 'SELECT studiensemester_kurzbz, start, ende
FROM public.tbl_studiensemester
WHERE start < NOW() + \'' . $days . ' DAYS\':: INTERVAL
ORDER BY start DESC
+5 -3
View File
@@ -14,12 +14,14 @@ class Adresse_model extends DB_Model
/**
* gets person data from uid
* @param $uid
* Get Zustelladress of given person.
* @param string $person_id
* @param string $select
* @return array
*/
public function getZustellAdresse($person_id)
public function getZustellAdresse($person_id, $select = '*')
{
$this->addSelect($select);
return $this->loadWhere(array('person_id' => $person_id, 'zustelladresse'=> true));
}
}
@@ -33,4 +33,67 @@ class Benutzer_model extends DB_Model
return $this->execQuery($sql, array($person_id, $oe_kurzbz));
}
/**
* Checks if alias exists
* @param $alias
*/
public function aliasExists($alias)
{
$this->addSelect('1');
$result = $this->loadWhere(array('alias' => $alias));
if (isSuccess($result))
{
if (hasData($result))
{
$result = success(array(true));
}
else
{
$result = success(array(false));
}
}
return $result;
}
/**
* Generates alias for a uid.
* @param $uid
* @return array the alias if newly generated
*/
public function generateAlias($uid)
{
$aliasres = '';
$this->addLimit(1);
$this->addSelect('vorname, nachname');
$this->addJoin('public.tbl_person', 'person_id');
$nameresult = $this->loadWhere(array('uid' => $uid));
if (hasData($nameresult))
{
$aliasdata = getData($nameresult);
$alias = $this->_sanitizeAliasName($aliasdata[0]->vorname).'.'.$this->_sanitizeAliasName($aliasdata[0]->nachname);
$aliasexists = $this->aliasExists($alias);
if (hasData($aliasexists) && !getData($aliasexists)[0])
$aliasres = $alias;
}
return success($aliasres);
}
// --------------------------------------------------------------------------------------------
// Private methods
/**
* Sanitizes a string used for alias. Replaces special characters, spaces, sets lower case.
* @param string $str
* @return string
*/
private function _sanitizeAliasName($str)
{
$str = sanitizeProblemChars($str);
return mb_strtolower(str_replace(' ','_', $str));
}
}
@@ -12,6 +12,44 @@ class Benutzerfunktion_model extends DB_Model
$this->pk = 'benutzerfunktion_id';
}
/**
* Lädt alle Benutzerfunktionen zu einer UID
* @param type $uid UID des Mitarbeiters
* @param type $funktion_kurzbz OPTIONAL Kurzbezeichnung der Funktion
* @param type $startZeitraum OPTIONAL Start Zeitraum in dem die Funktion aktiv ist
* @param type $endeZeitraum OPTIONAL Ende Zeitraum in dem die Funktion aktiv ist
* @return boolean
*/
public function getBenutzerFunktionByUid($uid, $funktion_kurzbz=null, $startZeitraum=null, $endeZeitraum=null)
{
$params = array($uid);
$qry = "SELECT tbl_benutzerfunktion.*, tbl_organisationseinheit.bezeichnung as organisationseinheit_bezeichnung,
tbl_organisationseinheit.organisationseinheittyp_kurzbz
FROM public.tbl_benutzerfunktion
LEFT JOIN public.tbl_organisationseinheit USING(oe_kurzbz)
WHERE uid=?";
if(!is_null($funktion_kurzbz))
{
$qry .= ' AND funktion_kurzbz = ?';
$params[] = $funktion_kurzbz;
}
if(!is_null($startZeitraum))
{
$qry .=' AND (datum_bis IS NULL OR datum_bis >= ?)';
$params[] = $startZeitraum;
}
if(!is_null($endeZeitraum))
{
$qry .=' AND (datum_von IS NULL OR datum_von <= ?)';
$params[] = $endeZeitraum;
}
$qry .= "ORDER BY datum_bis NULLS LAST, datum_von NULLS LAST;";
return $this->execQuery($qry, $params);
}
/**
* Get the Benutzerfunktion using the person_id
*/
+139
View File
@@ -10,6 +10,7 @@ class Kontakt_model extends DB_Model
parent::__construct();
$this->dbTable = 'public.tbl_kontakt';
$this->pk = 'kontakt_id';
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
}
public function getWholeKontakt($kontakt_id, $person_id = null, $kontakttyp = null)
@@ -59,4 +60,142 @@ class Kontakt_model extends DB_Model
return $this->execQuery($sql, array($person_id, $kontakttyp));
}
/**
* Laedt einen Kontakt eines Standortes
* Es wird nur der erste Eintrag zurueckgeliefert!
* @param $standort_id
* @param $kontakttyp
*/
public function getFirmaKontakttyp($standort_id, $kontakttyp)
{
if (!is_numeric($standort_id))
{
return error('StandortID ist ungueltig');
}
$qry = "SELECT kontakt, kontakt_id FROM public.tbl_kontakt WHERE standort_id=? AND kontakttyp=? ORDER BY kontakt_id LIMIT 1;";
return $this->execQuery($qry, array('standort_id' => $standort_id, 'kontakttyp' => $kontakttyp));
}
/**
* Gets Firmentelefon for a uid, can be Vorwahl with Telefonklappe or Firmenhandy
* @param $uid
*/
public function getFirmentelefon($uid)
{
$firmentelefon = success(array());
$this->MitarbeiterModel->addSelect('standort_id, telefonklappe, person_id');
$this->MitarbeiterModel->addJoin('public.tbl_benutzer', 'tbl_mitarbeiter.mitarbeiter_uid = tbl_benutzer.uid');
$mitarbeiter = $this->MitarbeiterModel->load(array('uid' => $uid));
if (hasData($mitarbeiter))
{
$mitarbeiter = getData($mitarbeiter);
if (isEmptyString($mitarbeiter[0]->telefonklappe))
{
$this->addSelect('kontakt');
$this->addOrder('updateamum, insertamum', 'DESC');
$this->addLimit(1);
$firmenhandy = $this->loadWhere(array('person_id' => $mitarbeiter[0]->person_id, 'kontakttyp' => 'firmenhandy'));
if (hasData($firmenhandy))
{
$firmenhandy = getData($firmenhandy);
$firmentelefon = success(array('kontakt' => $firmenhandy[0]->kontakt, 'telefonklappe' => ''));
}
}
else
{
$firmaKontakttyp = $this->getFirmaKontakttyp($mitarbeiter[0]->standort_id, 'telefon');
if (hasData($firmaKontakttyp))
{
$vorwahl = getData($firmaKontakttyp);
$vorwahl = $vorwahl[0]->kontakt;
$firmentelefon = success(array('kontakt' => $vorwahl, 'telefonklappe' => $mitarbeiter[0]->telefonklappe));
}
}
}
return $firmentelefon;
}
/**
* Get all latest contact data of person, where Zustellung is true
* @param $person_id
* @return array
*/
public function getAll_byPersonID($person_id)
{
$this->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt');
$this->addJoin('public.tbl_standort', 'standort_id', 'LEFT');
$this->addJoin('public.tbl_firma', 'firma_id', 'LEFT');
$this->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum');
return $this->loadWhere(array(
'zustellung' => TRUE,
'person_id' => $person_id
));
}
/**
* Get all latest phones of person where zustellung is true. Ordered by
* telefon > mobil > firmenhandy > else.
* @param string person_id
*/
public function getPhones_byPerson($person_id)
{
$qry = '
WITH latest_phones AS(
SELECT DISTINCT ON (kontakttyp) kontakttyp, kontakt
FROM public.tbl_kontakt kontakt
LEFT JOIN public.tbl_standort USING (standort_id)
LEFT JOIN public.tbl_firma USING (firma_id)
WHERE person_id = ?
AND zustellung
AND kontakttyp IN (\'telefon\', \'mobil\', \'firmenhandy\')
ORDER BY kontakttyp, kontakt, kontakt.updateamum
)
SELECT * FROM latest_phones
ORDER BY
CASE
WHEN kontakttyp = \'telefon\' THEN 0
WHEN kontakttyp = \'mobil\' THEN 1
WHEN kontakttyp = \'firmenhandy\' THEN 2
ELSE 3
END
';
return $this->execQuery($qry, array($person_id));
}
/**
* Loads main contact, i.e. most recent Zustellkontakt with the given kontakttypes.
* @param $person_id
* @param $kontakttypen array of kontakttypen, one chronologically last Zustellkontakt for all given types
* @return object
*/
public function getZustellKontakt($person_id, $kontakttypen)
{
if (is_string($kontakttypen))
$kontakttypen = array($kontakttypen);
if (!isEmptyArray($kontakttypen))
{
$qry = "
SELECT
kontakt
FROM
public.tbl_kontakt
WHERE person_id = ?
AND kontakttyp IN ?
ORDER BY zustellung DESC NULLS LAST, updateamum DESC, insertamum DESC
LIMIT 1";
return $this->execQuery($qry, array($person_id, $kontakttypen));
}
else
return success(array());
}
}
@@ -1,7 +1,6 @@
<?php
class Betriebsmittelperson_model extends DB_Model
{
/**
* Constructor
*/
@@ -11,4 +10,45 @@ class Betriebsmittelperson_model extends DB_Model
$this->dbTable = 'wawi.tbl_betriebsmittelperson';
$this->pk = 'betriebsmittelperson_id';
}
/**
* Get Betriebsmittel by person.
* @param string $person_id
* @param string $betriebsmitteltyp
* @param bool $isRetourniert False to retrieve only active Betriebsmittel.
* @return array|bool
*/
public function getBetriebsmittel($person_id, $betriebsmitteltyp = null, $isRetourniert = null)
{
if (!is_numeric($person_id))
{
$this->errormsg = 'Person_id type is not valid.';
return false;
}
$this->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id');
$condition = '
person_id = '. $this->escape($person_id). '
';
if (is_string($betriebsmitteltyp)) {
$condition .= '
AND betriebsmitteltyp = ' . $this->escape($betriebsmitteltyp);
}
if ($isRetourniert === true) {
$condition .= '
AND retouram IS NOT NULL'; // return date is given
}
elseif ($isRetourniert === false)
{
$condition .= '
AND retouram IS NULL'; // default
}
$this->addOrder('ausgegebenam', 'DESC'); // default
return $this->loadWhere($condition);
}
}
@@ -40,4 +40,166 @@ class Mitarbeiter_model extends DB_Model
return success(false);
}
}
/**
* Laedt das Personal
*
* @param $aktiv wenn true werden nur aktive geladen, wenn false dann nur inaktve, wenn null dann alle
* @param $fix wenn true werden nur fixangestellte geladen
* @param $verwendung wenn true werden alle geladen die eine BIS-Verwendung eingetragen haben
* @param $personaccount wenn true werden alle geladen die personalnr >= 0 haben, also "echte" Personaccounts
* @return array
*/
public function getPersonal($aktiv, $fix, $verwendung, $personaccount = null, $uids = null)
{
$qry = "SELECT DISTINCT ON(mitarbeiter_uid) staatsbuergerschaft, geburtsnation, sprache, anrede, titelpost, titelpre,
nachname, vorname, vornamen, gebdatum, gebort, gebzeit, tbl_person.anmerkung AS person_anmerkung, homepage, svnr, ersatzkennzeichen, familienstand,
geschlecht, anzahlkinder, tbl_person.insertamum AS person_insertamum, tbl_person.updateamum as person_updateamum,
tbl_person.updatevon AS person_updatevon, kompetenzen, kurzbeschreibung, zugangscode, zugangscode_timestamp, bpk,
tbl_benutzer.*, tbl_mitarbeiter.*, akt_funk.oe_kurzbz AS funktionale_zuordnung, akt_funk.wochenstunden
FROM ((public.tbl_mitarbeiter JOIN public.tbl_benutzer ON(mitarbeiter_uid=uid))
JOIN public.tbl_person USING(person_id))
LEFT JOIN public.tbl_benutzerfunktion USING(uid)
LEFT JOIN public.tbl_benutzerfunktion akt_funk ON tbl_mitarbeiter.mitarbeiter_uid = akt_funk.uid AND akt_funk.funktion_kurzbz = 'fachzuordnung'
AND (akt_funk.datum_von IS NULL OR akt_funk.datum_von <= now()) AND (akt_funk.datum_bis IS NULL OR akt_funk.datum_bis >= now())
WHERE true";
if ($fix === true)
$qry .= " AND fixangestellt=true";
elseif ($fix === false)
$qry .= " AND fixangestellt=false";
if ($aktiv === true)
$qry .= " AND tbl_benutzer.aktiv=true";
elseif ($aktiv === false)
$qry .= " AND tbl_benutzer.aktiv=false";
if ($verwendung === true)
{
$qry.=" AND EXISTS(SELECT * FROM bis.tbl_bisverwendung WHERE (ende>now() or ende is null) AND tbl_bisverwendung.mitarbeiter_uid=tbl_mitarbeiter.mitarbeiter_uid)";
}
elseif ($verwendung === false)
{
$qry.=" AND NOT EXISTS(SELECT * FROM bis.tbl_bisverwendung WHERE (ende>now() or ende is null) AND tbl_bisverwendung.mitarbeiter_uid=tbl_mitarbeiter.mitarbeiter_uid)";
}
if ($personaccount === true)
$qry .= " AND tbl_mitarbeiter.personalnummer >= 0";
elseif ($personaccount === false)
$qry .= " AND tbl_mitarbeiter.personalnummer < 0";
$params = array();
if (!isEmptyArray($uids))
{
$qry .= " AND tbl_mitarbeiter.mitarbeiter_uid IN ?";
$params[] = $uids;
}
return $this->execQuery($qry, $params);
}
/**
* Gibt ein Array mit den UIDs der Vorgesetzten zurück
* @return object
*/
public function getVorgesetzte($uid, $datum_von = null, $datum_bis = null)
{
$datum_von_var = isset($datum_von) ? '?' : 'now()';
$datum_bis_var = isset($datum_bis) ? '?' : 'now()';
$qry = "SELECT
DISTINCT uid as vorgesetzter
FROM
public.tbl_benutzerfunktion
WHERE
funktion_kurzbz='Leitung' AND
(datum_von is null OR datum_von<=%s) AND
(datum_bis is null OR datum_bis>=%s) AND
oe_kurzbz in (SELECT oe_kurzbz
FROM public.tbl_benutzerfunktion
WHERE
funktion_kurzbz='oezuordnung' AND uid=? AND
(datum_von is null OR datum_von<=%s) AND
(datum_bis is null OR datum_bis>=%s)
);";
$qry = sprintf($qry, $datum_von_var, $datum_bis_var, $datum_von_var, $datum_bis_var);
$params = array();
if (isset($datum_von))
$params[] = $datum_von;
if (isset($datum_bis))
$params[] = $datum_bis;
$params[] = $uid;
if (isset($datum_von))
$params[] = $datum_von;
if (isset($datum_bis))
$params[] = $datum_bis;
return $this->execQuery($qry, $params);
}
/**
* Checks if alias exists
* @param $kurzbz
*/
public function kurzbzExists($kurzbz)
{
$this->addSelect('1');
$result = $this->loadWhere(array('kurzbz' => $kurzbz));
if (isSuccess($result))
{
if (hasData($result))
{
$result = success(array(true));
}
else
{
$result = success(array(false));
}
}
return $result;
}
/**
* Generates alias for a uid.
* @param $uid
* @return array the alias if newly generated
*/
public function generateKurzbz($uid)
{
$kurzbz = '';
$this->addLimit(1);
$this->addSelect('vorname, nachname');
$this->addJoin('public.tbl_benutzer', 'tbl_mitarbeiter.mitarbeiter_uid = tbl_benutzer.uid');
$this->addJoin('public.tbl_person', 'person_id');
$nameresult = $this->loadWhere(array('uid' => $uid));
if (hasData($nameresult))
{
$kurzbzdata = getData($nameresult);
$nachname_clean = sanitizeProblemChars($kurzbzdata[0]->nachname);
$vorname_clean = sanitizeProblemChars($kurzbzdata[0]->vorname);
for ($nn = 6, $vn = 2; $nn != 0; $nn--, $vn++)
{
$kurzbz = mb_substr($nachname_clean, 0, $nn);
$kurzbz .= mb_substr($vorname_clean, 0, $vn);
$kurzbzexists = $this->kurzbzExists($kurzbz);
if (hasData($kurzbzexists) && !getData($kurzbzexists)[0])
break;
}
$kurzbzexists = $this->kurzbzExists($kurzbz);
if (hasData($kurzbzexists) && getData($kurzbzexists)[0])
return error('No Kurzbezeichnung could be generated');
}
return success($kurzbz);
}
}
@@ -11,4 +11,14 @@ class Zeitaufzeichnung_model extends DB_Model
$this->dbTable = 'campus.tbl_zeitaufzeichnung';
$this->pk = 'zeitaufzeichnung_id';
}
public function deleteEntriesForCurrentDay()
{
$today = date('Y-m-d');
$qry = "DELETE FROM " . $this->dbTable . "
WHERE start >= '" . $today . " 00:00:00'
AND start <= '" . $today . " 23:59:59';";
return $this->execQuery($qry);
}
}
@@ -11,4 +11,13 @@ class Zeitsperre_model extends DB_Model
$this->dbTable = 'campus.tbl_zeitsperre';
$this->pk = 'zeitsperre_id';
}
public function deleteEntriesForCurrentDay()
{
$today = date('Y-m-d');
$qry = "DELETE FROM " . $this->dbTable . "
WHERE vondatum = '" . $today . "';";
return $this->execQuery($qry);
}
}
-169
View File
@@ -1,169 +0,0 @@
<?php
class FAS_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';
/**
* 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;
}
}
@@ -0,0 +1,16 @@
<?php
class JobStatuses_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'system.tbl_jobstatuses';
$this->pk = 'status';
$this->hasSequence = false;
}
}
@@ -0,0 +1,32 @@
<?php
class JobTriggers_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'system.tbl_jobtriggers';
$this->pk = array('type', 'status', 'followingType');
$this->hasSequence = false;
}
/**
*
*/
public function getJobtriggersByTypeStatuses($type, $triggeredStatuses)
{
$query = 'SELECT jt.type,
jt.status,
jt.following_type
FROM system.tbl_jobtriggers jt
WHERE jt.type = ?
AND jt.status IN ?
ORDER BY jt.type, jt.status';
return $this->execQuery($query, array($type, $triggeredStatuses));
}
}
@@ -0,0 +1,16 @@
<?php
class JobTypes_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'system.tbl_jobtypes';
$this->pk = 'type';
$this->hasSequence = false;
}
}
@@ -0,0 +1,15 @@
<?php
class JobsQueue_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'system.tbl_jobsqueue';
$this->pk = 'jobid';
}
}
@@ -1,175 +1,202 @@
<?php
$this->load->view(
'templates/FHC-Header',
array(
'title' => 'Lehrauftrag annehmen',
'jquery' => true,
'jqueryui' => true,
'jquerycheckboxes' => true,
'bootstrap' => true,
'fontawesome' => true,
'sbadmintemplate' => false,
'tabulator' => true,
'momentjs' => true,
'ajaxlib' => true,
'dialoglib' => true,
'tablewidget' => true,
'phrases' => array(
'global' => array('lehrauftraegeAnnehmen'),
),
'customJSs' => array(
'public/js/bootstrapper.js',
'public/js/lehre/lehrauftrag/acceptLehrauftrag.js')
)
'templates/FHC-Header',
array(
'title' => 'Lehrauftrag annehmen',
'jquery' => true,
'jqueryui' => true,
'jquerycheckboxes' => true,
'bootstrap' => true,
'fontawesome' => true,
'sbadmintemplate' => false,
'tabulator' => true,
'momentjs' => true,
'ajaxlib' => true,
'dialoglib' => true,
'tablewidget' => true,
'phrases' => array(
'global' => array(
'lehrauftraegeAnnehmen',
'dokumentePDF',
'PDFLehrauftraegeFH',
'PDFLehrauftraegeLehrgaenge'
),
'ui' => array(
'anzeigen',
'alleAnzeigen',
'nurBestellteAnzeigen',
'nurErteilteAnzeigen',
'nurAngenommeneAnzeigen',
'nurStornierteAnzeigen',
'hilfeZuDieserSeite',
'alleAuswaehlen',
'alleAbwaehlen',
'ausgewaehlteZeilen',
'hilfe',
'tabelleneinstellungen',
'keineDatenVorhanden',
'spaltenEinstellen',
'bestelltVon',
'erteiltVon',
'angenommenVon',
'storniertVon',
'lehrauftragInBearbeitung',
'wartetAufErteilung',
'wartetAufErneuteErteilung',
'letzterStatusBestellt',
'letzterStatusErteilt',
'letzterStatusAngenommen',
'vertragWurdeStorniert',
),
'password' => array('password'),
'dms' => array('informationsblattExterneLehrende'),
'table' => array(
'spaltenEinAusblenden',
'spaltenEinAusblendenMitKlickOeffnen',
'spaltenEinAusblendenAufEinstellungenKlicken',
'spaltenEinAusblendenMitKlickAktivieren',
'spaltenEinAusblendenMitKlickSchliessen',
'spaltenbreiteVeraendern',
'spaltenbreiteVeraendernText',
'spaltenbreiteVeraendernInfotext',
'zeilenAuswaehlen',
'zeilenAuswaehlenEinzeln',
'zeilenAuswaehlenBereich',
'zeilenAuswaehlenAlle'
),
'lehre' => array(
'lehrauftraegeAnnehmen',
'lehrauftraegeAnnehmenText',
'lehrauftraegeAnnehmenKlickStatusicon',
'lehrauftraegeAnnehmenLehrauftraegeWaehlen',
'lehrauftraegeAnnehmenMitKlickAnnehmen',
'lehrauftraegeNichtAuswaehlbar',
'lehrauftraegeNichtAuswaehlbarTextBeiAnnahme',
'filterAlleBeiAnnahme',
'filterErteiltBeiAnnahme',
'filterAngenommen'
)
),
'customJSs' => array(
'public/js/bootstrapper.js',
'public/js/lehre/lehrauftrag/acceptLehrauftrag.js')
)
);
?>
<body>
<div id="page-wrapper">
<div class="container-fluid">
<div class="container-fluid">
<!-- title & helper link -->
<div class="row">
<div class="col-lg-12 page-header">
<div class="row">
<div class="col-lg-12 page-header">
<a class="pull-right" data-toggle="collapse" href="#collapseHelp" aria-expanded="false" aria-controls="collapseExample">
Hilfe zu dieser Seite
<?php echo $this->p->t('ui', 'hilfeZuDieserSeite'); ?>
</a>
<h3>
<?php echo ucfirst($this->p->t('global', 'lehrauftraegeAnnehmen')); ?>
</h3>
<?php echo ucfirst($this->p->t('global', 'lehrauftraegeAnnehmen')); ?>
</h3>
</div>
</div>
</div>
<!-- helper collapse module -->
<div class="row">
<div class="col-lg-12 collapse" id="collapseHelp">
<div class="well">
<h4>Wie nehme ich Lehraufträge an?</h4>
<div class="panel panel-body">
Sobald Ihnen ein oder mehrere Lehraufträge erteilt wurden, können Sie diese annehmen.
<ol>
<li>Klicken Sie unten auf das Status-Icon 'Nur erteilte anzeigen' oder 'Alle anzeigen'</li>
<li>Wählen Sie die Lehraufträge, die Sie annehmen möchten, selbst oder alle über den Button 'Alle auswählen'.</li>
<li>Geben Sie Ihr CIS-Passwort ein und klicken auf Lehrauftrag annehmen.</li>
</ol>
</div>
<br>
<h4>Warum kann ich manche Lehraufträge nicht auswählen?</h4>
<div class="panel panel-body">
Nur Lehraufträge mit dem Status 'erteilt' können gewählt werden.<br>
Angenommene Lehraufträge oder Lehraufträge in Bearbeitung werden nur zu Ihrer Information angezeigt.
</div>
<br>
<h4>Filter</h4>
<div class="panel panel-body">
<div class="col-xs-12 col-md-8 col-lg-6">
<table class="table table-bordered">
<tr class="text-center">
<td class="col-xs-1"><i class='fa fa-users'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-check.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-handshake-o'></i></td>
</tr>
<tr class="text-center">
<td><b>Alle</b><br>Alle Lehraufträge mit jedem Status</td>
<td><b>Erteilt</b><br>Nur erteilte UND geänderte Lehraufträge, die in Bearbeitung sind</td>
<td><b>Angenommen</b><br>Nur von Ihnen angenommene Lehraufträge</td>
</tr>
</table>
</div>
</div>
<br>
<h4>Auswahl</h4>
<div class="panel panel-body">
<ul>
<li>Einzeln auswählen: <kbd>Strg</kbd> + Klick auf einzelne Zeile(n)</li>
<li>Bereich auswählen: <kbd>Shift</kbd> + Klick auf Anfangs- und Endzeile</li>
<li>Alle auswählen: Button 'Alle auswählen'</li>
</ul>
</div>
<br>
<h4>Ansicht</h4>
<div class="panel panel-body">
<b>Spaltenbreite verändern</b>
<p>
Um die Spaltenbreite zu verändern, fährt man im Spaltenkopf langsam mit dem Mauszeiger auf
den rechten Rand der entprechenden Spalte. <br>
Sobald sich der Mauszeiger in einen Doppelpfeil verwandelt, wird die Maustaste geklickt und
mit gedrückter Maustaste die Spalte nach rechts erweitert oder nach links verkleinert.
</p>
</div>
<br>
</div>
<?php $this->load->view('lehre/lehrauftrag/acceptLehrauftragHelp') ?>
</div> <!--./well-->
</div>
</div>
<!-- dropdown widgets -->
<div class="row">
<div class="col-lg-12">
<form id="formLehrauftrag" class="form-inline" action="" method="get">
<div class="form-group">
<?php
echo $this->widgetlib->widget(
'Studiensemester_widget',
array(
DropdownWidget::SELECTED_ELEMENT => $studiensemester_selected
),
array(
'name' => 'studiensemester',
'id' => 'studiensemester'
)
);
?>
</div>
<button type="submit" name="submit" value="anzeigen" class="btn btn-default form-group">Anzeigen</button>
</form>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<form id="formLehrauftrag" class="form-inline" action="" method="get">
<input type="hidden" id="uid" name="uid" value="<?php echo getAuthUID(); ?>">
<div class="form-group">
<?php
echo $this->widgetlib->widget(
'Studiensemester_widget',
array(
DropdownWidget::SELECTED_ELEMENT => $studiensemester_selected
),
array(
'name' => 'studiensemester',
'id' => 'studiensemester'
)
);
?>
</div>
<button type="submit" name="submit" value="anzeigen" class="btn btn-default form-group"><?php echo ucfirst($this->p->t('ui', 'anzeigen')); ?></button>
</form>
</div>
</div>
<!-- tabulator data table 'Lehrauftraege annehmen'-->
<div class="row">
<div class="col-lg-12">
<?php $this->load->view('lehre/lehrauftrag/acceptLehrauftragData.php'); ?>
</div>
</div>
<br>
<div class="row">
<div class="col-lg-12">
<?php $this->load->view('lehre/lehrauftrag/acceptLehrauftragData.php'); ?>
</div>
</div>
<br>
<!-- filter buttons & password field & akzeptieren-button -->
<div class="row">
<div class="col-xs-6">
<div class="btn-toolbar" role="toolbar">
<div class="btn-group" role="group">
<button id="show-all" class="btn btn-default btn-lehrauftrag active focus" type="button"
data-toggle="tooltip" data-placement="left" title="Alle anzeigen"><i class='fa fa-users'></i>
<!-- link for external lectors 'Informationsblatt fuer externe Lehrende'. Show only for external lecturers -->
<?php if ($is_external_lector): ?>
<div class="row">
<div class="col-xs-12">
<span class="pull-right"><?php echo $this->p->t('dms' , 'informationsblattExterneLehrende'); ?></span>
</div>
</div>
<br>
<?php endif; ?>
<!-- filter buttons & PDF downloads & password field & akzeptieren-button -->
<div class="row">
<div class="col-xs-5 col-md-4">
<div class="btn-toolbar" role="toolbar">
<div class="btn-group" role="group">
<button id="show-all" class="btn btn-default btn-lehrauftrag active focus" type="button"
data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'alleAnzeigen'); ?>"><i class='fa fa-users'></i>
</button>
<button id="show-approved" class="btn btn-default btn-lehrauftrag" type="button"
data-toggle="tooltip" data-placement="left" title="Nur erteilte anzeigen">
<button id="show-approved" class="btn btn-default btn-lehrauftrag" type="button"
data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurErteilteAnzeigen'); ?>">
</button><!-- png img set in javascript -->
<button id="show-accepted" class="btn btn-default btn-lehrauftrag" type="button"
data-toggle="tooltip" data-placement="left" title="Nur angenommene anzeigen"><i class='fa fa-handshake-o'></i>
<button id="show-accepted" class="btn btn-default btn-lehrauftrag" type="button"
data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurAngenommeneAnzeigen'); ?>"><i class='fa fa-handshake-o'></i>
</button>
</div>
</div>
<button id="show-cancelled" class="btn btn-default btn-lehrauftrag" type="button" style="margin-left: 20px;"
data-toggle="collapse" data-placement="left" title="Stornierte anzeigen"
data-toggle="collapse" data-placement="left" title="<?php echo $this->p->t('ui', 'nurStornierteAnzeigen'); ?>"
data-target ="#collapseCancelledLehrauftraege" aria-expanded="false" aria-controls="collapseExample">
</button><!-- png img set in javascript -->
</div>
</div>
<div class="col-md-offset-2 col-md-4 col-xs-6">
</div>
</div>
<div class="col-xs-3 col-md-offset-2 col-md-2">
<div class="btn-group dropup pull-right">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<?php echo $this->p->t('global', 'dokumentePDF'); ?>&nbsp;&nbsp;<i class="fa fa-arrow-down"></i>&nbsp;&nbsp;&nbsp;&nbsp;<span class="caret"></span>
</button>
<ul id="ul-download-pdf" class="dropdown-menu">
<li value="etw"><a href="#"><?php echo $this->p->t('global', 'PDFLehrauftraegeFH'); ?></a></li>
<li value="lehrgang"><a href="#"><?php echo $this->p->t('global', 'PDFLehrauftraegeLehrgaenge'); ?></a></li>
</ul>
</div>
</div>
<div class="col-xs-4 col-md-offset-0 col-md-4">
<div class="input-group">
<input id="username" type="hidden" value=""><!-- this is to prevent Chrome autofilling a random input field with the username-->
<input id="password" type="password" autocomplete="new-password" class="form-control" placeholder="CIS-Passwort">
<input id="username" type="hidden" autocomplete="username" value=""><!-- this is to prevent Chrome autofilling a random input field with the username-->
<input id="password" type="password" autocomplete="new-password" class="form-control" placeholder="CIS-<?php echo ucfirst($this->p->t('password', 'password')); ?>">
<span class="input-group-btn">
<button id="accept-lehrauftraege" class="btn btn-primary pull-right">Lehrauftrag annehmen</button>
<button id="accept-lehrauftraege" class="btn btn-primary pull-right"><?php echo ucfirst($this->p->t('global', 'lehrauftraegeAnnehmen')); ?></button>
</span>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
@@ -192,7 +219,7 @@ $this->load->view(
<br>
</div>
</div>
</div><!-- end container -->
</div><!-- end container -->
</div><!-- end page-wrapper -->
<br>
</body>
@@ -9,19 +9,19 @@ $query = '
SELECT
/* provide extra row index for tabulator, because no other column has unique ids */
ROW_NUMBER() OVER () AS "row_index",
auftrag,
stg_typ_kurzbz,
gruppe,
typ,
lehreinheit_id,
lehrveranstaltung_id,
projektarbeit_id,
studiensemester_kurzbz,
studiengang_kz,
stg_typ_kurzbz,
semester,
orgform_kurzbz,
person_id,
typ,
auftrag,
lv_oe_kurzbz,
gruppe,
stunden,
betrag,
vertrag_id,
@@ -297,40 +297,39 @@ $filterWidgetArray = array(
'tableUniqueId' => 'acceptLehrauftrag',
'requiredPermissions' => 'lehre/lehrauftrag_akzeptieren',
'datasetRepresentation' => 'tabulator',
'columnsAliases' => array( // TODO: use phrasen
'columnsAliases' => array(
'Status', // alias for row_index, because row_index is formatted to display the status icons
'LV-Teil',
'LV-ID',
'PA-ID',
'Studiensemester',
'Studiengang-KZ',
'Studiengang',
ucfirst($this->p->t('lehre', 'lehrveranstaltung')). '- / '.
ucfirst($this->p->t('ui', 'projekt')). lcfirst($this->p->t('ui', 'bezeichnung')),
ucfirst($this->p->t('lehre', 'studiengang')),
ucfirst($this->p->t('lehre', 'gruppe')),
ucfirst($this->p->t('global', 'typ')),
ucfirst($this->p->t('lehre', 'lehreinheit')),
ucfirst($this->p->t('lehre', 'lehrveranstaltung')). '-ID',
ucfirst($this->p->t('ui', 'projektarbeit')). '-ID',
ucfirst($this->p->t('lehre', 'studiensemester')),
ucfirst($this->p->t('lehre', 'studiengang')). '-'. ucfirst($this->p->t('ui', 'kz')),
'Semester',
'OrgForm',
ucfirst($this->p->t('lehre', 'organisationsform')),
'Person-ID',
'Typ',
'LV- / Projektbezeichnung',
'Organisationseinheit',
'Gruppe',
'Stunden',
'Betrag',
'Vertrag-ID',
'Vertrag-Stunden',
'Vertrag-Betrag',
ucfirst($this->p->t('lehre', 'organisationseinheit')),
ucfirst($this->p->t('ui', 'stunden')),
ucfirst($this->p->t('ui', 'betrag')),
ucfirst($this->p->t('ui', 'vertrag')). '-ID',
ucfirst($this->p->t('ui', 'vertrag')). '-'. ucfirst($this->p->t('ui', 'stunden')),
ucfirst($this->p->t('ui', 'vertrag')). '-'. ucfirst($this->p->t('ui', 'betrag')),
'UID',
'Bestellt',
'Erteilt',
'Angenommen',
'Bestellt von',
'Erteilt von',
'Angenommen von'
ucfirst($this->p->t('ui', 'bestellt')),
ucfirst($this->p->t('ui', 'erteilt')),
ucfirst($this->p->t('ui', 'angenommen')),
ucfirst($this->p->t('ui', 'bestelltVon')),
ucfirst($this->p->t('ui', 'erteiltVon')),
ucfirst($this->p->t('ui', 'angenommenVon'))
),
'datasetRepOptions' => '{
height: 550,
layout: "fitColumns", // fit columns to width of table
responsiveLayout: "hide", // hide columns that dont fit on the table
movableColumns: true, // allows changing column
placeholder: func_placeholder(),
height: func_height(this),
layout: "fitColumns", // fit columns to width of table
autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated
headerFilterPlaceholder: " ",
index: "row_index", // assign specific column as unique id (important for row indexing)
selectable: true, // allow row selection
@@ -339,13 +338,9 @@ $filterWidgetArray = array(
selectableCheck: function(row){
return func_selectableCheck(row);
},
footerElement: func_footerElement(),
rowUpdated:function(row){
func_rowUpdated(row);
},
rowSelectionChanged:function(data, rows){
func_rowSelectionChanged(data, rows);
},
rowFormatter:function(row){
func_rowFormatter(row);
},
@@ -357,40 +352,47 @@ $filterWidgetArray = array(
},
renderStarted:function(){
func_renderStarted(this);
}
},
tableWidgetFooter: {
selectButtons: true
}
}', // tabulator properties
'datasetRepFieldsDefs' => '{
row_index: {visible:false}, // necessary for row indexing
lehreinheit_id: {headerFilter:"input", bottomCalc:"count", bottomCalcFormatter:function(cell){return "Anzahl: " + cell.getValue();}, width: "7%"},
lehrveranstaltung_id: {headerFilter:"input", width: "5%"},
projektarbeit_id: {visible: false},
studiensemester_kurzbz: {visible: false},
studiengang_kz: {visible: false},
stg_typ_kurzbz: {headerFilter:"input", width: "5%"},
auftrag: {
headerFilter:"input", widthGrow: 3,
bottomCalc:"count", bottomCalcFormatter:function(cell){return "'. ucfirst($this->p->t('global', 'anzahl')). ': " + cell.getValue();}
},
stg_typ_kurzbz: {headerFilter:"input"},
gruppe: {headerFilter:"input"},
typ: {headerFilter:"input"},
lehreinheit_id: {visible: false, headerFilter:"input"},
lehrveranstaltung_id: {visible: false, headerFilter:"input"},
projektarbeit_id: {visible: false, headerFilter:"input"},
studiensemester_kurzbz: {visible: false, headerFilter:"input"},
studiengang_kz: {visible: false, headerFilter:"input"},
semester: {headerFilter:"input"},
orgform_kurzbz: {headerFilter:"input"},
person_id: {visible: false},
typ: {headerFilter:"input", width: "7%"},
auftrag: {headerFilter:"input", width: "15%"},
lv_oe_kurzbz: {headerFilter:"input", width: "8%"},
gruppe: {headerFilter:"input", width: "5%"},
orgform_kurzbz: {visible: false, headerFilter:"input"},
person_id: {visible: false, headerFilter:"input"},
lv_oe_kurzbz: {visible: false, headerFilter:"input"},
stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1},
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
bottomCalc:"sum", bottomCalcParams:{precision:1}, width: "5%"},
betrag: {align:"right", width: "6%", formatter: form_formatNulltoStringNumber,
bottomCalc:"sum", bottomCalcParams:{precision:1}
},
betrag: {align:"right", formatter: form_formatNulltoStringNumber,
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"},
width: "8%"},
bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}
},
vertrag_id: {visible: false},
vertrag_stunden: {visible: false},
vertrag_betrag: {visible: false},
mitarbeiter_uid: {visible: false},
bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip, width: "8%"},
erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip, width: "8%"},
akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip, width: "8%"},
bestellt_von: {visible: false},
erteilt_von: {visible: false},
akzeptiert_von: {visible: false}
mitarbeiter_uid: {visible: false, headerFilter:"input"},
bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip},
erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip},
akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip},
bestellt_von: {visible: false, headerFilter:"input"},
erteilt_von: {visible: false, headerFilter:"input"},
akzeptiert_von: {visible: false, headerFilter:"input"}
}', // col properties
);
@@ -0,0 +1,35 @@
<h4><?php echo $this->p->t('lehre', 'lehrauftraegeAnnehmen'); ?></h4>
<div class="panel panel-body">
<?php echo $this->p->t('lehre', 'lehrauftraegeAnnehmenText'); ?>
<ol>
<li><?php echo $this->p->t('lehre', 'lehrauftraegeAnnehmenKlickStatusicon'); ?></li>
<li><?php echo $this->p->t('lehre', 'lehrauftraegeAnnehmenLehrauftraegeWaehlen'); ?></li>
<li><?php echo $this->p->t('lehre', 'lehrauftraegeAnnehmenMitKlickAnnehmen'); ?></li>
</ol>
</div>
<br>
<h4><?php echo $this->p->t('lehre', 'lehrauftraegeNichtAuswaehlbar'); ?></h4>
<div class="panel panel-body">
<?php echo $this->p->t('lehre', 'lehrauftraegeNichtAuswaehlbarTextBeiAnnahme'); ?>
</div>
<br>
<h4>Filter</h4>
<div class="panel panel-body">
<div class="col-xs-12 col-md-8 col-lg-6">
<table class="table table-bordered">
<tr class="text-center">
<td class="col-xs-1"><i class='fa fa-users'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-check.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-handshake-o'></i></td>
</tr>
<tr class="text-center">
<td><?php echo $this->p->t('lehre', 'filterAlleBeiAnnahme'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterErteiltBeiAnnahme'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterAngenommen'); ?></td>
</tr>
</table>
</div>
</div>
<br>
@@ -16,7 +16,76 @@ $this->load->view(
'tablewidget' => true,
'navigationwidget' => true,
'phrases' => array(
'global' => array('lehrauftraegeErteilen'),
'global' => array(
'lehrauftraegeErteilen',
'mehrHilfe',
'weitereInformationenUnter'
),
'ui' => array(
'anzeigen',
'alleAnzeigen',
'nurNeueAnzeigen',
'nurBestellteAnzeigen',
'nurErteilteAnzeigen',
'nurAngenommeneAnzeigen',
'nurGeaenderteAnzeigen',
'nurDummiesAnzeigen',
'hilfeZuDieserSeite',
'alleAuswaehlen',
'alleAbwaehlen',
'ausgewaehlteZeilen',
'hilfe',
'tabelleneinstellungen',
'keineDatenVorhanden',
'spaltenEinstellen',
'bestelltVon',
'erteiltVon',
'angenommenVon',
'stundenStundensatzGeaendert',
'neuerLehrauftragOhneLektorVerplant',
'wartetAufBestellung',
'wartetAufErneuteBestellung',
'neuerLehrauftragWartetAufBestellung',
'letzterStatusBestellt',
'letzterStatusErteilt',
'letzterStatusAngenommen',
),
'table' => array(
'spaltenEinAusblenden',
'spaltenEinAusblendenMitKlickOeffnen',
'spaltenEinAusblendenAufEinstellungenKlicken',
'spaltenEinAusblendenMitKlickAktivieren',
'spaltenEinAusblendenMitKlickSchliessen',
'spaltenbreiteVeraendern',
'spaltenbreiteVeraendernText',
'spaltenbreiteVeraendernInfotext',
'zeilenAuswaehlen',
'zeilenAuswaehlenEinzeln',
'zeilenAuswaehlenBereich',
'zeilenAuswaehlenAlle'
),
'lehre' => array(
'lehrauftragStandardBestellprozess',
'lehrauftragStandardBestellprozessBestellen',
'lehrauftragStandardBestellprozessErteilen',
'lehrauftragStandardBestellprozessAnnehmen',
'lehrauftraegeErteilen',
'lehrauftraegeErteilenText',
'lehrauftraegeErteilenKlickStatusicon',
'lehrauftraegeErteilenLehrauftraegeWaehlen',
'lehrauftraegeErteilenMitKlickErteilen',
'geaenderteLehrauftraege',
'geaenderteLehrauftraegeTextBeiErteilung',
'lehrauftraegeNichtAuswaehlbar',
'lehrauftraegeNichtAuswaehlbarTextBeiErteilung',
'filterAlle',
'filterNeu',
'filterBestellt',
'filterErteilt',
'filterAngenommen',
'filterGeaendert',
'filterDummies'
)
),
'customJSs' => array(
'public/js/bootstrapper.js',
@@ -24,7 +93,6 @@ $this->load->view(
)
)
);
?>
<body>
@@ -36,7 +104,7 @@ $this->load->view(
<div class="row">
<div class="col-lg-12 page-header">
<a class="pull-right" data-toggle="collapse" href="#collapseHelp" aria-expanded="false" aria-controls="collapseExample">
Hilfe zu dieser Seite
<?php echo $this->p->t('ui', 'hilfeZuDieserSeite'); ?>
</a>
<h3>
<?php echo ucfirst($this->p->t('global', 'lehrauftraegeErteilen')); ?>
@@ -48,103 +116,7 @@ $this->load->view(
<div class="row">
<div class="col-lg-12 collapse" id="collapseHelp">
<div class="well">
<h4>Lehrauftrag Standard-Bestellprozess</h4>
<div class="panel panel-body">
<table>
<tr class="text-center">
<td><img src="../../../public/images/icons/fa-user-tag.png" style="height: 60px; width: 60px;"></td>
<td><i class='fa fa-2x fa-long-arrow-right'></i></td>
<td><img src="../../../public/images/icons/fa-user-check.png" style="height: 60px; width: 60px;"></td>
<td><i class='fa fa-2x fa-long-arrow-right'></i></td>
<td><i class='fa fa-2x fa-handshake-o'></i></td>
</tr>
<tr class="text-center">
<td class="text-muted">BESTELLEN<br>(Studiengangsleitung)</td>
<td></td>
<td><b>ERTEILEN<br>(Department-/Kompetenzfeldleitung)</b></td>
<td></td>
<td class="text-muted">ANNEHMEN<br>(LektorIn)</td>
</tr>
</table>
</div>
<br>
<h4>Lehraufträge erteilen</h4>
<div class="panel panel-body">
Sobald Lehraufträge bestellt wurden, können Sie diese hier erteilen.<br>
Erteilte Lehraufträge können von den Lehrenden angenommen werden.<br>
<ol>
<li>Klicken Sie unten auf das Status-Icon 'Nur bestellte anzeigen' oder 'Alle anzeigen'</li>
<li>Wählen Sie die zu erteilenden Lehraufträge selbst oder alle über den Button 'Alle auswählen'.</li>
<li>Klicken Sie auf Lehrauftrag erteilen.</li>
</ol>
</div>
<br>
<h4>Geänderte Lehraufträge</h4>
<div class="panel panel-body">
Im FAS können Änderungen an Stunden/Stundensatz eines Lehrauftrags durchgeführt werden, solange dieser nicht vom Lehrenden angenommen wurde.<br>
Wenn Änderungen an bereits bestellten oder erteilten Lehraufträgen vorgenommen wurden, müssen diese vom Studiengang erneut bestellt werden.<br>
Bei bereits erteilten Lehraufträgen wird zusätzlich der Status 'erteilt' zurückgesetzt.
</div>
<br>
<h4>Warum kann ich manche Lehraufträge nicht auswählen?</h4>
<div class="panel panel-body">
Nur Lehraufträge mit dem Status 'bestellt' können gewählt werden.<br>
Neue, Bestellte, Akzeptierte oder geänderte Lehraufträge werden nur zu Ihrer Information angezeigt und sind daher NICHT wählbar.
</div>
<br>
<h4>Filter</h4>
<div class="panel panel-body">
<table class="table table-bordered">
<tr class="text-center">
<td class="col-xs-1"><i class='fa fa-users'></i></td>
<td class="col-xs-1"><i class='fa fa-user-plus'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-tag.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-check.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-handshake-o'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-edit.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-user-secret'></i></td>
</tr>
<tr class="text-center">
<td><b>Alle</b><br>Alle Lehraufträge mit jedem Status, auch geänderte und Dummy-Aufträge</td>
<td><b>Neu</b><br>Nur Lehraufträge, die im FAS über die Zuteilung eines Lehrenden zu einer Lehreinheit/einem Projekt angelegt und noch nicht bestellt worden sind</td>
<td><b>Bestellt</b><br>Nur bestellte UND geänderte bestellte Lehraufträge</td>
<td><b>Erteilt</b><br>Nur erteilte UND geänderte erteilte Lehraufträge</td>
<td><b>Angenommen</b><br>Nur vom Lehrenden angenommene Lehraufträge</td>
<td><b>Geändert</b><br>Nur Lehraufträge, die geändert wurden, nachdem sie bereits bestellt oder erteilt worden sind</td>
<td><b>Dummies</b><br>Nur Lehraufträge, die mit einem Dummylektor angelegt sind</td>
</tr>
</table>
</div>
<br>
<h4>Auswahl</h4>
<div class="panel panel-body">
<ul>
<li>Einzeln auswählen: <kbd>Strg</kbd> + Klick auf einzelne Zeile(n)</li>
<li>Bereich auswählen: <kbd>Shift</kbd> + Klick auf Anfangs- und Endzeile</li>
<li>Alle auswählen: Button 'Alle auswählen'</li>
</ul>
</div>
<br>
<h4>Ansicht</h4>
<div class="panel panel-body">
<b>Spaltenbreite verändern</b>
<p>
Um die Spaltenbreite zu verändern, fährt man im Spaltenkopf langsam mit dem Mauszeiger auf
den rechten Rand der entprechenden Spalte. <br>
Sobald sich der Mauszeiger in einen Doppelpfeil verwandelt, wird die Maustaste geklickt und
mit gedrückter Maustaste die Spalte nach rechts erweitert oder nach links verkleinert.
</p>
</div>
<br>
<?php $this->load->view('lehre/lehrauftrag/approveLehrauftragHelp') ?>
</div>
</div>
</div>
@@ -197,7 +169,7 @@ $this->load->view(
);
?>
</div>
<button type="submit" name="submit" value="anzeigen" class="btn btn-default form-group">Anzeigen</button>
<button type="submit" name="submit" value="anzeigen" class="btn btn-default form-group"><?php echo ucfirst($this->p->t('ui', 'anzeigen')); ?></button>
</form>
</div>
</div>
@@ -213,20 +185,20 @@ $this->load->view(
<!-- filter buttons & erteil-button -->
<div class="row">
<div class="col-xs-12">
<button id="approve-lehrauftraege" class="btn btn-primary pull-right">Lehrauftrag erteilen</button>
<button id="approve-lehrauftraege" class="btn btn-primary pull-right"><?php echo ucfirst($this->p->t('global', 'lehrauftraegeErteilen')); ?></button>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group" role="group">
<button id="show-all" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Alle anzeigen"><i class='fa fa-users'></i></button>
<button id="show-new" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Nur neue anzeigen"><i class='fa fa-user-plus'></i></button>
<button id="show-ordered" class="btn btn-default btn-lehrauftrag active focus" type="button" data-toggle="tooltip" data-placement="left" title="Nur bestellte anzeigen"></button><!-- png img set in javascript -->
<button id="show-approved" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Nur erteilte anzeigen"></button><!-- png img set in javascript -->
<button id="show-accepted" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Nur angenommene anzeigen"><i class='fa fa-handshake-o'></i></button>
<button id="show-all" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'alleAnzeigen'); ?>"><i class='fa fa-users'></i></button>
<button id="show-new" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurNeueAnzeigen'); ?>"><i class='fa fa-user-plus'></i></button>
<button id="show-ordered" class="btn btn-default btn-lehrauftrag active focus" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurBestellteAnzeigen'); ?>"></button><!-- png img set in javascript -->
<button id="show-approved" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurErteilteAnzeigen'); ?>"></button><!-- png img set in javascript -->
<button id="show-accepted" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurAngenommeneAnzeigen'); ?>"><i class='fa fa-handshake-o'></i></button>
</div>
<div class="btn-group" role="group" style="margin-left: 20px;">
<button id="show-changed" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Nur geänderte anzeigen"></button><!-- png img set in javascript -->
<button id="show-changed" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurGeaenderteAnzeigen'); ?>"></button><!-- png img set in javascript -->
</div>
<div class="btn-group" role="group" style="margin-left: 20px;">
<button id="show-dummies" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Nur verplante ohne Lektor anzeigen (Dummies)"><i class='fa fa-user-secret'></i></button>
<button id="show-dummies" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurDummiesAnzeigen'); ?>"><i class='fa fa-user-secret'></i></button>
</div>
</div>
</div>
@@ -9,20 +9,20 @@ SELECT
/* provide extra row index for tabulator, because no other column has unique ids */
ROW_NUMBER() OVER () AS "row_index",
personalnummer,
auftrag,
stg_typ_kurzbz,
gruppe,
typ,
lehreinheit_id,
lehrveranstaltung_id,
lv_bezeichnung,
projektarbeit_id,
studiensemester_kurzbz,
studiengang_kz,
stg_typ_kurzbz,
semester,
orgform_kurzbz,
person_id,
typ,
auftrag,
lv_oe_kurzbz,
gruppe,
lektor,
stunden,
betrag,
@@ -305,46 +305,46 @@ $filterWidgetArray = array(
'tableUniqueId' => 'approveLehrauftrag',
'requiredPermissions' => 'lehre/lehrauftrag_erteilen',
'datasetRepresentation' => 'tabulator',
'columnsAliases' => array( // TODO: use phrasen
'columnsAliases' => array(
'Status', // alias for row_index, because row_index is formatted to display the status icons
'Personalnummer',
'LV-Teil',
'LV-ID',
'LV',
'PA-ID',
'Studiensemester',
'Studiengang-KZ',
'Studiengang',
'Semester',
'OrgForm',
'Person-ID',
'Typ',
'LV- / Projektbezeichnung',
'Organisationseinheit',
'Gruppe',
'Lektor',
'Stunden',
'Betrag',
'Vertrag-ID',
'Vertrag-Stunden',
'Vertrag-Betrag',
'UID',
'Bestellt',
'Erteilt',
'Angenommen',
'Bestellt von',
'Erteilt von',
'Angenommen von'
ucfirst($this->p->t('global', 'personalnummer')),
ucfirst($this->p->t('lehre', 'lehrveranstaltung')). '- / '.
ucfirst($this->p->t('ui', 'projekt')). lcfirst($this->p->t('ui', 'bezeichnung')),
ucfirst($this->p->t('lehre', 'studiengang')),
ucfirst($this->p->t('lehre', 'gruppe')),
ucfirst($this->p->t('global', 'typ')),
ucfirst($this->p->t('lehre', 'lehreinheit')),
ucfirst($this->p->t('lehre', 'lehrveranstaltung')). '-ID',
ucfirst($this->p->t('lehre', 'lehrveranstaltung')),
ucfirst($this->p->t('ui', 'projektarbeit')). '-ID',
ucfirst($this->p->t('lehre', 'studiensemester')),
ucfirst($this->p->t('lehre', 'studiengang')). '-'. ucfirst($this->p->t('ui', 'kz')),
'Semester',
ucfirst($this->p->t('lehre', 'organisationsform')),
'Person-ID',
ucfirst($this->p->t('lehre', 'organisationseinheit')),
ucfirst($this->p->t('lehre', 'lektor')),
ucfirst($this->p->t('ui', 'stunden')),
ucfirst($this->p->t('ui', 'betrag')),
ucfirst($this->p->t('ui', 'vertrag')). '-ID',
ucfirst($this->p->t('ui', 'vertrag')). '-'. ucfirst($this->p->t('ui', 'stunden')),
ucfirst($this->p->t('ui', 'vertrag')). '-'. ucfirst($this->p->t('ui', 'betrag')),
'UID',
ucfirst($this->p->t('ui', 'bestellt')),
ucfirst($this->p->t('ui', 'erteilt')),
ucfirst($this->p->t('ui', 'angenommen')),
ucfirst($this->p->t('ui', 'bestelltVon')),
ucfirst($this->p->t('ui', 'erteiltVon')),
ucfirst($this->p->t('ui', 'angenommenVon'))
),
'datasetRepOptions' => '{
height: 700,
layout: "fitColumns", // fit columns to width of table
responsiveLayout: "hide", // hide columns that dont fit on the table
movableColumns: true, // allows changing column
placeholder: func_placeholder(),
height: func_height(this),
layout: "fitColumns", // fit columns to width of table
layoutColumnsOnNewData: true, // ajust column widths to the data each time TableWidget is loaded
autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated
headerFilterPlaceholder: " ",
groupBy:"lehrveranstaltung_id",
groupToggleElement:"header", //toggle group on click anywhere in the group header
groupToggleElement:"header", //toggle group on click anywhere in the group header
groupHeader: function(value, count, data, group){
return func_groupHeader(data);
},
@@ -357,13 +357,9 @@ $filterWidgetArray = array(
return func_selectableCheck(row);
},
initialFilter: func_initialFilter(),
footerElement: func_footerElement(),
rowUpdated:function(row){
func_rowUpdated(row);
},
rowSelectionChanged:function(data, rows){
func_rowSelectionChanged(data, rows);
},
rowFormatter:function(row)
{
func_rowFormatter(row);
@@ -373,44 +369,49 @@ $filterWidgetArray = array(
},
tableBuilt: function(){
func_tableBuilt(this);
}
},
tableWidgetFooter: {
selectButtons: true
}
}', // tabulator properties
'datasetRepFieldsDefs' => '{
// column status is built dynamically in funcTableBuilt(),
row_index: {visible:false}, // necessary for row indexing
personalnummer: {visible: false},
lehreinheit_id: {headerFilter:"input", bottomCalc:"count", width: "7%",
bottomCalcFormatter:function(cell){return "Anzahl: " + cell.getValue();},},
lehrveranstaltung_id: {headerFilter:"input"},
lv_bezeichnung: {visible: false},
projektarbeit_id: {visible: false},
studiensemester_kurzbz: {headerFilter:"input"},
studiengang_kz: {visible: false},
stg_typ_kurzbz: {headerFilter:"input", width: "5%"},
personalnummer: {visible: false, headerFilter:"input"},
auftrag: {
headerFilter:"input", widthGrow: 2,
bottomCalc:"count", bottomCalcFormatter:function(cell){return "'. ucfirst($this->p->t('global', 'anzahl')). ': " + cell.getValue();}
},
stg_typ_kurzbz: {headerFilter:"input"},
gruppe: {headerFilter:"input"},
typ: {headerFilter:"input"},
lehreinheit_id: {visible: false, headerFilter:"input"},
lehrveranstaltung_id: {visible: false, headerFilter:"input"},
lv_bezeichnung: {visible: false, headerFilter:"input"},
projektarbeit_id: {visible: false, headerFilter:"input"},
studiensemester_kurzbz: {visible: false, headerFilter:"input"},
studiengang_kz: {visible: false, headerFilter:"input"},
semester: {headerFilter:"input"},
orgform_kurzbz: {headerFilter:"input"},
person_id: {visible: false},
typ: {headerFilter:"input"},
auftrag: {headerFilter:"input", width:"20%"},
lv_oe_kurzbz: {headerFilter:"input"},
gruppe: {headerFilter:"input"},
lektor: {headerFilter:"input", widthGrow: 3},
orgform_kurzbz: {visible: false, headerFilter:"input"},
person_id: {visible: false, headerFilter:"input"},
lv_oe_kurzbz: {visible: false, headerFilter:"input"},
lektor: {headerFilter:"input", widthGrow: 2},
stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1},
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
bottomCalc:"sum", bottomCalcParams:{precision:1}},
betrag: {align:"right", width: "8%", formatter: form_formatNulltoStringNumber,
betrag: {align:"right", formatter: form_formatNulltoStringNumber,
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}},
vertrag_id: {visible: false},
vertrag_stunden: {visible: false},
vertrag_betrag: {visible: false},
mitarbeiter_uid: {visible: false},
bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip, width: "8%"},
erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip, width: "8%"},
akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip, width: "8%"},
bestellt_von: {visible: false},
erteilt_von: {visible: false},
akzeptiert_von: {visible: false},
mitarbeiter_uid: {visible: false, headerFilter:"input"},
bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip},
erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip},
akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip},
bestellt_von: {visible: false, headerFilter:"input"},
erteilt_von: {visible: false, headerFilter:"input"},
akzeptiert_von: {visible: false, headerFilter:"input"},
}', // col properties
);
@@ -0,0 +1,74 @@
<h4><?php echo $this->p->t('lehre', 'lehrauftragStandardBestellprozess'); ?></h4>
<div class="panel panel-body">
<table>
<tr class="text-center">
<td><img src="../../../public/images/icons/fa-user-tag.png" style="height: 60px; width: 60px;"></td>
<td><i class='fa fa-2x fa-long-arrow-right'></i></td>
<td><img src="../../../public/images/icons/fa-user-check.png" style="height: 60px; width: 60px;"></td>
<td><i class='fa fa-2x fa-long-arrow-right'></i></td>
<td><i class='fa fa-2x fa-handshake-o'></i></td>
</tr>
<tr class="text-center">
<td class="text-muted"><?php echo $this->p->t('lehre', 'lehrauftragStandardBestellprozessBestellen'); ?></td>
<td></td>
<td><b><?php echo $this->p->t('lehre', 'lehrauftragStandardBestellprozessErteilen'); ?></b></td>
<td></td>
<td class="text-muted"><?php echo $this->p->t('lehre', 'lehrauftragStandardBestellprozessAnnehmen'); ?></td>
</tr>
</table>
</div>
<br>
<h4><?php echo $this->p->t('lehre', 'lehrauftraegeErteilen'); ?></h4>
<div class="panel panel-body">
<?php echo $this->p->t('lehre', 'lehrauftraegeErteilenText'); ?>
<ol>
<li><?php echo $this->p->t('lehre', 'lehrauftraegeErteilenKlickStatusicon'); ?></li>
<li><?php echo $this->p->t('lehre', 'lehrauftraegeErteilenLehrauftraegeWaehlen'); ?></li>
<li><?php echo $this->p->t('lehre', 'lehrauftraegeErteilenMitKlickErteilen'); ?></li>
</ol>
</div>
<br>
<h4><?php echo $this->p->t('lehre', 'geaenderteLehrauftraege'); ?></h4>
<div class="panel panel-body">
<?php echo $this->p->t('lehre', 'geaenderteLehrauftraegeTextBeiErteilung'); ?>
</div>
<br>
<h4><?php echo $this->p->t('lehre', 'lehrauftraegeNichtAuswaehlbar'); ?></h4>
<div class="panel panel-body">
<?php echo $this->p->t('lehre', 'lehrauftraegeNichtAuswaehlbarTextBeiErteilung'); ?>
</div>
<br>
<h4>Filter</h4>
<div class="panel panel-body">
<table class="table table-bordered">
<tr class="text-center">
<td class="col-xs-1"><i class='fa fa-users'></i></td>
<td class="col-xs-1"><i class='fa fa-user-plus'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-tag.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-check.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-handshake-o'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-edit.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-user-secret'></i></td>
</tr>
<tr class="text-center">
<td><?php echo $this->p->t('lehre', 'filterAlle'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterNeu'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterBestellt'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterErteilt'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterAngenommen'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterGeaendert'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterDummies'); ?></td>
</tr>
</table>
</div>
<br>
<h4><?php echo $this->p->t('global', 'mehrHilfe'); ?></h4>
<div class="panel panel-info panel-body">
<?php echo $this->p->t('global', 'weitereInformationenUnter'); ?><a href="https://wiki.fhcomplete.org/doku.php?id=fhc:lehrauftraege" target="_blank">FH Complete WIKI</a>
</div><br>
@@ -53,20 +53,17 @@ $tableWidgetArray = array(
'tableUniqueId' => 'cancelledLehrauftrag',
'requiredPermissions' => 'lehre/lehrauftrag_akzeptieren',
'datasetRepresentation' => 'tabulator',
'columnsAliases' => array( // TODO: use phrasen
'columnsAliases' => array(
'Status',
'Studiensemester',
'Typ',
'LV- / Projektbezeichnung',
'Stunden',
'Betrag',
'Storniert am'
ucfirst($this->p->t('lehre', 'studiensemester')),
ucfirst($this->p->t('global', 'typ')),
ucfirst($this->p->t('lehre', 'lehrveranstaltung')). '- / '. ucfirst($this->p->t('ui', 'projekt')). lcfirst($this->p->t('ui', 'bezeichnung')),
ucfirst($this->p->t('ui', 'stunden')),
ucfirst($this->p->t('ui', 'betrag')),
ucfirst($this->p->t('ui', 'storniertAm')),
ucfirst($this->p->t('ui', 'storniertVon'))
),
'datasetRepOptions' => '{
layout: "fitColumns", // fit columns to width of table
responsiveLayout: "hide", // hide columns that dont fit on the table
movableColumns: true, // allows changing column
placeholder: func_placeholder(),
rowFormatter:function(row){
func_rowFormatter(row);
},
@@ -78,22 +75,24 @@ $tableWidgetArray = array(
},
tableBuilt: function(){
func_tableBuilt(this);
}
},
}', // tabulator properties
'datasetRepFieldsDefs' => '{
vertrag_id: {visible: false},
vertragsstunden_studiensemester_kurzbz: {visible: false},
vertragstyp_kurzbz: {widthGrow: 2},
bezeichnung: {widthGrow: 2},
vertragsstunden_studiensemester_kurzbz: {visible: false, widthShrink:1},
vertragstyp_kurzbz: {minWidth: 200},
bezeichnung: {minWidth: 200},
vertragsstunden: {
align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1},
bottomCalc:"sum", bottomCalcParams:{precision:1}
bottomCalc:"sum", bottomCalcParams:{precision:1},
minWidth: 200
},
betrag: {
align:"right", formatter: form_formatNulltoStringNumber,
bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}
bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"},
minWidth: 200
},
storniert: {align:"center", mutator: mut_formatStringDate, tooltip: storniert_tooltip},
storniert: {align:"center", mutator: mut_formatStringDate, tooltip: storniert_tooltip, minWidth: 200},
storniert_von: {visible: false},
letzterStatus_vorStorniert: {visible: false}
}', // col properties
@@ -1,5 +1,4 @@
<?php
// TODO: phrasen anpassen
$this->load->view(
'templates/FHC-Header',
array(
@@ -17,7 +16,76 @@ $this->load->view(
'tablewidget' => true,
'navigationwidget' => true,
'phrases' => array(
'global' => array('lehrauftraegeBestellen'),
'global' => array(
'lehrauftraegeBestellen',
'mehrHilfe',
'weitereInformationenUnter'
),
'ui' => array(
'anzeigen',
'alleAnzeigen',
'nurNeueAnzeigen',
'nurBestellteAnzeigen',
'nurErteilteAnzeigen',
'nurAngenommeneAnzeigen',
'nurGeaenderteAnzeigen',
'nurDummiesAnzeigen',
'hilfeZuDieserSeite',
'alleAuswaehlen',
'alleAbwaehlen',
'ausgewaehlteZeilen',
'hilfe',
'tabelleneinstellungen',
'keineDatenVorhanden',
'spaltenEinstellen',
'bestelltVon',
'erteiltVon',
'angenommenVon',
'neuerLehrauftragOhneLektorVerplant',
'neuerLehrauftragWartetAufBestellung',
'letzterStatusBestellt',
'letzterStatusErteilt',
'letzterStatusAngenommen',
'nachAenderungStundensatzStunden',
'vorAenderungStundensatzStunden'
),
'table' => array(
'spaltenEinAusblenden',
'spaltenEinAusblendenMitKlickOeffnen',
'spaltenEinAusblendenAufEinstellungenKlicken',
'spaltenEinAusblendenMitKlickAktivieren',
'spaltenEinAusblendenMitKlickSchliessen',
'spaltenbreiteVeraendern',
'spaltenbreiteVeraendernText',
'spaltenbreiteVeraendernInfotext',
'zeilenAuswaehlen',
'zeilenAuswaehlenEinzeln',
'zeilenAuswaehlenBereich',
'zeilenAuswaehlenAlle'
),
'lehre' => array(
'lehrauftragStandardBestellprozess',
'lehrauftragStandardBestellprozessBestellen',
'lehrauftragStandardBestellprozessErteilen',
'lehrauftragStandardBestellprozessAnnehmen',
'lehrauftraegeBestellen',
'lehrauftraegeBestellenText',
'lehrauftraegeBestellenKlickStatusicon',
'lehrauftraegeBestellenLehrauftraegeWaehlen',
'lehrauftraegeBestellenMitKlickBestellen',
'lehrauftraegeBestellenVertragWirdAngelegt',
'geaenderteLehrauftraege',
'geaenderteLehrauftraegeText',
'lehrauftraegeNichtAuswaehlbar',
'lehrauftraegeNichtAuswaehlbarText',
'filterAlle',
'filterNeu',
'filterBestellt',
'filterErteilt',
'filterAngenommen',
'filterGeaendert',
'filterDummies'
)
),
'customJSs' => array(
'public/js/bootstrapper.js',
@@ -35,8 +103,8 @@ $this->load->view(
<!-- title & helper link -->
<div class="row">
<div class="col-lg-12 page-header">
<a class="pull-right" data-toggle="collapse" href="#collapseHelp" aria-expanded="false" aria-controls="collapseExample">
Hilfe zu dieser Seite
<a class="pull-right" data-toggle="collapse" href="#collapseHelp" aria-expanded="false" aria-controls="collapseHelp">
<?php echo $this->p->t('ui', 'hilfeZuDieserSeite'); ?>
</a>
<h3>
<?php echo ucfirst($this->p->t('global', 'lehrauftraegeBestellen')); ?>
@@ -48,105 +116,7 @@ $this->load->view(
<div class="row">
<div class="col-lg-12 collapse" id="collapseHelp">
<div class="well">
<h4>Lehrauftrag Standard-Bestellprozess</h4>
<div class="panel panel-body">
<table>
<tr class="text-center">
<td><img src="../../../public/images/icons/fa-user-tag.png" style="height: 60px; width: 60px;"></td>
<td><i class='fa fa-2x fa-long-arrow-right'></i></td>
<td><img src="../../../public/images/icons/fa-user-check.png" style="height: 60px; width: 60px;"></td>
<td><i class='fa fa-2x fa-long-arrow-right'></i></td>
<td><i class='fa fa-2x fa-handshake-o'></i></td>
</tr>
<tr class="text-center">
<td><b>BESTELLEN<br>(Studiengangsleitung)</b></td>
<td></td>
<td class="text-muted">ERTEILEN<br>(Department-/Kompetenzfeldleitung)</td>
<td></td>
<td class="text-muted">ANNEHMEN<br>(LektorIn)</td>
</tr>
</table>
</div>
<br>
<h4>Lehraufträge bestellen</h4>
<div class="panel panel-body">
Sobald im FAS ein Lehrauftrag/eine Projektbetreuung angelegt wurde, können Sie diese hier bestellen.<br>
Bestellte Lehraufträge sind zur Erteilung freigegeben.<br>
<ol>
<li>Klicken Sie unten auf das Status-Icon 'Nur neue anzeigen', 'Nur geänderte anzeigen' oder 'Alle anzeigen'</li>
<li>Wählen Sie die zu bestellenden Lehraufträge selbst oder über den Button 'Alle auswählen'.</li>
<li>Klicken Sie auf Lehrauftrag bestellen.</li>
</ol>
Für jeden bestellten Lehrauftrag legt das System einen Vertrag an.
</div>
<br>
<h4>Geänderte Lehraufträge</h4>
<div class="panel panel-body">
Im FAS können Änderungen an Stunden/Stundensatz eines Lehrauftrags durchgeführt werden, solange dieser nicht vom Lehrenden angenommen wurde.<br>
Diese müssen dann erneut bestellt werden.<br><br>
Wenn Änderungen an bereits bestellten oder erteilten Lehraufträgen vorgenommen wurden, werden diese in einem tooltip angezeigt.<br>
Fahren Sie dazu mit der Maus über dem Status-Icon am Beginn der Zeile.<br>
</div>
<br>
<h4>Warum kann ich manche Lehraufträge nicht auswählen?</h4>
<div class="panel panel-body">
Nur Lehraufträge mit dem Status 'neu' und 'geändert' können bestellt werden.<br>
Erteilte oder akzeptierte Lehraufträge werden nur zu Ihrer Information angezeigt und sind daher NICHT wählbar.
</div>
<br>
<h4>Filter</h4>
<div class="panel panel-body">
<table class="table table-bordered">
<tr class="text-center">
<td class="col-xs-1"><i class='fa fa-users'></i></td>
<td class="col-xs-1"><i class='fa fa-user-plus'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-tag.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-check.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-handshake-o'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-edit.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-user-secret'></i></td>
</tr>
<tr class="text-center">
<td><b>Alle</b><br>Alle Lehraufträge mit jedem Status, auch geänderte und Dummy-Aufträge</td>
<td><b>Neu</b><br>Nur Lehraufträge, die im FAS über die Zuteilung eines Lehrenden zu einer Lehreinheit/einem Projekt angelegt und noch nicht bestellt worden sind</td>
<td><b>Bestellt</b><br>Nur bestellte UND geänderte bestellte Lehraufträge</td>
<td><b>Erteilt</b><br>Nur erteilte UND geänderte erteilte Lehraufträge</td>
<td><b>Angenommen</b><br>Nur vom Lehrenden angenommene Lehraufträge</td>
<td><b>Geändert</b><br>Nur Lehraufträge, die geändert wurden, nachdem sie bereits bestellt oder erteilt worden sind</td>
<td><b>Dummies</b><br>Nur Lehraufträge, die mit einem Dummylektor angelegt sind</td>
</tr>
</table>
</div>
<br>
<h4>Auswahl</h4>
<div class="panel panel-body">
<ul>
<li>Einzeln auswählen: <kbd>Strg</kbd> + Klick auf einzelne Zeile(n)</li>
<li>Bereich auswählen: <kbd>Shift</kbd> + Klick auf Anfangs- und Endzeile</li>
<li>Alle auswählen: Button 'Alle auswählen'</li>
</ul>
</div>
<br>
<h4>Ansicht</h4>
<div class="panel panel-body">
<b>Spaltenbreite verändern</b>
<p>
Um die Spaltenbreite zu verändern, fährt man im Spaltenkopf langsam mit dem Mauszeiger auf
den rechten Rand der entprechenden Spalte. <br>
Sobald sich der Mauszeiger in einen Doppelpfeil verwandelt, wird die Maustaste geklickt und
mit gedrückter Maustaste die Spalte nach rechts erweitert oder nach links verkleinert.
</p>
</div>
<br>
<?php $this->load->view('lehre/lehrauftrag/orderLehrauftragHelp') ?>
</div>
</div>
</div>
@@ -199,36 +169,31 @@ $this->load->view(
);
?>
</div>
<button type="submit" name="submit" value="anzeigen" class="btn btn-default form-group">Anzeigen</button>
<button type="submit" name="submit" value="anzeigen" class="btn btn-default form-group"><?php echo ucfirst($this->p->t('ui', 'anzeigen')); ?></button>
</form>
</div>
</div>
<!-- tabulator data table -->
<div class="row">
<div class="col-lg-12">
<?php $this->load->view('lehre/lehrauftrag/orderLehrauftragData.php'); ?>
</div>
</div>
<br>
<?php $this->load->view('lehre/lehrauftrag/orderLehrauftragData.php'); ?>
<!-- filter buttons & bestell-button -->
<div class="row">
<div class="col-xs-12">
<button id="order-lehrauftraege" class="btn btn-primary pull-right" data-toggle="tooltip" data-placement="left" title="">Lehrauftrag bestellen</button>
<button id="order-lehrauftraege" class="btn btn-primary pull-right" data-toggle="tooltip" data-placement="left" title=""><?php echo ucfirst($this->p->t('global', 'lehrauftraegeBestellen')); ?></button>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group" role="group">
<button id="show-all" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Alle anzeigen"><i class='fa fa-users'></i></button>
<button id="show-new" class="btn btn-default btn-lehrauftrag active focus" type="button" data-toggle="tooltip" data-placement="left" title="Nur neue anzeigen"><i class='fa fa-user-plus'></i></button>
<button id="show-ordered" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Nur bestellte anzeigen"></button><!-- png img set in javascript -->
<button id="show-approved" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Nur erteilte anzeigen"></button><!-- png img set in javascript -->
<button id="show-accepted" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Nur angenommene anzeigen"><i class='fa fa-handshake-o'></i></button>
<button id="show-all" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'alleAnzeigen'); ?>"><i class='fa fa-users'></i></button>
<button id="show-new" class="btn btn-default btn-lehrauftrag active focus" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurNeueAnzeigen'); ?>"><i class='fa fa-user-plus'></i></button>
<button id="show-ordered" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurBestellteAnzeigen'); ?>"></button><!-- png img set in javascript -->
<button id="show-approved" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurErteilteAnzeigen'); ?>"></button><!-- png img set in javascript -->
<button id="show-accepted" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurAngenommeneAnzeigen'); ?>"><i class='fa fa-handshake-o'></i></button>
</div>
<div class="btn-group" role="group" style="margin-left: 20px;">
<button id="show-changed" class="btn btn-default btn-lehrauftrag active focus" type="button" data-toggle="tooltip" data-placement="left" title="Nur geänderte anzeigen"></button><!-- png img set in javascript -->
<button id="show-changed" class="btn btn-default btn-lehrauftrag active focus" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurGeaenderteAnzeigen'); ?>"></button><!-- png img set in javascript -->
</div>
<div class="btn-group" role="group" style="margin-left: 20px;">
<button id="show-dummies" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="Nur verplante ohne Lektor anzeigen (Dummies)"><i class='fa fa-user-secret'></i></button>
<button id="show-dummies" class="btn btn-default btn-lehrauftrag" type="button" data-toggle="tooltip" data-placement="left" title="<?php echo $this->p->t('ui', 'nurDummiesAnzeigen'); ?>"><i class='fa fa-user-secret'></i></button>
</div>
</div>
</div>
@@ -239,4 +204,4 @@ $this->load->view(
<br>
</body>
<?php $this->load->view('templates/FHC-Footer'); ?>
<?php $this->load->view('templates/FHC-Footer'); ?>
@@ -9,13 +9,16 @@ SELECT
/* provide extra row index for tabulator, because no other column has unique ids */
ROW_NUMBER() OVER () AS "row_index",
personalnummer,
auftrag,
stg_typ_kurzbz,
gruppe,
typ,
lehreinheit_id,
lehrveranstaltung_id,
lv_bezeichnung,
projektarbeit_id,
studiensemester_kurzbz,
studiengang_kz,
stg_typ_kurzbz,
semester,
/* get valid STPL(s), to which the lehrveranstaltung is assigned to (can be more) */
/* therefore join over lv, studiensemester and semester */
@@ -49,10 +52,7 @@ SELECT
) AS "studienplan_bezeichnung",
orgform_kurzbz,
person_id,
typ,
auftrag,
lv_oe_kurzbz,
gruppe,
lektor,
stunden,
stundensatz,
@@ -337,54 +337,53 @@ $filterWidgetArray = array(
'tableUniqueId' => 'orderLehrauftrag',
'requiredPermissions' => 'lehre/lehrauftrag_bestellen',
'datasetRepresentation' => 'tabulator',
'columnsAliases' => array( // TODO: use phrasen
'columnsAliases' => array(
'Status', // alias for row_index, because row_index is formatted to display the status icons
'Personalnummer',
'LV-Teil',
'LV-ID',
'LV',
'PA-ID',
'Studiensemester',
'Studiengang-KZ',
'Studiengang',
ucfirst($this->p->t('global', 'personalnummer')),
ucfirst($this->p->t('lehre', 'lehrveranstaltung')). '- / '.
ucfirst($this->p->t('ui', 'projekt')). lcfirst($this->p->t('ui', 'bezeichnung')),
ucfirst($this->p->t('lehre', 'studiengang')),
ucfirst($this->p->t('lehre', 'gruppe')),
ucfirst($this->p->t('global', 'typ')),
ucfirst($this->p->t('lehre', 'lehreinheit')),
ucfirst($this->p->t('lehre', 'lehrveranstaltung')). '-ID',
ucfirst($this->p->t('lehre', 'lehrveranstaltung')),
ucfirst($this->p->t('ui', 'projektarbeit')). '-ID',
ucfirst($this->p->t('lehre', 'studiensemester')),
ucfirst($this->p->t('lehre', 'studiengang')). '-'. ucfirst($this->p->t('ui', 'kz')),
'Semester',
'Studienplan',
'OrgForm',
ucfirst($this->p->t('lehre', 'studienplan')),
ucfirst($this->p->t('lehre', 'organisationsform')),
'Person-ID',
'Typ',
'LV- / Projektbezeichnung',
'Organisationseinheit',
'Gruppe',
'Lektor',
'Stunden',
'Stundensatz',
'Betrag',
'Vertrag-ID',
'Vertrag-Stunden',
'Vertrag-Betrag',
ucfirst($this->p->t('lehre', 'organisationseinheit')),
ucfirst($this->p->t('lehre', 'lektor')),
ucfirst($this->p->t('ui', 'stunden')),
ucfirst($this->p->t('ui', 'stundensatz')),
ucfirst($this->p->t('ui', 'betrag')),
ucfirst($this->p->t('ui', 'vertrag')). '-ID',
ucfirst($this->p->t('ui', 'vertrag')). '-'. ucfirst($this->p->t('ui', 'stunden')),
ucfirst($this->p->t('ui', 'vertrag')). '-'. ucfirst($this->p->t('ui', 'betrag')),
'UID',
'Bestellt',
'Erteilt',
'Angenommen',
'Bestellt von',
'Erteilt von',
'Angenommen von'
ucfirst($this->p->t('ui', 'bestellt')),
ucfirst($this->p->t('ui', 'erteilt')),
ucfirst($this->p->t('ui', 'angenommen')),
ucfirst($this->p->t('ui', 'bestelltVon')),
ucfirst($this->p->t('ui', 'erteiltVon')),
ucfirst($this->p->t('ui', 'angenommenVon'))
),
'datasetRepOptions' => '{
height: 700,
layout:"fitColumns", // fit columns to width of table
responsiveLayout:"hide", // hide columns that dont fit on the table
movableColumns: true, // allows changing column
placeholder: func_placeholder(),
headerFilterPlaceholder: " ",
groupBy:"lehrveranstaltung_id",
groupToggleElement:"header", //toggle group on click anywhere in the group header
groupHeader: function(value, count, data, group){
return func_groupHeader(data);
},
footerElement: func_footerElement(),
columnCalcs:"both", // show column calculations at top and bottom of table and in groups
index: "row_index", // assign specific column as unique id (important for row indexing)
height: func_height(this),
layout:"fitColumns", // fit columns to width of table
layoutColumnsOnNewData: true, // ajust column widths to the data each time TableWidget is loaded
autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated
headerFilterPlaceholder: " ",
groupBy:"lehrveranstaltung_id",
groupToggleElement:"header", //toggle group on click anywhere in the group header
groupHeader: function(value, count, data, group){
return func_groupHeader(data);
},
columnCalcs:"both", // show column calculations at top and bottom of table and in groups
index: "row_index", // assign specific column as unique id (important for row indexing)
selectable: true, // allows row selection
selectableRangeMode: "click", // allows range selection using shift end click on end of range
selectablePersistence:false, // deselect previously selected rows when table is filtered, sorted or paginated
@@ -394,9 +393,6 @@ $filterWidgetArray = array(
rowUpdated:function(row){
func_rowUpdated(row);
},
rowSelectionChanged:function(data, rows){
func_rowSelectionChanged(data, rows);
},
rowFormatter:function(row){
func_rowFormatter(row);
},
@@ -409,46 +405,52 @@ $filterWidgetArray = array(
dataLoaded: function(data){
func_dataLoaded(data, this);
},
tableWidgetFooter: {
selectButtons: true
}
}', // tabulator properties
'datasetRepFieldsDefs' => '{
// column status is built dynamically in funcTableBuilt()
row_index: {visible: false},
personalnummer: {visible: false},
lehreinheit_id: {headerFilter:"input", bottomCalc:"count", width: "7%",
bottomCalcFormatter:function(cell){return "Anzahl: " + cell.getValue();}},
lehrveranstaltung_id: {headerFilter:"input"},
lv_bezeichnung: {visible: false},
projektarbeit_id: {visible: false},
studiensemester_kurzbz: {headerFilter:"input"},
studiengang_kz: {visible: false},
stg_typ_kurzbz: {headerFilter:"input", width: "5%"},
personalnummer: {visible: false, headerFilter:"input"},
auftrag: {
headerFilter:"input", widthGrow: 2,
bottomCalc:"count", bottomCalcFormatter:function(cell){return "'. ucfirst($this->p->t('global', 'anzahl')). ': " + cell.getValue();}
},
stg_typ_kurzbz: {headerFilter:"input"},
gruppe: {headerFilter:"input"},
typ: {headerFilter:"input"},
lehreinheit_id: {visible: false, headerFilter:"input"},
lehrveranstaltung_id: {visible: false, headerFilter:"input"},
lv_bezeichnung: {visible: false, headerFilter:"input"},
projektarbeit_id: {visible: false, headerFilter:"input"},
studiensemester_kurzbz: {visible: false, headerFilter:"input"},
studiengang_kz: {visible: false, headerFilter:"input"},
semester: {headerFilter:"input"},
studienplan_bezeichnung: {headerFilter:"input", width: "7%"},
orgform_kurzbz: {headerFilter:"input"},
person_id: {visible: false},
typ: {headerFilter:"input"},
auftrag: {headerFilter:"input", width:"15%"},
studienplan_bezeichnung: {visible: false, headerFilter:"input"},
orgform_kurzbz: {visible: false, headerFilter:"input", widthGrow: 2},
person_id: {visible: false, headerFilter:"input"},
lv_oe_kurzbz: {headerFilter:"input"},
gruppe: {headerFilter:"input"},
lektor: {headerFilter:"input", widthGrow: 3},
lektor: {headerFilter:"input", widthGrow: 2},
stunden: {align:"right", formatter: form_formatNulltoStringNumber, formatterParams:{precision:1},
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
bottomCalc:"sum", bottomCalcParams:{precision:1}},
stundensatz: {visible: false},
betrag: {align:"right", width: "8%", formatter: form_formatNulltoStringNumber,
stundensatz: {visible: false, align:"right", formatter: form_formatNulltoStringNumber,
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator},
betrag: {align:"right", formatter: form_formatNulltoStringNumber,
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money",
bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}},
vertrag_id: {visible: false},
vertrag_id: {visible: false, headerFilter:"input"},
vertrag_stunden: {visible: false},
vertrag_betrag: {visible: false},
mitarbeiter_uid: {visible: false},
bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip, width: "8%"},
erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip, width: "8%"},
akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip, width: "8%"},
bestellt_von: {visible: false},
erteilt_von: {visible: false},
akzeptiert_von: {visible: false}
mitarbeiter_uid: {visible: false, headerFilter:"input"},
bestellt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: bestellt_tooltip},
erteilt: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: erteilt_tooltip},
akzeptiert: {align:"center", headerFilter:"input", mutator: mut_formatStringDate, tooltip: akzeptiert_tooltip},
bestellt_von: {visible: false, headerFilter:"input"},
erteilt_von: {visible: false, headerFilter:"input"},
akzeptiert_von: {visible: false, headerFilter:"input"}
}', // col properties
);
@@ -0,0 +1,77 @@
<h4><?php echo $this->p->t('lehre', 'lehrauftragStandardBestellprozess'); ?></h4>
<div class="panel panel-body">
<table>
<tr class="text-center">
<td><img src="../../../public/images/icons/fa-user-tag.png" style="height: 60px; width: 60px;"></td>
<td><i class='fa fa-2x fa-long-arrow-right'></i></td>
<td><img src="../../../public/images/icons/fa-user-check.png" style="height: 60px; width: 60px;"></td>
<td><i class='fa fa-2x fa-long-arrow-right'></i></td>
<td><i class='fa fa-2x fa-handshake-o'></i></td>
</tr>
<tr class="text-center">
<td><b><?php echo $this->p->t('lehre', 'lehrauftragStandardBestellprozessBestellen'); ?></b></td>
<td></td>
<td class="text-muted"><?php echo $this->p->t('lehre', 'lehrauftragStandardBestellprozessErteilen'); ?></td>
<td></td>
<td class="text-muted"><?php echo $this->p->t('lehre', 'lehrauftragStandardBestellprozessAnnehmen'); ?></td>
</tr>
</table>
</div>
<br>
<h4><?php echo $this->p->t('lehre', 'lehrauftraegeBestellen'); ?></h4>
<div class="panel panel-body">
<?php echo $this->p->t('lehre', 'lehrauftraegeBestellenText'); ?>
<br>
<ol>
<li><?php echo $this->p->t('lehre', 'lehrauftraegeBestellenKlickStatusicon'); ?></li>
<li><?php echo $this->p->t('lehre', 'lehrauftraegeBestellenLehrauftraegeWaehlen'); ?></li>
<li><?php echo $this->p->t('lehre', 'lehrauftraegeBestellenMitKlickBestellen'); ?></li>
</ol>
<?php echo $this->p->t('lehre', 'lehrauftraegeBestellenVertragWirdAngelegt'); ?>
</div>
<br>
<h4><?php echo $this->p->t('lehre', 'geaenderteLehrauftraege'); ?></h4>
<div class="panel panel-body">
<?php echo $this->p->t('lehre', 'geaenderteLehrauftraegeText'); ?>
</div>
<br>
<h4><?php echo $this->p->t('lehre', 'lehrauftraegeNichtAuswaehlbar'); ?></h4>
<div class="panel panel-body">
<?php echo $this->p->t('lehre', 'lehrauftraegeNichtAuswaehlbarText'); ?>
</div>
<br>
<h4>Filter</h4>
<div class="panel panel-body">
<table class="table table-bordered">
<tr class="text-center">
<td class="col-xs-1"><i class='fa fa-users'></i></td>
<td class="col-xs-1"><i class='fa fa-user-plus'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-tag.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-check.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-handshake-o'></i></td>
<td class="col-xs-1"><img src="../../../public/images/icons/fa-user-edit.png" style="height: 30px; width: 30px;"></td>
<td class="col-xs-1"><i class='fa fa-user-secret'></i></td>
</tr>
<tr class="text-center">
<td><?php echo $this->p->t('lehre', 'filterAlle'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterNeu'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterBestellt'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterErteilt'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterAngenommen'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterGeaendert'); ?></td>
<td><?php echo $this->p->t('lehre', 'filterDummies'); ?></td>
</tr>
</table>
</div>
<br>
<h4><?php echo $this->p->t('global', 'mehrHilfe'); ?></h4>
<div class="panel panel-info panel-body">
<?php echo $this->p->t('global', 'weitereInformationenUnter'); ?>
<a href="https://wiki.fhcomplete.org/doku.php?id=fhc:lehrauftraege" target="_blank">FH Complete WIKI</a>
</div><br>
@@ -0,0 +1,232 @@
<?php
$this->load->view(
'templates/FHC-Header',
array(
'title' => 'Pruefungsprotokoll',
'jquery' => true,
'jqueryui' => true,
'bootstrap' => true,
'fontawesome' => true,
'dialoglib' => true,
'ajaxlib' => true,
'sbadmintemplate' => true,
'phrases' => array(
'abschlusspruefung' => array(
'freigegebenAm',
'pruefungGespeichert',
'pruefungSpeichernFehler',
'abschlussbeurteilungLeer',
'beginnzeitLeer',
'beginnzeitFormatError',
'endezeitLeer',
'endezeitFormatError',
'endezeitBeforeError',
'verfNotice'
),
'ui' => array(
'stunde',
'minute'
)
),
'customCSSs' => array(
'public/css/sbadmin2/admintemplate_contentonly.css',
'vendor/fgelinas/timepicker/jquery.ui.timepicker.css',
'public/css/lehre/pruefungsprotokoll.css'
),
'customJSs' => array(
'vendor/fgelinas/timepicker/jquery.ui.timepicker.js',
'public/js/lehre/pruefungsprotokoll.js'
)
)
);
?>
<body>
<div id="wrapper">
<div id="page-wrapper">
<div class="container-fluid">
<?php if (isset($abschlusspruefung)):
$studiengangstyp_name = $abschlusspruefung->studiengangstyp == 'Bachelor' ? 'Bachelor' : 'Master';
$pruefung_name = $abschlusspruefung->studiengangstyp == 'Bachelor' ? $this->p->t('abschlusspruefung', 'pruefungBachelor') : $this->p->t('abschlusspruefung', 'pruefungMaster');
$arbeit_name = $abschlusspruefung->studiengangstyp == 'Bachelor' ? $this->p->t('abschlusspruefung', 'arbeitBachelor') : $this->p->t('abschlusspruefung', 'arbeitMaster');
$protokolltextvorlage = $abschlusspruefung->studiengangstyp == 'Bachelor' ? $this->p->t('abschlusspruefung', 'pruefungsnotizenBachelor') : $this->p->t('abschlusspruefung', 'pruefungsnotizenMaster');
$protokolltext = isset($abschlusspruefung->protokoll) ? $abschlusspruefung->protokoll : $protokolltextvorlage;
?>
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">
<?php echo $this->p->t('abschlusspruefung', 'protokoll') ?>&nbsp;<?php echo $pruefung_name ?>
</h3>
<p>
<?php echo $abschlusspruefung->studiengangstyp == 'Bachelor' ? $this->p->t('abschlusspruefung', 'abgehaltenAmBachelor') : $this->p->t('abschlusspruefung', 'abgehaltenAmMaster'); ?>
<?php echo $language == 'German' ? $abschlusspruefung->studiengangbezeichnung : $abschlusspruefung->studiengangbezeichnung_englisch ?>,&nbsp;<?php echo $this->p->t('abschlusspruefung', 'studiengangskennzahl') ?>&nbsp;
<?php echo $abschlusspruefung->studiengang_kz ?>
</p>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h4>
<?php echo $abschlusspruefung->titelpre_student . ' ' . $abschlusspruefung->vorname_student . ' ' . $abschlusspruefung->nachname_student . ' ' . $abschlusspruefung->titelpost_student?>
</h4>
<p><?php echo $this->p->t('abschlusspruefung', 'personenkennzeichen') ?>: <?php echo $abschlusspruefung->matrikelnr ?></p>
<br />
<input type="hidden" name="abschlusspruefung_id" value="<?php echo $abschlusspruefung->abschlusspruefung_id;?>" id="abschlusspruefung_id">
<form id="protocolform">
<table class="table-condensed table-bordered table-responsive" id="protocoltbl">
<tr>
<td colspan="6">
<?php echo $this->p->t('abschlusspruefung', 'pruefungssenat') ?>
</td>
</tr>
<tr>
<td>
<?php echo $this->p->t('abschlusspruefung', 'vorsitz') ?>
</td>
<td colspan="5">
<?php echo $abschlusspruefung->titelpre_vorsitz . ' ' . $abschlusspruefung->vorname_vorsitz . ' ' . $abschlusspruefung->nachname_vorsitz . ' ' . $abschlusspruefung->titelpost_vorsitz ?>
</td>
</tr>
<tr>
<td>
<?php echo $this->p->t('abschlusspruefung', 'erstpruefer') ?>
</td>
<td colspan="5">
<?php echo $abschlusspruefung->titelpre_erstpruefer . ' ' . $abschlusspruefung->vorname_erstpruefer . ' ' . $abschlusspruefung->nachname_erstpruefer . ' ' . $abschlusspruefung->titelpost_erstpruefer ?>
</td>
</tr>
<tr>
<td>
<?php echo $this->p->t('abschlusspruefung', 'zweitpruefer') ?>
</td>
<td colspan="5">
<?php echo $abschlusspruefung->titelpre_zweitpruefer . ' ' . $abschlusspruefung->vorname_zweitpruefer . ' ' . $abschlusspruefung->nachname_zweitpruefer . ' ' . $abschlusspruefung->titelpost_zweitpruefer ?>
</td>
</tr>
<tr>
<td class="namecellwidth">
<?php echo $this->p->t('abschlusspruefung', 'pruefungsdatum') ?>
</td>
<td class="datevalcellwidth">
<?php echo date_format(date_create($abschlusspruefung->datum), 'd.m.Y'); ?>
</td>
<td class="cellbg namecellwidth">
<?php echo $this->p->t('abschlusspruefung', 'pruefungsbeginn') ?>
</td>
<td class="timecellwidth">
<input class="timepicker form-control" name="pruefungsbeginn" id="pruefungsbeginn" value="<?php echo isEmptyString($abschlusspruefung->pruefungsbeginn) ? '' : date_format(date_create($abschlusspruefung->pruefungsbeginn), 'H:i') ?>">
</td>
<td class="cellbg namecellwidth">
<?php echo $this->p->t('abschlusspruefung', 'pruefungsende') ?>
</td>
<td class="timecellwidth">
<input class="timepicker form-control" name="pruefungsende" id="pruefungsende" value="<?php echo isEmptyString($abschlusspruefung->pruefungsbeginn) ? '' : date_format(date_create($abschlusspruefung->pruefungsende), 'H:i') ?>">
</td>
</tr>
<tr>
<td>
<?php echo $this->p->t('abschlusspruefung', 'pruefungsantritt') ?>
</td>
<td colspan="5">
<?php echo $language == 'German' ? $abschlusspruefung->pruefungsantritt_bezeichnung : $abschlusspruefung->pruefungsantritt_bezeichnung_english; ?>
</td>
</tr>
<tr>
<td>
<?php echo $this->p->t('abschlusspruefung', 'einverstaendniserklaerungName') ?>
</td>
<td colspan="5">
<input type="checkbox" id="verfCheck">
<?php echo $this->p->t('abschlusspruefung', 'einverstaendniserklaerungText') ?>
</td>
</tr>
<tr>
<td>
<?php echo $this->p->t('abschlusspruefung', 'themaBeurteilung') ?>&nbsp;<?php echo $arbeit_name ?>
</td>
<td colspan="4">
<?php echo isset($abschlusspruefung->abschlussarbeit_titel) ? $abschlusspruefung->abschlussarbeit_titel : '' ?>
</td>
<td>
<?php echo $this->p->t('lehre', 'note') ?>: <?php echo isset($abschlusspruefung->abschlussarbeit_note) ? $abschlusspruefung->abschlussarbeit_note : '' ?>
</td>
</tr>
<tr>
<td>
<?php echo $this->p->t('abschlusspruefung', 'pruefungsgegenstand') ?>
</td>
<td colspan="5">
<?php echo ($abschlusspruefung->studiengangstyp == 'Bachelor' ? $this->p->t('abschlusspruefung', 'pruefungsgegenstandBachelor') : $this->p->t('abschlusspruefung', 'pruefungsgegenstandMaster')) ?>
</td>
</tr>
<tr>
<td colspan="6">
<?php echo ucfirst($this->p->t('global', 'notizen')); ?>
</td>
</tr>
<tr>
<td colspan="6">
<textarea id="protokoll" name="protokoll" class="form-control" rows="15" cols="107"><?php echo $protokolltext ?></textarea>
</td>
</tr>
<tr>
<td colspan="6">
<?php echo $abschlusspruefung->studiengangstyp == 'Bachelor' ? $this->p->t('abschlusspruefung', 'beurteilungKriterienBachelor') : $this->p->t('abschlusspruefung', 'beurteilungKriterienMaster') ?>
</td>
</tr>
<tr>
<td colspan="6">
<?php echo $abschlusspruefung->studiengangstyp == 'Bachelor' ? $this->p->t('abschlusspruefung', 'beurteilungBachelor') : $this->p->t('abschlusspruefung', 'beurteilungMaster') ?>:
<select name="abschlussbeurteilung_kurzbz" id="abschlussbeurteilung_kurzbz" class="form-control">
<option value="">-- <?php echo $this->p->t('ui', 'bitteWaehlen'); ?> --</option>
<?php foreach ($abschlussbeurteilung as $beurteilung):
$selected = $beurteilung->abschlussbeurteilung_kurzbz == $abschlusspruefung->abschlussbeurteilung_kurzbz ? " selected" : "" ?>
<option value="<?php echo $beurteilung->abschlussbeurteilung_kurzbz; ?>"<?php echo $selected ?>><?php echo $language == 'German' ? $beurteilung->bezeichnung : $beurteilung->bezeichnung_english; ?> </option>
<?php endforeach; ?>
</select>
<span id="verfNotice"></span>
</td>
</tr>
</table>
</form>
<br />
</div>
</div>
<div class="row">
<div class="col-lg-12 text-right">
<p>
<?php $freigegeben = isset($abschlusspruefung->freigabedatum); ?>
<button id="saveProtocolBtn" class="btn btn-default"<?php echo $freigegeben ? " disabled" : "" ?>><?php echo $this->p->t('ui', 'speichern') ?></button>
</p>
</div>
</div>
<hr id="hrbottom">
<div class="row">
<div class="col-lg-12">
<span id="freigegebenText">
<?php
if ($freigegeben)
echo '&nbsp;&nbsp;' . $this->p->t('abschlusspruefung', 'freigegebenAm') . ' ' . date_format(date_create($abschlusspruefung->freigabedatum), 'd.m.Y')
?>
</span>
</div>
</div>
<br />
<div class="row">
<div class="col-lg-8">
<div class="input-group">
<input id="username" type="hidden" value=""><!-- this is to prevent Chrome autofilling a random input field with the username-->
<input id="password" type="password" autocomplete="new-password" class="form-control" placeholder="CIS-<?php echo ucfirst($this->p->t('password', 'password')); ?>">
<span class="input-group-btn">
<button id="freigebenProtocolBtn" class="btn btn-default"><?php echo $this->p->t('abschlusspruefung', 'ueberpruefenFreigeben') ?></button>
</span>
</div>
</div>
</div>
<br />
<br />
<?php endif; ?>
</div>
</div>
</div>
@@ -0,0 +1,66 @@
<?php
$this->load->view(
'templates/FHC-Header',
array(
'title' => 'Prüfungsprotokoll',
'jquery' => true,
'jqueryui' => true,
'jquerycheckboxes' => true,
'bootstrap' => true,
'fontawesome' => true,
'tablesorter' => true,
'ajaxlib' => true,
'dialoglib' => true,
'tablewidget' => true,
'phrases' => array(
'ui' => array(
'keineDatenVorhanden',
'heute',
'letzteWoche',
'alle',
'zeitraum'
)
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css'),
'customJSs' => array('public/js/bootstrapper.js')
)
);
?>
<body>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">
<?php echo $this->p->t('abschlusspruefung','pruefungsprotokoll'); ?>
</h3>
</div>
</div>
<?php echo $this->p->t('abschlusspruefung','einfuehrungstext'); ?>
<br><br>
<div class="row">
<div class="col-lg-12">
<form action="" method="post">
<label><?php echo $this->p->t('ui','zeitraum'); ?>:&nbsp;&nbsp;</label>
<div class="btn-group" role="group">
<button type="submit" class="btn btn-default <?php echo $period == 'today' ? 'active' : ''?>"
name="period" value="today"><?php echo $this->p->t('ui','heute'); ?></button>
<button type="submit" class="btn btn-default <?php echo $period == 'lastWeek' ? 'active' : ''?>"
name="period" value="lastWeek"><?php echo $this->p->t('ui','letzteWoche'); ?></button>
<button type="submit" class="btn btn-default <?php echo $period == 'all' ? 'active' : ''?>"
name="period" value="all"><?php echo $this->p->t('ui','alle'); ?></button>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<?php $this->load->view('lehre/pruefungsprotokollUebersichtData.php'); ?>
</div>
</div>
</div>
</div>
</body>
<?php $this->load->view('templates/FHC-Footer'); ?>
@@ -0,0 +1,72 @@
<?php
$UID = getAuthUID();
$PERIOD = $period; // filter Pruefungsprotokolle for given period
$query = "
SELECT
tbl_abschlusspruefung.abschlusspruefung_id,
tbl_person.nachname || ' ' || tbl_person.vorname as name,
tbl_studiengangstyp.bezeichnung || ' ' || tbl_studiengang.bezeichnung,
tbl_abschlusspruefung.datum,
tbl_abschlusspruefung.freigabedatum
FROM
lehre.tbl_abschlusspruefung
JOIN public.tbl_student USING(student_uid)
JOIN public.tbl_benutzer ON(student_uid=uid)
JOIN public.tbl_person USING(person_id)
JOIN public.tbl_studiengang ON(tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz)
JOIN public.tbl_studiengangstyp USING(typ)
WHERE
vorsitz='".$UID."'
AND (
'". $PERIOD. "' = 'today' AND datum = NOW()::date OR
'". $PERIOD. "' = 'lastWeek' AND datum = (NOW() - interval '1 week')::date OR
'". $PERIOD. "' = 'all' AND datum >= '2020-05-27'
)
ORDER BY datum, nachname, vorname
";
$filterWidgetArray = array(
'query' => $query,
'tableUniqueId' => 'pruefungsprotokoll',
'requiredPermissions' => 'lehre/pruefungsbeurteilung',
'datasetRepresentation' => 'tablesorter',
'columnsAliases' => array(
ucfirst($this->p->t('global', 'details')),
ucfirst($this->p->t('global', 'name')),
ucfirst($this->p->t('lehre', 'studiengang')),
ucfirst($this->p->t('global', 'datum')),
ucfirst($this->p->t('global', 'status')),
),
'formatRow' => function($datasetRaw) {
/* NOTE: Dont use $this here for PHP Version compatibility */
$datasetRaw->{'abschlusspruefung_id'} = sprintf(
'<a href="%s?abschlusspruefung_id=%s" target="_blank">Protokoll ausfüllen</a>',
site_url('lehre/Pruefungsprotokoll/Protokoll'),
$datasetRaw->{'abschlusspruefung_id'}
);
if ($datasetRaw->{'datum'} == null)
{
$datasetRaw->{'datum'} = '-';
}
else
{
$datasetRaw->{'datum'} = date_format(date_create($datasetRaw->{'datum'}),'d.m.Y');
}
if ($datasetRaw->{'freigabedatum'} == null)
{
$datasetRaw->{'freigabedatum'} = 'offen';
}
else
{
$datasetRaw->{'freigabedatum'} = 'Freigegeben am: '.date_format(date_create($datasetRaw->{'freigabedatum'}),'d.m.Y');
}
return $datasetRaw;
},
);
echo $this->widgetlib->widget('TableWidget', $filterWidgetArray);
?>
@@ -106,7 +106,7 @@
public.tbl_reihungstest
LEFT JOIN public.tbl_studiengang using(studiengang_kz)
WHERE
datum>now()-'2 weeks'::interval
datum>now()-'5 months'::interval
ORDER BY datum desc
) data
",
@@ -142,7 +142,7 @@
}
else
{
$datasetRaw->{'anmeldefrist'} = date_format(date_create($datasetRaw->{'anmeldefrist'}), 'd.m.Y');
$datasetRaw->{'anmeldefrist'} = date_format(date_create($datasetRaw->{'anmeldefrist'}), 'Y-m-d');
}
if ($datasetRaw->{'max_plaetze'} == null)
{
@@ -175,7 +175,7 @@
}
else
{
$datasetRaw->{'datum'} = date_format(date_create($datasetRaw->{'datum'}), 'd.m.Y');
$datasetRaw->{'datum'} = date_format(date_create($datasetRaw->{'datum'}), 'Y-m-d');
}
return $datasetRaw;
+18 -1
View File
@@ -3,7 +3,7 @@
'query' => '
SELECT
person_id, vorname, nachname, geschlecht, svnr, ersatzkennzeichen, matr_nr,
staatsbuergerschaft, gebdatum
staatsbuergerschaft, gebdatum, false AS mitarbeiter
FROM
public.tbl_person
WHERE
@@ -11,6 +11,17 @@
AND bpk is null
AND EXISTS(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) AND
person_id=tbl_person.person_id AND tbl_benutzer.aktiv=true)
UNION
SELECT
person_id, vorname, nachname, geschlecht, svnr, ersatzkennzeichen, matr_nr,
staatsbuergerschaft, gebdatum, true AS mitarbeiter
FROM
public.tbl_person
JOIN public.tbl_benutzer USING(person_id)
JOIN public.tbl_mitarbeiter ON (mitarbeiter_uid=uid)
WHERE
bpk is null
AND tbl_benutzer.aktiv=true
',
'requiredPermissions' => 'admin',
'datasetRepresentation' => 'tablesorter',
@@ -25,6 +36,7 @@
ucfirst($this->p->t('person', 'matrikelnummer')),
ucfirst($this->p->t('person', 'staatsbuergerschaft')),
ucfirst($this->p->t('person', 'geburtsdatum')),
'Mitarbeiter'
),
'formatRow' => function($datasetRaw) {
@@ -45,6 +57,11 @@
{
$datasetRaw->{'svnr'} = '-';
}
if ($datasetRaw->{'matr_nr'} == null)
{
$datasetRaw->{'matr_nr'} = '-';
}
$datasetRaw->{'mitarbeiter'} = $datasetRaw->{'mitarbeiter'} == 'true' ? 'ja' : 'nein';
return $datasetRaw;
}
+111 -150
View File
@@ -1,150 +1,111 @@
<?php $this->load->view("templates/header", array("title" => "UDF", "widgetsCSS" => true)); ?>
<body style="background-color: #eff0f1;">
<?php
if ($result != null)
{
if (isSuccess($result))
{
?>
<div style="color: black;">
Saved!
</div>
<br>
<?php
}
else
{
?>
<div style="color: red;">
Error while saving!
</div>
<br>
<div style="color: red;">
<?php
$errors = $result->retval;
if(is_array($errors))
{
foreach ($errors as $error)
{
foreach ($error as $fieldError)
{
echo $fieldError->code . ': ' . $fieldError->retval . '<br>';
}
}
}
else
echo $result->retval;
?>
</div>
<br>
<br>
<br>
<?php
}
}
?>
<form action="<?php echo site_url('system/FAS_UDF/saveUDF'); ?>" method="POST">
<div class="div-table">
<div class="div-row">
<div class="div-cell" style="font-size: 20px; font-weight: bold;">
Zusatzfelder
</div>
</div>
<div class="div-row">
<div class="div-cell">
&nbsp;
</div>
</div>
<div class="div-row">
<?php
if (isset($personUdfs))
{
?>
<div class="div-cell">
<?php
echo $this->udflib->UDFWidget(
array(
UDFLib::SCHEMA_ARG_NAME => 'public',
UDFLib::TABLE_ARG_NAME => 'tbl_person',
UDFLib::UDFS_ARG_NAME => $personUdfs
)
);
?>
</div>
<div class="div-cell" style="width: 40px;">
&nbsp;
</div>
<?php
}
?>
<?php
if (isset($prestudentUdfs))
{
?>
<div class="div-cell">
<?php
echo $this->udflib->UDFWidget(
array(
UDFLib::SCHEMA_ARG_NAME => 'public',
UDFLib::TABLE_ARG_NAME => 'tbl_prestudent',
UDFLib::UDFS_ARG_NAME => $prestudentUdfs
)
);
?>
</div>
<?php
}
?>
</div>
<div class="div-row">
<div class="div-cell">
&nbsp;
</div>
</div>
<div class="div-row halign-right">
<?php
if (isset($personUdfs) && isset($prestudentUdfs))
{
?>
<div class="div-cell">
&nbsp;
</div>
<div class="div-cell">
&nbsp;
</div>
<?php
}
?>
<div class="div-cell halign-right">
<input type="submit" value="&nbsp;Speichern&nbsp;">
</div>
</div>
</div>
<?php
if (isset($personUdfs))
{
?>
<input type="hidden" name="person_id" value="<?php echo $personUdfs['person_id']; ?>">
<?php
}
?>
<?php
if (isset($prestudentUdfs))
{
?>
<input type="hidden" name="prestudent_id" value="<?php echo $prestudentUdfs['prestudent_id']; ?>">
<?php
}
?>
</form>
</body>
<?php $this->load->view("templates/footer"); ?>
<?php
$this->load->view(
'templates/FHC-Header',
array(
'title' => 'InfocenterDetails',
'jquery' => true,
'bootstrap' => true,
'fontawesome' => true,
'jqueryui' => true,
'dialoglib' => true,
'ajaxlib' => true,
'udfs' => true,
'widgets' => true,
'sbadmintemplate' => true,
'customCSSs' => array(
'public/css/sbadmin2/admintemplate.css'
),
'customJSs' => array(
'public/js/bootstrapper.js'
)
)
);
?>
<body style="background-color: #eff0f1;">
<div class="div-table">
<div class="div-row">
<div class="div-cell" style="font-size: 20px; font-weight: bold;">
Zusatzfelder
</div>
</div>
<div class="div-row">
<div class="div-cell">
&nbsp;
</div>
</div>
<div class="div-row">
<?php
if (isset($personUdfs))
{
?>
<div class="div-cell">
<?php
echo $this->udflib->UDFWidget(
array(
UDFLib::UDF_UNIQUE_ID => 'fasPersonUDFs',
UDFLib::REQUIRED_PERMISSIONS_PARAMETER => 'basis/person',
UDFLib::SCHEMA_ARG_NAME => 'public',
UDFLib::TABLE_ARG_NAME => 'tbl_person',
UDFLib::PRIMARY_KEY_NAME => 'person_id',
UDFLib::PRIMARY_KEY_VALUE => $person_id,
UDFLib::UDFS_ARG_NAME => $personUdfs
)
);
?>
</div>
<div class="div-cell" style="width: 40px;">
&nbsp;
</div>
<?php
}
?>
<?php
if (isset($prestudentUdfs))
{
?>
<div class="div-cell">
<?php
echo $this->udflib->UDFWidget(
array(
UDFLib::UDF_UNIQUE_ID => 'fasPrestudentUDFs',
UDFLib::REQUIRED_PERMISSIONS_PARAMETER => 'basis/person',
UDFLib::SCHEMA_ARG_NAME => 'public',
UDFLib::TABLE_ARG_NAME => 'tbl_prestudent',
UDFLib::PRIMARY_KEY_NAME => 'prestudent_id',
UDFLib::PRIMARY_KEY_VALUE => $prestudent_id,
UDFLib::UDFS_ARG_NAME => $prestudentUdfs
)
);
?>
</div>
<?php
}
?>
</div>
<div class="div-row">
<div class="div-cell">
&nbsp;
</div>
</div>
<div class="div-row halign-right">
<?php
if (isset($personUdfs) && isset($prestudentUdfs))
{
?>
<div class="div-cell">
&nbsp;
</div>
<div class="div-cell">
&nbsp;
</div>
<?php
}
?>
</div>
</div>
</body>
<?php $this->load->view("templates/footer"); ?>
@@ -14,6 +14,8 @@
'sbadmintemplate' => true,
'addons' => true,
'navigationwidget' => true,
'udfs' => true,
'widgets' => true,
'customCSSs' => array(
'public/css/sbadmin2/admintemplate.css',
'public/css/sbadmin2/tablesort_bootstrap.css',
@@ -125,8 +125,7 @@
<div id="collapse<?php echo $zgvpruefung->prestudent_id ?>"
class="panel-collapse collapse<?php echo $infoonly ? '' : ' in' ?>">
<div class="panel-body">
<form method="post"
action="#" class="zgvform">
<form action="javascript:void(0);" class="zgvform" id="zgvform_<?php echo $zgvpruefung->prestudent_id ?>">
<input type="hidden" name="prestudentid" value="<?php echo $zgvpruefung->prestudent_id ?>" class="prestudentidinput">
<div class="row">
<div class="col-lg-<?php echo $columns[0] ?>">
@@ -309,21 +308,38 @@
</div>
<!-- show only master zgv if master studiengang - end -->
<?php endif; ?>
<?php if (!$infoonly): ?>
<div class="row">
<div class="col-xs-6 text-left">
<button type="button" class="btn btn-default zgvUebernehmen" id="zgvUebernehmen_<?php echo $zgvpruefung->prestudent_id ?>">
<?php echo $this->p->t('infocenter', 'letzteZgvUebernehmen') ?>
</button>
</div>
<div class="col-xs-6 text-right">
<button type="submit" class="btn btn-default saveZgv" id="zgvSpeichern_<?php echo $zgvpruefung->prestudent_id ?>">
<?php echo $this->p->t('ui', 'speichern') ?>
</button>
</div>
</div>
<?php endif; ?>
</form>
<?php if (!$infoonly): ?>
<div class="row">
<div class="col-xs-6 text-left">
<button type="button" class="btn btn-default zgvUebernehmen" id="zgvUebernehmen_<?php echo $zgvpruefung->prestudent_id ?>">
<?php echo $this->p->t('infocenter', 'letzteZgvUebernehmen') ?>
</button>
</div>
<div class="col-xs-6 text-right">
<button type="submit" class="btn btn-default saveZgv" id="zgvSpeichern_<?php echo $zgvpruefung->prestudent_id ?>">
<?php echo $this->p->t('ui', 'speichern') ?>
</button>
</div>
</div>
<?php endif; ?>
<br />
<?php
if (isset($zgvpruefung->prestudentUdfs))
{
echo $this->udflib->UDFWidget(
array(
UDFLib::UDF_UNIQUE_ID => 'infocenterPrestudentUDFs_'.$zgvpruefung->prestudent_id,
UDFLib::REQUIRED_PERMISSIONS_PARAMETER => 'infocenter',
UDFLib::SCHEMA_ARG_NAME => 'public',
UDFLib::TABLE_ARG_NAME => 'tbl_prestudent',
UDFLib::PRIMARY_KEY_NAME => 'prestudent_id',
UDFLib::PRIMARY_KEY_VALUE => $zgvpruefung->prestudent_id,
UDFLib::UDFS_ARG_NAME => $zgvpruefung->prestudentUdfs
)
);
}
?>
</div>
<?php
@@ -0,0 +1,47 @@
<?php
$this->load->view(
'templates/FHC-Header',
array(
'title' => 'Jobs Queue Viewer',
'jquery' => true,
'jqueryui' => true,
'bootstrap' => true,
'fontawesome' => true,
'sbadmintemplate' => true,
'tablesorter' => true,
'ajaxlib' => true,
'filterwidget' => true,
'navigationwidget' => true,
'phrases' => array(
'global' => array('mailAnXversandt'),
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css',
'customJSs' => array('public/js/bootstrapper.js')
)
);
?>
<body>
<div id="wrapper">
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">
Jobs Queue Viewer
</h3>
</div>
</div>
<div>
<?php $this->load->view('system/jq/jobsQueueViewerData.php'); ?>
</div>
</div>
</div>
</div>
</body>
<?php $this->load->view('templates/FHC-Footer'); ?>
@@ -0,0 +1,67 @@
<?php
$filterWidgetArray = array(
'query' => '
SELECT jq.jobid AS "JobId",
jq.creationtime AS "CreationTime",
jq.type AS "Type",
jq.status AS "Status",
jq.starttime AS "StartTime",
jq.endtime AS "EndTime",
jq.insertvon AS "UserService"
FROM system.tbl_jobsqueue jq
ORDER BY jq.creationtime DESC, jq.starttime DESC, jq.endtime DESC
',
'requiredPermissions' => 'admin',
'datasetRepresentation' => 'tablesorter',
'columnsAliases' => array(
'Job id',
'Creation time',
'Type',
'Status',
'Start time',
'End time',
'User/Service'
),
'formatRow' => function($datasetRaw) {
$datasetRaw->CreationTime = date_format(date_create($datasetRaw->CreationTime), 'd.m.Y H:i:s');
$datasetRaw->StartTime = date_format(date_create($datasetRaw->StartTime), 'd.m.Y H:i:s');
$datasetRaw->EndTime = date_format(date_create($datasetRaw->EndTime), 'd.m.Y H:i:s');
return $datasetRaw;
},
'markRow' => function($datasetRaw) {
$mark = '';
if ($datasetRaw->Status == JobsQueueLib::STATUS_FAILED)
{
$mark = 'text-red';
}
if ($datasetRaw->Status == JobsQueueLib::STATUS_DONE)
{
$mark = 'text-green';
}
if ($datasetRaw->Status == JobsQueueLib::STATUS_RUNNING)
{
$mark = 'text-orange';
}
if ($datasetRaw->Status == JobsQueueLib::STATUS_NEW)
{
$mark = 'text-info';
}
return $mark;
}
);
$filterWidgetArray['app'] = 'core';
$filterWidgetArray['datasetName'] = 'jq';
$filterWidgetArray['filter_id'] = $this->input->get('filter_id');
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
?>
+2 -2
View File
@@ -2,7 +2,7 @@
$this->load->view(
'templates/FHC-Header',
array(
'title' => 'Logs viewer',
'title' => 'Logs Viewer',
'jquery' => true,
'jqueryui' => true,
'bootstrap' => true,
@@ -32,7 +32,7 @@
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">
JobsViewer
Job Logs Viewer
</h3>
</div>
</div>
@@ -25,7 +25,7 @@
),
'formatRow' => function($datasetRaw) {
$datasetRaw->ExecutionTime = date_format(date_create($datasetRaw->ExecutionTime), 'd.m.Y H:i:s');
$datasetRaw->ExecutionTime = date_format(date_create($datasetRaw->ExecutionTime), 'd.m.Y H:i:s:u');
return $datasetRaw;
},
@@ -33,22 +33,22 @@
$mark = '';
if ($datasetRaw->RequestId == 'Cronjob error')
if (strpos($datasetRaw->RequestId, 'error') != false)
{
$mark = 'text-red';
}
if ($datasetRaw->RequestId == 'Cronjob info')
if (strpos($datasetRaw->RequestId, 'info') != false)
{
$mark = 'text-green';
}
if ($datasetRaw->RequestId == 'Cronjob warning')
if (strpos($datasetRaw->RequestId, 'warning') != false)
{
$mark = 'text-orange';
}
if ($datasetRaw->RequestId == 'Cronjob debug')
if (strpos($datasetRaw->RequestId, 'debug') != false)
{
$mark = 'text-info';
}
@@ -63,3 +63,4 @@
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
?>
+6 -1
View File
@@ -34,6 +34,7 @@
$tablewidget = isset($tablewidget) ? $tablewidget : false;
$tabulator = isset($tabulator) ? $tabulator : false;
$tinymce = isset($tinymce) ? $tinymce : false;
$udfs = isset($udfs) ? $udfs : false;
$widgets = isset($widgets) ? $widgets : false;
?>
@@ -195,6 +196,7 @@
// From public folder
// DialogLib JS
// NOTE: must be called before including others JS libraries that use it
if ($dialoglib === true) generateJSsInclude('public/js/DialogLib.js');
// AjaxLib JS
@@ -213,8 +215,11 @@
// TableWidget JS
if ($tablewidget === true) generateJSsInclude('public/js/TableWidget.js');
// User Defined Fields
if ($udfs === true) generateJSsInclude('public/js/UDFWidget.js');
// Load addon hooks JS
// NOTE: keep it as the latest but one
// NOTE: keep it as the last but one
if ($addons === true) generateAddonsJSsInclude($calledPath.'/'.$calledMethod);
// Eventually required JS
+11 -4
View File
@@ -1,17 +1,24 @@
<br>
<div class="row" id="divTableWidgetDataset" tableUniqueId="<?php echo $tableUniqueId; ?>">
<div class="col-lg-12">
<!-- Table widget header -->
<div id="tableWidgetHeader"></div>
<!-- TableWidget help site ( only rendered if widget is Tabulator )-->
<?php $this->load->view('widgets/table/tableHelpsite') ?>
<!-- Table info top -->
<div id="tableDatasetActionsTop"></div>
<!-- TableWidget table -->
<div>
<?php TableWidget::loadViewDataset(); ?>
</div>
<?php TableWidget::loadViewDataset(); ?>
<!-- Table info bottom -->
<div id="tableDatasetActionsBottom"></div>
<!-- Table widget footer -->
<div id="tableWidgetFooter"></div>
</div>
</div>
@@ -0,0 +1,39 @@
<!--CollapseHTML 'Help'-->
<div class="row">
<div class="col-lg-12 collapse" id="tabulatorHelp-<?php echo $tableUniqueId; ?>">
<div class="well">
<h4><?php echo ucfirst($this->p->t('ui', 'tabelleneinstellungen')); ?></h4>
<div class="panel panel-body">
<b><?php echo $this->p->t('table', 'spaltenEinAusblenden'); ?></b>
<p>
<ul>
<li><?php echo $this->p->t('table', 'spaltenEinAusblendenMitKlickOeffnen'); ?></li>
<li><?php echo $this->p->t('table', 'spaltenEinAusblendenAufEinstellungenKlicken'); ?></li>
<li><?php echo $this->p->t('table', 'spaltenEinAusblendenMitKlickAktivieren'); ?></li>
<li><?php echo $this->p->t('table', 'spaltenEinAusblendenMitKlickSchliessen'); ?></li>
</ul>
</p>
<br>
<b><?php echo $this->p->t('table', 'spaltenbreiteVeraendern'); ?></b>
<p><?php echo $this->p->t('table', 'spaltenbreiteVeraendernText'); ?></p>
<div class="alert alert-info">
<strong>INFO: </strong>
<?php echo $this->p->t('table', 'spaltenbreiteVeraendernInfotext'); ?>
</div>
</div>
<br> <!--end panel-body-->
<h4><?php echo $this->p->t('table', 'zeilenAuswaehlen'); ?></h4>
<div class="panel panel-body">
<ul>
<li><?php echo $this->p->t('table', 'zeilenAuswaehlenEinzeln'); ?></li>
<li><?php echo $this->p->t('table', 'zeilenAuswaehlenBereich'); ?></li>
<li><?php echo $this->p->t('table', 'zeilenAuswaehlenAlle'); ?></li>
</ul>
</div>
<br> <!--end panel-body-->
</div><!--end well-->
</div><!--end col collapse-->
</div><!--end row-->
@@ -31,7 +31,10 @@ class Organisationseinheit_widget extends DropdownWidget
{
// NOTE: no need to call addSelectToModel because getRecursiveList already returns
// the correct names of the fields
$this->setElementsArray($this->OrganisationseinheitModel->getRecursiveList());
$this->setElementsArray($this->OrganisationseinheitModel->getRecursiveList(),
true,
$this->p->t('lehre', 'organisationseinheit'),
'No organisational unit found');
}
$this->loadDropDownView($widgetData);
+12 -12
View File
@@ -12,7 +12,7 @@ class DropdownWidgetUDF extends DropdownWidget
{
// Array that will contains the elements to be displayed in the dropdown
$tmpNewElements = array();
// Loops through the given parameters
foreach($parameters as $parameter)
{
@@ -29,27 +29,27 @@ class DropdownWidgetUDF extends DropdownWidget
// If the single element is an array of two element
if (is_array($parameter) && count($parameter) == 2)
{
$newElement->{DropdownWidget::ID_FIELD} = $parameter[0]; //
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter[1]; //
$newElement->{DropdownWidget::ID_FIELD} = $parameter[0]; //
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter[1]; //
}
// If the single element is a string or a number
else if (is_string($parameter) || is_numeric($parameter))
{
$newElement->{DropdownWidget::ID_FIELD} = $parameter; //
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter; //
$newElement->{DropdownWidget::ID_FIELD} = $parameter; //
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter; //
}
// If the single element is an object with two properties: id and description
else if (is_object($parameter) && isset($parameter->{DropdownWidget::ID_FIELD})
&& isset($parameter->{DropdownWidget::DESCRIPTION_FIELD}))
{
$newElement->{DropdownWidget::ID_FIELD} = $parameter->{DropdownWidget::ID_FIELD}; //
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter->{DropdownWidget::DESCRIPTION_FIELD}; //
$newElement->{DropdownWidget::ID_FIELD} = $parameter->{DropdownWidget::ID_FIELD}; //
$newElement->{DropdownWidget::DESCRIPTION_FIELD} = $parameter->{DropdownWidget::DESCRIPTION_FIELD}; //
}
array_push($tmpNewElements, $newElement); // Add $newElement into $tmpNewElements
}
}
// Set the list of elements
$this->setElementsArray(
success($tmpNewElements),
@@ -57,9 +57,9 @@ class DropdownWidgetUDF extends DropdownWidget
$this->htmlParameters[HTMLWidget::PLACEHOLDER],
'No data found for this UDF'
);
$this->loadDropDownView();
echo $this->content();
}
}
}
+146 -5
View File
@@ -6,14 +6,155 @@
*/
class UDFWidget extends HTMLWidget
{
private $_requiredPermissions; // The required permissions to use this UDF widget
private $_schema; // Schema name
private $_table; // Table name
private $_primaryKeyName; // Primary key name
private $_primaryKeyValue; // Primary key value
/**
* Initialize the UDFWidget and starts the execution of the logic
*/
public function __construct($name, $args = array())
{
parent::__construct($name, $args); // calls the parent's constructor
$this->load->library('UDFLib'); // Loads the UDFLib that contains all the used logic
$this->udflib->setUDFUniqueIdByParams($args); // sets the unique id for this UDF
$this->_initUDFWidget($args); // checks parameters and initialize properties
// Let's start if it's allowed
// NOTE: If it is NOT allowed then no data are loaded
if ($this->udflib->isAllowed($this->_requiredPermissions))
{
$this->_startUDFWidget($args[UDFLib::UDF_UNIQUE_ID]);
}
}
/**
* Called by the WidgetLib, it renders the HTML of the UDF
*/
public function display($widgetData)
{
// _ci is the instance of Code Igniter and the library UDFLib was previously loaded,
// so now is it possibile to call the method displayUDFWidget of UDFLib
// to render the HTML of this UDF
$this->_ci->udflib->displayUDFWidget($widgetData);
// Let's start if it's allowed
// NOTE: If it is NOT allowed then no data are loaded
if ($this->_ci->udflib->isAllowed($this->_requiredPermissions))
{
$this->_ci->udflib->displayUDFWidget($widgetData);
}
}
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Checks parameters and initialize all the properties of this UDFWidget
*/
private function _initUDFWidget($args)
{
$this->_checkParameters($args);
// If here then everything is ok
// Initialize class properties
$this->_requiredPermissions = null;
$this->_schema = null;
$this->_table = null;
$this->_primaryKeyName = null;
$this->_primaryKeyValue = null;
// Retrieved the required permissions parameter if present
if (isset($args[UDFLib::REQUIRED_PERMISSIONS_PARAMETER]))
{
$this->_requiredPermissions = $args[UDFLib::REQUIRED_PERMISSIONS_PARAMETER];
}
// Retrieved the
if (isset($args[UDFLib::SCHEMA_ARG_NAME]))
{
$this->_schema = $args[UDFLib::SCHEMA_ARG_NAME];
}
// Retrieved the
if (isset($args[UDFLib::TABLE_ARG_NAME]))
{
$this->_table = $args[UDFLib::TABLE_ARG_NAME];
}
// Retrieved the
if (isset($args[UDFLib::PRIMARY_KEY_NAME]))
{
$this->_primaryKeyName = $args[UDFLib::PRIMARY_KEY_NAME];
}
// Retrieved the
if (isset($args[UDFLib::PRIMARY_KEY_VALUE]))
{
$this->_primaryKeyValue = $args[UDFLib::PRIMARY_KEY_VALUE];
}
}
/**
* Checks the required parameters used to call this UDFWidget
*/
private function _checkParameters($args)
{
if (!is_array($args) || (is_array($args) && count($args) == 0))
{
show_error('Second parameter of the widget call must be a NOT empty associative array');
}
else
{
if (!isset($args[UDFLib::UDF_UNIQUE_ID]))
{
show_error('The parameter "'.UDFLib::UDF_UNIQUE_ID.'" must be specified');
}
if (!isset($args[UDFLib::REQUIRED_PERMISSIONS_PARAMETER]))
{
show_error('The parameter "'.UDFLib::REQUIRED_PERMISSIONS_PARAMETER.'" must be specified');
}
if (!isset($args[UDFLib::SCHEMA_ARG_NAME]))
{
show_error('The parameter "'.UDFLib::SCHEMA_ARG_NAME.'" must be specified');
}
if (!isset($args[UDFLib::TABLE_ARG_NAME]))
{
show_error('The parameter "'.UDFLib::TABLE_ARG_NAME.'" must be specified');
}
if (!isset($args[UDFLib::PRIMARY_KEY_NAME]))
{
show_error('The parameter "'.UDFLib::PRIMARY_KEY_NAME.'" must be specified');
}
if (!isset($args[UDFLib::PRIMARY_KEY_VALUE]))
{
show_error('The parameter "'.UDFLib::PRIMARY_KEY_VALUE.'" must be specified');
}
}
}
/**
* Contains all the logic used to load all the data needed to the UDFWidget
*/
private function _startUDFWidget($udfUniqueId)
{
// Stores an array that contains all the data useful for
$this->udflib->setSession(
array(
UDFLib::UDF_UNIQUE_ID => $udfUniqueId, // table unique id
UDFLib::REQUIRED_PERMISSIONS_PARAMETER => $this->_requiredPermissions, //
UDFLib::SCHEMA_ARG_NAME => $this->_schema, //
UDFLib::TABLE_ARG_NAME => $this->_table, //
UDFLib::PRIMARY_KEY_NAME => $this->_primaryKeyName, //
UDFLib::PRIMARY_KEY_VALUE => $this->_primaryKeyValue //
)
);
}
}
@@ -812,6 +812,7 @@ if (isset($_REQUEST["freigabe"]) && ($_REQUEST["freigabe"] == 1))
{
$studlist .= "
<td><b>" . $p->t('global/personenkz') . "</b></td>
<td><b>" . $p->t('global/studiengang') . "</b></td>
<td><b>" . $p->t('global/nachname') . "</b></td>
<td><b>" . $p->t('global/vorname') . "</b></td>
";
@@ -834,10 +835,11 @@ if (isset($_REQUEST["freigabe"]) && ($_REQUEST["freigabe"] == 1))
// studentenquery
$qry_stud = "SELECT
DISTINCT uid, vorname, nachname, matrikelnr
DISTINCT uid, vorname, nachname, matrikelnr, kurzbzlang
FROM
campus.vw_student_lehrveranstaltung
JOIN campus.vw_student USING(uid)
JOIN public.tbl_studiengang ON campus.vw_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
WHERE
studiensemester_kurzbz = " . $db->db_add_param($stsem) . "
AND lehrveranstaltung_id = " . $db->db_add_param($lvid, FHC_INTEGER) . "
@@ -859,6 +861,7 @@ if (isset($_REQUEST["freigabe"]) && ($_REQUEST["freigabe"] == 1))
if (defined('CIS_GESAMTNOTE_FREIGABEMAIL_NOTE') && CIS_GESAMTNOTE_FREIGABEMAIL_NOTE)
{
$studlist .= "<tr><td>" . trim($row_stud->matrikelnr) . "</td>";
$studlist .= "<td>" . trim($row_stud->kurzbzlang) . "</td>";
$studlist .= "<td>" . trim($row_stud->nachname) . "</td>";
$studlist .= "<td>" . trim($row_stud->vorname) . "</td>";
+43 -30
View File
@@ -178,7 +178,7 @@ function loadPruefungsfenster()
success: function(data){
if(data.result.length === 0)
{
messageBox("message", "<?php echo $p->t('pruefung/keinFensterVorhanden'); ?>", "red", "highlight", 1000);
messageBox("message", "<?php echo $p->t('pruefung/keinFensterVorhanden'); ?>", "red", "highlight", 10000);
$("#pruefungsfenster").html("<option value='null'></option>");
}
else
@@ -352,8 +352,12 @@ function writePruefungsTable(e, data, anmeldung)
var termin = d.von.split(" ");
var time = termin[1].substring(0,5);
termin = termin[0].split("-");
var minimumFrist = new Date(termin[0], termin[1]-1,termin[2]);
minimumFrist.setMonth(minimumFrist.getMonth() - 2);
// Wie viele Monate vor Prüfungen dürfen sich Studierende anmelden?
// Sperre "deaktiviert" indem man sich 24 Monate vorher anmelden darf
var minimumFrist = new Date(termin[0], termin[1]-1,termin[2]);
minimumFrist.setMonth(minimumFrist.getMonth() - 24);
termin = new Date(termin[0], termin[1]-1,termin[2]);
var frist = termin;
termin = termin.getDate()+"."+(termin.getMonth()+1)+"."+termin.getFullYear();
@@ -613,7 +617,7 @@ function saveAnmeldung(lehrveranstaltung_id, termin_id)
else
{
//Wenn Anmeldung durch Lektor
showAnmeldungen(termin_id, lehrveranstaltung_id);
showAnmeldungen(termin_id, lehrveranstaltung_id, false, false);
}
}
});
@@ -721,6 +725,11 @@ function refresh()
loadPruefungen();
loadPruefungenOfStudiengang();
loadPruefungenGesamt();
if ($("#filter_studiensemester").val() == "0")
$("#additional-exams").hide();
else
$("#additional-exams").show();
}
/**
@@ -759,9 +768,10 @@ function convertDateTime(string, type)
* @param {type} pruefungstermin_id ID des Prüfungstermins
* @param {type} lehrveranstaltung_id ID der Lehrveranstaltung
* @param saveReihungAfterShow speichert Reihung neu wenn true
* @param showMessage steuert ob Meldung angzeigt werden soll
* @returns {undefined}
*/
function showAnmeldungen(pruefungstermin_id, lehrveranstaltung_id, saveReihungAfterShow = false)
function showAnmeldungen(pruefungstermin_id, lehrveranstaltung_id, saveReihungAfterShow = false, showMessage = true)
{
$("#kommentar").empty();
$("#kommentarSpeichernButton").empty();
@@ -776,7 +786,7 @@ function showAnmeldungen(pruefungstermin_id, lehrveranstaltung_id, saveReihungAf
},
error: loadError,
success: function(data){
writeAnmeldungen(data);
writeAnmeldungen(data, showMessage);
$("#sortable").sortable();
$("#sortable").disableSelection();
@@ -786,7 +796,7 @@ function showAnmeldungen(pruefungstermin_id, lehrveranstaltung_id, saveReihungAf
});
}
function writeAnmeldungen(data)
function writeAnmeldungen(data, showMessage = true)
{
if(data.error === 'false')
{
@@ -858,7 +868,10 @@ function writeAnmeldungen(data)
$("#kommentarSpeichernButton").empty();
$("#raumLink").empty();
$("#listeDrucken").empty();
messageBox("message", data.errormsg, "red", "highlight", 1000);
if (showMessage)
messageBox("message", data.errormsg, "red", "highlight", 10000);
if (data.lv_bezeichnung)
{
$("#lvdaten").html(data.lv_bezeichnung+" ("+data.termin_datum+")");
@@ -906,11 +919,11 @@ function saveReihung(terminId, lehrveranstaltung_id)
success: function(data){
if(data.error === 'false' && data.result === true)
{
messageBox("message", "<?php echo $p->t('pruefung/reihunghErfolgreichGeaendert'); ?>", "green", "highlight", 1000);
messageBox("message", "<?php echo $p->t('pruefung/reihunghErfolgreichGeaendert'); ?>", "green", "highlight", 10000);
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
showAnmeldungen(terminId, lehrveranstaltung_id);
@@ -947,7 +960,7 @@ function anmeldungBestaetigen(pruefungsanmeldung_id, termin_id, lehrveranstaltun
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}
});
@@ -984,7 +997,7 @@ function anmeldungLoeschen(pruefungsanmeldung_id, termin_id, lehrveranstaltung_i
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}
});
@@ -1018,7 +1031,7 @@ function alleBestaetigen(termin_id, lehrveranstaltung_id)
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}
});
@@ -1070,7 +1083,7 @@ function loadStudiengaenge()
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}
});
@@ -1129,7 +1142,7 @@ function loadPruefungStudiengang(studiengang_kz, studiensemester)
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}
});
@@ -1174,7 +1187,7 @@ function saveKommentar(pruefungsanmeldung_id, termin_id, lehrveranstaltung_id)
},
error: loadError,
success: function(data){
messageBox("message", "<?php echo $p->t('pruefung/kommentarErfolgreichGespeichert'); ?>", "green", "highlight", 1000);
messageBox("message", "<?php echo $p->t('pruefung/kommentarErfolgreichGespeichert'); ?>", "green", "highlight", 10000);
showAnmeldungen(termin_id, lehrveranstaltung_id);
}
});
@@ -1392,7 +1405,7 @@ function savePruefungstermin()
if(error)
{
messageBox("message", "<?php echo $p->t('pruefung/formulardatenNichtKorrekt'); ?>", "red", "highlight", 3000);
messageBox("message", "<?php echo $p->t('pruefung/formulardatenNichtKorrekt'); ?>", "red", "highlight", 10000);
}
else
{
@@ -1418,12 +1431,12 @@ function savePruefungstermin()
unmarkMissingFormEntry();
if(data.error === "false")
{
messageBox("message", "<?php echo $p->t('pruefung/pruefungErfolgreichGespeichert'); ?>", "green", "highlight", 1000);
messageBox("message", "<?php echo $p->t('pruefung/pruefungErfolgreichGespeichert'); ?>", "green", "highlight", 10000);
resetPruefungsverwaltung();
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}
});
@@ -1526,7 +1539,7 @@ function loadPruefungsDetails(prfId)
}).done(function(data){
if(data.result.length === 0)
{
messageBox("message", "<?php echo $p->t('pruefung/keinePruefungsfensterGespeichert'); ?>", "red", "highlight", 1000);
messageBox("message", "<?php echo $p->t('pruefung/keinePruefungsfensterGespeichert'); ?>", "red", "highlight", 10000);
$("#pruefungsfenster").html("<option value='null'></option>");
}
else
@@ -1819,7 +1832,7 @@ function updatePruefung(prfId)
if(error)
{
messageBox("message", "<?php echo $p->t('pruefung/formulardatenNichtKorrekt'); ?>", "red", "highlight", 3000);
messageBox("message", "<?php echo $p->t('pruefung/formulardatenNichtKorrekt'); ?>", "red", "highlight", 10000);
}
else
{
@@ -1847,12 +1860,12 @@ function updatePruefung(prfId)
unmarkMissingFormEntry();
if(data.error === "false")
{
messageBox("message", "<?php echo $p->t('pruefung/pruefungErfolgreichGespeichert'); ?>", "green", "highlight", 1000);
messageBox("message", "<?php echo $p->t('pruefung/pruefungErfolgreichGespeichert'); ?>", "green", "highlight", 10000);
resetPruefungsverwaltung();
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}).always(function(){
loadAllPruefungen();
@@ -1882,11 +1895,11 @@ function deleteLehrveranstaltungFromPruefung(lvId, pruefung_id)
}).done(function(data){
if(data.error === "false")
{
messageBox("message", "<?php echo $p->t('pruefung/lvErfolgreichEntfernt'); ?>", "green", "highlight", 1000);
messageBox("message", "<?php echo $p->t('pruefung/lvErfolgreichEntfernt'); ?>", "green", "highlight", 10000);
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}).always(function(){
loadPruefungsDetails(pruefung_id);
@@ -1913,11 +1926,11 @@ function stornoPruefung(pruefung_id)
}).done(function(data){
if(data.error === "false")
{
messageBox("message", "<?php echo $p->t('pruefung/pruefungStorniert'); ?>", "green", "highlight", 1000);
messageBox("message", "<?php echo $p->t('pruefung/pruefungStorniert'); ?>", "green", "highlight", 10000);
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}).always(function(){
loadAllPruefungen();
@@ -1946,11 +1959,11 @@ function terminLoeschen(pruefung_id, pruefungstermin_id)
}).done(function(data){
if(data.error === "false")
{
messageBox("message", "<?php echo $p->t('pruefung/terminGeloescht'); ?>", "green", "highlight", 1000);
messageBox("message", "<?php echo $p->t('pruefung/terminGeloescht'); ?>", "green", "highlight", 10000);
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}).always(function(){
loadPruefungsDetails(pruefung_id);
@@ -2005,7 +2018,7 @@ function loadAllPruefungen()
}
else
{
messageBox("message", data.errormsg, "red", "highlight", 1000);
messageBox("message", data.errormsg, "red", "highlight", 10000);
}
}).always(function(event, xhr, settings){
if($("#prfTable")[0].hasInitialized !== true)
@@ -53,7 +53,7 @@ $method = isset($_REQUEST['method'])?$_REQUEST['method']:'';
switch($method)
{
case 'getPruefungByLv':
$studiensemester = isset($_REQUEST['studiensemester']) ? $_REQUEST['studiensemester'] : NULL;
$studiensemester = isset($_REQUEST['studiensemester']) && $_REQUEST['studiensemester'] != '0' ? $_REQUEST['studiensemester'] : NULL;
$data = getPruefungByLv($studiensemester, $uid);
break;
case 'getPruefungByLvFromStudiengang':
@@ -156,7 +156,7 @@ function getPruefungByLv($aktStudiensemester = null, $uid = null)
}
$lehrveranstaltungen=$lvIds;
$pruefung = new pruefungCis();
if($pruefung->getPruefungByLv($lehrveranstaltungen))
if($pruefung->getPruefungByLv($lehrveranstaltungen, $uid))
{
$pruefungen = array();
foreach($pruefung->lehrveranstaltungen as $key=>$lv)
@@ -164,7 +164,10 @@ function getPruefungByLv($aktStudiensemester = null, $uid = null)
$lehrveranstaltung = new lehrveranstaltung($lv->lehrveranstaltung_id);
$lehrveranstaltung = $lehrveranstaltung->cleanResult();
$lehreinheit = new lehreinheit();
$lehreinheit->load_lehreinheiten($lehrveranstaltung[0]->lehrveranstaltung_id, $aktStudiensemester);
if ($aktStudiensemester == null)
$lehreinheit->load_all_lehreinheiten($lehrveranstaltung[0]->lehrveranstaltung_id);
else
$lehreinheit->load_lehreinheiten($lehrveranstaltung[0]->lehrveranstaltung_id, $aktStudiensemester);
$lehreinheiten = $lehreinheit->lehreinheiten;
$prf = new stdClass();
$temp = new pruefungCis($lv->pruefung_id);
@@ -612,13 +615,14 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null)
$stdsem = $aktStudiensemester;
$prestudenten = array();
$gueltigerStatus = array("Student", "Unterbrecher", "Absolvent");
foreach ($prestudent->result as $ps)
{
// prüfen ob Student zum Zeitpunkt der LV oder zumindest irgendwann Student im Studiengang war/ist
if ($ps->getLaststatus($ps->prestudent_id, $stdsem_lv_besuch) || $ps->studiengang_kz == $studiengang_kz)
{
if (($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher") || ($ps->status_kurzbz == ""))
if (in_array($ps->status_kurzbz, $gueltigerStatus) || ($ps->status_kurzbz == ""))
{
array_push($prestudenten, $ps);
}
@@ -634,7 +638,7 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null)
{
if ($ps->getLaststatus($ps->prestudent_id, $stdsem))
{
if (($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher"))
if (in_array($ps->status_kurzbz, $gueltigerStatus))
{
$prestudent_id = $ps->prestudent_id;
}
@@ -642,7 +646,7 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null)
{
if ($ps->getLaststatus($ps->prestudent_id, $stdsem_lv_besuch))
{
if (($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher"))
if (in_array($ps->status_kurzbz, $gueltigerStatus))
{
$prestudent_id = $ps->prestudent_id;
}
@@ -653,7 +657,7 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null)
{
if ($ps->getLaststatus($ps->prestudent_id, $stdsem_lv_besuch))
{
if (($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher"))
if (in_array($ps->status_kurzbz, $gueltigerStatus))
{
$prestudent_id = $ps->prestudent_id;
}
@@ -667,7 +671,7 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null)
{
if ($ps->getLaststatus($ps->prestudent_id, $stdsem))
{
if (($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher"))
if (in_array($ps->status_kurzbz, $gueltigerStatus))
{
$prestudent_id = $ps->prestudent_id;
}
@@ -675,7 +679,7 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null)
{
if ($ps->getLaststatus($ps->prestudent_id, $stdsem_lv_besuch))
{
if (($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher"))
if (in_array($ps->status_kurzbz, $gueltigerStatus))
{
$prestudent_id = $ps->prestudent_id;
}
@@ -686,7 +690,7 @@ function saveAnmeldung($aktStudiensemester = null, $uid = null)
{
if ($ps->getLaststatus($ps->prestudent_id, $stdsem_lv_besuch))
{
if (($ps->status_kurzbz == "Student") || ($ps->status_kurzbz == "Unterbrecher"))
if (in_array($ps->status_kurzbz, $gueltigerStatus))
{
$prestudent_id = $ps->prestudent_id;
}
@@ -187,21 +187,15 @@ $studiensemester->getAll();
<body>
<?php
echo "<h1>".$p->t('pruefung/anmeldungFuer')." ".$benutzer->vorname." ".$benutzer->nachname." (".$uid.")</h1>";
echo '<h3>'.$p->t('pruefung/filter').'</h3>';
echo '<p>'.$p->t('global/studiensemester').': ';
echo '<h3 style="display: none">'.$p->t('pruefung/filter').'</h3>';
echo '<p style="display: none">'.$p->t('global/studiensemester').': ';
echo '<select id="filter_studiensemester" onchange="refresh();">';
$aktuellesSemester = $studiensemester->getaktorNext();
foreach ($studiensemester->studiensemester as $sem)
{
if ($aktuellesSemester == $sem->studiensemester_kurzbz)
{
echo '<option selected value="'.$sem->studiensemester_kurzbz.'">'.$sem->studiensemester_kurzbz.'</option>';
}
else
{
echo '<option value="'.$sem->studiensemester_kurzbz.'">'.$sem->studiensemester_kurzbz.'</option>';
}
echo '<option value="'.$sem->studiensemester_kurzbz.'">'.$sem->studiensemester_kurzbz.'</option>';
}
echo '<option selected value="0">alle Semester</option>';
echo '</select></p>';
?>
<div id="details" title="<?php echo $p->t('pruefung/details'); ?>">
@@ -240,43 +234,45 @@ $studiensemester->getAll();
</tbody>
</table>
</div>
<?php
if (!defined('CIS_PRUEFUNGSANMELDUNG_LEHRVERANSTALTUNGEN_AUS_STUDIENGANG')
|| CIS_PRUEFUNGSANMELDUNG_LEHRVERANSTALTUNGEN_AUS_STUDIENGANG == true):
?>
<h2><?php echo $p->t('pruefung/lvVonStudiengang'); ?></h2>
<div>
<table id="table2" class="tablesorter">
<thead>
<tr>
<th class="columnheader1"><?php echo $p->t('global/institut'); ?></th>
<th class="columnheader2"><?php echo $p->t('global/lehrveranstaltung'); ?></th>
<th class="columnheader3"><?php echo $p->t('pruefung/pruefungTermin'); ?></th>
<th class="columnheader4"><?php echo $p->t('pruefung/freiePlaetze'); ?></th>
</tr>
</thead>
<tbody id="pruefungenStudiengang">
</tbody>
</table>
</div>
<?php endif; ?>
<div id="additional-exams" style="display: none">
<?php
if (!defined('CIS_PRUEFUNGSANMELDUNG_LEHRVERANSTALTUNGEN_AUS_STUDIENGANG')
|| CIS_PRUEFUNGSANMELDUNG_LEHRVERANSTALTUNGEN_AUS_STUDIENGANG == true):
?>
<h2><?php echo $p->t('pruefung/lvVonStudiengang'); ?></h2>
<div>
<table id="table2" class="tablesorter">
<thead>
<tr>
<th class="columnheader1"><?php echo $p->t('global/institut'); ?></th>
<th class="columnheader2"><?php echo $p->t('global/lehrveranstaltung'); ?></th>
<th class="columnheader3"><?php echo $p->t('pruefung/pruefungTermin'); ?></th>
<th class="columnheader4"><?php echo $p->t('pruefung/freiePlaetze'); ?></th>
</tr>
</thead>
<tbody id="pruefungenStudiengang">
</tbody>
</table>
</div>
<?php endif; ?>
<h2><?php echo $p->t('pruefung/lvAlle'); ?></h2>
<div>
<table id="table3" class="tablesorter">
<thead>
<tr>
<th class="columnheader1"><?php echo $p->t('global/institut'); ?></th>
<th class="columnheader2"><?php echo $p->t('global/lehrveranstaltung'); ?></th>
<th class="columnheader3"><?php echo $p->t('pruefung/pruefungTermin'); ?></th>
<th class="columnheader4"><?php echo $p->t('pruefung/freiePlaetze'); ?></th>
</tr>
</thead>
<tbody id="pruefungenGesamt">
<h2><?php echo $p->t('pruefung/lvAlle'); ?></h2>
<div>
<table id="table3" class="tablesorter">
<thead>
<tr>
<th class="columnheader1"><?php echo $p->t('global/institut'); ?></th>
<th class="columnheader2"><?php echo $p->t('global/lehrveranstaltung'); ?></th>
<th class="columnheader3"><?php echo $p->t('pruefung/pruefungTermin'); ?></th>
<th class="columnheader4"><?php echo $p->t('pruefung/freiePlaetze'); ?></th>
</tr>
</thead>
<tbody id="pruefungenGesamt">
</tbody>
</table>
</div>
</tbody>
</table>
</div>
</div>
</div>
<div id="saveDialog" title="<?php echo $p->t('pruefung/anmeldungSpeichern'); ?>">
<form id="saveAnmeldungForm">
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
$url = "http://xgnd.bsz-bw.de/";
$url = "https://xgnd.bsz-bw.de/";
$zielfeld = "kontrollschlagwoerter";
$url = $url."?zielfeld=".$zielfeld;
header('Content-Type: text/html; charset=utf-8');
+23 -2
View File
@@ -37,6 +37,8 @@ require_once('../../include/studiengang.class.php');
require_once('../../include/student.class.php');
require_once('../../include/prestudent.class.php');
require_once('../../include/dokument_export.class.php');
require_once('../../include/person.class.php');
require_once('../../include/webservicelog.class.php');
if (!$db = new basis_db())
die('Fehler beim Oeffnen der Datenbankverbindung');
@@ -135,6 +137,23 @@ if (isset($_GET['typ']))
$params .= '&typ='.$_GET['typ'];
if (isset($_GET['all']))
$params .= '&all=1';
if (isset($_GET['xsl_oe_kurzbz']))
$params .= '&xsl_oe_kurzbz='. $_GET['xsl_oe_kurzbz'];
// Logeintrag bei Download von Zahlungsbestaetigungen
if (isset($_GET['xsl']) && $_GET['xsl'] == 'Zahlung')
{
$requestdata = $_SERVER['QUERY_STRING'];
$log = new Webservicelog();
$log->webservicetyp_kurzbz = 'content';
$log->request_id = isset($_GET['buchungsnummern']) && !empty($_GET['buchungsnummern']) ? $_GET['buchungsnummern'] : NULL;
$log->beschreibung = 'Zahlungsbestaetigungsdownload';
$log->request_data = $requestdata;
$log->execute_user = $user;
$log->save(true);
}
//OE fuer Output ermitteln
@@ -166,7 +185,7 @@ else
$konto = new konto();
if (($user == $_GET["uid"]) || $rechte->isBerechtigt('admin'))
if (((isset($_GET["uid"]) && $user == $_GET["uid"])) || $rechte->isBerechtigt('admin'))
{
$buchungstypen = array();
if (defined("CIS_DOKUMENTE_STUDIENBEITRAG_TYPEN"))
@@ -232,7 +251,9 @@ if (($user == $_GET["uid"]) || $rechte->isBerechtigt('admin'))
$filename .= '-'.$studienordnung->studiengangkurzbzlang;
break;
default:
$filename = $xsl;
$person = new Person();
$person->getPersonFromBenutzer($user);
$filename = $xsl. '_'. $person->nachname;
}
$dokument->setFilename($filename);
+2 -4
View File
@@ -76,7 +76,6 @@ if(isset($_GET['action']) && $_GET['action']=='download')
$akte = new akte();
$akte->load($id);
if ($akte->person_id == $student_studiengang->person_id
&& $akte->signiert
&& $akte->stud_selfservice)
{
if($akte->inhalt!='')
@@ -89,12 +88,12 @@ if(isset($_GET['action']) && $_GET['action']=='download')
}
else
{
die('Id ist ungueltig');
die('Akte hat keinen Inhalt.');
}
}
else
{
die('Id ist ungueltig');
die('Nicht zum selbständigen Download bestimmt oder falsche PersonID.');
}
}
else
@@ -123,7 +122,6 @@ echo '
});
$(".tablesorter2").tablesorter(
{
sortList: [[1,1]],
headers: { 0: { sorter: false }},
widgets: ["zebra"]
});
+8 -2
View File
@@ -56,6 +56,12 @@ $uid = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
$is_employee = false;
if (check_lektor($uid))
{
$is_employee = true;
}
$datum_obj = new datum();
// Wenn ein anderer User sich das Profil ansieht (Bei Personensuche) sollen bestimmte persönliche Daten nicht angezeigt werden
@@ -346,7 +352,7 @@ if ($type == 'mitarbeiter')
$kontakt->load_pers($user->person_id);
foreach($kontakt->result as $k)
{
if ($k->kontakttyp == 'firmenhandy')
if ($k->kontakttyp == 'firmenhandy' && $is_employee)
echo 'Firmenhandy: '.$k->kontakt.'<br>';
}
@@ -465,7 +471,7 @@ if (!$ansicht)
}
*/
}
if (!$has_notfallkontakt)
if (!$has_notfallkontakt && $type == 'mitarbeiter')
echo '<tr><td>'.$p->t('profil/notfallkontakt').'</td><td colspan="3">'.$p->t('profil/notfallkontaktBekanntgeben').'</td></tr>';
echo '</table>';
+299 -277
View File
@@ -1,277 +1,299 @@
<?php
/* Copyright (C) 2006 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../../../config/cis.config.inc.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/studiensemester.class.php');
require_once('../../../include/konto.class.php');
require_once('../../../include/person.class.php');
require_once('../../../include/benutzer.class.php');
require_once('../../../include/datum.class.php');
require_once('../../../include/studiengang.class.php');
require_once('../../../include/phrasen.class.php');
require_once('../../../include/benutzerberechtigung.class.php');
$sprache = getSprache();
$p = new phrasen($sprache);
$uid=get_uid();
if(isset($_GET['uid']))
{
// Administratoren duerfen die UID als Parameter uebergeben um die Zahlungen
// von anderen Personen anzuzeigen
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if($rechte->isBerechtigt('admin'))
{
$uid = $_GET['uid'];
$getParam = "&uid=" . $uid;
}
else
$getParam = "";
}
else
$getParam='';
$datum_obj = new datum();
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>'.$p->t('tools/zahlungen').'</title>
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>';
include('../../../include/meta/jquery.php');
include('../../../include/meta/jquery-tablesorter.php');
echo ' <script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
</head>
<style>
table.tablesorter
{
width: auto;
}
table.tablesorter tbody td
{
padding: 1px 3px;
}
</style>
<script type="text/javascript">
// Parser für Datum DD.MM.YYYY
$.tablesorter.addParser({
id: "customDate",
is: function(s) {
//return false;
//use the above line if you don\'t want table sorter to auto detected this parser
// match dd.mm.yyyy e.g. 01.01.2001 as regex
return /\d{1,2}.\d{1,2}.\d{1,4}/.test(s);
},
// replace regex-wildcards and return new date
format: function(s) {
s = s.replace(/\-/g," ");
s = s.replace(/:/g," ");
s = s.replace(/\./g," ");
s = s.split(" ");
return $.tablesorter.formatFloat(new Date(s[2], s[1]-1, s[0]).getTime());
},
type: "numeric"
});
// Parser für Betrag
$.tablesorter.addParser({
id: "customCurrancy",
is: function(s) {
//return false;
//use the above line if you don\'t want table sorter to auto detected this parser
// match dd.mm.yyyy e.g. 01.01.2001 as regex
//alert(/€\s\d*.*/.test(s))
return /€\s\d*.*/.test(s);
},
// replace regex-wildcards and return new date
format: function(s) {
s = s.replace(/\-/g," ");
s = s.replace(/:/g," ");
s = s.replace(/\./g," ");
s = s.split(" ");
return $.tablesorter.formatFloat(s[1]);
},
type: "numeric"
});
// Parser für Studiensemester
$.tablesorter.addParser({
// set a unique id
id: "studiensemester",
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
// format data for normalization
var result = s.substr(2) + s.substr(0, 2);
return result;
},
// set type, either numeric or text
type: "text"
});
// For correct sorting of Umlauts
$.tablesorter.characterEquivalents = {
"a" : "\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5", // áàâãäąå
"A" : "\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5", // ÁÀÂÃÄĄÅ
"c" : "\u00e7\u0107\u010d", // çćč
"C" : "\u00c7\u0106\u010c", // ÇĆČ
"e" : "\u00e9\u00e8\u00ea\u00eb\u011b\u0119", // éèêëěę
"E" : "\u00c9\u00c8\u00ca\u00cb\u011a\u0118", // ÉÈÊËĚĘ
"i" : "\u00ed\u00ec\u0130\u00ee\u00ef\u0131", // íìİîïı
"I" : "\u00cd\u00cc\u0130\u00ce\u00cf", // ÍÌİÎÏ
"o" : "\u00f3\u00f2\u00f4\u00f5\u00f6\u014d", // óòôõöō
"O" : "\u00d3\u00d2\u00d4\u00d5\u00d6\u014c", // ÓÒÔÕÖŌ
"ss": "\u00df", // ß (s sharp)
"SS": "\u1e9e", // ẞ (Capital sharp s)
"u" : "\u00fa\u00f9\u00fb\u00fc\u016f", // úùûüů
"U" : "\u00da\u00d9\u00db\u00dc\u016e" // ÚÙÛÜŮ
};
$(document).ready(function()
{
$("#t1").tablesorter(
{
// Adding Function for sorting images by title
textExtraction:function(s)
{
if($(s).find(\'img\').length == 0) return $(s).text();
return $(s).find(\'img\').attr(\'title\');
},
sortList: [[0,1],[1,1]],
widgets: ["zebra"],
sortLocaleCompare : true,
headers: { 0: { sorter: "customDate"}, 3: { sorter: "studiensemester"}, 5: { sorter: "customCurrancy"}, 6: { sorter: false}}
});
});
</script>
<body>';
$studiengang = new studiengang();
$studiengang->getAll(null,null);
$stg_arr = array();
foreach ($studiengang->result as $row)
$stg_arr[$row->studiengang_kz]=$row->kuerzel;
$benutzer = new benutzer();
if(!$benutzer->load($uid))
die('Benutzer wurde nicht gefunden');
echo '<h1>'.$p->t('tools/zahlungen').' - '.$benutzer->vorname.' '.$benutzer->nachname.'</h1>';
$konto = new konto();
$konto->getBuchungstyp();
$buchungstyp = array();
foreach ($konto->result as $row)
$buchungstyp[$row->buchungstyp_kurzbz]=$row->beschreibung;
$konto = new konto();
$konto->getBuchungen($benutzer->person_id);
if(count($konto->result)>0)
{
echo '<br><br><table class="tablesorter" id="t1"><thead>';
echo '<tr>';
echo '
<th>'.$p->t('global/datum').'</th>
<th>'.$p->t('tools/zahlungstyp').'</th>
<th>'.$p->t('lvplan/stg').'</th>
<th>'.$p->t('global/studiensemester').'</th>
<th>'.$p->t('tools/buchungstext').'</th>
<th>'.$p->t('tools/betrag').'</th>
<th>'.$p->t('tools/zahlungsbestaetigung').'</th>';
echo '</tr></thead><tbody>';
foreach ($konto->result as $row)
{
$i=0; //Zaehler fuer Anzahl Gegenbuchungen
$buchungsnummern='';
if(!isset($row['parent']))
continue;
$betrag = $row['parent']->betrag;
if(isset($row['childs']))
{
foreach ($row['childs'] as $key => $row_child)
{
$betrag += $row_child->betrag;
$betrag = round($betrag, 2);
$buchungsnummern .= ';'.$row['childs'][$key]->buchungsnr;
$i = $key; //Zaehler auf letzten Gegenbuchungseintrag setzen
}
}
else
$buchungsnummern = $row['parent']->buchungsnr;
if($betrag<0)
$style='style="background-color: #FF8888;"';
elseif($betrag>0)
$style='style="background-color: #88DD88;"';
else
$style='';
echo "<tr>";
echo '<td '.$style.'>'.date('d.m.Y',$datum_obj->mktime_fromdate(isset($row['childs'][$i])?$row['childs'][$i]->buchungsdatum:$row['parent']->buchungsdatum)).'</td>';
echo '<td '.$style.'>'.$buchungstyp[$row['parent']->buchungstyp_kurzbz].'</td>';
echo '<td '.$style.'>'.$stg_arr[$row['parent']->studiengang_kz].'</td>';
echo '<td '.$style.'>'.$row['parent']->studiensemester_kurzbz.'</td>';
echo '<td '.$style.'>'.$row['parent']->buchungstext.'</td>';
echo '<td align="right" '.$style.'>€ '.($betrag<0?'-':($betrag>0?'+':'')).sprintf('%.2f',abs($row['parent']->betrag)).'</td>';
echo '<td align="center" '.$style.'>';
if($betrag>=0 && $row['parent']->betrag<=0)
{
echo '<a href="../pdfExport.php?xml=konto.rdf.php&xsl=Zahlung&uid='.$uid.'&buchungsnummern='.$buchungsnummern.'" title="'.$p->t('tools/bestaetigungDrucken').'"><img src="../../../skin/images/pdfpic.gif" alt="'.$p->t('tools/bestaetigungDrucken').'"></a>';
}
elseif($row['parent']->betrag>0)
{
//Auszahlung
}
else
{
echo '<a onclick="window.open(';
echo "'zahlungen_details.php?buchungsnr=".$row['parent']->buchungsnr.$getParam."','Zahlungsdetails','height=500,width=550,left=0,top=0,hotkeys=0,resizable=yes,status=no,scrollbars=no,toolbar=no,location=no,menubar=no,dependent=yes');return false;";
echo '" href="#">'.$p->t('tools/offen').'</a>(€ '.sprintf('%.2f',$betrag*-1).')';
echo '</td>';
}
echo '</tr>';
}
echo '</tbody></table>';
}
else
{
echo $p->t('tools/keineZahlungenVorhanden');
}
echo '</td></tr></table';
echo '</body></html>';
?>
<?php
/* Copyright (C) 2006 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../../../config/cis.config.inc.php');
require_once('../../../config/global.config.inc.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/studiensemester.class.php');
require_once('../../../include/konto.class.php');
require_once('../../../include/person.class.php');
require_once('../../../include/benutzer.class.php');
require_once('../../../include/datum.class.php');
require_once('../../../include/studiengang.class.php');
require_once('../../../include/phrasen.class.php');
require_once('../../../include/benutzerberechtigung.class.php');
$sprache = getSprache();
$p = new phrasen($sprache);
$uid=get_uid();
if(isset($_GET['uid']))
{
// Administratoren duerfen die UID als Parameter uebergeben um die Zahlungen
// von anderen Personen anzuzeigen
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if($rechte->isBerechtigt('admin'))
{
$uid = $_GET['uid'];
$getParam = "&uid=" . $uid;
}
else
$getParam = "";
}
else
$getParam='';
if (defined('ZAHLUNGSBESTAETIGUNG_ANZEIGEN') && !ZAHLUNGSBESTAETIGUNG_ANZEIGEN)
{
die('Um diese Seite anzuzeigen, ist ein entsprechender Eintrag in der Konfigurationsdatei nötig.');
}
$datum_obj = new datum();
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>'.$p->t('tools/zahlungen').'</title>
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>';
include('../../../include/meta/jquery.php');
include('../../../include/meta/jquery-tablesorter.php');
echo ' <script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
</head>
<style>
table.tablesorter
{
width: auto;
}
table.tablesorter tbody td
{
padding: 1px 3px;
}
</style>
<script type="text/javascript">
// Parser für Datum DD.MM.YYYY
$.tablesorter.addParser({
id: "customDate",
is: function(s) {
//return false;
//use the above line if you don\'t want table sorter to auto detected this parser
// match dd.mm.yyyy e.g. 01.01.2001 as regex
return /\d{1,2}.\d{1,2}.\d{1,4}/.test(s);
},
// replace regex-wildcards and return new date
format: function(s) {
s = s.replace(/\-/g," ");
s = s.replace(/:/g," ");
s = s.replace(/\./g," ");
s = s.split(" ");
return $.tablesorter.formatFloat(new Date(s[2], s[1]-1, s[0]).getTime());
},
type: "numeric"
});
// Parser für Betrag
$.tablesorter.addParser({
id: "customCurrancy",
is: function(s) {
//return false;
//use the above line if you don\'t want table sorter to auto detected this parser
// match dd.mm.yyyy e.g. 01.01.2001 as regex
//alert(/€\s\d*.*/.test(s))
return /€\s\d*.*/.test(s);
},
// replace regex-wildcards and return new date
format: function(s) {
s = s.replace(/\-/g," ");
s = s.replace(/:/g," ");
s = s.replace(/\./g," ");
s = s.split(" ");
return $.tablesorter.formatFloat(s[1]);
},
type: "numeric"
});
// Parser für Studiensemester
$.tablesorter.addParser({
// set a unique id
id: "studiensemester",
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
// format data for normalization
var result = s.substr(2) + s.substr(0, 2);
return result;
},
// set type, either numeric or text
type: "text"
});
// For correct sorting of Umlauts
$.tablesorter.characterEquivalents = {
"a" : "\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5", // áàâãäąå
"A" : "\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5", // ÁÀÂÃÄĄÅ
"c" : "\u00e7\u0107\u010d", // çćč
"C" : "\u00c7\u0106\u010c", // ÇĆČ
"e" : "\u00e9\u00e8\u00ea\u00eb\u011b\u0119", // éèêëěę
"E" : "\u00c9\u00c8\u00ca\u00cb\u011a\u0118", // ÉÈÊËĚĘ
"i" : "\u00ed\u00ec\u0130\u00ee\u00ef\u0131", // íìİîïı
"I" : "\u00cd\u00cc\u0130\u00ce\u00cf", // ÍÌİÎÏ
"o" : "\u00f3\u00f2\u00f4\u00f5\u00f6\u014d", // óòôõöō
"O" : "\u00d3\u00d2\u00d4\u00d5\u00d6\u014c", // ÓÒÔÕÖŌ
"ss": "\u00df", // ß (s sharp)
"SS": "\u1e9e", // ẞ (Capital sharp s)
"u" : "\u00fa\u00f9\u00fb\u00fc\u016f", // úùûüů
"U" : "\u00da\u00d9\u00db\u00dc\u016e" // ÚÙÛÜŮ
};
$(document).ready(function()
{
$("#t1").tablesorter(
{
// Adding Function for sorting images by title
textExtraction:function(s)
{
if($(s).find(\'img\').length == 0) return $(s).text();
return $(s).find(\'img\').attr(\'title\');
},
sortList: [[0,1],[1,1]],
widgets: ["zebra"],
sortLocaleCompare : true,
headers: { 0: { sorter: "customDate"}, 3: { sorter: "studiensemester"}, 5: { sorter: "customCurrancy"}, 6: { sorter: false}}
});
});
</script>
<body>';
$studiengang = new studiengang();
$studiengang->getAll(null,null);
$stg_arr = array();
foreach ($studiengang->result as $row)
$stg_arr[$row->studiengang_kz]=$row->kuerzel;
$benutzer = new benutzer();
if(!$benutzer->load($uid))
die('Benutzer wurde nicht gefunden');
echo '<h1>'.$p->t('tools/zahlungen').' - '.$benutzer->vorname.' '.$benutzer->nachname.'</h1>';
$konto = new konto();
$konto->getBuchungstyp();
$buchungstyp = array();
foreach ($konto->result as $row)
$buchungstyp[$row->buchungstyp_kurzbz]=$row->beschreibung;
$konto = new konto();
$konto->getBuchungen($benutzer->person_id);
if(count($konto->result)>0)
{
echo '<br><br><table class="tablesorter" id="t1"><thead>';
echo '<tr>';
echo '
<th>'.$p->t('global/datum').'</th>
<th>'.$p->t('tools/zahlungstyp').'</th>
<th>'.$p->t('lvplan/stg').'</th>
<th>'.$p->t('global/studiensemester').'</th>
<th>'.$p->t('tools/buchungstext').'</th>
<th>'.$p->t('tools/betrag').'</th>
<th>'.$p->t('tools/zahlungsbestaetigung').'</th>';
echo '</tr></thead><tbody>';
foreach ($konto->result as $row)
{
$i=0; //Zaehler fuer Anzahl Gegenbuchungen
$count_studiengangszahlung = 0;
$buchungsnummern='';
// Für die FHTW sollen nur Zahlungsbestaetigungen von FHTW-Studien angezeigt werden. (Nicht von Lehrgaengen)
if (defined('ZAHLUNGSBESTAETIGUNG_ANZEIGEN_FUER_LEHRGAENGE') && !ZAHLUNGSBESTAETIGUNG_ANZEIGEN_FUER_LEHRGAENGE)
{
$is_lehrgang = $row['parent']->studiengang_kz < 0 ? true : false;
if ($is_lehrgang) continue;
}
if(!isset($row['parent']))
continue;
$betrag = $row['parent']->betrag;
$count_studiengangszahlung ++;
if(isset($row['childs']))
{
foreach ($row['childs'] as $key => $row_child)
{
$betrag += $row_child->betrag;
$betrag = round($betrag, 2);
$buchungsnummern = !empty($buchungsnummern) ? ';' : '';
$buchungsnummern .= $row['childs'][$key]->buchungsnr;
$i = $key; //Zaehler auf letzten Gegenbuchungseintrag setzen
}
}
else
$buchungsnummern = $row['parent']->buchungsnr;
if($betrag<0)
$style='style="background-color: #FF8888;"';
elseif($betrag>0)
$style='style="background-color: #88DD88;"';
else
$style='';
echo "<tr>";
echo '<td '.$style.'>'.date('d.m.Y',$datum_obj->mktime_fromdate(isset($row['childs'][$i])?$row['childs'][$i]->buchungsdatum:$row['parent']->buchungsdatum)).'</td>';
echo '<td '.$style.'>'.$buchungstyp[$row['parent']->buchungstyp_kurzbz].'</td>';
echo '<td '.$style.'>'.$stg_arr[$row['parent']->studiengang_kz].'</td>';
echo '<td '.$style.'>'.$row['parent']->studiensemester_kurzbz.'</td>';
echo '<td '.$style.'>'.$row['parent']->buchungstext.'</td>';
echo '<td align="right" '.$style.'>€ '.($betrag<0?'-':($betrag>0?'+':'')).sprintf('%.2f',abs($row['parent']->betrag)).'</td>';
echo '<td align="center" '.$style.'>';
if($betrag>=0 && $row['parent']->betrag<=0)
{
echo '<a href="../pdfExport.php?xml=konto.rdf.php&xsl=Zahlung&uid='.$uid.'&buchungsnummern='.$buchungsnummern.'" title="'.$p->t('tools/bestaetigungDrucken').'"><img src="../../../skin/images/pdfpic.gif" alt="'.$p->t('tools/bestaetigungDrucken').'"></a>';
}
elseif($row['parent']->betrag>0)
{
//Auszahlung
}
else
{
echo '<a onclick="window.open(';
echo "'zahlungen_details.php?buchungsnr=".$row['parent']->buchungsnr.$getParam."','Zahlungsdetails','height=500,width=550,left=0,top=0,hotkeys=0,resizable=yes,status=no,scrollbars=no,toolbar=no,location=no,menubar=no,dependent=yes');return false;";
echo '" href="#">'.$p->t('tools/offen').'</a>(€ '.sprintf('%.2f',$betrag*-1).')';
echo '</td>';
}
echo '</tr>';
}
// Wenn die Tabelle keine Eintraege hat, wird eine Tabellenzeile mit entsprechender Information angezeigt.
if ($count_studiengangszahlung == 0)
{
echo "<tr><td colspan='7' style='background-color: white;'>" .$p->t('tools/keineZahlungenVorhanden'). "</td></tr>";
}
echo '</tbody></table>';
}
else
{
echo $p->t('tools/keineZahlungenVorhanden');
}
echo '</td></tr></table';
echo '</body></html>';
?>
+13 -6
View File
@@ -15,9 +15,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Martin Tatzber <tatzberm@technikum-wien.at>,
* Authors: Martin Tatzber <tatzberm@technikum-wien.at>,
*/
require_once('../../../config/cis.config.inc.php');
require_once('../../../config/global.config.inc.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/konto.class.php');
require_once('../../../include/bankverbindung.class.php');
@@ -28,7 +29,7 @@ require_once('../../../include/benutzer.class.php');
require_once('../../../include/benutzerberechtigung.class.php');
require_once('../../../include/student.class.php');
require_once('../../../include/prestudent.class.php');
$uid = get_uid();
if(isset($_GET['uid']))
@@ -48,7 +49,7 @@ if(isset($_GET['uid']))
}
else
$getParam='';
$benutzer = new benutzer();
if(!$benutzer->load($uid))
die('Benutzer nicht gefunden');
@@ -88,7 +89,7 @@ $oe=new organisationseinheit();
$oe->load($studiengang->oe_kurzbz);
$konto->getBuchungstyp();
$buchungstyp = array();
$buchungstyp = array();
foreach ($konto->result as $row)
$buchungstyp[$row->buchungstyp_kurzbz]=$row->beschreibung;
@@ -153,7 +154,13 @@ if($bic!='')
<td>'.$bic.'</td>
</tr>';
}
if($konto->zahlungsreferenz!='')
if ($konto->zahlungsreferenz != ''
&&
(
!defined('ZAHLUNGSBESTAETIGUNG_ZAHLUNGSREFERENZ_ANZEIGEN')
|| ZAHLUNGSBESTAETIGUNG_ZAHLUNGSREFERENZ_ANZEIGEN == true
)
)
{
echo '
<tr>
@@ -189,7 +196,7 @@ foreach($addon->result as $a)
</tbody>
</table>';
}
}
echo '</body></html>';
@@ -518,7 +518,7 @@ if(count($zeit->result)>0)
$row_vertretung = $db->db_fetch_object($result_vertretung);
$content_table.= "<tr class='liste".($i%2)."'>
<td>$row->bezeichnung</td>
<td>$row->zeitsperretyp_kurzbz</td>
<td>$row->zeitsperretyp_beschreibung</td>
<td nowrap>".$datum_obj->convertISODate($row->vondatum)." ".($row->vonstunde!=''?'('.$row->vonstunde.')':'')."</td>
<td nowrap>".$datum_obj->convertISODate($row->bisdatum)." ".($row->bisstunde!=''?'('.$row->bisstunde.')':'')."</td>
<td>".(isset($row_vertretung->kurzbz)?$row_vertretung->kurzbz:'')."</td>
@@ -587,15 +587,15 @@ $content_form.= '<form method="POST" name="zeitsperre_form" action="'.$action.'"
$content_form.= "<table>\n";
$content_form.= '<tr><td style="width:150px">'.$p->t('zeitsperre/grund').'</td><td colspan="2" style="width:450px"><SELECT name="zeitsperretyp_kurzbz"'.$style.' onchange="showHideBezeichnungDropDown()" class="dd_breit">';
//dropdown fuer zeitsperretyp
$qry = "SELECT * FROM campus.tbl_zeitsperretyp ORDER BY zeitsperretyp_kurzbz";
$qry = "SELECT * FROM campus.tbl_zeitsperretyp ORDER BY beschreibung";
if($result = $db->db_query($qry))
{
while($row=$db->db_fetch_object($result))
{
if($zeitsperre->zeitsperretyp_kurzbz == $row->zeitsperretyp_kurzbz)
$content_form.= "<OPTION value='$row->zeitsperretyp_kurzbz' selected>$row->zeitsperretyp_kurzbz - $row->beschreibung</OPTION>";
$content_form.= "<OPTION value='$row->zeitsperretyp_kurzbz' selected>$row->beschreibung</OPTION>";
else
$content_form.= "<OPTION value='$row->zeitsperretyp_kurzbz'$disabled>$row->zeitsperretyp_kurzbz - $row->beschreibung</OPTION>";
$content_form.= "<OPTION value='$row->zeitsperretyp_kurzbz'$disabled>$row->beschreibung</OPTION>";
}
}
$content_form.= '</SELECT></td></tr>';
+3 -2
View File
@@ -1039,9 +1039,10 @@ if($projekt->getProjekteMitarbeiter($user, true))
echo '<p><a href="../../../cms/dms.php?id='.$p->t("dms_link/fiktiveNormalarbeitszeit").'" target="_blank">'.$p->t("zeitaufzeichnung/fiktiveNormalarbeitszeit").'</a></p>';
}
echo '<p><a href="../profile/zeitsperre_resturlaub.php">'.$p->t("urlaubstool/meineZeitsperren").'</a></p>';
echo "</td>
echo $p->t("zeitaufzeichnung/supportAnfragen");
echo '</td>
</tr>
</table>";
</table>';
echo '<table>
<tr>
<td rowspan="2">';
+1 -1
View File
@@ -265,7 +265,7 @@ if ($gebiet_id != '')
{
$offsetwarnung = strlen($gebiet->errormsg) > 0 ? ' (HINWEIS: '.$gebiet->errormsg.')' : '';
$offsethinweis = ' <span class="error">empfohlene Offsetpunkteanzahl: '.round($offsetpunkte).(round($offsetpunkte) != $offsetpunkte ? ' ('.$offsetpunkte.' gerundet)' : '').'</span>';
$offsethinweis = ' <span class="error">empfohlene Offsetpunkteanzahl: '.ceil($offsetpunkte).(ceil($offsetpunkte) != $offsetpunkte ? ' ('.$offsetpunkte.' gerundet)' : '').'</span>';
$offsethinweis .= '<span class="error">'.$offsetwarnung.'</span>';
}
echo '<td>Offsetpunkte (maximale Negativpunkte)</td><td><input type="text" size="5" maxlength="7" name="offsetpunkte" value="'.$gebiet->offsetpunkte.'">'.$offsethinweis.'</td>';
+15
View File
@@ -132,6 +132,9 @@ define('FAS_UDF', true);
// Legt fest ob Aufnahmegruppen bei Reihungstests verwaltet werden true|false
define('FAS_REIHUNGSTEST_AUFNAHMEGRUPPEN',false);
// Legt fest welche OEs nicht zur Stundenobergrenze für Lektoren hinzugerechnet werden
define('FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE', array('eci'));
// Legt fest, ob Vertragsdetails zum Lehrauftrag im Reiter LektorInnenzuteilung angezeigt werden
define('FAS_LV_LEKTORINNENZUTEILUNG_VERTRAGSDETAILS_ANZEIGEN', false);
@@ -291,4 +294,16 @@ define('STUDIENGANG_KZ_QUALIFIKATIONKURSE', null);
// Gibt an ob der Login ins Testtool ueber das Bewerbungstool stattfindet oder nicht
define('TESTTOOL_LOGIN_BEWERBUNGSTOOL', false);
// Prueft ob Buchungen bereits ins SAP uebertragen wurden und sperrt ggf die Bearbeitung
define('BUCHUNGEN_CHECK_SAP', true);
// Gibt an, ob im FAS die Zahlungsbestaetigungen zum Download / im CIS generell die Zahlungen angezeigt werden
define ('ZAHLUNGSBESTAETIGUNG_ANZEIGEN', true);
// Gibt an, ob im CIS die Zahlungsbestaetigungen fuer Lehrgaenge zum Download angezeigt werden
define ('ZAHLUNGSBESTAETIGUNG_ANZEIGEN_FUER_LEHRGAENGE', true);
// Gibt an, ob im CIS die Zahlungsreferenz angezeigt wird
define ('ZAHLUNGSBESTAETIGUNG_ZAHLUNGSREFERENZ_ANZEIGEN', false);
?>
+5
View File
@@ -249,4 +249,9 @@ define('BIS_FUNKTIONSCODE_6_ARR', array(
'Team'
));
// Standortcode fuer Lehrgaenge
define('BIS_STANDORTCODE_LEHRGAENGE', '0');
// bPk Abfrage
define('BPK_FUER_ALLE_BENUTZER_ABFRAGEN', false);
?>
+206 -203
View File
@@ -1,204 +1,207 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
$user = get_uid();
loadVariables($user);
?>
// ****
// * Laedt die zu bearbeitenden Daten
// ****
function AdresseInit(adresse_id, person_id)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
if(adresse_id!='')
{
//Daten holen
var url = '<?php echo APP_ROOT ?>rdf/adresse.rdf.php?adresse_id='+adresse_id+'&'+gettimestamp();
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].
getService(Components.interfaces.nsIRDFService);
var dsource = rdfService.GetDataSourceBlocking(url);
var subject = rdfService.GetResource("http://www.technikum-wien.at/adresse/" + adresse_id);
var predicateNS = "http://www.technikum-wien.at/adresse/rdf";
//RDF parsen
person_id = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#person_id" ));
name = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#name" ));
strasse = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#strasse" ));
plz = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#plz" ));
ort = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#ort" ));
gemeinde = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#gemeinde" ));
nation = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#nation" ));
typ = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#typ" ));
heimatadresse = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#heimatadresse" ));
zustelladresse = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#zustelladresse" ));
firma_id = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#firma_id" ));
rechnungsadresse = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#rechnungsadresse" ));
anmerkung = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#anmerkung" ));
neu = false;
}
else
{
//Defaultwerte bei Neuem Datensatz
neu = true;
name='';
strasse='';
plz='';
ort='';
gemeinde=''
nation='A';
typ='h';
heimatadresse='Ja';
zustelladresse='Ja';
firma_id='';
rechnungsadresse='Nein';
anmerkung='';
}
document.getElementById('adresse-checkbox-neu').checked=neu;
document.getElementById('adresse-textbox-person_id').value=person_id;
document.getElementById('adresse-textbox-adresse_id').value=adresse_id;
document.getElementById('adresse-textbox-name').value=name;
document.getElementById('adresse-textbox-strasse').value=strasse;
document.getElementById('adresse-textbox-plz').value=plz;
AdresseLoadGemeinde(true);
document.getElementById('adresse-textbox-gemeinde').value=gemeinde;
AdresseLoadOrtschaft(true);
document.getElementById('adresse-textbox-ort').value=ort;
document.getElementById('adresse-menulist-nation').value=nation;
document.getElementById('adresse-menulist-typ').value=typ;
if(heimatadresse=='Ja')
document.getElementById('adresse-checkbox-heimatadresse').checked=true;
else
document.getElementById('adresse-checkbox-heimatadresse').checked=false;
if(zustelladresse=='Ja')
document.getElementById('adresse-checkbox-zustelladresse').checked=true;
else
document.getElementById('adresse-checkbox-zustelladresse').checked=false;
document.getElementById('adresse-menulist-firma').value=firma_id;
document.getElementById('adresse-textbox-anmerkung').value=anmerkung;
if(rechnungsadresse=='Ja')
document.getElementById('adresse-checkbox-rechnungsadresse').checked=true;
else
document.getElementById('adresse-checkbox-rechnungsadresse').checked=false;
}
// ****
// * Speichern der Daten
// ****
function AdresseSpeichern()
{
if(window.opener.KontaktAdresseSpeichern(document))
window.close();
else
this.focus();
}
// ****
// * Laedt die Gemeinden zur eingegebenen Postleitzahl
// ****
function AdresseLoadGemeinde(blocking)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
menulist_gemeinde = document.getElementById('adresse-textbox-gemeinde');
if(document.getElementById('adresse-menulist-nation').value=='A')
{
menulist_gemeinde.value='';
document.getElementById('adresse-textbox-ort').value='';
}
plz = document.getElementById('adresse-textbox-plz').value;
if(plz.length>3)
{
var url = '<?php echo APP_ROOT; ?>rdf/gemeinde.rdf.php?plz='+plz+'&'+gettimestamp();
var oldDatasources = menulist_gemeinde.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
menulist_gemeinde.database.RemoveDataSource(oldDatasources.getNext());
}
//Refresh damit die entfernten DS auch wirklich entfernt werden
menulist_gemeinde.builder.rebuild();
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
if(blocking)
var datasource = rdfService.GetDataSourceBlocking(url);
else
var datasource = rdfService.GetDataSource(url);
datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
datasource.QueryInterface(Components.interfaces.nsIRDFXMLSink);
menulist_gemeinde.database.AddDataSource(datasource);
menulist_gemeinde.builder.rebuild();
}
}
// ****
// * Laedt die Ortschaften zu Plz und Gemeinde
// ****
function AdresseLoadOrtschaft(blocking)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
gemeinde = document.getElementById('adresse-textbox-gemeinde').value;
menulist_ort = document.getElementById('adresse-textbox-ort');
if(document.getElementById('adresse-menulist-nation').value=='A')
{
menulist_ort.value='';
}
plz = document.getElementById('adresse-textbox-plz').value;
if(plz.length>3 && gemeinde!='')
{
var url = '<?php echo APP_ROOT; ?>rdf/gemeinde.rdf.php?plz='+plz+'&gemeinde='+encodeURIComponent(gemeinde)+'&'+gettimestamp();
var oldDatasources = menulist_ort.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
menulist_ort.database.RemoveDataSource(oldDatasources.getNext());
}
//Refresh damit die entfernten DS auch wirklich entfernt werden
menulist_ort.builder.rebuild();
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
if(blocking)
var datasource1 = rdfService.GetDataSourceBlocking(url);
else
var datasource1 = rdfService.GetDataSource(url);
datasource1.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
datasource1.QueryInterface(Components.interfaces.nsIRDFXMLSink);
menulist_ort.database.AddDataSource(datasource1);
menulist_ort.builder.rebuild();
}
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../config/vilesci.config.inc.php');
require_once('../include/functions.inc.php');
$user = get_uid();
loadVariables($user);
?>
// ****
// * Laedt die zu bearbeitenden Daten
// ****
function AdresseInit(adresse_id, person_id)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
if(adresse_id!='')
{
//Daten holen
var url = '<?php echo APP_ROOT ?>rdf/adresse.rdf.php?adresse_id='+adresse_id+'&'+gettimestamp();
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].
getService(Components.interfaces.nsIRDFService);
var dsource = rdfService.GetDataSourceBlocking(url);
var subject = rdfService.GetResource("http://www.technikum-wien.at/adresse/" + adresse_id);
var predicateNS = "http://www.technikum-wien.at/adresse/rdf";
//RDF parsen
person_id = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#person_id" ));
name = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#name" ));
strasse = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#strasse" ));
plz = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#plz" ));
ort = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#ort" ));
gemeinde = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#gemeinde" ));
nation = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#nation" ));
typ = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#typ" ));
heimatadresse = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#heimatadresse" ));
zustelladresse = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#zustelladresse" ));
co_name = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#co_name" ));
firma_id = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#firma_id" ));
rechnungsadresse = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#rechnungsadresse" ));
anmerkung = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#anmerkung" ));
neu = false;
}
else
{
//Defaultwerte bei Neuem Datensatz
neu = true;
name='';
strasse='';
plz='';
ort='';
gemeinde=''
nation='A';
typ='h';
heimatadresse='Ja';
zustelladresse='Ja';
co_name = '';
firma_id='';
rechnungsadresse='Nein';
anmerkung='';
}
document.getElementById('adresse-checkbox-neu').checked=neu;
document.getElementById('adresse-textbox-person_id').value=person_id;
document.getElementById('adresse-textbox-adresse_id').value=adresse_id;
document.getElementById('adresse-textbox-name').value=name;
document.getElementById('adresse-textbox-strasse').value=strasse;
document.getElementById('adresse-textbox-plz').value=plz;
AdresseLoadGemeinde(true);
document.getElementById('adresse-textbox-gemeinde').value=gemeinde;
AdresseLoadOrtschaft(true);
document.getElementById('adresse-textbox-ort').value=ort;
document.getElementById('adresse-menulist-nation').value=nation;
document.getElementById('adresse-menulist-typ').value=typ;
if(heimatadresse=='Ja')
document.getElementById('adresse-checkbox-heimatadresse').checked=true;
else
document.getElementById('adresse-checkbox-heimatadresse').checked=false;
if(zustelladresse=='Ja')
document.getElementById('adresse-checkbox-zustelladresse').checked=true;
else
document.getElementById('adresse-checkbox-zustelladresse').checked=false;
document.getElementById('adresse-textbox-co_name').value = co_name;
document.getElementById('adresse-menulist-firma').value=firma_id;
document.getElementById('adresse-textbox-anmerkung').value=anmerkung;
if(rechnungsadresse=='Ja')
document.getElementById('adresse-checkbox-rechnungsadresse').checked=true;
else
document.getElementById('adresse-checkbox-rechnungsadresse').checked=false;
}
// ****
// * Speichern der Daten
// ****
function AdresseSpeichern()
{
if(window.opener.KontaktAdresseSpeichern(document))
window.close();
else
this.focus();
}
// ****
// * Laedt die Gemeinden zur eingegebenen Postleitzahl
// ****
function AdresseLoadGemeinde(blocking)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
menulist_gemeinde = document.getElementById('adresse-textbox-gemeinde');
if(document.getElementById('adresse-menulist-nation').value=='A')
{
menulist_gemeinde.value='';
document.getElementById('adresse-textbox-ort').value='';
}
plz = document.getElementById('adresse-textbox-plz').value;
if(plz.length>3)
{
var url = '<?php echo APP_ROOT; ?>rdf/gemeinde.rdf.php?plz='+plz+'&'+gettimestamp();
var oldDatasources = menulist_gemeinde.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
menulist_gemeinde.database.RemoveDataSource(oldDatasources.getNext());
}
//Refresh damit die entfernten DS auch wirklich entfernt werden
menulist_gemeinde.builder.rebuild();
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
if(blocking)
var datasource = rdfService.GetDataSourceBlocking(url);
else
var datasource = rdfService.GetDataSource(url);
datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
datasource.QueryInterface(Components.interfaces.nsIRDFXMLSink);
menulist_gemeinde.database.AddDataSource(datasource);
menulist_gemeinde.builder.rebuild();
}
}
// ****
// * Laedt die Ortschaften zu Plz und Gemeinde
// ****
function AdresseLoadOrtschaft(blocking)
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
gemeinde = document.getElementById('adresse-textbox-gemeinde').value;
menulist_ort = document.getElementById('adresse-textbox-ort');
if(document.getElementById('adresse-menulist-nation').value=='A')
{
menulist_ort.value='';
}
plz = document.getElementById('adresse-textbox-plz').value;
if(plz.length>3 && gemeinde!='')
{
var url = '<?php echo APP_ROOT; ?>rdf/gemeinde.rdf.php?plz='+plz+'&gemeinde='+encodeURIComponent(gemeinde)+'&'+gettimestamp();
var oldDatasources = menulist_ort.database.GetDataSources();
while(oldDatasources.hasMoreElements())
{
menulist_ort.database.RemoveDataSource(oldDatasources.getNext());
}
//Refresh damit die entfernten DS auch wirklich entfernt werden
menulist_ort.builder.rebuild();
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
if(blocking)
var datasource1 = rdfService.GetDataSourceBlocking(url);
else
var datasource1 = rdfService.GetDataSource(url);
datasource1.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
datasource1.QueryInterface(Components.interfaces.nsIRDFXMLSink);
menulist_ort.database.AddDataSource(datasource1);
menulist_ort.builder.rebuild();
}
}
+205 -198
View File
@@ -1,199 +1,206 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
header("Content-type: application/vnd.mozilla.xul+xml");
include('../config/vilesci.config.inc.php');
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
echo '<?xml-stylesheet href="'.APP_ROOT.'skin/tempus.css" type="text/css"?>';
echo '<?xml-stylesheet href="'.APP_ROOT.'content/bindings.css" type="text/css"?>';
if(isset($_GET['adresse_id']) && is_numeric($_GET['adresse_id']))
$adresse_id=$_GET['adresse_id'];
else
$adresse_id='';
if(isset($_GET['person_id']) && is_numeric($_GET['person_id']))
$person_id=$_GET['person_id'];
else
$person_id='';
?>
<window id="adresse-dialog" title="Adresse"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="AdresseInit(<?php echo ($adresse_id!=''?$adresse_id:"''").','.($person_id!=''?$person_id:"''"); ?>)"
>
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/adressedialog.js.php" />
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/functions.js.php" />
<vbox>
<textbox id="adresse-textbox-adresse_id" hidden="true"/>
<textbox id="adresse-textbox-person_id" hidden="true"/>
<checkbox id="adresse-checkbox-neu" hidden="true"/>
<groupbox id="adresse-groupbox" flex="1">
<caption label="Details"/>
<grid id="adresse-grid-detail" style="overflow:auto;margin:4px;" flex="1">
<columns >
<column flex="1"/>
<column flex="5"/>
</columns>
<rows>
<row>
<label value="Typ" control="adresse-menulist-typ"/>
<menulist id="adresse-menulist-typ"
flex="1">
<menupopup>
<menuitem value="h" label="Hauptwohnsitz"/>
<menuitem value="n" label="Nebenwohnsitz"/>
<menuitem value="f" label="Firma"/>
<menuitem value="r" label="Rechnungsadresse"/>
</menupopup>
</menulist>
</row>
<row>
<label value="Strasse" control="adresse-textbox-strasse"/>
<hbox>
<textbox id="adresse-textbox-strasse" maxlength="256" size="30"/>
<spacer flex="1" />
</hbox>
</row>
<row>
<label value="Nation" control="adresse-menulist-nation"/>
<menulist id="adresse-menulist-nation"
datasources="<?php echo APP_ROOT ?>rdf/nation.rdf.php" flex="1"
ref="http://www.technikum-wien.at/nation/liste" >
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/nation/rdf#nation_code"
label="rdf:http://www.technikum-wien.at/nation/rdf#kurztext"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<row>
<label value="Plz" control="adresse-textbox-plz"/>
<hbox>
<textbox id="adresse-textbox-plz" maxlength="16" size="5" oninput="AdresseLoadGemeinde(false)"/>
<spacer flex="1" />
</hbox>
</row>
<row>
<label value="Gemeinde" />
<!--<hbox>
<textbox id="adresse-textbox-gemeinde" maxlength="256" size="30" />
<spacer flex="1" />
</hbox>-->
<menulist id="adresse-textbox-gemeinde"
editable="true"
datasources="rdf:null" flex="1"
ref="http://www.technikum-wien.at/gemeinde/liste"
oncommand="AdresseLoadOrtschaft(false)"
>
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/gemeinde/rdf#name"
label="rdf:http://www.technikum-wien.at/gemeinde/rdf#name"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<row>
<label value="Ortschaft" control="adresse-textbox-ort"/>
<!--<hbox>
<textbox id="adresse-textbox-ort" maxlength="256" size="30"/>
<spacer flex="1" />
</hbox>-->
<menulist id="adresse-textbox-ort"
editable="true"
datasources="rdf:null" flex="1"
ref="http://www.technikum-wien.at/gemeinde/liste"
>
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/gemeinde/rdf#ortschaftsname"
label="rdf:http://www.technikum-wien.at/gemeinde/rdf#ortschaftsname"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<row>
<label value="Heimatadresse" control="adresse-checkbox-heimatadresse"/>
<checkbox id="adresse-checkbox-heimatadresse" checked="true"/>
</row>
<row>
<label value="Zustelladresse" control="adresse-checkbox-zustelladresse"/>
<checkbox id="adresse-checkbox-zustelladresse" checked="true"/>
</row>
<row>
<label value="Rechnungsadresse" control="adresse-checkbox-rechnungsadresse"/>
<checkbox id="adresse-checkbox-rechnungsadresse" checked="true"/>
</row>
<row>
<label value="Firma" control="adresse-menulist-firma"/>
<!--
<menulist id="adresse-menulist-firma"
datasources="<?php echo APP_ROOT ?>rdf/firma.rdf.php?optional=true" flex="1"
ref="http://www.technikum-wien.at/firma/liste" >
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/firma/rdf#firma_id"
label="rdf:http://www.technikum-wien.at/firma/rdf#name"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
-->
<box class="Firma" id="adresse-menulist-firma" />
</row>
<row>
<label value="Name" control="adresse-textbox-name"/>
<hbox>
<textbox id="adresse-textbox-name" maxlength="256" size="30"/>
<spacer flex="1" />
</hbox>
</row>
<row>
<label value="Anmerkung" control="adresse-textbox-anmerkung"/>
<textbox id="adresse-textbox-anmerkung" multiline="true"/>
</row>
</rows>
</grid>
<hbox>
<spacer flex="1" />
<button id="adresse-button-speichern" oncommand="AdresseSpeichern()" label="Speichern" />
</hbox>
</groupbox>
</vbox>
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
header("Cache-Control: no-cache");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
header("Content-type: application/vnd.mozilla.xul+xml");
include('../config/vilesci.config.inc.php');
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
echo '<?xml-stylesheet href="'.APP_ROOT.'skin/tempus.css" type="text/css"?>';
echo '<?xml-stylesheet href="'.APP_ROOT.'content/bindings.css" type="text/css"?>';
if(isset($_GET['adresse_id']) && is_numeric($_GET['adresse_id']))
$adresse_id=$_GET['adresse_id'];
else
$adresse_id='';
if(isset($_GET['person_id']) && is_numeric($_GET['person_id']))
$person_id=$_GET['person_id'];
else
$person_id='';
?>
<window id="adresse-dialog" title="Adresse"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="AdresseInit(<?php echo ($adresse_id!=''?$adresse_id:"''").','.($person_id!=''?$person_id:"''"); ?>)"
>
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/adressedialog.js.php" />
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/functions.js.php" />
<vbox>
<textbox id="adresse-textbox-adresse_id" hidden="true"/>
<textbox id="adresse-textbox-person_id" hidden="true"/>
<checkbox id="adresse-checkbox-neu" hidden="true"/>
<groupbox id="adresse-groupbox" flex="1">
<caption label="Details"/>
<grid id="adresse-grid-detail" style="overflow:auto;margin:4px;" flex="1">
<columns >
<column flex="1"/>
<column flex="5"/>
</columns>
<rows>
<row>
<label value="Typ" control="adresse-menulist-typ"/>
<menulist id="adresse-menulist-typ"
flex="1">
<menupopup>
<menuitem value="h" label="Hauptwohnsitz"/>
<menuitem value="n" label="Nebenwohnsitz"/>
<menuitem value="f" label="Firma"/>
<menuitem value="r" label="Rechnungsadresse"/>
</menupopup>
</menulist>
</row>
<row>
<label value="Strasse" control="adresse-textbox-strasse"/>
<hbox>
<textbox id="adresse-textbox-strasse" maxlength="256" size="30"/>
<spacer flex="1" />
</hbox>
</row>
<row>
<label value="Nation" control="adresse-menulist-nation"/>
<menulist id="adresse-menulist-nation"
datasources="<?php echo APP_ROOT ?>rdf/nation.rdf.php" flex="1"
ref="http://www.technikum-wien.at/nation/liste" >
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/nation/rdf#nation_code"
label="rdf:http://www.technikum-wien.at/nation/rdf#kurztext"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<row>
<label value="Plz" control="adresse-textbox-plz"/>
<hbox>
<textbox id="adresse-textbox-plz" maxlength="16" size="5" oninput="AdresseLoadGemeinde(false)"/>
<spacer flex="1" />
</hbox>
</row>
<row>
<label value="Gemeinde" />
<!--<hbox>
<textbox id="adresse-textbox-gemeinde" maxlength="256" size="30" />
<spacer flex="1" />
</hbox>-->
<menulist id="adresse-textbox-gemeinde"
editable="true"
datasources="rdf:null" flex="1"
ref="http://www.technikum-wien.at/gemeinde/liste"
oncommand="AdresseLoadOrtschaft(false)"
>
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/gemeinde/rdf#name"
label="rdf:http://www.technikum-wien.at/gemeinde/rdf#name"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<row>
<label value="Ortschaft" control="adresse-textbox-ort"/>
<!--<hbox>
<textbox id="adresse-textbox-ort" maxlength="256" size="30"/>
<spacer flex="1" />
</hbox>-->
<menulist id="adresse-textbox-ort"
editable="true"
datasources="rdf:null" flex="1"
ref="http://www.technikum-wien.at/gemeinde/liste"
>
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/gemeinde/rdf#ortschaftsname"
label="rdf:http://www.technikum-wien.at/gemeinde/rdf#ortschaftsname"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
</row>
<row>
<label value="Heimatadresse" control="adresse-checkbox-heimatadresse"/>
<checkbox id="adresse-checkbox-heimatadresse" checked="true"/>
</row>
<row>
<label value="Zustelladresse" control="adresse-checkbox-zustelladresse"/>
<checkbox id="adresse-checkbox-zustelladresse" checked="true"/>
</row>
<row>
<label value="Abweichender Empfänger (c/o)" control="adresse-textbox-co_name"/>
<hbox>
<textbox id="adresse-textbox-co_name" maxlength="256" size="30"/>
<spacer flex="1" />
</hbox>
</row>
<row>
<label value="Rechnungsadresse" control="adresse-checkbox-rechnungsadresse"/>
<checkbox id="adresse-checkbox-rechnungsadresse" checked="true"/>
</row>
<row>
<label value="Firma" control="adresse-menulist-firma"/>
<!--
<menulist id="adresse-menulist-firma"
datasources="<?php echo APP_ROOT ?>rdf/firma.rdf.php?optional=true" flex="1"
ref="http://www.technikum-wien.at/firma/liste" >
<template>
<menupopup>
<menuitem value="rdf:http://www.technikum-wien.at/firma/rdf#firma_id"
label="rdf:http://www.technikum-wien.at/firma/rdf#name"
uri="rdf:*"/>
</menupopup>
</template>
</menulist>
-->
<box class="Firma" id="adresse-menulist-firma" />
</row>
<row>
<label value="Name" control="adresse-textbox-name"/>
<hbox>
<textbox id="adresse-textbox-name" maxlength="256" size="30"/>
<spacer flex="1" />
</hbox>
</row>
<row>
<label value="Anmerkung" control="adresse-textbox-anmerkung"/>
<textbox id="adresse-textbox-anmerkung" multiline="true"/>
</row>
</rows>
</grid>
<hbox>
<spacer flex="1" />
<button id="adresse-button-speichern" oncommand="AdresseSpeichern()" label="Speichern" />
</hbox>
</groupbox>
</vbox>
</window>
-2
View File
@@ -123,8 +123,6 @@ if(isset($_POST['submitbild']))
$dokument = new dokument();
$dokument->loadDokumenttyp($_REQUEST['dokumenttyp']);
$extension = end(explode(".",strtolower($_FILES['file']['name'])));
$akte->dokument_kurzbz = $_REQUEST['dokumenttyp'];
$akte->person_id = $_GET['person_id'];
//$akte->inhalt = base64_encode($content);
+823 -822
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More