Merge remote-tracking branch 'origin/master'

This commit is contained in:
Manfred Kindl
2019-05-03 16:47:39 +02:00
39 changed files with 1184 additions and 906 deletions
+9 -35
View File
@@ -11,12 +11,13 @@
* @filesource
*/
if (! defined('BASEPATH'))
exit('No direct script access allowed');
if (!defined('BASEPATH')) exit('No direct script access allowed');
class AmpelMail extends FHC_Controller
class AmpelMail extends CLI_Controller
{
private $CIS_AMPELVERWALTUNG_URL;
const CIS_AMPELVERWALTUNG_URL = CIS_ROOT. "cis/index.php?menu=".
CIS_ROOT. "cis/menu.php?content_id=&content=".
CIS_ROOT. "cis/private/tools/ampelverwaltung.php";
/**
* Constructor
@@ -25,39 +26,12 @@ class AmpelMail extends FHC_Controller
{
parent::__construct();
// Allow script execution only from CLI
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;
}
$this->CIS_AMPELVERWALTUNG_URL = CIS_ROOT. "cis/index.php?menu=".
CIS_ROOT. "cis/menu.php?content_id=&content=".
CIS_ROOT. "cis/private/tools/ampelverwaltung.php";
// Load helpers
$this->load->helper('hlp_sancho');
// Load models
$this->load->model('content/Ampel_model', 'AmpelModel');
$this->load->model('person/Person_model', 'PersonModel');
// Load helpers
$this->load->helper('hlp_sancho');
}
/**
* Main function index as help
*
* @return void
*/
public function index()
{
$result = "The following are the available command line interface commands\n\n";
$result .= "php index.ci.php jobs/AmpelMail generateAmpelMail";
echo $result. PHP_EOL;
}
/**
@@ -210,7 +184,7 @@ class AmpelMail extends FHC_Controller
'uid' => $uid,
'firstName' => $firstName,
'ampel_list' => $html_text,
'link' => $this->CIS_AMPELVERWALTUNG_URL
'link' => self::CIS_AMPELVERWALTUNG_URL
);
}
return $ampel_data_arr;
+3 -29
View File
@@ -17,10 +17,9 @@
*
* Authors: Andreas Oesterreicher <[email protected]>
*/
if (! defined('BASEPATH'))
exit('No direct script access allowed');
if (!defined('BASEPATH')) exit('No direct script access allowed');
class LVPlanJob extends FHC_Controller
class LVPlanJob extends CLI_Controller
{
/**
* Initialize LVPlanJob Class
@@ -29,32 +28,7 @@ class LVPlanJob extends FHC_Controller
*/
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;
parent::__construct();
}
/**
@@ -7,8 +7,7 @@ if (! defined('BASEPATH'))
* Database Class
*
*/
class Prestudentstatus extends FHC_Controller
class Prestudentstatus extends CLI_Controller
{
/**
* Initialize Prestudentstatus Class
@@ -17,32 +16,7 @@ class Prestudentstatus extends FHC_Controller
*/
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/Prestudentstatus CorrectStudienplan";
echo $result.PHP_EOL;
parent::__construct();
}
/**
@@ -1,11 +1,9 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
if (!defined('BASEPATH')) exit('No direct script access allowed');
class ReihungstestJob extends FHC_Controller
class ReihungstestJob extends CLI_Controller
{
private $VILESCI_RT_VERWALTUNGS_URL;
/**
* Constructor
*/
@@ -13,20 +11,6 @@ class ReihungstestJob extends FHC_Controller
{
parent::__construct();
// Allow script execution only from CLI
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;
}
$this->VILESCI_RT_VERWALTUNGS_URL = site_url('/organisation/Reihungstest');
// Load models
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
$this->load->model('crm/RtStudienplan_model', 'RtStudienplanModel');
@@ -38,18 +22,8 @@ class ReihungstestJob extends FHC_Controller
}
/**
* Main function index as help
*
* @return void
* runReihungstestJob
*/
public function index()
{
$result = "The following are the available command line interface commands\n\n";
$result .= "php index.ci.php jobs/ReihungstestJob runReihungstestInfo";
echo $result. PHP_EOL;
}
public function runReihungstestJob()
{
// Get study plans that have no assigned placement tests yet
@@ -92,6 +66,9 @@ class ReihungstestJob extends FHC_Controller
}
}
/**
* runZentraleReihungstestAnmeldefristAssistenzJob
*/
public function runZentraleReihungstestAnmeldefristAssistenzJob()
{
// Get placement tests where registration date was yesterday
@@ -198,7 +175,6 @@ class ReihungstestJob extends FHC_Controller
$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;
// Send email in Sancho design
if (!isEmptyString($mailcontent))
@@ -215,7 +191,9 @@ class ReihungstestJob extends FHC_Controller
}
}
// Checks, if an applicant was assigned to a test after Anmeldefrist
/**
* 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
@@ -510,8 +488,7 @@ class ReihungstestJob extends FHC_Controller
// Set associative array with the prepared HTML tables and URL be used by the template's variables
$content_data_arr['studienplan_list'] = $studienplan_list;
$content_data_arr['freie_plaetze_list'] = $freie_plaetze_list;
$content_data_arr['link'] = $this->VILESCI_RT_VERWALTUNGS_URL;
;
$content_data_arr['link'] = site_url('/organisation/Reihungstest');
return $content_data_arr;
}
+9 -1
View File
@@ -133,6 +133,11 @@ class Gradelist extends Auth_Controller
if (in_array($row_status->status_kurzbz,
array('Student','Diplomand','Incoming','Abbrecher','Unterbrecher','Absolvent')))
{
// Wenn das Semester schon vorhanden ist dann ueberspringen
// (bei mehreren Statuseintraegen im selben Semester (zB Absolvent / Diplomand)
if(isset($courses['semester'][$row_status->studiensemester_kurzbz]))
continue;
// LVs fuer das Semester holen lt Studienplan
$lvtree = $this->studienplanlib->getLehrveranstaltungTree(
$row_status->studienplan_id,
@@ -184,7 +189,10 @@ class Gradelist extends Auth_Controller
$courses['semester'][$row_noten->studiensemester_kurzbz]['lvs_nonstpl'][] = array(
'lehrveranstaltung_id' => $row_noten->lehrveranstaltung_id,
'lehrtyp_kurzbz' => $result_lv->retval[0]->lehrtyp_kurzbz,
'lehrform_kurzbz' => $result_lv->retval[0]->lehrform_kurzbz,
'pflicht' => false,
'sws' => $result_lv->retval[0]->sws,
'zeugnis' => $result_lv->retval[0]->zeugnis,
'bezeichnung' => $result_lv->retval[0]->bezeichnung,
'ects' => $result_lv->retval[0]->ects,
'note' => $row_noten->note,
@@ -316,7 +324,7 @@ class Gradelist extends Auth_Controller
);
}
if ($row['childs'])
if (isset($row['childs']))
{
$childgrades = $this->getGrades($row['childs']);
$grades = array_merge($grades, $childgrades);
+4 -4
View File
@@ -35,7 +35,7 @@ class Filters extends FHC_Controller
// Public methods
/**
* Retrives data about the current filter from the session and will be written on the output in JSON format
* Retrieves data about the current filter from the session and will be written on the output in JSON format
*/
public function getFilter()
{
@@ -43,7 +43,7 @@ class Filters extends FHC_Controller
}
/**
* Retrives the number of records present in the current dataset and will be written on the output in JSON format
* Retrieves the number of records present in the current dataset and will be written on the output in JSON format
*/
public function rowNumber()
{
@@ -243,11 +243,11 @@ class Filters extends FHC_Controller
// If it is present in the HTTP GET
if (isset($_GET[self::FILTER_PAGE_PARAM]))
{
$filterPage = $this->input->get(self::FILTER_PAGE_PARAM); // is retrived from the HTTP GET
$filterPage = $this->input->get(self::FILTER_PAGE_PARAM); // is retrieved from the HTTP GET
}
elseif (isset($_POST[self::FILTER_PAGE_PARAM])) // Else if it is present in the HTTP POST
{
$filterPage = $this->input->post(self::FILTER_PAGE_PARAM); // is retrived from the HTTP POST
$filterPage = $this->input->post(self::FILTER_PAGE_PARAM); // is retrieved from the HTTP POST
}
// Loads the FiltersLib that contains all the used logic
@@ -69,11 +69,11 @@ class Navigation extends Auth_Controller
// If it is present in the HTTP GET
if (isset($_GET[self::NAVIGATION_PAGE_PARAM]))
{
$navigationPage = $this->input->get(self::NAVIGATION_PAGE_PARAM); // is retrived from the HTTP GET
$navigationPage = $this->input->get(self::NAVIGATION_PAGE_PARAM); // is retrieved from the HTTP GET
}
elseif (isset($_POST[self::NAVIGATION_PAGE_PARAM])) // Else if it is present in the HTTP POST
{
$navigationPage = $this->input->post(self::NAVIGATION_PAGE_PARAM); // is retrived from the HTTP POST
$navigationPage = $this->input->post(self::NAVIGATION_PAGE_PARAM); // is retrieved from the HTTP POST
}
// Loads the NavigationLib that contains all the used logic
@@ -0,0 +1,36 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class CLI_Manager extends CLI_Controller
{
/**
*
*/
public function __construct()
{
parent::__construct();
// Load helpers to upload files
$this->load->helper('form');
// Loads the extensions library
$this->load->library('ExtensionsLib');
}
/**
* Installiert eine Extension.
* Es wird davon ausgegangen, dass die Extension ueber einen Fileupload hochgeladen wird.
* alternativ kann hier auch der Name und Filename uebergeben werden um die installation ueber
* die Commandline ohne Upload durchzufuehren.
* @param $extensioName string Name der Extension
* @param $filename Url Encoded Pfad zum tgz File der Extension
*/
public function uploadExtension($extensionName = null, $filename = null)
{
$this->extensionslib->installExtension($extensionName, urldecode($filename));
}
}