1. Refactoring form objects and database objects to use inheritance and abstract base class for consistency and reduced redundancy.\n2. Contact us page button links updated to resolve error of missing link causing page refresh instead of expected functionality.

This commit is contained in:
2024-09-10 12:09:50 +01:00
parent c9dda91dc9
commit 6b730bf8e7
709 changed files with 5158 additions and 1512 deletions

View File

@@ -14,6 +14,4 @@ CREATE TABLE IF NOT EXISTS Shop_Product_Category_Temp (
, display_order INT NOT NULL
, id_access_level_required INT NOT NULL DEFAULT 1
, guid BINARY(36) NOT NULL
, created_on TIMESTAMP NOT NULL
, created_by INT NOT NULL
);

View File

@@ -16,23 +16,22 @@ DROP PROCEDURE IF EXISTS p_shop_get_many_access_level;
DELIMITER //
CREATE PROCEDURE p_shop_get_many_access_level (
IN a_get_inactive_access_level BIT
IN a_id_user INT,
IN a_get_inactive_access_level BIT
)
BEGIN
IF a_get_inactive_access_level IS NULL THEN
SET a_get_inactive_access_level = 0;
END IF;
SET a_get_inactive_access_level = IFNULL(a_get_inactive_access_level, 0);
SELECT
AL.id_access_level,
AL.code,
AL.name,
AL.active,
AL.priority,
AL.display_order
AL.code,
AL.name,
AL.active,
AL.priority,
AL.display_order
FROM Shop_Access_Level AL
WHERE
a_get_inactive_access_level = 1
a_get_inactive_access_level = 1
OR AL.active = 1
ORDER BY AL.display_order
;

View File

@@ -111,7 +111,7 @@ BEGIN
, IFNULL(PC_T.code, PC.code) AS code
, IFNULL(PC_T.name, PC.code) AS name
, IFNULL(PC_T.description, PC.description) AS description
, PC_T.id_access_level_required AS id_access_level_required
, IFNULL(PC_T.id_access_level_required, PC.id_access_level_required) AS id_access_level_required
, IFNULL(PC_T.active, PC.active) AS active
, IFNULL(PC_T.display_order, PC.display_order) AS display_order
, IFNULL(PC_T.name, IFNULL(PC.name, IFNULL(PC_T.code, IFNULL(PC.code, IFNULL(PC_T.id_category, '(No Product Category)'))))) AS name_error

View File

@@ -325,14 +325,16 @@ BEGIN
, PC.name
, PC.description
, PC.id_access_level_required
, AL.name AS name_access_level_required
, PC.display_order
, PC.active
, MIN(t_P.can_view) AS can_view
, MIN(t_P.can_edit) AS can_edit
, MIN(t_P.can_admin) AS can_admin
FROM tmp_Category t_C
INNER JOIN Shop_product_category PC ON t_C.id_category = PC.id_category
INNER JOIN Shop_Product_Category PC ON t_C.id_category = PC.id_category
LEFT JOIN tmp_Product t_P ON t_C.id_category = t_P.id_product
INNER JOIN Shop_Access_Level AL ON PC.id_access_level_required = AL.id_access_level
GROUP BY t_C.id_category -- , t_P.id_product
ORDER BY PC.display_order
;
@@ -344,6 +346,7 @@ BEGIN
P.name,
P.has_variations,
P.id_access_level_required,
AL.name AS name_access_level_required,
P.active,
P.display_order,
t_P.can_view,
@@ -352,6 +355,7 @@ BEGIN
FROM tmp_Product t_P
INNER JOIN Shop_Product P ON t_P.id_product = P.id_product
INNER JOIN tmp_Category t_C ON t_P.id_category = t_C.id_category
INNER JOIN Shop_Access_Level AL ON P.id_access_level_required = AL.id_access_level
GROUP BY t_P.id_category, t_C.display_order, t_P.id_product, t_P.can_view, t_P.can_edit, t_P.can_admin
ORDER BY t_C.display_order, P.display_order
;