From e4cc9f4ef340d442b75cad606adf47b7fb82281a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Thu, 16 May 2024 15:56:20 +0200 Subject: [PATCH] CIM77 - Service reports alleen laatste 5 --- api/v1/get/equipments.php | 31 ++++++++++++++++++++--- assets/functions.php | 12 ++++++--- equipment.php | 2 +- servicereports.php | 12 +++++++-- settings/translations/translations_NL.php | 1 + settings/translations/translations_US.php | 3 +-- 6 files changed, 50 insertions(+), 11 deletions(-) diff --git a/api/v1/get/equipments.php b/api/v1/get/equipments.php index f34efbc..377add0 100644 --- a/api/v1/get/equipments.php +++ b/api/v1/get/equipments.php @@ -119,9 +119,26 @@ elseif (isset($criterias['totals']) && $criterias['totals'] =='' && isset($crite //Request for total rows for history reports $sql ='SELECT count(*) as count from history h LEFT JOIN equipment e ON h.equipmentid = e.rowID '.$whereclause.''; } -elseif (isset($criterias['history']) && $criterias['history'] ==''){ +elseif (isset($criterias['history']) && $criterias['history'] != ''){ + + //History INDICATOR + /* + 0 Show All + 1 Created DESC, LIMIT 5 + */ + + switch ($criterias['history']) { + case 1: + $sort = ' ORDER BY h.created DESC LIMIT 0,'.$page_rows_equipment_servicereporst; + break; + + default: + $sort = ''; + break; + } //request history - $sql ='SELECT h.rowID as historyID, e.rowID as equipmentID, h.equipmentid as h_equipmentid, e.serialnumber, h.type, h.description, h.created, h.createdby from history h LEFT JOIN equipment e ON h.equipmentid = e.rowID '.$whereclause.''; + $sql ='SELECT h.rowID as historyID, e.rowID as equipmentID, h.equipmentid as h_equipmentid, e.serialnumber, h.type, h.description, h.created, h.createdby from history h LEFT JOIN equipment e ON h.equipmentid = e.rowID '.$whereclause.$sort; + } else { // GET SORT INDICATOR @@ -205,6 +222,14 @@ if (!empty($criterias)){ } } } + +//------------------------------------------ +// Debuglog +//------------------------------------------ +if (debug){ + $message = $date.';'.$sql.';'.$username; + debuglog($message); +} //------------------------------------------ //Add paging details //------------------------------------------ @@ -213,7 +238,7 @@ if(isset($criterias['totals']) && $criterias['totals']==''){ $messages = $stmt->fetch(); $messages = $messages[0]; } -elseif ((isset($criterias['history']) && $criterias['history'] =='') || (isset($criterias['download']) && $criterias['download'] =='')){ +elseif ((isset($criterias['history']) && $criterias['history'] !='') || (isset($criterias['download']) && $criterias['download'] =='')){ //Excute Query $stmt->execute(); //Get results diff --git a/assets/functions.php b/assets/functions.php index 616b485..b842209 100644 --- a/assets/functions.php +++ b/assets/functions.php @@ -900,16 +900,22 @@ function serviceEvents ($messages){
'.$servicereports_p.'
+ '.$back_btn_orgin.' '; $view .= ' diff --git a/settings/translations/translations_NL.php b/settings/translations/translations_NL.php index 1cc875e..030c24b 100644 --- a/settings/translations/translations_NL.php +++ b/settings/translations/translations_NL.php @@ -55,6 +55,7 @@ $general_first = '↤'; // <-First; $general_view = 'Bekijk'; $general_actions = 'Acties'; +$general_actions_more = 'Meer resultaten'; $general_profile = 'Profiel'; $general_logout = 'Uitloggen'; diff --git a/settings/translations/translations_US.php b/settings/translations/translations_US.php index b496405..95dcbb3 100644 --- a/settings/translations/translations_US.php +++ b/settings/translations/translations_US.php @@ -55,6 +55,7 @@ $general_first = '↤'; // <-First; $general_view = 'View'; $general_actions = 'Actions'; +$general_actions_more = 'Show more'; $general_profile = 'Profile'; $general_logout = 'Logout'; @@ -240,7 +241,6 @@ $product_serialized = 'Serialized'; $product_build = 'Build'; $product_sales = 'Sales'; - $part_type1 = 'Product'; $part_type2 = 'Sparepart'; $part_type3 = 'Loose_item'; @@ -277,7 +277,6 @@ $User_pw_reset = 'Password reset'; $User_pw_login_count = 'Failed login attempts'; $User_block = 'Blocked'; - $reset_message = 'Password reset started => See your email inbox for further instructions, you will be redirected to the login page.'; $reset_message2 = 'Resettoken not valid, you will be redirected'; $reset_message3 = 'Password minimal length of 6 characters';