Skip to content

Commit b11c8b0

Browse files
authored
Merge pull request #135 from techjoomla/j4x
Merge `J4x` into `master`
2 parents 4b66169 + 1f7bf66 commit b11c8b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2074
-680
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
- Feature Addition (+)
77
- Improvement (^)
88

9+
### TJNotifications v2.0.2
10+
11+
##### ^ Improvements:
12+
- #173952 Chore: Table changes - adding default values for all the tables of TJnotification(Joomla 4 compatibility)
13+
914
### TJNotifications v2.0.1
1015

1116
##### + Features Added:

src/com_tjnotifications/admin/controllers/notification.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ public function save($key = null, $urlVar = '')
105105
// Access check.
106106
if (!$this->allowSave($data, $key))
107107
{
108-
$this->setError(Text::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'));
109-
$this->setMessage($this->getError(), 'error');
108+
$this->setMessage(Text::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
110109

111110
$this->setRedirect(
112111
Route::_(
@@ -183,8 +182,7 @@ public function save($key = null, $urlVar = '')
183182

184183
// Redirect back to the edit screen.
185184
// Redirect back to the edit screen.
186-
$this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()));
187-
$this->setMessage($this->getError(), 'error');
185+
$this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()), 'error');
188186

189187
$extension = $input->get('extension', '', 'STRING');
190188

@@ -215,8 +213,7 @@ public function save($key = null, $urlVar = '')
215213
$app->setUserState('com_tjnotifications.edit.notification.data', $validData);
216214

217215
// Check-in failed, so go back to the record and display a notice.
218-
$this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()));
219-
$this->setMessage($this->getError(), 'error');
216+
$this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()), 'error');
220217

221218
$extension = $input->get('extension', '', 'STRING');
222219

src/com_tjnotifications/admin/controllers/subscription.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ public function save($key = null, $urlVar = '')
126126
// Access check.
127127
if (!$this->allowSave($data, $key))
128128
{
129-
$this->setError(Text::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'));
130-
$this->setMessage($this->getError(), 'error');
129+
$this->setMessage(Text::_('JLIB_APPLICATION_ERROR_SAVE_NOT_PERMITTED'), 'error');
131130

132131
$this->setRedirect(
133132
Route::_(
@@ -188,8 +187,7 @@ public function save($key = null, $urlVar = '')
188187
$app->setUserState('com_tjnotifications.edit.subscription.data', $data);
189188

190189
// Redirect back to the edit screen.
191-
$this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()));
192-
$this->setMessage($this->getError(), 'error');
190+
$this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $model->getError()), 'error');
193191

194192
$this->setRedirect(Route::_('index.php?option=com_tjnotifications&view=subscription' . $this->getRedirectToItemAppend($recordId, $urlVar), false));
195193

@@ -203,8 +201,7 @@ public function save($key = null, $urlVar = '')
203201
$app->setUserState('com_tjnotifications.edit.subscription.data', $validData);
204202

205203
// Check-in failed, so go back to the record and display a notice.
206-
$this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()));
207-
$this->setMessage($this->getError(), 'error');
204+
$this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_CHECKIN_FAILED', $model->getError()), 'error');
208205

209206
$this->setRedirect(Route::_('index.php?option=com_tjnotifications&view=subscription' . $this->getRedirectToItemAppend($recordId, $urlVar), false));
210207

src/com_tjnotifications/admin/helpers/tjnotifications.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
// No direct access
1111
defined('_JEXEC') or die('Restricted access');
1212

13+
use Joomla\CMS\Language\Text;
14+
use Joomla\CMS\HTML\HTMLHelper;
1315
use Joomla\CMS\Factory;
1416
use Joomla\CMS\Filesystem\Path;
1517
use Joomla\CMS\Helper\ContentHelper;
16-
use Joomla\CMS\Language\Text;
1718

