mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'master' into feature-7264/Dauerampel_fuer_fehlende_Timesheets
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'
|
||||
);
|
||||
|
||||
@@ -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'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -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'
|
||||
)
|
||||
);
|
||||
|
||||
@@ -91,7 +92,8 @@ class Lehrauftrag extends Auth_Controller
|
||||
|
||||
// Retrieve studiengaenge the user is entitled for to populate studiengang dropdown
|
||||
if (!$studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::BERECHTIGUNG_LEHRAUFTRAG_BESTELLEN)) {
|
||||
show_error('Fehler bei Berechtigungsprüfung');
|
||||
show_error('Keine Studiengänge gefunden.<br>
|
||||
Es muss eine passende Organisationseinheit hinterlegt werden.<br>');
|
||||
}
|
||||
|
||||
// If studiengang_kz get param was set, check against entitled stg
|
||||
|
||||
@@ -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'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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!');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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' => '/À|Á|Â|Ã|Å/',
|
||||
'Ae' => '/Ä/',
|
||||
'a' => '/à|á|â|ã|å/',
|
||||
'ae'=> '/ä/',
|
||||
'C' => '/Ç/',
|
||||
'c' => '/ç/',
|
||||
'E' => '/È|É|Ê|Ë/',
|
||||
'e' => '/è|é|ê|ë/',
|
||||
'I' => '/Ì|Í|Î|Ï/',
|
||||
'i' => '/ì|í|î|ï/',
|
||||
'N' => '/Ñ/',
|
||||
'n' => '/ñ/',
|
||||
'O' => '/Ò|Ó|Ô|Õ/',
|
||||
'Oe' => '/Ö/',
|
||||
'o' => '/ò|ó|ô|õ/',
|
||||
'oe' => '/ö/',
|
||||
'U' => '/Ù|Ú|Û/',
|
||||
'Ue' => '/Ü/',
|
||||
'u' => '/ù|ú|û/',
|
||||
'ue' => '/ü/',
|
||||
'Y' => '/Ý/',
|
||||
'y' => '/ý|ÿ/',
|
||||
'a.' => '/ª/',
|
||||
'o.' => '/º/',
|
||||
'ss' => '/ß/'
|
||||
);
|
||||
|
||||
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
|
||||
|
||||
@@ -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)';
|
||||
}
|
||||
|
||||
@@ -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!
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -215,6 +215,31 @@ class MessageLib
|
||||
|
||||
return $messageVars; // otherwise returns the error
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves message vars of the logged in user from view vw_msg_vars_user
|
||||
*/
|
||||
public function getMessageVarsLoggedInUser()
|
||||
{
|
||||
// Retrieves message vars from view vw_msg_vars
|
||||
$messageVars = $this->_ci->MessageModel->getMsgVarsLoggedInUser();
|
||||
if (isSuccess($messageVars)) // if everything is ok
|
||||
{
|
||||
$variablesArray = array();
|
||||
$tmpVariablesArray = getData($messageVars);
|
||||
|
||||
// Starts from 1 to skip the first element which is uid
|
||||
for ($i = 1; $i < count($tmpVariablesArray); $i++)
|
||||
{
|
||||
$variablesArray['{'.str_replace(' ', '_', strtolower($tmpVariablesArray[$i])).'}']
|
||||
= strtoupper($tmpVariablesArray[$i]);
|
||||
}
|
||||
|
||||
return success($variablesArray);
|
||||
}
|
||||
|
||||
return $messageVars; // otherwise returns the error
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves organisation units for each role that a user plays inside that organisation unit
|
||||
@@ -595,11 +620,24 @@ class MessageLib
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
|
||||
// And the receiver has an active account for the given organisation unit
|
||||
$benutzerResult = $this->_ci->BenutzerModel->getActiveUserByPersonIdAndOrganisationUnit($message->receiver_id, $message->sender_ou);
|
||||
$benutzerResult = $this->_ci->BenutzerModel->getActiveUserByPersonIdAndOrganisationUnit(
|
||||
$message->receiver_id,
|
||||
$message->sender_ou
|
||||
);
|
||||
|
||||
if (isError($benutzerResult)) return $benutzerResult; // if an error occured then return it
|
||||
|
||||
// Use the uid + domain email
|
||||
if (hasData($benutzerResult)) $message->receiverContact = getData($benutzerResult)[0]->uid .'@'.DOMAIN;
|
||||
// If an active user for the given organization unit was found
|
||||
if (hasData($benutzerResult))
|
||||
{
|
||||
// Checks if the user was NOT created in the last 24 hours
|
||||
if (getData($benutzerResult)[0]->insertamum < date('Y-m-d H:i:s', strtotime('-1 day')))
|
||||
{
|
||||
// Use the uid + domain email
|
||||
$message->receiverContact = getData($benutzerResult)[0]->uid .'@'.DOMAIN;
|
||||
}
|
||||
// otherwise do NOT use the internal email account
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise try with the private email
|
||||
@@ -644,7 +682,7 @@ class MessageLib
|
||||
// If there are presetudent
|
||||
if (hasData($prestudentResults))
|
||||
{
|
||||
$inArray = true;
|
||||
$privateOnly = false;
|
||||
$organisationUnits = getData($prestudentResults);
|
||||
|
||||
// Look if any of the organization units of this prestudent are in the list of the
|
||||
@@ -652,16 +690,21 @@ class MessageLib
|
||||
foreach ($organisationUnits as $organisationUnit)
|
||||
{
|
||||
// If the recipient organisation unit is NOT in the list of organisation units that sent only to private emails
|
||||
// NOTE: done in this way because it is easyer to check the result of array_search
|
||||
if (array_search($organisationUnit, $this->_ci->config->item(self::CFG_OU_RECEIVERS_PRIVATE)) === false)
|
||||
{
|
||||
$inArray = false;
|
||||
// NOP
|
||||
}
|
||||
else // otherwise If the recipient organisation unit is the list of organisation units that sent only to private emails
|
||||
{
|
||||
$privateOnly = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If the recipient prestudent organization unit is not in in the list of the
|
||||
// organization units that will not send the notice email to the internal account
|
||||
if (!$inArray)
|
||||
if ($privateOnly)
|
||||
{
|
||||
// Then use the private email
|
||||
$privateEmailResult = $this->_getPrivateEmail($message->receiver_id);
|
||||
@@ -676,10 +719,37 @@ class MessageLib
|
||||
$this->_ci->BenutzerModel->addOrder('updateamum', 'DESC');
|
||||
$this->_ci->BenutzerModel->addOrder('insertamum', 'DESC');
|
||||
|
||||
$benutzerResult = $this->_ci->BenutzerModel->loadWhere(array('person_id' => $message->receiver_id));
|
||||
$benutzerResult = $this->_ci->BenutzerModel->loadWhere(
|
||||
array(
|
||||
'person_id' => $message->receiver_id
|
||||
)
|
||||
);
|
||||
if (isError($benutzerResult)) return $benutzerResult; // if an error occured then return it
|
||||
|
||||
$message->receiverContact = getData($benutzerResult)[0]->uid .'@'.DOMAIN; // Use the uid + domain email
|
||||
// If an active user for the given organization unit was found
|
||||
if (hasData($benutzerResult))
|
||||
{
|
||||
// For each benutzer found for this person
|
||||
foreach (getData($benutzerResult) as $benutzer)
|
||||
{
|
||||
// Checks if the user was NOT created in the last 24 hours
|
||||
if (getData($benutzerResult)[0]->insertamum < date('Y-m-d H:i:s', strtotime('-1 day')))
|
||||
{
|
||||
// Use the uid + domain as email address
|
||||
$message->receiverContact = getData($benutzerResult)[0]->uid .'@'.DOMAIN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise try with the private email
|
||||
if (isEmptyString($message->receiverContact))
|
||||
{
|
||||
// Then use the private email
|
||||
$privateEmailResult = $this->_getPrivateEmail($message->receiver_id);
|
||||
if (isError($privateEmailResult)) return $privateEmailResult; // if an error occured then return it
|
||||
|
||||
if (hasData($privateEmailResult)) $message->receiverContact = getData($privateEmailResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -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};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,9 @@ class Messages_model extends CI_Model
|
||||
$this->load->model('system/Benutzerrolle_model', 'BenutzerrolleModel');
|
||||
// Loads model Prestudent_model
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
// Loads model Benutzer_model
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -284,9 +287,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 +299,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,
|
||||
@@ -393,7 +405,10 @@ class Messages_model extends CI_Model
|
||||
// Looping on receivers data
|
||||
foreach (getData($msgVarsData) as $receiver)
|
||||
{
|
||||
$msgVarsDataArray = $this->_lowerReplaceSpaceArrayKeys((array)$receiver); // replaces array keys
|
||||
// Merge receivers data with logged in user data
|
||||
$msgVarsDataArray = $this->_addMsgVarsDataOfLoggedInUser($receiver);
|
||||
|
||||
$msgVarsDataArray = $this->_lowerReplaceSpaceArrayKeys((array)getData($msgVarsDataArray)[0]); // replaces array keys
|
||||
$parsedSubject = parseText($subject, $msgVarsDataArray);
|
||||
$parsedBody = parseText($body, $msgVarsDataArray);
|
||||
|
||||
@@ -411,23 +426,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
|
||||
}
|
||||
@@ -460,6 +472,15 @@ class Messages_model extends CI_Model
|
||||
if (!hasData($msgVarsData)) show_error('No recipients were given');
|
||||
|
||||
$prestudentsData = $this->PrestudentModel->getOrganisationunits($prestudents);
|
||||
|
||||
// Get the senders uid (if user is an active employee)
|
||||
$this->BenutzerModel->addSelect('uid');
|
||||
$this->BenutzerModel->addJoin('public.tbl_mitarbeiter ma', 'ma.mitarbeiter_uid = uid');
|
||||
if (!$result = getData($this->BenutzerModel->getFromPersonId($sender_id)))
|
||||
{
|
||||
show_error('No sender_uid found');
|
||||
}
|
||||
$sender_uid = $result[0]->uid;
|
||||
|
||||
// Adds the organisation unit to each prestudent
|
||||
if (isEmptyString($oe_kurzbz) && hasData($msgVarsData) && hasData($prestudentsData))
|
||||
@@ -469,7 +490,15 @@ class Messages_model extends CI_Model
|
||||
|
||||
foreach (getData($msgVarsData) as $receiver)
|
||||
{
|
||||
$msgVarsDataArray = $this->_lowerReplaceSpaceArrayKeys((array)$receiver); // replaces array keys
|
||||
/**
|
||||
* Merge receivers data with senders data
|
||||
* NOTE: _addMsgVarsDataOfLoggedInUser usually retrieves data of the logged in user that is set in the
|
||||
* templates user fields. As sendExplicitTemplateSenderId is run by a job, a sender uid is passed to be used
|
||||
* instead the logged in user.
|
||||
*/
|
||||
$msgVarsDataArray = $this->_addMsgVarsDataOfLoggedInUser($receiver, $sender_uid);
|
||||
|
||||
$msgVarsDataArray = $this->_lowerReplaceSpaceArrayKeys((array)getData($msgVarsDataArray)[0]); // replaces array keys
|
||||
|
||||
// Additional message variables
|
||||
if (is_array($msgVars)) $msgVarsDataArray = array_merge($msgVarsDataArray, $msgVars);
|
||||
@@ -600,6 +629,9 @@ class Messages_model extends CI_Model
|
||||
$parseMessageText = error('The given person_id is not a valid number');
|
||||
|
||||
if (is_numeric($person_id)) $parseMessageText = $this->MessageModel->getMsgVarsDataByPersonId($person_id);
|
||||
|
||||
// Add message vars data of the logged in user
|
||||
$parseMessageText = $this->_addMsgVarsDataOfLoggedInUser($parseMessageText);
|
||||
|
||||
if (hasData($parseMessageText))
|
||||
{
|
||||
@@ -623,7 +655,10 @@ class Messages_model extends CI_Model
|
||||
$parseMessageText = error('The given prestudent_id is not a valid number');
|
||||
|
||||
if (is_numeric($prestudent_id)) $parseMessageText = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id);
|
||||
|
||||
|
||||
// Add message vars data of the logged in user
|
||||
$parseMessageText = $this->_addMsgVarsDataOfLoggedInUser($parseMessageText);
|
||||
|
||||
if (hasData($parseMessageText))
|
||||
{
|
||||
$parseMessageText = success(
|
||||
@@ -833,6 +868,26 @@ class Messages_model extends CI_Model
|
||||
|
||||
$variables[] = $tmpVar;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Retrieves message vars of logged in user from database view vw_msg_vars_person
|
||||
$result = null;
|
||||
|
||||
// If data contains a prestudent id
|
||||
$result = $this->messagelib->getMessageVarsLoggedInUser();
|
||||
|
||||
if (isError($result)) show_error(getError($result));
|
||||
|
||||
// Then builds an array that contains objects with field name and field description of logged in user data
|
||||
$user_fields = array();
|
||||
foreach (getData($result) as $id => $description)
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->id = $id;
|
||||
$obj->description = $description;
|
||||
|
||||
$user_fields[] = $obj;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// Retrieves the sender id
|
||||
@@ -853,6 +908,7 @@ class Messages_model extends CI_Model
|
||||
'subject' => $replySubject,
|
||||
'body' => $replyBody,
|
||||
'variables' => $variables,
|
||||
'user_fields' => $user_fields,
|
||||
'organisationUnits' => getData($organisationUnits),
|
||||
'senderIsAdmin' => getData($senderIsAdmin),
|
||||
'recipientsArray' => $recipientsArray,
|
||||
@@ -861,4 +917,30 @@ class Messages_model extends CI_Model
|
||||
'type' => $type
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds message vars data of the logged in user to the given object (that should also have message vars data)
|
||||
* @param object $otherMsgVarsDataObj Can be success object or simple object.
|
||||
* @return object Returns success object.
|
||||
*/
|
||||
public function _addMsgVarsDataOfLoggedInUser($otherMsgVarsDataObj, $uid = null)
|
||||
{
|
||||
// First check if param type is object
|
||||
if (!is_object($otherMsgVarsDataObj)) show_error('Must pass an object to merge with data of logged in user');
|
||||
|
||||
// If it is a return object, extract the simple data object
|
||||
if (isSuccess($otherMsgVarsDataObj))
|
||||
{
|
||||
$otherMsgVarsDataObj = getData($otherMsgVarsDataObj)[0];
|
||||
}
|
||||
|
||||
// Retrieve message vars data of the logged in user
|
||||
if (!$msgVarsDataLoggedInUser = getData($this->MessageModel->getMsgVarsDataByLoggedInUser($uid))[0])
|
||||
{
|
||||
return success($otherMsgVarsDataObj); // If failed, return at least given object as expected success object
|
||||
}
|
||||
|
||||
return success(array((object)(array_merge((array) $otherMsgVarsDataObj, (array) $msgVarsDataLoggedInUser))));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -132,7 +132,7 @@ class Studiensemester_model extends DB_Model
|
||||
$query .= ' WHERE SUBSTRING(studiensemester_kurzbz FROM 1 FOR 2) = \'' . $ss . '\'';
|
||||
}
|
||||
|
||||
$query .= ' ORDER BY delta LIMIT 1';
|
||||
$query .= ' ORDER BY delta, start LIMIT 1';
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
@@ -188,7 +188,7 @@ class Studiensemester_model extends DB_Model
|
||||
{
|
||||
$query = "SELECT studiensemester_kurzbz, start, ende FROM public.vw_studiensemester
|
||||
WHERE studiensemester_kurzbz <> ?
|
||||
ORDER BY delta LIMIT 1";
|
||||
ORDER BY delta, start LIMIT 1";
|
||||
|
||||
return $this->execQuery($query, array($studiensemester_kurzbz));
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,14 +23,81 @@ class Benutzer_model extends DB_Model
|
||||
*/
|
||||
public function getActiveUserByPersonIdAndOrganisationUnit($person_id, $oe_kurzbz)
|
||||
{
|
||||
$sql = 'SELECT b.uid
|
||||
FROM public.tbl_benutzer b
|
||||
JOIN public.tbl_prestudent ps USING (person_id)
|
||||
JOIN public.tbl_studiengang sg USING (studiengang_kz)
|
||||
WHERE ps.person_id = ?
|
||||
AND sg.oe_kurzbz = ?
|
||||
AND b.aktiv = TRUE';
|
||||
$sql = 'SELECT
|
||||
b.uid,
|
||||
b.insertamum
|
||||
FROM
|
||||
public.tbl_prestudent ps
|
||||
JOIN public.tbl_studiengang sg USING (studiengang_kz)
|
||||
JOIN public.tbl_student USING(prestudent_id)
|
||||
JOIN public.tbl_benutzer b ON(uid = student_uid)
|
||||
WHERE ps.person_id = ?
|
||||
AND sg.oe_kurzbz = ?
|
||||
AND b.aktiv = TRUE';
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
@@ -171,6 +171,23 @@ class Message_model extends DB_Model
|
||||
return error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get message variables for logged in user
|
||||
*/
|
||||
public function getMsgVarsLoggedInUser()
|
||||
{
|
||||
$result = $this->db->query('SELECT * FROM public.vw_msg_vars_user WHERE 0 = 1');
|
||||
|
||||
if ($result)
|
||||
{
|
||||
return success($result->list_fields());
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error(), FHC_DB_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getMsgVarsDataByPrestudentId
|
||||
@@ -191,4 +208,26 @@ class Message_model extends DB_Model
|
||||
|
||||
return $this->execQuery(sprintf($query, is_array($person_id) ? 'IN' : '='), array($person_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get message vars data for logged in user
|
||||
* @param string uid The UID should ONLY be passed if this method is called by a cronjob.
|
||||
* This is to enable jobs to use templates which use logged-in-user fields ('Eigene Felder').
|
||||
* @return array|null
|
||||
*/
|
||||
public function getMsgVarsDataByLoggedInUser($uid = null)
|
||||
{
|
||||
if (is_string($uid))
|
||||
{
|
||||
$params = array($uid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$params = array(getAuthUID());
|
||||
}
|
||||
|
||||
$query = 'SELECT * FROM public.vw_msg_vars_user WHERE my_uid = ?';
|
||||
|
||||
return $this->execQuery($query, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'); ?> <i class="fa fa-arrow-down"></i> <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') ?> <?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 ?>, <?php echo $this->p->t('abschlusspruefung', 'studiengangskennzahl') ?>
|
||||
<?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') ?> <?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 ' ' . $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'); ?>: </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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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">
|
||||
|
||||
</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;">
|
||||
|
||||
</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">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-row halign-right">
|
||||
<?php
|
||||
if (isset($personUdfs) && isset($prestudentUdfs))
|
||||
{
|
||||
?>
|
||||
<div class="div-cell">
|
||||
|
||||
</div>
|
||||
<div class="div-cell">
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="div-cell halign-right">
|
||||
<input type="submit" value=" Speichern ">
|
||||
</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">
|
||||
|
||||
</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;">
|
||||
|
||||
</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">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-row halign-right">
|
||||
<?php
|
||||
if (isset($personUdfs) && isset($prestudentUdfs))
|
||||
{
|
||||
?>
|
||||
<div class="div-cell">
|
||||
|
||||
</div>
|
||||
<div class="div-cell">
|
||||
|
||||
</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,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);
|
||||
?>
|
||||
|
||||
|
||||
@@ -83,19 +83,41 @@
|
||||
</label>
|
||||
|
||||
<?php
|
||||
$size = count($variables) > 19 ? 19 : count($variables);
|
||||
echo $this->widgetlib->widget(
|
||||
'MultipleDropdown_widget',
|
||||
array('elements' => success($variables)),
|
||||
array(
|
||||
'name' => 'variables[]',
|
||||
'id' => 'variables',
|
||||
'size' => count($variables),
|
||||
'size' => $size,
|
||||
'multiple' => true
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
|
||||
<?php echo ucfirst($this->p->t('ui', 'meineFelder')); ?>:
|
||||
|
||||
</label>
|
||||
|
||||
<?php
|
||||
$size = count($user_fields) > 5 ? 5 : count($user_fields);
|
||||
echo $this->widgetlib->widget(
|
||||
'MultipleDropdown_widget',
|
||||
array('elements' => success($user_fields)),
|
||||
array(
|
||||
'name' => 'user_fields[]',
|
||||
'id' => 'user_fields',
|
||||
'size' => $size,
|
||||
'multiple' => true
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
@@ -111,14 +133,15 @@
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-lg-7 col-xs-9 text-right">
|
||||
<button id="sendButton" class="btn btn-default" type="button">
|
||||
<div class="col-xs-6">
|
||||
<button id="sendButton" class="btn btn-default pull-right" type="button">
|
||||
|
||||
<?php echo $this->p->t('ui', 'senden'); ?>
|
||||
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>";
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -1613,8 +1626,9 @@ function loadPruefungsDetails(prfId)
|
||||
{
|
||||
$("#termin"+j+"sammelklausur").text("false");
|
||||
}
|
||||
$("#termin"+j+"Id").closest("tr").append("<td><a href='#' onclick='terminLoeschen(\""+d.pruefung.pruefung_id+"\", \""+t.pruefungstermin_id+"\");'><?php echo $p->t('global/löschen'); ?></a></td>");
|
||||
$("#termin"+j+"Id").closest("tr").append("<td><a href='#' onclick='window.open(\"pruefungstermin_aendern.php?termin_id="+t.pruefungstermin_id+"\",\"edit\",\"height=600,width=500,toolbar=no,titlebar=no,status=no,menubar=no\");'><?php echo $p->t('global/editieren'); ?></a></td>");
|
||||
//$("#termin"+j+"Id").closest("tr").append("<td><a href='#' onclick='terminLoeschen(\""+d.pruefung.pruefung_id+"\", \""+t.pruefungstermin_id+"\");'><?php //echo $p->t('global/löschen'); ?></a></td>");
|
||||
$("#termin"+j+"Id").closest("tr").append("<td><a href='#' onclick='window.open(\"pruefungstermin_loeschen.php?pruefung_id="+d.pruefung.pruefung_id+"&termin_id="+t.pruefungstermin_id+"\",\"delete\",\"height=600,width=500,toolbar=no,titlebar=no,status=no,menubar=no\");'><?php echo $p->t('global/löschen'); ?></a></td>");
|
||||
$("#termin"+j+"Id").closest("tr").append("<td><a href='#' onclick='window.open(\"pruefungstermin_aendern.php?termin_id="+t.pruefungstermin_id+"\",\"edit\",\"height=600,width=500,toolbar=no,titlebar=no,status=no,menubar=no\");'><?php echo $p->t('global/editieren'); ?></a></td>");
|
||||
terminHinzufuegen("span");
|
||||
}
|
||||
});
|
||||
@@ -1819,7 +1833,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 +1861,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 +1896,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 +1927,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 +1960,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);
|
||||
@@ -1958,6 +1972,36 @@ function terminLoeschen(pruefung_id, pruefungstermin_id)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Löscht einen Termin ohne im Anschluss die Prüfungen neu zu laden
|
||||
* @param {int} pruefung_id ID der Prüfung
|
||||
* @param {int} pruefungstermin_id ID des Prüfungstermines
|
||||
* @returns {undefined}
|
||||
*/
|
||||
function terminLoeschenOhneLaden(pruefung_id, pruefungstermin_id)
|
||||
{
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
url: "./pruefungstermin.json.php",
|
||||
type: "POST",
|
||||
data: {
|
||||
method: "deleteTermin",
|
||||
pruefung_id: pruefung_id,
|
||||
pruefungstermin_id: pruefungstermin_id
|
||||
},
|
||||
error: loadError
|
||||
}).done(function(data){
|
||||
if(data.error === "false")
|
||||
{
|
||||
messageBox("message", "<?php echo $p->t('pruefung/terminGeloescht'); ?>", "green", "highlight", 10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
messageBox("message", data.errormsg, "red", "highlight", 10000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Lädt alle Prüfungen
|
||||
* @returns {void}
|
||||
@@ -2005,7 +2049,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">
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright 2021 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., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*
|
||||
*
|
||||
* Authors: Nikolaus Krondraf <krondraf@technikum-wien.at>
|
||||
*/
|
||||
|
||||
require_once('../../../../config/cis.config.inc.php');
|
||||
require_once('../../../../include/functions.inc.php');
|
||||
require_once('../../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../../include/studiensemester.class.php');
|
||||
require_once('../../../../include/datum.class.php');
|
||||
require_once('../../../../include/pruefungsfenster.class.php');
|
||||
require_once('../../../../include/pruefungsanmeldung.class.php');
|
||||
require_once('../../../../include/lehrveranstaltung.class.php');
|
||||
require_once('../../../../include/pruefungstermin.class.php');
|
||||
require_once('../../../../include/studiengang.class.php');
|
||||
require_once('../../../../include/pruefungCis.class.php');
|
||||
require_once('../../../../include/mitarbeiter.class.php');
|
||||
require_once('../../../../include/phrasen.class.php');
|
||||
require_once('../../../../include/globals.inc.php');
|
||||
require_once('../../../../include/sprache.class.php');
|
||||
require_once('../../../../include/mail.class.php');
|
||||
|
||||
|
||||
$sprache = getSprache();
|
||||
$lang = new sprache();
|
||||
$lang->load($sprache);
|
||||
$p = new phrasen($sprache);
|
||||
|
||||
$maildebug = '';
|
||||
$uid = get_uid();
|
||||
$db = new basis_db();
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
|
||||
$studiensemester = new studiensemester();
|
||||
$lehrveranstaltung = new lehrveranstaltung();
|
||||
$lehrveranstaltung->loadLVAfromMitarbeiter(0, $uid, $studiensemester->getaktorNext());
|
||||
if(empty($lehrveranstaltung->lehrveranstaltungen) && !$rechte->isBerechtigt('lehre/pruefungsterminAdmin'))
|
||||
die('Sie haben keine Berechtigung für diese Seite');
|
||||
|
||||
if (!ctype_digit($_GET['termin_id']) || !ctype_digit($_GET['pruefung_id']))
|
||||
die('Wrong Parameter');
|
||||
else
|
||||
{
|
||||
$termin_id = $_GET['termin_id'];
|
||||
$pruefung_id = $_GET['pruefung_id'];
|
||||
}
|
||||
|
||||
if (isset($_GET["sendmail"], $_GET["message"]) && $_GET["message"] != "")
|
||||
{
|
||||
$pruefung = new pruefungCis($pruefung_id);
|
||||
$pruefung->getLehrveranstaltungenByPruefung();
|
||||
$lvstr = "";
|
||||
foreach ($pruefung->lehrveranstaltungen as $lv)
|
||||
{
|
||||
$lv_objekt = new lehrveranstaltung($lv->lehrveranstaltung_id);
|
||||
$lvstr .= "*".$lv_objekt->bezeichnung."* ";
|
||||
}
|
||||
$maildebug = 'Mail gesendet an:<br>';
|
||||
$anmeldung = new pruefungsanmeldung();
|
||||
$anmeldungen = $anmeldung->getAnmeldungenByTermin($termin_id);
|
||||
foreach ($anmeldungen as $row)
|
||||
{
|
||||
$uid = $row->uid;
|
||||
$to = $uid.'@'.DOMAIN;
|
||||
$from = 'no-reply@'.DOMAIN;
|
||||
$subject = $p->t('pruefung/pruefungStorniert');
|
||||
$text = $_GET["message"];
|
||||
$msg = new mail($to, $from, $subject, $text);
|
||||
if ($msg->send())
|
||||
$maildebug .= $to." OK<br>";
|
||||
else
|
||||
$maildebug .= $to.' Fehler<br>';
|
||||
}
|
||||
}
|
||||
|
||||
$prfgtermin = new pruefungstermin($termin_id);
|
||||
$datum = new DateTime(explode(" ", $prfgtermin->von)[0]);
|
||||
$datum = $datum->format('d.m.Y');
|
||||
$vonzeit = substr(explode(" ", $prfgtermin->von)[1],0,5);
|
||||
$biszeit = substr(explode(" ", $prfgtermin->bis)[1],0,5);
|
||||
$pruefung_id = $prfgtermin->pruefung_id;
|
||||
|
||||
$pruefung = new pruefungCis($pruefung_id);
|
||||
$pruefung->getLehrveranstaltungenByPruefung();
|
||||
$lvstr = "";
|
||||
foreach ($pruefung->lehrveranstaltungen as $lv)
|
||||
{
|
||||
$lv_objekt = new lehrveranstaltung($lv->lehrveranstaltung_id);
|
||||
$lvstr .= "*".$lv_objekt->bezeichnung."*";
|
||||
}
|
||||
|
||||
$uids = '';
|
||||
$anmeldung = new pruefungsanmeldung();
|
||||
$anmeldungen = $anmeldung->getAnmeldungenByTermin($termin_id);
|
||||
foreach ($anmeldungen as $row)
|
||||
{
|
||||
$uids .= $row->uid.'@'.DOMAIN.'<br>';
|
||||
}
|
||||
|
||||
$nachricht = "Sehr geehrte Studierende,\n\ndie Prüfung zur LV $lvstr am $datum um $vonzeit Uhr wurde abgesagt.";
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><?php echo $p->t('pruefung/titlePruefungstermin'); ?></title>
|
||||
<script src="../../../../include/js/datecheck.js"></script>
|
||||
<script type="text/javascript" src="../../../../vendor/components/jquery/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../../../vendor/mottie/tablesorter/dist/js/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="../../../../vendor/mottie/tablesorter/dist/js/jquery.tablesorter.widgets.min.js"></script>
|
||||
<script type="text/javascript" src="../../../../vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js"></script>
|
||||
<script type="text/javascript" src="../../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../../../../vendor/components/jqueryui/ui/i18n/datepicker-de.js"></script>
|
||||
<link rel="stylesheet" href="../../../../vendor/components/jqueryui/themes/base/jquery-ui.min.css">
|
||||
<script src="./pruefung.js.php"></script>
|
||||
<link rel="stylesheet" href="../../../../skin/fhcomplete.css">
|
||||
<link rel="stylesheet" href="../../../../skin/style.css.php">
|
||||
<link rel="stylesheet" href="../../../../vendor/mottie/tablesorter/dist/css/theme.default.min.css">
|
||||
<link rel="stylesheet" href="../../../../vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css">
|
||||
<style type="text/css">
|
||||
#message {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
width: 50%;
|
||||
height: 2em;
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.missingFormData {
|
||||
border: 2px solid red;
|
||||
outline: 2px solid red;
|
||||
}
|
||||
|
||||
.modalOverlay {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background-color: rgba(0,0,0,0.3); /* black semi-transparent */
|
||||
}
|
||||
|
||||
#prfDetails, #prfVerwaltung {
|
||||
margin: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="padding-top:20px">
|
||||
<center>
|
||||
<div id="message"></div>
|
||||
|
||||
<form name="delete_termin" action="./pruefungstermin_loeschen.php" method="get">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo $p->t('global/lehrveranstaltung'); ?></td>
|
||||
<td><b><?php echo $lvstr; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $p->t('global/datum'); ?></td>
|
||||
<td><?php echo $datum ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $p->t('global/von'); ?></td>
|
||||
<td><?php echo $vonzeit ?> Uhr</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $p->t('global/bis'); ?></td>
|
||||
<td><?php echo $biszeit ?> Uhr</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $p->t('pruefung/pruefungsbewertungAnmeldungen'); ?>:</td>
|
||||
<td><?php echo $uids; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<br>***<br>
|
||||
<textarea cols="30" rows="10" name="message" placeholder="Bitte Nachricht an Studierende eingeben"><?php echo $nachricht ?></textarea>
|
||||
<br>***<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<p style="color: red; font-weight: bold;">Das Infomail ist optional und muss bei Bedarf vor dem Löschen des Termins versendet werden!</p>
|
||||
<input type="submit" value="Sende Infomail">
|
||||
<a href='#' onclick='terminLoeschenOhneLaden("<?php echo $pruefung_id ?>", "<?php echo $termin_id ?>");'>
|
||||
<input type="button" name="loeschen" value="<?php echo $p->t('global/loeschen'); ?>">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2"><?php echo $maildebug; ?></td></tr>
|
||||
</table>
|
||||
<input type="hidden" name="pruefung_id" value="<?php echo $pruefung_id ?>"/>
|
||||
<input type="hidden" name="termin_id" value="<?php echo $termin_id; ?>"/>
|
||||
<input type="hidden" name="sendmail" value="1"/>
|
||||
</form>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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');
|
||||
|
||||
@@ -1,456 +1,456 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009 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>,
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
|
||||
* Gerald Simane-Sequens <gerald.simane@technikum-wien.at>.
|
||||
*/
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
require_once('../../../include/benutzer.class.php');
|
||||
require_once('../../../include/student.class.php');
|
||||
require_once('../../../include/studiengang.class.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../include/studiensemester.class.php');
|
||||
|
||||
if (!$db = new basis_db())
|
||||
die('Fehler beim Oeffnen der Datenbankverbindung');
|
||||
$uid=isset($_GET['uid'])?$_GET['uid']:(isset($_POST['uid'])?$_POST['uid']:get_uid());
|
||||
$uid=trim($uid);
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
|
||||
if(!$rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 's') || !$rechte->isBerechtigt('admin'))
|
||||
die($rechte->errormsg);
|
||||
unset($rechte);
|
||||
|
||||
header('Content-Type: text/html;charset=UTF-8');
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Anzahl Studenten Lehrveranstaltungsplan FH Technikum-Wien</title>
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<?php
|
||||
/* Copyright (C) 2009 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>,
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
|
||||
* Gerald Simane-Sequens <gerald.simane@technikum-wien.at>.
|
||||
*/
|
||||
require_once('../../../config/cis.config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/datum.class.php');
|
||||
require_once('../../../include/benutzer.class.php');
|
||||
require_once('../../../include/student.class.php');
|
||||
require_once('../../../include/studiengang.class.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../../include/studiensemester.class.php');
|
||||
|
||||
if (!$db = new basis_db())
|
||||
die('Fehler beim Oeffnen der Datenbankverbindung');
|
||||
$uid=isset($_GET['uid'])?$_GET['uid']:(isset($_POST['uid'])?$_POST['uid']:get_uid());
|
||||
$uid=trim($uid);
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
|
||||
if(!$rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 's') && !$rechte->isBerechtigt('admin'))
|
||||
die($rechte->errormsg);
|
||||
unset($rechte);
|
||||
|
||||
header('Content-Type: text/html;charset=UTF-8');
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Anzahl Studenten Lehrveranstaltungsplan FH Technikum-Wien</title>
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
|
||||
<script type="text/javascript" src="../../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
|
||||
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
|
||||
<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>
|
||||
<script src="../../../vendor/components/jqueryui/jquery-ui.min.js" type="text/javascript"></script>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
li { list-style : outside url("../../../skin/images/right.gif");}
|
||||
/* ----------------------------------
|
||||
Resizable
|
||||
---------------------------------- */
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
|
||||
|
||||
div.info {top:5%;position: absolute;display:none;padding: 5px 5px 5px 5px;border: 1px solid Black;empty-cells : hide;text-align:center;vertical-align: top;z-index: 99;background-color: white; position:absolute;}
|
||||
div.infoclose {border: 7px outset #008381;padding: 0px 10px 0px 10px;}
|
||||
div.infodetail {font-size:medium;text-align:left;background-color: #F5F5F5;padding: 15px 15px 15px 15px;}
|
||||
|
||||
-->
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" language="JavaScript1.2">
|
||||
<!--
|
||||
$(function()
|
||||
{
|
||||
$("#info").resizable();
|
||||
$("#ui-resizable").draggable();
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
<body id="inhalt">
|
||||
<div id="ui-resizable" class="ui-resizable">
|
||||
<div style="-moz-user-select: none;" class="ui-resizable-handle ui-resizable-e"></div>
|
||||
<div style="-moz-user-select: none;" class="ui-resizable-handle ui-resizable-s"></div>
|
||||
<div style="z-index: 1001; -moz-user-select: none;" class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se"></div>
|
||||
<div id="info" class="info">
|
||||
<div style="border: 7px outset #393939;padding: 10px 10px 10px 10px;">
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr style="color:#FFF;" class="ContentHeader">
|
||||
<td id="info_print" align="left" style="color:#FFF;cursor: default;" class="ContentHeader">
|
||||
<div>drucken <img border="0" src="../../../skin/images/printer.png" title="drucken" ><br /></div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("td#info_print").click(function()
|
||||
{
|
||||
el='div#infodetail';
|
||||
var doc=null;
|
||||
var tab=false;;
|
||||
var iframe=false;
|
||||
if ($.browser.opera || $.browser.mozilla)
|
||||
{
|
||||
var tab = window.open("","jqPrint-preview");
|
||||
tab.document.open();
|
||||
var doc = tab.document;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var iframe=document.createElement('IFRAME');
|
||||
document.body.appendChild(iframe);
|
||||
doc=iframe.contentWindow.document;
|
||||
}
|
||||
|
||||
var links=window.document.getElementsByTagName("link");
|
||||
for(var i=0;i<links.length;i++)
|
||||
{
|
||||
if(links[i].rel.toLowerCase()=="stylesheet")
|
||||
{
|
||||
doc.write('<link type="text/css" rel="stylesheet" href="'+links[i].href+'"></link>');
|
||||
}
|
||||
}
|
||||
doc.write('<div class="'+$(el).attr("class")+'">'+$(el).html()+'</div>');
|
||||
doc.close();
|
||||
(tab ? tab : iframe.contentWindow).focus();
|
||||
setTimeout( function() { ( tab ? tab : iframe.contentWindow).print(); if (tab) { tab.close(); } }, 1000);
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
<td id="info_close" align="right" style="color:#FFF;cursor: default;" class="ContentHeader">
|
||||
<div>schliessen <img border="0" src="../../../skin/images/cross.png" title="schliessen"> </div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("td#info_close").click(function(event)
|
||||
{
|
||||
$("div#info").hide("slow"); // div# langsam oeffnen
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr></table>
|
||||
<div id="infodetail" style="font-size:medium;text-align:left;background-color: #F5F5F5;padding: 15px 15px 15px 15px;"></div>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Variablen uebernehmen
|
||||
$datum=(isset($_GET['datum'])?$_GET['datum']:(isset($_POST['datum'])?$_POST['datum']:time()));
|
||||
$stpl_table=(isset($_GET['stpl_table'])?$_GET['stpl_table']:'stundenplan');
|
||||
$montag=montag($datum);
|
||||
$letzterTag=mktime(0,0,0,date('m',$montag),date('d',$montag) + TAGE_PRO_WOCHE,date('Y',$montag));
|
||||
$letzterTagAnzeige=mktime(0,0,0,date('m',$montag),date('d',$montag) + ( TAGE_PRO_WOCHE - 1),date('Y',$montag));
|
||||
|
||||
// Vorbelegen der Wochennavigation
|
||||
$kwRet=mktime(0,0,0,date('m',$montag),date('d',$montag) -7 ,date('Y',$montag));
|
||||
$kwVor=mktime(0,0,0,date('m',$montag),date('d',$montag) +7 ,date('Y',$montag));
|
||||
$kw=strftime('%W',mktime(0,0,0,date('m',$montag),date('d',$montag),date('Y',$montag)));
|
||||
|
||||
$adresse_id=(isset($_GET['adresse_id'])?$_GET['adresse_id']:(isset($_POST['adresse_id'])?$_POST['adresse_id']:1));
|
||||
|
||||
// Datum Anzeige Header
|
||||
$tag=strftime('%a %d',mktime(0,0,0,date('m',$montag),date('d',$montag) ,date('Y',$montag)));
|
||||
$tag_monat=strftime('%a %d %b',mktime(0,0,0,date('m',$montag),date('d',$montag) ,date('Y',$montag)));
|
||||
$tag_monat_jahr=strftime('%a %d %b %Y',mktime(0,0,0,date('m',$montag),date('d',$montag),date('Y',$montag)));
|
||||
$letzter_tag_monat_jahr=strftime('%a %d %b %Y',mktime(0,0,0,date('m',$letzterTagAnzeige),date('d',$letzterTagAnzeige),date('Y',$letzterTagAnzeige)));
|
||||
|
||||
// Beginn Ende setzen
|
||||
$objSS=new studiensemester();
|
||||
$ss=$objSS->getaktorNext();
|
||||
$objSS->load($ss);
|
||||
$datum_obj = new datum();
|
||||
$ss_begin=$datum_obj->mktime_fromdate($objSS->start);
|
||||
$ss_ende=$datum_obj->mktime_fromdate($objSS->ende);
|
||||
|
||||
|
||||
$sql_query=' select tbl_adresse.plz,tbl_adresse.name, sum(tbl_ort.max_person) as summe ';
|
||||
$sql_query.=' from public.tbl_ort,public.tbl_standort, public.tbl_adresse ';
|
||||
$sql_query.=" where tbl_standort.standort_id=tbl_ort.standort_id ";
|
||||
$sql_query.=" and tbl_adresse.adresse_id=tbl_standort.adresse_id ";
|
||||
$sql_query.=" and tbl_adresse.adresse_id=".$db->db_add_param($adresse_id, FHC_INTEGER)." ";
|
||||
$sql_query.=" and tbl_ort.aktiv and tbl_ort.lehre ";
|
||||
$sql_query.=" group by tbl_adresse.plz,tbl_adresse.name ";
|
||||
// Gibt es fuer das Datum und Stunde einen Stundenplaneintrag
|
||||
if(!$results_anzahl=$db->db_query($sql_query))
|
||||
die($db->db_last_error());
|
||||
$raum_max_anz=0;
|
||||
$fh_name='FH lese fehler';
|
||||
if ($num_rows_anzahl=$db->db_num_rows($results_anzahl))
|
||||
{
|
||||
$fh_name = $db->db_result($results_anzahl,0,"name").', '.$db->db_result($results_anzahl,0,"plz");
|
||||
$raum_max_anz = $db->db_result($results_anzahl,0,"summe");
|
||||
}
|
||||
|
||||
$stg=array();
|
||||
echo '<H2><table class="tabcontent"><tr><td>
|
||||
Lehrveranstaltungsplan >> <a class="Item" href="index.php">Wochenplan</a> - Anzahl Studenten
|
||||
<a class="Item" href="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'&datum='.$kwRet.'&stpl_table='.$stpl_table.'"><<</a>
|
||||
Wochenplan <a class="Item" href="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'&datum='.$datum.'&stpl_table='.$stpl_table.'">Kw '.$kw.'</a>
|
||||
<a class="Item" href="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'&datum='.$kwVor.'&stpl_table='.$stpl_table.'">>></a>
|
||||
<a class="Item" href="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'&datum='.time().'&stpl_table='.$stpl_table.'">Heute</a>
|
||||
</td></tr></table></H2>';
|
||||
|
||||
// Stundentafel abfragen
|
||||
$sql_query="SELECT stunde, beginn, ende FROM lehre.tbl_stunde ORDER BY stunde";
|
||||
if(!$results=$db->db_query($sql_query))
|
||||
die($db->db_last_error());
|
||||
|
||||
|
||||
echo '<table class="tabcontent" style=" z-index: 1;">';
|
||||
echo '<tr><td style="text-align:center;color:#FFF;" class="ContentHeader" colspan="'. ( TAGE_PRO_WOCHE + 1 ) .'">'. $fh_name .' '. (date('Ym',$montag)==date('Ym',$letzterTagAnzeige)?$tag:(date('Y',$montag)==date('Y',$letzterTagAnzeige)?$tag_monat:$tag_monat_jahr)) .' - '. $letzter_tag_monat_jahr.'</td></tr>';
|
||||
echo '<tr>';
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">Stunde</td>';
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">'.strftime('%a',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).' '.date('d M',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
$max_person_array=array();
|
||||
$num_rows_stunde=$db->db_num_rows($results);
|
||||
echo '<tr>';
|
||||
for ($k=0; $k<$num_rows_stunde; $k++)
|
||||
{
|
||||
$row = $db->db_fetch_object($results, $k);
|
||||
$row->show_beginn=substr($row->beginn,0,5);
|
||||
$row->show_ende=substr($row->ende,0,5);
|
||||
$row->check_beginn=str_replace(':','',substr($row->beginn,0,5));
|
||||
$row->check_ende=str_replace(':','',substr($row->ende,0,5));
|
||||
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">'.$row->show_beginn.'<br>'.$row->show_ende.'</td>';
|
||||
$lehreinheiten=array();
|
||||
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
// Init je Tag und Std.
|
||||
$fehler=false;
|
||||
$aktiv=false;
|
||||
$max_person=0;
|
||||
|
||||
$day= date('Ymd',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag)));
|
||||
if ($day== date('Ymd') && date('Hi') >= $row->check_beginn && date('Hi')<=$row->check_ende )
|
||||
$aktiv=true;
|
||||
|
||||
echo '<td style="border-bottom: 1px solid Black;'.($aktiv?'background-color:#009e84;color:#FFF;':'').'" valign="top" '.($k % 2==0?'':' class="MarkLine" ').' >';
|
||||
|
||||
$sql_query=' select distinct vw_'.$stpl_table.'.stg_bezeichnung as bezeichnung,vw_'.$stpl_table.'.stg_kurzbzlang as kurzbzlang,vw_'.$stpl_table.'.stg_kurzbz as kurzbz, vw_'.$stpl_table.'.'.$stpl_table.'_id,vw_'.$stpl_table.'.lehrform, vw_'.$stpl_table.'.gruppe, vw_'.$stpl_table.'.gruppe_kurzbz, vw_'.$stpl_table.'.unr,vw_'.$stpl_table.'.verband,vw_'.$stpl_table.'.ort_kurzbz,vw_'.$stpl_table.'.lehreinheit_id,vw_'.$stpl_table.'.studiengang_kz,vw_'.$stpl_table.'.semester,tbl_ort.max_person,tbl_standort.adresse_id,tbl_adresse.plz,tbl_adresse.name ';
|
||||
$sql_query.=' from lehre.vw_'.$stpl_table.', public.tbl_ort,public.tbl_standort, public.tbl_adresse ';
|
||||
$sql_query.=" where vw_".$stpl_table.".datum=".$db->db_add_param(date('Y-m-d',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))))." ";
|
||||
$sql_query.=" and vw_".$stpl_table.".stunde=".$db->db_add_param($row->stunde, FHC_INTEGER)." ";
|
||||
$sql_query.=" and tbl_ort.ort_kurzbz=vw_".$stpl_table.".ort_kurzbz ";
|
||||
$sql_query.=" and tbl_standort.standort_id=tbl_ort.standort_id ";
|
||||
$sql_query.=" and tbl_adresse.adresse_id=tbl_standort.adresse_id ";
|
||||
$sql_query.=" and tbl_adresse.adresse_id=".$db->db_add_param($adresse_id, FHC_INTEGER)." ";
|
||||
$sql_query.=" order by tbl_adresse.plz,vw_".$stpl_table.".ort_kurzbz ";
|
||||
|
||||
// Gibt es fuer das Datum und Stunde einen Stundenplaneintrag
|
||||
if(!$results_anzahl=$db->db_query($sql_query))
|
||||
die($db->db_last_error());
|
||||
$num_rows_anzahl=$db->db_num_rows($results_anzahl);
|
||||
|
||||
$gefunden_anz=0;
|
||||
$tooltip='';
|
||||
for ($k_anz=0; $k_anz<$num_rows_anzahl; $k_anz++)
|
||||
{
|
||||
$row_anz = $db->db_fetch_object($results_anzahl, $k_anz);
|
||||
// Lehreinheit wird aufgeteilt in zwei Raeume - nicht verarbeiten , das sind die selben Personen
|
||||
if (isset($lehreinheiten[trim($row_anz->lehreinheit_id).trim($row_anz->gruppe_kurzbz)]))
|
||||
continue;
|
||||
$lehreinheiten[$row_anz->lehreinheit_id]=trim($row_anz->lehreinheit_id).trim($row_anz->gruppe_kurzbz);
|
||||
|
||||
$max_person=$row_anz->max_person+$max_person;
|
||||
$row_anz->verband=trim($row_anz->verband);
|
||||
$row_anz->gruppe=trim($row_anz->gruppe);
|
||||
$row_anz->gruppe_kurzbz=trim($row_anz->gruppe_kurzbz);
|
||||
|
||||
$stsem=$ss;
|
||||
|
||||
$gruppe=($row_anz->gruppe_kurzbz?$row_anz->gruppe_kurzbz:null);
|
||||
$student=new student();
|
||||
|
||||
$row_anz->anz=0;
|
||||
if ($result=$student->getStudents($row_anz->studiengang_kz,$row_anz->semester,$row_anz->verband,$row_anz->gruppe,$gruppe, $stsem))
|
||||
$row_anz->anz=count($result);
|
||||
|
||||
|
||||
if (empty($row_anz->anz))
|
||||
$fehler=true;
|
||||
|
||||
$lvb=$row_anz->kurzbzlang.'-'.$row_anz->semester;
|
||||
if (!is_null($row_anz->verband) && !empty($row_anz->verband))
|
||||
{
|
||||
$lvb.=$row_anz->verband;
|
||||
if (!is_null($row_anz->gruppe) && !empty($row_anz->gruppe) )
|
||||
$lvb.=$row_anz->gruppe;
|
||||
}
|
||||
if (!empty($k_anz))
|
||||
$tooltip.='</tr><tr>';
|
||||
else
|
||||
$tooltip.='<tr><th colspan=\'4\'>'. date('d M Y',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).' '.$row->show_beginn.' - '.$row->show_ende.'</th><th>Anzahl</th></tr>';
|
||||
$tooltip.='<td title=\'Stundenplan ID '.($stpl_table=='stundenplan'?$row_anz->stundenplan_id:$row_anz->stundenplandev_id).'\'><b>'.trim($row_anz->ort_kurzbz).'</b> </td><td><a href=\'stpl_detail.php?type=ort&datum='.date('Y-m-d',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).'&stunde='.$row->stunde.'&pers_uid='.$uid.'&stg_kz=&sem=&ver=&grp=&ort_kurzbz='.trim($row_anz->ort_kurzbz).'\' target=\'_blank\' titel=\'Studiengang Kz '.$row_anz->studiengang_kz.'\'>'.$lvb.'</a> </td><td>'.$row_anz->gruppe_kurzbz.' </td><td>'.(!$row_anz->anz?'<font color=\'Maroon\'>':'').$row_anz->bezeichnung.(!$row_anz->anz?'</font>':'').' </td><td>'.$row_anz->anz.'</td>';
|
||||
$gefunden_anz+=$row_anz->anz;
|
||||
}
|
||||
|
||||
if (!empty($gefunden_anz))
|
||||
{
|
||||
$tooltip.='<tr><td colspan=\'4\' align=\'right\'>max.Personen:'.$max_person.' Belegung:'. number_format($gefunden_anz / $max_person,2)*100 .'% <b>Ges.:</b></td><td><b>'.$gefunden_anz.'</b></td></tr>';
|
||||
|
||||
echo '<br><img id="img_'.$i.'_'.$k.'" src="../../../skin/images/sticky.png" title="Detailanzeige"> <b'.($fehler?' style="color:red;" ':'').'> Gesamt: </b>'.$gefunden_anz;
|
||||
echo '<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("img#img_'.$i.'_'.$k.'").click(function(event)
|
||||
{
|
||||
$("div#infodetail").html("<table border=\"0\"><tr>'.$tooltip.'</tr></table>");
|
||||
$("div#info").show("slow"); // div# langsam oeffnen
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
|
||||
if (!isset($max_person_array[$i]['tag']))
|
||||
$max_person_array[$i]['tag']=0;
|
||||
$max_person_array[$i]['tag']=$max_person_array[$i]['tag']+$gefunden_anz;
|
||||
if (!isset($max_person_array[$i]['tag_max']))
|
||||
$max_person_array[$i]['tag_max']=0;
|
||||
$max_person_array[$i]['tag_max']=$max_person_array[$i]['tag_max']+$max_person;
|
||||
|
||||
if (!isset($max_person_array[$k]['stunde']))
|
||||
$max_person_array[$k]['stunde']=0;
|
||||
$max_person_array[$k]['stunde']=$max_person_array[$k]['stunde']+$gefunden_anz;
|
||||
if (!isset($max_person_array[$k]['stunde_max']))
|
||||
$max_person_array[$k]['stunde_max']=0;
|
||||
$max_person_array[$k]['stunde_max']=$max_person_array[$k]['stunde_max']+$max_person;
|
||||
|
||||
if (!isset($max_person_array[$i][$k]['tag_stunde']))
|
||||
$max_person_array[$i][$k]['tag_stunde']=0;
|
||||
$max_person_array[$i][$k]['tag_stunde']=$max_person_array[$i][$k]['tag_stunde']+$gefunden_anz;
|
||||
if (!isset($max_person_array[$i][$k]['tag_stunde_max']))
|
||||
$max_person_array[$i][$k]['tag_stunde_max']=0;
|
||||
$max_person_array[$i][$k]['tag_stunde_max']=$max_person_array[$i][$k]['tag_stunde_max']+$max_person;
|
||||
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
if($rechte->isBerechtigt('admin'))
|
||||
{
|
||||
echo '<table class="tabcontent" style=" z-index: 1;">';
|
||||
echo '<tr><td style="text-align:center;color:#FFF;" class="ContentHeader" colspan="'. ( TAGE_PRO_WOCHE + 2 ) .'">'. $fh_name .' '. (date('Ym',$montag)==date('Ym',$letzterTagAnzeige)?$tag:(date('Y',$montag)==date('Y',$letzterTagAnzeige)?$tag_monat:$tag_monat_jahr)) .' - '. $letzter_tag_monat_jahr.'</td></tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td colspan="2" style="text-align:center;color:#FFF;" class="ContentHeader">Zeit / Datum – </td>';
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">'.strftime('%a',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).' '. date('d M Y',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
$stunde_proz=0;
|
||||
$stunde=0;
|
||||
$stunde_max=0;
|
||||
for ($k=0; $k<$num_rows_stunde; $k++)
|
||||
{
|
||||
$row = $db->db_fetch_object($results, $k);
|
||||
$row->show_beginn=substr($row->beginn,0,5);
|
||||
$row->show_ende=substr($row->ende,0,5);
|
||||
$row->check_beginn=str_replace(':','',substr($row->beginn,0,5));
|
||||
$row->check_ende=str_replace(':','',substr($row->ende,0,5));
|
||||
echo '<tr>';
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">'.$row->show_beginn.'<br>'.$row->show_ende.'</td>';
|
||||
echo '<td style="border-bottom: 1px solid Black;'.($aktiv?'background-color:#009e84;color:#FFF;':'').'" valign="top" '.($k % 2==0?'':' class="MarkLine" ').' >';
|
||||
echo 'anz.:'.$max_person_array[$k]['stunde'];
|
||||
echo '<br>';
|
||||
echo 'FH '.($raum_max_anz*TAGE_PRO_WOCHE);
|
||||
echo '<br>';
|
||||
echo ' Ø '.($max_person_array[$k]['stunde']?number_format(($max_person_array[$k]['stunde'])/TAGE_PRO_WOCHE / ($raum_max_anz),2)*100:0).'%';
|
||||
echo '<br>';
|
||||
echo 'Raum '.$max_person_array[$k]['stunde_max'];
|
||||
echo '<br>';
|
||||
echo ' Ø '.($max_person_array[$k]['stunde']?number_format(($max_person_array[$k]['stunde']/TAGE_PRO_WOCHE) / ($max_person_array[$k]['stunde_max']/TAGE_PRO_WOCHE),2)*100:0).'%';
|
||||
echo '</td>';
|
||||
|
||||
$stunde=$stunde+$max_person_array[$k]['stunde'];
|
||||
$stunde_max=$stunde_max+$max_person_array[$k]['stunde_max'];
|
||||
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
echo '<td style="border-bottom: 1px solid Black;'.($aktiv?'background-color:#009e84;color:#FFF;':'').'" valign="top" '.($k % 2==0?'':' class="MarkLine" ').' >';
|
||||
echo 'anz.:'.$max_person_array[$i][$k]['tag_stunde'];
|
||||
echo '<br>';
|
||||
echo 'FH max.:'. $raum_max_anz;
|
||||
echo '<br>';
|
||||
echo ' '.($max_person_array[$i][$k]['tag_stunde']?number_format($max_person_array[$i][$k]['tag_stunde'] / $raum_max_anz,2)*100:0).'%';
|
||||
echo '<br>';
|
||||
echo 'Raum max.:'. $max_person_array[$i][$k]['tag_stunde_max'];
|
||||
echo '<br>';
|
||||
echo ' '.($max_person_array[$i][$k]['tag_stunde']?number_format($max_person_array[$i][$k]['tag_stunde'] / $max_person_array[$i][$k]['tag_stunde_max'],2)*100:0).'%';
|
||||
echo '</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">Ø</td>';
|
||||
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">';
|
||||
echo 'FH Ø '.($stunde?number_format(($stunde)/$num_rows_stunde/TAGE_PRO_WOCHE / ($raum_max_anz),2)*100:0).'%';
|
||||
echo '<br>';
|
||||
echo 'Raum Ø '.($stunde_max?number_format(($stunde/$num_rows_stunde/TAGE_PRO_WOCHE) / ($stunde_max/$num_rows_stunde/TAGE_PRO_WOCHE),2)*100:0).'%';
|
||||
echo '</td>';
|
||||
|
||||
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">';
|
||||
echo 'FH Ø '.($max_person_array[$i]['tag']?number_format($max_person_array[$i]['tag'] / ($raum_max_anz *$num_rows_stunde),2)*100:0).'%';
|
||||
echo '<br>';
|
||||
echo 'Raum Ø '.($max_person_array[$i]['tag']?number_format($max_person_array[$i]['tag'] / $max_person_array[$i]['tag_max'],2)*100:0).'%';
|
||||
echo '</td>';
|
||||
}
|
||||
|
||||
echo '</tr>';
|
||||
|
||||
|
||||
echo '</table>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
|
||||
<script src="../../../vendor/components/jqueryui/jquery-ui.min.js" type="text/javascript"></script>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
li { list-style : outside url("../../../skin/images/right.gif");}
|
||||
/* ----------------------------------
|
||||
Resizable
|
||||
---------------------------------- */
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
|
||||
|
||||
div.info {top:5%;position: absolute;display:none;padding: 5px 5px 5px 5px;border: 1px solid Black;empty-cells : hide;text-align:center;vertical-align: top;z-index: 99;background-color: white; position:absolute;}
|
||||
div.infoclose {border: 7px outset #008381;padding: 0px 10px 0px 10px;}
|
||||
div.infodetail {font-size:medium;text-align:left;background-color: #F5F5F5;padding: 15px 15px 15px 15px;}
|
||||
|
||||
-->
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" language="JavaScript1.2">
|
||||
<!--
|
||||
$(function()
|
||||
{
|
||||
$("#info").resizable();
|
||||
$("#ui-resizable").draggable();
|
||||
});
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
<body id="inhalt">
|
||||
<div id="ui-resizable" class="ui-resizable">
|
||||
<div style="-moz-user-select: none;" class="ui-resizable-handle ui-resizable-e"></div>
|
||||
<div style="-moz-user-select: none;" class="ui-resizable-handle ui-resizable-s"></div>
|
||||
<div style="z-index: 1001; -moz-user-select: none;" class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se"></div>
|
||||
<div id="info" class="info">
|
||||
<div style="border: 7px outset #393939;padding: 10px 10px 10px 10px;">
|
||||
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr style="color:#FFF;" class="ContentHeader">
|
||||
<td id="info_print" align="left" style="color:#FFF;cursor: default;" class="ContentHeader">
|
||||
<div>drucken <img border="0" src="../../../skin/images/printer.png" title="drucken" ><br /></div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("td#info_print").click(function()
|
||||
{
|
||||
el='div#infodetail';
|
||||
var doc=null;
|
||||
var tab=false;;
|
||||
var iframe=false;
|
||||
if ($.browser.opera || $.browser.mozilla)
|
||||
{
|
||||
var tab = window.open("","jqPrint-preview");
|
||||
tab.document.open();
|
||||
var doc = tab.document;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var iframe=document.createElement('IFRAME');
|
||||
document.body.appendChild(iframe);
|
||||
doc=iframe.contentWindow.document;
|
||||
}
|
||||
|
||||
var links=window.document.getElementsByTagName("link");
|
||||
for(var i=0;i<links.length;i++)
|
||||
{
|
||||
if(links[i].rel.toLowerCase()=="stylesheet")
|
||||
{
|
||||
doc.write('<link type="text/css" rel="stylesheet" href="'+links[i].href+'"></link>');
|
||||
}
|
||||
}
|
||||
doc.write('<div class="'+$(el).attr("class")+'">'+$(el).html()+'</div>');
|
||||
doc.close();
|
||||
(tab ? tab : iframe.contentWindow).focus();
|
||||
setTimeout( function() { ( tab ? tab : iframe.contentWindow).print(); if (tab) { tab.close(); } }, 1000);
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
<td id="info_close" align="right" style="color:#FFF;cursor: default;" class="ContentHeader">
|
||||
<div>schliessen <img border="0" src="../../../skin/images/cross.png" title="schliessen"> </div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("td#info_close").click(function(event)
|
||||
{
|
||||
$("div#info").hide("slow"); // div# langsam oeffnen
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr></table>
|
||||
<div id="infodetail" style="font-size:medium;text-align:left;background-color: #F5F5F5;padding: 15px 15px 15px 15px;"></div>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// Variablen uebernehmen
|
||||
$datum=(isset($_GET['datum'])?$_GET['datum']:(isset($_POST['datum'])?$_POST['datum']:time()));
|
||||
$stpl_table=(isset($_GET['stpl_table'])?$_GET['stpl_table']:'stundenplan');
|
||||
$montag=montag($datum);
|
||||
$letzterTag=mktime(0,0,0,date('m',$montag),date('d',$montag) + TAGE_PRO_WOCHE,date('Y',$montag));
|
||||
$letzterTagAnzeige=mktime(0,0,0,date('m',$montag),date('d',$montag) + ( TAGE_PRO_WOCHE - 1),date('Y',$montag));
|
||||
|
||||
// Vorbelegen der Wochennavigation
|
||||
$kwRet=mktime(0,0,0,date('m',$montag),date('d',$montag) -7 ,date('Y',$montag));
|
||||
$kwVor=mktime(0,0,0,date('m',$montag),date('d',$montag) +7 ,date('Y',$montag));
|
||||
$kw=strftime('%W',mktime(0,0,0,date('m',$montag),date('d',$montag),date('Y',$montag)));
|
||||
|
||||
$adresse_id=(isset($_GET['adresse_id'])?$_GET['adresse_id']:(isset($_POST['adresse_id'])?$_POST['adresse_id']:1));
|
||||
|
||||
// Datum Anzeige Header
|
||||
$tag=strftime('%a %d',mktime(0,0,0,date('m',$montag),date('d',$montag) ,date('Y',$montag)));
|
||||
$tag_monat=strftime('%a %d %b',mktime(0,0,0,date('m',$montag),date('d',$montag) ,date('Y',$montag)));
|
||||
$tag_monat_jahr=strftime('%a %d %b %Y',mktime(0,0,0,date('m',$montag),date('d',$montag),date('Y',$montag)));
|
||||
$letzter_tag_monat_jahr=strftime('%a %d %b %Y',mktime(0,0,0,date('m',$letzterTagAnzeige),date('d',$letzterTagAnzeige),date('Y',$letzterTagAnzeige)));
|
||||
|
||||
// Beginn Ende setzen
|
||||
$objSS=new studiensemester();
|
||||
$ss=$objSS->getaktorNext();
|
||||
$objSS->load($ss);
|
||||
$datum_obj = new datum();
|
||||
$ss_begin=$datum_obj->mktime_fromdate($objSS->start);
|
||||
$ss_ende=$datum_obj->mktime_fromdate($objSS->ende);
|
||||
|
||||
|
||||
$sql_query=' select tbl_adresse.plz,tbl_adresse.name, sum(tbl_ort.max_person) as summe ';
|
||||
$sql_query.=' from public.tbl_ort,public.tbl_standort, public.tbl_adresse ';
|
||||
$sql_query.=" where tbl_standort.standort_id=tbl_ort.standort_id ";
|
||||
$sql_query.=" and tbl_adresse.adresse_id=tbl_standort.adresse_id ";
|
||||
$sql_query.=" and tbl_adresse.adresse_id=".$db->db_add_param($adresse_id, FHC_INTEGER)." ";
|
||||
$sql_query.=" and tbl_ort.aktiv and tbl_ort.lehre ";
|
||||
$sql_query.=" group by tbl_adresse.plz,tbl_adresse.name ";
|
||||
// Gibt es fuer das Datum und Stunde einen Stundenplaneintrag
|
||||
if(!$results_anzahl=$db->db_query($sql_query))
|
||||
die($db->db_last_error());
|
||||
$raum_max_anz=0;
|
||||
$fh_name='FH lese fehler';
|
||||
if ($num_rows_anzahl=$db->db_num_rows($results_anzahl))
|
||||
{
|
||||
$fh_name = $db->db_result($results_anzahl,0,"name").', '.$db->db_result($results_anzahl,0,"plz");
|
||||
$raum_max_anz = $db->db_result($results_anzahl,0,"summe");
|
||||
}
|
||||
|
||||
$stg=array();
|
||||
echo '<H2><table class="tabcontent"><tr><td>
|
||||
Lehrveranstaltungsplan >> <a class="Item" href="index.php">Wochenplan</a> - Anzahl Studenten
|
||||
<a class="Item" href="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'&datum='.$kwRet.'&stpl_table='.$stpl_table.'"><<</a>
|
||||
Wochenplan <a class="Item" href="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'&datum='.$datum.'&stpl_table='.$stpl_table.'">Kw '.$kw.'</a>
|
||||
<a class="Item" href="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'&datum='.$kwVor.'&stpl_table='.$stpl_table.'">>></a>
|
||||
<a class="Item" href="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'&datum='.time().'&stpl_table='.$stpl_table.'">Heute</a>
|
||||
</td></tr></table></H2>';
|
||||
|
||||
// Stundentafel abfragen
|
||||
$sql_query="SELECT stunde, beginn, ende FROM lehre.tbl_stunde ORDER BY stunde";
|
||||
if(!$results=$db->db_query($sql_query))
|
||||
die($db->db_last_error());
|
||||
|
||||
|
||||
echo '<table class="tabcontent" style=" z-index: 1;">';
|
||||
echo '<tr><td style="text-align:center;color:#FFF;" class="ContentHeader" colspan="'. ( TAGE_PRO_WOCHE + 1 ) .'">'. $fh_name .' '. (date('Ym',$montag)==date('Ym',$letzterTagAnzeige)?$tag:(date('Y',$montag)==date('Y',$letzterTagAnzeige)?$tag_monat:$tag_monat_jahr)) .' - '. $letzter_tag_monat_jahr.'</td></tr>';
|
||||
echo '<tr>';
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">Stunde</td>';
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">'.strftime('%a',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).' '.date('d M',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
$max_person_array=array();
|
||||
$num_rows_stunde=$db->db_num_rows($results);
|
||||
echo '<tr>';
|
||||
for ($k=0; $k<$num_rows_stunde; $k++)
|
||||
{
|
||||
$row = $db->db_fetch_object($results, $k);
|
||||
$row->show_beginn=substr($row->beginn,0,5);
|
||||
$row->show_ende=substr($row->ende,0,5);
|
||||
$row->check_beginn=str_replace(':','',substr($row->beginn,0,5));
|
||||
$row->check_ende=str_replace(':','',substr($row->ende,0,5));
|
||||
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">'.$row->show_beginn.'<br>'.$row->show_ende.'</td>';
|
||||
$lehreinheiten=array();
|
||||
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
// Init je Tag und Std.
|
||||
$fehler=false;
|
||||
$aktiv=false;
|
||||
$max_person=0;
|
||||
|
||||
$day= date('Ymd',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag)));
|
||||
if ($day== date('Ymd') && date('Hi') >= $row->check_beginn && date('Hi')<=$row->check_ende )
|
||||
$aktiv=true;
|
||||
|
||||
echo '<td style="border-bottom: 1px solid Black;'.($aktiv?'background-color:#009e84;color:#FFF;':'').'" valign="top" '.($k % 2==0?'':' class="MarkLine" ').' >';
|
||||
|
||||
$sql_query=' select distinct vw_'.$stpl_table.'.stg_bezeichnung as bezeichnung,vw_'.$stpl_table.'.stg_kurzbzlang as kurzbzlang,vw_'.$stpl_table.'.stg_kurzbz as kurzbz, vw_'.$stpl_table.'.'.$stpl_table.'_id,vw_'.$stpl_table.'.lehrform, vw_'.$stpl_table.'.gruppe, vw_'.$stpl_table.'.gruppe_kurzbz, vw_'.$stpl_table.'.unr,vw_'.$stpl_table.'.verband,vw_'.$stpl_table.'.ort_kurzbz,vw_'.$stpl_table.'.lehreinheit_id,vw_'.$stpl_table.'.studiengang_kz,vw_'.$stpl_table.'.semester,tbl_ort.max_person,tbl_standort.adresse_id,tbl_adresse.plz,tbl_adresse.name ';
|
||||
$sql_query.=' from lehre.vw_'.$stpl_table.', public.tbl_ort,public.tbl_standort, public.tbl_adresse ';
|
||||
$sql_query.=" where vw_".$stpl_table.".datum=".$db->db_add_param(date('Y-m-d',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))))." ";
|
||||
$sql_query.=" and vw_".$stpl_table.".stunde=".$db->db_add_param($row->stunde, FHC_INTEGER)." ";
|
||||
$sql_query.=" and tbl_ort.ort_kurzbz=vw_".$stpl_table.".ort_kurzbz ";
|
||||
$sql_query.=" and tbl_standort.standort_id=tbl_ort.standort_id ";
|
||||
$sql_query.=" and tbl_adresse.adresse_id=tbl_standort.adresse_id ";
|
||||
$sql_query.=" and tbl_adresse.adresse_id=".$db->db_add_param($adresse_id, FHC_INTEGER)." ";
|
||||
$sql_query.=" order by tbl_adresse.plz,vw_".$stpl_table.".ort_kurzbz ";
|
||||
|
||||
// Gibt es fuer das Datum und Stunde einen Stundenplaneintrag
|
||||
if(!$results_anzahl=$db->db_query($sql_query))
|
||||
die($db->db_last_error());
|
||||
$num_rows_anzahl=$db->db_num_rows($results_anzahl);
|
||||
|
||||
$gefunden_anz=0;
|
||||
$tooltip='';
|
||||
for ($k_anz=0; $k_anz<$num_rows_anzahl; $k_anz++)
|
||||
{
|
||||
$row_anz = $db->db_fetch_object($results_anzahl, $k_anz);
|
||||
// Lehreinheit wird aufgeteilt in zwei Raeume - nicht verarbeiten , das sind die selben Personen
|
||||
if (isset($lehreinheiten[trim($row_anz->lehreinheit_id).trim($row_anz->gruppe_kurzbz)]))
|
||||
continue;
|
||||
$lehreinheiten[$row_anz->lehreinheit_id]=trim($row_anz->lehreinheit_id).trim($row_anz->gruppe_kurzbz);
|
||||
|
||||
$max_person=$row_anz->max_person+$max_person;
|
||||
$row_anz->verband=trim($row_anz->verband);
|
||||
$row_anz->gruppe=trim($row_anz->gruppe);
|
||||
$row_anz->gruppe_kurzbz=trim($row_anz->gruppe_kurzbz);
|
||||
|
||||
$stsem=$ss;
|
||||
|
||||
$gruppe=($row_anz->gruppe_kurzbz?$row_anz->gruppe_kurzbz:null);
|
||||
$student=new student();
|
||||
|
||||
$row_anz->anz=0;
|
||||
if ($result=$student->getStudents($row_anz->studiengang_kz,$row_anz->semester,$row_anz->verband,$row_anz->gruppe,$gruppe, $stsem))
|
||||
$row_anz->anz=count($result);
|
||||
|
||||
|
||||
if (empty($row_anz->anz))
|
||||
$fehler=true;
|
||||
|
||||
$lvb=$row_anz->kurzbzlang.'-'.$row_anz->semester;
|
||||
if (!is_null($row_anz->verband) && !empty($row_anz->verband))
|
||||
{
|
||||
$lvb.=$row_anz->verband;
|
||||
if (!is_null($row_anz->gruppe) && !empty($row_anz->gruppe) )
|
||||
$lvb.=$row_anz->gruppe;
|
||||
}
|
||||
if (!empty($k_anz))
|
||||
$tooltip.='</tr><tr>';
|
||||
else
|
||||
$tooltip.='<tr><th colspan=\'4\'>'. date('d M Y',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).' '.$row->show_beginn.' - '.$row->show_ende.'</th><th>Anzahl</th></tr>';
|
||||
$tooltip.='<td title=\'Stundenplan ID '.($stpl_table=='stundenplan'?$row_anz->stundenplan_id:$row_anz->stundenplandev_id).'\'><b>'.trim($row_anz->ort_kurzbz).'</b> </td><td><a href=\'stpl_detail.php?type=ort&datum='.date('Y-m-d',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).'&stunde='.$row->stunde.'&pers_uid='.$uid.'&stg_kz=&sem=&ver=&grp=&ort_kurzbz='.trim($row_anz->ort_kurzbz).'\' target=\'_blank\' titel=\'Studiengang Kz '.$row_anz->studiengang_kz.'\'>'.$lvb.'</a> </td><td>'.$row_anz->gruppe_kurzbz.' </td><td>'.(!$row_anz->anz?'<font color=\'Maroon\'>':'').$row_anz->bezeichnung.(!$row_anz->anz?'</font>':'').' </td><td>'.$row_anz->anz.'</td>';
|
||||
$gefunden_anz+=$row_anz->anz;
|
||||
}
|
||||
|
||||
if (!empty($gefunden_anz))
|
||||
{
|
||||
$tooltip.='<tr><td colspan=\'4\' align=\'right\'>max.Personen:'.$max_person.' Belegung:'. number_format($gefunden_anz / $max_person,2)*100 .'% <b>Ges.:</b></td><td><b>'.$gefunden_anz.'</b></td></tr>';
|
||||
|
||||
echo '<br><img id="img_'.$i.'_'.$k.'" src="../../../skin/images/sticky.png" title="Detailanzeige"> <b'.($fehler?' style="color:red;" ':'').'> Gesamt: </b>'.$gefunden_anz;
|
||||
echo '<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("img#img_'.$i.'_'.$k.'").click(function(event)
|
||||
{
|
||||
$("div#infodetail").html("<table border=\"0\"><tr>'.$tooltip.'</tr></table>");
|
||||
$("div#info").show("slow"); // div# langsam oeffnen
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
|
||||
if (!isset($max_person_array[$i]['tag']))
|
||||
$max_person_array[$i]['tag']=0;
|
||||
$max_person_array[$i]['tag']=$max_person_array[$i]['tag']+$gefunden_anz;
|
||||
if (!isset($max_person_array[$i]['tag_max']))
|
||||
$max_person_array[$i]['tag_max']=0;
|
||||
$max_person_array[$i]['tag_max']=$max_person_array[$i]['tag_max']+$max_person;
|
||||
|
||||
if (!isset($max_person_array[$k]['stunde']))
|
||||
$max_person_array[$k]['stunde']=0;
|
||||
$max_person_array[$k]['stunde']=$max_person_array[$k]['stunde']+$gefunden_anz;
|
||||
if (!isset($max_person_array[$k]['stunde_max']))
|
||||
$max_person_array[$k]['stunde_max']=0;
|
||||
$max_person_array[$k]['stunde_max']=$max_person_array[$k]['stunde_max']+$max_person;
|
||||
|
||||
if (!isset($max_person_array[$i][$k]['tag_stunde']))
|
||||
$max_person_array[$i][$k]['tag_stunde']=0;
|
||||
$max_person_array[$i][$k]['tag_stunde']=$max_person_array[$i][$k]['tag_stunde']+$gefunden_anz;
|
||||
if (!isset($max_person_array[$i][$k]['tag_stunde_max']))
|
||||
$max_person_array[$i][$k]['tag_stunde_max']=0;
|
||||
$max_person_array[$i][$k]['tag_stunde_max']=$max_person_array[$i][$k]['tag_stunde_max']+$max_person;
|
||||
|
||||
}
|
||||
echo '</tr>';
|
||||
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
if($rechte->isBerechtigt('admin'))
|
||||
{
|
||||
echo '<table class="tabcontent" style=" z-index: 1;">';
|
||||
echo '<tr><td style="text-align:center;color:#FFF;" class="ContentHeader" colspan="'. ( TAGE_PRO_WOCHE + 2 ) .'">'. $fh_name .' '. (date('Ym',$montag)==date('Ym',$letzterTagAnzeige)?$tag:(date('Y',$montag)==date('Y',$letzterTagAnzeige)?$tag_monat:$tag_monat_jahr)) .' - '. $letzter_tag_monat_jahr.'</td></tr>';
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td colspan="2" style="text-align:center;color:#FFF;" class="ContentHeader">Zeit / Datum – </td>';
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">'.strftime('%a',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).' '. date('d M Y',mktime(0,0,0,date('m',$montag),date('d',$montag) + $i,date('Y',$montag))).'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
$stunde_proz=0;
|
||||
$stunde=0;
|
||||
$stunde_max=0;
|
||||
for ($k=0; $k<$num_rows_stunde; $k++)
|
||||
{
|
||||
$row = $db->db_fetch_object($results, $k);
|
||||
$row->show_beginn=substr($row->beginn,0,5);
|
||||
$row->show_ende=substr($row->ende,0,5);
|
||||
$row->check_beginn=str_replace(':','',substr($row->beginn,0,5));
|
||||
$row->check_ende=str_replace(':','',substr($row->ende,0,5));
|
||||
echo '<tr>';
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">'.$row->show_beginn.'<br>'.$row->show_ende.'</td>';
|
||||
echo '<td style="border-bottom: 1px solid Black;'.($aktiv?'background-color:#009e84;color:#FFF;':'').'" valign="top" '.($k % 2==0?'':' class="MarkLine" ').' >';
|
||||
echo 'anz.:'.$max_person_array[$k]['stunde'];
|
||||
echo '<br>';
|
||||
echo 'FH '.($raum_max_anz*TAGE_PRO_WOCHE);
|
||||
echo '<br>';
|
||||
echo ' Ø '.($max_person_array[$k]['stunde']?number_format(($max_person_array[$k]['stunde'])/TAGE_PRO_WOCHE / ($raum_max_anz),2)*100:0).'%';
|
||||
echo '<br>';
|
||||
echo 'Raum '.$max_person_array[$k]['stunde_max'];
|
||||
echo '<br>';
|
||||
echo ' Ø '.($max_person_array[$k]['stunde']?number_format(($max_person_array[$k]['stunde']/TAGE_PRO_WOCHE) / ($max_person_array[$k]['stunde_max']/TAGE_PRO_WOCHE),2)*100:0).'%';
|
||||
echo '</td>';
|
||||
|
||||
$stunde=$stunde+$max_person_array[$k]['stunde'];
|
||||
$stunde_max=$stunde_max+$max_person_array[$k]['stunde_max'];
|
||||
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
echo '<td style="border-bottom: 1px solid Black;'.($aktiv?'background-color:#009e84;color:#FFF;':'').'" valign="top" '.($k % 2==0?'':' class="MarkLine" ').' >';
|
||||
echo 'anz.:'.$max_person_array[$i][$k]['tag_stunde'];
|
||||
echo '<br>';
|
||||
echo 'FH max.:'. $raum_max_anz;
|
||||
echo '<br>';
|
||||
echo ' '.($max_person_array[$i][$k]['tag_stunde']?number_format($max_person_array[$i][$k]['tag_stunde'] / $raum_max_anz,2)*100:0).'%';
|
||||
echo '<br>';
|
||||
echo 'Raum max.:'. $max_person_array[$i][$k]['tag_stunde_max'];
|
||||
echo '<br>';
|
||||
echo ' '.($max_person_array[$i][$k]['tag_stunde']?number_format($max_person_array[$i][$k]['tag_stunde'] / $max_person_array[$i][$k]['tag_stunde_max'],2)*100:0).'%';
|
||||
echo '</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
|
||||
echo '<tr>';
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">Ø</td>';
|
||||
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">';
|
||||
echo 'FH Ø '.($stunde?number_format(($stunde)/$num_rows_stunde/TAGE_PRO_WOCHE / ($raum_max_anz),2)*100:0).'%';
|
||||
echo '<br>';
|
||||
echo 'Raum Ø '.($stunde_max?number_format(($stunde/$num_rows_stunde/TAGE_PRO_WOCHE) / ($stunde_max/$num_rows_stunde/TAGE_PRO_WOCHE),2)*100:0).'%';
|
||||
echo '</td>';
|
||||
|
||||
|
||||
for ($i=0; $i<TAGE_PRO_WOCHE; $i++)
|
||||
{
|
||||
|
||||
echo '<td style="text-align:center;color:#FFF;" class="ContentHeader">';
|
||||
echo 'FH Ø '.($max_person_array[$i]['tag']?number_format($max_person_array[$i]['tag'] / ($raum_max_anz *$num_rows_stunde),2)*100:0).'%';
|
||||
echo '<br>';
|
||||
echo 'Raum Ø '.($max_person_array[$i]['tag']?number_format($max_person_array[$i]['tag'] / $max_person_array[$i]['tag_max'],2)*100:0).'%';
|
||||
echo '</td>';
|
||||
}
|
||||
|
||||
echo '</tr>';
|
||||
|
||||
|
||||
echo '</table>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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"]
|
||||
});
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -163,6 +163,68 @@ if (isset($_GET['rechts_x']) || isset($_POST['rechts_x']))
|
||||
$wjahr=$wjahr;
|
||||
}
|
||||
}
|
||||
|
||||
//Bereits freigegebenen Eintrag löschen
|
||||
//Eintragung löschen
|
||||
if((isset($_GET['delete']) && isset($_GET['informSupervisor'])) || (isset($_POST['delete']) && isset($_POST['informSupervisor'])))
|
||||
{
|
||||
$zeitsperre = new zeitsperre();
|
||||
$zeitsperre->load($_GET['delete']);
|
||||
|
||||
$vondatum = $zeitsperre->getVonDatum();
|
||||
$bisdatum = $zeitsperre->getBisDatum();
|
||||
|
||||
if(!$zeitsperre->delete($_GET['delete']))
|
||||
echo $zeitsperre->errormsg;
|
||||
|
||||
//Mail an Vorgesetzten
|
||||
$prsn = new person();
|
||||
|
||||
$vorgesetzter = $ma->getVorgesetzte($uid);
|
||||
if($vorgesetzter)
|
||||
{
|
||||
$to='';
|
||||
$fullName ='';
|
||||
foreach($ma->vorgesetzte as $vg)
|
||||
{
|
||||
if($to!='')
|
||||
{
|
||||
$to.=', '.$vg.'@'.DOMAIN;
|
||||
$name = $prsn->getFullNameFromBenutzer($vg);
|
||||
$fullName.=', '.$name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$to.=$vg.'@'.DOMAIN;
|
||||
$name = $prsn->getFullNameFromBenutzer($vg);
|
||||
$fullName.=$name;
|
||||
}
|
||||
}
|
||||
|
||||
$benutzer = new benutzer();
|
||||
$benutzer->load($uid);
|
||||
$message = $p->t('urlaubstool/diesIstEineAutomatischeMail')."\n".
|
||||
$p->t('urlaubstool/xHatUrlaubGeloescht',array($benutzer->nachname,$benutzer->vorname)).":\n";
|
||||
$message.= $p->t('urlaubstool/von')." ".date("d.m.Y", strtotime($vondatum))." ".$p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($bisdatum))."\n";
|
||||
|
||||
|
||||
$mail = new mail($to, 'vilesci@'.DOMAIN,$p->t('urlaubstool/freigegebenerUrlaubGeloescht'), $message);
|
||||
if($mail->send())
|
||||
{
|
||||
$vgmail="<span style='color:green;'>".$p->t('urlaubstool/VorgesetzteInformiert',array($fullName))."</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$vgmail="<br><span class='error'>".$p->t('urlaubstool/fehlerBeimSendenAufgetreten',array($fullName))."!</span>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$vgmail="<br><span class='error'>".$p->t('urlaubstool/konnteKeinFreigabemailVersendetWerden')."</span>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Eintragung löschen
|
||||
if((isset($_GET['delete']) || isset($_POST['delete'])))
|
||||
{
|
||||
@@ -257,19 +319,26 @@ if(isset($_GET['speichern']) && isset($_GET['wtag']))
|
||||
if(!$error)
|
||||
{
|
||||
//Mail an Vorgesetzten
|
||||
$prsn = new person();
|
||||
|
||||
$vorgesetzter = $ma->getVorgesetzte($uid);
|
||||
if($vorgesetzter)
|
||||
{
|
||||
$to='';
|
||||
$fullName ='';
|
||||
foreach($ma->vorgesetzte as $vg)
|
||||
{
|
||||
if($to!='')
|
||||
{
|
||||
$to.=', '.$vg.'@'.DOMAIN;
|
||||
$name = $prsn->getFullNameFromBenutzer($vg);
|
||||
$fullName.=', '.$name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$to.=$vg.'@'.DOMAIN;
|
||||
$name = $prsn->getFullNameFromBenutzer($vg);
|
||||
$fullName.=$name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +364,7 @@ if(isset($_GET['speichern']) && isset($_GET['wtag']))
|
||||
$mail = new mail($to, 'vilesci@'.DOMAIN,$p->t('urlaubstool/freigabeansuchenUrlaub'), $message);
|
||||
if($mail->send())
|
||||
{
|
||||
$vgmail="<span style='color:green;'>".$p->t('urlaubstool/freigabemailWurdeVersandt',array($to))."</span>";
|
||||
$vgmail="<span style='color:green;'>".$p->t('urlaubstool/freigabemailWurdeVersandt',array($fullName))."</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -373,10 +442,14 @@ if ((isset($wmonat) || isset($wmonat))&&(isset($wjahr) || isset($wjahr)))
|
||||
if(date("Y-m-d",mktime(0, 0, 0, ($wmonat+1) , $i-$wotag+1, $jahre[$wjahr]))>=$row->vondatum
|
||||
&& date("Y-m-d",mktime(0, 0, 0, ($wmonat+1) , $i-$wotag+1, $jahre[$wjahr]))<=$row->bisdatum)
|
||||
{
|
||||
if($row->freigabevon!='' || $row->bisdatum<date("Y-m-d",time()))
|
||||
if($row->freigabevon!='' && $row->vondatum<=date("Y-m-d",time()))
|
||||
{
|
||||
$hgfarbe[$i]='#bbb';
|
||||
}
|
||||
elseif ($row->freigabevon!='' && $row->vondatum>date("Y-m-d",time()))
|
||||
{
|
||||
$hgfarbe[$i]='#CDDDEE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$hgfarbe[$i]='#FFFC7F';
|
||||
@@ -389,7 +462,7 @@ if ((isset($wmonat) || isset($wmonat))&&(isset($wjahr) || isset($wjahr)))
|
||||
}
|
||||
else
|
||||
{
|
||||
if($hgfarbe[$i]!='#FFFC7F' && $hgfarbe[$i]!='#bbb')
|
||||
if($hgfarbe[$i]!='#FFFC7F' && $hgfarbe[$i]!='#bbb' && $hgfarbe[$i]!='#CDDDEE')
|
||||
{
|
||||
|
||||
$hgfarbe[$i]='#E9ECEE';
|
||||
@@ -696,7 +769,7 @@ for ($i=0;$i<6;$i++)
|
||||
}
|
||||
if($tage[$j+7*$i]!='')
|
||||
{
|
||||
if($hgfarbe[$j+7*$i]=='#FFFC7F')
|
||||
if($hgfarbe[$j+7*$i]=='#FFFC7F' )//|| $hgfarbe[$j+7*$i]=='#CDDDEE')
|
||||
{
|
||||
echo '<b title='.$p->t('urlaubstool/vertretung').': '.$vertretung_uid[$j+7*$i].' - '.$p->t('urlaubstool/erreichbar').': '.$erreichbarkeit_kurzbz[$j+7*$i].'">'.$tage[$j+7*$i].'</b><br>';;
|
||||
$k=$j+7*$i;
|
||||
@@ -724,7 +797,13 @@ for ($i=0;$i<6;$i++)
|
||||
}
|
||||
elseif(isset($freigabeamum[$j+7*$i]))
|
||||
{
|
||||
echo '<img src="../../../skin/images/flag-green.png" alt="freigegeben" title="'.$p->t('urlaubstool/freigegebenDurchAm', array($freigabevon[$j+7*$i])).' '.date("d-m-Y",strtotime($freigabeamum[$j+7*$i])).'"></td>';
|
||||
echo '<img src="../../../skin/images/flag-green.png" alt="freigegeben" title="'.$p->t('urlaubstool/freigegebenDurch', array($freigabevon[$j+7*$i])).': '.$freigabevon[$j+7*$i].'"><span> </span>';
|
||||
if($hgfarbe[$j+7*$i]=='#CDDDEE')
|
||||
{
|
||||
$k=$j+7*$i;
|
||||
echo "<a href='$PHP_SELF?wmonat=$wmonat&wjahr=$wjahr&delete=$datensatz[$k]&informSupervisor=True' onclick='return conf_del()'>";
|
||||
echo '<img src="../../../skin/images/delete_x.png" alt="loeschen" title="'.$p->t('urlaubstool/eintragungLoeschen').'"></a></td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+305
-277
@@ -1,277 +1,305 @@
|
||||
<?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='';
|
||||
|
||||
$buchungsdatum = $datum_obj->mktime_fromdate(isset($row['childs'][$i])?$row['childs'][$i]->buchungsdatum:$row['parent']->buchungsdatum);
|
||||
$aktdatum = time();
|
||||
// Zukünftige Zahlungen werden nicht angezeigt
|
||||
if ($buchungsdatum <= $aktdatum)
|
||||
{
|
||||
echo "<tr>";
|
||||
echo '<td '.$style.'>'.date('d.m.Y',$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>';
|
||||
?>
|
||||
|
||||
@@ -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>';
|
||||
|
||||
@@ -413,15 +413,23 @@ if(isset($_GET['type']) && ($_GET['type']=='edit_sperre' || $_GET['type']=='new_
|
||||
if($zeitsperre->new && $zeitsperre->zeitsperretyp_kurzbz=='Urlaub')
|
||||
{
|
||||
//Beim Anlegen von neuen Urlauben wird ein Mail an den Vorgesetzten versendet um diesen Freizugeben
|
||||
$vorgesetzter = $ma->getVorgesetzte($uid);
|
||||
$prsn = new person();
|
||||
|
||||
$vorgesetzter = $ma->getVorgesetzte($uid);
|
||||
if($vorgesetzter)
|
||||
{
|
||||
$to='';
|
||||
$fullName='';
|
||||
foreach($ma->vorgesetzte as $vg)
|
||||
{
|
||||
if (!empty($to))
|
||||
{
|
||||
$to.=',';
|
||||
$fullName.=',';
|
||||
}
|
||||
$to.=trim($vg.'@'.DOMAIN);
|
||||
$name = $prsn->getFullNameFromBenutzer($vg);
|
||||
$fullName.=$name;
|
||||
}
|
||||
|
||||
$benutzer = new benutzer();
|
||||
@@ -440,11 +448,11 @@ if(isset($_GET['type']) && ($_GET['type']=='edit_sperre' || $_GET['type']=='new_
|
||||
$mail = new mail($to, $from, 'Freigabeansuchen', $message);
|
||||
if($mail->send())
|
||||
{
|
||||
echo "<br><b>".$p->t('urlaubstool/freigabemailWurdeVersandt',array($to))."</b>";
|
||||
echo "<br><b>".$p->t('urlaubstool/freigabemailWurdeVersandt',array($fullName))."</b>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><span class='error'>".$p->t('urlaubstool/fehlerBeimSendenAufgetreten',array($to))."</span>";
|
||||
echo "<br><span class='error'>".$p->t('urlaubstool/fehlerBeimSendenAufgetreten',array($fullName))."</span>";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -461,8 +469,69 @@ if(isset($_GET['type']) && ($_GET['type']=='edit_sperre' || $_GET['type']=='new_
|
||||
echo "<span class='error'>$error_msg</span>";
|
||||
}
|
||||
|
||||
//loeschen eines bereits freigegebenen Urlaubs
|
||||
if((isset($_GET['type']) && $_GET['type']=='delete_sperre' && isset($_GET['informSupervisor'])))
|
||||
{
|
||||
$zeitsperre = new zeitsperre();
|
||||
$zeitsperre->load($_GET['id']);
|
||||
|
||||
$vondatum = $zeitsperre->getVonDatum();
|
||||
$bisdatum = $zeitsperre->getBisDatum();
|
||||
|
||||
if(!$zeitsperre->delete($_GET['id']))
|
||||
echo $zeitsperre->errormsg;
|
||||
|
||||
//Mail an Vorgesetzten
|
||||
$prsn = new person();
|
||||
|
||||
$vorgesetzter = $ma->getVorgesetzte($uid);
|
||||
if($vorgesetzter)
|
||||
{
|
||||
$to='';
|
||||
$fullName ='';
|
||||
foreach($ma->vorgesetzte as $vg)
|
||||
{
|
||||
if($to!='')
|
||||
{
|
||||
$to.=', '.$vg.'@'.DOMAIN;
|
||||
$name = $prsn->getFullNameFromBenutzer($vg);
|
||||
$fullName.=', '.$name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$to.=$vg.'@'.DOMAIN;
|
||||
$name = $prsn->getFullNameFromBenutzer($vg);
|
||||
$fullName.=$name;
|
||||
}
|
||||
}
|
||||
|
||||
$benutzer = new benutzer();
|
||||
$benutzer->load($uid);
|
||||
$message = $p->t('urlaubstool/diesIstEineAutomatischeMail')."\n".
|
||||
$p->t('urlaubstool/xHatUrlaubGeloescht',array($benutzer->nachname,$benutzer->vorname)).":\n";
|
||||
|
||||
|
||||
$message.= $p->t('urlaubstool/von')." ".date("d.m.Y", strtotime($vondatum))." ".$p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($bisdatum))."\n";
|
||||
|
||||
|
||||
$mail = new mail($to, 'vilesci@'.DOMAIN,$p->t('urlaubstool/freigegebenerUrlaubGeloescht'), $message);
|
||||
if($mail->send())
|
||||
{
|
||||
echo "<br><b>".$p->t('urlaubstool/VorgesetzteInformiert',array($fullName))."</b>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><span class='error'>".$p->t('urlaubstool/fehlerBeimSendenAufgetreten',array($fullName))."!</span>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$vgmail="<br><span class='error'>".$p->t('urlaubstool/konnteKeinFreigabemailVersendetWerden')."</span>";
|
||||
}
|
||||
}
|
||||
|
||||
//loeschen einer zeitsperre
|
||||
if(isset($_GET['type']) && $_GET['type']=='delete_sperre')
|
||||
if(isset($_GET['type']) && $_GET['type']=='delete_sperre' && !isset($_GET['informSupervisor']) )
|
||||
{
|
||||
$zeit = new zeitsperre();
|
||||
$zeit->load($_GET['id']);
|
||||
@@ -518,7 +587,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>
|
||||
@@ -532,10 +601,14 @@ if(count($zeit->result)>0)
|
||||
$content_table.="<td><a href='$PHP_SELF?type=edit&id=$row->zeitsperre_id' class='Item'>".$p->t('zeitsperre/edit')."</a></td>";
|
||||
if ($row->vondatum < $gesperrt_bis AND in_array($row->zeitsperretyp_kurzbz,$typen_arr))
|
||||
$content_table .= '<td> </td>';
|
||||
else if($row->freigabeamum=='' || $row->zeitsperretyp_kurzbz!='Urlaub')
|
||||
else if($row->vondatum>=date("Y-m-d",time()) && $row->zeitsperretyp_kurzbz=='Urlaub')
|
||||
{
|
||||
$content_table.="\n<td><a href='$PHP_SELF?type=delete_sperre&id=$row->zeitsperre_id' onclick='return conf_del()' class='Item'>".$p->t('zeitsperre/loeschen')."</a></td>";
|
||||
$content_table.="\n<td><a href='$PHP_SELF?type=delete_sperre&id=$row->zeitsperre_id&informSupervisor=True' onclick='return conf_del()' class='Item'>".$p->t('zeitsperre/loeschen')."</a></td>";
|
||||
}
|
||||
elseif($row->zeitsperretyp_kurzbz!='Urlaub')
|
||||
{
|
||||
$content_table.="\n<td><a href='$PHP_SELF?type=delete_sperre&id=$row->zeitsperre_id' onclick='return conf_del()' class='Item'>".$p->t('zeitsperre/loeschen')."</a></td>";
|
||||
}
|
||||
else
|
||||
$content_table .= '<td> </td>';
|
||||
$content_table.="</tr>";
|
||||
@@ -587,15 +660,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>';
|
||||
|
||||
@@ -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">';
|
||||
|
||||
@@ -62,11 +62,15 @@ TZOFFSETTO:+0100
|
||||
END:STANDARD
|
||||
END:VTIMEZONE\n";
|
||||
//echo 'URL:',APP_ROOT,'cis/public/ical_coodle.php/',$uid,"\n";
|
||||
echo "BEGIN:VEVENT";
|
||||
|
||||
// Alle Umfragen holen an denen der User beteiligt ist
|
||||
$umfragen = new coodle();
|
||||
$umfragen->getCoodleFromUser($uid);
|
||||
$i = 0;
|
||||
if (count($umfragen->result) > 0)
|
||||
{
|
||||
//echo "BEGIN:VEVENT";
|
||||
}
|
||||
foreach($umfragen->result as $umfrage)
|
||||
{
|
||||
if($umfrage->coodle_status_kurzbz=='laufend')
|
||||
@@ -88,10 +92,7 @@ foreach($umfragen->result as $umfrage)
|
||||
$uhrzeit_ende = $date->format('H:i:s');
|
||||
$dtende = $date->format('Ymd\THis');
|
||||
|
||||
if ($i > 0)
|
||||
{
|
||||
echo "\nBEGIN:VEVENT";
|
||||
}
|
||||
echo "\nBEGIN:VEVENT";
|
||||
echo "\nUID:Coodle_Terminoption".$dtstart."_".$dtende."";
|
||||
echo "\nSUMMARY:Coodle Terminoption";
|
||||
echo "\nDTSTART;TZID=Europe/Vienna:$dtstart";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user