From 8dd70233101725429183c38eadfa1036c73d878d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Fri, 21 Feb 2025 17:48:51 +0100 Subject: [PATCH] CMXX - Update whereclause get/post --- api/v1/get/accounts.php | 2 +- api/v1/get/application.php | 2 +- api/v1/get/cartests.php | 2 +- api/v1/get/communications.php | 2 +- api/v1/get/equipment_data.php | 2 +- api/v1/get/equipments.php | 2 +- api/v1/get/partners.php | 2 +- api/v1/get/products.php | 2 +- api/v1/get/products_software.php | 2 +- api/v1/get/products_versions.php | 2 +- api/v1/get/profile.php | 2 +- api/v1/get/users.php | 2 +- api/v1/post/accounts.php | 2 +- api/v1/post/communications.php | 2 +- api/v1/post/contracts.php | 2 +- api/v1/post/equipments.php | 2 +- api/v1/post/partners.php | 2 +- api/v1/post/products.php | 2 +- api/v1/post/products_software.php | 2 +- api/v1/post/products_versions.php | 2 +- api/v1/post/users.php | 2 +- api/v2/get/accounts.php | 2 +- api/v2/get/cartests.php | 2 +- api/v2/get/categories.php | 2 +- api/v2/get/discounts.php | 2 +- api/v2/get/equipment_data.php | 2 +- api/v2/get/equipment_healthindex.php | 2 +- api/v2/get/equipments.php | 2 +- api/v2/get/invoice.php | 2 +- api/v2/get/media.php | 2 +- api/v2/get/pricelists.php | 2 +- api/v2/get/pricelists_items.php | 2 +- api/v2/get/products.php | 2 +- api/v2/get/products_attributes.php | 2 +- api/v2/get/products_attributes_items.php | 2 +- api/v2/get/products_categories.php | 2 +- api/v2/get/products_configurations.php | 2 +- api/v2/get/products_software.php | 2 +- api/v2/get/products_versions.php | 2 +- api/v2/get/rma.php | 2 +- api/v2/get/rma_history.php | 2 +- api/v2/get/shipping.php | 2 +- api/v2/get/taxes.php | 2 +- api/v2/get/transactions.php | 2 +- api/v2/get/transactions_items.php | 2 +- api/v2/get/translations.php | 2 +- api/v2/get/translations_details.php | 2 +- api/v2/get/users.php | 2 +- api/v2/post/accounts.php | 2 +- api/v2/post/categories.php | 2 +- api/v2/post/contracts.php | 2 +- api/v2/post/discounts.php | 2 +- api/v2/post/equipments.php | 2 +- api/v2/post/invoice.php | 2 +- api/v2/post/media.php | 2 +- api/v2/post/pricelists.php | 2 +- api/v2/post/pricelists_items.php | 2 +- api/v2/post/products.php | 2 +- api/v2/post/products_attributes.php | 2 +- api/v2/post/products_attributes_items.php | 2 +- api/v2/post/products_categories.php | 2 +- api/v2/post/products_configurations.php | 2 +- api/v2/post/products_software.php | 2 +- api/v2/post/products_versions.php | 2 +- api/v2/post/shipping.php | 2 +- api/v2/post/transactions.php | 2 +- api/v2/post/translations.php | 2 +- api/v2/post/translations_details.php | 4 +++- api/v2/post/users.php | 2 +- assets/functions.php | 19 ++++++++++--------- translation_manage.php | 15 ++++++++++----- 71 files changed, 91 insertions(+), 83 deletions(-) diff --git a/api/v1/get/accounts.php b/api/v1/get/accounts.php index 4931208..c69eb6f 100644 --- a/api/v1/get/accounts.php +++ b/api/v1/get/accounts.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY diff --git a/api/v1/get/application.php b/api/v1/get/application.php index 772fd9e..c884147 100644 --- a/api/v1/get/application.php +++ b/api/v1/get/application.php @@ -30,7 +30,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause //------------------------------------------ -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //------------------------------------------ //NEW ARRAY diff --git a/api/v1/get/cartests.php b/api/v1/get/cartests.php index 4605eb6..e5e6f24 100644 --- a/api/v1/get/cartests.php +++ b/api/v1/get/cartests.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY diff --git a/api/v1/get/communications.php b/api/v1/get/communications.php index db1ce91..4b789b5 100644 --- a/api/v1/get/communications.php +++ b/api/v1/get/communications.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2('communications',$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2('communications',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v1/get/equipment_data.php b/api/v1/get/equipment_data.php index 66a83cd..9c977e7 100644 --- a/api/v1/get/equipment_data.php +++ b/api/v1/get/equipment_data.php @@ -15,7 +15,7 @@ $partner = json_decode($partnerhierarchy); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner); +list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner,'get'); //------------------------------------------ //NEW ARRAY diff --git a/api/v1/get/equipments.php b/api/v1/get/equipments.php index 2b522cb..e3c3a15 100644 --- a/api/v1/get/equipments.php +++ b/api/v1/get/equipments.php @@ -16,7 +16,7 @@ $partner = json_decode($partnerhierarchy); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner); +list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner,'get'); //------------------------------------------ //NEW ARRAY diff --git a/api/v1/get/partners.php b/api/v1/get/partners.php index 0dd52a1..178c6ac 100644 --- a/api/v1/get/partners.php +++ b/api/v1/get/partners.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2('partners',$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2('partners',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v1/get/products.php b/api/v1/get/products.php index 937c3ce..3e4f7dc 100644 --- a/api/v1/get/products.php +++ b/api/v1/get/products.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v1/get/products_software.php b/api/v1/get/products_software.php index b589359..d97bf4b 100644 --- a/api/v1/get/products_software.php +++ b/api/v1/get/products_software.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v1/get/products_versions.php b/api/v1/get/products_versions.php index 93c25a1..cd58d49 100644 --- a/api/v1/get/products_versions.php +++ b/api/v1/get/products_versions.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v1/get/profile.php b/api/v1/get/profile.php index bf8442f..856f693 100644 --- a/api/v1/get/profile.php +++ b/api/v1/get/profile.php @@ -12,7 +12,7 @@ $partner = json_decode($partnerhierarchy); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('profile',$permission,$partner); +list($whereclause,$condition) = getWhereclause('profile',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v1/get/users.php b/api/v1/get/users.php index c832bf3..23454d7 100644 --- a/api/v1/get/users.php +++ b/api/v1/get/users.php @@ -12,7 +12,7 @@ $partner = json_decode($partnerhierarchy); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('profile',$permission,$partner); +list($whereclause,$condition) = getWhereclause('profile',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v1/post/accounts.php b/api/v1/post/accounts.php index 2b30ba5..d6de8cd 100644 --- a/api/v1/post/accounts.php +++ b/api/v1/post/accounts.php @@ -14,7 +14,7 @@ $post_content = json_decode(decode_payload($input),true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner); +list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v1/post/communications.php b/api/v1/post/communications.php index f5eb043..bb589d7 100644 --- a/api/v1/post/communications.php +++ b/api/v1/post/communications.php @@ -14,7 +14,7 @@ $post_content = json_decode(decode_payload($input),true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v1/post/contracts.php b/api/v1/post/contracts.php index 68e7eb6..498f164 100644 --- a/api/v1/post/contracts.php +++ b/api/v1/post/contracts.php @@ -16,7 +16,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY $id = $post_content['rowID'] ?? ''; //check for rowID diff --git a/api/v1/post/equipments.php b/api/v1/post/equipments.php index 5951882..8801226 100644 --- a/api/v1/post/equipments.php +++ b/api/v1/post/equipments.php @@ -16,7 +16,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY $id = $post_content['rowID'] ?? ''; //check for rowID diff --git a/api/v1/post/partners.php b/api/v1/post/partners.php index 356237a..6f1be77 100644 --- a/api/v1/post/partners.php +++ b/api/v1/post/partners.php @@ -14,7 +14,7 @@ $post_content = json_decode(decode_payload($input),true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause to check if data is owned by user -list($whereclause,$condition) = getWhereclauselvl2('partners',$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2('partners',$permission,$partner,''); //SET PARAMETERS FOR QUERY $id = $post_content['partnerID'] ?? ''; //check for rowID diff --git a/api/v1/post/products.php b/api/v1/post/products.php index b851073..9f6e68c 100644 --- a/api/v1/post/products.php +++ b/api/v1/post/products.php @@ -14,7 +14,7 @@ $post_content = json_decode(decode_payload($input),true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v1/post/products_software.php b/api/v1/post/products_software.php index 04118ef..40194dc 100644 --- a/api/v1/post/products_software.php +++ b/api/v1/post/products_software.php @@ -14,7 +14,7 @@ $post_content = json_decode(decode_payload($input),true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //ENSURE PRODUCTROWID IS SEND diff --git a/api/v1/post/products_versions.php b/api/v1/post/products_versions.php index dc63408..8f44c62 100644 --- a/api/v1/post/products_versions.php +++ b/api/v1/post/products_versions.php @@ -14,7 +14,7 @@ $post_content = json_decode(decode_payload($input),true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //ENSURE PRODUCTROWID IS SEND diff --git a/api/v1/post/users.php b/api/v1/post/users.php index 314b782..998caf7 100644 --- a/api/v1/post/users.php +++ b/api/v1/post/users.php @@ -15,7 +15,7 @@ $owner_user = 0; if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause to check if data is owned by user -list($whereclause,$condition) = getWhereclause('profile',$permission,$partner); +list($whereclause,$condition) = getWhereclause('profile',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v2/get/accounts.php b/api/v2/get/accounts.php index 8a80da3..672a339 100644 --- a/api/v2/get/accounts.php +++ b/api/v2/get/accounts.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY diff --git a/api/v2/get/cartests.php b/api/v2/get/cartests.php index d091274..7728b24 100644 --- a/api/v2/get/cartests.php +++ b/api/v2/get/cartests.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY diff --git a/api/v2/get/categories.php b/api/v2/get/categories.php index 1503b89..c13ed88 100644 --- a/api/v2/get/categories.php +++ b/api/v2/get/categories.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/discounts.php b/api/v2/get/discounts.php index 440a5f1..de47c8d 100644 --- a/api/v2/get/discounts.php +++ b/api/v2/get/discounts.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2("discounts",$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2("discounts",$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/equipment_data.php b/api/v2/get/equipment_data.php index 5def010..a17cfd9 100644 --- a/api/v2/get/equipment_data.php +++ b/api/v2/get/equipment_data.php @@ -15,7 +15,7 @@ $partner = json_decode($partnerhierarchy); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner); +list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner,'get'); //------------------------------------------ //NEW ARRAY diff --git a/api/v2/get/equipment_healthindex.php b/api/v2/get/equipment_healthindex.php index 8925b30..cf110f3 100644 --- a/api/v2/get/equipment_healthindex.php +++ b/api/v2/get/equipment_healthindex.php @@ -15,7 +15,7 @@ $partner = json_decode($partnerhierarchy); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner); +list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner,'get'); //------------------------------------------ //NEW ARRAY diff --git a/api/v2/get/equipments.php b/api/v2/get/equipments.php index 320ba85..0c857f1 100644 --- a/api/v2/get/equipments.php +++ b/api/v2/get/equipments.php @@ -15,7 +15,7 @@ $partner = json_decode($partnerhierarchy); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //------------------------------------------ //NEW ARRAY diff --git a/api/v2/get/invoice.php b/api/v2/get/invoice.php index b95c096..37c0a48 100644 --- a/api/v2/get/invoice.php +++ b/api/v2/get/invoice.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2("invoice",$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2("invoice",$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/media.php b/api/v2/get/media.php index 32ec1dc..c15700d 100644 --- a/api/v2/get/media.php +++ b/api/v2/get/media.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/pricelists.php b/api/v2/get/pricelists.php index f56e125..6310bb5 100644 --- a/api/v2/get/pricelists.php +++ b/api/v2/get/pricelists.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('pricelist',$permission,$partner); +list($whereclause,$condition) = getWhereclause('pricelist',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/pricelists_items.php b/api/v2/get/pricelists_items.php index dc327d9..40614db 100644 --- a/api/v2/get/pricelists_items.php +++ b/api/v2/get/pricelists_items.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/products.php b/api/v2/get/products.php index ac0f98a..40d346a 100644 --- a/api/v2/get/products.php +++ b/api/v2/get/products.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/products_attributes.php b/api/v2/get/products_attributes.php index ec6b003..810573b 100644 --- a/api/v2/get/products_attributes.php +++ b/api/v2/get/products_attributes.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/products_attributes_items.php b/api/v2/get/products_attributes_items.php index 419c30c..cabd8a0 100644 --- a/api/v2/get/products_attributes_items.php +++ b/api/v2/get/products_attributes_items.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2("attributes",$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2("attributes",$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/products_categories.php b/api/v2/get/products_categories.php index e87f9d5..0b08b55 100644 --- a/api/v2/get/products_categories.php +++ b/api/v2/get/products_categories.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/products_configurations.php b/api/v2/get/products_configurations.php index 067f1ac..fe2bb99 100644 --- a/api/v2/get/products_configurations.php +++ b/api/v2/get/products_configurations.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2("config",$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2("config",$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/products_software.php b/api/v2/get/products_software.php index e402cdf..ec50e8b 100644 --- a/api/v2/get/products_software.php +++ b/api/v2/get/products_software.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2("software",$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2("software",$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/products_versions.php b/api/v2/get/products_versions.php index cd95647..5a6e4f5 100644 --- a/api/v2/get/products_versions.php +++ b/api/v2/get/products_versions.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/rma.php b/api/v2/get/rma.php index d8c0cc3..de35f24 100644 --- a/api/v2/get/rma.php +++ b/api/v2/get/rma.php @@ -11,7 +11,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY diff --git a/api/v2/get/rma_history.php b/api/v2/get/rma_history.php index 99378d4..12a492d 100644 --- a/api/v2/get/rma_history.php +++ b/api/v2/get/rma_history.php @@ -11,7 +11,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY diff --git a/api/v2/get/shipping.php b/api/v2/get/shipping.php index ebaf988..1c87961 100644 --- a/api/v2/get/shipping.php +++ b/api/v2/get/shipping.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/taxes.php b/api/v2/get/taxes.php index 5dd0a90..f5ef626 100644 --- a/api/v2/get/taxes.php +++ b/api/v2/get/taxes.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/transactions.php b/api/v2/get/transactions.php index 30b0e9b..57313b8 100644 --- a/api/v2/get/transactions.php +++ b/api/v2/get/transactions.php @@ -12,7 +12,7 @@ $pdo = dbConnect($dbname); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2("transactions",$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2("transactions",$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/transactions_items.php b/api/v2/get/transactions_items.php index cd24231..f337fee 100644 --- a/api/v2/get/transactions_items.php +++ b/api/v2/get/transactions_items.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/translations.php b/api/v2/get/translations.php index a57549a..da4a919 100644 --- a/api/v2/get/translations.php +++ b/api/v2/get/translations.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/translations_details.php b/api/v2/get/translations_details.php index e8aa87b..5f7286c 100644 --- a/api/v2/get/translations_details.php +++ b/api/v2/get/translations_details.php @@ -14,7 +14,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/get/users.php b/api/v2/get/users.php index b497dd0..069a9ff 100644 --- a/api/v2/get/users.php +++ b/api/v2/get/users.php @@ -12,7 +12,7 @@ $partner = json_decode($partnerhierarchy); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('profile',$permission,$partner); +list($whereclause,$condition) = getWhereclause('profile',$permission,$partner,'get'); //NEW ARRAY $criterias = []; diff --git a/api/v2/post/accounts.php b/api/v2/post/accounts.php index 4d694fc..daf8abe 100644 --- a/api/v2/post/accounts.php +++ b/api/v2/post/accounts.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner); +list($whereclause,$condition) = getWhereclause('equipment',$permission,$partner,''); //SET PARAMETERS FOR QUERY $id = $post_content['rowID'] ?? ''; //check for rowID diff --git a/api/v2/post/categories.php b/api/v2/post/categories.php index b5df660..ba6488c 100644 --- a/api/v2/post/categories.php +++ b/api/v2/post/categories.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclauselvl2("categories",$permission,$partner); +list($whereclause,$condition) = getWhereclauselvl2("categories",$permission,$partner,''); //BUILD UP PARTNERHIERARCHY FROM USER diff --git a/api/v2/post/contracts.php b/api/v2/post/contracts.php index 0860704..9ecb7bb 100644 --- a/api/v2/post/contracts.php +++ b/api/v2/post/contracts.php @@ -16,7 +16,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY $id = $post_content['rowID'] ?? ''; //check for rowID diff --git a/api/v2/post/discounts.php b/api/v2/post/discounts.php index faaa9f2..3d8c459 100644 --- a/api/v2/post/discounts.php +++ b/api/v2/post/discounts.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //BUILD UP PARTNERHIERARCHY FROM USER diff --git a/api/v2/post/equipments.php b/api/v2/post/equipments.php index 3e58a59..610cd7b 100644 --- a/api/v2/post/equipments.php +++ b/api/v2/post/equipments.php @@ -16,7 +16,7 @@ if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} el //default whereclause $whereclause = ''; -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY $id = $post_content['rowID'] ?? ''; //check for rowID diff --git a/api/v2/post/invoice.php b/api/v2/post/invoice.php index c3fa5f4..79accb9 100644 --- a/api/v2/post/invoice.php +++ b/api/v2/post/invoice.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v2/post/media.php b/api/v2/post/media.php index 256440c..10f1546 100644 --- a/api/v2/post/media.php +++ b/api/v2/post/media.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v2/post/pricelists.php b/api/v2/post/pricelists.php index 97068a3..5fc76a7 100644 --- a/api/v2/post/pricelists.php +++ b/api/v2/post/pricelists.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v2/post/pricelists_items.php b/api/v2/post/pricelists_items.php index 7af14da..693d4c6 100644 --- a/api/v2/post/pricelists_items.php +++ b/api/v2/post/pricelists_items.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v2/post/products.php b/api/v2/post/products.php index f6670e4..ada0587 100644 --- a/api/v2/post/products.php +++ b/api/v2/post/products.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v2/post/products_attributes.php b/api/v2/post/products_attributes.php index a8d4d19..7682a0f 100644 --- a/api/v2/post/products_attributes.php +++ b/api/v2/post/products_attributes.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v2/post/products_attributes_items.php b/api/v2/post/products_attributes_items.php index 72b30c5..e179280 100644 --- a/api/v2/post/products_attributes_items.php +++ b/api/v2/post/products_attributes_items.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v2/post/products_categories.php b/api/v2/post/products_categories.php index 3c83365..50b1b8f 100644 --- a/api/v2/post/products_categories.php +++ b/api/v2/post/products_categories.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //CHECK IF PRODUCT ID IS SEND if (isset($post_content['product_id']) && $post_content['product_id'] != ''){ diff --git a/api/v2/post/products_configurations.php b/api/v2/post/products_configurations.php index 32f3a53..ea01658 100644 --- a/api/v2/post/products_configurations.php +++ b/api/v2/post/products_configurations.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //ENSURE PRODUCTROWID IS SEND diff --git a/api/v2/post/products_software.php b/api/v2/post/products_software.php index fdb37d8..d1c22fb 100644 --- a/api/v2/post/products_software.php +++ b/api/v2/post/products_software.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //ENSURE PRODUCTROWID IS SEND diff --git a/api/v2/post/products_versions.php b/api/v2/post/products_versions.php index 8940d9b..d273647 100644 --- a/api/v2/post/products_versions.php +++ b/api/v2/post/products_versions.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //ENSURE PRODUCTROWID IS SEND diff --git a/api/v2/post/shipping.php b/api/v2/post/shipping.php index e887738..5912d74 100644 --- a/api/v2/post/shipping.php +++ b/api/v2/post/shipping.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //BUILD UP PARTNERHIERARCHY FROM USER diff --git a/api/v2/post/transactions.php b/api/v2/post/transactions.php index fcf2de4..63f0736 100644 --- a/api/v2/post/transactions.php +++ b/api/v2/post/transactions.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //WEBSHOP UPDATE CAN SEND TXN_ID ONLY diff --git a/api/v2/post/translations.php b/api/v2/post/translations.php index 144ab57..976e30d 100644 --- a/api/v2/post/translations.php +++ b/api/v2/post/translations.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/api/v2/post/translations_details.php b/api/v2/post/translations_details.php index cf32181..ca784e3 100644 --- a/api/v2/post/translations_details.php +++ b/api/v2/post/translations_details.php @@ -14,7 +14,7 @@ $post_content = json_decode($input,true); if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('',$permission,$partner); +list($whereclause,$condition) = getWhereclause('',$permission,$partner,''); //SET PARAMETERS FOR QUERY @@ -70,7 +70,9 @@ if ($command == 'update' && isAllowed('translation_manage',$profile,$permission, $sql = 'UPDATE text_variables_translations SET '.$clause.' WHERE rowID = ? '.$whereclause.''; $execute_input[] = $id; $stmt = $pdo->prepare($sql); + $stmt->debugDumpParams(); $stmt->execute($execute_input); + } elseif ($command == 'insert' && isAllowed('translation_manage',$profile,$permission,'C') === 1){ $sql = 'INSERT INTO text_variables_translations ('.$clause_insert.') VALUES ('.$input_insert.')'; diff --git a/api/v2/post/users.php b/api/v2/post/users.php index 92e209c..8455f65 100644 --- a/api/v2/post/users.php +++ b/api/v2/post/users.php @@ -15,7 +15,7 @@ $owner_user = 0; if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} //default whereclause -list($whereclause,$condition) = getWhereclause('profile',$permission,$partner); +list($whereclause,$condition) = getWhereclause('profile',$permission,$partner,''); //SET PARAMETERS FOR QUERY diff --git a/assets/functions.php b/assets/functions.php index 84dbeab..c6e8976 100644 --- a/assets/functions.php +++ b/assets/functions.php @@ -695,7 +695,7 @@ function ioAPIv2($api_call, $data, $token){ // DEFINE WHERECLAUSE BASED ON ACCOUNTHIERARCHY ALL //------------------------------------------ -function getWhereclause($table_name,$permission,$partner){ +function getWhereclause($table_name,$permission,$partner,$method){ //api_name converter to table $table =[ @@ -704,7 +704,7 @@ function getWhereclause($table_name,$permission,$partner){ ]; $table = ($table_name != '') ? $table[$table_name] : 'accounthierarchy'; - + $type = ($method == 'get') ? 'WHERE ' : ''; //SoldTo is empty if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} @@ -717,15 +717,15 @@ function getWhereclause($table_name,$permission,$partner){ break; case '3': $condition = '__salesid___'.$partner->salesid.'___soldto___%'; - $whereclause = 'WHERE '.$table.' like "'.$condition.'"'; + $whereclause = $type.$table.' like "'.$condition.'"'; break; case '2': $condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search; - $whereclause = 'WHERE '.$table.' like "'.$condition.'"'; + $whereclause = $type.$table.' like "'.$condition.'"'; break; default: $condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search.'___shipto___'.substr($partner->shipto, 0, strpos($partner->shipto, "-")).'%___location___'.substr($partner->location, 0, strpos($partner->location, "-")).'%'; - $whereclause = 'WHERE '.$table.' like "'.$condition.'"'; + $whereclause = $type.$table.' like "'.$condition.'"'; break; } @@ -735,7 +735,7 @@ function getWhereclause($table_name,$permission,$partner){ //------------------------------------------ // DEFINE WHERECLAUSE BASED ON ACCOUNTHIERARCHY SALES AND SOLD //------------------------------------------ -function getWhereclauselvl2($table_name,$permission,$partner){ +function getWhereclauselvl2($table_name,$permission,$partner,$method){ //api_name converter to table $table =[ @@ -752,7 +752,8 @@ function getWhereclauselvl2($table_name,$permission,$partner){ ]; $table = ($table_name != '') ? $table[$table_name] : 'accounthierarchy'; - + $type = ($method == 'get') ? 'WHERE ' : ''; + //SoldTo is empty if (empty($partner->soldto) || $partner->soldto == ''){$soldto_search = '%';} else {$soldto_search = '-%';} @@ -765,11 +766,11 @@ function getWhereclauselvl2($table_name,$permission,$partner){ break; case '3': $condition = '__salesid___'.$partner->salesid.'___soldto___%'; - $whereclause = 'WHERE '.$table.' like "'.$condition.'" '; + $whereclause = $type.$table.' like "'.$condition.'" '; break; default: $condition = '__salesid___'.$partner->salesid.'___soldto___'.substr($partner->soldto, 0, strpos($partner->soldto, "-")).$soldto_search; - $whereclause = 'WHERE '.$table.' like "'.$condition.'"'; + $whereclause = $type.$table.' like "'.$condition.'"'; break; } diff --git a/translation_manage.php b/translation_manage.php index 351295e..f3dcbd0 100644 --- a/translation_manage.php +++ b/translation_manage.php @@ -66,7 +66,9 @@ if (isset($_GET['rowID'])) { if ($responses === 'NOK'){ } else { - generateLanguageFile($_POST['language_key'],$_SESSION['userkey']); + if ($_SESSION['permission'] == 4){ + generateLanguageFile($_POST['language_key'],$_SESSION['userkey']); + } header('Location: index.php?page=translation_manage&rowID='.$_GET['rowID'].''); exit; } @@ -79,9 +81,10 @@ if (isset($_GET['rowID'])) { //RUN through all POST items foreach ($_POST['item'] as $attr){ + //GET ALL POST DATA $payload = json_encode($attr, JSON_UNESCAPED_UNICODE); - + var_dump($payload); //API call $responses = ioServer('/v2/translations_details', $payload); @@ -96,11 +99,13 @@ if (isset($_GET['rowID'])) { if ($NOK_error == 0){ //NO errors generatelanguagefile - generateLanguageFile($attr_language,$_SESSION['userkey']); + if ($_SESSION['permission'] == 4){ + generateLanguageFile($attr_language,$_SESSION['userkey']); + } } - header('Location: index.php?page=translation_manage&rowID='.$_GET['rowID'].''); - exit; + //header('Location: index.php?page=translation_manage&rowID='.$_GET['rowID'].''); + //exit; } }