Skip to content

Commit

Permalink
Merge pull request #167 from techjoomla/release-3.0.4
Browse files Browse the repository at this point in the history
Release 3.0.4
  • Loading branch information
manojLondhe authored Nov 22, 2023
2 parents 168cb69 + 8357159 commit d66ebb0
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 70 deletions.
6 changes: 6 additions & 0 deletions src/com_tjnotifications/admin/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
default="" label="COM_TJNOTIFICATIONS_SETTINGS_CHOOSE_URL_SHORTENING_PLUGIN" description="COM_TJNOTIFICATIONS_SETTINGS_CHOOSE_URL_SHORTENING_PLUGIN_DESC" query="SELECT element, name FROM #__extensions WHERE type='plugin' AND folder='tjurlshortner' AND enabled=1" key_field="element" value_field="name" />

<field name="url_shortening_enabled_backends" type="tjnotificationsbackends" showon="enable_url_shortening:1" default="sms" multiple="multiple" label="COM_TJNOTIFICATIONS_SETTINGS_CHOOSE_BACKEND_SHORTENING" description="COM_TJNOTIFICATIONS_SETTINGS_CHOOSE_BACKEND_SHORTENING_DESC" />

<field name="web_notification_provider" type="list" default="easysocial"
description="COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER_DESC"
label="COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER">
<option value="easysocial">COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER_EASYSOCIAL</option>
</field>

</fieldset>

Expand Down
2 changes: 1 addition & 1 deletion src/com_tjnotifications/admin/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