1819
/**
1920
* helper class for tjnotificationss
@@ -66,13 +67,13 @@ public static function addSubmenu($view = '')
6667
}
6768

6869
/*JHtmlSidebar::addEntry(
69-
JText::_('COM_TJNOTIFICATIONS_TITLE_NOTIFICATIONS'),
70+
Text::_('COM_TJNOTIFICATIONS_TITLE_NOTIFICATIONS'),
7071
'index.php?option=com_tjnotifications&view=notifications',
7172
$view == 'notifications'
7273
);
7374
7475
JHtmlSidebar::addEntry(
75-
JText::_('COM_TJNOTIFICATIONS_TITLE_NOTIFICATIONLOGS'),
76+
Text::_('COM_TJNOTIFICATIONS_TITLE_NOTIFICATIONLOGS'),
7677
'index.php?option=com_tjnotifications&view=logs',
7778
$view == 'logs'
7879
);*/

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
// No direct access
1111
defined('_JEXEC') or die('Restricted access');
1212

13+
use Joomla\CMS\Form\FormHelper;
14+
use Joomla\CMS\HTML\HTMLHelper;
1315
use Joomla\CMS\Language\Text;
1416

15-
JFormHelper::loadFieldClass('list');
17+
FormHelper::loadFieldClass('list');
1618

1719
/**
1820
* Supports an HTML select list of backends
@@ -40,11 +42,11 @@ protected function getOptions()
4042
{
4143
$options = array();
4244

43-
$options[] = JHtml::_('select.option', '', Text::_('COM_TJNOTIFICATIONS_BACKEND_LIST_CHOOSE'));
44-
$options[] = JHtml::_('select.option', 'email', Text::_('COM_TJNOTIFICATIONS_BACKEND_EMAIL'));
45-
$options[] = JHtml::_('select.option', 'push', Text::_('COM_TJNOTIFICATIONS_BACKEND_PUSH'));
46-
$options[] = JHtml::_('select.option', 'sms', Text::_('COM_TJNOTIFICATIONS_BACKEND_SMS'));
47-
$options[] = JHtml::_('select.option', 'whatsapp', Text::_('COM_TJNOTIFICATIONS_BACKEND_WHATSAPP'));
45+
$options[] = HTMLHelper::_('select.option', '', Text::_('COM_TJNOTIFICATIONS_BACKEND_LIST_CHOOSE'));
46+
$options[] = HTMLHelper::_('select.option', 'email', Text::_('COM_TJNOTIFICATIONS_BACKEND_EMAIL'));
47+
$options[] = HTMLHelper::_('select.option', 'push', Text::_('COM_TJNOTIFICATIONS_BACKEND_PUSH'));
48+
$options[] = HTMLHelper::_('select.option', 'sms', Text::_('COM_TJNOTIFICATIONS_BACKEND_SMS'));
49+
$options[] = HTMLHelper::_('select.option', 'whatsapp', Text::_('COM_TJNOTIFICATIONS_BACKEND_WHATSAPP'));
4850

4951
return array_merge(parent::getOptions(), array_values($options));
5052
}

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
*/
1010

1111
defined('_JEXEC') or die('Restricted access');
12+
13+
use Joomla\CMS\Form\FormHelper;
14+
use Joomla\CMS\HTML\HTMLHelper;
1215
use Joomla\CMS\Language\Text;
1316
use Joomla\CMS\Factory;
1417

15-
JFormHelper::loadFieldClass('list');
18+
FormHelper::loadFieldClass('list');
1619

