Merge branch 'master' into feature-6050/Stundensatz_vorschlag

This commit is contained in:
Andreas Österreicher
2020-03-25 15:05:07 +01:00
7 changed files with 76 additions and 29 deletions
+2
View File
@@ -18,6 +18,8 @@ $config['ou_receivers'] = array('ass');
$config['ou_receivers_no_notice'] = array('infocenter');
// Organization units that will not send the notice email to the internal account, but to the private one
$config['ou_receivers_private'] = array('eac', 'ewu', 'scs');
//
$config['ou_function_whitelist'] = array('ass', 'Leitung', 'fachzuordnung', 'oezuordnung');
$config['message_redirect_url'] = array();
$config['message_redirect_url']['fallback'] = site_url('system/messages/ViewMessage/writeReply');
+9 -1
View File
@@ -15,6 +15,7 @@ class MessageLib
const CFG_OU_RECEIVERS = 'ou_receivers';
const CFG_OU_RECEIVERS_NO_NOTICE = 'ou_receivers_no_notice';
const CFG_OU_RECEIVERS_PRIVATE = 'ou_receivers_private';
const CFG_OU_FUNCTION_WHITELIST = 'ou_function_whitelist';
const CFG_REDIRECT_VIEW_MESSAGE_URL = 'redirect_view_message_url';
// Templates names
@@ -229,7 +230,14 @@ class MessageLib
$ouArray = array();
// Copies organisation units in $ouArray array
foreach (getData($benutzer) as $val) $ouArray[] = $val->oe_kurzbz;
foreach (getData($benutzer) as $val)
{
// If the function is in the white list then get the organisation unit
if (in_array($val->funktion_kurzbz, $this->_ci->config->item(self::CFG_OU_FUNCTION_WHITELIST)))
{
$ouArray[] = $val->oe_kurzbz;
}
}
return success($ouArray);
}
@@ -125,12 +125,12 @@ class Organisationseinheit_model extends DB_Model
public function getChilds($oe_kurzbz, $includeinactive = false)
{
$query = "
WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
(
SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
WHERE oe_kurzbz=? %s
UNION ALL
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
WHERE o.oe_parent_kurzbz=oes.oe_kurzbz %s
)
SELECT oe_kurzbz
@@ -150,12 +150,12 @@ class Organisationseinheit_model extends DB_Model
public function getParents($oe_kurzbz, $includeinactive = false)
{
$query=
"WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
"WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
(
SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
WHERE oe_kurzbz=? %s
UNION ALL
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
WHERE o.oe_kurzbz=oes.oe_parent_kurzbz %s
)
SELECT oe_kurzbz
@@ -177,7 +177,7 @@ class Organisationseinheit_model extends DB_Model
{
$condition = '
oe_kurzbz = (
SELECT
SELECT
oe_parent_kurzbz
FROM
public.tbl_organisationseinheit
+48 -21
View File
@@ -11,9 +11,9 @@ class Vorlage_widget extends DropdownWidget
$vorlage = null;
// If the user is an admin
if ($idAdmin === true)
if ($idAdmin)
{
// Get all the vorlage with mimetype = text/html
// Get all the vorlage with mimetype = text/html
$vorlage = $this->_getAllHTMLVorlage();
}
else
@@ -39,7 +39,7 @@ class Vorlage_widget extends DropdownWidget
private function _getAllHTMLVorlage()
{
$this->load->model('system/Vorlage_model', 'VorlageModel');
$this->VorlageModel->addOrder('vorlage_kurzbz');
$this->VorlageModel->addOrder('bezeichnung');
$this->addSelectToModel($this->VorlageModel, 'vorlage_kurzbz', 'bezeichnung');
@@ -59,15 +59,31 @@ class Vorlage_widget extends DropdownWidget
$vorlage = success(array()); // Default value
$table = '(
SELECT v.vorlage_kurzbz, v.bezeichnung, vs.version, vs.oe_kurzbz, vs.aktiv, vs.subject, vs.text, v.mimetype
FROM tbl_vorlagestudiengang vs INNER JOIN tbl_vorlage v USING(vorlage_kurzbz)
SELECT v.vorlage_kurzbz,
v.bezeichnung,
vs.version,
vs.oe_kurzbz,
vs.aktiv,
vs.subject,
vs.text,
v.mimetype
FROM tbl_vorlagestudiengang vs
JOIN tbl_vorlage v USING(vorlage_kurzbz)
) templates';
$alias = 'templates';
$fields = array("templates.vorlage_kurzbz AS id", "templates.bezeichnung AS description");
$fields = array(
'templates.vorlage_kurzbz AS id',
'templates.bezeichnung || \' (\' || UPPER(templates.oe_kurzbz) || \')\' AS description'
);
$where = 'templates.aktiv = TRUE
AND templates.subject IS NOT NULL
AND templates.text IS NOT NULL
AND templates.mimetype = \'text/html\'';
AND templates.subject IS NOT NULL
AND templates.text IS NOT NULL
AND templates.mimetype = \'text/html\'
GROUP BY 1, 2, 3';
$order_by = 'description ASC';
if (!is_array($oe_kurzbz))
@@ -99,30 +115,41 @@ class Vorlage_widget extends DropdownWidget
if (hasData($tmpVorlage))
{
// If it's the first vorlage copy it
if (count($vorlage->retval) == 0)
if (!hasData($vorlage))
{
for ($j = 0; $j < count($tmpVorlage->retval); $j++)
for ($j = 0; $j < count(getData($tmpVorlage)); $j++)
{
if ($tmpVorlage->retval[$j]->id != '')
if (getData($tmpVorlage)[$j]->id != '')
{
array_push($vorlage->retval, $tmpVorlage->retval[$j]);
array_push($vorlage->retval, getData($tmpVorlage)[$j]);
}
}
}
else // checks for duplicates, if it's not already present push it into the array $vorlage->retval
else // checks for duplicates, if it's not already present push it into the array getData($vorlage)
{
for ($i = 0; $i < count($vorlage->retval); $i++)
for ($j = 0; $j < count(getData($tmpVorlage)); $j++)
{
for ($j = 0; $j < count($tmpVorlage->retval); $j++)
$found = false;
$currentTmpVorlageData = null;
for ($i = 0; $i < count(getData($vorlage)); $i++)
{
if ($tmpVorlage->retval[$j]->id != ''
&& $vorlage->retval[$i]->_pk != $tmpVorlage->retval[$j]->_pk
&& $vorlage->retval[$i]->_ppk != $tmpVorlage->retval[$j]->_ppk
&& $vorlage->retval[$i]->_jtpk != $tmpVorlage->retval[$j]->_jtpk)
$currentTmpVorlageData = getData($tmpVorlage)[$j];
if (getData($vorlage)[$i]->id == getData($tmpVorlage)[$j]->id
&& getData($vorlage)[$i]->_pk == getData($tmpVorlage)[$j]->_pk
&& getData($vorlage)[$i]->_ppk == getData($tmpVorlage)[$j]->_ppk
&& getData($vorlage)[$i]->_jtpk == getData($tmpVorlage)[$j]->_jtpk)
{
array_push($vorlage->retval, $tmpVorlage->retval[$j]);
$found = true;
break;
}
}
if (!$found && $currentTmpVorlageData->id != '')
{
array_push($vorlage->retval, $currentTmpVorlageData);
}
}
}
}
+6
View File
@@ -427,6 +427,7 @@ if (!$ansicht)
usort($kontakt->result, "sortKontakt");
echo '<table>';
$has_notfallkontakt = false;
foreach($kontakt->result as $k)
{
if ($k->kontakttyp != 'firmenhandy' && $k->kontakttyp != 'hidden')
@@ -441,6 +442,8 @@ if (!$ansicht)
echo '<td>'.$k->anmerkung.'</td>';
echo '<td>'.$zustellung.'</td>';
echo '</tr>';
if ($k->kontakttyp == 'notfallkontakt')
$has_notfallkontakt = true;
}
/*
if ($k->zustellung === TRUE)
@@ -462,6 +465,9 @@ if (!$ansicht)
}
*/
}
if (!$has_notfallkontakt)
echo '<tr><td>'.$p->t('profil/notfallkontakt').'</td><td colspan="3">'.$p->t('profil/notfallkontaktBekanntgeben').'</td></tr>';
echo '</table>';
}
+2
View File
@@ -84,4 +84,6 @@ $this->phrasen['profil/gueltigbis']='Gültig bis';
$this->phrasen['profil/wochenstunden']='Wochenstunden';
$this->phrasen['profil/vertragsstunden']='Vertragsstunden';
$this->phrasen['profil/zukuenftigeFunktionen']='Zukünftige Funktionen';
$this->phrasen['profil/notfallkontakt']='Notfallkontakt';
$this->phrasen['profil/notfallkontaktBekanntgeben']='Bitte geben Sie einen Notfallkontakt bekannt!';
?>
+2
View File
@@ -82,4 +82,6 @@ $this->phrasen['profil/gueltigbis']='Valid to';
$this->phrasen['profil/wochenstunden']='week hours';
$this->phrasen['profil/vertragsstunden']='contract hours';
$this->phrasen['profil/zukuenftigeFunktionen']='Future functions';
$this->phrasen['profil/notfallkontakt']='Emergency contact';
$this->phrasen['profil/notfallkontaktBekanntgeben']='Please provide an emergency contact!';
?>