From 20686c7647255d4d41f8641eac2c925efbbde126 Mon Sep 17 00:00:00 2001 From: snehal patil Date: Thu, 18 Jul 2019 14:15:07 +0530 Subject: [PATCH 1/6] Feature #147693 feat: Update replcaement tags (#53) * Feature #147693 feat: Update replcaement tags * Feature #147693 feat: Update replcaement tags * Feature #147693 feat: Update replcaement tags --- .../admin/models/notification.php | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/com_tjnotifications/admin/models/notification.php b/src/com_tjnotifications/admin/models/notification.php index ca188d5f..6eddf89f 100644 --- a/src/com_tjnotifications/admin/models/notification.php +++ b/src/com_tjnotifications/admin/models/notification.php @@ -232,4 +232,68 @@ public function getKeys($client) return $existingKeys; } + + /** + * Method to get tag replacement count + * + * @param string $key Template key. + * @param string $client client. + * + * @return integer replacement tags count + * + * @since __DEPLOY_VERSION__ + */ + public function getReplacementTagsCount($key, $client) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + $query->select($db->quoteName('replacement_tags')); + $query->from($db->quoteName('#__tj_notification_templates')); + $query->where($db->quoteName('client') . ' = ' . $db->quote($client)); + $query->where($db->quoteName('key') . ' = ' . $db->quote($key)); + $db->setQuery($query); + $replacementTags = $db->loadResult(); + + return count(json_decode($replacementTags)); + } + + /** + * Method to replace tags if they are changed + * + * @param array $data template data + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function updateReplacementTags($data) + { + if (!empty($data['replacement_tags'])) + { + $replacementTags = json_encode($data['replacement_tags']); + } + else + { + return; + } + + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + + // Fields to update. + $fields = array( + $db->quoteName('replacement_tags') . ' = ' . $db->quote($replacementTags) + ); + + // Conditions for which records should be updated. + $conditions = array( + $db->quoteName('client') . ' = ' . $db->quote($data['client']), + $db->quoteName('key') . ' = ' . $db->quote($data['key']) + ); + + $query->update($db->quoteName('#__tj_notification_templates'))->set($fields)->where($conditions); + $db->setQuery($query); + + $result = $db->execute(); + } } From b9395092a158fa2900015b8eddefd9fe88486e29 Mon Sep 17 00:00:00 2001 From: snehal patil Date: Thu, 18 Jul 2019 18:13:16 +0530 Subject: [PATCH 2/6] Extras #147738 chore: Version update (#55) * Feature #147693 feat: Update replcaement tags * Feature #147693 feat: Update replcaement tags * Feature #147693 feat: Update replcaement tags * Extras #147738 chore: Version update --- src/com_tjnotifications/admin/models/notification.php | 4 ++-- src/com_tjnotifications/tjnotifications.xml | 4 ++-- src/plugins/actionlog/tjnotification/tjnotification.xml | 4 ++-- src/plugins/privacy/tjnotification/tjnotification.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/com_tjnotifications/admin/models/notification.php b/src/com_tjnotifications/admin/models/notification.php index 6eddf89f..785cbae0 100644 --- a/src/com_tjnotifications/admin/models/notification.php +++ b/src/com_tjnotifications/admin/models/notification.php @@ -241,7 +241,7 @@ public function getKeys($client) * * @return integer replacement tags count * - * @since __DEPLOY_VERSION__ + * @since 1.0.4 */ public function getReplacementTagsCount($key, $client) { @@ -264,7 +264,7 @@ public function getReplacementTagsCount($key, $client) * * @return void * - * @since __DEPLOY_VERSION__ + * @since 1.0.4 */ public function updateReplacementTags($data) { diff --git a/src/com_tjnotifications/tjnotifications.xml b/src/com_tjnotifications/tjnotifications.xml index c707265e..c6cfde57 100644 --- a/src/com_tjnotifications/tjnotifications.xml +++ b/src/com_tjnotifications/tjnotifications.xml @@ -6,8 +6,8 @@ https://techjoomla.com Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 7th Feb 2019 - 1.0.3 + 18th Jul 2019 + 1.0.4 sql/install.mysql.utf8.sql diff --git a/src/plugins/actionlog/tjnotification/tjnotification.xml b/src/plugins/actionlog/tjnotification/tjnotification.xml index 77d25ede..4f3dbc80 100644 --- a/src/plugins/actionlog/tjnotification/tjnotification.xml +++ b/src/plugins/actionlog/tjnotification/tjnotification.xml @@ -2,12 +2,12 @@ plg_actionlog_tjnotification Techjoomla - 7th Feb 2019 + 18th Jul 2019 Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL extensions@techjoomla.com https://techjoomla.com - 1.0.3 + 1.0.4 PLG_ACTIONLOG_TJNOTIFICATION_XML_DESCRIPTION tjnotification.php diff --git a/src/plugins/privacy/tjnotification/tjnotification.xml b/src/plugins/privacy/tjnotification/tjnotification.xml index 2674ef23..4b8c26ac 100644 --- a/src/plugins/privacy/tjnotification/tjnotification.xml +++ b/src/plugins/privacy/tjnotification/tjnotification.xml @@ -1,8 +1,8 @@ plg_privacy_tjnotification - 1.0.3 - 7th Feb 2019 + 1.0.4 + 18th Jul 2019 Techjoomla extensions@techjoomla.com https://techjoomla.com From 3344087cdabb9b0a13cffb8610b35272f99821f5 Mon Sep 17 00:00:00 2001 From: Manoj L Date: Tue, 22 Oct 2019 11:56:48 +0530 Subject: [PATCH 3/6] Merge `release-1.0.5` into `master` (#58) * #00000 feat: DB engine Changes * #00000 feat: DB engine Changes * #00000 feat: DB engine Changes --- .../admin/sql/install.mysql.utf8.sql | 12 +++--------- .../admin/sql/updates/mysql/1.0.5.sql | 8 ++++++++ src/com_tjnotifications/tjnotifications.xml | 7 ++++++- 3 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 src/com_tjnotifications/admin/sql/updates/mysql/1.0.5.sql diff --git a/src/com_tjnotifications/admin/sql/install.mysql.utf8.sql b/src/com_tjnotifications/admin/sql/install.mysql.utf8.sql index b4e5d91e..dfb9b0f7 100644 --- a/src/com_tjnotifications/admin/sql/install.mysql.utf8.sql +++ b/src/com_tjnotifications/admin/sql/install.mysql.utf8.sql @@ -2,10 +2,7 @@ CREATE TABLE IF NOT EXISTS `#__tj_notification_providers` ( `provider` varchar(100) NOT NULL, `state` int(1) NOT NULL, primary key(provider) - ) - AUTO_INCREMENT =0 - DEFAULT CHARSET =utf8; - + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__tj_notification_templates` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -35,9 +32,7 @@ CREATE TABLE IF NOT EXISTS `#__tj_notification_templates` ( UNIQUE KEY `client_2` (`client`,`key`), KEY `client` (`client`), KEY `key` (`key`) -) - DEFAULT CHARSET=utf8 - AUTO_INCREMENT=0 ; +) AUTO_INCREMENT=1 ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__tj_notification_user_exclusions` ( `user_id` int(11) NOT NULL, @@ -48,5 +43,4 @@ CREATE TABLE IF NOT EXISTS `#__tj_notification_templates` ( KEY `key` (`key`), KEY `provider` (`provider`), CONSTRAINT `#__tj_notification_user_exclusions_ibfk_1` FOREIGN KEY (`provider`) REFERENCES `#__tj_notification_providers` (`provider`) -) - DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/src/com_tjnotifications/admin/sql/updates/mysql/1.0.5.sql b/src/com_tjnotifications/admin/sql/updates/mysql/1.0.5.sql new file mode 100644 index 00000000..8c7f100e --- /dev/null +++ b/src/com_tjnotifications/admin/sql/updates/mysql/1.0.5.sql @@ -0,0 +1,8 @@ + +-- +-- Change table ENGINE; +-- + +ALTER TABLE `#__tj_notification_providers` ENGINE = InnoDB; +ALTER TABLE `#__tj_notification_templates` ENGINE = InnoDB; +ALTER TABLE `#__tj_notification_user_exclusions` ENGINE = InnoDB; diff --git a/src/com_tjnotifications/tjnotifications.xml b/src/com_tjnotifications/tjnotifications.xml index c6cfde57..5f79d4f5 100644 --- a/src/com_tjnotifications/tjnotifications.xml +++ b/src/com_tjnotifications/tjnotifications.xml @@ -7,12 +7,17 @@ Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL 18th Jul 2019 - 1.0.4 + 1.0.5 sql/install.mysql.utf8.sql + + + sql/updates/mysql + + sql/uninstall.mysql.utf8.sql From 11077f480b022b677ba6ac06b92f043945b76a85 Mon Sep 17 00:00:00 2001 From: Manoj L Date: Tue, 22 Oct 2019 11:58:43 +0530 Subject: [PATCH 4/6] Extras #147738 chore: Version update --- src/com_tjnotifications/tjnotifications.xml | 2 +- src/plugins/actionlog/tjnotification/tjnotification.xml | 4 ++-- src/plugins/privacy/tjnotification/tjnotification.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com_tjnotifications/tjnotifications.xml b/src/com_tjnotifications/tjnotifications.xml index 5f79d4f5..23775d51 100644 --- a/src/com_tjnotifications/tjnotifications.xml +++ b/src/com_tjnotifications/tjnotifications.xml @@ -6,7 +6,7 @@ https://techjoomla.com Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 18th Jul 2019 + 22nd Oct 2019 1.0.5 diff --git a/src/plugins/actionlog/tjnotification/tjnotification.xml b/src/plugins/actionlog/tjnotification/tjnotification.xml index 4f3dbc80..2aa349bc 100644 --- a/src/plugins/actionlog/tjnotification/tjnotification.xml +++ b/src/plugins/actionlog/tjnotification/tjnotification.xml @@ -2,12 +2,12 @@ plg_actionlog_tjnotification Techjoomla - 18th Jul 2019 + 22nd Oct 2019 Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL extensions@techjoomla.com https://techjoomla.com - 1.0.4 + 1.0.5 PLG_ACTIONLOG_TJNOTIFICATION_XML_DESCRIPTION tjnotification.php diff --git a/src/plugins/privacy/tjnotification/tjnotification.xml b/src/plugins/privacy/tjnotification/tjnotification.xml index 4b8c26ac..a6f6eb5b 100644 --- a/src/plugins/privacy/tjnotification/tjnotification.xml +++ b/src/plugins/privacy/tjnotification/tjnotification.xml @@ -1,8 +1,8 @@ plg_privacy_tjnotification - 1.0.4 - 18th Jul 2019 + 1.0.5 + 22nd Oct 2019 Techjoomla extensions@techjoomla.com https://techjoomla.com From faca2bc13b06acfad1dc077bf19694fc89ed58a0 Mon Sep 17 00:00:00 2001 From: Deepa Date: Tue, 5 Nov 2019 14:09:29 +0530 Subject: [PATCH 5/6] Bug #152597 fix: JGive pkg is not installing : Error SQL Specified key was too long; max key length is 1000 bytes --- src/com_tjnotifications/admin/sql/install.mysql.utf8.sql | 2 +- src/com_tjnotifications/admin/sql/updates/mysql/1.0.6.sql | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/com_tjnotifications/admin/sql/updates/mysql/1.0.6.sql diff --git a/src/com_tjnotifications/admin/sql/install.mysql.utf8.sql b/src/com_tjnotifications/admin/sql/install.mysql.utf8.sql index dfb9b0f7..322a03fa 100644 --- a/src/com_tjnotifications/admin/sql/install.mysql.utf8.sql +++ b/src/com_tjnotifications/admin/sql/install.mysql.utf8.sql @@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS `#__tj_notification_templates` ( `client` varchar(100) NOT NULL, `key` varchar(100) NOT NULL, `provider` varchar(100) NOT NULL, - KEY `client1` (`client`,`provider`,`key`), + KEY `client1` (`client`(100),`provider`(50),`key`(100)), KEY `key` (`key`), KEY `provider` (`provider`), CONSTRAINT `#__tj_notification_user_exclusions_ibfk_1` FOREIGN KEY (`provider`) REFERENCES `#__tj_notification_providers` (`provider`) diff --git a/src/com_tjnotifications/admin/sql/updates/mysql/1.0.6.sql b/src/com_tjnotifications/admin/sql/updates/mysql/1.0.6.sql new file mode 100644 index 00000000..c10ad94a --- /dev/null +++ b/src/com_tjnotifications/admin/sql/updates/mysql/1.0.6.sql @@ -0,0 +1,3 @@ +----Change table Key; + +ALTER TABLE `#__tj_notification_user_exclusions` CHANGE KEY `client1` (`client`(100),`provider`(50),`key`(100)); From f40fd695d94e8127c45fa113bfcf46e94d72e28a Mon Sep 17 00:00:00 2001 From: Deepa Date: Wed, 13 Nov 2019 12:15:26 +0530 Subject: [PATCH 6/6] Task #150350: Version and date changes --- src/com_tjnotifications/tjnotifications.xml | 4 ++-- src/plugins/actionlog/tjnotification/tjnotification.xml | 4 ++-- src/plugins/privacy/tjnotification/tjnotification.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com_tjnotifications/tjnotifications.xml b/src/com_tjnotifications/tjnotifications.xml index 23775d51..b8cdeab9 100644 --- a/src/com_tjnotifications/tjnotifications.xml +++ b/src/com_tjnotifications/tjnotifications.xml @@ -6,8 +6,8 @@ https://techjoomla.com Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL - 22nd Oct 2019 - 1.0.5 + 13th Nov 2019 + 1.0.6 sql/install.mysql.utf8.sql diff --git a/src/plugins/actionlog/tjnotification/tjnotification.xml b/src/plugins/actionlog/tjnotification/tjnotification.xml index 2aa349bc..d48f2a46 100644 --- a/src/plugins/actionlog/tjnotification/tjnotification.xml +++ b/src/plugins/actionlog/tjnotification/tjnotification.xml @@ -2,12 +2,12 @@ plg_actionlog_tjnotification Techjoomla - 22nd Oct 2019 + 13th Nov 2019 Copyright (C) 2016 - 2019 Techjoomla. All rights reserved. http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL extensions@techjoomla.com https://techjoomla.com - 1.0.5 + 1.0.6 PLG_ACTIONLOG_TJNOTIFICATION_XML_DESCRIPTION tjnotification.php diff --git a/src/plugins/privacy/tjnotification/tjnotification.xml b/src/plugins/privacy/tjnotification/tjnotification.xml index a6f6eb5b..9827e261 100644 --- a/src/plugins/privacy/tjnotification/tjnotification.xml +++ b/src/plugins/privacy/tjnotification/tjnotification.xml @@ -1,8 +1,8 @@ plg_privacy_tjnotification - 1.0.5 - 22nd Oct 2019 + 1.0.6 + 13th Nov 2019 Techjoomla extensions@techjoomla.com https://techjoomla.com