Skip to content

Commit d66ebb0

Browse files
authored
Merge pull request #167 from techjoomla/release-3.0.4
Release 3.0.4
2 parents 168cb69 + 8357159 commit d66ebb0

File tree

16 files changed

+129
-70
lines changed

16 files changed

+129
-70
lines changed

src/com_tjnotifications/admin/config.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
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" />
3434

3535
<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" />
36+
37+
<field name="web_notification_provider" type="list" default="easysocial"
38+
description="COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER_DESC"
39+
label="COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER">
40+
<option value="easysocial">COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER_EASYSOCIAL</option>
41+
</field>
3642

3743
</fieldset>
3844

src/com_tjnotifications/admin/defines.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
if (!defined('TJNOTIFICATIONS_CONST_BACKENDS_ARRAY'))
1414
{
15-
define('TJNOTIFICATIONS_CONST_BACKENDS_ARRAY', "email,sms");
15+
define('TJNOTIFICATIONS_CONST_BACKENDS_ARRAY', "email,sms,web");
1616
}

src/com_tjnotifications/admin/language/en-GB.com_tjnotifications.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,10 @@ COM_TJNOTIFICATIONS_NOTIFICATION_SMS_REMAINING_EXCEEDED="characters exceeded"
286286
; Notification - SMS provider template ID
287287
COM_TJNOTIFICATIONS_FIELD_SMS_TEMPLATE_ID_LABEL="SMS template ID"
288288
COM_TJNOTIFICATIONS_FIELD_SMS_TEMPLATE_ID_DESC="Set template ID which is proided by SMS provider"
289+
290+
; Notification - WEB provider
291+
COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER="Web Notification Provider"
292+
COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER_DESC="Choose Web Notification Provider"
293+
COM_TJNOTIFICATIONS_WEB_NOTIFICATION_PROVIDER_EASYSOCIAL="Easysocial"
294+
COM_TJNOTIFICATIONS_WEB_FIELDS="Web Fields"
295+
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_WEB_TITLE="Web"

src/com_tjnotifications/admin/models/fields/tjnotificationsbackends.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use Joomla\CMS\Language\Text;
1515
use Joomla\CMS\HTML\HTMLHelper;
1616

17+
require_once JPATH_ADMINISTRATOR . '/components/com_tjnotifications/defines.php';
18+
1719
FormHelper::loadFieldClass('list');
1820

