From b480ec30a269b1ff52cc4527aa15c704210964b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 8 Feb 2018 17:32:41 +0100 Subject: [PATCH 1/8] Handled Errors if there are no Filters --- application/controllers/system/infocenter/InfoCenter.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 6e08c1b57..5c07c3027 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -386,6 +386,9 @@ class InfoCenter extends VileSci_Controller */ private function _setNavigationMenuArray() { + $listFiltersSent = array(); + $listFiltersNotSent = array(); + $filtersSent = $this->FiltersModel->getFilterList('infocenter', 'PersonActions', '%InfoCenterSentApplication%'); if (hasData($filtersSent)) { From 9f4f4909b99ac4e79da550a16bc860f300e81b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 8 Feb 2018 19:37:33 +0100 Subject: [PATCH 2/8] Infocenter Rolle angepasst --- application/config/fhcomplete.php | 2 -- application/config/roles.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 29c93e2e4..31c7dc6f6 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -240,8 +240,6 @@ $config['fhc_acl'] = array DMS_PATH => 'fs/dms', - 'public.tbl_sprache' => 'admin', - 'PhrasesLib.getPhrase' => 'system/PhrasesLib' ); diff --git a/application/config/roles.php b/application/config/roles.php index 6c2d0614b..227321f32 100644 --- a/application/config/roles.php +++ b/application/config/roles.php @@ -55,7 +55,7 @@ $config['roles'] = array ( 'basis/adresse','basis/akte','basis/kontakt','basis/log','basis/nation','basis/notiz','basis/notizzuordnung', 'basis/person','basis/prestudent','basis/prestudentstatus','basis/status','basis/zgv','basis/zgvmaster', - 'lehre/studienplan','system/filters','fs/dms' + 'lehre/studienplan','system/filters','fs/dms','basis/message','basis/benutzerrolle', 'basis/sprache' ) ) ); From d23e44643dca423a2bdd466919b4b3efe4e05157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 8 Feb 2018 19:37:58 +0100 Subject: [PATCH 3/8] PHP compatibility fix --- system/environment.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/environment.php b/system/environment.php index dc4e6b992..8300c3fa4 100644 --- a/system/environment.php +++ b/system/environment.php @@ -92,7 +92,10 @@ printValue("php-curl", extension_loaded('curl')); $returnArray = array(); exec('unoconv --version',$returnArray); if(isset($returnArray[0])) - $unoconvVersion = explode(' ',$returnArray[0])[1]; +{ + $hlp = explode(' ',$returnArray[0]); + $unoconvVersion = $hlp[1]; +} else $unoconvVersion = false; From e2e4f03c598dd493779f2b3212aa6a509c4f68da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 9 Feb 2018 15:16:53 +0100 Subject: [PATCH 4/8] Removed Model of legacy Table --- application/config/fhcomplete.php | 2 -- application/models/crm/Aufnahmetermin_model.php | 14 -------------- application/models/crm/Aufnahmetermintyp_model.php | 14 -------------- 3 files changed, 30 deletions(-) delete mode 100644 application/models/crm/Aufnahmetermin_model.php delete mode 100644 application/models/crm/Aufnahmetermintyp_model.php diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 31c7dc6f6..5bdaa4692 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -125,8 +125,6 @@ $config['fhc_acl'] = array 'public.tbl_ampel' => 'basis/ampel', 'public.tbl_aufmerksamdurch' => 'basis/aufmerksamdurch', 'public.tbl_aufnahmeschluessel' => 'basis/aufnahmeschluessel', - 'public.tbl_aufnahmetermin' => 'basis/aufnahmetermin', - 'public.tbl_aufnahmetermintyp' => 'basis/aufnahmetermintyp', 'public.tbl_bankverbindung' => 'basis/bankverbindung', 'public.tbl_benutzer' => 'basis/benutzer', 'public.tbl_benutzerfunktion' => 'basis/benutzerfunktion', diff --git a/application/models/crm/Aufnahmetermin_model.php b/application/models/crm/Aufnahmetermin_model.php deleted file mode 100644 index c023f6403..000000000 --- a/application/models/crm/Aufnahmetermin_model.php +++ /dev/null @@ -1,14 +0,0 @@ -dbTable = 'public.tbl_aufnahmetermin'; - $this->pk = 'aufnahmetermin_id'; - } -} diff --git a/application/models/crm/Aufnahmetermintyp_model.php b/application/models/crm/Aufnahmetermintyp_model.php deleted file mode 100644 index e75db011c..000000000 --- a/application/models/crm/Aufnahmetermintyp_model.php +++ /dev/null @@ -1,14 +0,0 @@ -dbTable = 'public.tbl_aufnahmetermintyp'; - $this->pk = 'aufnahmetermintyp_kurzbz'; - } -} From a6247c464f10175f29d7debe920eeb625c93796c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 9 Feb 2018 15:19:33 +0100 Subject: [PATCH 5/8] Removed Model of legacy Table --- application/config/fhcomplete.php | 1 - application/models/ressource/Zeitfenster_model.php | 14 -------------- 2 files changed, 15 deletions(-) delete mode 100644 application/models/ressource/Zeitfenster_model.php diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index 5bdaa4692..3b24595a7 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -116,7 +116,6 @@ $config['fhc_acl'] = array 'lehre.tbl_vertrag' => 'basis/vertrag', 'lehre.tbl_vertragsstatus' => 'basis/vertragsstatus', 'lehre.tbl_vertragstyp' => 'basis/vertragstyp', - 'lehre.tbl_zeitfenster' => 'basis/zeitfenster', 'lehre.tbl_zeugnis' => 'basis/zeugnis', 'lehre.tbl_zeugnisnote' => 'basis/zeugnisnote', 'lehre.vw_studienplan' => 'lehre/studienplan', diff --git a/application/models/ressource/Zeitfenster_model.php b/application/models/ressource/Zeitfenster_model.php deleted file mode 100644 index e9ef6709c..000000000 --- a/application/models/ressource/Zeitfenster_model.php +++ /dev/null @@ -1,14 +0,0 @@ -dbTable = 'lehre.tbl_zeitfenster'; - $this->pk = array('wochentag', 'studiengang_kz', 'ort_kurzbz', 'stunde'); - } -} From fe5e5cc3134e2a89434f43f52469b85592babd4a Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 9 Feb 2018 17:00:16 +0100 Subject: [PATCH 6/8] added lines with actions for multiple persons in infocenter uebersicht (send message, select all, number of rows), message with no sender sends from logged user, layout tweaks writemessage page --- application/controllers/system/Messages.php | 54 +++++++++--- .../views/system/infocenter/infocenter.php | 9 +- .../system/infocenter/infocenterDetails.php | 15 +--- .../views/system/infocenter/stammdaten.php | 18 ++-- application/views/system/messageWrite.php | 35 +++++--- application/views/widgets/filter/filter.php | 16 ++-- include/js/bootstrapper.js | 3 +- include/js/infocenterPersonDataset.js | 82 +++++++++++++++++++ 8 files changed, 174 insertions(+), 58 deletions(-) create mode 100644 include/js/infocenterPersonDataset.js diff --git a/application/controllers/system/Messages.php b/application/controllers/system/Messages.php index e0642ca02..2c2474a1e 100644 --- a/application/controllers/system/Messages.php +++ b/application/controllers/system/Messages.php @@ -27,8 +27,19 @@ class Messages extends VileSci_Controller /** * write */ - public function write($sender_id, $msg_id = null, $receiver_id = null) + public function write($sender_id = null, $msg_id = null, $receiver_id = null) { + if ($sender_id === null) + { + $user_person = $this->PersonModel->getByUid($this->uid); + + if (isError($user_person)) + { + show_error($user_person->retval); + } + $sender_id = $user_person->retval[0]->person_id; + } + $prestudent_id = $this->input->post('prestudent_id'); $person_id = $this->input->post('person_id'); $personOnly = false; @@ -68,7 +79,7 @@ class Messages extends VileSci_Controller $benutzerResult = $this->BenutzerfunktionModel->getByPersonId($sender_id); if (hasData($benutzerResult)) { - foreach($benutzerResult->retval as $val) + foreach ($benutzerResult->retval as $val) { $oe_kurzbz[] = $val->oe_kurzbz; } @@ -95,6 +106,12 @@ class Messages extends VileSci_Controller $v = $this->load->view('system/messageWrite', $data); } + /** + * gets Message Variables and their data for Prestudent + * @param $prestudent_id + * @param $variablesArray to be filled with variable names + * @param $msgVarsData to be filled with variable data + */ private function getPrestudentMsgData($prestudent_id, &$variablesArray, &$msgVarsData) { $msgVarsData = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id); @@ -111,7 +128,7 @@ class Messages extends VileSci_Controller { $variablesArray = array(); // Skip person_id and prestudent_id - for($i = 2; $i < count($variables->retval); $i++) + for ($i = 2; $i < count($variables->retval); $i++) { $variablesArray['{'.str_replace(" ", "_", strtolower($variables->retval[$i])).'}'] = $variables->retval[$i]; } @@ -121,6 +138,12 @@ class Messages extends VileSci_Controller array_shift($variables->retval); // Remove prestudent_id } + /** + * gets Message Variables and their data for Person + * @param $person_id + * @param $variablesArray to be filled with variable names + * @param $msgVarsData to be filled with variable data + */ private function getPersonMsgData($person_id, &$variablesArray, &$msgVarsData) { $msgVarsData = $this->MessageModel->getMsgVarsDataByPersonId($person_id); @@ -137,7 +160,7 @@ class Messages extends VileSci_Controller { $variablesArray = array(); // Skip person_id - for($i = 1; $i < count($variables->retval); $i++) + for ($i = 1; $i < count($variables->retval); $i++) { $variablesArray['{'.str_replace(" ", "_", strtolower($variables->retval[$i])).'}'] = $variables->retval[$i]; } @@ -148,8 +171,19 @@ class Messages extends VileSci_Controller /** * send */ - public function send($sender_id) + public function send($sender_id = null) { + if ($sender_id === null) + { + $user_person = $this->PersonModel->getByUid($this->uid); + + if (isError($user_person)) + { + show_error($user_person->retval); + } + $sender_id = $user_person->retval[0]->person_id; + } + $error = false; $subject = $this->input->post('subject'); @@ -165,7 +199,7 @@ class Messages extends VileSci_Controller // get message data of prestudents or persons $prestudentsData = array(); - if($prestudents !== null) + if ($prestudents !== null) { $data = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudents); // @@ -182,7 +216,7 @@ class Messages extends VileSci_Controller { $parsedText = ""; $dataArray = (array)$data->retval[$i]; - foreach($dataArray as $key => $val) + foreach ($dataArray as $key => $val) { $newKey = str_replace(" ", "_", strtolower($key)); $dataArray[$newKey] = $dataArray[$key]; @@ -191,7 +225,7 @@ class Messages extends VileSci_Controller $parsedText = $this->messagelib->parseMessageText($body, $dataArray); $oe_kurzbz = null; - if(hasData($prestudentsData)) + if (hasData($prestudentsData)) { for ($p = 0; $p < count($prestudentsData->retval); $p++) { @@ -247,7 +281,7 @@ class Messages extends VileSci_Controller { $person_id = $this->input->get('person_id'); } - else if ($this->input->post('person_id') !== null) + elseif ($this->input->post('person_id') !== null) { $person_id = $this->input->get('person_id'); } @@ -310,7 +344,7 @@ class Messages extends VileSci_Controller if (hasData($data)) { $dataArray = (array)$data->retval[0]; - foreach($dataArray as $key => $val) + foreach ($dataArray as $key => $val) { $newKey = str_replace(" ", "_", strtolower($key)); $dataArray[$newKey] = $dataArray[$key]; diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index 3b598203b..8244e8c67 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -8,7 +8,8 @@ 'fontawesome' => true, 'sbadmintemplate' => true, 'tablesorter' => true, - 'customCSSs' => 'skin/tablesort_bootstrap.css' + 'customCSSs' => 'skin/tablesort_bootstrap.css', + 'customJSs' => array('include/js/infocenterPersonDataset.js', 'include/js/bootstrapper.js') ) ); ?> @@ -40,11 +41,7 @@ diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index ed6bb2c7f..16effcfdd 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -10,7 +10,8 @@ $this->load->view( 'tablesorter' => true, 'tinymce' => true, 'sbadmintemplate' => true, - 'customCSSs' => array('skin/admintemplate.css', 'skin/tablesort_bootstrap.css') + 'customCSSs' => array('skin/admintemplate.css', 'skin/tablesort_bootstrap.css'), + 'customJSs' => 'include/js/bootstrapper.js' ) ); ?> @@ -127,10 +128,6 @@ $this->load->view( $(document).ready( function () { - //javascript bootstrap hack - not nice! - $("select").addClass('form-control'); - $("table").addClass('table-condensed'); - //initialise table sorter addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); @@ -148,14 +145,6 @@ $this->load->view( "dateFormat": "dd.mm.yy" }); - //add submit event to message send link - $("#sendmsglink").click( - function() - { - $("#sendmsgform").submit(); - } - ); - //add click events to "formal geprüft" checkboxes diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php index bd58879be..3e2ec1fb7 100644 --- a/application/views/system/infocenter/stammdaten.php +++ b/application/views/system/infocenter/stammdaten.php @@ -98,12 +98,18 @@ zugangscode)): ?> - \ No newline at end of file + + \ No newline at end of file diff --git a/application/views/system/messageWrite.php b/application/views/system/messageWrite.php index 12f7d5aa6..340b9203e 100644 --- a/application/views/system/messageWrite.php +++ b/application/views/system/messageWrite.php @@ -16,7 +16,12 @@ $this->load->view( ">
- - +
+ +
-   +
+ +
 
+
-
-
+
- $val) { @@ -100,6 +108,7 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[
+
- Preview: +
@@ -186,7 +195,8 @@ $href = str_replace("/system/Messages/write", "/system/Messages/send", $_SERVER[