mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
Merge branch 'master' into cleanci
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -17,10 +17,9 @@
|
||||
*
|
||||
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
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
|
||||
@@ -315,6 +293,9 @@ class ReihungstestJob extends FHC_Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* runRemindApplicantsOfPlacementTestJob
|
||||
*/
|
||||
public function runRemindApplicantsOfPlacementTestJob()
|
||||
{
|
||||
// Get placement tests with testdate within 3 working days
|
||||
@@ -473,8 +454,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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -34,7 +34,7 @@ class Auth_Controller extends FHC_Controller
|
||||
// Checks if this user is entitled to access to this content
|
||||
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized'); // set the HTTP header as unauthorized
|
||||
$this->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized
|
||||
|
||||
$this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
|
||||
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class CLI_Controller extends FHC_Controller
|
||||
{
|
||||
const INFO_FORMAT = '%s %s %s %s'; // Info message format
|
||||
const REQUIRED_PARAM_FORMAT = ' %s'; // Info message required method parameter format
|
||||
const OPTIONAL_PARAM_FORMAT = ' (%s)'; // Info message optional method parameter format
|
||||
const BLACKLIST_METHODS = array('__construct', 'index', 'get_instance'); // Methods to NOT display with _printHelp
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Checks if the controller is called from command line
|
||||
$this->_isAllowed();
|
||||
}
|
||||
|
||||
/**
|
||||
* By default the index is used to print the help message to explain how to call them from command line
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->printHelp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all the public methods of the called controller and display
|
||||
* a help message to explain how to call them from command line
|
||||
*/
|
||||
protected function printHelp()
|
||||
{
|
||||
$this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
|
||||
|
||||
$this->eprintflib->printInfo('The following are the available commands:');
|
||||
$this->eprintflib->printInfo('');
|
||||
|
||||
// Gets a list of public methods of the called controller
|
||||
$reflectionClass = new ReflectionClass($this->router->class);
|
||||
$methods = $reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC);
|
||||
|
||||
// Loops through them
|
||||
foreach ($methods as $method)
|
||||
{
|
||||
// Disascard the black listed methods
|
||||
if (!in_array($method->name, self::BLACKLIST_METHODS))
|
||||
{
|
||||
// Formatted message
|
||||
$info = sprintf(
|
||||
self::INFO_FORMAT, // Message format
|
||||
PHP_BINARY, // PHP binary name
|
||||
index_page(), // CI index page name
|
||||
$this->router->class, // The called controller name
|
||||
$method->name // The called controller current method name
|
||||
);
|
||||
|
||||
// Retrieves the parameter names for the current method
|
||||
$reflectionMethod = new ReflectionMethod($this->router->class, $method->name);
|
||||
$parameters = $reflectionMethod->getParameters();
|
||||
|
||||
// Loops through them
|
||||
foreach ($parameters as $parameter)
|
||||
{
|
||||
$info .= sprintf(
|
||||
$parameter->isOptional() ? self::OPTIONAL_PARAM_FORMAT : self::REQUIRED_PARAM_FORMAT, // Parameter message format required/optional
|
||||
$parameter->getName() // Current method parameter name
|
||||
);
|
||||
}
|
||||
|
||||
// Print the info message
|
||||
$this->eprintflib->printInfo($info);
|
||||
$this->eprintflib->printInfo('');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the controller is called from the command line, if NOT the execution is immediately stopped
|
||||
*/
|
||||
private function _isAllowed()
|
||||
{
|
||||
if (!$this->input->is_cli_request())
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED);
|
||||
|
||||
$this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
|
||||
|
||||
// Prints the main error message
|
||||
$this->eprintflib->printError('You are not authorized to access this content');
|
||||
// Prints the called controller name
|
||||
$this->eprintflib->printInfo('Controller name: '.$this->router->class);
|
||||
// Prints the called controller method name
|
||||
$this->eprintflib->printInfo('Method name: '.$this->router->method);
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -706,7 +706,7 @@ class DB_Model extends CI_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get meda data info about the retrived fields after having executed a query
|
||||
* Get meda data info about the retrieved fields after having executed a query
|
||||
*/
|
||||
public function getExecutedQueryMetaData()
|
||||
{
|
||||
@@ -863,7 +863,7 @@ class DB_Model extends CI_Model
|
||||
$toBeConverterdArray = array(); // Fields to be converted
|
||||
|
||||
$this->executedQueryMetaData = $result->field_data(); // Fields information
|
||||
$this->executedQueryListFields = $result->list_fields(); // List of the retrived fields
|
||||
$this->executedQueryListFields = $result->list_fields(); // List of the retrieved fields
|
||||
|
||||
for ($i = 0; $i < count($this->executedQueryMetaData); $i++) // Looking for booleans and arrays
|
||||
{
|
||||
|
||||
@@ -17,8 +17,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Function to retrive the language of the logged user
|
||||
* If is not possible to retrive it, then the default system language is returnd
|
||||
* Function to retrieve the language of the logged user
|
||||
* If is not possible to retrieve it, then the default system language is returnd
|
||||
* If as parameter is given a valid language the it's returned useful to avoid
|
||||
* to write the same control structures for the language
|
||||
*/
|
||||
@@ -28,9 +28,9 @@ function getUserLanguage($language = null)
|
||||
|
||||
$ci =& get_instance(); // get CI instance
|
||||
|
||||
// Use the default system language, if it's possible retrives the language for the logged user
|
||||
// Use the default system language, if it's possible retrieves the language for the logged user
|
||||
$language = DEFAULT_LANGUAGE;
|
||||
// Checks if the user is authenticated to retrive the users's language
|
||||
// Checks if the user is authenticated to retrieve the users's language
|
||||
// NOTE: this helper could be called when the user is not logged in the system
|
||||
// so this is why is checked if the function getAuthUID exists
|
||||
if (function_exists('getAuthUID'))
|
||||
|
||||
@@ -305,7 +305,7 @@ class AuthLib
|
||||
*/
|
||||
private function _showInvalidAuthentication()
|
||||
{
|
||||
header('HTTP/1.0 401 Unauthorized'); // set the HTTP header as unauthorized
|
||||
$this->_ci->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized
|
||||
unset($_SERVER['PHP_AUTH_USER']);
|
||||
|
||||
$this->_ci->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
|
||||
@@ -325,6 +325,8 @@ class AuthLib
|
||||
*/
|
||||
private function _showError($errorMessage)
|
||||
{
|
||||
$this->_ci->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized
|
||||
|
||||
$this->_ci->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
|
||||
$this->_ci->load->library('LogLib'); // Loads the logs library
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
*/
|
||||
class ExtensionsLib
|
||||
{
|
||||
const SQL_DIRECTORY = 'sql'; // directory where to retrive SQL scripts
|
||||
const SQL_DIRECTORY = 'sql'; // directory where to retrieve SQL scripts
|
||||
const SQL_FILE_EXTENSION = '.sql'; // SQL scripts file extension
|
||||
|
||||
const FILE_INPUT_NAME = 'extension'; // name of the HTTP parameter containing the archive data
|
||||
@@ -200,7 +200,7 @@ class ExtensionsLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive the list of all the installed extensions
|
||||
* Retrieve the list of all the installed extensions
|
||||
*/
|
||||
public function getInstalledExtensions()
|
||||
{
|
||||
@@ -253,7 +253,7 @@ class ExtensionsLib
|
||||
// If the upload was a success
|
||||
if ($this->_ci->upload->do_upload(ExtensionsLib::FILE_INPUT_NAME))
|
||||
{
|
||||
$uploadData = $this->_ci->upload->data(); // retrives data about the uploaded file
|
||||
$uploadData = $this->_ci->upload->data(); // retrieves data about the uploaded file
|
||||
// Checks the file extension
|
||||
$uploadedFileExtension = '.'.pathinfo($uploadData['full_path'], PATHINFO_EXTENSION);
|
||||
if (!in_array($uploadedFileExtension, $this->ARCHIVE_EXTENSIONS))
|
||||
|
||||
@@ -23,7 +23,7 @@ class FiltersLib
|
||||
const SESSION_DATASET_REPRESENTATION = 'datasetRepresentation';
|
||||
const SESSION_DATASET_REP_OPTIONS = 'datasetRepresentationOptions';
|
||||
|
||||
// Alias for the dynamic table used to retrive the dataset
|
||||
// Alias for the dynamic table used to retrieve the dataset
|
||||
const DATASET_TABLE_ALIAS = 'datasetFilterTable';
|
||||
|
||||
// Parameters names...
|
||||
@@ -40,7 +40,7 @@ class FiltersLib
|
||||
// ...to specify permissions that are needed to use this FilterWidget
|
||||
const REQUIRED_PERMISSIONS_PARAMETER = 'requiredPermissions';
|
||||
|
||||
// ...stament to retrive the dataset
|
||||
// ...stament to retrieve the dataset
|
||||
const QUERY_PARAMETER = 'query';
|
||||
|
||||
// ...to specify more columns or aliases for them
|
||||
@@ -136,7 +136,7 @@ class FiltersLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method to the session helper funtions to retrive the whole session for this filter
|
||||
* Wrapper method to the session helper funtions to retrieve the whole session for this filter
|
||||
*/
|
||||
public function getSession()
|
||||
{
|
||||
@@ -144,7 +144,7 @@ class FiltersLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method to the session helper funtions to retrive one element from the session of this filter
|
||||
* Wrapper method to the session helper funtions to retrieve one element from the session of this filter
|
||||
*/
|
||||
public function getSessionElement($name)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ class FiltersLib
|
||||
$this->_ci->FiltersModel->addJoin('public.tbl_benutzer', 'person_id', 'LEFT'); // left join with benutzer table
|
||||
$this->_ci->FiltersModel->addSelect('system.tbl_filters.*'); // select only from table filters
|
||||
$this->_ci->FiltersModel->addOrder('sort', 'ASC'); // sort on column sort
|
||||
$this->_ci->FiltersModel->addLimit(1); // if more than one filter is set as default only one will be retrived
|
||||
$this->_ci->FiltersModel->addLimit(1); // if more than one filter is set as default only one will be retrieved
|
||||
|
||||
$definition = null;
|
||||
$whereParameters = null; // where clause parameters
|
||||
@@ -206,7 +206,7 @@ class FiltersLib
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we can univocally retrive a filter
|
||||
// If we can univocally retrieve a filter
|
||||
if ($app != null && $datasetName != null && $filterKurzbz != null)
|
||||
{
|
||||
$whereParameters = array(
|
||||
@@ -280,7 +280,7 @@ class FiltersLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the query to retrive the dataset for a filter
|
||||
* Generate the query to retrieve the dataset for a filter
|
||||
*/
|
||||
public function generateDatasetQuery($query, $filters)
|
||||
{
|
||||
@@ -316,7 +316,7 @@ class FiltersLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrives the dataset from the DB
|
||||
* Retrieves the dataset from the DB
|
||||
*/
|
||||
public function getDataset($datasetQuery)
|
||||
{
|
||||
@@ -368,7 +368,7 @@ class FiltersLib
|
||||
// Checks the parameter selectedFields
|
||||
if (isset($selectedFields) && is_array($selectedFields) && count($selectedFields) > 0)
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
// Retrieves all the used fields by the current filter
|
||||
$fields = $this->getSessionElement(self::SESSION_FIELDS);
|
||||
|
||||
// Checks that the given selected fields are present in all the used fields by the current filter
|
||||
@@ -393,9 +393,9 @@ class FiltersLib
|
||||
// Checks the parameter selectedField
|
||||
if (!isEmptyString($selectedField))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
// Retrieves all the used fields by the current filter
|
||||
$fields = $this->getSessionElement(self::SESSION_FIELDS);
|
||||
// Retrives the selected fields by the current filter
|
||||
// Retrieves the selected fields by the current filter
|
||||
$selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS);
|
||||
|
||||
// Checks that the given selected field is present in the list of all the used fields by the current filter
|
||||
@@ -427,9 +427,9 @@ class FiltersLib
|
||||
// Checks the parameter selectedField
|
||||
if (!isEmptyString($selectedField))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
// Retrieves all the used fields by the current filter
|
||||
$fields = $this->getSessionElement(self::SESSION_FIELDS);
|
||||
// Retrives the selected fields by the current filter
|
||||
// Retrieves the selected fields by the current filter
|
||||
$selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS);
|
||||
|
||||
// Checks that the given selected field is present in the list of all the used fields by the current filter
|
||||
@@ -456,9 +456,9 @@ class FiltersLib
|
||||
// Checks the parameter appliedFilter
|
||||
if (!isEmptyString($appliedFilter))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
// Retrieves all the used fields by the current filter
|
||||
$fields = $this->getSessionElement(self::SESSION_FIELDS);
|
||||
// Retrives the applied filters by the current filter
|
||||
// Retrieves the applied filters by the current filter
|
||||
$filters = $this->getSessionElement(self::SESSION_FILTERS);
|
||||
|
||||
// Checks that the given applied filter is present in the list of all the used fields by the current filter
|
||||
@@ -493,7 +493,7 @@ class FiltersLib
|
||||
if (isset($appliedFilters) && is_array($appliedFilters)
|
||||
&& isset($appliedFiltersOperations) && is_array($appliedFiltersOperations))
|
||||
{
|
||||
$fields = $this->getSessionElement(self::SESSION_FIELDS); // Retrives all the used fields by the current filter
|
||||
$fields = $this->getSessionElement(self::SESSION_FIELDS); // Retrieves all the used fields by the current filter
|
||||
|
||||
// Checks that the given applied filters are present in all the used fields by the current filter
|
||||
if (!array_diff($appliedFilters, $fields))
|
||||
@@ -544,9 +544,9 @@ class FiltersLib
|
||||
// Checks the parameter filter
|
||||
if (!isEmptyString($filter))
|
||||
{
|
||||
// Retrives all the used fields by the current filter
|
||||
// Retrieves all the used fields by the current filter
|
||||
$fields = $this->getSessionElement(self::SESSION_FIELDS);
|
||||
// Retrives the applied filters by the current filter
|
||||
// Retrieves the applied filters by the current filter
|
||||
$filters = $this->getSessionElement(self::SESSION_FILTERS);
|
||||
|
||||
// Checks that the given applied filter is present in the list of all the used fields by the current filter
|
||||
@@ -619,7 +619,7 @@ class FiltersLib
|
||||
|
||||
// Generates the "column" property
|
||||
$jsonDeifinition->columns = array();
|
||||
$selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS); // retrived the selected fields
|
||||
$selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS); // retrieved the selected fields
|
||||
for ($i = 0; $i < count($selectedFields); $i++)
|
||||
{
|
||||
// Each element is an object with a property called "name"
|
||||
|
||||
@@ -294,7 +294,7 @@ class MessageLib
|
||||
$result = $this->_ci->PersonModel->load($receiver_id);
|
||||
if (hasData($result))
|
||||
{
|
||||
// Retrives the language of the logged user
|
||||
// Retrieves the language of the logged user
|
||||
$sprache = getUserLanguage();
|
||||
|
||||
// Loads template data
|
||||
|
||||
@@ -88,7 +88,7 @@ class NavigationLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method to the session helper funtions to retrive the whole session for this navigation widget
|
||||
* Wrapper method to the session helper funtions to retrieve the whole session for this navigation widget
|
||||
*/
|
||||
public function getSessionMenu()
|
||||
{
|
||||
@@ -103,7 +103,7 @@ class NavigationLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method to the session helper funtions to retrive the whole session for this navigation widget
|
||||
* Wrapper method to the session helper funtions to retrieve the whole session for this navigation widget
|
||||
*/
|
||||
public function getSessionHeader()
|
||||
{
|
||||
@@ -118,7 +118,7 @@ class NavigationLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method to the session helper funtions to retrive one element from the session of this navigation widget
|
||||
* Wrapper method to the session helper funtions to retrieve one element from the session of this navigation widget
|
||||
*/
|
||||
public function getSessionElementMenu($name)
|
||||
{
|
||||
@@ -133,7 +133,7 @@ class NavigationLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper method to the session helper funtions to retrive one element from the session of this navigation widget
|
||||
* Wrapper method to the session helper funtions to retrieve one element from the session of this navigation widget
|
||||
*/
|
||||
public function getSessionElementHeader($name)
|
||||
{
|
||||
|
||||
@@ -100,7 +100,7 @@ class PermissionLib
|
||||
* - convert the required permissions to an array if needed
|
||||
* - loops through the required permissions
|
||||
* - checks if the permission is well formatted
|
||||
* - retrives permission and required access type from the $requiredPermissions array
|
||||
* - retrieves permission and required access type from the $requiredPermissions array
|
||||
* - checks if the required access type is compliant with the HTTP method (GET => r, POST => w)
|
||||
* - if the user has one of the permissions than exit the loop
|
||||
* - checks if the user has the same required permissiond with the same required access type
|
||||
@@ -142,7 +142,7 @@ class PermissionLib
|
||||
// Checks if the permission is well formatted
|
||||
if (strpos($permissions[$pCounter], PermissionLib::PERMISSION_SEPARATOR) !== false)
|
||||
{
|
||||
// Retrives permission and required access type from the $requiredPermissions array
|
||||
// Retrieves permission and required access type from the $requiredPermissions array
|
||||
list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]);
|
||||
|
||||
$accessType = '';
|
||||
|
||||
@@ -5,7 +5,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class PhrasesLib
|
||||
{
|
||||
private $_ci; // Code igniter instance
|
||||
private $_phrases; // Contains the retrived phrases
|
||||
private $_phrases; // Contains the retrieved phrases
|
||||
|
||||
/**
|
||||
* Loads parser library
|
||||
@@ -88,7 +88,7 @@ class PhrasesLib
|
||||
}
|
||||
|
||||
/**
|
||||
* getPhrases() - Retrives phrases from the DB
|
||||
* getPhrases() - Retrieves phrases from the DB
|
||||
* The given parameter are the same needed to read from the table system.tb_phrase
|
||||
*/
|
||||
public function getPhrases($app, $sprache, $phrase = null, $orgeinheit_kurzbz = null, $orgform_kurzbz = null, $blockTags = null)
|
||||
@@ -175,7 +175,7 @@ class PhrasesLib
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrives a phrases from the the property _phrases with the given parameters
|
||||
* Retrieves a phrases from the the property _phrases with the given parameters
|
||||
* It also replace parameters inside the phrase if they are provided
|
||||
* @param string $category Category name which is used to categorize the phrase.
|
||||
* @param string $phrase Phrase name.
|
||||
@@ -239,7 +239,7 @@ class PhrasesLib
|
||||
$categories = array($categories);
|
||||
}
|
||||
|
||||
// Retrives the language of the logged user
|
||||
// Retrieves the language of the logged user
|
||||
$language = getUserLanguage(count($parameters) == 2 ? $parameters[1] : null);
|
||||
|
||||
// If only categories is not an empty array then loads phrases
|
||||
|
||||
@@ -43,7 +43,7 @@ class UDFLib
|
||||
|
||||
const CHKBOX_TYPE = 'checkbox'; // UDF checkbox type
|
||||
|
||||
const PHRASES_APP_NAME = 'core'; // Name of the app parameter used to retrive phrases
|
||||
const PHRASES_APP_NAME = 'core'; // Name of the app parameter used to retrieve phrases
|
||||
|
||||
private $_ci; // Code igniter instance
|
||||
|
||||
@@ -620,7 +620,7 @@ class UDFLib
|
||||
{
|
||||
$parameters = $jsonSchema->{UDFLib::LIST_VALUES}->enum;
|
||||
}
|
||||
// If the list of values to show should be retrived with a SQL statement
|
||||
// If the list of values to show should be retrieved with a SQL statement
|
||||
elseif (isset($jsonSchema->{UDFLib::LIST_VALUES}->sql))
|
||||
{
|
||||
// UDFModel is loaded in method _loadUDF that is called before the current method
|
||||
|
||||
@@ -200,7 +200,7 @@ class Person_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrives the language of the user by the UID
|
||||
* Retrieves the language of the user by the UID
|
||||
* Gets all the persons related to the given UID and starting from the most recent person in DB
|
||||
* tries to find a valid language (!= null), if found is returned, otherwise is returned the
|
||||
* default global language of the system
|
||||
|
||||
@@ -57,7 +57,7 @@ class Phrase_model extends DB_Model
|
||||
|
||||
/**
|
||||
* Loads phrases using category(s) and language as keys
|
||||
* The retrived fields are category, phrase, orgeinheit_kurzbz, orgform_kurzbz and text
|
||||
* The retrieved fields are category, phrase, orgeinheit_kurzbz, orgform_kurzbz and text
|
||||
* They are ordered by p.category, p.phrase, pt.orgeinheit_kurzbz DESC and pt.orgform_kurzbz DESC'
|
||||
*/
|
||||
public function getPhrasesByCategoryAndLanguage($categories, $language)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// Retrives the name of the index page, the URL path of the called controller and the called controller
|
||||
// Retrieves the name of the index page, the URL path of the called controller and the called controller
|
||||
// NOTE: placed here because it doesn't work inside functions
|
||||
$indexPage = $this->config->item('index_page');
|
||||
$calledPath = $this->router->directory.$this->router->class;
|
||||
|
||||
@@ -170,13 +170,13 @@ class FilterWidget extends Widget
|
||||
$this->_datasetRepresentation = null;
|
||||
$this->_datasetRepresentationOptions = null;
|
||||
|
||||
// Retrived the required permissions parameter if present
|
||||
// Retrieved the required permissions parameter if present
|
||||
if (isset($args[FiltersLib::REQUIRED_PERMISSIONS_PARAMETER]))
|
||||
{
|
||||
$this->_requiredPermissions = $args[FiltersLib::REQUIRED_PERMISSIONS_PARAMETER];
|
||||
}
|
||||
|
||||
// Parameters needed to retrive univocally a filter from DB
|
||||
// Parameters needed to retrieve univocally a filter from DB
|
||||
if (isset($args[FiltersLib::APP_PARAMETER]))
|
||||
{
|
||||
$this->_app = $args[FiltersLib::APP_PARAMETER];
|
||||
@@ -197,7 +197,7 @@ class FilterWidget extends Widget
|
||||
$this->_filterId = $args[FiltersLib::FILTER_ID];
|
||||
}
|
||||
|
||||
// How to retrive data for the filter: SQL statement or a result from DB
|
||||
// How to retrieve data for the filter: SQL statement or a result from DB
|
||||
if (isset($args[FiltersLib::QUERY_PARAMETER]))
|
||||
{
|
||||
$this->_query = $args[FiltersLib::QUERY_PARAMETER];
|
||||
@@ -329,7 +329,7 @@ class FilterWidget extends Widget
|
||||
// If session is NOT empty -> a filter was already loaded
|
||||
if ($session != null)
|
||||
{
|
||||
// Retrive the filterId stored in the session
|
||||
// Retrieve the filterId stored in the session
|
||||
$sessionFilterId = $this->filterslib->getSessionElement(FiltersLib::FILTER_ID);
|
||||
|
||||
// If the filter loaded in session is NOT the same that is being requested then empty the session
|
||||
@@ -355,7 +355,7 @@ class FilterWidget extends Widget
|
||||
$this->filterslib->getSessionElement(FiltersLib::SESSION_FILTERS)
|
||||
);
|
||||
|
||||
// Then retrive dataset from DB
|
||||
// Then retrieve dataset from DB
|
||||
$dataset = $this->filterslib->getDataset($datasetQuery);
|
||||
|
||||
// Save changes into session if data are valid
|
||||
@@ -392,7 +392,7 @@ class FilterWidget extends Widget
|
||||
// Generate dataset query
|
||||
$datasetQuery = $this->filterslib->generateDatasetQuery($this->_query, $parsedFilterJson->filters);
|
||||
|
||||
// Then retrive dataset from DB
|
||||
// Then retrieve dataset from DB
|
||||
$dataset = $this->filterslib->getDataset($datasetQuery);
|
||||
|
||||
// Try to load the name of the filter using the PhrasesLib
|
||||
@@ -448,7 +448,7 @@ class FilterWidget extends Widget
|
||||
|
||||
/**
|
||||
* Calls the method _markRow and _formatRow to marks rows using markRow and format rowns using formatRow
|
||||
* NOTE: this method operates directly on the retrived dataset: parameter passed by reference
|
||||
* NOTE: this method operates directly on the retrieved dataset: parameter passed by reference
|
||||
*/
|
||||
private function _formatDataset(&$rawDataset)
|
||||
{
|
||||
@@ -471,7 +471,7 @@ class FilterWidget extends Widget
|
||||
* - converts booleans into strings "true" and "false"
|
||||
* - format dates using the format string defined in DEFAULT_DATE_FORMAT
|
||||
* Calls the parameter formatRow if it was given and if it is a valid funtion
|
||||
* NOTE: this method operates directly on the retrived dataset: parameter passed by reference
|
||||
* NOTE: this method operates directly on the retrieved dataset: parameter passed by reference
|
||||
*/
|
||||
private function _formatRow(&$rawDatasetRow)
|
||||
{
|
||||
@@ -514,7 +514,7 @@ class FilterWidget extends Widget
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method that retrives the name of the columns present in a filter JSON definition
|
||||
* Utility method that retrieves the name of the columns present in a filter JSON definition
|
||||
*/
|
||||
private function _getColumnsNames($columns)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user