Compare commits

..
Author SHA1 Message Date
Paolo 92e30e02da Merge branch 'master' into feature-68684/PHPMailer 2026-09-30 13:58:34 +02:00
Paolo 181a80ddd4 Merge branch 'master' into feature-68684/PHPMailer 2026-09-10 13:16:50 +02:00
Paolo 3733d644eb Merge branch 'master' into feature-68684/PHPMailer 2026-07-09 10:50:32 +02:00
Paolo 8de260816f Merge branch 'master' into feature-68684/PHPMailer 2026-04-27 12:58:21 +02:00
Paolo 6cf24065b2 Merge branch 'master' into feature-68684/PHPMailer 2026-03-24 09:43:48 +01:00
Paolo f21d5a87b1 - Adapted legacy include/mail.class.php to use PHPMailer
- application/libraries/MailLib.php now set the default encoding to UTF-8
2026-03-12 14:04:24 +01:00
Paolo d33f04f3ad Merge branch 'master' into feature-68684/PHPMailer 2026-02-23 12:26:08 +01:00
Paolo 9bba8ebb15 Merge branch 'master' into feature-68684/PHPMailer 2026-02-09 12:29:16 +01:00
Paolo 0ccef1ee65 Merge branch 'master' into feature-68684/PHPMailer 2026-01-13 17:08:41 +01:00
Paolo 34dca18a46 - Added PHPMailer to composer
- Changed application/libraries/MailLib.php to use PHPMailer
- Changed application/config/mail.php to be used by MailLib + PHPMailer
2025-12-18 13:14:48 +01:00
52 changed files with 570 additions and 1402 deletions
+15 -17
View File
@@ -4,34 +4,31 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
// Define configuration parameters
$config['email_number_to_sent'] = 1000; // Number of emails to sent each time sendAll is called
$config['email_number_per_time_range'] = 1; // Number of emails to sent before pause
$config['email_number_per_time_range'] = 882; // Number of emails to sent before pause
$config['email_time_range'] = 1; // Length of the pause in seconds
$config['email_from_system'] = '[email protected]';
$config['alias_from_system'] = 'No Reply';
// Smtp: if the CI email library has to connect to a smtp server
// Mail: if the system is setup to send emails with the standard php mail function
// Sendmail: if the system is setup to send email via Sendmail (or similar)
$config['protocol'] = ''; // mail, sendmail, or smtp
// If protocol is set to sendmail
$config['mailpath'] = ''; // SThe server path to Sendmail (or similar)
// If protocol is set to smtp
$config['smtp_host'] = 'localhost'; // SMTP Server Address
$config['smtp_port'] = 25;
$config['smtp_timeout'] = 5; // in seconds
$config['smtp_timeout'] = 1; // in seconds
$config['smtp_keepalive'] = false; // Enable persistent SMTP connections
$config['smtp_auth'] = false;
$config['smtp_user'] = '';
$config['smtp_pass'] = '';
$config['wordwrap'] = true; // {unwrap}http://example.com/a_long_link_that_should_not_be_wrapped.html{/unwrap}
$config['wrapchars'] = 76; // Character count to wrap at.
$config['mailtype'] = 'html'; // html or text
$config['priority'] = 3; // Email Priority. 1 = highest. 5 = lowest. 3 = normal
$config['validate'] = false; // If true then the email address will be validated
$config['smtp_encryption'] = ''; // '', 'tls' or 'ssl'
$config['wordwrap'] = 76;
$config['is_html'] = true; // html or text
$config['priority'] = 3; // 1 = High, 3 = Normal, 5 = low. When null, the header is not set at all.
// If enabled will be logged info about emails in Codeigniter error logs
$config['enable_debug'] = false;
// If enabled will be logged info about emails
// 0: Disable debugging (you can also leave this out completely, 0 is the default).
// 1: Output messages sent by the client.
// 2: as 1, plus responses received from the server (this is the most useful setting).
// 3: as 2, plus more information about the initial connection - this level can help diagnose STARTTLS failures.
// 4: as 3, plus even lower-level information, very verbose, don't use for debugging SMTP, only low-level problems.
$config['enable_debug'] = 0;
// default sender
$config['sancho_mail_default_sender'] = defined('SANCHO_MAIL_DEFAULT_SENDER') ? SANCHO_MAIL_DEFAULT_SENDER : '';
@@ -47,3 +44,4 @@ $config['sancho_mail_header_img'] = defined('SANCHO_MAIL_HEADER_IMG') ? SANCHO_M
// footer image for custom mails
$config['sancho_mail_footer_img'] = defined('SANCHO_MAIL_FOOTER_IMG') ? SANCHO_MAIL_FOOTER_IMG : '';
+2 -8
View File
@@ -129,19 +129,13 @@ $route['api/frontend/v1/treemenudata/stv/.*'] = 'api/frontend/v1/stv/students/in
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/semester/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/semester/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3/$4';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/semester/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3/$4';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStgOrgform/$1/$2/$3';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/stg/(:any)/orgform/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByStg/$1/$2/$3';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)/stg/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2/$3';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/emp/(:any)/stg/(:any)/.*'] = 'api/frontend/v1/Lehrveranstaltung/getByEmp/$1/$2/$3';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/le/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByLe/$1/$2';
$route['api/frontend/v1/treemenudata/lvverwaltung/stdsem/(:any)/lv/(:any)'] = 'api/frontend/v1/Lehrveranstaltung/getByLv/$1/$2';
// load routes from extensions, also look for environment-specific configs
$subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT . '/extensions'];
+2 -3
View File
@@ -26,8 +26,7 @@ $config['root'] = [
'verband' => [
'group'
]
]
],
'orgform'
]
];
$config['root']['stg']['orgform'] = $config['root']['stg'];
@@ -1916,7 +1916,7 @@ class Abgabe extends FHCAPI_Controller
if (!$mailres)
{
$this->terminateWithError($this->p->t('abgabetool', 'c4fehlerMailZweitBegutachterv2'), 'general');
$this->terminateWithError($this->p->t('abgabetool', 'c4fehlerMailBegutachterv2'), 'general');
}
}
@@ -28,10 +28,7 @@ class Lehrveranstaltung extends FHCAPI_Controller
{
parent::__construct([
'getByEmp' => ['admin:r', 'assistenz:r'],
'getByLe' => ['admin:r', 'assistenz:r'],
'getByLv' => ['admin:r', 'assistenz:r'],
'getByStg' => ['admin:r', 'assistenz:r'],
'getByStgOrgform' => ['admin:r', 'assistenz:r'],
'loadByLV' => ['admin:r', 'assistenz:r'],
]);
@@ -80,117 +77,41 @@ class Lehrveranstaltung extends FHCAPI_Controller
$this->terminateWithSuccess($tree);
}
public function getByLe($studiensemester_kurzbz = null, $lehreinheit_id = null)
{
if (is_null($lehreinheit_id))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
$lehreinheiten = $this->_ci->LehreinheitModel->getByLeStudiensemester($lehreinheit_id, $studiensemester_kurzbz);
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
$this->terminateWithSuccess($lehreinheiten_data);
}
public function getByLv($studiensemester_kurzbz = null, $lehrveranstaltung_id = null)
{
if (is_null($lehrveranstaltung_id))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
$tree = [];
$this->_ci->LehrveranstaltungModel->addSelect('studiengang_kz');
$lv = $this->_ci->LehrveranstaltungModel->load($lehrveranstaltung_id);
$lv = $this->getDataOrTerminateWithError($lv);
if (empty($lv))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$lehrveranstaltungen_data = array();
foreach ($this->_loadLvRows(current($lv)->studiengang_kz, $studiensemester_kurzbz) as $row)
{
if ((string)$row->lehrveranstaltung_id === (string)$lehrveranstaltung_id)
{
$lehrveranstaltungen_data[] = $row;
break;
}
}
if (empty($lehrveranstaltungen_data))
{
$this->_ci->LehrveranstaltungModel->addSelect('
tbl_lehrveranstaltung.*,
tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
lehrveranstaltung_id,
lehrtyp_kurzbz,
studiengang_kz as lv_studiengang_kz,
UPPER(CONCAT(tbl_studiengang.typ, tbl_studiengang.kurzbz)) as studiengang,
semester as semester,
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
ects as lv_ects,
lehreverzeichnis as lv_lehreverzeichnis,
planfaktor as lv_planfaktor,
planlektoren as lv_planlektoren,
planpersonalkosten as lv_planpersonalkosten,
plankostenprolektor as lv_plankostenprolektor,
tbl_lehrveranstaltung.orgform_kurzbz as orgform_kurzbz,
tbl_lehrveranstaltung.sprache as sprache,
lehrform_kurzbz as lv_lehrform_kurzbz,
tbl_lehrveranstaltung.bezeichnung_english as lv_bezeichnung_english,
semesterstunden as lv_semesterstunden,
');
$this->_ci->LehrveranstaltungModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
$lehrveranstaltungen = $this->_ci->LehrveranstaltungModel->load($lehrveranstaltung_id);
$lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
}
foreach ($lehrveranstaltungen_data as $lehrveranstaltung)
{
$lehreinheiten = $this->_ci->LehreinheitModel->getByLvidStudiensemester($lehrveranstaltung->lehrveranstaltung_id, $studiensemester_kurzbz);
$lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
if (!isset($lehrveranstaltung->_children))
{
$lehrveranstaltung->_children = $lehreinheiten_data;
}
$tree[] = $lehrveranstaltung;
}
$counter = 0;
$this->assignUniqueIndex($tree, $counter);
$this->terminateWithSuccess($tree);
}
public function getByStg($studiensemester_kurzbz = null, $stg_kz = null, $semester = null)
{
$this->_getLvTree($studiensemester_kurzbz, $stg_kz, $semester, null);
}
public function getByStgOrgform($studiensemester_kurzbz = null, $stg_kz = null, $orgform = null, $semester = null)
{
$orgform_kurzbz = $this->getOrgformKurzbz($orgform);
$this->_getLvTree($studiensemester_kurzbz, $stg_kz, $semester, $orgform_kurzbz);
}
private function _getLvTree($studiensemester_kurzbz, $stg_kz, $semester, $orgform_kurzbz)
{
$studiengang_kz = $this->getStudiengangKz($stg_kz);
if (is_null($studiengang_kz) || !preg_match("/^(-?[1-9][0-9]*|0)$/", (string)$studiengang_kz))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
if (!is_null($semester) && !ctype_digit((string)$semester))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$verband = null;
if (!is_null($semester) && !is_numeric($semester))
{
$verband = $this->getOrgformKurzbz($semester);
$semester = null;
}
$this->_ci->load->model('organisation/Studienplan_model', 'StudienplanModel');
$studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
$studienplan_data = $this->_ci->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
$lehrveranstaltungen_data = $this->_loadLvRows($studiengang_kz, $studiensemester_kurzbz, $semester, $orgform_kurzbz);
$studienplan_ids = array();
$only_ids = array();
$placeholders = array();
if (hasData($studienplan_data))
{
foreach (getData($studienplan_data) as $studienplan) {
$placeholders[] = "(?, ?)";
$studienplan_ids[] = $studienplan->studienplan_id;
$studienplan_ids[] = $studienplan->semester;
$only_ids[] = $studienplan->studienplan_id;
}
}
$lehrveranstaltungen_data = $this->_ci->LehrveranstaltungModel->getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
$lehrveranstaltungen_data = hasData($lehrveranstaltungen_data) ? getData($lehrveranstaltungen_data) : array();
$tree = [];
foreach ($lehrveranstaltungen_data as $row)
@@ -323,31 +244,6 @@ class Lehrveranstaltung extends FHCAPI_Controller
$this->LehreinheitModel->getLvsByFachbereich($fachbereich, $studiensemester_kurzbz, $mitarbeiter_uid);
}*/
private function _loadLvRows($studiengang_kz, $studiensemester_kurzbz, $semester = null, $orgform_kurzbz = null)
{
$this->_ci->load->model('organisation/Studienplan_model', 'StudienplanModel');
$studienplan_data = $this->_ci->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $semester, $orgform_kurzbz);
$studienplan_ids = array();
$only_ids = array();
$placeholders = array();
if (hasData($studienplan_data))
{
foreach (getData($studienplan_data) as $studienplan) {
$placeholders[] = "(?, ?)";
$studienplan_ids[] = $studienplan->studienplan_id;
$studienplan_ids[] = $studienplan->semester;
$only_ids[] = $studienplan->studienplan_id;
}
}
$lehrveranstaltungen_data = $this->_ci->LehrveranstaltungModel->getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester, $orgform_kurzbz);
return hasData($lehrveranstaltungen_data) ? getData($lehrveranstaltungen_data) : array();
}
private function _setAuthUID()
{
$this->_uid = getAuthUID();
@@ -413,8 +309,8 @@ class Lehrveranstaltung extends FHCAPI_Controller
$data = $this->getDataOrTerminateWithError($result);
if (!$data)
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
return $orgform_kurzbz;
return current($data)->orgform_kurzbz;
}
}
}
@@ -101,9 +101,6 @@ class Widget extends FHCAPI_Controller
$tmpsetup = json_decode($widget->setup);
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
$widget->setup = $tmpsetup;
$widget->permitted = empty($widget->berechtigung_kurzbz)
|| $this->permissionlib->isBerechtigt($widget->berechtigung_kurzbz);
return $widget;
}, $widgets);
@@ -28,8 +28,7 @@ class Studiensemester extends FHCAPI_Controller
'getStudienjahrByStudiensemester' => self::PERM_LOGGED,
'getAllStudiensemesterAndAktOrNext' => self::PERM_LOGGED,
'current' => self::PERM_LOGGED,
'set' => self::PERM_LOGGED,
'getContainingOrNearestByDateRange' => self::PERM_LOGGED,
'set' => self::PERM_LOGGED
)
);
// Load model StudiensemesterModel
@@ -204,15 +203,4 @@ class Studiensemester extends FHCAPI_Controller
$this->terminateWithSuccess(true);
}
public function getContainingOrNearestByDateRange()
{
$from = $this->input->get("from");
$to = $this->input->get("to");
$result = $this->StudiensemesterModel->getContainingOrNearestByDateRange($from, $to);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
}
@@ -574,19 +574,6 @@ class Kontakt extends FHCAPI_Controller
$person_id = $this->input->post('person_id');
$standort_id = $this->input->post('standort_id');
//check person_id: allow editing only of persons who are no mitarbeiter
if($person_id)
{
$this->load->model('person/Benutzer_model', 'BenutzerModel');
$this->BenutzerModel->addJoin('public.tbl_mitarbeiter ma', 'ON (ma.mitarbeiter_uid = public.tbl_benutzer.uid)');
$result = $this->BenutzerModel->loadWhere([
'person_id' => $person_id
]);
if(hasData($result))
return $this->terminateWithError($this->p->t('ui', 'editingMitarbeiterPVonly'), self::ERROR_TYPE_GENERAL);
}
$result = $this->KontaktModel->update(
[
'kontakt_id' => $kontakt_id
+20 -41
View File
@@ -35,41 +35,20 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
* @param string $bcc Sets BCC of mail.
* @return void
*/
function sendSanchoMail(
$vorlage_kurzbz,
$vorlage_data,
$to,
$subject,
$headerImg = '',
$footerImg = '',
$from = null,
$cc = null,
$bcc = null
)
function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = '', $footerImg = '', $from = null, $cc = null, $bcc = null)
{
$ci =& get_instance();
$ci->load->library('email');
$ci->load->library('MailLib');
$embeddedImages = array();
$_from = 'noreply@' . DOMAIN;
$sancho_mail_config = $ci->config->item('mail');
if ($from == '')
if ($from == null && isset($sancho_mail_config['sancho_mail_default_sender']) && $sancho_mail_config['sancho_mail_default_sender'])
{
$from = ((isset($sancho_mail_config['sancho_mail_default_sender'])
&& $sancho_mail_config['sancho_mail_default_sender'])
? $sancho_mail_config['sancho_mail_default_sender']
: 'noreply')
. '@' . DOMAIN;
$_from = $sancho_mail_config['sancho_mail_default_sender'] . '@' . DOMAIN;
}
// Embed sancho header and footer image
// reset important to ensure embedding of images when called in a loop
$ci->email->clear(true); // clear vars and attachments
$cid_header = '';
$cid_footer = '';
if (isset($sancho_mail_config['sancho_mail_use_images']) && $sancho_mail_config['sancho_mail_use_images'])
{
$sanchoHeader_img = '';
@@ -111,29 +90,27 @@ function sendSanchoMail(
}
}
// attach header and footer
$ci->email->attach($sanchoHeader_img, 'inline');
$ci->email->attach($sanchoFooter_img, 'inline');
$cid_header = $ci->email->attachment_cid($sanchoHeader_img); // sets unique content id for embedding
$cid_footer = $ci->email->attachment_cid($sanchoFooter_img); // sets unique content id for embedding
// Attach header and footer
$embeddedImages[] = array('file_name' => $sanchoHeader_img, 'cid' => 'sancho_header');
$embeddedImages[] = array('file_name' => $sanchoFooter_img, 'cid' => 'sancho_footer');
}
// Set specific mail content into specific content template
$content = _parseMailContent($vorlage_kurzbz, $vorlage_data);
// overall main content data array
$layout = array(
'CID_header' => $cid_header,
'CID_footer' => $cid_footer,
'content' => $content
);
// Set overall main content into the sancho mail template
$body = _parseMailContent('Sancho_Mail_Template', $layout);
$body = _parseMailContent(
'Sancho_Mail_Template',
array(
'CID_header' => 'sancho_header',
'CID_footer' => 'sancho_footer',
'content' => $content
)
);
// Send mail
return $ci->maillib->send(
$from,
$_from,
$to,
$subject,
$body,
@@ -142,7 +119,8 @@ function sendSanchoMail(
$bcc,
'', // altMessage
true, // bulk
true // autogenerated
true, // autogenerated
$embeddedImages
);
}
@@ -171,3 +149,4 @@ function _parseMailContent($vorlage_kurzbz, $vorlage_data)
}
}
}
+126 -83
View File
@@ -2,6 +2,10 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
/**
* Library to manage the sending of the email
*/
@@ -9,7 +13,7 @@ class MailLib
{
const ENABLE_DEBUG = 'enable_debug';
private $sended; // Sended email counter
private $_sended; // Sended email counter
// Properties for storing the configuration
private $email_number_to_sent;
@@ -18,6 +22,7 @@ class MailLib
private $email_from_system;
private $_ci; // Codeigniter instance
private $_mail; // PHPMailer instance
/**
* Class constructor
@@ -25,7 +30,7 @@ class MailLib
public function __construct()
{
// Set the counter to 0
$this->sended = 0;
$this->_sended = 0;
// Get CI instance
$this->_ci =& get_instance();
@@ -33,97 +38,135 @@ class MailLib
// The second parameter is used to avoiding name collisions in the config array
$this->_ci->config->load('mail', true);
// CI Email library
$this->_ci->load->library('email');
try
{
// PHPMailer configuration
$this->_mail = new PHPMailer(true);
$this->_mail->isSMTP(); // Send using SMTP
$this->_mail->Host = $this->_getEmailCfgItem('smtp_host'); // Set the SMTP server to send through
$this->_mail->Port = $this->_getEmailCfgItem('smtp_port'); // TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
$this->_mail->SMTPAuth = $this->_getEmailCfgItem('smtp_auth'); // Enable SMTP authentication
$this->_mail->Username = $this->_getEmailCfgItem('smtp_user'); // SMTP username
$this->_mail->Password = $this->_getEmailCfgItem('smtp_pass'); // SMTP password
$this->_mail->SMTPSecure = $this->_getEmailCfgItem('smtp_encryption'); // Enable implicit TLS encryption
$this->_mail->Timeout = $this->_getEmailCfgItem('smtp_timeout'); // set the timeout (seconds)
$this->_mail->SMTPKeepAlive = $this->_getEmailCfgItem('smtp_keepalive'); // Persistent SMTP connection
$this->_mail->Priority = $this->_getEmailCfgItem('priority'); // 1 = High, 3 = Normal, 5 = low. When null, the header is not set at all.
$this->_mail->WordWrap = $this->_getEmailCfgItem('wordwrap');
$this->_mail->isHTML($this->_getEmailCfgItem('is_html')); // html or text
$this->_mail->SMTPDebug = $this->_getEmailCfgItem('enable_debug');
$this->_mail->CharSet = 'UTF-8';
// Initializing email library with the loaded configurations
$this->_ci->email->initialize($this->_ci->config->config['mail']);
// Set the configuration properties with the standard configuration values
$this->email_number_to_sent = $this->getEmailCfgItem('email_number_to_sent');
$this->email_number_per_time_range = $this->getEmailCfgItem('email_number_per_time_range');
$this->email_time_range = $this->getEmailCfgItem('email_time_range');
$this->email_from_system = $this->getEmailCfgItem('email_from_system');
$this->alias_from_system = $this->getEmailCfgItem('alias_from_system');
// Set the configuration properties with the standard configuration values
$this->email_number_to_sent = $this->_getEmailCfgItem('email_number_to_sent');
$this->email_number_per_time_range = $this->_getEmailCfgItem('email_number_per_time_range');
$this->email_time_range = $this->_getEmailCfgItem('email_time_range');
$this->email_from_system = $this->_getEmailCfgItem('email_from_system');
$this->alias_from_system = $this->_getEmailCfgItem('alias_from_system');
}
catch(Exception $e)
{
error_log($e->errorMessage());
}
}
/**
* Sends a single email
*/
public function send($from, $to, $subject, $message, $alias = '', $cc = null, $bcc = null, $altMessage = '', $bulk = false, $autogenerated = false)
public function send($from, $to, $subject, $message, $alias = '', $cc = null, $bcc = null, $altMessage = '', $bulk = false, $autogenerated = false, $embeddedImages = array())
{
// If it is configured then log mail info into the CI error logs
if ($this->getEmailCfgItem(self::ENABLE_DEBUG) === true)
{
$this->_ci->load->library('LogLib'); // Loads logging library
$result = false;
// Log them all!
$this->_ci->loglib->logError('From: '.$from);
$this->_ci->loglib->logError('To: '.$to);
$this->_ci->loglib->logError('Subject: '.$subject);
$this->_ci->loglib->logError('Message: '.$message);
$this->_ci->loglib->logError('Alias: '.$alias);
$this->_ci->loglib->logError('CC: '.$cc);
$this->_ci->loglib->logError('BCC: '.$bcc);
$this->_ci->loglib->logError('Alternative message: '.$altMessage);
}
// If from is not specified then use the standard one
if (is_null($from) || $from == '')
try
{
$from = $this->email_from_system;
// If alias is not specified then use the standard one
if (is_null($alias) || $alias == '')
// If it is configured then log mail info into the CI error logs
if ($this->_getEmailCfgItem(self::ENABLE_DEBUG) === true)
{
$alias = $this->alias_from_system;
$this->_ci->load->library('LogLib'); // Loads logging library
// Log them all!
$this->_ci->loglib->logError('From: '.$from);
$this->_ci->loglib->logError('To: '.$to);
$this->_ci->loglib->logError('Subject: '.$subject);
$this->_ci->loglib->logError('Message: '.$message);
$this->_ci->loglib->logError('Alias: '.$alias);
$this->_ci->loglib->logError('CC: '.$cc);
$this->_ci->loglib->logError('BCC: '.$bcc);
$this->_ci->loglib->logError('Alternative message: '.$altMessage);
}
}
if (defined('MAIL_FROM') && MAIL_FROM != '')
{
$from = MAIL_FROM;
if (is_null($alias) || $alias == '')
// If from is not specified then use the standard one
if (is_null($from) || $from == '')
{
$alias = $this->alias_from_system;
$from = $this->email_from_system;
// If alias is not specified then use the standard one
if (is_null($alias) || $alias == '')
{
$alias = $this->alias_from_system;
}
}
if (defined('MAIL_FROM') && MAIL_FROM != '')
{
$from = MAIL_FROM;
if (is_null($alias) || $alias == '')
{
$alias = $this->alias_from_system;
}
}
$this->_mail->setFrom($from, $alias);
// Check if the email address of the debug recipient is a valid one
$recipient = $to;
$recipientCC = $cc;
$recipientBCC = $bcc;
// If we the an email for debugging has been set
if (defined('MAIL_DEBUG') && MAIL_DEBUG != '')
{
// if is it valid use it!!!
$recipient = MAIL_DEBUG;
if ($recipientCC != '') $recipientCC = MAIL_DEBUG;
if ($recipientBCC != '') $recipientBCC = MAIL_DEBUG;
}
// Recipients
$this->_mail->addAddress($recipient);
if (!is_null($recipientCC)) $this->_mail->addCC($recipientCC);
if (!is_null($recipientBCC)) $this->_mail->addBCC($recipientBCC);
// Subject & body & alternative body
$this->_mail->Subject = $subject;
$this->_mail->Body = $message;
if (!isEmptyString($altMessage)) $this->_mail->AltBody = $altMessage;
// Custom headers
if ($bulk) $this->_mail->addCustomHeader('Precedence', 'bulk');
if ($autogenerated) $this->_mail->addCustomHeader('Auto-Submitted', 'auto-generated');
// Embedded images
foreach ($embeddedImages as $embeddedImage)
{
if (!$this->_mail->addEmbeddedImage($embeddedImage['file_name'], $embeddedImage['cid'])) return false;
}
$result = $this->_mail->send();
// If the email was succesfully sended then increment the counter and checks if it has to _wait until the sending of the next
if ($result != false)
{
$this->_sended++;
$this->_wait();
}
// Clear the properties for the next message
$this->_mail->clearAddresses();
$this->_mail->clearAllRecipients();
$this->_mail->clearAttachments();
}
$this->_ci->email->from($from, $alias);
// Check if the email address of the debug recipient is a valid one
$recipient = $to;
$recipientCC = $cc;
$recipientBCC = $bcc;
if (defined('MAIL_DEBUG') && MAIL_DEBUG != '')
catch (Exception $e)
{
// if is it valid use it!!!
$recipient = MAIL_DEBUG;
if ($recipientCC != '')
$recipientCC = MAIL_DEBUG;
if ($recipientBCC != '')
$recipientBCC = MAIL_DEBUG;
}
$this->_ci->email->to($recipient);
if (!is_null($recipientCC)) $this->_ci->email->cc($recipientCC);
if (!is_null($recipientBCC)) $this->_ci->email->bcc($recipientBCC);
$this->_ci->email->subject($subject);
$this->_ci->email->message($message);
if (!isEmptyString($altMessage)) $this->_ci->email->set_alt_message($altMessage);
if($bulk)
$this->_ci->email->set_header('Precedence', 'bulk');
if($autogenerated)
$this->_ci->email->set_header('Auto-Submitted', 'auto-generated');
// Avoid printing on standard output ugly error messages
$result = @$this->_ci->email->send();
// If the email was succesfully sended then increment the counter
// and checks if it has to wait until the sending of the next
if ($result)
{
$this->sended++;
$this->wait();
error_log($e->errorMessage());
}
return $result;
@@ -176,13 +219,13 @@ class MailLib
}
/**
* Checks if it has to wait until the sending of the next
* Checks if it has to _wait until the sending of the next
*/
private function wait()
private function _wait()
{
if ($this->sended == $this->email_number_per_time_range)
if ($this->_sended == $this->email_number_per_time_range)
{
$this->sended = 0;
$this->_sended = 0;
sleep($this->email_time_range); // Wait!!!
}
}
@@ -190,7 +233,7 @@ class MailLib
/**
* Gets an item from the email configuration array
*/
private function getEmailCfgItem($itemName)
private function _getEmailCfgItem($itemName)
{
return $this->_ci->config->item($itemName, EMAIL_CONFIG_INDEX);
}
+4 -101
View File
@@ -33,7 +33,7 @@ class SearchBarLib
const ERROR_NOT_AUTH = 'ERR005';
// List of allowed types of search
const ALLOWED_TYPES = ['mitarbeiter', 'mitarbeiter_ohne_zuordnung', 'organisationunit', 'raum', 'person', 'student','studentStv', 'prestudent', 'document', 'cms', 'lehreinheit', 'lehrveranstaltung'];
const ALLOWED_TYPES = ['mitarbeiter', 'mitarbeiter_ohne_zuordnung', 'organisationunit', 'raum', 'person', 'student','studentStv', 'prestudent', 'document', 'cms'];
const PHOTO_IMG_URL = '/cis/public/bild.php?src=person&person_id=';
@@ -180,14 +180,10 @@ class SearchBarLib
protected function buildSearchClause(DB_Model $dbModel, array $columns, $searchstr)
{
$searchstr = preg_replace('/[[:punct:]]/', ' ', $searchstr);
$words = preg_split('/\s+/', trim($searchstr), -1, PREG_SPLIT_NO_EMPTY);
if (empty($words)) return array();
$document = implode(' || \' \' || ', $columns);
$query = '\'' . implode(':* & ', $words) . ':*\'';
$reversequery = '\'*:' . implode(' & *:', $words) . '\'';
$nospacequery = '\'' . implode('', $words) . ':*\'';
$query = '\'' . implode(':* & ', explode(' ', trim($searchstr))) . ':*\'';
$reversequery = '\'*:' . implode(' & *:', explode(' ', trim($searchstr))) . '\'';
$nospacequery = '\'' . implode('', explode(' ', trim($searchstr))) . ':*\'';
$searchclause = <<<EOSC
to_tsvector(lower(regexp_replace({$document}, '[[:punct:]]', ' ', 'g'))) @@ to_tsquery(lower({$query}))
@@ -600,98 +596,5 @@ EOSC;
// Otherwise return an empty array
return array();
}
private function _lehreinheit($searchstr, $type)
{
$dbModel = new DB_Model();
$idwhere = '';
if (ctype_digit(trim($searchstr)))
{
$id = (int)trim($searchstr);
$idwhere = ' OR le.lehreinheit_id = ' . $id;
}
$lehreinheit = $dbModel->execReadOnlyQuery('
SELECT
\'teachingunit\' AS renderer,
\''.$type.'\' AS type,
le.lehreinheit_id AS id,
le.studiensemester_kurzbz,
lv.bezeichnung,
\'lv_table_icon icon-\' AS foto,
UPPER(stg.typ || stg.kurzbz) AS studiengang,
le.lehrform_kurzbz,
lv.semester
FROM lehre.tbl_lehreinheit le
JOIN lehre.tbl_lehrveranstaltung lv ON (lv.lehrveranstaltung_id = le.lehrveranstaltung_id)
JOIN public.tbl_studiengang stg ON (stg.studiengang_kz = lv.studiengang_kz)
JOIN public.tbl_studiensemester sem ON (sem.studiensemester_kurzbz = le.studiensemester_kurzbz)
WHERE (' .
$this->buildSearchClause(
$dbModel,
array(
'(stg.typ || stg.kurzbz)',
'lv.semester',
'lv.bezeichnung'
),
$searchstr
) . ')' . $idwhere . '
');
// If something has been found then return it
if (hasData($lehreinheit)) return getData($lehreinheit);
// Otherwise return an empty array
return array();
}
private function _lehrveranstaltung($searchstr, $type)
{
$dbModel = new DB_Model();
$idwhere = '';
if (ctype_digit(trim($searchstr)))
{
$id = (int)trim($searchstr);
$idwhere = ' OR tbl_lehrveranstaltung.lehrveranstaltung_id = ' . $id;
}
$lehreinheit = $dbModel->execReadOnlyQuery('
SELECT
\'teachingunit\' AS renderer,
\''.$type.'\' AS type,
lehrveranstaltung_id as id,
tbl_lehrveranstaltung.bezeichnung,
\'lv_table_icon icon-lv\' as foto,
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as studiengang,
semester,
lehrform_kurzbz,
tbl_organisationseinheit.bezeichnung as oe_bezeichnung
FROM lehre.tbl_lehrveranstaltung
JOIN public.tbl_studiengang USING(studiengang_kz)
JOIN public.tbl_organisationseinheit ON tbl_lehrveranstaltung.oe_kurzbz = tbl_organisationseinheit.oe_kurzbz
WHERE (' .
$this->buildSearchClause(
$dbModel,
array(
'(tbl_studiengang.typ || tbl_studiengang.kurzbz)',
'semester',
'tbl_lehrveranstaltung.bezeichnung'
),
$searchstr
) . ')' . $idwhere . '
');
// If something has been found then return it
if (hasData($lehreinheit)) return getData($lehreinheit);
// Otherwise return an empty array
return array();
}
}
@@ -159,6 +159,8 @@ class LvVwLib
if (!$stg->mischform)
return [];
$this->_ci->StudiengangModel->db->select('TRUE AS leaf', false);
return $this->_ci->stglib->orgform($path_template, $stg->studiengang_kz);
}
@@ -340,20 +340,6 @@ EOSQL;
}
public function getByLeStudiensemester($lehreinheit_id, $studiensemester_kurzbz)
{
$qry = "WITH lehreinheiten AS (
SELECT *
FROM lehre.tbl_lehreinheit
WHERE lehreinheit_id = ?
AND studiensemester_kurzbz = ?
)," . $this->_getLeCTE();
$params = array($lehreinheit_id, $studiensemester_kurzbz);
return $this->execReadOnlyQuery($qry, $params);
}
public function getByLvidStudiensemester($lv_id, $studiensemester_kurzbz, $mitarbeiter_uid = null, $fachbereich_kurzbz = null)
{
$qry = "WITH lehreinheiten AS (
@@ -361,7 +347,35 @@ EOSQL;
FROM lehre.tbl_lehreinheit
WHERE lehrveranstaltung_id = ?
AND studiensemester_kurzbz = ?
)," . $this->_getLeCTE();
),
". $this->_getGruppenCTE() . ",
". $this->_getLektorenCTE() . ",
". $this->_getFachbereichCTE() . ",
". $this->_getTagsCTE() . "
SELECT lehreinheiten.*,
lehreinheiten.lehrform_kurzbz as lv_lehrform_kurzbz,
tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
COALESCE(tag_data_agg.tags, '[]'::json) AS tags,
gruppen.gruppen,
mitarbeiter.lektoren,
mitarbeiter.le_planstunden,
mitarbeiter.vorname,
mitarbeiter.nachname,
mitarbeiter.semesterstunden,
fachbereich.bezeichnung as fachbereich,
UPPER(CONCAT(tbl_studiengang.typ,tbl_studiengang.kurzbz)) as studiengang,
semester
FROM lehreinheiten
LEFT JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = lehreinheiten.lehrfach_id
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
LEFT JOIN tag_data_agg ON tag_data_agg.lehreinheit_id = lehreinheiten.lehreinheit_id
LEFT JOIN mitarbeiter ON lehreinheiten.lehreinheit_id = mitarbeiter.lehreinheit_id
LEFT JOIN fachbereich ON lehreinheiten.lehreinheit_id = fachbereich.lehreinheit_id
LEFT JOIN gruppen ON lehreinheiten.lehreinheit_id = gruppen.lehreinheit_id
WHERE true
";
$params = array($lv_id, $studiensemester_kurzbz);
@@ -381,83 +395,9 @@ EOSQL;
return $this->execReadOnlyQuery($qry, $params);
}
public function getOffeneStunden($lehreinheit_ids)
private function getLVTmp($stg_kz = null)
{
if (!is_array($lehreinheit_ids))
$lehreinheit_ids = [$lehreinheit_ids];
if (empty($lehreinheit_ids))
return success([]);
$db = new DB_Model();
$placeholders = implode(',', array_fill(0, count($lehreinheit_ids), '?'));
$qry = "WITH eventdauer AS (
SELECT
tbl_kalender_lehreinheit.lehreinheit_id,
tbl_kalender.von,
tbl_kalender.bis,
tbl_kalender.kalender_id
FROM lehre.tbl_lehreinheit
JOIN lehre.tbl_kalender_lehreinheit USING(lehreinheit_id)
JOIN lehre.tbl_kalender USING(kalender_id)
WHERE tbl_lehreinheit.lehreinheit_id IN ($placeholders)
AND NOT EXISTS (SELECT 1 FROM lehre.tbl_kalender nachfolger
WHERE nachfolger.vorgaenger_kalender_id = tbl_kalender.kalender_id)
AND tbl_kalender.status_kurzbz NOT IN ('deleted', 'todelete', 'archived')
GROUP BY tbl_kalender_lehreinheit.lehreinheit_id, tbl_kalender.von, tbl_kalender.bis, tbl_kalender.kalender_id
),
raster AS (
SELECT
eventdauer.lehreinheit_id,
eventdauer.kalender_id,
eventdauer.von,
eventdauer.bis,
vonstunde.stunde AS vonstunde_nr,
bisstunde.stunde AS bisstunde_nr
FROM eventdauer
LEFT JOIN lehre.tbl_stunde vonstunde ON eventdauer.von::time = vonstunde.beginn
LEFT JOIN lehre.tbl_stunde bisstunde ON eventdauer.bis::time = bisstunde.ende
),
unterrichtsdauer AS (
SELECT
raster.lehreinheit_id,
raster.kalender_id,
sum(EXTRACT(EPOCH FROM (LEAST(stunde.ende, raster.bis::time) - GREATEST(stunde.beginn, raster.von::time))) / 60) AS minuten
FROM raster JOIN lehre.tbl_stunde stunde ON stunde.beginn < raster.bis::time AND stunde.ende > raster.von::time
WHERE raster.vonstunde_nr IS NULL OR raster.bisstunde_nr IS NULL
GROUP BY raster.lehreinheit_id, raster.kalender_id
),
verplantestunden AS (
SELECT raster.lehreinheit_id, raster.kalender_id,
CASE
WHEN raster.vonstunde_nr IS NOT NULL AND raster.bisstunde_nr IS NOT NULL
THEN (raster.bisstunde_nr - raster.vonstunde_nr + 1)
ELSE coalesce(unterrichtsdauer.minuten, 0) / 45
END AS verplantestunde
FROM raster LEFT JOIN unterrichtsdauer ON unterrichtsdauer.lehreinheit_id = raster.lehreinheit_id AND unterrichtsdauer.kalender_id = raster.kalender_id
),
verplant_gesamt AS (
SELECT lehreinheit_id, SUM(verplantestunde) AS verplant
FROM verplantestunden
GROUP BY lehreinheit_id
)
SELECT
lema.lehreinheit_id,
lema.mitarbeiter_uid,
lema.planstunden,
ROUND(coalesce(verplant_gesamt.verplant, 0), 2) AS verplant,
ROUND((lema.planstunden - coalesce(verplant_gesamt.verplant, 0)), 2) AS offenestunden
FROM lehre.tbl_lehreinheitmitarbeiter lema
LEFT JOIN verplant_gesamt ON verplant_gesamt.lehreinheit_id = lema.lehreinheit_id
WHERE lema.lehreinheit_id IN ($placeholders)";
return $db->execReadOnlyQuery($qry, array_merge($lehreinheit_ids, $lehreinheit_ids));
}
private function getLVTmp()
{
return "SELECT DISTINCT ON(lehrveranstaltung_id) *,
$qry = "SELECT DISTINCT ON(lehrveranstaltung_id) *,
'' as stundenblockung,
'' as lehreinheit_id,
'' as wochenrythmus,
@@ -468,33 +408,24 @@ EOSQL;
'' as studienplan_beeichnung,
UPPER(CONCAT(vw_lehreinheit.stg_typ, vw_lehreinheit.stg_kurzbz)) as studiengang
FROM campus.vw_lehreinheit
WHERE studiensemester_kurzbz = ? ";
WHERE mitarbeiter_uid = ?
AND studiensemester_kurzbz = ?";
if (!is_null($stg_kz)) {
$qry .= " AND lv_studiengang_kz = ?";
}
return $qry;
}
public function getLvsById($lehrveranstaltung_id, $studiensemester_kurzbz)
{
$where = ' AND lehrveranstaltung_id = ?';
$qry = "WITH lvs AS (" . $this->getLVTmp() . $where .")
SELECT lvs.*
FROM lvs
";
$params = array($studiensemester_kurzbz, $lehrveranstaltung_id);
return $this->execReadOnlyQuery($qry, $params);
}
public function getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $stg_kz = null)
{
$where = ' AND mitarbeiter_uid = ?';
if ($stg_kz != null)
$where .= " AND lv_studiengang_kz = ?";
$qry = "WITH lvs AS (" . $this->getLVTmp() . $where .")
$qry = "WITH lvs AS (" . $this->getLVTmp($stg_kz) . ")
SELECT lvs.*
FROM lvs";
$params = array($studiensemester_kurzbz, $mitarbeiter_uid);
FROM lvs
";
$params = array($mitarbeiter_uid, $studiensemester_kurzbz);
if (!is_null($stg_kz))
{
$params[] = $stg_kz;
@@ -701,36 +632,6 @@ EOSQL;
return success('Contract successfully updated.');
}
private function _getLeCTE()
{
return $this->_getGruppenCTE() . ",
". $this->_getLektorenCTE() . ",
". $this->_getFachbereichCTE() . ",
". $this->_getTagsCTE() . "
SELECT lehreinheiten.*,
lehreinheiten.lehrform_kurzbz as lv_lehrform_kurzbz,
tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
COALESCE(tag_data_agg.tags, '[]'::json) AS tags,
gruppen.gruppen,
mitarbeiter.lektoren,
mitarbeiter.le_planstunden,
mitarbeiter.vorname,
mitarbeiter.nachname,
mitarbeiter.semesterstunden,
fachbereich.bezeichnung as fachbereich,
UPPER(CONCAT(tbl_studiengang.typ,tbl_studiengang.kurzbz)) as studiengang,
semester
FROM lehreinheiten
LEFT JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = lehreinheiten.lehrfach_id
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
LEFT JOIN tag_data_agg ON tag_data_agg.lehreinheit_id = lehreinheiten.lehreinheit_id
LEFT JOIN mitarbeiter ON lehreinheiten.lehreinheit_id = mitarbeiter.lehreinheit_id
LEFT JOIN fachbereich ON lehreinheiten.lehreinheit_id = fachbereich.lehreinheit_id
LEFT JOIN gruppen ON lehreinheiten.lehreinheit_id = gruppen.lehreinheit_id
WHERE true";
}
private function _getGruppenCTE()
{
return "gruppen AS (
@@ -292,29 +292,13 @@ class Studiensemester_model extends DB_Model
COALESCE(
(SELECT studiensemester_kurzbz FROM semester_interval_startdate),
(SELECT studiensemester_kurzbz FROM nearest_semester_interval_startdate)
) AS studiensemester_kurzbz,
COALESCE(
(SELECT start FROM semester_interval_startdate),
(SELECT start FROM nearest_semester_interval_startdate)
) as start,
COALESCE(
(SELECT ende FROM semester_interval_startdate),
(SELECT ende FROM nearest_semester_interval_startdate)
) as ende
) AS studiensemester_kurzbz
UNION
SELECT
COALESCE(
(SELECT studiensemester_kurzbz FROM semester_interval_enddate),
(SELECT studiensemester_kurzbz FROM nearest_semester_interval_enddate)
) AS studiensemester_kurzbz,
COALESCE(
(SELECT start FROM semester_interval_enddate),
(SELECT start FROM nearest_semester_interval_enddate)
) as start,
COALESCE(
(SELECT ende FROM semester_interval_enddate),
(SELECT ende FROM nearest_semester_interval_enddate)
) as ende
) AS studiensemester_kurzbz
EOSQL;
@@ -21,7 +21,6 @@ $this->load->view('templates/FHC-Header', $includesArray);
?>
<script type="text/javascript">
document.body.classList.add("cis4");
if (window.self !== window.top)
document.body.classList.add("in-frame");
</script>
+2 -1
View File
@@ -519,7 +519,8 @@
"vuejs/vuedatepicker_js": "7.2.0",
"vuejs/vuedatepicker_css": "7.2.0",
"vuejs/vuedatepicker_js11": "11.0.1",
"vuejs/vuedatepicker_css11": "11.0.1"
"vuejs/vuedatepicker_css11": "11.0.1",
"phpmailer/phpmailer": "^7.0"
},
"config": {
Generated
+139 -34
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "bc21de2a48b960781c1ed028c4b8d7b9",
"content-hash": "3fe105bed2633fb937e6cc4146ce3508",
"packages": [
{
"name": "afarkas/html5shiv",
@@ -897,12 +897,12 @@
"version": "v6.0.0",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
"url": "https://github.com/googleapis/php-jwt.git",
"reference": "0541cba75ab108ef901985e68055a92646c73534"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/0541cba75ab108ef901985e68055a92646c73534",
"url": "https://api.github.com/repos/googleapis/php-jwt/zipball/0541cba75ab108ef901985e68055a92646c73534",
"reference": "0541cba75ab108ef901985e68055a92646c73534",
"shasum": ""
},
@@ -944,8 +944,8 @@
"php"
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
"source": "https://github.com/firebase/php-jwt/tree/v6.0.0"
"issues": "https://github.com/googleapis/php-jwt/issues",
"source": "https://github.com/googleapis/php-jwt/tree/v6.0.0"
},
"time": "2022-01-24T15:18:34+00:00"
},
@@ -1615,17 +1615,99 @@
"type": "library"
},
{
"name": "phpseclib/phpseclib",
"version": "2.0.48",
"name": "phpmailer/phpmailer",
"version": "v7.1.1",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "eaa7be704b8b93a6913b69eb7f645a59d7731b61"
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "1bc1716a507a65e039d4ac9d9adebbbd0d346e15"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/eaa7be704b8b93a6913b69eb7f645a59d7731b61",
"reference": "eaa7be704b8b93a6913b69eb7f645a59d7731b61",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/1bc1716a507a65e039d4ac9d9adebbbd0d346e15",
"reference": "1bc1716a507a65e039d4ac9d9adebbbd0d346e15",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-filter": "*",
"ext-hash": "*",
"php": ">=5.5.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"doctrine/annotations": "^1.2.6 || ^1.13.3",
"php-parallel-lint/php-console-highlighter": "^1.0.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcompatibility/php-compatibility": "^10.0.0@dev",
"squizlabs/php_codesniffer": "^3.13.5",
"yoast/phpunit-polyfills": "^1.0.4"
},
"suggest": {
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"directorytree/imapengine": "For uploading sent messages via IMAP, see gmail example",
"ext-imap": "Needed to support advanced email address parsing according to RFC822",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
},
"type": "library",
"autoload": {
"psr-4": {
"PHPMailer\\PHPMailer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-only"
],
"authors": [
{
"name": "Marcus Bointon",
"email": "[email protected]"
},
{
"name": "Jim Jagielski",
"email": "[email protected]"
},
{
"name": "Andy Prevost",
"email": "[email protected]"
},
{
"name": "Brent R. Matzelle"
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v7.1.1"
},
"funding": [
{
"url": "https://github.com/Synchro",
"type": "github"
}
],
"time": "2026-05-18T08:06:14+00:00"
},
{
"name": "phpseclib/phpseclib",
"version": "2.0.55",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "d73c9e019a895be83b18a2ccccfa7e2b0a648743"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d73c9e019a895be83b18a2ccccfa7e2b0a648743",
"reference": "d73c9e019a895be83b18a2ccccfa7e2b0a648743",
"shasum": ""
},
"require": {
@@ -1633,7 +1715,7 @@
},
"require-dev": {
"phing/phing": "~2.7",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0|^8.5|^9.4",
"squizlabs/php_codesniffer": "~2.0"
},
"suggest": {
@@ -1706,7 +1788,7 @@
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
"source": "https://github.com/phpseclib/phpseclib/tree/2.0.48"
"source": "https://github.com/phpseclib/phpseclib/tree/2.0.55"
},
"funding": [
{
@@ -1722,7 +1804,7 @@
"type": "tidelift"
}
],
"time": "2024-12-14T21:03:54+00:00"
"time": "2026-06-14T19:53:12+00:00"
},
{
"name": "rmariuzzo/jquery-checkboxes",
@@ -1931,8 +2013,18 @@
],
"support": {
"issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/1.x"
"source": "https://github.com/twigphp/Twig/tree/v1.42.5"
},
"funding": [
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
"type": "tidelift"
}
],
"time": "2020-02-11T05:59:23+00:00"
},
{
@@ -2726,33 +2818,29 @@
},
{
"name": "phpmetrics/phpmetrics",
"version": "v2.8.2",
"version": "v2.11.0",
"source": {
"type": "git",
"url": "https://github.com/phpmetrics/PhpMetrics.git",
"reference": "4b77140a11452e63c7a9b98e0648320bf6710090"
"reference": "55c5e23b34afb8fa9b6c6ea95cbd59b710160235"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/4b77140a11452e63c7a9b98e0648320bf6710090",
"reference": "4b77140a11452e63c7a9b98e0648320bf6710090",
"url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/55c5e23b34afb8fa9b6c6ea95cbd59b710160235",
"reference": "55c5e23b34afb8fa9b6c6ea95cbd59b710160235",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-tokenizer": "*",
"nikic/php-parser": "^3|^4",
"php": ">=5.5"
"nikic/php-parser": "^3|^4|^5"
},
"replace": {
"halleck45/php-metrics": "*",
"halleck45/phpmetrics": "*"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14",
"sebastian/comparator": ">=1.2.3",
"squizlabs/php_codesniffer": "^3.5",
"symfony/dom-crawler": "^3.0 || ^4.0 || ^5.0"
"phpunit/phpunit": "*"
},
"bin": [
"bin/phpmetrics"
@@ -2788,9 +2876,15 @@
],
"support": {
"issues": "https://github.com/PhpMetrics/PhpMetrics/issues",
"source": "https://github.com/phpmetrics/PhpMetrics/tree/v2.8.2"
"source": "https://github.com/phpmetrics/PhpMetrics/tree/v2.11.0"
},
"time": "2023-03-08T15:03:36+00:00"
"funding": [
{
"url": "https://github.com/Halleck45",
"type": "github"
}
],
"time": "2026-08-09T06:58:42+00:00"
},
{
"name": "phpspec/prophecy",
@@ -3127,7 +3221,6 @@
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/master"
},
"abandoned": true,
"time": "2017-11-27T05:48:46+00:00"
},
{
@@ -3963,16 +4056,16 @@
},
{
"name": "sebastian/recursion-context",
"version": "3.0.2",
"version": "3.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c"
"reference": "4d3432ab12baebb4da6b7ad65d92847287f593b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/9bfd3c6f1f08c026f542032dfb42813544f7d64c",
"reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/4d3432ab12baebb4da6b7ad65d92847287f593b8",
"reference": "4d3432ab12baebb4da6b7ad65d92847287f593b8",
"shasum": ""
},
"require": {
@@ -4014,15 +4107,27 @@
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
"source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.2"
"source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.4"
},
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
},
{
"url": "https://liberapay.com/sebastianbergmann",
"type": "liberapay"
},
{
"url": "https://thanks.dev/u/gh/sebastianbergmann",
"type": "thanks_dev"
},
{
"url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context",
"type": "tidelift"
}
],
"time": "2024-03-01T14:07:30+00:00"
"time": "2026-08-11T05:21:46+00:00"
},
{
"name": "sebastian/resource-operations",
+25 -63
View File
@@ -21,7 +21,6 @@
* Manuela Thamer <[email protected]>
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
require_once(dirname(__FILE__).'/mitarbeiter.class.php');
class entwicklungsteam extends basis_db
{
@@ -44,6 +43,7 @@ class entwicklungsteam extends basis_db
public $ext_id;
public $besqual;
public $studiengang_kz_old;
/**
* Konstruktor
@@ -74,7 +74,7 @@ class entwicklungsteam extends basis_db
$qry = "SELECT * FROM bis.tbl_entwicklungsteam JOIN bis.tbl_besqual USING(besqualcode)
WHERE entwicklungsteam_id=".$this->db_add_param($entwicklungsteam_id);
$qry.=";";
$qry.=";";
if($this->db_query($qry))
{
@@ -147,11 +147,6 @@ class entwicklungsteam extends basis_db
$this->errormsg = 'Es muss ein Mitarbeiter angegeben werden';
return false;
}
if(!$this->checkIfExistingUid($this->mitarbeiter_uid))
{
$this->errormsg = 'Bitte einen Eintrag aus dem Dropdown Personensuche auswählen!';
return false;
}
if($this->studiengang_kz=='')
{
$this->errormsg = 'Es muss ein Studiengang angegeben werden';
@@ -167,26 +162,6 @@ class entwicklungsteam extends basis_db
$this->errormsg = 'Endedatum darf nicht vor Anfangsdatum liegen';
return false;
}
if($this->beginn != '')
{
$beginnParts = explode('-', $this->beginn);
if (!checkdate((int)$beginnParts[1], (int)$beginnParts[2], (int)$beginnParts[0])) {
$this->errormsg = 'Anfangsdatum ist ungültig';
return false;
}
}
if($this->ende != '')
{
$endeParts = explode('-', $this->ende);
if (!checkdate((int)$endeParts[1], (int)$endeParts[2], (int)$endeParts[0]))
{
$this->errormsg = 'Endedatum ist ungültig';
return false;
}
}
return true;
}
@@ -208,28 +183,30 @@ class entwicklungsteam extends basis_db
//Neuen Datensatz anlegen
$qry = "INSERT INTO bis.tbl_entwicklungsteam (mitarbeiter_uid, studiengang_kz, besqualcode, beginn, ende,
updateamum, updatevon, insertamum, insertvon) VALUES (".
$this->db_add_param($this->mitarbeiter_uid).', '.
$this->db_add_param($this->studiengang_kz, FHC_INTEGER).', '.
$this->db_add_param($this->besqualcode, FHC_INTEGER).', '.
$this->db_add_param($this->beginn).', '.
$this->db_add_param($this->ende).', '.
$this->db_add_param($this->updateamum).', '.
$this->db_add_param($this->updatevon).', '.
$this->db_add_param($this->insertamum).', '.
$this->db_add_param($this->insertvon).');';
$this->db_add_param($this->mitarbeiter_uid).', '.
$this->db_add_param($this->studiengang_kz, FHC_INTEGER).', '.
$this->db_add_param($this->besqualcode, FHC_INTEGER).', '.
$this->db_add_param($this->beginn).', '.
$this->db_add_param($this->ende).', '.
$this->db_add_param($this->updateamum).', '.
$this->db_add_param($this->updatevon).', '.
$this->db_add_param($this->insertamum).', '.
$this->db_add_param($this->insertvon).');';
}
else
{
if($this->studiengang_kz_old=='')
$this->studiengang_kz_old = $this->studiengang_kz;
//Bestehenden Datensatz aktualisieren
$qry= "UPDATE bis.tbl_entwicklungsteam SET".
" besqualcode=".$this->db_add_param($this->besqualcode, FHC_INTEGER).",".
" beginn=".$this->db_add_param($this->beginn).",".
" studiengang_kz=".$this->db_add_param($this->studiengang_kz, FHC_INTEGER).",".
" ende=".$this->db_add_param($this->ende).",".
" mitarbeiter_uid=".$this->db_add_param($this->mitarbeiter_uid).",".
" updateamum=".$this->db_add_param($this->updateamum).",".
" updatevon=".$this->db_add_param($this->updatevon).
" WHERE entwicklungsteam_id=".$this->db_add_param($this->entwicklungsteam_id).";";
" besqualcode=".$this->db_add_param($this->besqualcode, FHC_INTEGER).",".
" beginn=".$this->db_add_param($this->beginn).",".
" studiengang_kz=".$this->db_add_param($this->studiengang_kz, FHC_INTEGER).",".
" ende=".$this->db_add_param($this->ende).",".
" updateamum=".$this->db_add_param($this->updateamum).",".
" updatevon=".$this->db_add_param($this->updatevon).
" WHERE entwicklungsteam_id=".$this->db_add_param($this->entwicklungsteam_id).";";
}
if($this->db_query($qry))
@@ -257,7 +234,7 @@ class entwicklungsteam extends basis_db
if($studiengang_kz!=null)
$qry.=" AND studiengang_kz=".$this->db_add_param($studiengang_kz);
$qry.=";";
$qry.=";";
if($this->db_query($qry))
{
@@ -339,7 +316,7 @@ class entwicklungsteam extends basis_db
if ($sort != null)
{
$qry .= " ORDER BY ".$sort;
$qry .= " ORDER BY ".$sort;
}
$qry .= ";";
@@ -387,7 +364,7 @@ class entwicklungsteam extends basis_db
$bismeldung_jahr = $datetime->format('Y');
//laden des Datensatzes
$qry = "SELECT tbl_entwicklungsteam.*, tbl_besqual.*, tbl_studiengang.studiengang_kz, tbl_studiengang.melderelevant
$qry = "SELECT tbl_entwicklungsteam.*, tbl_besqual.*, tbl_studiengang.studiengang_kz, tbl_studiengang.melderelevant
FROM bis.tbl_entwicklungsteam
JOIN bis.tbl_besqual USING(besqualcode)
JOIN public.tbl_studiengang USING(studiengang_kz)
@@ -398,7 +375,7 @@ class entwicklungsteam extends basis_db
if($studiengang_kz!=null)
$qry.=" AND studiengang_kz=".$this->db_add_param($studiengang_kz);
$qry.=";";
$qry.=";";
if($this->db_query($qry))
{
@@ -430,20 +407,5 @@ class entwicklungsteam extends basis_db
return false;
}
}
/*
* Überprüft, ob die übergebene Uid in der Tabelle tbl_mitarbeiter vorhanden ist
* @param String $uid UID des Mitarbeiters
* @return true wenn vorhanden, false wenn nicht
*/
private function checkIfExistingUid($uid)
{
$mitarbeiter = new mitarbeiter();
if(!$mitarbeiter->checkIfExistingUid($uid))
return false;
return true;
}
}
?>
+66 -72
View File
@@ -16,9 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <[email protected]>,
* Andreas Oesterreicher <[email protected]>,
* Rudolf Hangl <[email protected]> and
* Gerald Simane-Sequens <[email protected]>
* Andreas Oesterreicher <[email protected]>,
* Rudolf Hangl <[email protected]> and
* Gerald Simane-Sequens <[email protected]>
*/
/**
* Klasse Mail
@@ -28,6 +28,12 @@
* Replyto und Attachments
*/
include_once DOC_ROOT . 'vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
class mail
{
public $to;
@@ -41,6 +47,8 @@ class mail
public $attachments;
public $errormsg;
private $_mail; // PHPMailer instance
/**
* MAIL - Konstruktor
* $to Empfaenger
@@ -65,6 +73,30 @@ class mail
*/
public function send()
{
// PHPMailer configuration
try
{
$this->_mail = new PHPMailer(true);
$this->_mail->isSMTP(); // Send using SMTP
$this->_mail->Host = 'localhost'; // Set the SMTP server to send through
$this->_mail->Port = 25; // TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
$this->_mail->SMTPAuth = false; // Enable SMTP authentication
$this->_mail->Username = ''; // SMTP username
$this->_mail->Password = ''; // SMTP password
$this->_mail->SMTPSecure = ''; // Enable implicit TLS encryption
$this->_mail->Timeout = 1; // set the timeout (seconds)
$this->_mail->SMTPKeepAlive = false; // Persistent SMTP connection
$this->_mail->Priority = 3; // 1 = High, 3 = Normal, 5 = low. When null, the header is not set at all.
$this->_mail->WordWrap = 76;
$this->_mail->isHTML(true); // html or text
$this->_mail->SMTPDebug = 0; // Disable debugging
$this->_mail->CharSet = 'UTF-8';
}
catch(Exception $e)
{
return false;
}
//wenn MAIL_DEBUG gesetzt ist dann alles an diese Adresse schicken
if(MAIL_DEBUG!='')
{
@@ -82,68 +114,38 @@ class mail
$this->sender = MAIL_FROM;
// Header
$header = '';
$header .= "From: {$this->sender}".$eol;
$this->_mail->setFrom($this->sender);
if (!empty($this->CC_recievers))
$header .= "CC: {$this->CC_recievers}".$eol;
$this->_mail->addCC($this->CC_recievers);
if (!empty($this->BCC_recievers))
$header .= "BCC: {$this->BCC_recievers}".$eol;
$this->_mail->addBCC($this->BCC_recievers);
if (!empty($this->replyTo))
$header .= "Reply-To: {$this->replyTo}".$eol;
if (!empty($this->replyTo))
$header .= "Return-Path: {$this->replyTo}".$eol;
$header .= 'X-Mailer: FHComplete V1'.$eol;
$header .= 'Mime-Version: 1.0'.$eol;
$header .= 'Precedence: bulk'.$eol;
$header .= 'Auto-Submitted: auto-generated'.$eol;
$header .= "Content-Type: multipart/related; boundary=\"$mime_boundary_mixed\"".$eol;
$header .= "Content-Transfer-Encoding: 8bit".$eol;
// Body
$mailbody = "";
$mailbody .= $eol;
$mailbody .= "--$mime_boundary_mixed".$eol;
$mailbody .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary_alternative\"".$eol;
$mailbody .= $eol;
$mailbody .= "--$mime_boundary_alternative".$eol;
$mailbody .= "Content-Type: text/plain; charset={$this->textContent[1]}".$eol;
$mailbody .= "Content-Transfer-Encoding: {$this->textContent[2]}".$eol;
$mailbody .= $eol;
$mailbody .= $this->textContent[0];
$mailbody .= $eol;
$mailbody .= $eol;
if (!empty($this->htmlContent[0]))
{
$mailbody .= "--$mime_boundary_alternative".$eol;
$mailbody .= "Content-Type: text/html; charset={$this->htmlContent[1]}".$eol;
$mailbody .= "Content-Transfer-Encoding: {$this->htmlContent[2]}".$eol;
$mailbody .= $eol;
$mailbody .= $this->htmlContent[0];
$mailbody .= $eol;
$mailbody .= $eol;
$this->_mail->addReplyTo($this->replyTo);
$this->_mail->addCustomHeader('Return-Path', $this->replyTo);
}
$mailbody .= "--{$mime_boundary_alternative}--".$eol;
$mailbody .= $eol;
$mailbody .= "--$mime_boundary_mixed";
$this->_mail->addCustomHeader('X-Mailer', 'FHComplete V1');
$this->_mail->addCustomHeader('Mime-Version', '1.0');
$this->_mail->addCustomHeader('Precedence', 'bulk');
$this->_mail->addCustomHeader('Auto-Submitted', 'auto-generated');
$this->_mail->Body = $this->htmlContent[0];
$this->_mail->AltBody = $this->textContent[0];
// Attachments Plain
if (is_array($this->attachmentsplain) && (count($this->attachmentsplain) > 0))
{
foreach ($this->attachmentsplain as $attachment)
{
$dispo = 'attachment';
$mailbody .= $eol;
$mailbody .= "Content-Disposition: $dispo; filename={$attachment[2]}".$eol;
$mailbody .= "Content-Type: {$attachment[1]}; name={$attachment[2]}".$eol;
$mailbody .= 'Content-Transfer-Encoding: '.$attachment[3].$eol;
$mailbody .= $eol;
$mailbody .= $attachment[0];
$mailbody .= $eol;
$mailbody .= "--$mime_boundary_mixed";
$this->_mail->addStringAttachment(
$attachment[0], // File content
$attachment[2], // Name
$attachment[3], // Encoding
$attachment[1], // Type
'attachment' // Disposition
);
}
}
@@ -152,31 +154,23 @@ class mail
{
foreach ($this->attachments as $attachment)
{
$dispo = empty($attachment[3]) ? 'attachment' : 'inline';
$mailbody .= $eol;
$mailbody .= "Content-Disposition: $dispo; filename={$attachment[2]}".$eol;
$mailbody .= "Content-Type: {$attachment[1]}; name={$attachment[2]}".$eol;
if (!empty($attachment[3]))
{
$mailbody .= "Content-ID: <{$attachment[3]}>".$eol;
}
$mailbody .= 'Content-Transfer-Encoding: base64'.$eol;
$mailbody .= $eol;
$mailbody .= $attachment[0];
$mailbody .= $eol;
$mailbody .= "--$mime_boundary_mixed";
$this->_mail->addStringEmbeddedImage(
$attachment[0], // File content
$attachment[3], // Content ID
$attachment[2], // Content name
PHPMailer::ENCODING_BASE64, // Encoding
$attachment[1], // Type
empty($attachment[3]) ? 'attachment' : 'inline' // Disposition
);
}
}
$mailbody .= "--".$eol;
// Subject Encoding setzen
$subject = "=?UTF-8?B?".base64_encode($this->subject)."?=";
$this->_mail->Subject = $this->subject;
$this->_mail->addAddress($this->to);
// Senden
if(mail($this->to, $subject, $mailbody, $header))
return true;
else
return false;
return $this->_mail->send();
}
/**
-18
View File
@@ -1995,23 +1995,5 @@ class mitarbeiter extends benutzer
return true;
}
}
/**
* Prueft ob eine existierende ma_uid übergeben wurde
* @param String $mitarbeiter_uid mitarbeiter_uid
* @return bool True wenn mitarbeiter_uid vorhanden sonst false.
*/
public function checkIfExistingUid($mitarbeiter_uid)
{
$qry = "Select 1 from public.tbl_mitarbeiter where mitarbeiter_uid =".$this->db_add_param($mitarbeiter_uid);
if ($result = $this->db_query($qry))
{
if ($this->db_num_rows($result) > 0)
return true;
else
return false;
}
}
}
?>
+4 -25
View File
@@ -7,11 +7,6 @@ html {
font-size: 0.875em;
}
body.compat,
body.compat main#cis-main {
background-color: #fff;
}
.fhc-dark-bg{
background-color: var(--fhc-dark);
color:var(--fhc-light) !important;
@@ -459,8 +454,8 @@ body.compat main#cis-main {
/* desktop */
@media (min-width: 992px) {
body.cis4 {
display: flex;
body {
display: flex;
padding-top: var(--fhc-cis-header-height);
width: calc(100svw - var(--scrollbar-width, 0px));
/* overflow: visible !important; */
@@ -765,7 +760,7 @@ body.compat main#cis-main {
}
.dashboard-item {
overscroll-behavior: auto;
overscroll-behavior: none;
}
.abgabe-zieldatum-border-red,
@@ -858,20 +853,4 @@ body.compat main#cis-main {
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 0.5rem;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.cis-main-menu {
max-width: 100vw;
}
.cis-main-menu ul {
list-style: none;
margin: 0;
padding: 0;
}
.cis-main-menu ul li {
margin: 0;
padding: 0;
width: 100%;
}
}
+1 -11
View File
@@ -44,15 +44,5 @@ export default {
studiensemester_kurzbz
}
};
},
getContainingOrNearestByDateRange(from, to) {
return {
method: 'get',
url: 'api/frontend/v1/organisation/studiensemester/getContainingOrNearestByDateRange',
params: {
from,
to,
}
};
},
}
};
-2
View File
@@ -17,8 +17,6 @@ const router = VueRouter.createRouter({
component: LVVerwaltung,
children: [
{ name: 'emp', path: 'emp/:emp/:treemenu(.*)*', component: LVVerwaltung },
{ name: 'le', path: 'le/:le', component: LVVerwaltung },
{ name: 'lv', path: 'lv/:lv', component: LVVerwaltung },
{ name: 'treemenu', path: ':treemenu(.*)*', component: LVVerwaltung }
]
},
-7
View File
@@ -103,13 +103,6 @@ export default {
keyboard: this.keyboard
});
},
//to avoid pagelocks if more than one instance
beforeUnmount() {
if (this.modal) {
this.modal.dispose();
this.modal = null;
}
},
popup(body, options, title, footer) {
const BsModal = this,
slots = {};
-6
View File
@@ -16,15 +16,9 @@ export default {
return this.mode + '#' + this.path + '#' + this.query_string;
}
},
beforeMount: function() {
document.body.classList.add('compat');
},
mounted: function() {
this.srcUrl = this.buildSrcUrl();
},
beforeUnmount: function() {
document.body.classList.remove('compat');
},
watch: {
propsWatchHelper: function() {
if(this.lastLoadediFrameURL === '') {
+19 -30
View File
@@ -1,7 +1,6 @@
import FhcCalendar from "../../Calendar/LvPlan.js";
import ApiLvPlan from '../../../api/factory/lvPlan.js';
import ApiStudienSemester from '../../../api/factory/studiensemester.js';
import ApiAuthinfo from '../../../api/factory/authinfo.js';
export const DEFAULT_MODE_LVPLAN_DESKTOP = "Week";
@@ -17,12 +16,13 @@ export default {
},
data() {
return {
studiensemester_kurzbz: null,
studiensemester_start: null,
studiensemester_ende: null,
uid: null,
isMitarbeiter: false,
isStudent: false,
timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone,
startSemester: null,
endSemester: null,
};
},
inject: ["isMobile"],
@@ -48,12 +48,9 @@ export default {
return this.propsViewData?.mode;
},
downloadLinks() {
const startDate = this.startSemester?.start;
const endDate = this.endSemester ? this.endSemester.ende : this.startSemester?.ende;
if (!startDate || !endDate || !this.uid)
if (!this.studiensemester_start || !this.studiensemester_ende || !this.uid)
return false;
let type = false;
type = this.isStudent ? 'student' : type;
type = this.isMitarbeiter ? 'lektor' : type;
@@ -64,10 +61,10 @@ export default {
const opts = { zone: this.timezone };
const start = luxon.DateTime
.fromISO(startDate, opts)
.fromISO(this.studiensemester_start, opts)
.toUnixInteger();
const ende = luxon.DateTime
.fromISO(endDate, opts)
.fromISO(this.studiensemester_ende, opts)
.toUnixInteger();
const download_link = FHC_JS_DATA_STORAGE_OBJECT.app_root
@@ -112,21 +109,16 @@ export default {
}
});
},
async updateRange(rangeInterval) {
const semesterResponse = await this.$api.call(
ApiStudienSemester.getContainingOrNearestByDateRange(
rangeInterval.s.toISO().slice(0, 10),
rangeInterval.e.toISO().slice(0, 10),
),
);
this.startSemester =
semesterResponse.data.length
? semesterResponse.data[0]
: null;
this.endSemester =
semesterResponse.data.length > 1
? semesterResponse.data[1]
: null;
updateRange(rangeInterval) {
this.$api
.call(ApiLvPlan.studiensemesterDateInterval(
rangeInterval.end.startOf('week').toISODate()
))
.then(res => {
this.studiensemester_kurzbz = res.data.studiensemester_kurzbz;
this.studiensemester_start = res.data.start;
this.studiensemester_ende = res.data.ende;
});
},
getPromiseFunc(start, end) {
return [
@@ -150,11 +142,8 @@ export default {
<div class="cis-lvplan-personal d-flex flex-column h-100">
<h2>
{{ $p.t('lehre/stundenplan') }}
<span v-if="startSemester?.studiensemester_kurzbz">
{{ startSemester.studiensemester_kurzbz }}
<span v-if="endSemester?.studiensemester_kurzbz">
{{ "- " + endSemester.studiensemester_kurzbz }}
</span>
<span v-if="studiensemester_kurzbz" class="ps-3">
{{ studiensemester_kurzbz }}
</span>
</h2>
<hr>
+25 -32
View File
@@ -5,7 +5,6 @@ import FhcCalendar from "../../Calendar/LvPlan.js";
import ApiLvPlan from "../.././../api/factory/lvPlan.js";
import ApiOtherLvPlan from "../.././../api/factory/otherLvPlan.js";
import ApiAuthinfo from "../../../api/factory/authinfo.js";
import ApiStudienSemester from '../../../api/factory/studiensemester.js';
export const DEFAULT_MODE_LVPLAN_DESKTOP = "Week";
export const DEFAULT_MODE_LVPLAN_MOBILE = "List";
@@ -23,6 +22,9 @@ export default {
data() {
return {
localProps: {},
studiensemester_kurzbz: null,
studiensemester_start: null,
studiensemester_ende: null,
isOtherPersonMitarbeiter: false,
isOtherPersonStudent: false,
currentStgBezeichnung: null,
@@ -34,8 +36,6 @@ export default {
photo: "",
},
timezone: FHC_JS_DATA_STORAGE_OBJECT.timezone,
startSemester: null,
endSemester: null,
};
},
inject: ["isMobile"],
@@ -67,10 +67,11 @@ export default {
// do not show download links in otherLvPlan Mode
return false;
const startDate = this.startSemester?.start;
const endDate = this.endSemester ? this.endSemester.ende : this.startSemester?.ende;
if (!startDate || !endDate || !this.uid)
if (
!this.studiensemester_start ||
!this.studiensemester_ende ||
!this.propsViewData.otherUid
)
return false;
const type = this.isOtherPersonStudent
@@ -83,11 +84,11 @@ export default {
const opts = { zone: this.timezone };
const start = luxon.DateTime.fromISO(
startDate,
this.studiensemester_start,
opts,
).toUnixInteger();
const ende = luxon.DateTime.fromISO(
endDate,
this.studiensemester_ende,
opts,
).toUnixInteger();
@@ -165,21 +166,19 @@ export default {
},
});
},
async updateRange(rangeInterval) {
const semesterResponse = await this.$api.call(
ApiStudienSemester.getContainingOrNearestByDateRange(
rangeInterval.s.toISO().slice(0, 10),
rangeInterval.e.toISO().slice(0, 10),
),
);
this.startSemester =
semesterResponse.data.length
? semesterResponse.data[0]
: null;
this.endSemester =
semesterResponse.data.length > 1
? semesterResponse.data[1]
: null;
updateRange(rangeInterval) {
this.$api
.call(
ApiLvPlan.studiensemesterDateInterval(
rangeInterval.end.startOf("week").toISODate(),
),
)
.then((res) => {
this.studiensemester_kurzbz =
res.data.studiensemester_kurzbz;
this.studiensemester_start = res.data.start;
this.studiensemester_ende = res.data.ende;
});
},
getPromiseFunc(start, end) {
return [
@@ -251,14 +250,8 @@ export default {
<div class="d-flex flex-column h-100">
<h2>
<div class="d-flex flex-row justify-content-between align-items-center">
<span>
{{ $p.t('lehre/stundenplan') }}
<span v-if="startSemester?.studiensemester_kurzbz">
{{ startSemester.studiensemester_kurzbz }}
<span v-if="endSemester?.studiensemester_kurzbz">
{{ "- " + endSemester.studiensemester_kurzbz }}
</span>
</span>
<span>
{{ $p.t('lehre/stundenplan') + (studiensemester_kurzbz ? " " + studiensemester_kurzbz : "") }}
</span>
<div @click="this.$router.push({name: 'ProfilView', params: {uid: propsViewData.otherUid}})" type="button" class="d-flex flex-row align-items-center gap-3">
<span v-if="otherPersonData.fullNameWithTitle?.length">
+1 -1
View File
@@ -186,7 +186,7 @@ export default {
</div>
</div>
<nav id="nav-main" class="cis-main-menu offcanvas offcanvas-start" tabindex="-1" aria-labelledby="nav-main-btn" data-bs-backdrop="false">
<nav id="nav-main" class="offcanvas offcanvas-start" tabindex="-1" aria-labelledby="nav-main-btn" data-bs-backdrop="false">
<div id="nav-main-sticky">
<div class="d-flex flex-row h-100">
<div class="offcanvas-body p-0">
+1 -5
View File
@@ -162,7 +162,6 @@ export default {
<div class="btn-group w-100">
<a :target="target"
:href="(entry.menu_open && hasFullLink) ? entry.url : null"
draggable="false"
@click="toggleCollapse"
:class="{
'btn btn-default rounded-0 text-start': true,
@@ -181,15 +180,12 @@ export default {
</div>
<ul ref="children"
class="nav w-100 collapse">
<li>
<cis-menu-entry :highestMatchingUrlCount="highestMatchingUrlCount" :activeContent="activeContent" v-for="child in entry.childs" :key="child" :entry="child" :level="level + 1"/>
</li>
<cis-menu-entry :highestMatchingUrlCount="highestMatchingUrlCount" :activeContent="activeContent" v-for="child in entry.childs" :key="child" :entry="child" :level="level + 1"/>
</ul>
</template>
<a v-else
:href="entry.url"
:target="target"
draggable="false"
:class="{
'btn btn-default rounded-0 w-100 text-start': true,
['btn-level-' + level]: true,
@@ -73,7 +73,7 @@ export default {
// check if the lv has lvplan entries for this studiensemester
if (this.studiensemester && this.event) {
return this.$fhcApi.factory.studium.getLvPlanForStudiensemester(this.studiensemester, this.event.lehreinheit_id ?? this.event.lehrveranstaltung_id)
.then(data => data.data?.retval)
.then(data => data.data)
.then(res => {
if (Array.isArray(res) && res.length > 0) {
this.hasLvPlanEintraege = true;
@@ -114,4 +114,4 @@ export default {
`,
};
};
@@ -1,6 +1,5 @@
export default {
name: 'Cis-Renderer-Feiertag-CalendarEvent',
props: {
event: {
type: Object,
@@ -1,7 +1,6 @@
import { formatDate } from "../../../../helpers/DateHelpers.js"
export default {
name: 'Cis-Renderer-Feiertag-ModalContent',
props:{
event: {
type: Object,
@@ -1,5 +1,4 @@
export default {
name: 'Cis-Renderer-Feiertag-ModalTitle',
props:{
event: {
type: Object,
@@ -1,5 +1,4 @@
export default {
name: 'Cis-Renderer-Lehreinheit-CalendarEvent',
props:{
event: {
type: Object,
@@ -5,7 +5,6 @@ import ApiLvPlan from '../../../../api/factory/lvPlan.js';
import ApiAddons from '../../../../api/factory/addons.js';
export default {
name: 'Cis-Renderer-Lehreinheit-ModalContent',
components:{
LvMenu,
},
@@ -50,16 +49,6 @@ export default {
return this.event.ende;
}
return numberPadding(this.event.ende.getHours()) + ":" + numberPadding(this.event.ende.getMinutes());
},
showLvMenu: function() {
const hideOnRoutes = [
'OtherLvPlan',
'StgOrgLvPlan'
];
if(hideOnRoutes.includes(this.$route.name)) {
return false;
}
return true;
}
},
watch: {
@@ -173,6 +162,6 @@ export default {
</tr>
</tbody>
</table>
<lv-menu v-if="lvMenu.length && showLvMenu" :containerStyles="['p-0']" :rowStyles="['m-0']" :menu="lvMenu" />
<lv-menu v-if="lvMenu.length && $route.name === 'MyLvPlan'" :containerStyles="['p-0']" :rowStyles="['m-0']" :menu="lvMenu" />
</div>`,
}
@@ -1,5 +1,4 @@
export default {
name: 'Cis-Renderer-Lehreinheit-ModalTitle',
props:{
event: {
type: Object,
@@ -1,5 +1,4 @@
export default {
name: 'Cis-Renderer-Reservierung-CalendarEvent',
props: {
event: {
type: Object,
@@ -2,7 +2,6 @@ import { numberPadding, formatDate } from "../../../../helpers/DateHelpers.js"
import LvMenu from "../../Mylv/LvMenu.js";
export default {
name: 'Cis-Renderer-Reservierung-ModalContent',
props:{
event: {
type: Object,
@@ -1,5 +1,4 @@
export default {
name: 'Cis-Renderer-Reservierung-ModalTitle',
props:{
event: {
type: Object,
+2 -13
View File
@@ -1,6 +1,5 @@
import BsModal from "../Bootstrap/Modal.js";
import HeightTransition from "../Tranistion/HeightTransition.js";
import MissingPermissionWidget from "../DashboardWidget/MissingPermission.js";
import { enableDragDropTouch } from "../../../../vendor/drag-drop-touch-js/dragdroptouch/dist/drag-drop-touch.esm.min.js";
@@ -113,12 +112,6 @@ export default {
isPinned() {
return this.place?.pinned ? true : false;
},
permitted() {
// widgets without a linked permission (or before the template loaded)
// are considered permitted; the backend sets permitted === false only
// when the user is missing the widget's required permission
return this.widgetTemplate?.permitted !== false;
},
ready() {
return this.component && this.arguments !== null;
}
@@ -176,11 +169,7 @@ export default {
&& this.widgetTemplate.widget_id
&& this.widgetTemplate.arguments
) {
// render the "missing permission" screen instead of the actual
// widget when the user does not hold the widget's linked permission
let component = this.permitted
? (await import(this.widgetTemplate.setup.file)).default
: MissingPermissionWidget;
let component = (await import(this.widgetTemplate.setup.file)).default;
this.$options.components["widget" + this.widgetTemplate.widget_id] = component;
this.component = "widget" + this.widgetTemplate.widget_id;
this.arguments = { ...this.widgetTemplate.arguments, ...this.config };
@@ -280,7 +269,7 @@ export default {
</template>
<!-- widget link -->
<a
v-if="widgetTemplate.setup.cis4link && permitted"
v-if="widgetTemplate.setup.cis4link"
:href="getWidgetC4Link(widgetTemplate)"
class="col-auto ms-auto"
:aria-label="$p.t('dashboard/widget_link')"
@@ -14,14 +14,10 @@ export default {
callbacks: {}
}),
computed: {
// filter widgets away the user has no permissions for
availableWidgets() {
return (this.widgets || []).filter(widget => widget.permitted !== false);
},
hasAnyWidgets() {
if (!this.widgets)
return false;
if (!this.availableWidgets.length && !this.hiddenWidgets?.length)
if (!this.widgets.length && !this.hiddenWidgets?.length)
return false;
return true;
}
@@ -58,7 +54,7 @@ export default {
<template v-slot:default>
<template v-if="widgets && hiddenWidgets">
<div
v-if="!availableWidgets.length && !hiddenWidgets.length"
v-if="!widgets.length && !hiddenWidgets.length"
class="row g-2"
>
<div>{{ $p.t('dashboard/noWidgetsAvailable') }}</div>
@@ -78,17 +74,16 @@ export default {
</div>
</div>
<div
v-if="availableWidgets.length"
v-if="widgets.length"
class="row g-2"
>
<template
v-for="widget in availableWidgets"
<div
v-for="widget in widgets"
:key="widget.widget_id"
class="widget-icon-container col-sm-6 col-md-4 col-lg-3 col-xl-2"
>
<div v-if="widget.permitted" class="widget-icon-container col-sm-6 col-md-4 col-lg-3 col-xl-2">
<widget-icon @select="pick" :widget="widget"></widget-icon>
</div>
</template>
<widget-icon @select="pick" :widget="widget"></widget-icon>
</div>
</div>
</template>
</template>
@@ -1,21 +0,0 @@
import AbstractWidget from './Abstract.js';
/**
* Fallback screen rendered in place of a widget when the current user is missing
* the permission (berechtigung_kurzbz) linked to that widget. Used for widgets
* that are already on a user's dashboard but whose required permission the user
* no longer holds.
*/
export default {
mixins: [
AbstractWidget
],
created() {
this.$emit('setConfig', false);
},
template: /*html*/`
<div class="dashboard-widget-missing-permission d-flex flex-column justify-content-center align-items-center text-center h-100 p-3 text-body-secondary">
<i class="fa-solid fa-lock fa-2x mb-2" aria-hidden="true"></i>
<p class="mb-0">{{ $p.t('dashboard/widget_missing_permission') }}</p>
</div>`
}
@@ -61,7 +61,6 @@ export default {
selected: [],
studiengang_kz: null,
selectedStudiensemester: this.defaultSemester,
preselected: null,
dropdowns: {
studiensemester_array: [],
sprachen_array: [],
@@ -74,11 +73,7 @@ export default {
calcheightonly: true,
types: [
"mitarbeiter",
"mitarbeiter_ohne_zuordnung",
/*
"lehreinheit",
"lehrveranstaltung",
*/
"mitarbeiter_ohne_zuordnung"
],
actions: {
employee: {
@@ -91,26 +86,6 @@ export default {
childactions: [
]
},
lehreinheit: {
defaultaction: {
type: "function",
action: (data) => {
this.onSelectLehreinheit(data);
}
},
childactions: [
]
},
lehrveranstaltung: {
defaultaction: {
type: "function",
action: (data) => {
this.onSelectLehrveranstaltung(data);
}
},
childactions: [
]
}
}
},
}
@@ -119,8 +94,6 @@ export default {
filter() {
let filter = {
emp: this.$route.params.emp,
le: this.$route.params.le,
lv: this.$route.params.lv,
studiensemester_kurzbz: this.selectedStudiensemester
};
let index;
@@ -132,7 +105,7 @@ export default {
if (index > -1)
filter.semester = this.$route.params.treemenu[index+1];
}
filter.activeFilter = filter.emp ? 'employee' : filter.stg ? 'verband' : filter.le ? 'lehreinheit' : filter.lv ? 'lehrveranstaltung' : null;
filter.activeFilter = filter.emp ? 'employee' : filter.stg ? 'verband' : null;
return filter;
},
emp() {
@@ -230,50 +203,20 @@ export default {
},
onSelectEmployee(emp)
{
let params = { ...this.$route.params }
delete params.le;
delete params.lv;
this.$router.push({
name: 'emp',
params: {
...params,
...this.$route.params,
emp
}
});
},
onSelectLehreinheit(lehreinheit)
{
this.$router.push({
name: 'le',
params: {
le: lehreinheit.id,
stdsem: lehreinheit.studiensemester_kurzbz.toLowerCase()
}
});
},
onSelectLehrveranstaltung(lehrveranstaltung)
{
this.$router.push({
name: 'lv',
params: {
lv: lehrveranstaltung.id,
stdsem: lehrveranstaltung?.studiensemester_kurzbz?.toLowerCase() ?? this.selectedStudiensemester.toLowerCase()
}
});
},
onSelectVerband({ path: link, stg_kz })
{
let params = { ...this.$route.params }
delete params.le;
delete params.lv;
this.$router.push({
name: this.$route.name == 'emp' ? 'emp' : 'treemenu',
params: {
...params,
...this.$route.params,
treemenu: link.split('/')
}
});
@@ -352,7 +295,7 @@ export default {
}
},
created() {
if (this.$route.name !== 'le' && this.$route.name !== 'lv' && !this.$route.params.stdsem) {
if (!this.$route.params.stdsem) {
this.$router.replace({
name: 'stdsem',
params: {
@@ -534,8 +477,7 @@ export default {
<template #top>
<lv-table ref="lvTable"
v-model:selected="selected"
@row-clicked="handleRowClicked"
@select-LV="onSelectLehrveranstaltung"
@row-clicked="handleRowClicked"
:filter="filter"
>
<template #filterzuruecksetzen v-if="filter.activeFilter === 'employee'">
@@ -57,8 +57,7 @@ export default {
},
emits: [
'update:selected',
'row-clicked',
'selectLV',
'row-clicked'
],
watch: {
filter: {
@@ -107,24 +106,8 @@ export default {
{
event: 'dataProcessed',
handler: (data) => {
if (this.$route.params.le)
{
this.$refs.table.tabulator.selectRow(this.$refs.table.tabulator.getRows());
}
else if (this.$route.params.lv)
{
this.$refs.table.tabulator.selectRow(this.$refs.table.tabulator.getRows());
this.allRows = this.getAllRows(this.$refs.table.tabulator.getRows());
this.allRows.forEach(row => {
row.treeExpand()
});
}
else
{
this.reexpandRows()
this.$emit('update:selected', {})
}
this.reexpandRows()
this.$emit('update:selected', {})
}
},
{
@@ -238,35 +221,35 @@ export default {
selectableRows: true,
rowContextMenu: (component, e) => {
if (e.getData()?.lehreinheit_id === undefined || !e.getData()?.lehreinheit_id)
return [];
if (e.getData()?.lehreinheit_id === undefined)
return;
return [
{
label: this.$p.t('lehre', 'lvteilkopieren'),
label: "LV-Teil kopieren",
menu: [
{
label: this.$p.t('lehre', 'alles'),
label: "Alles",
action: (e, row) =>
{
this.copyLehreinheit(row, "alle");
},
},
{
label: this.$p.t('lehre', 'nurlvteil'),
label: "Nur LV-Teil",
action: (e, row) =>
{
this.copyLehreinheit(row, "lvteil");
},
},
{
label: this.$p.t('lehre', 'nurmitgruppen'),
label: "Nur mit Gruppen",
action: (e, row) =>
{
this.copyLehreinheit(row, "gruppen");
},
},
{
label: this.$p.t('lehre', 'nurmitlehrende'),
label: "Nur mit Lehrenden",
action: (e, row) =>
{
this.copyLehreinheit(row, "lektoren");
@@ -275,21 +258,7 @@ export default {
],
},
{
label: this.$p.t('lehre', 'zurlvspringen'),
action: (e, row) => {
this.openLV(row)
},
},
{
label: this.$p.t('lehre', 'lvteillinkkopieren'),
action: (e, row) => {
let rowData = row.getData();
let link = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/LVVerwaltung/stdsem/' + rowData.studiensemester_kurzbz.toLowerCase() + '/le/' + rowData.lehreinheit_id;
navigator.clipboard.writeText(link);
},
},
{
label: this.$p.t('ui', 'entfernen'),
label: "Entfernen",
action: (e, row) => {
this.deleteLehreinheit(row)
},
@@ -386,7 +355,7 @@ export default {
},
buildApiUrl()
{
if (!['emp', 'treemenu', 'le', 'lv'].includes(this.$route.name))
if (!['emp', 'treemenu'].includes(this.$route.name))
return null;
let url = 'stdsem/' + this.$route.params.stdsem;
@@ -395,14 +364,6 @@ export default {
url += '/emp/' + this.$route.params.emp;
}
if (this.$route.params.le) {
url += '/le/' + this.$route.params.le;
}
if (this.$route.params.lv) {
url += '/lv/' + this.$route.params.lv;
}
if (this.$route.params.treemenu) {
url += '/' + this.$route.params.treemenu.join('/');
}
@@ -541,17 +502,6 @@ export default {
})
.catch(this.$fhcAlert.handleSystemError);
},
openLV(row)
{
let rowData = row.getData();
let data = {
id: rowData.lehrveranstaltung_id,
studiensemester_kurzbz: rowData.studiensemester_kurzbz
}
this.$emit('selectLV', data);
},
getAllRows(rows)
{
let result = [];
@@ -263,7 +263,7 @@ export default {
this.$refs[modalRef].hide();
},
reload() {
this.$refs.table?.reloadTable();
this.$refs.table.reloadTable();
},
searchFirma(event) {
if (this.abortController.firmen) {
@@ -30,9 +30,6 @@ export default {
computed: {
betreuerFormOpened() {
return this.newMode || this.editMode;
},
isMitarbeiter(){
return this.autocompleteSelectedBetreuer?.name?.includes('Mitarbeiter') ?? false;
}
},
props: {
@@ -433,11 +430,6 @@ export default {
},
actionKontaktdatenBearbeiten() {
if (!this.autocompleteSelectedBetreuer) return;
if (this.isMitarbeiter)
{
this.$fhcAlert.alertError(this.$p.t('ui', 'editingMitarbeiterPVonly'));
return;
}
this.$refs.kontaktdatenModal.show();
},
// stuff to do after new person has been saved
@@ -502,12 +494,7 @@ export default {
<button class="btn btn-outline-secondary" @click="actionNewPerson">{{ $p.t('projektarbeit', 'neuePersonAnlegen') }}</button>
</div>
<div class="col-6">
<button
class="btn btn-outline-secondary float-end"
@click="actionKontaktdatenBearbeiten"
>
{{ $p.t('projektarbeit', 'kontaktdatenBearbeiten') }}
</button>
<button class="btn btn-outline-secondary float-end" @click="actionKontaktdatenBearbeiten">{{ $p.t('projektarbeit', 'kontaktdatenBearbeiten') }}</button>
</div>
</div>
@@ -618,7 +605,7 @@ export default {
</contact>
</div>
</div>
</bs-modal>
</bs-modal>
`
}
@@ -1,62 +0,0 @@
import TemplateFrame from "./template/frame.js";
export default {
name: 'SearchbarResultTeachingUnit',
components: {
TemplateFrame
},
emits: [ 'actionexecuted' ],
props: {
res: Object,
actions: Object
},
template: `
<template-frame
class="searchbar-result-teachingunit"
:res="res"
:actions="actions"
:title="res.bezeichnung"
:image-fallback="res.foto"
@actionexecuted="$emit('actionexecuted')"
>
<div class="searchbar_table">
<div class="searchbar_tablerow">
<div class="searchbar_tablecell searchbar_label"> {{ res.type === 'lehreinheit' ? $p.t('lehre/lehreinheit') : $p.t('lehre/lehrveranstaltung') }}</div>
<div class="searchbar_tablecell searchbar_value">
{{ res.id }}
</div>
</div>
<div class="searchbar_tablerow">
<div class="searchbar_tablecell searchbar_label">{{ $p.t('lehre/studiengang') }}</div>
<div class="searchbar_tablecell searchbar_value">
{{ res.studiengang }}
</div>
</div>
<div class="searchbar_tablerow" v-if="res.oe_bezeichnung">
<div class="searchbar_tablecell searchbar_label">{{ $p.t('lehre/organisationseinheit') }}</div>
<div class="searchbar_tablecell searchbar_value">
{{ res.oe_bezeichnung }}
</div>
</div>
<div class="searchbar_tablerow" v-if="res.studiensemester_kurzbz">
<div class="searchbar_tablecell searchbar_label">{{ $p.t('lehre/studiensemester') }}</div>
<div class="searchbar_tablecell searchbar_value">
{{ res.studiensemester_kurzbz }}
</div>
</div>
<div class="searchbar_tablerow">
<div class="searchbar_tablecell searchbar_label">{{ $p.t('lehre/ausbildungssemester') }}</div>
<div class="searchbar_tablecell searchbar_value">
{{ res.semester }}
</div>
</div>
<div class="searchbar_tablerow">
<div class="searchbar_tablecell searchbar_label">{{ $p.t('lehre/lehrform') }}</div>
<div class="searchbar_tablecell searchbar_value">
{{ res.lehrform_kurzbz }}
</div>
</div>
</div>
</template-frame>`
};
@@ -8,7 +8,6 @@ import dms from "./result/dms.js";
import cms from "./result/cms.js";
import mergedStudent from "./result/mergedstudent.js";
import mergedPerson from "./result/mergedperson.js";
import teachingunit from "./result/teachingunit.js";
import { debounce } from "../../helpers/DebounceHelper.js";
export default {
@@ -24,7 +23,6 @@ export default {
cms,
mergedStudent,
mergedPerson,
teachingunit,
},
props: {
searchoptions: {
+1 -1
View File
@@ -103,7 +103,7 @@ require_once('dbupdate_3.4/76160_lvv_favorites.php');
require_once('dbupdate_3.4/77080_tabulator_presets_table.php');
require_once('dbupdate_3.4/78292_gehaltsanpassungtyp.php');
require_once('dbupdate_3.4/54225_reihungstest_ablauf_fuer_quereinsteiger.php');
require_once('dbupdate_3.4/77757_widgets_berechtigungen.php');
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
@@ -1,57 +0,0 @@
<?php
/* Copyright (C) 2026 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.
*
* Beschreibung:
* Dashboard Widgets: Verknüpfung einer (einzelnen) Berechtigung pro Widget.
* Neue Spalte dashboard.tbl_widget.berechtigung_kurzbz mit FK auf
* system.tbl_berechtigung. Ist die Spalte NULL, erfordert das Widget keine
* gesonderte Berechtigung. Benutzer denen die verknüpfte Berechtigung fehlt,
* bekommen das Widget nicht mehr zur Auswahl angezeigt bzw. sehen (falls bereits
* am Dashboard) einen "Fehlende Berechtigung"-Screen.
*/
if (! defined('DB_NAME')) exit('No direct script access allowed');
// Add column dashboard.tbl_widget.berechtigung_kurzbz (FK => system.tbl_berechtigung)
if ($result = @$db->db_query("
SELECT 1
FROM information_schema.columns
WHERE table_schema = 'dashboard'
AND table_name = 'tbl_widget'
AND column_name = 'berechtigung_kurzbz';"))
{
if ($db->db_num_rows($result) == 0)
{
$qry = "
ALTER TABLE dashboard.tbl_widget
ADD COLUMN berechtigung_kurzbz VARCHAR(32) NULL;
ALTER TABLE dashboard.tbl_widget
ADD CONSTRAINT tbl_widget_berechtigung_fk
FOREIGN KEY (berechtigung_kurzbz)
REFERENCES system.tbl_berechtigung (berechtigung_kurzbz)
ON UPDATE CASCADE ON DELETE SET NULL;";
if (!$db->db_query($qry))
{
echo '<strong>dashboard.tbl_widget: '.$db->db_last_error().'</strong><br>';
}
else
{
echo 'dashboard.tbl_widget: Spalte berechtigung_kurzbz (FK system.tbl_berechtigung) hinzugefuegt<br>';
}
}
}
+2 -182
View File
@@ -49620,26 +49620,6 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'dashboard',
'phrase' => 'widget_missing_permission',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Ihnen fehlt die erforderliche Berechtigung, um dieses Widget anzuzeigen.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'You do not have the permission required to display this widget.',
'description' => '',
'insertvon' => 'system'
)
)
),
// CIS4 phrases from legacy code end
// FHC4 Phrases Abschlusspruefung
array(
@@ -53372,146 +53352,6 @@ and represent the current state of research on the topic. The prescribed citatio
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'lvteilkopieren',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'LV-Teil kopieren',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Copy teaching unit',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'nurlvteil',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Nur LV-Teil',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Teaching unit only',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'nurmitgruppen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Nur mit Gruppen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'With groups only',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'nurmitlehrende',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Nur mit Lehrenden',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'With lecturers only',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'zurlvspringen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Zur LV Springen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Go to teaching unit',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'lvteillinkkopieren',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Link zu diesem LV-Teil kopieren',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Copy link to this teaching unit',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
'phrase' => 'alles',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Alles',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Everything',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehre',
@@ -61477,7 +61317,7 @@ I have been informed that I am under no obligation to consent to the transmissio
'insertvon' => 'system'
)
)
),
),
array(
'app' => 'core',
'category' => 'tabulator',
@@ -62751,28 +62591,8 @@ I have been informed that I am under no obligation to consent to the transmissio
'insertvon' => 'system'
)
)
),
// ### Infocenter Onboarding END
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'editingMitarbeiterPVonly',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Kontaktdaten von Mitarbeiter*innen dürfen nur in der Personalverwaltung editiert werden.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Employee contact details may only be edited in the personnel administration system.',
'description' => '',
'insertvon' => 'system'
)
)
)
// ### Infocenter Onboarding END
);
@@ -1,9 +1,9 @@
INSERT INTO lehre.tbl_projektarbeit
(projektarbeit_id, projekttyp_kurzbz, titel, lehreinheit_id, student_uid, firma_id, note, punkte, beginn, ende, faktor, freigegeben, gesperrtbis, stundensatz, themenbereich, anmerkung, updateamum, updatevon, insertamum, insertvon, ext_id, gesamtstunden, titel_english, sprache, seitenanzahl, abgabedatum, kontrollschlagwoerter, schlagwoerter, schlagwoerter_en, abstract, abstract_en, "final", lehrveranstaltung_id, studiensemester_kurzbz) VALUES
(1, 'Bachelor', 'Auswirkung der Sonneneinstrahlung auf die Gesundheit', 46111, 's46b413', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-12 14:06:10.000', 'anondata', NULL, 3.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true, 4611, NearestWintersemester(1)),
(2, 'Bachelor', 'Neue Unterrichtsmethoden mit KI', 46111, 's46b414', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-12 14:06:10.000', 'anondata', NULL, 3.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true, 4611, NearestWintersemester(1)),
(3, 'Bachelor', 'Betrugsbekämpfung bei Anwesenheitskontrolle', 46111, 's46b415', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-12 14:06:10.000', 'anondata', NULL, 3.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true, 4611, NearestWintersemester(1)),
(4, 'Bachelor', 'Neuronale Netze', 46111, 's46b416', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-12 14:06:10.000', 'anondata', NULL, 3.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true, 4611, NearestWintersemester(1))
(projektarbeit_id, projekttyp_kurzbz, titel, lehreinheit_id, student_uid, firma_id, note, punkte, beginn, ende, faktor, freigegeben, gesperrtbis, stundensatz, themenbereich, anmerkung, updateamum, updatevon, insertamum, insertvon, ext_id, gesamtstunden, titel_english, sprache, seitenanzahl, abgabedatum, kontrollschlagwoerter, schlagwoerter, schlagwoerter_en, abstract, abstract_en, "final") VALUES
(1, 'Bachelor', 'Auswirkung der Sonneneinstrahlung auf die Gesundheit', 46111, 's46b413', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-12 14:06:10.000', 'anondata', NULL, 3.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true),
(2, 'Bachelor', 'Neue Unterrichtsmethoden mit KI', 46111, 's46b414', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-12 14:06:10.000', 'anondata', NULL, 3.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true),
(3, 'Bachelor', 'Betrugsbekämpfung bei Anwesenheitskontrolle', 46111, 's46b415', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-12 14:06:10.000', 'anondata', NULL, 3.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true),
(4, 'Bachelor', 'Neuronale Netze', 46111, 's46b416', NULL, NULL, NULL, NULL, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, '2025-12-12 14:06:10.000', 'anondata', NULL, 3.0000, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, true)
;
INSERT INTO lehre.tbl_projektbetreuer