diff --git a/application/controllers/system/messages/MessageClient.php b/application/controllers/system/messages/MessageClient.php new file mode 100644 index 000000000..3000e6b91 --- /dev/null +++ b/application/controllers/system/messages/MessageClient.php @@ -0,0 +1,39 @@ + array('basis/message:r'), + 'listMessages' => array('basis/message:r') + ) + ); + + // Loads model CLMessagesModel which contains the GUI logic + $this->load->model('CL/Messages_model', 'CLMessagesModel'); + } + + /** + * Starts the GUI used to read all the personal messages + */ + public function read() + { + // Loads the view to read messages + $this->load->view('system/messages/ajaxRead'); + } + + /** + * Returns JSON that that contains all the received messages by the currently logged user + * This JSON structure is nested data used by tabulator + */ + public function listMessages() + { + $jsonNestedData = $this->CLMessagesModel->prepareAjaxRead(); + + $this->outputJson($jsonNestedData); + } +} diff --git a/application/controllers/system/messages/Messages.php b/application/controllers/system/messages/Messages.php index 20fed38ad..869caec39 100644 --- a/application/controllers/system/messages/Messages.php +++ b/application/controllers/system/messages/Messages.php @@ -30,7 +30,7 @@ class Messages extends Auth_Controller } // ----------------------------------------------------------------------------------------------------------------- - // Public methods - HTML output + // Methods with HTML output /** * Initialize all the parameters used by view system/messages/htmlWriteTemplate @@ -71,7 +71,7 @@ class Messages extends Auth_Controller } // ----------------------------------------------------------------------------------------------------------------- - // Public methods - JSON output - called by this controller and FASMessages (view system/messages/htmlWriteTemplate) + // Methods with JSON output called by this controller and FASMessages (view system/messages/htmlWriteTemplate) /** * Returns an object that represent a template store in database @@ -98,7 +98,7 @@ class Messages extends Auth_Controller } // ----------------------------------------------------------------------------------------------------------------- - // Public methods - JSON output - called by infocenter + // Methods with JSON output called by infocenter /** * Outputs message data for a message (identified my msg id and receiver id) in JSON format diff --git a/application/views/system/messages/ajaxRead.php b/application/views/system/messages/ajaxRead.php new file mode 100644 index 000000000..97f16ce3b --- /dev/null +++ b/application/views/system/messages/ajaxRead.php @@ -0,0 +1,20 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'Read personal messages', + 'jquery' => true, + 'bootstrap' => true, + 'momentjs' => true, + 'tabulator' => true, + 'ajaxlib' => true, + 'customJSs' => array('public/js/messaging/messageClient.js') + ) + ); +?> +
+ + + + +load->view("templates/FHC-Footer"); ?> diff --git a/application/views/system/messages/htmlRead.php b/application/views/system/messages/htmlRead.php index 97751f96f..01a5421ac 100644 --- a/application/views/system/messages/htmlRead.php +++ b/application/views/system/messages/htmlRead.php @@ -2,7 +2,7 @@ $this->load->view( 'templates/FHC-Header', array( - 'title' => 'MessageSent', + 'title' => 'Read a message', 'jquery' => true, 'bootstrap' => true, 'fontawesome' => true, diff --git a/application/views/system/messages/htmlWriteReply.php b/application/views/system/messages/htmlWriteReply.php index fe8145613..b9932148b 100644 --- a/application/views/system/messages/htmlWriteReply.php +++ b/application/views/system/messages/htmlWriteReply.php @@ -2,7 +2,7 @@ $this->load->view( 'templates/FHC-Header', array( - 'title' => 'MessageReply', + 'title' => 'Reply to a message', 'jquery' => true, 'bootstrap' => true, 'fontawesome' => true, diff --git a/application/views/system/messages/htmlWriteTemplate.php b/application/views/system/messages/htmlWriteTemplate.php index f46138e28..7132cfb36 100644 --- a/application/views/system/messages/htmlWriteTemplate.php +++ b/application/views/system/messages/htmlWriteTemplate.php @@ -2,7 +2,7 @@ $this->load->view( 'templates/FHC-Header', array( - 'title' => 'Write a message', + 'title' => 'Write a new message or reply using templates', 'jquery' => true, 'jqueryui' => true, 'bootstrap' => true, diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 6b9afd6b9..7b75e2ad7 100644 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -25,10 +25,12 @@ $jqueryui = isset($jqueryui) ? $jqueryui : false; $jquerycheckboxes = isset($jquerycheckboxes) ? $jquerycheckboxes : false; $jquerytreetable = isset($jquerytreetable) ? $jquerytreetable : false; + $momentjs = isset($momentjs) ? $momentjs : false; $navigationwidget = isset($navigationwidget) ? $navigationwidget : false; $pivotui = isset($pivotui) ? $pivotui : false; $sbadmintemplate = isset($sbadmintemplate) ? $sbadmintemplate : false; $tablesorter = isset($tablesorter) ? $tablesorter : false; + $tabulator = isset($tabulator) ? $tabulator : false; $tinymce = isset($tinymce) ? $tinymce : false; $widgets = isset($widgets) ? $widgets : false; ?> @@ -61,10 +63,7 @@ if ($fontawesome === true) generateCSSsInclude('vendor/components/font-awesome/css/font-awesome.min.css'); // PivotUI CSS - if ($pivotui === true) - { - generateCSSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.css'); - } + if ($pivotui === true) generateCSSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.css'); // SB Admin 2 template CSS if ($sbadmintemplate === true) @@ -80,6 +79,9 @@ generateCSSsInclude('vendor/mottie/tablesorter/dist/css/jquery.tablesorter.pager.min.css'); } + // Tabulator CSS + if ($tabulator === true) generateCSSsInclude('vendor/olifolkerd/tabulator/dist/css/bootstrap/tabulator_bootstrap.min.css'); + // -------------------------------------------------------------------------------------------------------- // From public folder @@ -101,6 +103,7 @@ // Eventually required CSS generateCSSsInclude($customCSSs); // Eventually required CSS + // -------------------------------------------------------------------------------------------------------- // Javascripts @@ -126,10 +129,7 @@ } // jQuery checkboxes - if ($jquerycheckboxes === true) - { - generateJSsInclude('vendor/rmariuzzo/jquery-checkboxes/dist/jquery.checkboxes-1.0.7.min.js'); - } + if ($jquerycheckboxes === true) generateJSsInclude('vendor/rmariuzzo/jquery-checkboxes/dist/jquery.checkboxes-1.0.7.min.js'); // Bootstrap JS if ($bootstrap === true) generateJSsInclude('vendor/twbs/bootstrap/dist/js/bootstrap.min.js'); @@ -138,12 +138,17 @@ // NOTE: keep it after jQuery includes if ($jquerytreetable === true) generateJSsInclude('vendor/ludo/jquery-treetable/jquery.treetable.js'); - // PivotUI CSS - if ($pivotui === true) + // MomentJS + if ($momentjs === true) { - generateJSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.js'); + generateJSsInclude('vendor/moment/momentjs/min/moment.min.js'); + generateJSsInclude('vendor/moment/momentjs/locale/de-at.js'); + generateJSsInclude('vendor/moment/momentjs/locale/en-ie.js'); } + // PivotUI JS + if ($pivotui === true) generateJSsInclude('vendor/nicolaskruchten/pivottable/dist/pivot.min.js'); + // Table sorter JS if ($tablesorter === true) { @@ -152,6 +157,9 @@ generateJSsInclude('vendor/mottie/tablesorter/dist/js/extras/jquery.tablesorter.pager.min.js'); } + // Tabulator JS + if ($tabulator === true) generateJSsInclude('vendor/olifolkerd/tabulator/dist/js/tabulator.min.js'); + // Tinymce JS if ($tinymce === true) generateJSsInclude('vendor/tinymce/tinymce/tinymce.min.js'); diff --git a/composer.json b/composer.json index c6816e075..5003468c2 100644 --- a/composer.json +++ b/composer.json @@ -162,6 +162,17 @@ } } }, + { + "type": "package", + "package": { + "name": "moment/momentjs", + "version": "2.24.0", + "dist": { + "url": "https://github.com/moment/moment/archive/2.24.0.zip", + "type": "zip" + } + } + }, { "type": "package", "package": { @@ -263,6 +274,7 @@ "ludo/jquery-treetable": "^3.2", + "moment/momentjs": "2.24.0", "michelf/php-markdown": "1.5.0", "ml/json-ld": "1.*", "mottie/tablesorter": "^2.29", diff --git a/composer.lock b/composer.lock index f328832e6..85e506cc4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "df6059a4bee974ecf5447aad8a8b1e15", - "content-hash": "2111c73853dbc47938c3f31dbc349883", + "hash": "e3de1eee238160400fb63f68735b4144", + "content-hash": "5b71e8a3c356d52e43d788eb6f018151", "packages": [ { "name": "BlackrockDigital/startbootstrap-sb-admin-2", @@ -1095,6 +1095,17 @@ ], "time": "2018-11-18 20:26:18" }, + { + "name": "moment/momentjs", + "version": "2.24.0", + "dist": { + "type": "zip", + "url": "https://github.com/moment/moment/archive/2.24.0.zip", + "reference": null, + "shasum": null + }, + "type": "library" + }, { "name": "mottie/tablesorter", "version": "v2.31.1", @@ -2191,16 +2202,16 @@ }, { "name": "twig/twig", - "version": "v1.42.1", + "version": "v1.42.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "671347603760a88b1e7288aaa9378f33687d7edf" + "reference": "21707d6ebd05476854805e4f91b836531941bcd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/671347603760a88b1e7288aaa9378f33687d7edf", - "reference": "671347603760a88b1e7288aaa9378f33687d7edf", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/21707d6ebd05476854805e4f91b836531941bcd4", + "reference": "21707d6ebd05476854805e4f91b836531941bcd4", "shasum": "" }, "require": { @@ -2253,7 +2264,7 @@ "keywords": [ "templating" ], - "time": "2019-06-04 11:31:08" + "time": "2019-06-18 15:35:16" }, { "name": "zetacomponents/base",