Compare commits

..

1 Commits

Author SHA1 Message Date
adisposkofh 0a4906c5ac added course-specific mailing lists 2026-05-13 16:07:43 +02:00
11 changed files with 89 additions and 319 deletions
-45
View File
@@ -1,45 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
$config['stv_menu'] = array(
'library' => 'treemenu/StvMenuLib',
'children' => array(
'stg' => array(
'library' => 'treemenu/StgLib',
/*
'children' => array(
'pre' => array(
'library' => 'treemenu/PrestudentLib'
),
'sem' => array(
'library' => 'treemenu/AusbSemesterLib',
'children' => array(
'vbd' => array(
'library' => 'treemenu/VerbandLib'
)
)
),
'orgform' => array(
'library' => 'treemenu/OrgFormLib',
'children' => array(
'pre' => array(
'library' => 'treemenu/PrestudentLib'
),
'sem' => array(
'library' => 'treemenu/AusbSemesterLib',
'children' => array(
'vbd' => array(
'library' => 'treemenu/VerbandLib'
)
)
)
)
)
)
*/
),
'inout' => array(
'library' => 'treemenu/InOutLib'
),
)
);
@@ -1,109 +0,0 @@
<?php
/**
* Copyright (C) 2024 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 3 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, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the back-end
* Provides data to the ajax get calls about verbände
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class TreeMenu extends FHCAPI_Controller
{
protected $treemenuconfig;
public function __construct()
{
parent::__construct([
'fullMenu' => ['admin:r', 'assistenz:r'],
'partMenu' => ['admin:r', 'assistenz:r'],
]);
}
public function fullMenu($treemenu=null)
{
if(is_null($treemenu))
{
$this->terminateWithError('missing parameter treemenu.');
}
$this->loadMenuConfig($treemenu);
$bhdebug = (object) array(
'treemenu' => $treemenu,
'treemenuconfig' => $this->treemenuconfig
);
$this->addMeta('bhdebug', $bhdebug);
$data = array();
$this->terminateWithSuccess($data);
}
public function partMenu($treemenu=null)
{
if(is_null($treemenu))
{
$this->terminateWithError('missing parameter treemenu.');
}
$this->loadMenuConfig($treemenu);
$startconfig = $this->findStartLib($this->treemenuconfig, array_keys($this->uri->uri_to_assoc(7)));
$libpath = $startconfig['library'];
$children = isset($startconfig['children']) ? $startconfig['children'] : array();
$libname = basename($startconfig['library']);
$this->load->library(
$libpath,
$children,
$libname
);
$bhdebug = (object) array(
'treemenu' => $treemenu,
'treemenuconfig' => $this->treemenuconfig,
'uri' => $this->uri->uri_to_assoc(7),
'libpath' => $libpath,
'libname' => $libname,
'children' => $children,
'startconfig' => $startconfig
);
$this->addMeta('bhdebug', $bhdebug);
//$this->addMeta('bhci', $this);
$data = $this->$libname->getSubMenu();
$this->terminateWithSuccess($data);
}
protected function findStartLib($config, $uri)
{
$level = array_shift($uri);
if(is_null($level)) {
return $config;
}
return $this->findStartLib($config['children'][$level], $uri);
}
protected function loadMenuConfig($treemenu)
{
$this->config->load('treemenu/' . $treemenu . '.php');
$this->treemenuconfig = $this->config->item($treemenu);
}
}
+53
View File
@@ -263,6 +263,59 @@ class ProfilLib{
$element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN;
return $element;
}, $mailverteiler_res);
$this->ci->load->model("crm/Student_model", "StudentModel");
$this->ci->StudentModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_student.student_uid");
$this->ci->StudentModel->addJoin("tbl_person", "tbl_benutzer.person_id = tbl_person.person_id");
$this->ci->StudentModel->addJoin("tbl_studiengang", "tbl_student.studiengang_kz = tbl_studiengang.studiengang_kz");
$this->ci->StudentModel->addSelect("matr_nr, semester, verband, gruppe, kurzbzlang");
$studentResult = $this->ci->StudentModel->loadWhere(["student_uid" => $uid]);
if (isError($studentResult)) {
return error(getData($studentResult));
}
$studentResultData = getData($studentResult);
$studentData = null;
if (is_array($studentResultData) && count($studentResultData)) {
$studentData = $studentResultData[0];
}
if ($studentData && $studentData->matr_nr) {
$this->ci->load->library("phrasesLib", ["profil"], "phrases");
$standardCourseVerteiler = trim($studentData->kurzbzlang) . "_STD";
$mailverteiler_res[] = [
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $standardCourseVerteiler,
"gruppe_kurzbz" => $standardCourseVerteiler,
"mailto" => "mailto:" . strtolower($standardCourseVerteiler) . "@" . DOMAIN,
];
$semesterVerteiler = trim($studentData->kurzbzlang) . trim($studentData->semester);
$mailverteiler_res[] = [
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $semesterVerteiler,
"gruppe_kurzbz" => $semesterVerteiler,
"mailto" => "mailto:" . strtolower($semesterVerteiler) . "@" . DOMAIN,
];
if ($studentData->verband && strlen(trim($studentData->verband))) {
$verbandVerteiler = $semesterVerteiler . trim($studentData->verband);
$mailverteiler_res[] = [
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $verbandVerteiler,
"gruppe_kurzbz" => $verbandVerteiler,
"mailto" => "mailto:" . strtolower($verbandVerteiler) . "@" . DOMAIN,
];
if ($studentData->gruppe && strlen(trim($studentData->gruppe))) {
$gruppeVerteiler = $verbandVerteiler . trim($studentData->gruppe);
$mailverteiler_res[] = [
"beschreibung" => $this->ci->phrases->t('profil', 'alleStudentenVon') . " " . $gruppeVerteiler,
"gruppe_kurzbz" => $gruppeVerteiler,
"mailto" => "mailto:" . strtolower($gruppeVerteiler) . "@" . DOMAIN,
];
}
}
}
return $mailverteiler_res;
}
@@ -1,42 +0,0 @@
<?php
require_once APPPATH . 'libraries/treemenu/TreeMenuLib.php';
/**
* Description of InOutLib
*
* @author bambi
*/
class InOutLib extends TreeMenuLib
{
public function getNodes()
{
return [
[
'name' => 'International',
'link' => 'inout',
'children' => [
[
'name' => 'Incoming',
'link' => 'inout/incoming',
'leaf' => true
],
[
'name' => 'Outgoing',
'link' => 'inout/outgoing',
'leaf' => true
],
[
'name' => 'Gemeinsame Studien',
'link' => 'inout/gemeinsamestudien',
'leaf' => true
]
]
]
];
}
public function getSubMenu()
{
return [];
}
}
-38
View File
@@ -1,38 +0,0 @@
<?php
require_once APPPATH . 'libraries/treemenu/TreeMenuLib.php';
/**
* Description of InOutLib
*
* @author bambi
*/
class StgLib extends TreeMenuLib
{
public function getNodes()
{
$this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
$res = $this->ci->StudiengangModel->loadWhere(array('aktiv' => true));
$stgs = hasData($res) ? getData($res) : array();
$this->ci->addMeta('bhstg', $stgs);
$nodes = array_map(
function($stg) {
return array(
'name' => strtoupper($stg->typ . $stg->kurzbz) . ' ' . $stg->bezeichnung,
'link' => 'stg/' . $stg->studiengang_kz,
'leaf' => false
);
},
$stgs
);
return $nodes;
}
public function getSubMenu()
{
return [
'StgLib' => 'test123'
];
}
}
@@ -1,23 +0,0 @@
<?php
require_once APPPATH . 'libraries/treemenu/TreeMenuLib.php';
/**
* Description of StvMenuLib
*
* @author bambi
*/
class StvMenuLib extends TreeMenuLib
{
public function getSubMenu()
{
$nodes = array();
foreach($this->children_config as $childconfig)
{
$childlib = basename($childconfig['library']);
$childnodes = $this->ci->$childlib->getNodes();
$nodes = array_merge($nodes, $childnodes);
}
return $nodes;
}
}
@@ -1,39 +0,0 @@
<?php
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
*/
/**
* Description of InOutLib
*
* @author bambi
*/
abstract class TreeMenuLib
{
protected $ci;
protected $children_config;
public function __construct($children_config)
{
$this->ci =& get_instance();
$this->children_config = $children_config;
foreach($this->children_config as $child_config)
{
$grandchildren_config = isset($child_config['children']) ? $child_config['children'] : [];
$this->ci->load->library($child_config['library'], $grandchildren_config, basename($child_config['library']));
}
}
public function getNode($name)
{
$node = array(
'name' => $name
);
return $node;
}
public abstract function getSubMenu();
}
@@ -40,9 +40,7 @@ abstract class AbstractBestandteil implements IValidation
if( is_bool($new_value) && ($old_value !== $new_value) ) {
$this->modifiedcolumns[$columnname] = $columnname;
} else if(is_null($old_value) xor is_null($new_value)) {
$this->modifiedcolumns[$columnname] = $columnname;
} else if($old_value != $new_value) {
} else if($old_value != $new_value) {
$this->modifiedcolumns[$columnname] = $columnname;
}
}
@@ -137,25 +137,19 @@ EOTXT;
return parent::__toString() . $txt;
}
public function validate()
/* public function validate()
{
$value = $this->vordienstzeit;
if ($value === null || $value === '') {
$result = null; // allow null value
} else {
$result = filter_var($value, FILTER_VALIDATE_INT, [
'options' => [
'min_range' => 0,
'max_range' => 100
]
]);
if ($result === false) {
$this->validationerrors[] = 'Vordienstjahre muss eine ganze Zahl (0 bis 100) enthalten oder leer sein.';
}
if( !(filter_var($this->tage, FILTER_VALIDATE_INT,
array(
'options' => array(
'min_range' => 1,
'max_range' => 50
)
)
)) ) {
$this->validationerrors[] = 'Urlaubsanspruch muss eine Tagesanzahl im Bereich 1 bis 50 sein.';
}
return parent::validate();
}
} */
}
+2 -2
View File
@@ -264,8 +264,8 @@ CREATE TABLE IF NOT EXISTS hr.tbl_vertragsbestandteil_lohnguide (
stellenbezeichnung varchar(255),
fachrichtung_kurzbz character varying(32) NOT NULL,
modellstelle_kurzbz character varying(32) NOT NULL,
kommentar_person text,
kommentar_modellstelle text,
kommentar_person varchar(255),
kommentar_modellstelle varchar(255),
CONSTRAINT tbl_vertragsbestandteil_lohnguide_pk PRIMARY KEY (vertragsbestandteil_id),
CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT tbl_vertragsbestandteil_lohnguide_fachrichtung_fk FOREIGN KEY (fachrichtung_kurzbz) REFERENCES hr.tbl_lohnguide_fachrichtung (fachrichtung_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE,
+22 -1
View File
@@ -29562,7 +29562,8 @@ array(
'insertvon' => 'system'
)
)
), array(
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'sem_short',
@@ -29582,6 +29583,26 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'profil',
'phrase' => 'alleStudentenVon',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Alle StudentInnen aus',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'All students from',
'description' => '',
'insertvon' => 'system'
)
)
),
//Profil Phrasen ende
// LvPlan Phrasen start
array(