From 5635f1792c1fa72c11e26ea48789836d15daedd8 Mon Sep 17 00:00:00 2001 From: Paolo Date: Tue, 17 Jul 2018 17:13:12 +0200 Subject: [PATCH 1/4] - Removed config file application/config/fhcomplete.php - Moved config messages entries from fhcomplete.php to application/config/message.php - Renamed the config entry addons_aufnahme_url to message_redirect_url - Adapted application/controllers/Redirect.php to use this new entry --- application/config/autoload.php | 2 +- application/config/fhcomplete.php | 9 --------- application/config/message.php | 4 ++++ application/controllers/Redirect.php | 4 ++-- 4 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 application/config/fhcomplete.php diff --git a/application/config/autoload.php b/application/config/autoload.php index baf545db6..4916ef0ce 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -98,7 +98,7 @@ $autoload['helper'] = array('url', 'language'); | config files. Otherwise, leave it blank. | */ -$autoload['config'] = array('fhcomplete'); +$autoload['config'] = array(); /* | ------------------------------------------------------------------- diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php deleted file mode 100644 index 427270550..000000000 --- a/application/config/fhcomplete.php +++ /dev/null @@ -1,9 +0,0 @@ -sentInfo separator diff --git a/application/controllers/Redirect.php b/application/controllers/Redirect.php index 38b7c6dbe..8a24c590d 100644 --- a/application/controllers/Redirect.php +++ b/application/controllers/Redirect.php @@ -58,7 +58,7 @@ class Redirect extends FHC_Controller show_error('No organisation unit present in the message'); } - $addonAufnahmeUrls = $this->config->item('addons_aufnahme_url'); + $addonAufnahmeUrls = $this->config->item('message_redirect_url'); if(!isset($addonAufnahmeUrls[$organisationRoot])) $organisationRoot = 'fallback'; @@ -73,7 +73,7 @@ class Redirect extends FHC_Controller } else { - $addonAufnahmeUrls = $this->config->item('addons_aufnahme_url'); + $addonAufnahmeUrls = $this->config->item('message_redirect_url'); if (isset($token) && hasData($msg) && is_array($addonAufnahmeUrls) From bb52aee900e1755b6b648cb0bb5ccc9734e5398c Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 18 Jul 2018 12:04:00 +0200 Subject: [PATCH 2/4] - Moved spl_autoload_register from application/config/config.php to application/config/core_includes.php - application/config/core_includes.php is included by index.ci.php - Renamed the prefix of the helpers from "fhc_" to "hlp_" - Adapted the helpers includes --- application/config/config.php | 13 ------------- application/config/core_includes.php | 12 ++++++++++++ application/controllers/api/v1/Test.php | 2 +- application/controllers/jobs/AmpelMail.php | 2 +- application/core/APIv1_Controller.php | 4 ++-- application/core/Auth_Controller.php | 2 +- application/core/FHC_Controller.php | 10 +++++----- ...ion_helper.php => hlp_authentication_helper.php} | 0 ...{fhc_common_helper.php => hlp_common_helper.php} | 0 ...{fhc_header_helper.php => hlp_header_helper.php} | 0 ..._language_helper.php => hlp_language_helper.php} | 0 ...hc_message_helper.php => hlp_message_helper.php} | 0 ...{fhc_sancho_helper.php => hlp_sancho_helper.php} | 0 ...hc_session_helper.php => hlp_session_helper.php} | 0 application/libraries/FiltersLib.php | 2 +- application/models/system/MessageToken_model.php | 2 +- index.ci.php | 3 +++ 17 files changed, 27 insertions(+), 25 deletions(-) create mode 100644 application/config/core_includes.php rename application/helpers/{fhc_authentication_helper.php => hlp_authentication_helper.php} (100%) rename application/helpers/{fhc_common_helper.php => hlp_common_helper.php} (100%) rename application/helpers/{fhc_header_helper.php => hlp_header_helper.php} (100%) rename application/helpers/{fhc_language_helper.php => hlp_language_helper.php} (100%) rename application/helpers/{fhc_message_helper.php => hlp_message_helper.php} (100%) rename application/helpers/{fhc_sancho_helper.php => hlp_sancho_helper.php} (100%) rename application/helpers/{fhc_session_helper.php => hlp_session_helper.php} (100%) diff --git a/application/config/config.php b/application/config/config.php index 152bda403..2602c12cf 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -502,16 +502,3 @@ $config['rewrite_short_tags'] = FALSE; | Array: array('10.0.1.200', '192.168.5.0/24') */ $config['proxy_ips'] = ''; - -/* -|-------------------------------------------------------------------------- -| Autoload Custom Controllers -|-------------------------------------------------------------------------- -| -| It's working, so don't delete this :D -*/ -spl_autoload_register(function ($class) { - if (substr($class,0,3) !== 'CI_' && substr($class,0,4) !== 'FHC_') - if (file_exists($file = APPPATH . 'core/' . $class . '.php')) - require_once $file; -}); diff --git a/application/config/core_includes.php b/application/config/core_includes.php new file mode 100644 index 000000000..734686471 --- /dev/null +++ b/application/config/core_includes.php @@ -0,0 +1,12 @@ +load->helper('fhc_message'); + $this->load->helper('hlp_message'); } /** diff --git a/application/controllers/jobs/AmpelMail.php b/application/controllers/jobs/AmpelMail.php index b88c5536b..e27bd5f82 100644 --- a/application/controllers/jobs/AmpelMail.php +++ b/application/controllers/jobs/AmpelMail.php @@ -44,7 +44,7 @@ class AmpelMail extends FHC_Controller $this->load->model('person/Person_model', 'PersonModel'); // Load helpers - $this->load->helper('fhc_sancho'); + $this->load->helper('hlp_sancho'); } /** diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php index 11ed9fc98..b2cd98051 100644 --- a/application/core/APIv1_Controller.php +++ b/application/core/APIv1_Controller.php @@ -12,10 +12,10 @@ class APIv1_Controller extends REST_Controller parent::__construct(); // Loads helper message to manage returning messages - $this->load->helper('fhc_message'); + $this->load->helper('hlp_message'); // Loads helper with generic utility function - $this->load->helper('fhc_common'); + $this->load->helper('hlp_common'); // Loads permission lib $this->load->library('PermissionLib'); diff --git a/application/core/Auth_Controller.php b/application/core/Auth_Controller.php index 3cdde3e0e..5a3986c90 100644 --- a/application/core/Auth_Controller.php +++ b/application/core/Auth_Controller.php @@ -12,7 +12,7 @@ class Auth_Controller extends FHC_Controller parent::__construct(); // Loads authentication helper - $this->load->helper('fhc_authentication'); + $this->load->helper('hlp_authentication'); // Checks if the caller is allowed to access to this content $this->_isAllowed($requiredPermissions); diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index 14acc1ca0..5b6901f52 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -21,19 +21,19 @@ class FHC_Controller extends CI_Controller $this->_controllerId = null; // set _controllerId as null by default // Loads helper message to manage returning messages - $this->load->helper('fhc_message'); + $this->load->helper('hlp_message'); // Loads helper with generic utility function - $this->load->helper('fhc_common'); + $this->load->helper('hlp_common'); // Loads helper session to manage the php session - $this->load->helper('fhc_session'); + $this->load->helper('hlp_session'); // Loads language helper - $this->load->helper('fhc_language'); + $this->load->helper('hlp_language'); // Loads header helper - $this->load->helper('fhc_header'); + $this->load->helper('hlp_header'); } //------------------------------------------------------------------------------------------------------------------ diff --git a/application/helpers/fhc_authentication_helper.php b/application/helpers/hlp_authentication_helper.php similarity index 100% rename from application/helpers/fhc_authentication_helper.php rename to application/helpers/hlp_authentication_helper.php diff --git a/application/helpers/fhc_common_helper.php b/application/helpers/hlp_common_helper.php similarity index 100% rename from application/helpers/fhc_common_helper.php rename to application/helpers/hlp_common_helper.php diff --git a/application/helpers/fhc_header_helper.php b/application/helpers/hlp_header_helper.php similarity index 100% rename from application/helpers/fhc_header_helper.php rename to application/helpers/hlp_header_helper.php diff --git a/application/helpers/fhc_language_helper.php b/application/helpers/hlp_language_helper.php similarity index 100% rename from application/helpers/fhc_language_helper.php rename to application/helpers/hlp_language_helper.php diff --git a/application/helpers/fhc_message_helper.php b/application/helpers/hlp_message_helper.php similarity index 100% rename from application/helpers/fhc_message_helper.php rename to application/helpers/hlp_message_helper.php diff --git a/application/helpers/fhc_sancho_helper.php b/application/helpers/hlp_sancho_helper.php similarity index 100% rename from application/helpers/fhc_sancho_helper.php rename to application/helpers/hlp_sancho_helper.php diff --git a/application/helpers/fhc_session_helper.php b/application/helpers/hlp_session_helper.php similarity index 100% rename from application/helpers/fhc_session_helper.php rename to application/helpers/hlp_session_helper.php diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 22fd77d4b..51c399f29 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -87,7 +87,7 @@ class FiltersLib $this->_ci =& get_instance(); // get code igniter instance // Loads authentication helper - $this->_ci->load->helper('fhc_authentication'); // NOTE: needed to load custom filters do not remove! + $this->_ci->load->helper('hlp_authentication'); // NOTE: needed to load custom filters do not remove! $this->_filterUniqueId = $this->_getFilterUniqueId($params); // sets the id for the related filter widget } diff --git a/application/models/system/MessageToken_model.php b/application/models/system/MessageToken_model.php index 04f23382d..64cfe4996 100644 --- a/application/models/system/MessageToken_model.php +++ b/application/models/system/MessageToken_model.php @@ -18,7 +18,7 @@ class MessageToken_model extends CI_Model $this->config->load('message'); // Load return message helper - $this->load->helper('fhc_message'); + $this->load->helper('hlp_message'); // Loads the database object $this->load->database(); diff --git a/index.ci.php b/index.ci.php index 043acb111..5514d9450 100644 --- a/index.ci.php +++ b/index.ci.php @@ -306,5 +306,8 @@ require_once 'config/vilesci.config.inc.php'; // ... and the vendor autoload include_once 'vendor/autoload.php'; +// Autoload custom controllers, models, etc that are present in the application/core directory +require_once 'application/config/core_includes.php'; + // Now the bootstrap file require_once BASEPATH.'core/CodeIgniter.php'; From 2045c21e633a73c818437500c75894e5bfbfe7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 18 Jul 2018 16:29:10 +0200 Subject: [PATCH 3/4] Inventarliste Export um Spalte Status erweitert --- vilesci/inventar/inventarliste.php | 32 +++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/vilesci/inventar/inventarliste.php b/vilesci/inventar/inventarliste.php index d330165ae..3166c4afb 100644 --- a/vilesci/inventar/inventarliste.php +++ b/vilesci/inventar/inventarliste.php @@ -26,7 +26,7 @@ require_once('../../include/benutzerberechtigung.class.php'); require_once('../../include/mitarbeiter.class.php'); require_once('../../include/ort.class.php'); require_once('../../include/organisationseinheit.class.php'); -require_once('../../include/person.class.php'); +require_once('../../include/person.class.php'); require_once('../../include/betriebsmittel.class.php'); require_once('../../include/betriebsmittelperson.class.php'); require_once('../../include/betriebsmitteltyp.class.php'); @@ -38,6 +38,11 @@ require_once('../../include/Excel/excel.php'); if (!$uid = get_uid()) die('Keine UID gefunden ! Zurück'); +$rechte = new benutzerberechtigung(); +$rechte->getBerechtigungen($uid); + +if(!$rechte->isBerechtigt('wawi/inventar:begrenzt')) + die($rechte->errormsg); $inventarnummer=trim((isset($_REQUEST['inventarnummer']) ? $_REQUEST['inventarnummer']:'')); $seriennummer=trim((isset($_REQUEST['seriennummer']) ? $_REQUEST['seriennummer']:'')); @@ -67,7 +72,7 @@ $default_status_vorhanden='vorhanden'; $oBetriebsmittelstatus = new betriebsmittelstatus(); $oBetriebsmittelstatus->result=array(); - + $resultBetriebsmittelstatus=$oBetriebsmittelstatus->result; $oBetriebsmittel = new betriebsmittel(); @@ -104,7 +109,7 @@ $format_right->setAlign('right'); $spalte=0; $zeile=0; - + if (is_null($resultBetriebsmittel) || !is_array($resultBetriebsmittel) || count($resultBetriebsmittel)<1) return false; @@ -132,6 +137,8 @@ $worksheet->write($zeile,++$spalte,'Anschaffungsdatum',$format_bold); $maxlength[$spalte]=17; $worksheet->write($zeile,++$spalte,'Anschaffungswert',$format_bold); $maxlength[$spalte]=16; +$worksheet->write($zeile,++$spalte,'Status',$format_bold); +$maxlength[$spalte]=16; $worksheet->write($zeile,++$spalte,'Person',$format_bold); $maxlength[$spalte]=20; @@ -139,7 +146,7 @@ for ($pos=0;$posoe_kurzbz=trim($resultBetriebsmittel[$pos]->oe_kurzbz); if (empty($resultBetriebsmittel[$pos]->oe_kurzbz)) { @@ -147,11 +154,11 @@ for ($pos=0;$posload_betriebsmittel_oe($resultBetriebsmittel[$pos]->betriebsmittel_id)) $resultBetriebsmittel[$pos]->oe_kurzbz=$oBetriebsmittelOrganisationseinheit->oe_kurzbz; - else if ($oBetriebsmittelOrganisationseinheit->errormsg) + else if ($oBetriebsmittelOrganisationseinheit->errormsg) $resultBetriebsmittel[$pos]->oe_kurzbz=$oBetriebsmittelOrganisationseinheit->errormsg; } - - + + $oOrganisationseinheit = new organisationseinheit($resultBetriebsmittel[$pos]->oe_kurzbz); //$oOrganisationseinheit->bezeichnung=''; // String - Daten Leerzeichen am Ende entfernen @@ -163,7 +170,7 @@ for ($pos=0;$posfirma_id=trim($resultBetriebsmittel[$pos]->firma_id); $resultBetriebsmittel[$pos]->firmenname=trim($resultBetriebsmittel[$pos]->firmenname); - + InsertCell($zeile,$spalte,$resultBetriebsmittel[$pos]->inventarnummer); InsertCell($zeile,++$spalte,mb_str_replace("\r\n"," ",$resultBetriebsmittel[$pos]->beschreibung)); InsertCell($zeile,++$spalte,mb_str_replace("\r\n"," ",$resultBetriebsmittel[$pos]->verwendung)); @@ -174,9 +181,10 @@ for ($pos=0;$posformatDatum($resultBetriebsmittel[$pos]->betriebsmittelstatus_datum,'d.m.Y'),$format_date); InsertCell($zeile,++$spalte,$datum_obj->formatDatum($resultBetriebsmittel[$pos]->inventuramum,'d.m.Y'),$format_date); InsertCell($zeile,++$spalte,$datum_obj->formatDatum($resultBetriebsmittel[$pos]->leasing_bis,'d.m.Y'),$format_date); - + InsertCell($zeile,++$spalte,$datum_obj->formatDatum($resultBetriebsmittel[$pos]->anschaffungsdatum,'d.m.Y'),$format_date); InsertCell($zeile,++$spalte,$resultBetriebsmittel[$pos]->anschaffungswert, $format_number); + InsertCell($zeile,++$spalte,$resultBetriebsmittel[$pos]->betriebsmittelstatus_kurzbz); $bmp = new betriebsmittelperson(); $bmp->load_betriebsmittelpersonen($resultBetriebsmittel[$pos]->betriebsmittel_id); @@ -190,12 +198,12 @@ $maxlength[2]=30; foreach($maxlength as $i=>$breite) $worksheet->setColumn(0, $i, $breite+2); $workbook->close(); - + function InsertCell($zeile, $spalte, $value, $format=null) { global $maxlength, $worksheet; - + if(!is_null($format)) { if($format=='string') @@ -205,7 +213,7 @@ function InsertCell($zeile, $spalte, $value, $format=null) } else $worksheet->write($zeile,$spalte,$value); - + if(mb_strlen($value)>$maxlength[$spalte]) $maxlength[$spalte]=mb_strlen($value); } From 40828665a7cd4f6f7540c3751113c8704ad95c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 18 Jul 2018 16:29:54 +0200 Subject: [PATCH 4/4] =?UTF-8?q?Header=20Navigation=20einger=C3=BCckt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/NavigationWidget.css | 1 + 1 file changed, 1 insertion(+) diff --git a/public/css/NavigationWidget.css b/public/css/NavigationWidget.css index 0f3f30666..ae63d0e3b 100644 --- a/public/css/NavigationWidget.css +++ b/public/css/NavigationWidget.css @@ -36,6 +36,7 @@ .navbar-header { padding-top: 15px; + padding-left: 15px; height: 50px; }