student issues list issueData: language index comes from tbl_sprache, limit results only to dvuh and core issues

This commit is contained in:
KarpAlex
2023-04-22 15:41:20 +02:00
parent bc8709f842
commit 3122825b73
2 changed files with 131 additions and 80 deletions
@@ -26,6 +26,7 @@ class Issues extends Auth_Controller
// Load models
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
$this->load->model('system/Sprache_model', 'SpracheModel');
$this->loadPhrases(
array(
@@ -45,10 +46,11 @@ class Issues extends Auth_Controller
public function index()
{
$oes_for_issues = $this->_getOesForIssues();
$language_index = $this->_getLanguageIndex();
$this->load->view(
'system/issues/issues',
$oes_for_issues
array_merge($oes_for_issues, array('language_index' => $language_index))
);
}
@@ -166,4 +168,29 @@ class Issues extends Auth_Controller
'all_oe_kurzbz_berechtigt' => $all_oe_kurzbz_berechtigt
);
}
/**
*
* @param
* @return object success or error
*/
private function _getLanguageIndex()
{
$idx = 1;
$this->SpracheModel->addSelect('sprache, index');
$langRes = $this->SpracheModel->load();
if (hasData($langRes))
{
$userLang = getUserLanguage();
$lang = getData($langRes);
foreach ($lang as $l)
{
if ($l->sprache == $userLang) $idx = $l->index;
}
}
return $idx;
}
}