mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 16:32:20 +00:00
Merge branch 'master' into messages
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// Header menu
|
||||
|
||||
$config['navigation_header'] = array(
|
||||
@@ -22,16 +20,8 @@ $config['navigation_header'] = array(
|
||||
'icon' => '',
|
||||
'description' => 'Vilesci',
|
||||
'expand' => true,
|
||||
'sort' => 1,
|
||||
'requiredPermissions' => 'basis/vilesci:r'
|
||||
),
|
||||
'reihungstest' => array(
|
||||
'link' => site_url('organisation/Reihungstest'),
|
||||
'icon' => 'list-ol',
|
||||
'description' => 'Reihungstests',
|
||||
'expand' => true,
|
||||
'sort' => 10,
|
||||
'requiredPermissions' => 'infocenter:r'
|
||||
'requiredPermissions' => 'basis/vilesci:r'
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -47,14 +37,20 @@ $config['navigation_header'] = array(
|
||||
'description' => 'CIS',
|
||||
'sort' => 10
|
||||
),
|
||||
'infocenter' => array(
|
||||
'link' => site_url('system/infocenter/InfoCenter'),
|
||||
'icon' => 'info',
|
||||
'description' => 'Infocenter',
|
||||
'reihungstest' => array(
|
||||
'link' => site_url('organisation/Reihungstest'),
|
||||
'description' => 'Reihungstests',
|
||||
'expand' => true,
|
||||
'sort' => 20,
|
||||
'requiredPermissions' => 'infocenter:r'
|
||||
),
|
||||
'infocenter' => array(
|
||||
'link' => site_url('system/infocenter/InfoCenter'),
|
||||
'description' => 'Infocenter',
|
||||
'expand' => true,
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'infocenter:r'
|
||||
),
|
||||
)
|
||||
),
|
||||
'Personen' => array(
|
||||
@@ -71,6 +67,23 @@ $config['navigation_header'] = array(
|
||||
'requiredPermissions' => 'admin:r'
|
||||
)
|
||||
)
|
||||
),
|
||||
'Administration' => array(
|
||||
'link' => '#',
|
||||
'icon' => 'gear',
|
||||
'description' => 'Administration',
|
||||
'expand' => false,
|
||||
'sort' => 50,
|
||||
'requiredPermissions' => 'admin:r',
|
||||
'children'=> array(
|
||||
'extensions' => array(
|
||||
'link' => site_url('system/extensions/Manager'),
|
||||
'description' => 'Extensions Manager',
|
||||
'expand' => true,
|
||||
'sort' => 10,
|
||||
'requiredPermissions' => 'admin:r'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -86,55 +99,6 @@ $config['navigation_menu']['Vilesci/index'] = array(
|
||||
'description' => 'Dashboard',
|
||||
'icon' => 'dashboard',
|
||||
'sort' => 1
|
||||
),
|
||||
'lehre' => array(
|
||||
'link' => '#',
|
||||
'icon' => 'graduation-cap',
|
||||
'description' => 'Lehre',
|
||||
'expand' => true,
|
||||
'sort' => 2,
|
||||
'children'=> array(
|
||||
'cis' => array(
|
||||
'link' => CIS_ROOT,
|
||||
'icon' => '',
|
||||
'description' => 'CIS',
|
||||
'expand' => true,
|
||||
'sort' => 1
|
||||
),
|
||||
'infocenter' => array(
|
||||
'link' => site_url('system/infocenter/InfoCenter'),
|
||||
'icon' => 'info',
|
||||
'description' => 'Infocenter',
|
||||
'expand' => true,
|
||||
'sort' => 2,
|
||||
'requiredPermissions' => 'infocenter:r'
|
||||
),
|
||||
)
|
||||
),
|
||||
'administration' => array(
|
||||
'link' => '#',
|
||||
'icon' => 'gear',
|
||||
'description' => 'Administration',
|
||||
'expand' => false,
|
||||
'sort' => 3,
|
||||
'children'=> array(
|
||||
'vilesci' => array(
|
||||
'link' => base_url('vilesci'),
|
||||
'icon' => '',
|
||||
'description' => 'Vilesci',
|
||||
'expand' => true,
|
||||
'sort' => 1,
|
||||
'requiredPermissions' => 'basis/vilesci:r'
|
||||
),
|
||||
'extensions' => array(
|
||||
'link' => site_url('system/extensions/Manager'),
|
||||
'icon' => 'cubes',
|
||||
'description' => 'Extensions Manager',
|
||||
'expand' => true,
|
||||
'sort' => 2,
|
||||
'requiredPermissions' => 'admin:r'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
/* Copyright (C) 2019 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.
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
if (! defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class LVPlanJob extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* Initialize LVPlanJob Class
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// An empty array as parameter will ensure that this controller is ONLY callable from command line
|
||||
parent::__construct(array());
|
||||
|
||||
if ($this->input->is_cli_request())
|
||||
{
|
||||
$cli = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->output->set_status_header(403, 'Jobs must be run from the CLI');
|
||||
echo "Jobs must be run from the CLI";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Main function index as help
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$result = "The following are the available command line interface commands\n\n";
|
||||
$result .= "php ".$this->config->item('index_page')." jobs/LVPlanJob AddDirectGroups";
|
||||
|
||||
echo $result.PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check all Courses with direkt Groups attached and adds the Groups to the Schedule if missing
|
||||
*/
|
||||
public function addDirectGroups()
|
||||
{
|
||||
$studiensemester_arr = array();
|
||||
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('ressource/Stundenplandev_model', 'StundenplandevModel');
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
|
||||
|
||||
// Get actual Studiensemester
|
||||
$resultsem = $this->StudiensemesterModel->getAktOrNextSemester();
|
||||
|
||||
if(hasData($resultsem))
|
||||
{
|
||||
$studiensemester_arr[] = $resultsem->retval[0]->studiensemester_kurzbz;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'kein Studiensemester gefunden';
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get nearest Studiensemester to actual
|
||||
$resultsem = $this->StudiensemesterModel->getNearestFrom($studiensemester_arr[0]);
|
||||
if(hasData($resultsem))
|
||||
{
|
||||
$studiensemester_arr[] = $resultsem->retval[0]->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
foreach($studiensemester_arr as $studiensemester)
|
||||
{
|
||||
echo "LVPlanJob/addDirectGroups Studiensemester: ".$studiensemester."\n";
|
||||
$succ = 0;
|
||||
$fail = 0;
|
||||
|
||||
// get all schedule entries where group is missing
|
||||
$result = $this->StundenplandevModel->getMissingDirectGroups($studiensemester);
|
||||
if(hasData($result))
|
||||
{
|
||||
foreach($result->retval as $row)
|
||||
{
|
||||
$this->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung','lehrveranstaltung_id');
|
||||
$result_le = $this->LehreinheitModel->loadWhere(array('lehreinheit_id' => $row->lehreinheit_id));
|
||||
|
||||
// load additional data of course
|
||||
$unr = null;
|
||||
$stg_kz = null;
|
||||
$semester = null;
|
||||
$gruppe_kurzbz = null;
|
||||
|
||||
if (hasData($result_le))
|
||||
{
|
||||
$le = $result_le->retval[0];
|
||||
$unr = $le->unr;
|
||||
$stg_kz = $le->studiengang_kz;
|
||||
$semester = $le->semester;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Failed to load Lehreinheit '.$row->lehreinheit_id;
|
||||
$fail++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// get direct group if course
|
||||
$result_leg = $this->LehreinheitgruppeModel->getDirectGroup($row->lehreinheit_id);
|
||||
if (hasData($result_leg))
|
||||
{
|
||||
$gruppe_kurzbz = $result_leg->retval[0]->gruppe_kurzbz;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Failed to load direct group for le '.$row->lehreinheit_id;
|
||||
$fail++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// add group to schedule
|
||||
$result = $this->StundenplandevModel->insert(
|
||||
array(
|
||||
'lehreinheit_id' => $row->lehreinheit_id,
|
||||
'unr' => $unr,
|
||||
'studiengang_kz' => $stg_kz,
|
||||
'semester' => $semester,
|
||||
'verband' => '',
|
||||
'gruppe' => '',
|
||||
'gruppe_kurzbz' => $gruppe_kurzbz,
|
||||
'mitarbeiter_uid' => $row->mitarbeiter_uid,
|
||||
'ort_kurzbz' => $row->ort_kurzbz,
|
||||
'datum' => $row->datum,
|
||||
'stunde' => $row->stunde,
|
||||
'titel' => null,
|
||||
'anmerkung' => null,
|
||||
'fix' => false,
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => 'lvplanjob',
|
||||
'insertvon' => 'lvplanjob',
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$succ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$fail++;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "New Entries ".$succ."\n";
|
||||
echo "Failed ".$fail."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,7 @@ class ReihungstestJob extends FHC_Controller
|
||||
|
||||
// Load models
|
||||
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
// Load helpers
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
@@ -102,6 +103,304 @@ class ReihungstestJob extends FHC_Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function runZentraleReihungstestAnmeldefristAssistenzJob()
|
||||
{
|
||||
// Get placement tests where registration date was yesterday
|
||||
$result = $this->ReihungstestModel->checkReachedRegistrationDate(11000);
|
||||
|
||||
$reachedRegistration_rt_arr = array();
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$reachedRegistration_rt_arr = $result->retval;
|
||||
}
|
||||
elseif (isError($result))
|
||||
{
|
||||
show_error($result->error);
|
||||
}
|
||||
|
||||
$applicants_arr = array();
|
||||
|
||||
foreach ($reachedRegistration_rt_arr as $reihungstest)
|
||||
{
|
||||
$applicants = $this->ReihungstestModel->getApplicantsOfPlacementTestForCronjob($reihungstest->reihungstest_id);
|
||||
|
||||
if (hasData($applicants))
|
||||
{
|
||||
$applicants_arr = $applicants->retval;
|
||||
}
|
||||
elseif (isError($applicants))
|
||||
{
|
||||
show_error($applicants->error);
|
||||
}
|
||||
|
||||
// Get all Bachelor-Degree-Programs with Mailadress
|
||||
$bachelorStudiengeange = $this->StudiengangModel->loadStudiengaengeFromTyp('b');
|
||||
|
||||
if (hasData($bachelorStudiengeange))
|
||||
{
|
||||
$bachelorStudiengeange_arr = $bachelorStudiengeange->retval;
|
||||
}
|
||||
elseif (isError($bachelorStudiengeange))
|
||||
{
|
||||
show_error($bachelorStudiengeange->error);
|
||||
}
|
||||
|
||||
// If a person ist an applicant of this degree-program send mail with application data
|
||||
// Otherwise inform assistant, that no applicant is registered in this test
|
||||
foreach ($bachelorStudiengeange_arr as $bachelorStudiengang)
|
||||
{
|
||||
$studiengang_kuerzel = strtoupper($bachelorStudiengang->typ.$bachelorStudiengang->kurzbz);
|
||||
$applicants_list = '';
|
||||
$applicantCounter = 0;
|
||||
$rowstyle = 'style="background-color: #EEEEEE; padding: 4px;"';
|
||||
$mailReceipients = ''; // String with all mailadresses
|
||||
$mailcontent_data_arr = array();
|
||||
foreach ($applicants_arr as $applicant)
|
||||
{
|
||||
if ($bachelorStudiengang->studiengang_kz == $applicant->studiengang_kz)
|
||||
{
|
||||
$mailReceipients .= $applicant->email. ';';
|
||||
$applicantCounter ++;
|
||||
$applicants_list .= '
|
||||
<tr '.$rowstyle.'>
|
||||
<td>'. $applicant->orgform_kurzbz. '</td>
|
||||
<td>'. $applicant->ausbildungssemester. '</td>
|
||||
<td>'. $applicant->nachname. '</td>
|
||||
<td>'. $applicant->vorname. '</td>
|
||||
<td>'. $applicant->zgv_kurzbz. '</td>
|
||||
<td>'. $applicant->prioritaet. '</td>
|
||||
<td>'. $applicant->qualifikationskurs. '</td>
|
||||
<td><a href="mailto:'. $applicant->email. '">'. $applicant->email. '</a></td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
}
|
||||
if ($applicantCounter == 0)
|
||||
{
|
||||
$mailcontent = '<p style="font-family: verdana, sans-serif;">Der Anmeldeschluss für den zentralen Reihungstest am ' . date_format(date_create($reihungstest->datum), 'd.m.Y') . ' um ' . $reihungstest->uhrzeit . ' Uhr wurde gestern erreicht.</p>';
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><b>Für den Studiengang '.$studiengang_kuerzel.' nehmen keine InteressentInnen an diesem Reihungstest teil</b></p>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$headerstyle = 'style="background: #DCE4EF; border: 1px solid #FFF; padding: 4px; text-align: left;"';
|
||||
|
||||
$mailcontent = '<p style="font-family: verdana, sans-serif;">Der Anmeldeschluss für den zentralen Reihungstest am ' . date_format(date_create($reihungstest->datum), 'd.m.Y') . ' um ' . $reihungstest->uhrzeit . ' Uhr wurde gestern erreicht.</p>';
|
||||
$mailcontent .= '
|
||||
<p style="font-family: verdana, sans-serif;">Folgende ' . $applicantCounter . ' InteressentInnen des Studiengangs ' . $studiengang_kuerzel . ' nehmen daran teil:</p>
|
||||
<table width="100%" style="cellpadding: 3px; font-family: verdana, sans-serif; border: 1px solid #000000;">
|
||||
<thead>
|
||||
<th '.$headerstyle.'>OrgForm</th>
|
||||
<th '.$headerstyle.'>Semester</th>
|
||||
<th '.$headerstyle.'>Nachname</th>
|
||||
<th '.$headerstyle.'>Vorname</th>
|
||||
<th '.$headerstyle.'>ZGV</th>
|
||||
<th '.$headerstyle.'>Priorität</th>
|
||||
<th '.$headerstyle.'>Qualikurs</th>
|
||||
<th '.$headerstyle.'>E-Mail</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
$mailcontent .= $applicants_list;
|
||||
$mailcontent .= '
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><a href="mailto:?bcc=' . $mailReceipients . '">Mail an alle schicken</a></p>';
|
||||
}
|
||||
$mailcontent_data_arr['table'] = $mailcontent;
|
||||
//$mailcontent_data_arr['link'] = $this->VILESCI_RT_VERWALTUNGS_URL;
|
||||
//var_dump($mailcontent_data_arr);
|
||||
// Send email in Sancho design
|
||||
if (!isEmptyString($mailcontent))
|
||||
{
|
||||
sendSanchoMail(
|
||||
'Sancho_ReihungstestteilnehmerJob',
|
||||
$mailcontent_data_arr,
|
||||
array($bachelorStudiengang->email,'kindlm@technikum-wien.at'),
|
||||
'Anmeldeschluss Reihungstest ' . date_format(date_create($reihungstest->datum), 'd.m.Y') . ' ' . $reihungstest->uhrzeit . ' Uhr',
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Checks, if an applicant was assigned to a test after Anmeldefrist
|
||||
public function runZentraleReihungstestNachtraeglichHinzugefuegtJob()
|
||||
{
|
||||
// Get applicants that have been added to a test after Anmeldefrist
|
||||
$result = $this->ReihungstestModel->getApplicantAssignedAfterDate(11000);
|
||||
|
||||
$applicants_after_anmeldefrist_arr = array();
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$applicants_after_anmeldefrist_arr = $result->retval;
|
||||
}
|
||||
elseif (isError($result))
|
||||
{
|
||||
show_error($result->error);
|
||||
}
|
||||
|
||||
$studiengang = '';
|
||||
$mailReceipients = ''; // String with all mailadresses
|
||||
$mailcontent_data_arr = array();
|
||||
$headerstyle = 'style="background: #DCE4EF; border: 1px solid #FFF; padding: 4px; text-align: left;"';
|
||||
$rowstyle = 'style="background-color: #EEEEEE; padding: 4px;"';
|
||||
$mailcontent = '';
|
||||
$applicants_list = '';
|
||||
|
||||
if (count($applicants_after_anmeldefrist_arr) > 0)
|
||||
{
|
||||
foreach ($applicants_after_anmeldefrist_arr as $applicant)
|
||||
{
|
||||
if ($studiengang != $applicant->studiengang_kz)
|
||||
{
|
||||
if ($studiengang != '' && $studiengang != $applicant->studiengang_kz)
|
||||
{
|
||||
$bachelorStudiengang = $this->StudiengangModel->load($studiengang);
|
||||
$mailcontent .= $applicants_list;
|
||||
$mailcontent .= '</tbody></table>';
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><a href="mailto:?bcc=' . $mailReceipients . '">Mail an alle schicken</a></p>';
|
||||
$mailcontent_data_arr['table'] = $mailcontent;
|
||||
sendSanchoMail(
|
||||
'Sancho_ReihungstestteilnehmerJob',
|
||||
$mailcontent_data_arr,
|
||||
array($bachelorStudiengang->retval[0]->email,'kindlm@technikum-wien.at'),
|
||||
'InteressentIn nach Reihungstest-Anmeldeschluss hinzugefügt',
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg');
|
||||
$applicants_list = '';
|
||||
$mailcontent_data_arr = array();
|
||||
}
|
||||
|
||||
$mailcontent = '<p style="font-family: verdana, sans-serif;">Folgende InteressentInnen wurden <b>nach</b> der Anmeldefrist zu einem Reihungstest hinzugefügt.</p>';
|
||||
$mailcontent .= '
|
||||
<table width="100%" style="cellpadding: 3px; font-family: verdana, sans-serif; border: 1px solid #000000;">
|
||||
<thead>
|
||||
<th ' . $headerstyle . '>Datum des Tests</th>
|
||||
<th ' . $headerstyle . '>Uhrzeit des Tests</th>
|
||||
<th ' . $headerstyle . '>OrgForm</th>
|
||||
<th ' . $headerstyle . '>Semester</th>
|
||||
<th ' . $headerstyle . '>Nachname</th>
|
||||
<th ' . $headerstyle . '>Vorname</th>
|
||||
<th ' . $headerstyle . '>ZGV</th>
|
||||
<th ' . $headerstyle . '>Priorität</th>
|
||||
<th ' . $headerstyle . '>Qualikurs</th>
|
||||
<th ' . $headerstyle . '>E-Mail</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
';
|
||||
}
|
||||
|
||||
$studiengang = $applicant->studiengang_kz;
|
||||
$mailReceipients .= $applicant->email . ';';
|
||||
$applicants_list .= '
|
||||
<tr ' . $rowstyle . '>
|
||||
<td>' . date_format(date_create($applicant->datum), 'd.m.Y') . '</td>
|
||||
<td>' . $applicant->uhrzeit . '</td>
|
||||
<td>' . $applicant->orgform_kurzbz . '</td>
|
||||
<td>' . $applicant->ausbildungssemester . '</td>
|
||||
<td>' . $applicant->nachname . '</td>
|
||||
<td>' . $applicant->vorname . '</td>
|
||||
<td>' . $applicant->zgv_kurzbz . '</td>
|
||||
<td>' . $applicant->prioritaet . '</td>
|
||||
<td>' . $applicant->qualifikationskurs . '</td>
|
||||
<td><a href="mailto:' . $applicant->email . '">' . $applicant->email . '</a></td>
|
||||
</tr>
|
||||
';
|
||||
};
|
||||
$bachelorStudiengang = $this->StudiengangModel->load($studiengang);
|
||||
$mailcontent .= $applicants_list;
|
||||
$mailcontent .= '</tbody></table>';
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><a href="mailto:?bcc=' . $mailReceipients . '">Mail an alle schicken</a></p>';
|
||||
$mailcontent_data_arr['table'] = $mailcontent;
|
||||
sendSanchoMail(
|
||||
'Sancho_ReihungstestteilnehmerJob',
|
||||
$mailcontent_data_arr,
|
||||
array($bachelorStudiengang->retval[0]->email,'kindlm@technikum-wien.at'),
|
||||
'InteressentIn nach Reihungstest-Anmeldeschluss hinzugefügt',
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg');
|
||||
}
|
||||
}
|
||||
|
||||
public function runRemindApplicantsOfPlacementTestJob()
|
||||
{
|
||||
// Get placement tests with testdate within 3 working days
|
||||
|
||||
// Check if today +3 days is working day
|
||||
$todayPlus3 = date('Y-m-d', strtotime("+3 days"));
|
||||
|
||||
if (getWorkingDays($todayPlus3, $todayPlus3) == 0)
|
||||
{
|
||||
// If not increase counting days till next working day
|
||||
for ($i = 3; $i < 100; $i++)
|
||||
{
|
||||
$dateToCheck = date('Y-m-d', strtotime("+".$i." days"));
|
||||
if (getWorkingDays($dateToCheck, $dateToCheck) == 1)
|
||||
{
|
||||
$nextWorkingDay = $dateToCheck;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$nextWorkingDay = date('Y-m-d', strtotime("+3 days"));
|
||||
}
|
||||
|
||||
// Check if a placement test happens on $nextWorkingDay
|
||||
$result = $this->ReihungstestModel->getTestsOnDate($nextWorkingDay, 11000);
|
||||
|
||||
$testsOndate = array();
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$testsOndate = $result->retval;
|
||||
}
|
||||
elseif (isError($result))
|
||||
{
|
||||
show_error($result->error);
|
||||
}
|
||||
|
||||
$applicants_arr = array();
|
||||
|
||||
foreach ($testsOndate as $reihungstest)
|
||||
{
|
||||
// Loads applicants of a test
|
||||
$applicants = $this->ReihungstestModel->getApplicantsOfPlacementTest($reihungstest->reihungstest_id);
|
||||
|
||||
if (hasData($applicants))
|
||||
{
|
||||
$applicants_arr = $applicants->retval;
|
||||
}
|
||||
elseif (isError($applicants))
|
||||
{
|
||||
show_error($applicants->error);
|
||||
}
|
||||
|
||||
foreach ($applicants_arr as $applicant)
|
||||
{
|
||||
$mailcontent_data_arr = array();
|
||||
$mailcontent_data_arr['anrede'] = $applicant->anrede;
|
||||
$mailcontent_data_arr['nachname'] = $applicant->nachname;
|
||||
$mailcontent_data_arr['vorname'] = $applicant->vorname;
|
||||
$mailcontent_data_arr['rt_datum'] = date_format(date_create($reihungstest->datum), 'd.m.Y');
|
||||
$mailcontent_data_arr['rt_uhrzeit'] = date_format(date_create($reihungstest->uhrzeit), 'H:i');
|
||||
$mailcontent_data_arr['rt_raum'] = $applicant->planbezeichnung;
|
||||
$mailcontent_data_arr['wegbeschreibung'] = $applicant->lageplan;
|
||||
|
||||
sendSanchoMail(
|
||||
'Sancho_RemindApplicantsOfTest',
|
||||
$mailcontent_data_arr,
|
||||
array($applicant->email,'kindlm@technikum-wien.at'),
|
||||
'Ihre Anmeldung zum Reihungstest - Reminder / Your registration for the placement test - Reminder');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Private methods
|
||||
/**
|
||||
@@ -118,7 +417,8 @@ class ReihungstestJob extends FHC_Controller
|
||||
// Prepare HTML table with study plans that have no placement tests yet
|
||||
if (!empty($missing_rt_arr))
|
||||
{
|
||||
$studienplan_list = '
|
||||
$studienplan_list
|
||||
= '
|
||||
<table'. $style_tbl2.'>
|
||||
';
|
||||
|
||||
|
||||
@@ -527,7 +527,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
$logparams = array($prestudent_id, $logdata['studiengang_kurzbz'], '');
|
||||
|
||||
if (isset($statusgrund_id))
|
||||
if (isset($statusgrund_id) && is_numeric($statusgrund_id))
|
||||
{
|
||||
$this->StatusgrundModel->addSelect('bezeichnung_mehrsprachig');
|
||||
$statusgrund_kurzbz = $this->StatusgrundModel->load($statusgrund_id);
|
||||
|
||||
@@ -167,3 +167,100 @@ function isEmptyArray($array)
|
||||
{
|
||||
return ($array == null) || ($array != null && !is_array($array) || (is_array($array) && count($array) == 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* The function returns the number of business days between two dates and it skips the (static) holidays
|
||||
* @param string $startDate Date (YYYY-MM-DD) to start counting from (included)
|
||||
* @param string $endDate Date (YYYY-MM-DD) to end counting (included)
|
||||
* @param array $dynamic_holidays Optional. Static holidays that have the same date every year are included automatically.
|
||||
* You can give an array with dates (YYYY-MM-DD) that should be included furthermore
|
||||
* @return integer Number of working days between $startDate and $endDate
|
||||
*/
|
||||
function getWorkingDays($startDate, $endDate, $dynamic_holidays = array())
|
||||
{
|
||||
//Get year of $startDate
|
||||
$startYear = substr($startDate, 0, 4);
|
||||
//Get year of $endDate
|
||||
$endYear = substr($endDate, 0, 4);
|
||||
|
||||
$datediff = $endYear - $startYear;
|
||||
$austrian_holidays = array();
|
||||
for ($i = 0; $i <= $datediff; $i++)
|
||||
{
|
||||
$austrian_holidays[] = $startYear.'-01-01'; // Neujahr
|
||||
$austrian_holidays[] = $startYear.'-01-06'; // 3 Könige
|
||||
$austrian_holidays[] = $startYear.'-05-01'; // Staatsfeiertag
|
||||
$austrian_holidays[] = $startYear.'-08-15'; // Maria Himmelfahrt
|
||||
$austrian_holidays[] = $startYear.'-10-26'; // Nationalfeiertag
|
||||
$austrian_holidays[] = $startYear.'-11-01'; // Allerheiligen
|
||||
$austrian_holidays[] = $startYear.'-12-08'; // Maria Empfängnis
|
||||
$austrian_holidays[] = $startYear.'-12-25'; // Weihnachten
|
||||
$austrian_holidays[] = $startYear.'-12-26'; // Stefanitag
|
||||
$startYear++;
|
||||
}
|
||||
if (count($dynamic_holidays) > 0)
|
||||
{
|
||||
$austrian_holidays = array_merge($austrian_holidays, $dynamic_holidays);
|
||||
}
|
||||
// do strtotime calculations just once
|
||||
$endDate = strtotime($endDate);
|
||||
$startDate = strtotime($startDate);
|
||||
|
||||
//The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24
|
||||
//We add one to inlude both dates in the interval.
|
||||
$days = ($endDate - $startDate) / 86400 + 1;
|
||||
|
||||
$no_full_weeks = floor($days / 7);
|
||||
$no_remaining_days = fmod($days, 7);
|
||||
|
||||
//It will return 1 if it's Monday,.. ,7 for Sunday
|
||||
$the_first_day_of_week = date("N", $startDate);
|
||||
$the_last_day_of_week = date("N", $endDate);
|
||||
|
||||
//---->The two can be equal in leap years when february has 29 days, the equal sign is added here
|
||||
//In the first case the whole interval is within a week, in the second case the interval falls in two weeks.
|
||||
if ($the_first_day_of_week <= $the_last_day_of_week)
|
||||
{
|
||||
if ($the_first_day_of_week <= 6 && 6 <= $the_last_day_of_week) $no_remaining_days--;
|
||||
if ($the_first_day_of_week <= 7 && 7 <= $the_last_day_of_week) $no_remaining_days--;
|
||||
}
|
||||
else {
|
||||
// (edit by Tokes to fix an edge case where the start day was a Sunday
|
||||
// and the end day was NOT a Saturday)
|
||||
|
||||
// the day of the week for start is later than the day of the week for end
|
||||
if ($the_first_day_of_week == 7) {
|
||||
// if the start date is a Sunday, then we definitely subtract 1 day
|
||||
$no_remaining_days--;
|
||||
|
||||
if ($the_last_day_of_week == 6) {
|
||||
// if the end date is a Saturday, then we subtract another day
|
||||
$no_remaining_days--;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// the start date was a Saturday (or earlier), and the end date was (Mon..Fri)
|
||||
// so we skip an entire weekend and subtract 2 days
|
||||
$no_remaining_days -= 2;
|
||||
}
|
||||
}
|
||||
|
||||
//The no. of business days is: (number of weeks between the two dates) * (5 working days) + the remainder
|
||||
//---->february in none leap years gave a remainder of 0 but still calculated weekends between first and last day, this is one way to fix it
|
||||
$workingDays = $no_full_weeks * 5;
|
||||
if ($no_remaining_days > 0 )
|
||||
{
|
||||
$workingDays += $no_remaining_days;
|
||||
}
|
||||
|
||||
//We subtract the holidays
|
||||
foreach($austrian_holidays as $key=>$value)
|
||||
{
|
||||
$time_stamp=strtotime($value);
|
||||
//If the holiday doesn't fall in weekend
|
||||
if ($startDate <= $time_stamp && $time_stamp <= $endDate && date("N",$time_stamp) != 6 && date("N",$time_stamp) != 7)
|
||||
$workingDays--;
|
||||
}
|
||||
|
||||
return $workingDays;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ const DEFAULT_SANCHO_FOOTER_IMG = 'sancho_footer_DEFAULT.jpg';
|
||||
/**
|
||||
* Send single Mail with Sancho Design and Layout.
|
||||
* @param string $vorlage_kurzbz Name of the template for specific mail content.
|
||||
* @param array $vorlage_data Associative array with specific mail content varibales
|
||||
* @param array $vorlage_data Associative array with specific mail content variables
|
||||
* to be replaced in the content template.
|
||||
* @param string $to Email-adress.
|
||||
* @param string $subject Subject of mail.
|
||||
|
||||
@@ -204,8 +204,8 @@ class Prestudent_model extends DB_Model
|
||||
$this->addJoin('bis.tbl_nation zgvmanat', 'zgvmanation = zgvmanat.nation_code', 'LEFT');
|
||||
|
||||
$prestudent = $this->load($prestudent_id);
|
||||
if($prestudent->error)
|
||||
return error($prestudent->retval);
|
||||
if (!hasData($prestudent))
|
||||
return error('prestudent could not be loaded');
|
||||
|
||||
//Prestudentstatus
|
||||
$this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
|
||||
@@ -225,6 +225,7 @@ class Prestudent_model extends DB_Model
|
||||
|
||||
if (count($studienordnung->retval) > 0)
|
||||
{
|
||||
$lastStatus->retval[0]->studiengang_kz = $studienordnung->retval[0]->studiengang_kz;
|
||||
$lastStatus->retval[0]->studiengangkurzbzlang = $studienordnung->retval[0]->studiengangkurzbzlang;
|
||||
$lastStatus->retval[0]->studiengangbezeichnung = $studienordnung->retval[0]->studiengangbezeichnung;
|
||||
$lastStatus->retval[0]->studiengangbezeichnung_englisch = $studienordnung->retval[0]->studiengangbezeichnung_englisch;
|
||||
@@ -233,6 +234,7 @@ class Prestudent_model extends DB_Model
|
||||
|
||||
//get Sprache
|
||||
$this->load->model('system/sprache_model', 'SpracheModel');
|
||||
$this->SpracheModel->addSelect('sprache, locale, bezeichnung');
|
||||
$language = $this->SpracheModel->load($lastStatus->retval[0]->sprache);
|
||||
|
||||
if ($language->error)
|
||||
|
||||
@@ -224,4 +224,270 @@ class Reihungstest_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a registration date (Anmeldefrist) of a placement test has been reached yesterday.
|
||||
* @param integer $studiengang_kz Optional. Kennzahl of degree program whose registration date should be checked.
|
||||
* @return array Returns object array with reihungstest_ids whose registration date has been reached yesterday.
|
||||
*/
|
||||
public function checkReachedRegistrationDate($studiengang_kz = null)
|
||||
{
|
||||
$query = '
|
||||
SELECT *
|
||||
FROM PUBLIC.tbl_reihungstest
|
||||
WHERE anmeldefrist = (
|
||||
SELECT CURRENT_DATE - 1
|
||||
)
|
||||
';
|
||||
|
||||
$parametersArray = array();
|
||||
|
||||
if (!isEmptyString($studiengang_kz))
|
||||
{
|
||||
$query .= ' AND studiengang_kz = ?';
|
||||
array_push($parametersArray, $studiengang_kz);
|
||||
}
|
||||
|
||||
return $this->execQuery($query, $parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all applicants of a placement test for runZentraleReihungstestAnmeldefristAssistenzJob
|
||||
* @param integer $reihungstest_id ID of placement test
|
||||
* @return array Returns object array with data of applicants.
|
||||
*/
|
||||
public function getApplicantsOfPlacementTestForCronjob($reihungstest_id)
|
||||
{
|
||||
$query = '
|
||||
SELECT tbl_rt_person.person_id,
|
||||
ps.prestudent_id,
|
||||
tbl_studienplan.orgform_kurzbz,
|
||||
tbl_prestudentstatus.studienplan_id,
|
||||
tbl_prestudentstatus.ausbildungssemester,
|
||||
nachname,
|
||||
vorname,
|
||||
tbl_zgv.zgv_kurzbz,
|
||||
ps.studiengang_kz,
|
||||
CASE WHEN tbl_prestudentstatus.statusgrund_id=9
|
||||
THEN \'Ja\'
|
||||
ELSE \'Nein\'
|
||||
END AS "qualifikationskurs",
|
||||
(
|
||||
SELECT count(*) AS prio_relativ
|
||||
FROM (
|
||||
SELECT *,
|
||||
(
|
||||
SELECT status_kurzbz
|
||||
FROM PUBLIC.tbl_prestudentstatus
|
||||
WHERE prestudent_id = pst.prestudent_id
|
||||
ORDER BY datum DESC,
|
||||
tbl_prestudentstatus.insertamum DESC LIMIT 1
|
||||
) AS laststatus
|
||||
FROM PUBLIC.tbl_prestudent pst
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
WHERE person_id = (
|
||||
SELECT person_id
|
||||
FROM PUBLIC.tbl_prestudent
|
||||
WHERE prestudent_id = ps.prestudent_id
|
||||
)
|
||||
AND studiensemester_kurzbz = (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM PUBLIC.tbl_prestudentstatus
|
||||
WHERE prestudent_id = ps.prestudent_id
|
||||
AND status_kurzbz = \'Interessent\' LIMIT 1
|
||||
)
|
||||
AND status_kurzbz = \'Interessent\'
|
||||
) prest
|
||||
WHERE laststatus NOT IN (\'Abbrecher\', \'Abgewiesener\', \'Absolvent\')
|
||||
AND priorisierung <= (
|
||||
SELECT priorisierung
|
||||
FROM PUBLIC.tbl_prestudent
|
||||
WHERE prestudent_id = ps.prestudent_id
|
||||
)
|
||||
) AS "prioritaet",
|
||||
(
|
||||
SELECT kontakt
|
||||
FROM PUBLIC.tbl_kontakt
|
||||
WHERE kontakttyp = \'email\'
|
||||
AND zustellung = true
|
||||
AND person_id = tbl_rt_person.person_id
|
||||
ORDER BY insertamum DESC,
|
||||
updateamum DESC LIMIT 1
|
||||
) AS "email"
|
||||
FROM PUBLIC.tbl_rt_person
|
||||
JOIN PUBLIC.tbl_person ON (tbl_rt_person.person_id = tbl_person.person_id)
|
||||
JOIN PUBLIC.tbl_reihungstest rt ON (rt_id = reihungstest_id)
|
||||
JOIN PUBLIC.tbl_prestudent ps ON (ps.person_id = tbl_rt_person.person_id)
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
JOIN lehre.tbl_studienplan ON (tbl_prestudentstatus.studienplan_id = tbl_studienplan.studienplan_id)
|
||||
LEFT JOIN bis.tbl_zgv ON (ps.zgv_code = tbl_zgv.zgv_code)
|
||||
WHERE rt_id = ?
|
||||
AND get_rolle_prestudent(prestudent_id, rt.studiensemester_kurzbz) = \'Interessent\'
|
||||
AND tbl_prestudentstatus.studiensemester_kurzbz = rt.studiensemester_kurzbz
|
||||
AND bewerbung_abgeschicktamum IS NOT NULL
|
||||
AND bestaetigtam IS NOT NULL
|
||||
ORDER BY studiengang_kz,
|
||||
orgform_kurzbz,
|
||||
prioritaet,
|
||||
nachname,
|
||||
vorname,
|
||||
person_id
|
||||
';
|
||||
|
||||
return $this->execQuery($query, array($reihungstest_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an Applicant was assigned to a plament test after Anmeldefrist and before Test-Date
|
||||
* @param integer $studiengang_kz Kennzahl of degree program those tests should be checked
|
||||
* @return array Returns object array with data of applicants.
|
||||
*/
|
||||
public function getApplicantAssignedAfterDate($studiengang_kz)
|
||||
{
|
||||
$query = '
|
||||
SELECT tbl_rt_person.person_id,
|
||||
ps.prestudent_id,
|
||||
rt.datum,
|
||||
rt.uhrzeit,
|
||||
tbl_studienplan.orgform_kurzbz,
|
||||
tbl_prestudentstatus.studienplan_id,
|
||||
tbl_prestudentstatus.ausbildungssemester,
|
||||
nachname,
|
||||
vorname,
|
||||
tbl_zgv.zgv_kurzbz,
|
||||
ps.studiengang_kz,
|
||||
CASE WHEN tbl_prestudentstatus.statusgrund_id=9
|
||||
THEN \'Ja\'
|
||||
ELSE \'Nein\'
|
||||
END AS "qualifikationskurs",
|
||||
(
|
||||
SELECT count(*) AS prio_relativ
|
||||
FROM (
|
||||
SELECT *,
|
||||
(
|
||||
SELECT status_kurzbz
|
||||
FROM PUBLIC.tbl_prestudentstatus
|
||||
WHERE prestudent_id = pst.prestudent_id
|
||||
ORDER BY datum DESC,
|
||||
tbl_prestudentstatus.insertamum DESC LIMIT 1
|
||||
) AS laststatus
|
||||
FROM PUBLIC.tbl_prestudent pst
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
WHERE person_id = (
|
||||
SELECT person_id
|
||||
FROM PUBLIC.tbl_prestudent
|
||||
WHERE prestudent_id = ps.prestudent_id
|
||||
)
|
||||
AND studiensemester_kurzbz = (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM PUBLIC.tbl_prestudentstatus
|
||||
WHERE prestudent_id = ps.prestudent_id
|
||||
AND status_kurzbz = \'Interessent\' LIMIT 1
|
||||
)
|
||||
AND status_kurzbz = \'Interessent\'
|
||||
) prest
|
||||
WHERE laststatus NOT IN (\'Abbrecher\', \'Abgewiesener\', \'Absolvent\')
|
||||
AND priorisierung <= (
|
||||
SELECT priorisierung
|
||||
FROM PUBLIC.tbl_prestudent
|
||||
WHERE prestudent_id = ps.prestudent_id
|
||||
)
|
||||
) AS "prioritaet",
|
||||
(
|
||||
SELECT kontakt
|
||||
FROM PUBLIC.tbl_kontakt
|
||||
WHERE kontakttyp = \'email\'
|
||||
AND zustellung = true
|
||||
AND person_id = tbl_rt_person.person_id
|
||||
ORDER BY insertamum DESC,
|
||||
updateamum DESC LIMIT 1
|
||||
) AS "email"
|
||||
FROM PUBLIC.tbl_rt_person
|
||||
JOIN PUBLIC.tbl_person ON (tbl_rt_person.person_id = tbl_person.person_id)
|
||||
JOIN PUBLIC.tbl_reihungstest rt ON (rt_id = reihungstest_id)
|
||||
JOIN PUBLIC.tbl_prestudent ps ON (ps.person_id = tbl_rt_person.person_id)
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
JOIN lehre.tbl_studienplan ON (tbl_prestudentstatus.studienplan_id = tbl_studienplan.studienplan_id)
|
||||
LEFT JOIN bis.tbl_zgv ON (ps.zgv_code = tbl_zgv.zgv_code)
|
||||
WHERE rt.studiengang_kz = ?
|
||||
AND get_rolle_prestudent(prestudent_id, rt.studiensemester_kurzbz) = \'Interessent\'
|
||||
AND tbl_prestudentstatus.studiensemester_kurzbz = rt.studiensemester_kurzbz
|
||||
AND bewerbung_abgeschicktamum IS NOT NULL
|
||||
AND bestaetigtam IS NOT NULL
|
||||
AND anmeldefrist < (SELECT CURRENT_DATE)
|
||||
AND rt.datum > (SELECT CURRENT_DATE)
|
||||
--AND tbl_rt_person.insertamum > anmeldefrist
|
||||
--AND tbl_rt_person.insertamum < rt.datum
|
||||
AND tbl_rt_person.insertamum::date = (SELECT CURRENT_DATE -1)
|
||||
ORDER BY studiengang_kz,
|
||||
orgform_kurzbz,
|
||||
prioritaet,
|
||||
nachname,
|
||||
vorname,
|
||||
person_id
|
||||
';
|
||||
|
||||
return $this->execQuery($query, array($studiengang_kz));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all applicants of a placement test
|
||||
* @param integer $reihungstest_id ID of placement test
|
||||
* @return array Returns object array with data of applicants.
|
||||
*/
|
||||
public function getApplicantsOfPlacementTest($reihungstest_id)
|
||||
{
|
||||
$query = '
|
||||
SELECT DISTINCT tbl_rt_person.person_id,
|
||||
anrede,
|
||||
nachname,
|
||||
vorname,
|
||||
(
|
||||
SELECT kontakt
|
||||
FROM PUBLIC.tbl_kontakt
|
||||
WHERE kontakttyp = \'email\'
|
||||
AND zustellung = true
|
||||
AND person_id = tbl_rt_person.person_id
|
||||
ORDER BY insertamum DESC,
|
||||
updateamum DESC LIMIT 1
|
||||
) AS "email",
|
||||
tbl_ort.planbezeichnung,
|
||||
tbl_ort.lageplan
|
||||
FROM PUBLIC.tbl_rt_person
|
||||
JOIN PUBLIC.tbl_person ON (tbl_rt_person.person_id = tbl_person.person_id)
|
||||
JOIN PUBLIC.tbl_reihungstest rt ON (rt_id = reihungstest_id)
|
||||
JOIN PUBLIC.tbl_prestudent ps ON (ps.person_id = tbl_rt_person.person_id)
|
||||
JOIN PUBLIC.tbl_prestudentstatus USING (prestudent_id)
|
||||
LEFT JOIN bis.tbl_zgv ON (ps.zgv_code = tbl_zgv.zgv_code)
|
||||
LEFT JOIN PUBLIC.tbl_ort ON (tbl_rt_person.ort_kurzbz = tbl_ort.ort_kurzbz)
|
||||
WHERE rt_id = ?
|
||||
AND get_rolle_prestudent(prestudent_id, rt.studiensemester_kurzbz) = \'Interessent\'
|
||||
AND tbl_prestudentstatus.studiensemester_kurzbz = rt.studiensemester_kurzbz
|
||||
AND bewerbung_abgeschicktamum IS NOT NULL
|
||||
AND bestaetigtam IS NOT NULL
|
||||
ORDER BY nachname,
|
||||
vorname,
|
||||
person_id
|
||||
';
|
||||
|
||||
return $this->execQuery($query, array($reihungstest_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all placement tests of the given day and optional degree program
|
||||
* @param string $date Date of the tests to be loaded (YYYY-MM-DD)
|
||||
* @param integer $studiengang_kz Optional. Kennzahl of degree program to load
|
||||
* @return array Returns object array with data of applicants.
|
||||
*/
|
||||
public function getTestsOnDate($date, $studiengang_kz = null)
|
||||
{
|
||||
$query = '
|
||||
SELECT *
|
||||
FROM PUBLIC.tbl_reihungstest
|
||||
WHERE datum = ?
|
||||
AND studiengang_kz = ?
|
||||
';
|
||||
|
||||
return $this->execQuery($query, array($date, $studiengang_kz));
|
||||
}
|
||||
}
|
||||
@@ -11,4 +11,14 @@ class Lehreinheitgruppe_model extends DB_Model
|
||||
$this->dbTable = 'lehre.tbl_lehreinheitgruppe';
|
||||
$this->pk = 'lehreinheitgruppe_id';
|
||||
}
|
||||
|
||||
public function getDirectGroup($lehreinheit_id)
|
||||
{
|
||||
$this->addJoin('public.tbl_gruppe', 'gruppe_kurzbz');
|
||||
return $this->loadWhere(array(
|
||||
'tbl_gruppe.direktinskription' => true,
|
||||
'lehreinheit_id' => $lehreinheit_id
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,4 +429,23 @@ class Studiengang_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($studiensemester_kurzbz));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads degree programs of the given type
|
||||
* @param string $typ Type of degree programs to be loaded
|
||||
* @return array
|
||||
*/
|
||||
public function loadStudiengaengeFromTyp($typ)
|
||||
{
|
||||
$query = "SELECT
|
||||
distinct tbl_studiengang.*
|
||||
FROM
|
||||
public.tbl_studiengang
|
||||
WHERE
|
||||
tbl_studiengang.typ=?
|
||||
ORDER BY
|
||||
kurzbz";
|
||||
|
||||
return $this->execQuery($query, array($typ));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ class Studiensemester_model extends DB_Model
|
||||
*/
|
||||
public function getAusbildungssemesterByStudiensemesterAndStudiengang($studiensemester_kurzbz, $studiengang_kz)
|
||||
{
|
||||
$query = "SELECT DISTINCT semester
|
||||
$query = "SELECT DISTINCT semester
|
||||
FROM lehre.tbl_studienplan
|
||||
JOIN lehre.tbl_studienordnung USING(studienordnung_id)
|
||||
JOIN lehre.tbl_studienplan_semester USING(studienplan_id)
|
||||
@@ -131,9 +131,9 @@ class Studiensemester_model extends DB_Model
|
||||
if (date_format(date_create($from), 'Y-m-d') > (date_format(date_create($to), 'Y-m-d')))
|
||||
return success(array());
|
||||
|
||||
$query = "SELECT *
|
||||
$query = "SELECT *
|
||||
FROM public.tbl_studiensemester
|
||||
WHERE
|
||||
WHERE
|
||||
(ende > ?::date AND start < ?::date)
|
||||
OR start = ?::date
|
||||
OR ende = ?::date
|
||||
@@ -141,4 +141,19 @@ class Studiensemester_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($from, $to, $from, $to));
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert das Studiensemester das aktuell am naehesten zu $studiensemester_kurzbz liegt
|
||||
*
|
||||
* @param $studiensemester_kurzbz
|
||||
* @return array | null
|
||||
*/
|
||||
public function getNearestFrom($studiensemester_kurzbz)
|
||||
{
|
||||
$query = "SELECT studiensemester_kurzbz, start, ende FROM public.vw_studiensemester
|
||||
WHERE studiensemester_kurzbz <> ?
|
||||
ORDER BY delta LIMIT 1";
|
||||
|
||||
return $this->execQuery($query, array($studiensemester_kurzbz));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,54 @@ class Stundenplandev_model extends DB_Model
|
||||
$this->dbTable = 'lehre.tbl_stundenplandev';
|
||||
$this->pk = 'stundenplandev_id';
|
||||
}
|
||||
|
||||
public function getMissingDirectGroups($studiensemester_kurzbz = null)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
distinct lehreinheit_id, datum, stunde, mitarbeiter_uid, ort_kurzbz
|
||||
FROM
|
||||
lehre.tbl_stundenplandev stpl
|
||||
WHERE
|
||||
lehreinheit_id IN(
|
||||
SELECT
|
||||
lehreinheit_id
|
||||
FROM
|
||||
lehre.tbl_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id)
|
||||
JOIN public.tbl_gruppe USING(gruppe_kurzbz)
|
||||
WHERE
|
||||
tbl_gruppe.direktinskription = true
|
||||
";
|
||||
|
||||
$parametersArray = array();
|
||||
|
||||
if (!is_null($studiensemester_kurzbz))
|
||||
{
|
||||
$parametersArray[] = $studiensemester_kurzbz;
|
||||
$qry .= ' AND tbl_lehreinheit.studiensemester_kurzbz = ?';
|
||||
}
|
||||
$qry .= ")
|
||||
AND NOT EXISTS(
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
lehre.tbl_stundenplandev
|
||||
WHERE
|
||||
datum=stpl.datum
|
||||
AND stunde=stpl.stunde
|
||||
AND lehreinheit_id=stpl.lehreinheit_id
|
||||
AND gruppe_kurzbz=(SELECT
|
||||
gruppe_kurzbz
|
||||
FROM
|
||||
lehre.tbl_lehreinheitgruppe
|
||||
JOIN public.tbl_gruppe USING(gruppe_kurzbz)
|
||||
WHERE
|
||||
lehreinheit_id=stpl.lehreinheit_id
|
||||
AND tbl_gruppe.direktinskription = true
|
||||
)
|
||||
)";
|
||||
|
||||
return $this->execQuery($qry, $parametersArray);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ $this->load->view('templates/FHC-Header',
|
||||
'fontawesome' => true,
|
||||
'sbadmintemplate' => true,
|
||||
'ajaxlib' => true,
|
||||
'addons' => true,
|
||||
'navigationwidget' => true
|
||||
)
|
||||
);
|
||||
@@ -23,102 +24,8 @@ $this->load->view('templates/FHC-Header',
|
||||
<h3 class="page-header">FH-Complete</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
<i class="fa fa-comments fa-5x"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 text-right">
|
||||
<div class="huge">26</div>
|
||||
<div>neue Messages</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#">
|
||||
<div class="panel-footer">
|
||||
<span class="pull-left">View Details</span>
|
||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<div class="panel panel-green">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
<i class="fa fa-tasks fa-5x"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 text-right">
|
||||
<div class="huge">12</div>
|
||||
<div>neue Interessenten</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#">
|
||||
<div class="panel-footer">
|
||||
<span class="pull-left">View Details</span>
|
||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<div class="panel panel-yellow">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
<i class="fa fa-clock-o fa-5x"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 text-right">
|
||||
<div class="huge">124</div>
|
||||
<div>inaktive Interessenten</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#">
|
||||
<div class="panel-footer">
|
||||
<span class="pull-left">View Details</span>
|
||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<div class="panel panel-red">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-3">
|
||||
<i class="fa fa-support fa-5x"></i>
|
||||
</div>
|
||||
<div class="col-xs-9 text-right">
|
||||
<div class="huge">13</div>
|
||||
<div>Support Tickets!</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="#">
|
||||
<div class="panel-footer">
|
||||
<span class="pull-left">View Details</span>
|
||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
<span>
|
||||
<?php
|
||||
//$this->load->view('system/infocenter/infocenterData.php');
|
||||
?>
|
||||
<div id="dashboard"></div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
'fontawesome' => true,
|
||||
'ajaxlib' => true,
|
||||
'customCSSs' => array(
|
||||
'public/css/tools/gradelist.css'
|
||||
'public/css/tools/gradelist.css',
|
||||
'public/css/fhcomplete.css'
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js'
|
||||
|
||||
@@ -2,11 +2,34 @@
|
||||
<?php
|
||||
$unique_studsemester = array();
|
||||
$first = true;
|
||||
$fit_programme_studiengaenge = array(10021, 10027);
|
||||
foreach ($zgvpruefungen as $zgvpruefung):
|
||||
$infoonly = $zgvpruefung->infoonly;
|
||||
$studiengangkurzbz = $studiengangbezeichnung = $studiengangtyp = '';
|
||||
|
||||
$studiensemester = isset($zgvpruefung->prestudentstatus->studiensemester_kurzbz) ? $zgvpruefung->prestudentstatus->studiensemester_kurzbz : '';
|
||||
$studiengangkurzbz = empty($zgvpruefung->prestudentstatus->studiengangkurzbzlang) ? $zgvpruefung->studiengang : $zgvpruefung->prestudentstatus->studiengangkurzbzlang;
|
||||
$studiengangbezeichnung = empty($zgvpruefung->prestudentstatus->studiengangbezeichnung) ? $zgvpruefung->studiengangbezeichnung : $zgvpruefung->prestudentstatus->studiengangbezeichnung;
|
||||
$studiengang_kz = isset($zgvpruefung->studiengang_kz) ? $zgvpruefung->studiengang_kz : '';
|
||||
$studiengangtyp = isset($zgvpruefung->studiengangtyp) ? $zgvpruefung->studiengangtyp : '';
|
||||
|
||||
if (empty($zgvpruefung->prestudentstatus->studiengangkurzbzlang))
|
||||
{
|
||||
if (!empty($zgvpruefung->studiengang))
|
||||
$studiengangkurzbz = $zgvpruefung->studiengang;
|
||||
}
|
||||
else
|
||||
{
|
||||
$studiengangkurzbz = $zgvpruefung->prestudentstatus->studiengangkurzbzlang;
|
||||
}
|
||||
|
||||
if (empty($zgvpruefung->prestudentstatus->studiengangbezeichnung))
|
||||
{
|
||||
if (!empty($zgvpruefung->studiengangbezeichnung))
|
||||
$studiengangbezeichnung = $zgvpruefung->studiengangbezeichnung;
|
||||
}
|
||||
else
|
||||
{
|
||||
$studiengangbezeichnung = $zgvpruefung->prestudentstatus->studiengangbezeichnung;
|
||||
}
|
||||
|
||||
//set bootstrap columns for zgv form
|
||||
$columns = array(3, 3, 3, 3);
|
||||
@@ -219,7 +242,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- show only master zgv if master studiengang - start -->
|
||||
<?php if ($zgvpruefung->studiengangtyp === 'm') : ?>
|
||||
<?php if ($studiengangtyp === 'm') : ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-<?php echo $columns[0] ?>">
|
||||
<div class="form-group"><label><?php echo $this->p->t('infocenter', 'zgv') . ' ' . $this->p->t('lehre','master') . ':'?></label>
|
||||
@@ -360,17 +383,24 @@
|
||||
</div>
|
||||
</div><!-- /.column-absage -->
|
||||
<?php
|
||||
$disabled = $disabledTxt = '';
|
||||
$disabled = $disabledStg = $disabledTxt = $disabledStgTxt = '';
|
||||
if (isEmptyString($zgvpruefung->prestudentstatus->bewerbung_abgeschicktamum))
|
||||
{
|
||||
$disabled = 'disabled';
|
||||
$disabledTxt = 'Die Bewerbung muss erst abgeschickt worden sein.';
|
||||
$disabled = $disabledStg = 'disabled';
|
||||
$disabledTxt = $disabledStgTxt = 'Die Bewerbung muss erst abgeschickt worden sein.';
|
||||
}
|
||||
|
||||
if ($zgvpruefung->studiengangtyp !== 'b')
|
||||
if ($studiengangtyp !== 'b')
|
||||
{
|
||||
$disabled = 'disabled';
|
||||
$disabledTxt = 'Nur Bachelorstudiengänge können freigegeben werden.';;
|
||||
$disabledTxt = 'Nur Bachelorstudiengänge können freigegeben werden.';
|
||||
|
||||
// FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter
|
||||
if (!in_array($studiengang_kz, $fit_programme_studiengaenge))
|
||||
{
|
||||
$disabledStg = 'disabled';
|
||||
$disabledStgTxt = 'Nur Bachelorstudiengänge können freigegeben werden.';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="col-lg-8 text-right">
|
||||
@@ -378,7 +408,7 @@
|
||||
<div class="input-group frgstatusgrselect" id="frgstatusgrselect_<?php echo $zgvpruefung->prestudent_id ?>">
|
||||
<select name="frgstatusgrund"
|
||||
class="d-inline float-right"
|
||||
<?php echo $disabled ?>
|
||||
<?php echo $disabledStg ?>
|
||||
required>
|
||||
<option value="null"
|
||||
selected="selected"><?php echo ucfirst($this->p->t('ui', 'freigabeart')) . '...' ?>
|
||||
@@ -388,8 +418,8 @@
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default freigabebtnstg" <?php echo $disabled ?> id="freigabebtnstg_<?php echo $zgvpruefung->prestudent_id ?>"
|
||||
data-toggle="tooltip" title="<?php echo $disabledTxt ?>">
|
||||
<button class="btn btn-default freigabebtnstg" <?php echo $disabledStg ?> id="freigabebtnstg_<?php echo $zgvpruefung->prestudent_id ?>"
|
||||
data-toggle="tooltip" title="<?php echo $disabledStgTxt ?>">
|
||||
<?php echo $this->p->t('ui', 'freigabeAnStudiengang') ?>
|
||||
</button>
|
||||
</span>
|
||||
|
||||
@@ -93,8 +93,6 @@
|
||||
// NavigationWidget CSS
|
||||
if ($navigationwidget === true) generateCSSsInclude('public/css/NavigationWidget.css');
|
||||
|
||||
generateCSSsInclude('public/css/fhcomplete.css');
|
||||
|
||||
// Eventually required CSS
|
||||
generateCSSsInclude($customCSSs); // Eventually required CSS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user