1921
/**

src/com_tjnotifications/admin/models/forms/notification.xml

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,33 @@
138138
groupByFieldset="false" />
139139
</fieldset>
140140
</fields>
141+
142+
<fields name="web">
143+
<fieldset name="web_fieldset">
144+
<field
145+
name="state"
146+
type="radio"
147+
default="0"
148+
label="COM_TJNOTIFICATIONS_FIELD_WEB_STATUS_LABEL"
149+
description="COM_TJNOTIFICATIONS_FIELD_WEB_STATUS_DESC"
150+
class="btn-group btn-group-yesno"
151+
>
152+
<option value="1">JON</option>
153+
<option value="0">JOFF</option>
154+
</field>
155+
<field
156+
name="webfields"
157+
description="COM_TJNOTIFICATIONS_WEB_FIELDS_DESC"
158+
type="subform"
159+
label="COM_TJNOTIFICATIONS_WEB_FIELDS"
160+
min="1"
161+
formsource="/administrator/components/com_tjnotifications/models/forms/webfields.xml"
162+
multiple="true"
163+
buttons="add,remove"
164+
layout="joomla.form.field.subform.repeatable"
165+
groupByFieldset="false" />
166+
</fieldset>
167+
</fields>
141168

142169
<fields name="push">
143170
<fieldset name="push_fieldset">
@@ -194,35 +221,4 @@
194221
groupByFieldset="false" />
195222
</fieldset>
196223
</fields>
197-
198-
<!--
199-
<fields name="web">
200-
<fieldset name="web_fieldset">
201-
<field
202-
name="state"
203-
type="radio"
204-
default="0"
205-
label="COM_TJNOTIFICATIONS_FIELD_WEB_STATUS_LABEL"
206-
description="COM_TJNOTIFICATIONS_FIELD_WEB_STATUS_DESC"
207-
class="btn-group btn-group-yesno"
208-
>
209-
<option value="1">JON</option>
210-
<option value="0">JOFF</option>
211-
</field>
212-
<field
213-
name="subject"
214-
type="textarea"
215-
label="COM_TJNOTIFICATIONS_FIELD_WEB_SUBJECT_LABEL"
216-
description="COM_TJNOTIFICATIONS_FIELD_WEB_SUBJECT_DESC"
217-
/>
218-
219-
<field
220-
name="body"
221-
type="editor"
222-
label="COM_TJNOTIFICATIONS_FIELD_WEB_BODY_LABEL"
223-
description="COM_TJNOTIFICATIONS_FIELD_WEB_BODY_DESC"
224-
validation="required"
225-
/>
226-
</fieldset>
227-
</fields>-->
228224
</form>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<form>
3+
<fieldset>
4+
<field
5+
name="id"
6+
type="hidden" />
7+
8+
<field
9+
name="language"
10+
type="contentlanguage"
11+
label="JFIELD_LANGUAGE_LABEL"
12+
description="COM_TJNOTIFICATIONS_NOTIFICATION_LANGUAGE_DESC"
13+
required="true"
14+
>
15+
<option value="*">JALL</option>
16+
</field>
17+
18+
<field
19+
name="subject"
20+
type="textarea"
21+
label="COM_TJNOTIFICATIONS_FIELD_WEB_SUBJECT_LABEL"
22+
description="COM_TJNOTIFICATIONS_FIELD_WEB_SUBJECT_DESC"
23+
required="true"
24+
/>
25+
26+
<field
27+
name="body"
28+
type="textarea"
29+
label="COM_TJNOTIFICATIONS_FIELD_WEB_BODY_LABEL"
30+
description="COM_TJNOTIFICATIONS_FIELD_WEB_BODY_DESC"
31+
required="true"
32+
/>
33+
</fieldset>
34+
</form>

src/com_tjnotifications/media/css/tjnotifcations.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@
44

55
.table-wrap{table-layout: fixed; width: 100%; white-space: initial;}
66
.wrap{word-wrap: break-word; white-space: initial; overflow: hidden;}
7+
8+
.radio-btns>.btn:not(:last-child):not(.dropdown-toggle) {
9+
margin-left: 5px!important;
10+
}
11+
.radio-btns>:not(.btn-check:first-child)+.btn {
12+
margin-left: 5px!important;
13+
}
14+
.radio-btns>input {
15+
margin-left: 10px;
16+
}

src/com_tjnotifications/media/css/tjnotifcations.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/com_tjnotifications/site/models/preferences.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,10 @@ public function adminPreferences($provider)
249249
$query = $db->getQuery(true);
250250
$provider = strtolower($provider);
251251
$query->select('client,`key`');
252-
$query->from($db->quoteName('#__tj_notification_templates'));
253-
$query->where($db->quoteName($provider . '_status') . '=' . $db->quote('1'));
254-
252+
$query->from($db->quoteName('#__tj_notification_templates','tnt'));
253+
$query->join('INNER', $db->qn('#__tj_notification_template_configs', 'tntc') . ' ON (' . $db->qn('tntc.template_id') . ' = ' . $db->qn('tnt.id') . ')');
254+
$query->where($db->quoteName('tntc.backend') . '=' . $db->quote($provider));
255+
$query->where($db->quoteName('tntc.state') . '=' . $db->quote('1'));
255256
$db->setQuery($query);
256257

257258
return $db->loadObjectList();

src/com_tjnotifications/site/views/preferences/tmpl/default_bs5.php

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
$language = Factory::getLanguage();
1919
$language->load('com_tjnotification', JPATH_SITE, 'en-GB', true);
2020
$language->load('com_tjnotification', JPATH_SITE, null, true);
21-
21+
HTMLHelper::_('stylesheet','media/com_tjnotifications/css/tjnotifcations.css');
2222
HTMLHelper::_('script', '/jquery.min.js');
23+
HTMLHelper::_('script','https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js');
2324
Factory::getDocument()->addScriptDeclaration('
2425
const tjnBaseurl = "' . Uri::root() . '";
2526
jQuery.noConflict();
@@ -119,11 +120,11 @@ function removePreferance(pId,client,provider,key)
119120
</div>
120121

121122
<div id="display_info"></div>
122-
<ul class="nav nav-pills" id="myTab" role="tablist">
123+
<ul class="nav nav-tabs" id="myTab" role="tablist">
123124
<?php if (!empty($this->clients)) : ?>
124125
<?php foreach ($this->clients as $i => $menu) :?>
125-
<li class="nav-item" role="presentation">
126-
<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 ' : ''?>">
126+
<li class="nav-item" role="tab" role="presentation">
127+
<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 ' : ''?>">
127128
<?php echo str_replace("com_","",$menu->client); ?>
128129
</button>
129130
</li>
@@ -133,7 +134,7 @@ function removePreferance(pId,client,provider,key)
133134

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

169170
<div class="control">
170-
<fieldset class="btn-group btn-group-yesno radio pull-left">
171-
<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" />
172-
<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; ?>')" />
173-
<label class="btn-success" for="<?php echo $value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
174-
<label class="btn" for="<?php echo $key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
171+
<fieldset class="btn-group radio-btns btn-group-yesno radio pull-left">
172+
<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; ?>')" />
173+
<label class="btn btn-success" for="<?php echo $value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
174+
175+
<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" />
176+
<label class="btn btn-danger" for="<?php echo $key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
175177
</fieldset>
176178
</div>
177179

@@ -183,23 +185,26 @@ function removePreferance(pId,client,provider,key)
183185
<?php if ($prefer->client == $menu->client && $prefer->key == $value && $prefer->provider == $head->provider) : ?>
184186
<?php $count++; ?>
185187
<div class="control">
186-
<fieldset class="btn-group btn-group-yesno radio pull-left">
187-
<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; ?>')" />
188-
<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" />
189-
<label class="btn" for="<?php echo $menu->client.$value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
190-
<label class="btn-danger" for="<?php echo $menu->client.$key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
188+
<fieldset class="btn-group radio-btns btn-group-yesno radio pull-left">
189+
<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" />
190+
<label class="btn btn-success" for="<?php echo $menu->client.$value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
191+
192+
<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; ?>')" />
193+
<label class="btn btn-danger" for="<?php echo $menu->client.$key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
191194
</fieldset>
192195
</div>
193196
<?php endif;?>
194197
<?php endforeach; ?>
195198

196199
<?php if ($count==0): ?>
197200
<div class="control">
198-
<fieldset class="btn-group btn-group-yesno radio pull-left">
199-
<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" />
200-
<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; ?>')" />
201-
<label class="btn-success" for="<?php echo $menu->client.$value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
202-
<label class="btn" for="<?php echo $menu->client.$key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
201+
<fieldset class="btn-group radio-btns btn-group-yesno radio pull-left">
202+
<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; ?>')" />
203+
<label class="btn btn-success" for="<?php echo $menu->client.$value.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
204+
<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" />
205+
<label class="btn btn-danger" for="<?php echo $menu->client.$key.$i; ?>"><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
206+
207+
203208
</fieldset>
204209
</div>
205210
<?php endif; ?>

0 commit comments

Comments
 (0)