mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-28 01:19:28 +00:00
Merge branch 'master' of https://github.com/FH-Complete/FHC-Core
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -402,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);
|
||||
|
||||
@@ -466,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))
|
||||
@@ -475,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);
|
||||
@@ -606,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))
|
||||
{
|
||||
@@ -629,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(
|
||||
@@ -839,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
|
||||
@@ -859,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,
|
||||
@@ -867,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))));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -23,13 +23,17 @@ 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));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -122,6 +122,10 @@ echo ']>
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/messages/rdf#status"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="messages-tree-status" label="Letzte Statusänderung" flex="2" hidden="false"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/messages/rdf#statusdatum"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
</treecols>
|
||||
|
||||
<template>
|
||||
@@ -137,6 +141,7 @@ echo ']>
|
||||
<treecell label="rdf:http://www.technikum-wien.at/messages/rdf#sender_id"/>
|
||||
<treecell label="rdf:http://www.technikum-wien.at/messages/rdf#recipient_id"/>
|
||||
<treecell label="rdf:http://www.technikum-wien.at/messages/rdf#status"/>
|
||||
<treecell label="rdf:http://www.technikum-wien.at/messages/rdf#statusdatum"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
|
||||
@@ -287,7 +287,7 @@ class studiensemester extends basis_db
|
||||
|
||||
$qry.= " WHERE substring(studiensemester_kurzbz from 1 for 2)='$ss' ";
|
||||
}
|
||||
$qry.=' ORDER BY delta LIMIT 1';
|
||||
$qry.=' ORDER BY delta, start LIMIT 1';
|
||||
|
||||
if(!$this->db_query($qry))
|
||||
{
|
||||
@@ -573,7 +573,7 @@ class studiensemester extends basis_db
|
||||
{
|
||||
$qry = "SELECT studiensemester_kurzbz, start, ende FROM public.vw_studiensemester
|
||||
WHERE studiensemester_kurzbz<>".$this->db_add_param($studiensemester_kurzbz)."
|
||||
ORDER BY delta LIMIT 1";
|
||||
ORDER BY delta, start LIMIT 1";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
@@ -907,13 +907,13 @@ class studiensemester extends basis_db
|
||||
ORDER BY ende ASC";
|
||||
if ($plus != '')
|
||||
$qry .= " LIMIT ".$this->db_add_param($plus, FHC_INTEGER);
|
||||
|
||||
|
||||
$qry .= ") UNION
|
||||
(SELECT studiensemester_kurzbz FROM public.tbl_studiensemester WHERE start <= now()
|
||||
ORDER BY start DESC ";
|
||||
if ($minus != '')
|
||||
$qry .= " LIMIT ".$this->db_add_param($minus, FHC_INTEGER);
|
||||
|
||||
|
||||
$qry .= ")) ORDER BY ".$order;
|
||||
|
||||
if($this->db_query($qry))
|
||||
@@ -967,7 +967,7 @@ class studiensemester extends basis_db
|
||||
FROM tbl_studiensemester
|
||||
) a
|
||||
WHERE a.studiensemester_kurzbz!=".$this->db_add_param($studiensemester_kurzbz)."
|
||||
ORDER BY delta LIMIT 1";
|
||||
ORDER BY delta, start LIMIT 1";
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
@@ -1029,7 +1029,7 @@ class studiensemester extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gibt das Wintersemester eines Studienjahres zurück (zb WS2017)
|
||||
*
|
||||
@@ -1040,10 +1040,10 @@ class studiensemester extends basis_db
|
||||
{
|
||||
$qry = "
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM tbl_studiensemester
|
||||
FROM tbl_studiensemester
|
||||
WHERE studienjahr_kurzbz LIKE " . $this->db_add_param($studienjahr_kurzbz) . "
|
||||
AND studiensemester_kurzbz LIKE 'WS%';";
|
||||
|
||||
|
||||
if ($result = $this->db_query($qry))
|
||||
{
|
||||
if ($row = $this->db_fetch_object())
|
||||
@@ -1063,7 +1063,7 @@ class studiensemester extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gibt das Sommersemester eines Studienjahres zurück (zb SS2018)
|
||||
*
|
||||
@@ -1074,10 +1074,10 @@ class studiensemester extends basis_db
|
||||
{
|
||||
$qry = "
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM tbl_studiensemester
|
||||
FROM tbl_studiensemester
|
||||
WHERE studienjahr_kurzbz LIKE " . $this->db_add_param($studienjahr_kurzbz) . "
|
||||
AND studiensemester_kurzbz LIKE 'SS%';";
|
||||
|
||||
|
||||
if ($result = $this->db_query($qry))
|
||||
{
|
||||
if ($row = $this->db_fetch_object())
|
||||
@@ -1097,7 +1097,7 @@ class studiensemester extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gibt die Studiensemester zwischen $studiensemesterStart und $studiensemesterEnde zurück
|
||||
* Wenn $inklusive true ist (default), werden auch $studiensemesterStart und $studiensemesterEnde selbst zurückgegeben
|
||||
@@ -1116,7 +1116,7 @@ class studiensemester extends basis_db
|
||||
}
|
||||
if ($inklusive = true)
|
||||
$equalSign = '=';
|
||||
else
|
||||
else
|
||||
$equalSign = '';
|
||||
$qry = "
|
||||
SELECT *
|
||||
@@ -1132,13 +1132,13 @@ class studiensemester extends basis_db
|
||||
WHERE studiensemester_kurzbz = " . $this->db_add_param($studiensemesterEnde) . "
|
||||
)
|
||||
ORDER BY start DESC;";
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$stsem_obj = new studiensemester();
|
||||
|
||||
|
||||
$stsem_obj->studiensemester_kurzbz = $row->studiensemester_kurzbz;
|
||||
$stsem_obj->start = $row->start;
|
||||
$stsem_obj->ende = $row->ende;
|
||||
@@ -1146,7 +1146,7 @@ class studiensemester extends basis_db
|
||||
$stsem_obj->studienjahr_kurzbz = $row->studienjahr_kurzbz;
|
||||
$stsem_obj->beschreibung = $row->beschreibung;
|
||||
$stsem_obj->onlinebewerbung = $row->onlinebewerbung;
|
||||
|
||||
|
||||
$this->studiensemester[] = $stsem_obj;
|
||||
}
|
||||
return true;
|
||||
@@ -1158,4 +1158,4 @@ class studiensemester extends basis_db
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -46,7 +46,12 @@ $(document).ready(function ()
|
||||
{
|
||||
tinymce.init({
|
||||
selector: "#bodyTextArea",
|
||||
plugins: "autoresize"
|
||||
plugins: "autoresize",
|
||||
autoresize_on_init: false,
|
||||
autoresize_min_height: 400,
|
||||
autoresize_max_height: 400,
|
||||
autoresize_bottom_margin: 10,
|
||||
auto_focus: "bodyTextArea"
|
||||
});
|
||||
|
||||
tinymce.init({
|
||||
@@ -73,6 +78,21 @@ $(document).ready(function ()
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#user_fields"))
|
||||
{
|
||||
$("#user_fields").dblclick(function ()
|
||||
{
|
||||
if ($("#bodyTextArea"))
|
||||
{
|
||||
//if editor active add at cursor position, otherwise at end
|
||||
if (tinymce.activeEditor.id === "bodyTextArea")
|
||||
tinymce.activeEditor.execCommand('mceInsertContent', false, $(this).children(":selected").val());
|
||||
else
|
||||
tinyMCE.get("bodyTextArea").setContent(tinyMCE.get("bodyTextArea").getContent() + $(this).children(":selected").val());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($("#recipients"))
|
||||
{
|
||||
$("#recipients").change(tinymcePreviewSetContent);
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
require_once('../config/vilesci.config.inc.php');
|
||||
require_once('../include/basis_db.class.php');
|
||||
require_once('../include/rdf.class.php');
|
||||
require_once('../include/datum.class.php');
|
||||
require_once('../include/functions.inc.php');
|
||||
require_once('../include/benutzerberechtigung.class.php');
|
||||
|
||||
$uid = get_uid();
|
||||
$datum_obj = new datum();
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($uid);
|
||||
if(!$rechte->isBerechtigt('basis/message', null, 's'))
|
||||
@@ -50,7 +52,8 @@ SELECT
|
||||
(SELECT COALESCE(titelpre,'') || ' ' || COALESCE(vorname,'') || ' ' || COALESCE(nachname,'') || ' ' || COALESCE(titelpost,'') FROM public.tbl_person WHERE person_id = r.person_id) as recipient,
|
||||
m.person_id as sender_id,
|
||||
r.person_id as recipient_id,
|
||||
MAX(ss.status) as status
|
||||
MAX(ss.status) as status,
|
||||
MAX(ss.insertamum) as statusdatum
|
||||
FROM public.tbl_msg_message m
|
||||
JOIN public.tbl_msg_recipient r USING(message_id)
|
||||
JOIN public.tbl_msg_status ss ON(r.message_id = ss.message_id AND ss.person_id = r.person_id)
|
||||
@@ -67,7 +70,8 @@ SELECT
|
||||
(SELECT COALESCE(titelpre,'') || ' ' || COALESCE(vorname,'') || ' ' || COALESCE(nachname,'') || ' ' || COALESCE(titelpost,'') FROM public.tbl_person WHERE person_id = r.person_id) as recipient,
|
||||
m.person_id as sender_id,
|
||||
r.person_id as recipient_id,
|
||||
MAX(ss.status) as status
|
||||
MAX(ss.status) as status,
|
||||
MAX(ss.insertamum) as statusdatum
|
||||
FROM public.tbl_msg_recipient r
|
||||
JOIN public.tbl_msg_status ss USING(message_id, person_id)
|
||||
JOIN public.tbl_msg_message m USING(message_id)
|
||||
@@ -104,6 +108,7 @@ if($db->db_query($qry))
|
||||
$oRdf->obj[$i]->setAttribut('message_id',$row->message_id,true);
|
||||
$oRdf->obj[$i]->setAttribut('insertamum',$row->insertamum,true);
|
||||
$oRdf->obj[$i]->setAttribut('status',$status,true);
|
||||
$oRdf->obj[$i]->setAttribut('statusdatum',$datum_obj->formatDatum($row->statusdatum,'d.m.Y H:i'),true);
|
||||
$oRdf->obj[$i]->setAttribut('sender',$row->sender,true);
|
||||
$oRdf->obj[$i]->setAttribut('recipient',$row->recipient,true);
|
||||
$oRdf->obj[$i]->setAttribut('sender_id',$row->sender_id,true);
|
||||
|
||||
@@ -196,6 +196,43 @@ if(!$result = @$db->db_query("SELECT 1 FROM public.vw_msg_vars_person LIMIT 1"))
|
||||
echo '<br>Granted privileges to <strong>vilesci</strong> on public.vw_msg_vars_person';
|
||||
}
|
||||
|
||||
// CREATE OR REPLACE VIEW public.vw_msg_vars_user and grants privileges
|
||||
if(!$result = @$db->db_query("SELECT 1 FROM public.vw_msg_vars_user LIMIT 1"))
|
||||
{
|
||||
$qry = '
|
||||
CREATE OR REPLACE VIEW public.vw_msg_vars_user AS (
|
||||
SELECT DISTINCT ON
|
||||
(b.uid) b.uid AS "my_uid",
|
||||
p.vorname AS "my_vorname",
|
||||
p.nachname AS "my_nachname",
|
||||
COALESCE(b.alias, b.uid) AS "my_alias",
|
||||
ma.telefonklappe AS "my_durchwahl"
|
||||
FROM public.tbl_person p
|
||||
JOIN public.tbl_benutzer b USING (person_id)
|
||||
JOIN public.tbl_mitarbeiter ma ON ma.mitarbeiter_uid = b.uid
|
||||
WHERE ma.personalnummer > 0
|
||||
);';
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.vw_msg_vars_user: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>public.vw_msg_vars_user view created';
|
||||
|
||||
$qry = 'GRANT SELECT ON TABLE public.vw_msg_vars_user TO web;';
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.vw_msg_vars_user: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>web</strong> on public.vw_msg_vars_user';
|
||||
|
||||
$qry = 'GRANT SELECT ON TABLE public.vw_msg_vars_user TO vilesci;';
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.vw_msg_vars_user: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>vilesci</strong> on public.vw_msg_vars_user';
|
||||
}
|
||||
|
||||
//Spalte anmerkung und rechnungsadresse in tbl_adresse
|
||||
if(!$result = @$db->db_query("SELECT rechnungsadresse FROM public.tbl_adresse LIMIT 1"))
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ $filters = array(
|
||||
"columns": [
|
||||
{"name": "Vorname"},
|
||||
{"name": "Nachname"},
|
||||
{"name": "Nation"},
|
||||
{"name": "ZGVNation"},
|
||||
{"name": "StgAbgeschickt"},
|
||||
{"name": "Studiensemester"},
|
||||
{"name": "LastAction"},
|
||||
@@ -65,7 +65,7 @@ $filters = array(
|
||||
"columns": [
|
||||
{"name": "Vorname"},
|
||||
{"name": "Nachname"},
|
||||
{"name": "Nation"},
|
||||
{"name": "ZGVNation"},
|
||||
{"name": "StgAbgeschickt"},
|
||||
{"name": "Studiensemester"},
|
||||
{"name": "LastAction"},
|
||||
@@ -104,7 +104,7 @@ $filters = array(
|
||||
"columns": [
|
||||
{"name": "Vorname"},
|
||||
{"name": "Nachname"},
|
||||
{"name": "Nation"},
|
||||
{"name": "ZGVNation"},
|
||||
{"name": "LastAction"},
|
||||
{"name": "LastActionType"},
|
||||
{"name": "User/Operator"},
|
||||
@@ -139,7 +139,7 @@ $filters = array(
|
||||
"columns": [
|
||||
{"name": "Vorname"},
|
||||
{"name": "Nachname"},
|
||||
{"name": "Nation"},
|
||||
{"name": "ZGVNation"},
|
||||
{"name": "LastAction"},
|
||||
{"name": "User/Operator"},
|
||||
{"name": "LockUser"},
|
||||
@@ -179,7 +179,7 @@ $filters = array(
|
||||
"columns": [
|
||||
{"name": "Vorname"},
|
||||
{"name": "Nachname"},
|
||||
{"name": "Nation"},
|
||||
{"name": "ZGVNation"},
|
||||
{"name": "StgAbgeschickt"},
|
||||
{"name": "Studiensemester"},
|
||||
{"name": "LastAction"},
|
||||
@@ -217,7 +217,7 @@ $filters = array(
|
||||
"columns": [
|
||||
{"name": "Vorname"},
|
||||
{"name": "Nachname"},
|
||||
{"name": "Nation"},
|
||||
{"name": "ZGVNation"},
|
||||
{"name": "LastAction"},
|
||||
{"name": "User/Operator"},
|
||||
{"name": "LockUser"},
|
||||
|
||||
@@ -7949,6 +7949,26 @@ Any unusual occurrences
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'meineFelder',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Meine Felder',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'My fields',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
|
||||
@@ -359,8 +359,46 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<head>
|
||||
<title>BIS - Meldung Student - ('.$stg_kz.')</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link href="../../skin/vilesci.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<link href="../../skin/vilesci.css" rel="stylesheet" type="text/css">';
|
||||
|
||||
include('../../include/meta/jquery.php');
|
||||
include('../../include/meta/jquery-tablesorter.php');
|
||||
|
||||
echo ' </head>
|
||||
<style>
|
||||
#t1, #t2
|
||||
{
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#t1").tablesorter(
|
||||
{
|
||||
sortList: [[6,1],[5,1],[4,1],[2,0],[3,0]],
|
||||
widgets: ["zebra", "filter", "stickyHeaders"],
|
||||
widgetOptions : { filter_functions:
|
||||
{
|
||||
// Add select menu to this column
|
||||
4 : {
|
||||
"Abbrecher" : function(e, n, f, i, $r, c, data) { return /Abbrecher/.test(e); },
|
||||
"Absolvent" : function(e, n, f, i, $r, c, data) { return /Absolvent/.test(e); },
|
||||
"Diplomand" : function(e, n, f, i, $r, c, data) { return /Diplomand/.test(e); },
|
||||
"Incoming" : function(e, n, f, i, $r, c, data) { return /Incoming/.test(e); },
|
||||
"Student" : function(e, n, f, i, $r, c, data) { return /Student/.test(e); },
|
||||
"Unterbrecher" : function(e, n, f, i, $r, c, data) { return /Unterbrecher/.test(e); },
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#t2").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0]],
|
||||
widgets: ["zebra", "filter", "stickyHeaders"]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<body>';
|
||||
if ($rechte->isBerechtigt('admin'))
|
||||
{
|
||||
@@ -570,7 +608,8 @@ if(file_exists($eee))
|
||||
echo '<a href="'.$eee.'">BIS-Meldeübersicht der BIS-Meldung Stg '.$stg_kz.'</a><br><br>';
|
||||
}
|
||||
|
||||
echo '<table border=1>
|
||||
echo '<table id="t1" class="tablesorter">
|
||||
<thead>
|
||||
<tr align=center>
|
||||
<th>UID</th>
|
||||
<th>PersKZ</th>
|
||||
@@ -580,16 +619,25 @@ echo '<table border=1>
|
||||
<th>Semester</th>
|
||||
<th>Orgform</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
',$stlist,'
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
echo '<br>Bewerberübersicht';
|
||||
echo '<table border=1>
|
||||
echo '<table id="t2" class="tablesorter">
|
||||
<thead>
|
||||
<tr align=center>
|
||||
<th>Nachname</th>
|
||||
<th>Vorname</th>
|
||||
<th>Orgform</th>
|
||||
<th>Geschlecht</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
',$bwlist,'
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
echo '</body></html>';
|
||||
|
||||
Reference in New Issue
Block a user