if (!defined('TJNOTIFICATIONS_CONST_BACKENDS_ARRAY'))
{
define('TJNOTIFICATIONS_CONST_BACKENDS_ARRAY', "email,sms");
define('TJNOTIFICATIONS_CONST_BACKENDS_ARRAY', "email,sms,web");
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,10 @@ COM_TJNOTIFICATIONS_NOTIFICATION_SMS_REMAINING_EXCEEDED="characters exceeded"
; Notification - SMS provider template ID
COM_TJNOTIFICATIONS_FIELD_SMS_TEMPLATE_ID_LABEL="SMS template ID"
COM_TJNOTIFICATIONS_FIELD_SMS_TEMPLATE_ID_DESC="Set template ID which is proided by SMS provider"

; Notification - WEB provider
COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER="Web Notification Provider"
COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER_DESC="Choose Web Notification Provider"
COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER_EASYSOCIAL="Easysocial"
COM_TJNOTIFICATIONS_WEB_FIELDS="Web Fields"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_WEB_TITLE="Web"
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;

require_once JPATH_ADMINISTRATOR . '/components/com_tjnotifications/defines.php';

FormHelper::loadFieldClass('list');

/**
Expand Down
58 changes: 27 additions & 31 deletions src/com_tjnotifications/admin/models/forms/notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,33 @@
groupByFieldset="false" />
</fieldset>
</fields>

<fields name="web">
<fieldset name="web_fieldset">
<field
name="state"
type="radio"
default="0"
label="COM_TJNOTIFICATIONS_FIELD_WEB_STATUS_LABEL"
description="COM_TJNOTIFICATIONS_FIELD_WEB_STATUS_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JON</option>
<option value="0">JOFF</option>
</field>
<field
name="webfields"
description="COM_TJNOTIFICATIONS_WEB_FIELDS_DESC"
type="subform"
label="COM_TJNOTIFICATIONS_WEB_FIELDS"
min="1"
formsource="/administrator/components/com_tjnotifications/models/forms/webfields.xml"
multiple="true"
buttons="add,remove"
layout="joomla.form.field.subform.repeatable"
groupByFieldset="false" />
</fieldset>
</fields>

<fields name="push">
<fieldset name="push_fieldset">
Expand Down Expand Up @@ -194,35 +221,4 @@
groupByFieldset="false" />
</fieldset>
</fields>

<!--
<fields name="web">
<fieldset name="web_fieldset">
<field
name="state"
type="radio"
default="0"
label="COM_TJNOTIFICATIONS_FIELD_WEB_STATUS_LABEL"
description="COM_TJNOTIFICATIONS_FIELD_WEB_STATUS_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JON</option>
<option value="0">JOFF</option>
</field>
<field
name="subject"
type="textarea"
label="COM_TJNOTIFICATIONS_FIELD_WEB_SUBJECT_LABEL"
description="COM_TJNOTIFICATIONS_FIELD_WEB_SUBJECT_DESC"
/>
<field
name="body"
type="editor"
label="COM_TJNOTIFICATIONS_FIELD_WEB_BODY_LABEL"
description="COM_TJNOTIFICATIONS_FIELD_WEB_BODY_DESC"
validation="required"
/>
</fieldset>
</fields>-->
</form>
34 changes: 34 additions & 0 deletions src/com_tjnotifications/admin/models/forms/webfields.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset>
<field
name="id"
type="hidden" />

<field
name="language"
type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_TJNOTIFICATIONS_NOTIFICATION_LANGUAGE_DESC"
required="true"
>
<option value="*">JALL</option>
</field>

<field
name="subject"
type="textarea"
label="COM_TJNOTIFICATIONS_FIELD_WEB_SUBJECT_LABEL"
description="COM_TJNOTIFICATIONS_FIELD_WEB_SUBJECT_DESC"
required="true"
/>

<field
name="body"
type="textarea"
label="COM_TJNOTIFICATIONS_FIELD_WEB_BODY_LABEL"
description="COM_TJNOTIFICATIONS_FIELD_WEB_BODY_DESC"
required="true"
/>
</fieldset>
</form>
10 changes: 10 additions & 0 deletions src/com_tjnotifications/media/css/tjnotifcations.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@

.table-wrap{table-layout: fixed; width: 100%; white-space: initial;}
.wrap{word-wrap: break-word; white-space: initial; overflow: hidden;}

.radio-btns>.btn:not(:last-child):not(.dropdown-toggle) {
margin-left: 5px!important;
}
.radio-btns>:not(.btn-check:first-child)+.btn {
margin-left: 5px!important;
}
.radio-btns>input {
margin-left: 10px;
}
1 change: 1 addition & 0 deletions src/com_tjnotifications/media/css/tjnotifcations.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/com_tjnotifications/site/models/preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,10 @@ public function adminPreferences($provider)
$query = $db->getQuery(true);
$provider = strtolower($provider);
$query->select('client,`key`');
$query->from($db->quoteName('#__tj_notification_templates'));
$query->where($db->quoteName($provider . '_status') . '=' . $db->quote('1'));

$query->from($db->quoteName('#__tj_notification_templates','tnt'));
$query->join('INNER', $db->qn('#__tj_notification_template_configs', 'tntc') . ' ON (' . $db->qn('tntc.template_id') . ' = ' . $db->qn('tnt.id') . ')');
$query->where($db->quoteName('tntc.backend') . '=' . $db->quote($provider));
$query->where($db->quoteName('tntc.state') . '=' . $db->quote('1'));
$db->setQuery($query);

return $db->loadObjectList();
Expand Down
45 changes: 25 additions & 20 deletions src/com_tjnotifications/site/views/preferences/tmpl/default_bs5.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
$language = Factory::getLanguage();
$language->load('com_tjnotification', JPATH_SITE, 'en-GB', true);
$language->load('com_tjnotification', JPATH_SITE, null, true);

HTMLHelper::_('stylesheet','media/com_tjnotifications/css/tjnotifcations.css');
HTMLHelper::_('script', '/jquery.min.js');
HTMLHelper::_('script','https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js');
Factory::getDocument()->addScriptDeclaration('
const tjnBaseurl = "' . Uri::root() . '";
jQuery.noConflict();
Expand Down Expand Up @@ -119,11 +120,11 @@ function removePreferance(pId,client,provider,key)
</div>

<div id="display_info"></div>
<ul class="nav nav-pills" id="myTab" role="tablist">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<?php if (!empty($this->clients)) : ?>
<?php foreach ($this->clients as $i => $menu) :?>
<li class="nav-item" role="presentation">
<button type="button" id="<?php echo($menu->client) . '-tab'; ?>" role="tab" data-bs-target="#<?php echo($menu->client); ?>" class="nav-link <?php echo ($i == 0) ? ' active ' : ''?>">
<li class="nav-item" role="tab" role="presentation">
<button type="button" id="<?php echo($menu->client) . '-tab'; ?>" role="tab" data-bs-target="#<?php echo($menu->client); ?>" data-bs-toggle="tab" class="nav-link <?php echo ($i == 0) ? ' active ' : ''?>">
<?php echo str_replace("com_","",$menu->client); ?>
</button>
</li>
Expand All @@ -133,7 +134,7 @@ function removePreferance(pId,client,provider,key)

<div class="tab-content">
<?php foreach ($this->clients as $i => $menu) :?>
<div class="tab-pane fade <?php echo ($i == 0) ? ' active ' : ''?>" id="<?php echo($menu->client); ?>">
<div role="tabpanel" class="tab-pane fade <?php echo ($i == 0) ? ' active show' : ''?>" id="<?php echo($menu->client);?>">
<table class="table table-striped table-hover">
<thead>
<tr>
Expand Down Expand Up @@ -167,11 +168,12 @@ function removePreferance(pId,client,provider,key)
<?php if (empty($this->preferences)) : ?>

<div class="control">
<fieldset class="btn-group btn-group-yesno radio pull-left">
<input type="radio" id="<?php echo $value.$i; ?>" name="prefer" value="1" onclick="removePreferance('<?php echo $value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" checked="checked" />
<input type="radio" id="<?php echo $key.$i; ?>" name="prefer1" value="0" onclick="addPreferance('<?php echo $value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" />
<label class="btn-success" for="<?php echo $value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
<label class="btn" for="<?php echo $key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
<fieldset class="btn-group radio-btns btn-group-yesno radio pull-left">
<input type="radio" id="<?php echo $key.$i; ?>" name="prefer1" value="0" onclick="addPreferance('<?php echo $value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" />
<label class="btn btn-success" for="<?php echo $value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>

<input type="radio" id="<?php echo $value.$i; ?>" name="prefer1" value="1" onclick="removePreferance('<?php echo $value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" checked="checked" />
<label class="btn btn-danger" for="<?php echo $key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
</fieldset>
</div>

Expand All @@ -183,23 +185,26 @@ function removePreferance(pId,client,provider,key)
<?php if ($prefer->client == $menu->client && $prefer->key == $value && $prefer->provider == $head->provider) : ?>
<?php $count++; ?>
<div class="control">
<fieldset class="btn-group btn-group-yesno radio pull-left">
<input type="radio" id="<?php echo $menu->client.$value.$i; ?>" name="prefer" value="1" onclick="removePreferance('<?php echo $menu->client.$value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" />
<input type="radio" id="<?php echo $menu->client.$key.$i; ?>" name="prefer1" value="0" onclick="addPreferance('<?php echo $menu->client.$value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" checked="checked" />
<label class="btn" for="<?php echo $menu->client.$value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
<label class="btn-danger" for="<?php echo $menu->client.$key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
<fieldset class="btn-group radio-btns btn-group-yesno radio pull-left">
<input type="radio" id="<?php echo $menu->client.$key.$i; ?>" name="prefer2" value="0" onclick="addPreferance('<?php echo $menu->client.$value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" checked="checked" />
<label class="btn btn-success" for="<?php echo $menu->client.$value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>

<input type="radio" id="<?php echo $menu->client.$value.$i; ?>" name="prefer2" value="1" onclick="removePreferance('<?php echo $menu->client.$value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" />
<label class="btn btn-danger" for="<?php echo $menu->client.$key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
</fieldset>
</div>
<?php endif;?>
<?php endforeach; ?>

<?php if ($count==0): ?>
<div class="control">
<fieldset class="btn-group btn-group-yesno radio pull-left">
<input type="radio" id="<?php echo $menu->client.$value.$i; ?>" name="prefer" value="1" onclick="removePreferance('<?php echo $menu->client.$value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" checked="checked" />
<input type="radio" id="<?php echo $menu->client.$key.$i; ?>" name="prefer1" value="0" onclick="addPreferance('<?php echo $menu->client.$value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" />
<label class="btn-success" for="<?php echo $menu->client.$value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
<label class="btn" for="<?php echo $menu->client.$key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
<fieldset class="btn-group radio-btns btn-group-yesno radio pull-left">
<input type="radio" id="<?php echo $menu->client.$key.$i; ?>" name="prefer3" value="0" onclick="addPreferance('<?php echo $menu->client.$value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" />
<label class="btn btn-success" for="<?php echo $menu->client.$value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
<input type="radio" id="<?php echo $menu->client.$value.$i; ?>" name="prefer3" value="1" onclick="removePreferance('<?php echo $menu->client.$value.$i; ?>','<?php echo($menu->client); ?>','<?php echo($head->provider); ?>','<?php echo $value; ?>')" checked="checked" />
<label class="btn btn-danger" for="<?php echo $menu->client.$key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>


</fieldset>
</div>
<?php endif; ?>
Expand Down
7 changes: 2 additions & 5 deletions src/com_tjnotifications/site/views/preferences/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,13 @@ public function display($tpl = null)

$this->preferences = $this->get('States');
$model = ListModel::getInstance('Providers', 'TJNotificationsModel');

$this->providers = $model->getProvider();

$model = $this->getModel();
$modelPreferences = ListModel::getInstance('Preferences', 'TJNotificationsModel');

for ($i = 0;$i < count($this->providers); $i++)
{
$this->adminPreferences[$this->providers[$i]->provider] = $model->adminPreferences($this->providers[$i]->provider);
$this->adminPreferences[$this->providers[$i]->provider] = $modelPreferences->adminPreferences($this->providers[$i]->provider);
}

parent::display($tpl);
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/com_tjnotifications/tjnotifications.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<authorUrl>https://techjoomla.com</authorUrl>
<copyright>Copyright (C) 2016 - 2023 Techjoomla. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<creationDate>6th Jan 2023</creationDate>
<version>3.0.3</version>
<creationDate>22nd Nov 2023</creationDate>
<version>3.0.4</version>
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/actionlog/tjnotification/tjnotification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension version="3.9" type="plugin" group="actionlog" method="upgrade">
<name>plg_actionlog_tjnotification</name>
<author>Techjoomla</author>
<creationDate>6th Jan 2023</creationDate>
<creationDate>22nd Nov 2023</creationDate>
<copyright>Copyright (C) 2016 - 2023 Techjoomla. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>extensions@techjoomla.com</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
<version>3.0.3</version>
<version>3.0.4</version>
<description>PLG_ACTIONLOG_TJNOTIFICATION_XML_DESCRIPTION</description>
<files>
<filename plugin="tjnotification">tjnotification.php</filename>
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/api/tjnotifications/tjnotifications.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<author>Techjoomla</author>
<authorEmail>extensions@techjoomla.com</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
<creationDate>6th Jan 2023</creationDate>
<creationDate>22nd Nov 2023</creationDate>
<copyright>Copyright (C) 2016 - 2023 Techjoomla. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<version>3.0.3</version>
<version>3.0.4</version>

<files>
<filename plugin="tjnotifications">tjnotifications.php</filename>
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/privacy/tjnotification/tjnotification.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.9" type="plugin" group="privacy" method="upgrade">
<name>plg_privacy_tjnotification</name>
<version>3.0.3</version>
<creationDate>6th Jan 2023</creationDate>
<version>3.0.4</version>
<creationDate>22nd Nov 2023</creationDate>
<author>Techjoomla</author>
<authorEmail>extensions@techjoomla.com</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<author>Techjoomla</author>
<authorEmail>extensions@techjoomla.com</authorEmail>
<authorUrl>https://techjoomla.com</authorUrl>
<creationDate>6th Jan 2023</creationDate>
<creationDate>22nd Nov 2023</creationDate>
<copyright>Copyright (C) 2016 - 2023 Techjoomla. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<version>3.0.3</version>
<version>3.0.4</version>

<files>
<filename plugin="tjnotificationsmobilenumber">tjnotificationsmobilenumber.php</filename>
Expand Down

0 comments on commit d66ebb0

Please sign in to comment.