Basic Structure Automatic Tagging

- new library libTag
- new Job TagJob
- new entries for automatic tags in config stv.php
- automatic tagging of wiederholer and prewiederholer
This commit is contained in:
ma0068
2026-03-27 09:40:14 +01:00
parent cfe1307018
commit b20613f5d7
5 changed files with 363 additions and 3 deletions
+90
View File
@@ -0,0 +1,90 @@
<?php
/**
* FH-Complete
*
* @package FHC-Helper
* @author FHC-Team
* @copyright Copyright (c) 2026 fhcomplete.net
* @license GPLv3
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \DateTime as DateTime;
use \stdClass as stdClass;
class TagLib
{
const BATCHUSER = 'sftest';
const TYP_ZUORDNUNG = 'prestudent_id';
/**
* Object initialization
*/
public function __construct()
{
$this->_ci =& get_instance();
// Configs
$this->_ci->load->config('stv');
// Models
$this->_ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
$this->_ci->load->model('person/Person_model', 'PersonModel');
$this->_ci->load->model('person/Notiz_model', 'NotizModel');
$this->_ci->load->model('system/Notiztyp_model', 'NotiztypModel');
$this->_ci->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
// Tag-Helper
// Libraries
$this->_ci->load->library('PermissionLib');
$this->_ci->load->library('PrestudentLib');
}
public function getAutomatedTags($tag, $prestudentIds)
{
$prestudentIds = array_unique($prestudentIds);
$count = 0;
$tagged = [];
foreach ($prestudentIds as $value)
{
$resultInsertNotiz = $this->_ci->NotizModel->insert(array(
'titel' => 'TAG',
'text' => 'AUTOMATED TAG',
'verfasser_uid' => self::BATCHUSER,
'erledigt' => false,
'insertamum' => date('Y-m-d H:i:s'),
'insertvon' => self::BATCHUSER,
'typ' => $tag
));
if (isError($resultInsertNotiz))
return error ('Error occurred insert Result ' . $value);
$resultInsertZuordnung = $this->_ci->NotizzuordnungModel->insert(array(
'notiz_id' => $resultInsertNotiz->retval,
self::TYP_ZUORDNUNG => $value
));
if (isError($resultInsertZuordnung))
return error ('Error occurred insert Zuordnung' . $value);
$count++;
$tagged[] = $value;
}
return success([$count, $tagged]);
}
public function getAutomatedTagsStudiengang($studiengang_Kzs= null)
{
}
}