mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ed3031dad | |||
| cb7a0f7669 | |||
| 68d97a5e97 | |||
| d27071528f | |||
| 17772c3738 | |||
| bbb4f8a01c | |||
| b7e48633ab | |||
| 7f13c128f1 | |||
| 58a921b500 | |||
| 21d80905a2 |
@@ -78,52 +78,32 @@ class Dokumente extends FHCAPI_Controller
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Studiengang_kz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$resultPreDoc = $this->_getPrestudentDokumente($prestudent_id);
|
||||
|
||||
$arrayAccepted = [];
|
||||
$person_id = $this->_getPersonId($prestudent_id);
|
||||
|
||||
$docNames = array_map(function ($item) {
|
||||
return $item->dokument_kurzbz;
|
||||
}, $resultPreDoc);
|
||||
$mergedArray = [];
|
||||
|
||||
foreach($docNames as $doc)
|
||||
foreach ($resultPreDoc as $pre)
|
||||
{
|
||||
$result = $this->AkteModel->getAktenFAS($person_id, $doc, $studiengang_kz, $prestudent_id, true);
|
||||
$result = $this->AkteModel->getAktenFAS($person_id, $pre->dokument_kurzbz, $studiengang_kz, $prestudent_id, true);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$data = getData($result);
|
||||
foreach ($data as $value)
|
||||
foreach (getData($result) as $doc)
|
||||
{
|
||||
array_push($arrayAccepted, $value);
|
||||
$merged = clone $doc;
|
||||
$merged->docdatum = $pre->docdatum;
|
||||
$merged->insertvonma = $pre->insertvonma;
|
||||
$merged->bezeichnung = $pre->bezeichnung;
|
||||
$mergedArray[] = $merged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Mapping with document_kurzbz
|
||||
$preDocMap = [];
|
||||
foreach ($resultPreDoc as $pre) {
|
||||
$preDocMap[$pre->dokument_kurzbz] = $pre;
|
||||
}
|
||||
|
||||
$mergedArray = [];
|
||||
foreach ($arrayAccepted as $doc) {
|
||||
$merged = clone $doc;
|
||||
|
||||
if (isset($preDocMap[$doc->dokument_kurzbz])) {
|
||||
$merged->docdatum = $preDocMap[$doc->dokument_kurzbz]->docdatum;
|
||||
$merged->insertvonma = $preDocMap[$doc->dokument_kurzbz]->insertvonma;
|
||||
$merged->bezeichnung = $preDocMap[$doc->dokument_kurzbz]->bezeichnung;
|
||||
} else {
|
||||
$merged->akzeptiertdatum = null;
|
||||
$merged->akzeptiertvon = null;
|
||||
else
|
||||
{
|
||||
$mergedArray[] = $pre;
|
||||
}
|
||||
|
||||
$mergedArray[] = $merged;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($mergedArray);
|
||||
|
||||
@@ -673,6 +673,58 @@ class AntragJob extends JOB_Controller
|
||||
$this->logInfo('Ende Job sendAufforderungWiederholer');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Reminder to Assistance of Wiederholer with a Second Negative Commissional Exam
|
||||
*
|
||||
*/
|
||||
public function sendReminderWiederholerWithNegativeCommissionalExam()
|
||||
{
|
||||
$this->logInfo('Start Job sendReminderWiederholerWithNegativeCommissionalExam');
|
||||
|
||||
$this->load->library('PrestudentLib');
|
||||
$result = $this->PruefungModel->getAllExRepeaterWithNewNegativeCommissionalExams();
|
||||
if (isError($result)) {
|
||||
print_r(getError($result));
|
||||
}
|
||||
$dataExrepeater = getData($result) ?: [];
|
||||
$count = 0;
|
||||
|
||||
foreach ($dataExrepeater as $exrepeater) {
|
||||
|
||||
$result = $this->PrestudentModel->load($exrepeater->prestudent_id);
|
||||
if (!hasData($result)) {
|
||||
$this->logWarning('No Prestudent found');
|
||||
continue;
|
||||
}
|
||||
$prestudent = current(getData($result));
|
||||
$result = $this->StudiengangModel->load($prestudent->studiengang_kz);
|
||||
if (!hasData($result)) {
|
||||
$this->logWarning('No Studiengang found');
|
||||
continue;
|
||||
}
|
||||
$studiengang = current(getData($result));
|
||||
$result = $this->PersonModel->loadPrestudent($exrepeater->prestudent_id);
|
||||
if (!hasData($result)) {
|
||||
$this->logWarning('No Person found');
|
||||
continue;
|
||||
}
|
||||
$person = current(getData($result));
|
||||
$count++;
|
||||
$email = $studiengang->email;
|
||||
$dataMail = array(
|
||||
'prestudent' => 'PreStudentId: ' . $exrepeater->prestudent_id,
|
||||
'name' => trim($person->vorname . ' ' . $person->nachname),
|
||||
//'emailAn' => $email
|
||||
);
|
||||
|
||||
if (!sendSanchoMail('Sancho_Mail_Antrag_W_EX_W', $dataMail, $email, 'Kommissionelle Prüfung ehemalige*r Wiederholer*in')) {
|
||||
$this->logWarning("Failed to send Notification to " . $email);
|
||||
}
|
||||
}
|
||||
$this->logInfo($count . " Mails sent");
|
||||
$this->logInfo('End Job sendReminderWiederholerWithNegativeCommissionalExam');
|
||||
}
|
||||
|
||||
protected function prestudentsGetUnique($prestudents)
|
||||
{
|
||||
$result = [];
|
||||
|
||||
@@ -40,7 +40,9 @@ abstract class AbstractBestandteil implements IValidation
|
||||
|
||||
if( is_bool($new_value) && ($old_value !== $new_value) ) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
} else if($old_value != $new_value) {
|
||||
} else if(is_null($old_value) xor is_null($new_value)) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
} else if($old_value != $new_value) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,19 +137,25 @@ EOTXT;
|
||||
return parent::__toString() . $txt;
|
||||
}
|
||||
|
||||
/* public function validate()
|
||||
public function validate()
|
||||
{
|
||||
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.';
|
||||
$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.';
|
||||
}
|
||||
}
|
||||
|
||||
return parent::validate();
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,4 +306,35 @@ class Pruefung_model extends DB_Model
|
||||
|
||||
return $this->loadWhereCommitteeExamsFailed();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getAllExRepeaterWithNewNegativeCommissionalExams()
|
||||
{
|
||||
$query = "
|
||||
SELECT DISTINCT antrag.prestudent_id
|
||||
FROM lehre.tbl_pruefung p
|
||||
JOIN lehre.tbl_note n USING (note)
|
||||
JOIN (
|
||||
SELECT
|
||||
stud.student_uid,
|
||||
antr.datum,
|
||||
antr.prestudent_id
|
||||
FROM campus.tbl_studierendenantrag antr
|
||||
JOIN public.tbl_prestudent ps USING (prestudent_id)
|
||||
JOIN public.tbl_student stud USING (prestudent_id)
|
||||
JOIN public.tbl_benutzer ben ON (ben.uid = stud.student_uid)
|
||||
WHERE antr.typ = 'Wiederholung'
|
||||
AND ben.aktiv = true
|
||||
) antrag ON antrag.student_uid = p.student_uid
|
||||
WHERE n.note IN (20, 13, 5, 15, 14) -- 9 (noch nicht eingetragen ist negativ)
|
||||
AND p.pruefungstyp_kurzbz IN ('kommPruef', 'zusKommPruef')
|
||||
AND p.datum > antrag.datum
|
||||
";
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 varchar(255),
|
||||
kommentar_modellstelle varchar(255),
|
||||
kommentar_person text,
|
||||
kommentar_modellstelle text,
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user