From 036c2ba22fcba7407b4691d47274376296c8a876 Mon Sep 17 00:00:00 2001 From: Philippe Logel Date: Mon, 12 Feb 2024 20:08:18 +0000 Subject: [PATCH] =?UTF-8?q?src/v2/templates/query/queryview.php=20:=20mise?= =?UTF-8?q?=20=C3=A0=20jour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mysql/install/Install.sql | 7 +++-- src/mysql/upgrade/8.0.0-upgrade.sql | 9 +++++- src/v2/templates/query/queryview.php | 41 ++++++++++++++++++---------- 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/mysql/install/Install.sql b/src/mysql/install/Install.sql index 1789785e5..dcfc19c9d 100644 --- a/src/mysql/install/Install.sql +++ b/src/mysql/install/Install.sql @@ -1088,7 +1088,9 @@ INSERT INTO `queryparameters_qrp` (`qrp_ID`, `qrp_qry_ID`, `qrp_Type`, `qrp_Opti (100, 100, 2, 'SELECT vol_ID AS Value, vol_Name AS Display FROM volunteeropportunity_vol ORDER BY vol_Name', 'Volunteer opportunities', 'First volunteer opportunity choice', 'volopp1', '1', 1, 0, '', 12, 1, 1, 2), (101, 100, 2, 'SELECT vol_ID AS Value, vol_Name AS Display FROM volunteeropportunity_vol ORDER BY vol_Name', 'Volunteer opportunities', 'Second volunteer opportunity choice', 'volopp2', '1', 1, 0, '', 12, 1, 1, 2), (200, 200, 2, 'SELECT custom_field as Value, custom_Name as Display FROM person_custom_master', 'Custom field', 'Choose customer person field', 'custom', '1', 0, 0, '', 0, 0, 0, 0), - (201, 200, 0, '', 'Field value', 'Match custom field to this value', 'value', '1', 0, 0, '', 0, 0, 0, 0); + (201, 200, 0, '', 'Field value', 'Match custom field to this value', 'value', '1', 0, 0, '', 0, 0, 0, 0), + (202, 201, 2, 'SELECT custom_field as Value, custom_Name as Display FROM person_custom_master', 'Custom field', 'Choose customer person field', 'custom', '1', 0, 0, '', 0, 0, 0, 0), + (203, 201, 0, '', 'Field value', 'Match custom field to this value', 'value', '1', 0, 0, '', 0, 0, 0, 0); -- -------------------------------------------------------- @@ -1161,7 +1163,8 @@ INSERT INTO `query_qry` (`qry_ID`, `qry_SQL`, `qry_Name`, `qry_Description`, `qr (37, "SELECT a.per_ID as AddToCart, per_Email as Email, CONCAT('',a.per_FirstName,' ',a.per_LastName,'') AS Name, a.per_DateDeactivated as 'GDPR' FROM `person_per` AS a WHERE per_confirm_report='Done';", 'Done confirmation of persons', 'Look for person who have confirmed', 1, 1), (38, "SELECT a.per_ID as AddToCart, per_Email as Email, CONCAT('',a.per_FirstName,' ',a.per_LastName,'') AS Name, a.per_DateDeactivated as 'GDPR' FROM person_per AS a WHERE `per_fam_ID` IN (SELECT F.fam_ID FROM `family_fam` AS F WHERE F.fam_confirm_report='Done');", 'Done confirmation of families', 'Look for families who have confirmed', 1, 1), (100, 'SELECT a.per_ID as AddToCart, CONCAT('''',a.per_FirstName,'' '',a.per_LastName,'''') AS Name, a.per_DateDeactivated as ''GDPR'' FROM person_per AS a LEFT JOIN person2volunteeropp_p2vo p2v1 ON (a.per_id = p2v1.p2vo_per_ID AND p2v1.p2vo_vol_ID = ~volopp1~) LEFT JOIN person2volunteeropp_p2vo p2v2 ON (a.per_id = p2v2.p2vo_per_ID AND p2v2.p2vo_vol_ID = ~volopp2~) WHERE p2v1.p2vo_per_ID=p2v2.p2vo_per_ID ORDER BY per_LastName', 'Volunteers', 'Find volunteers for who match two specific opportunity codes', 1, 6), - (200, 'SELECT a.per_ID as AddToCart, CONCAT('''',a.per_FirstName,'' '',a.per_LastName,'''') AS Name, a.per_DateDeactivated as ''GDPR'' FROM person_per AS a LEFT JOIN person_custom pc ON a.per_id = pc.per_ID WHERE pc.~custom~ LIKE ''%~value~%'' ORDER BY per_LastName', 'CustomSearch', 'Find people with a custom field value', 1, 7); + (200, 'SELECT a.per_ID as AddToCart, CONCAT('''',a.per_FirstName,'' '',a.per_LastName,'''') AS Name, a.per_DateDeactivated as ''GDPR'' FROM person_per AS a LEFT JOIN person_custom pc ON a.per_id = pc.per_ID WHERE pc.~custom~ LIKE ''%~value~%'' ORDER BY per_LastName', 'CustomSearch', 'Find people with a custom field value', 1, 7), + (201, 'SELECT a.per_ID as AddToCart, CONCAT('''',a.per_FirstName,'' '',a.per_LastName,'''') AS Name, a.per_DateDeactivated as ''GDPR'' FROM person_per AS a LEFT JOIN person_custom pc ON a.per_id = pc.per_ID WHERE pc.~custom~ IS ~value~ ORDER BY per_LastName', 'CustomSearch is NULL', 'Find people with a custom field value is NULL', 1, 7); -- -------------------------------------------------------- diff --git a/src/mysql/upgrade/8.0.0-upgrade.sql b/src/mysql/upgrade/8.0.0-upgrade.sql index e4a683c87..43d6297d5 100644 --- a/src/mysql/upgrade/8.0.0-upgrade.sql +++ b/src/mysql/upgrade/8.0.0-upgrade.sql @@ -223,4 +223,11 @@ INSERT INTO `query_qry` (`qry_ID`, `qry_SQL`, `qry_Name`, `qry_Description`, `qr (35, "SELECT a.per_ID as AddToCart, per_Email as Email, CONCAT('',a.per_FirstName,' ',a.per_LastName,'') AS Name, a.per_DateDeactivated as 'GDPR' FROM `person_per` AS a WHERE per_confirm_report='pending';", 'Awaiting confirmation of persons', 'Find person who are in pending confirmation process', 1, 1), (36, "SELECT a.per_ID as AddToCart, per_Email as Email, CONCAT('',a.per_FirstName,' ',a.per_LastName,'') AS Name, a.per_DateDeactivated as 'GDPR' FROM person_per AS a WHERE `per_fam_ID` IN (SELECT F.fam_ID FROM `family_fam` AS F WHERE F.fam_confirm_report='pending');", 'Awaiting confirmation of families', 'Find families who are in pending confirmation process', 1, 1), (37, "SELECT a.per_ID as AddToCart, per_Email as Email, CONCAT('',a.per_FirstName,' ',a.per_LastName,'') AS Name, a.per_DateDeactivated as 'GDPR' FROM `person_per` AS a WHERE per_confirm_report='Done';", 'Done confirmation of persons', 'Look for person who have confirmed', 1, 1), - (38, "SELECT a.per_ID as AddToCart, per_Email as Email, CONCAT('',a.per_FirstName,' ',a.per_LastName,'') AS Name, a.per_DateDeactivated as 'GDPR' FROM person_per AS a WHERE `per_fam_ID` IN (SELECT F.fam_ID FROM `family_fam` AS F WHERE F.fam_confirm_report='Done');", 'Done confirmation of families', 'Look for families who have confirmed', 1, 1); \ No newline at end of file + (38, "SELECT a.per_ID as AddToCart, per_Email as Email, CONCAT('',a.per_FirstName,' ',a.per_LastName,'') AS Name, a.per_DateDeactivated as 'GDPR' FROM person_per AS a WHERE `per_fam_ID` IN (SELECT F.fam_ID FROM `family_fam` AS F WHERE F.fam_confirm_report='Done');", 'Done confirmation of families', 'Look for families who have confirmed', 1, 1); + +INSERT INTO `queryparameters_qrp` (`qrp_ID`, `qrp_qry_ID`, `qrp_Type`, `qrp_OptionSQL`, `qrp_Name`, `qrp_Description`, `qrp_Alias`, `qrp_Default`, `qrp_Required`, `qrp_InputBoxSize`, `qrp_Validation`, `qrp_NumericMax`, `qrp_NumericMin`, `qrp_AlphaMinLength`, `qrp_AlphaMaxLength`) VALUES + (202, 201, 2, 'SELECT custom_field as Value, custom_Name as Display FROM person_custom_master', 'Custom field', 'Choose customer person field', 'custom', '1', 0, 0, '', 0, 0, 0, 0), + (203, 201, 0, '', 'Field value', 'Match custom field to this value', 'value', '1', 0, 0, '', 0, 0, 0, 0); + +INSERT INTO `query_qry` (`qry_ID`, `qry_SQL`, `qry_Name`, `qry_Description`, `qry_Count`, `qry_Type_ID`) VALUES + (201, 'SELECT a.per_ID as AddToCart, CONCAT('''',a.per_FirstName,'' '',a.per_LastName,'''') AS Name, a.per_DateDeactivated as ''GDPR'' FROM person_per AS a LEFT JOIN person_custom pc ON a.per_id = pc.per_ID WHERE pc.~custom~ IS ~value~ ORDER BY per_LastName', 'CustomSearch is NULL', 'Find people with a custom field value is NULL', 1, 7); diff --git a/src/v2/templates/query/queryview.php b/src/v2/templates/query/queryview.php index abca16edd..7e5afa9f9 100644 --- a/src/v2/templates/query/queryview.php +++ b/src/v2/templates/query/queryview.php @@ -96,8 +96,9 @@ function ProcessSQL($vPOST, $qry_SQL, $rsParameters) extract($aRow); //Debugging code - //echo "--" . $qry_SQL . "
--" . "~" . $qrp_Alias . "~" . "
--" . $vPOST[$qrp_Alias] . "

"; - + ?> +
-- ~~
--

+ '; - echo mysqli_num_rows($rsQueryResults) . _(' record(s) returned'); - echo '

'; + ?> +

+ +

+ name != 'AddToCart' && $fieldInfo->name != 'GDPR') { - echo '' . _($fieldInfo->name) . ''; + if ($fieldInfo->name != 'AddToCart' && $fieldInfo->name != 'GDPR') {?> + name) ?> + name == 'AddToCart') { ?> @@ -165,7 +169,9 @@ class="btn btn-danger btn-sm"> '; + ?> + + ' . $res . ''; + ?> + + ' . $aRow[$iCount] . ''; + ?> + + '; + ?> + + @@ -433,9 +444,9 @@ function DisplayParameterForm($rsParameters, $iQueryID, $sRootPath) } while ($aRow = mysqli_fetch_array($rsParameters)) { $res = getQueryFormInput($aRow); - - echo $res[1]; - + ?> + +