From bcff9dd10224f516aaf04af583ea6b4f18c8839a Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 5 Aug 2023 11:42:39 +0200 Subject: [PATCH] Added support for grid when printing from the advanced logbook --- application/controllers/Labels.php | 2 +- application/views/labels/startatform.php | 2 +- .../views/logbookadvanced/startatform.php | 19 ++++++++++++++++--- assets/js/sections/logbookadvanced.js | 4 +++- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/application/controllers/Labels.php b/application/controllers/Labels.php index 387cb91c..008ec762 100644 --- a/application/controllers/Labels.php +++ b/application/controllers/Labels.php @@ -133,7 +133,7 @@ class Labels extends CI_Controller { public function printids() { $ids = xss_clean(json_decode($this->input->post('id'))); $offset = xss_clean($this->input->post('startat')); - $grid = xss_clean($this->input->post('grid') ?? 0); + $grid = $this->input->post('grid') === "true" ? 1 : 0; $this->load->model('labels_model'); $result = $this->labels_model->export_printrequestedids($ids); diff --git a/application/views/labels/startatform.php b/application/views/labels/startatform.php index 33c93455..a9de4d26 100644 --- a/application/views/labels/startatform.php +++ b/application/views/labels/startatform.php @@ -1,6 +1,6 @@
- +
diff --git a/application/views/logbookadvanced/startatform.php b/application/views/logbookadvanced/startatform.php index 74fe356b..a2ecbca7 100644 --- a/application/views/logbookadvanced/startatform.php +++ b/application/views/logbookadvanced/startatform.php @@ -1,4 +1,17 @@ - - - + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index e939c4e3..02207540 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -585,7 +585,9 @@ function printlabel() { url: base_url + 'index.php/labels/printids', type: 'post', data: {'id': JSON.stringify(id_list, null, 2), - 'startat': $('#startat').val() + 'startat': $('#startat').val(), + 'grid': $('#gridlabel')[0].checked, + }, xhr:function(){ var xhr = new XMLHttpRequest();