diff --git a/.gitignore b/.gitignore index 247c57d2e..de95987a8 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ application/models/extensions/ application/views/extensions/ application/widgets/extensions/ application/logs/ +public/extensions/ tests/codeception/_output/* !/tests/codeception/_output/.placeholder tests/codeception/codeception.yml diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 15c5d8be0..dfb690278 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -236,6 +236,13 @@ $config['fhc_acl'] = array 'wawi.tbl_rechnungstyp' => 'basis/rechnungstyp', 'wawi.tbl_zahlungstyp' => 'basis/zahlungstyp', + // Temporary + 'extension.tbl_budgetantrag' => 'basis/kostenstelle', + 'extension.tbl_budgetposition' => 'basis/kostenstelle', + 'extension.tbl_budgetstatus' => 'basis/kostenstelle', + 'extension.tbl_budgetantrag_status' => 'basis/kostenstelle', + 'extension.tbl_dsms_anonymisierung' => 'dsms/export', + DMS_PATH => 'fs/dms', 'PhrasesLib.getPhrase' => 'system/PhrasesLib' diff --git a/application/config/navigation.php b/application/config/navigation.php index 6e1c711ed..abb5338b6 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -1,18 +1,8 @@ array( - 'FH-Complete' => base_url('index.ci.php/'), - 'Vilesci' => base_url('/vilesci'), - 'CIS' => CIS_ROOT - ), - 'system/infocenter/InfoCenter/index' => array( - 'FH-Complete' => base_url('index.ci.php/'), - 'Vilesci' => base_url('/vilesci'), - 'CIS' => CIS_ROOT - ), - 'system/infocenter/InfoCenter/showDetails' => array( - 'FH-Complete' => base_url('index.ci.php/'), + '*' => array( + 'FH-Complete' => site_url(''), 'Vilesci' => base_url('/vilesci'), 'CIS' => CIS_ROOT ) @@ -39,7 +29,7 @@ $config['navigation_menu']['Vilesci/index'] = array( 'expand' => true ), 'Infocenter' => array( - 'link' => base_url('index.ci.php/system/infocenter/InfoCenter'), + 'link' => site_url('/system/infocenter/InfoCenter'), 'icon' => 'info', 'description' => 'Infocenter', 'expand' => true @@ -59,16 +49,10 @@ $config['navigation_menu']['Vilesci/index'] = array( 'expand' => true ), 'Extensions' => array( - 'link' => base_url('index.ci.php/system/extensions/Manager'), + 'link' => site_url('/system/extensions/Manager'), 'icon' => 'cubes', 'description' => 'Extensions Manager', 'expand' => true - ), - 'Datenschutz' => array( - 'link' => base_url('index.ci.php/extensions/FHC-Core-DSMS/export'), - 'description' => 'Datenschutz', - 'icon' => 'legal', - 'expand' => true ) ) ) diff --git a/application/controllers/system/Navigation.php b/application/controllers/system/Navigation.php index 037a7d0f4..65f311c66 100644 --- a/application/controllers/system/Navigation.php +++ b/application/controllers/system/Navigation.php @@ -10,20 +10,23 @@ class Navigation extends VileSci_Controller const SESSION_NAME = 'NAVIGATION_MENU'; /** - * + * Constructor */ public function __construct() - { - parent::__construct(); + { + parent::__construct(); $this->config->load('navigation'); - // Load session library - $this->load->library('session'); - } + // Load session library + $this->load->library('session'); + $this->load->library('ExtensionsLib'); + } /** - * + * This function creates the left Menu for each Page + * @param navigation_widget_called GET Parameter witch holds the currently called Page + * @return JSON object with the Menu Entries */ public function menu() { @@ -32,16 +35,33 @@ class Navigation extends VileSci_Controller if (isset($navigation_widget_called)) { + // Get Menu Entries of the Core $navigationMenuArray = $this->config->item('navigation_menu'); + $json = $this->wildcardsearch($navigationMenuArray, $navigation_widget_called); - if (isset($navigationMenuArray) && is_array($navigationMenuArray)) + // Load Menu Entries of Extensions + $extensions = $this->extensionslib->getInstalledExtensions(); + if(hasData($extensions)) { - if (isset($navigationMenuArray[$navigation_widget_called])) + $json_extension = array(); + foreach($extensions->retval as $ext) { - $json = $navigationMenuArray[$navigation_widget_called]; + $filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/navigation.php'; + if (file_exists($filename)) + { + unset($config); + include($filename); + if(isset($config['navigation_menu']) && is_array($config['navigation_menu'])) + { + $json_extension = array_merge_recursive($json_extension, $this->wildcardsearch($config['navigation_menu'], $navigation_widget_called)); + } + } } + // Merge Extension Menuentries with the Core Entries + $json = array_merge_recursive($json, $json_extension); } + // Load dynamic Menu Entries from Session if (isset($_SESSION['navigation_menu'])) { $navigationMenuSessionArray = $_SESSION['navigation_menu']; @@ -50,7 +70,7 @@ class Navigation extends VileSci_Controller { if (isset($navigationMenuSessionArray[$navigation_widget_called])) { - $json = array_merge($json, $navigationMenuSessionArray[$navigation_widget_called]); + $json = array_merge_recursive($json, $navigationMenuSessionArray[$navigation_widget_called]); } } } @@ -60,7 +80,9 @@ class Navigation extends VileSci_Controller } /** - * + * This function creates the Top Menu for each Page + * @param navigation_widget_called GET Parameter witch holds the currently called Page + * @return JSON object with the Menu Entries */ public function header() { @@ -69,16 +91,32 @@ class Navigation extends VileSci_Controller if (isset($navigation_widget_called)) { + // Load Header Entries of Core $navigationHeaderArray = $this->config->item('navigation_header'); + $json = $this->wildcardsearch($navigationHeaderArray, $navigation_widget_called); - if (isset($navigationHeaderArray) && is_array($navigationHeaderArray)) + // Load Header Entries of Extensions + $extensions = $this->extensionslib->getInstalledExtensions(); + if(hasData($extensions)) { - if (isset($navigationHeaderArray[$navigation_widget_called])) + $json_extension = array(); + foreach($extensions->retval as $ext) { - $json = $navigationHeaderArray[$navigation_widget_called]; + $filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/navigation.php'; + if (file_exists($filename)) + { + unset($config); + include($filename); + if(isset($config['navigation_header']) && is_array($config['navigation_header'])) + { + $json_extension = array_merge_recursive($json_extension, $this->wildcardsearch($config['navigation_header'], $navigation_widget_called)); + } + } } + $json = array_merge_recursive($json, $json_extension); } + // Load dynamic Header Entries from Session if (isset($_SESSION['navigation_header'])) { $navigationHeaderSessionArray = $_SESSION['navigation_header']; @@ -87,7 +125,8 @@ class Navigation extends VileSci_Controller { if (isset($navigationHeaderSessionArray[$navigation_widget_called])) { - $json = array_merge($json, $navigationHeaderSessionArray[$navigation_widget_called]); + $jsontmp = $this->wildcardsearch($navigationHeaderSessionArray, $navigation_widget_called); + $json = array_merge_recursive($json, $jsontmp); } } } @@ -95,4 +134,47 @@ class Navigation extends VileSci_Controller $this->output->set_content_type('application/json')->set_output(json_encode($json)); } + + /** + * Searches a Menuentry. If there is no exact entry it searches for Wildcard Entries with a Star + * Example: + * Searching for /system/foo/index will Match the following Menuentries: + * /system/foo/index + * /system/foo/* + * /system/* + * * + * + * @param $navigationArray Array to Search in. + * @param $navigation_widget_called Navigation to search for. + * @return Navigation Array if found, empty array otherwise + */ + private function wildcardsearch($navigationArray, $navigation_widget_called) + { + // Sort Navigation to have them in correct order + krsort($navigationArray); + + // 100% match found + if(isset($navigationArray[$navigation_widget_called])) + { + return $navigationArray[$navigation_widget_called]; + } + else + { + foreach($navigationArray as $key=>$row) + { + // Search for * Entries + if(mb_strpos($key, '*') === 0 || mb_strpos($key, '*') === mb_strlen($key) - 1) + { + // Take * Entry if Matches + $search = mb_substr($key, 0, -1); + if($search == '' || mb_strpos($navigation_widget_called, $search) === 0) + { + return $row; + } + } + } + } + + return array(); + } } diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 5b13ce76d..23b4972c2 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -559,11 +559,6 @@ class InfoCenter extends VileSci_Controller { $toPrint = "%s=%s"; - if ($this->router->method != 'index') - { - - } - $tofill['children'][] = array( 'link' => sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter?filter_id'), $filterId), 'description' => $description, @@ -896,7 +891,7 @@ class InfoCenter extends VileSci_Controller //parse freigabe html email template, wordwrap wraps text so no display errors $email = wordwrap($this->parser->parse('templates/mailtemplates/interessentFreigabe', $data, true), 70); - $subject = ($person->geschlecht == 'm' ? 'Interessent ' : 'Interessentin ').$person->vorname.' '.$person->nachname.' freigegeben'; + $subject = ($person->geschlecht == 'm' ? 'Interessent ' : 'Interessentin ').$person->vorname.' '.$person->nachname.' für '.$prestudent->studiengangbezeichnung.$orgform.' freigegeben'; $receiver = $prestudent->studiengangmail; diff --git a/application/libraries/ExtensionsLib.php b/application/libraries/ExtensionsLib.php index 25e9c666a..26f1c5247 100644 --- a/application/libraries/ExtensionsLib.php +++ b/application/libraries/ExtensionsLib.php @@ -723,6 +723,7 @@ class ExtensionsLib ); if (!$_addSoftLinks) { + log_message('error','Failed to create Symlink to '.$extensionPath.$targetDirectory); break; } } diff --git a/application/libraries/VorlageLib.php b/application/libraries/VorlageLib.php index 7ea3de93d..ea96f3e18 100644 --- a/application/libraries/VorlageLib.php +++ b/application/libraries/VorlageLib.php @@ -114,6 +114,8 @@ class VorlageLib $queryParameters["sprache"] = $sprache; } + $this->ci->VorlageStudiengangModel->addOrder('version', 'DESC'); + $vorlage = $this->ci->VorlageStudiengangModel->loadWhere($queryParameters); // If the searched template was not found if (!hasData($vorlage)) diff --git a/application/models/accounting/Konto_model.php b/application/models/accounting/Konto_model.php index d041909cd..d76b2bd46 100644 --- a/application/models/accounting/Konto_model.php +++ b/application/models/accounting/Konto_model.php @@ -11,4 +11,20 @@ class Konto_model extends DB_Model $this->dbTable = 'wawi.tbl_konto'; $this->pk = 'konto_id'; } + + /** + * Gets all Konten connected for a Kostenstelle + * @param $kostenstelle_id + * @return array + */ + public function getKontenForKostenstelle($kostenstelle_id) + { + $this->addJoin('wawi.tbl_konto_kostenstelle', 'konto_id'); + $konten = $this->loadWhere(array('kostenstelle_id' => $kostenstelle_id)); + + if ($konten->error) + return error($konten->retval); + + return $konten; + } } diff --git a/application/models/accounting/Kostenstelle_model.php b/application/models/accounting/Kostenstelle_model.php index 489286306..fd064125c 100644 --- a/application/models/accounting/Kostenstelle_model.php +++ b/application/models/accounting/Kostenstelle_model.php @@ -11,4 +11,52 @@ class Kostenstelle_model extends DB_Model $this->dbTable = 'wawi.tbl_kostenstelle'; $this->pk = 'kostenstelle_id'; } + + /** + * Gets all active Kostenstellen for a geschaeftsjahr, as determined by the geschaeftsjahrvon and bis fields + * @param $geschaeftsjahr + * @return array|null + */ + public function getActiveKostenstellenForGeschaeftsjahr($geschaeftsjahr = null) + { + $this->load->model('organisation/geschaeftsjahr_model', 'GeschaeftsjahrModel'); + + if ($geschaeftsjahr === null) + { + $lgj = $this->GeschaeftsjahrModel->getLastGeschaeftsjahr(); + + if ($lgj->error) + return error($lgj->retval); + + if (count($lgj->retval) < 1) + return success(array()); + + $geschaeftsjahr = $lgj->retval[0]->geschaeftsjahr_kurzbz; + } + + $this->GeschaeftsjahrModel->addSelect('start, ende'); + $gj = $this->GeschaeftsjahrModel->load($geschaeftsjahr); + + if ($gj->error) + return error($gj->retval); + + if (count($gj->retval) < 1) + return success(array()); + + $gjstart = $gj->retval[0]->start; + + $query = 'SELECT kostenstelle_id, kostenstelle_nr, kurzbz, wawi.tbl_kostenstelle.bezeichnung, kgjvon.start, kgjbis.ende + FROM wawi.tbl_kostenstelle + LEFT JOIN public.tbl_geschaeftsjahr kgjvon on wawi.tbl_kostenstelle.geschaeftsjahrvon = kgjvon.geschaeftsjahr_kurzbz + LEFT JOIN public.tbl_geschaeftsjahr kgjbis on wawi.tbl_kostenstelle.geschaeftsjahrbis = kgjbis.geschaeftsjahr_kurzbz + WHERE + (wawi.tbl_kostenstelle.geschaeftsjahrbis IS NULL AND wawi.tbl_kostenstelle.geschaeftsjahrvon IS NULL) + OR + (DATE ? >= kgjvon.start AND (DATE ? < kgjbis.ende OR wawi.tbl_kostenstelle.geschaeftsjahrbis IS NULL)) + OR + (DATE ? < kgjbis.ende AND (DATE ? >= kgjvon.start OR wawi.tbl_kostenstelle.geschaeftsjahrvon IS NULL)) + ORDER BY wawi.tbl_kostenstelle.bezeichnung'; + + return $this->execQuery($query, array($gjstart, $gjstart, $gjstart, $gjstart)); + } } diff --git a/application/models/organisation/Geschaeftsjahr_model.php b/application/models/organisation/Geschaeftsjahr_model.php index e3c0e9fb2..d475b8142 100644 --- a/application/models/organisation/Geschaeftsjahr_model.php +++ b/application/models/organisation/Geschaeftsjahr_model.php @@ -11,4 +11,20 @@ class Geschaeftsjahr_model extends DB_Model $this->dbTable = 'public.tbl_geschaeftsjahr'; $this->pk = 'geschaeftsjahr_kurzbz'; } + + /** + * Gets latest Geschaeftsjahr, as determined by its start date + * @return array|null + */ + public function getLastGeschaeftsjahr() + { + $query = 'SELECT * + FROM public.tbl_geschaeftsjahr + WHERE start = ( + SELECT max(start) + FROM public.tbl_geschaeftsjahr + )'; + + return $this->execQuery($query); + } } diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 0c7c169bb..790f1b4db 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -111,10 +111,13 @@ class Person_model extends DB_Model $this->addJoin('public.tbl_prestudent', 'person_id'); + $this->addJoin('public.tbl_benutzer', 'person_id'); + $result = $this->loadTree( 'public.tbl_person', array( - 'public.tbl_prestudent' + 'public.tbl_prestudent', + 'public.tbl_benutzer' ), 'EXISTS ( SELECT @@ -129,7 +132,8 @@ class Person_model extends DB_Model AND datum <= '.$this->escape($bis).' )', array( - 'prestudenten' + 'prestudenten', + 'benutzer' ) ); diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php old mode 100644 new mode 100755 index 663e69ca6..8360867b6 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -9,10 +9,12 @@ p.vorname AS "Vorname", p.nachname AS "Nachname", p.gebdatum AS "Gebdatum", + p.staatsbuergerschaft AS "Nation", ( SELECT zeitpunkt FROM system.tbl_log WHERE taetigkeit_kurzbz IN(\'bewerbung\',\'kommunikation\') + AND logdata->>\'name\' NOT IN (\'Login with code\', \'New application\') AND person_id = p.person_id ORDER BY zeitpunkt DESC LIMIT 1 @@ -21,6 +23,7 @@ SELECT insertvon FROM system.tbl_log WHERE taetigkeit_kurzbz IN(\'bewerbung\',\'kommunikation\') + AND logdata->>\'name\' NOT IN (\'Login with code\', \'New application\') AND person_id = p.person_id ORDER BY zeitpunkt DESC LIMIT 1 @@ -79,15 +82,17 @@ FROM public.tbl_studiensemester WHERE ende >= NOW() ) + AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\') LIMIT 1 ) AS "AnzahlAbgeschickt", array_to_string( ( - SELECT array_agg(distinct UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz)) + SELECT array_agg(distinct UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz) || \':\' || tbl_studienplan.orgform_kurzbz) FROM public.tbl_prestudentstatus pss INNER JOIN public.tbl_prestudent ps USING(prestudent_id) JOIN public.tbl_studiengang USING(studiengang_kz) + JOIN lehre.tbl_studienplan using (studienplan_id) WHERE pss.status_kurzbz = \'Interessent\' AND (pss.bewerbung_abgeschicktamum IS NOT NULL AND pss.bewerbung_abgeschicktamum>=\''.$NOTBEFORE.'\') AND pss.bestaetigtam IS NULL @@ -98,9 +103,53 @@ FROM public.tbl_studiensemester WHERE ende >= NOW() ) + AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\') LIMIT 1 ),\', \' ) AS "StgAbgeschickt", + array_to_string( + ( + SELECT array_agg(distinct UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz) || \':\' || tbl_studienplan.orgform_kurzbz) + FROM + public.tbl_prestudentstatus pss + INNER JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang USING(studiengang_kz) + JOIN lehre.tbl_studienplan using (studienplan_id) + WHERE pss.status_kurzbz = \'Interessent\' + AND (pss.bewerbung_abgeschicktamum IS NULL) + AND pss.bestaetigtam IS NULL + AND ps.person_id = p.person_id + AND tbl_studiengang.typ in(\'b\') + AND studiensemester_kurzbz IN ( + SELECT studiensemester_kurzbz + FROM public.tbl_studiensemester + WHERE ende >= NOW() + ) + AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\') + LIMIT 1 + ),\', \' + ) AS "StgNichtAbgeschickt", + array_to_string( + ( + SELECT array_agg(distinct UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz) || \':\' || tbl_studienplan.orgform_kurzbz) + FROM + public.tbl_prestudentstatus pss + INNER JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang USING(studiengang_kz) + JOIN lehre.tbl_studienplan using (studienplan_id) + WHERE pss.status_kurzbz in (\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\') + AND (pss.bewerbung_abgeschicktamum IS NULL) + AND ps.person_id = p.person_id + AND tbl_studiengang.typ in(\'b\') + AND studiensemester_kurzbz IN ( + SELECT studiensemester_kurzbz + FROM public.tbl_studiensemester + WHERE start >= NOW() + ) + AND not exists (select 1 from tbl_prestudentstatus psss where psss.prestudent_id = pss.prestudent_id and psss.status_kurzbz = \'Abgewiesener\') + LIMIT 1 + ),\', \' + ) AS "StgAktiv", pl.zeitpunkt AS "LockDate", pl.lockuser as "LockUser" FROM public.tbl_person p @@ -137,12 +186,10 @@ ) ORDER BY "LastAction" ASC ', - 'hideHeader' => false, - 'hideSave' => false, 'checkboxes' => 'PersonId', 'additionalColumns' => array('Details'), - 'columnsAliases' => array('PersonID','Vorname','Nachname','GebDatum','Letzte Aktion','Letzter Bearbeiter', - 'StSem','GesendetAm','NumAbgeschickt','Studiengänge','Sperrdatum','GesperrtVon'), + 'columnsAliases' => array('PersonID','Vorname','Nachname','GebDatum','Nation', 'Letzte Aktion','Letzter Bearbeiter', + 'StSem','GesendetAm','NumAbgeschickt','StgSent','StgNotSent','StgAktiv', 'Sperrdatum','GesperrtVon'), 'formatRaw' => function($datasetRaw) { $datasetRaw->{'Details'} = sprintf( @@ -186,7 +233,19 @@ if ($datasetRaw->{'StgAbgeschickt'} == null) { - $datasetRaw->{'StgAbgeschickt'} = 'N/A'; + $datasetRaw->{'StgAbgeschickt'} = '-'; + } + if ($datasetRaw->{'StgNichtAbgeschickt'} == null) + { + $datasetRaw->{'StgNichtAbgeschickt'} = '-'; + } + if ($datasetRaw->{'StgAktiv'} == null) + { + $datasetRaw->{'StgAktiv'} = '-'; + } + if ($datasetRaw->{'Nation'} == null) + { + $datasetRaw->{'Nation'} = '-'; } return $datasetRaw; diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index b309f4a22..cbf20b0ec 100755 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -2,6 +2,10 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); +// Retrives the URL path of the called controller + controller method +// NOTE: placed here because it doesn't work inside functions +$calledFrom = $this->router->directory.$this->router->class.'/'.$this->router->method; + // By default set the parameters to null $title = isset($title) ? $title : null; $customCSSs = isset($customCSSs) ? $customCSSs : null; @@ -55,6 +59,26 @@ function _generateCSSsInclude($CSSs) } } +/** + * Generates global JS-Object to pass parms to other javascripts + */ +function _generateJSDataStorageObject($calledFrom) +{ + $toPrint = "\n"; + $toPrint .= ''; + $toPrint .= "\n\n"; + + echo $toPrint; +} + /** * Generates tags for the javascripts you want to include, the parameter could by a string or an array of strings */ @@ -78,13 +102,25 @@ function _generateJSsInclude($JSs) } /** - * Generates global JS-Object to pass parms to addon-js-functions + * Generates all the includes needed by the Addons */ -function _generateAddonDataStorageObject() +function _generateAddonsJSsInclude($calledFrom) { - echo '\n"; + $aktive_addons = array_filter(explode(";", ACTIVE_ADDONS)); + + foreach ($aktive_addons as $addon) + { + $hookfile = DOC_ROOT.'addons/'.$addon.'/hooks.config.inc.php'; + if (file_exists($hookfile)) + { + include($hookfile); + if (key_exists($calledFrom, $js_hooks)) + { + foreach ($js_hooks[$calledFrom] as $js_file) + _generateJSsInclude('addons/'.$addon.'/'.$js_file); + } + } + } } ?> @@ -102,16 +138,20 @@ function _generateAddonDataStorageObject() // jQuery UI CSS if ($jqueryui === true) _generateCSSsInclude('vendor/components/jqueryui/themes/base/jquery-ui.min.css'); + // bootstrap CSS if ($bootstrap === true) _generateCSSsInclude('vendor/twbs/bootstrap/dist/css/bootstrap.min.css'); + // font awesome CSS if ($fontawesome === true) _generateCSSsInclude('vendor/components/font-awesome/css/font-awesome.min.css'); + // Table sorter CSS if ($tablesorter === true) { _generateCSSsInclude('vendor/mottie/tablesorter/dist/css/theme.default.min.css'); _generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css'); } + // sb admin template CSS if ($sbadmintemplate === true) { @@ -125,8 +165,13 @@ function _generateAddonDataStorageObject() // -------------------------------------------------------------------------------------------------------- // Javascripts + // Generates the global object to pass useful parms to the other javascripts + // NOTE: must be called before any other JS include + _generateJSDataStorageObject($calledFrom); + // JQuery V3 if ($jquery === true) _generateJSsInclude('vendor/components/jquery/jquery.min.js'); + // JQuery UI if ($jqueryui === true) { @@ -134,8 +179,10 @@ function _generateAddonDataStorageObject() //datepicker german language file _generateJSsInclude('vendor/components/jqueryui/ui/i18n/datepicker-de.js'); } + // bootstrap JS if ($bootstrap === true) _generateJSsInclude('vendor/twbs/bootstrap/dist/js/bootstrap.min.js'); + // Table sorter JS if ($tablesorter === true) { @@ -143,6 +190,7 @@ function _generateAddonDataStorageObject() _generateJSsInclude('vendor/mottie/tablesorter/dist/js/jquery.tablesorter.widgets.min.js'); _generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js'); } + //tinymce JS if($tinymce === true) _generateJSsInclude('vendor/tinymce/tinymce/tinymce.min.js') ; @@ -153,27 +201,8 @@ function _generateAddonDataStorageObject() _generateJSsInclude('vendor/BlackrockDigital/startbootstrap-sb-admin-2/dist/js/sb-admin-2.min.js'); } - // load addon hooks JS - if ($addons === true) - { - _generateAddonDataStorageObject(); - - $aktive_addons = array_filter(explode(";", ACTIVE_ADDONS)); - $called_from = $this->router->directory.$this->router->class.'/'.$this->router->method; - foreach ($aktive_addons as $addon) - { - $hookfile = DOC_ROOT.'addons/'.$addon.'/hooks.config.inc.php'; - if (file_exists($hookfile)) - { - include($hookfile); - if (key_exists($called_from, $js_hooks)) - { - foreach ($js_hooks[$called_from] as $js_file) - _generateJSsInclude('addons/'.$addon.'/'.$js_file); - } - } - } - } + // Load addon hooks JS + if ($addons === true) _generateAddonsJSsInclude($calledFrom); // Eventually required JS _generateJSsInclude($customJSs); diff --git a/application/views/widgets/filter/filter.php b/application/views/widgets/filter/filter.php index 606d19b60..669fb914d 100644 --- a/application/views/widgets/filter/filter.php +++ b/application/views/widgets/filter/filter.php @@ -1,5 +1,11 @@ diff --git a/application/views/widgets/filter/saveFilter.php b/application/views/widgets/filter/saveFilter.php index 1fd9c57af..99f5f5d9d 100644 --- a/application/views/widgets/filter/saveFilter.php +++ b/application/views/widgets/filter/saveFilter.php @@ -30,12 +30,19 @@ +
+
+ + Filter description: + - Filter description: +
+ +
diff --git a/application/views/widgets/filter/selectFields.php b/application/views/widgets/filter/selectFields.php index 57edda25e..18d5cac02 100644 --- a/application/views/widgets/filter/selectFields.php +++ b/application/views/widgets/filter/selectFields.php @@ -232,7 +232,7 @@
- + Add field: diff --git a/application/views/widgets/filter/selectFilters.php b/application/views/widgets/filter/selectFilters.php index f79a1e449..9f775a826 100644 --- a/application/views/widgets/filter/selectFilters.php +++ b/application/views/widgets/filter/selectFilters.php @@ -29,28 +29,6 @@ }); - $(".remove-filter").click(function(event) { - - $.ajax({ - url: "", - method: "POST", - data: { - fieldName: $(this).attr('filterToRemove') - } - }) - .done(function(data, textStatus, jqXHR) { - - resetSelectedFilters(); - renderSelectedFilters(); - - renderTableDataset(); - - }).fail(function(jqXHR, textStatus, errorThrown) { - alert(textStatus); - }); - - }); - $(".select-filter-operation").change(function() { if ($(this).val() == "set" || $(this).val() == "nset") @@ -116,6 +94,23 @@ }); }); + + $(".remove-selected-filter").click(function(event) { + $.ajax({ + url: "", + method: "POST", + data: { + fieldName: $(this).attr('filterToRemove') + } + }) + .done(function(data, textStatus, jqXHR) { + resetSelectedFilters(); + renderSelectedFilters(); + }).fail(function(jqXHR, textStatus, errorThrown) { + alert(textStatus); + }); + }); + } function renderSelectedFilterFields(metaData, activeFilters, activeFiltersOperation, activeFiltersOption) @@ -125,7 +120,7 @@ if (metaData.type.toLowerCase().indexOf("int") >= 0) { html = ''; - html += ' '; html += ' '; html += ' '; html += ' '; @@ -133,37 +128,37 @@ html += ' '; html += ''; html += ''; - html += ' '; + html += ' '; html += ''; } - if (metaData.type.toLowerCase().indexOf('varchar') >= 0) + if (metaData.type.toLowerCase().indexOf('varchar') >= 0 || metaData.type.toLowerCase() == 'text') { html = ''; - html += ' '; html += ' '; html += ' '; html += ' '; html += ''; html += ''; - html += ' '; + html += ' '; html += ''; } if (metaData.type.toLowerCase().indexOf('bool') >= 0) { html = ''; - html += ' '; html += ' '; html += ' '; html += ' '; html += ''; html += ''; - html += ' '; + html += ' '; html += ''; } if (metaData.type.toLowerCase().indexOf('timestamp') >= 0 || metaData.type.toLowerCase().indexOf('date') >= 0) { - var classOperation = 'select-filter-operation-value form-control'; - var classOption = 'select-filter-option form-control'; + var classOperation = 'form-control select-filter-operation-value'; + var classOption = 'form-control select-filter-option'; var disabled = ""; if (activeFiltersOperation == "set" || activeFiltersOperation == "nset") @@ -174,7 +169,7 @@ } html = ''; - html += ' '; html += ' '; html += ' '; html += ' '; @@ -220,7 +215,7 @@ { var selectedFilters = '
'; - selectedFilters += ''; + selectedFilters += ''; selectedFilters += data.selectedFiltersAliases[i]; selectedFilters += ''; @@ -232,7 +227,7 @@ ); selectedFilters += ''; - selectedFilters += ''; + selectedFilters += ''; selectedFilters += ''; selectedFilters += '
'; @@ -277,10 +272,12 @@ +
+
- + Add filter: @@ -289,6 +286,6 @@ - +
diff --git a/application/views/widgets/navigationMenu.php b/application/views/widgets/navigationMenu.php index 1fdb4b6b3..427fecf2e 100644 --- a/application/views/widgets/navigationMenu.php +++ b/application/views/widgets/navigationMenu.php @@ -139,7 +139,7 @@ { // Hiding/showing navigation menu - works only with sb admin 2 template!! - $("#side-menu").prepend('
  • '); + $("#side-menu").html('
  • '); $("#collapseicon").click(function() { $("#page-wrapper").css('margin-left', '0px'); $("#side-menu").hide(); diff --git a/cis/private/open_grp.php b/cis/private/open_grp.php index 2973ac7cd..aca6272d4 100644 --- a/cis/private/open_grp.php +++ b/cis/private/open_grp.php @@ -87,16 +87,62 @@ echo ' '.$p->t('mailverteiler/oeffnenEinesVerteilers').' + '; if (isset($_REQUEST['token']) && isset($_REQUEST['grp'])) { echo ' - - - - - '; +

    '.$p->t('mailverteiler/oeffnenEinesVerteilers').'

    '; /* Generate an random String */ $mail_id = mail_id_generator(); @@ -116,30 +162,18 @@ if (isset($_REQUEST['token']) && isset($_REQUEST['grp'])) fwrite($filet, $message, mb_strlen($message)); fclose($filet); - echo " - - - - - - - - "; + echo ' +

    '.$p->t('mailverteiler/geoeffnet',$db->convert_html_chars($_REQUEST['desc'])).'

    +

    Code: '.$mail_id.'
    + Adresse: '.$_REQUEST["grp"].$mail_id.'@'.DOMAIN.'

    +

    '.$p->t('mailverteiler/klickenZumSchicken').'

    +

    '.$p->t('mailverteiler/infoBenutzung').'

    '; } else { echo ' - - - '; +

    '.$p->t('mailverteiler/oeffnenFehlgeschlagen').'

    '; } - echo '
    '.$p->t('mailverteiler/mailverteiler').''.$p->t('mailverteiler/status').'
    ".$db->convert_html_chars($_REQUEST['desc'])."".$p->t('mailverteiler/geoeffnet')." (Code: ".$mail_id.")
    -

    ".$p->t('mailverteiler/klickenZumSchicken')."

    - -

    ".$p->t('mailverteiler/infoBenutzung',array($_REQUEST['grp'].$mail_id."@".DOMAIN))."

    -
    - '.$p->t('mailverteiler/oeffnenFehlgeschlagen').' -
    '; } else { @@ -149,7 +183,9 @@ else } else { - echo $p->t('mailverteiler/bestaetigeOeffnen',array($_REQUEST['grp']))." : convert_html_chars($_REQUEST['desc'])."&token=1\">".$p->t('mailverteiler/bestaetige').""; + echo '

    '.$p->t('mailverteiler/oeffnenEinesVerteilers').'

    '; + echo $p->t('mailverteiler/bestaetigeOeffnen').':'; + echo ''; } } diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php index 6961ddf11..40cefd67b 100644 --- a/cis/private/profile/index.php +++ b/cis/private/profile/index.php @@ -47,7 +47,7 @@ $p=new phrasen($sprache); if (!$db = new basis_db()) die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung')); -$uid=get_uid(); +$uid = get_uid(); $datum_obj = new datum(); @@ -129,11 +129,11 @@ echo ' - - - - - + + + + + <?php echo $p->t('tools/ampelsystem') ?> @@ -346,7 +342,7 @@ $(document).ready(function(){ ' . $p->t('tools/ampelsystem') . ''; + echo '

    ' . $p->t('tools/ampelsystem') . '

    '; //title in popup for mandatory ampeln if ($is_popup) @@ -402,10 +398,33 @@ $(document).ready(function(){ $cnt = 1; //counter to set iterative id's $cnt_inactive = 1; //counter to set only one heading line for inactive ampeln + $cnt_active = 0; + + //show panel "no actual ampeln" if there are no active ampeln + foreach ($user_ampel_arr as $user_ampel) + { + if ($user_ampel['active'] == true) + $cnt_active++; + } + + if ($cnt_active == 0) + { + echo ' +
    +
    + +
    +
    '; + + } //fill panel with ampeln foreach ($user_ampel_arr as $user_ampel) { + //use only ampeln that are not overdue if ($user_ampel['show_ampel'] == true) { @@ -416,7 +435,7 @@ $(document).ready(function(){
    @@ -428,12 +447,12 @@ $(document).ready(function(){