1720
/**
1821
* Custom field to list all client of tjnotification
@@ -33,7 +36,7 @@ protected function getOptions()
3336
$options = array();
3437
$db = Factory::getDbo();
3538

36-
$options[] = JHtml::_('select.option', '', Text::_('COM_TJNOTIFICATIONS_FIELD_CLIENT_OPTION'));
39+
$options[] = HTMLHelper::_('select.option', '', Text::_('COM_TJNOTIFICATIONS_FIELD_CLIENT_OPTION'));
3740

3841
// Create a new query object.
3942
$query = $db->getQuery(true);
@@ -52,11 +55,11 @@ protected function getOptions()
5255

5356
if (!empty($client[1]))
5457
{
55-
$options[] = JHtml::_('select.option', $obj->client, ucfirst($client[1]));
58+
$options[] = HTMLHelper::_('select.option', $obj->client, ucfirst($client[1]));
5659
}
5760
else
5861
{
59-
$options[] = JHtml::_('select.option', $obj->client, ucfirst($client[0]));
62+
$options[] = HTMLHelper::_('select.option', $obj->client, ucfirst($client[0]));
6063
}
6164
}
6265
}

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99

1010
// No direct access.
1111
defined('_JEXEC') or die();
12-
use Joomla\CMS\Factory;
12+
13+
use Joomla\CMS\Form\FormField;
1314
use Joomla\CMS\Language\Text;
14-
use Joomla\CMS\Form\FormHelper;
15+
use Joomla\CMS\Factory;
1516
use Joomla\CMS\HTML\HTMLHelper;
17+
use Joomla\CMS\Form\FormHelper;
1618

1719
FormHelper::loadFieldClass('groupedlist');
1820

@@ -58,7 +60,7 @@ protected function getGroups()
5860
$customFieldnames = FieldsHelper::getFields('com_users.user');
5961
$comFieldOptions = array();
6062

61-
$comFieldOptions[][] = HTMLHelper::_('select.option', '', JText::_('COM_TJNOTIFICATIONS_SUBSCRIPTIONS_SELECT_FIELD'));
63+
$comFieldOptions[][] = HTMLHelper::_('select.option', '', Text::_('COM_TJNOTIFICATIONS_SUBSCRIPTIONS_SELECT_FIELD'));
6264

6365
foreach ($customFieldnames as $key => $field)
6466
{

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
// No direct access
1111
defined('_JEXEC') or die('Restricted access');
1212

13+
use Joomla\CMS\Form\FormHelper;
14+
use Joomla\CMS\HTML\HTMLHelper;
1315
use Joomla\CMS\Language\Text;
1416

15-
JFormHelper::loadFieldClass('list');
17+
FormHelper::loadFieldClass('list');
1618

1719
/**
1820
* Supports an HTML select list of platforms
@@ -40,10 +42,10 @@ protected function getOptions()
4042
{
4143
$options = array();
4244

43-
$options[] = JHtml::_('select.option', '', Text::_('COM_TJNOTIFICATIONS_PLATFORM_LIST_CHOOSE'));
44-
$options[] = JHtml::_('select.option', 'android', Text::_('COM_TJNOTIFICATIONS_PLATFORM_ANDROID'));
45-
$options[] = JHtml::_('select.option', 'ios', Text::_('COM_TJNOTIFICATIONS_PLATFORM_IOS'));
46-
$options[] = JHtml::_('select.option', 'web', Text::_('COM_TJNOTIFICATIONS_PLATFORM_WEB'));
45+
$options[] = HTMLHelper::_('select.option', '', Text::_('COM_TJNOTIFICATIONS_PLATFORM_LIST_CHOOSE'));
46+
$options[] = HTMLHelper::_('select.option', 'android', Text::_('COM_TJNOTIFICATIONS_PLATFORM_ANDROID'));
47+
$options[] = HTMLHelper::_('select.option', 'ios', Text::_('COM_TJNOTIFICATIONS_PLATFORM_IOS'));
48+
$options[] = HTMLHelper::_('select.option', 'web', Text::_('COM_TJNOTIFICATIONS_PLATFORM_WEB'));
4749

4850
return array_merge(parent::getOptions(), array_values($options));
4951
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
// No direct access
1111
defined('_JEXEC') or die('Restricted access');
1212

13+
use Joomla\CMS\Form\FormHelper;
1314
use Joomla\CMS\Language\Text;
1415
use Joomla\CMS\HTML\HTMLHelper;
1516

16-
JFormHelper::loadFieldClass('list');
17+
FormHelper::loadFieldClass('list');
1718

1819
/**
1920
* Supports an HTML select list of backends

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818
value_field="client"
1919
/>
2020
</fields>
21+
<fields name="list">
22+
<field name="limit" type="limitbox" class="input-mini" default="20" onchange="this.form.submit();" />
23+
</fields>
2124
</form>

0 commit comments

Comments
 (0)