Skip to content

Commit dfaec70

Browse files
Joomla 4 Compatability (#132)
* Task #172430 feat: Update JGive code to make Joomla 4 compatible * Task #172430 feat: Update JGive code to make Joomla 4 compatible * Task #172430 feat: Update JGive code to make Joomla 4 compatible * Task #172430 feat: Update JGive code to make Joomla 4 compatible * Task #139783 chore: Make TJ notification compatible with Joomla 4 * Task #173069 feat: Update infra extensions code used to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used in JGive to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used in JGive to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used in JGive to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used in JGive to make Joomla 4 compatible * Bug #178705 fix: Frontend >login by 'Super user/Registered user' > selecting 'Create New Campaign' menu > it displays 'The vendor has not yet been approved' ,user not able to create campaign * Task #173069 feat: Update infra extensions code used in JGive to make Joomla 4 compatible * Task #173069 feat: Update infra extensions code used in JGive to make Joomla 4 compatible Co-authored-by: Deepa Gawade <[email protected]>
1 parent 4e92fa2 commit dfaec70

File tree

14 files changed

+497
-247
lines changed

14 files changed

+497
-247
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Joomla\CMS\HTML\HTMLHelper;
1515
use Joomla\CMS\Language\Text;
1616

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

1919
/**
2020
* Supports an HTML select list of backends

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Joomla\CMS\Language\Text;
1616
use Joomla\CMS\Factory;
1717

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

2020
/**
2121
* Custom field to list all client of tjnotification

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Joomla\CMS\Language\Text;
1515
use Joomla\CMS\Factory;
1616
use Joomla\CMS\HTML\HTMLHelper;
17+
use Joomla\CMS\Form\FormHelper;
1718

1819
FormHelper::loadFieldClass('groupedlist');
1920

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Joomla\CMS\HTML\HTMLHelper;
1515
use Joomla\CMS\Language\Text;
1616

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

1919
/**
2020
* Supports an HTML select list of platforms

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Joomla\CMS\Language\Text;
1515
use Joomla\CMS\HTML\HTMLHelper;
1616

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

1919
/**
2020
* Supports an HTML select list of backends
Lines changed: 7 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -1,236 +1,16 @@
11
<?php
22
/**
3-
* @package TJNotifications
4-
* @subpackage com_tjnotifications
3+
* @package JGive
4+
* @subpackage com_jgive
55
*
66
* @author Techjoomla <[email protected]>
7-
* @copyright Copyright (C) 2009 - 2019 Techjoomla. All rights reserved.
7+
* @copyright Copyright (C) 2009 - 2021 Techjoomla. All rights reserved.
88
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
99
*/
1010

11-
defined('_JEXEC') or die;
11+
// Do not allow direct access
12+
defined('_JEXEC') or die('Restricted access');
1213

13-
use Joomla\CMS\Uri\Uri;
14-
use \Joomla\CMS\Factory;
15-
use \Joomla\CMS\Language\Text;
16-
use \Joomla\CMS\HTML\HTMLHelper;
17-
18-
$language = Factory::getLanguage();
19-
$language->load('com_tjnotification', JPATH_SITE, 'en-GB', true);
20-
$language->load('com_tjnotification', JPATH_SITE, null, true);
21-
22-
HTMLHelper::_('script', '/jquery.min.js');
23-
Factory::getDocument()->addScriptDeclaration('
24-
const tjnBaseurl = "' . Uri::root() . '";
25-
jQuery.noConflict();
26-
jQuery(".btn-group > .btn").click(function(){
27-
jQuery(this).addClass("active").siblings().removeClass("active");
28-
});
29-
30-
function addPreferance(pId,client,provider,key)
31-
{
32-
if(pId)
33-
{
34-
jQuery.ajaxSetup({
35-
global: false,
36-
type:"post",
37-
url:tjnBaseurl+"index.php?option=com_tjnotifications&task=preferences.save",
38-
dataType:"json",
39-
beforeSend: function () {
40-
jQuery("#ajax-loader"+pId).show();
41-
jQuery("#ajax-loader"+pId).html("<img src=\'' . Uri::root() . 'components/com_tjnotifications/images/ajax-loader.gif\'><style=\'display:block\'>");
42-
},
43-
complete: function () {
44-
jQuery("#ajax-loader"+pId).hide();
45-
jQuery("#tick"+pId).show();
46-
jQuery("#tick"+pId).html("<img src=\'' . Uri::root() . 'components/com_tjnotifications/images/tick.png\'><style=\'display:block\'>");
47-
48-
setTimeout(function() {
49-
jQuery("#tick"+pId).hide();
50-
}, 5000);
51-
}
52-
});
53-
jQuery.ajax({
54-
data:
55-
{
56-
client_name:client,
57-
provider_name:provider,
58-
key:key,
59-
},
60-
success: function (response)
61-
{
62-
jQuery("#display_info").html("Item successfully saved");
63-
}
64-
});
65-
}
66-
else
67-
{
68-
jQuery("#display_info").html("Item not successfully saved");
69-
}
70-
}
71-
function removePreferance(pId,client,provider,key)
72-
{
73-
if(pId)
74-
{
75-
jQuery.ajaxSetup({
76-
global: false,
77-
type:"post",
78-
url:tjnBaseurl+"index.php?option=com_tjnotifications&task=preferences.delete",
79-
80-
beforeSend: function () {
81-
jQuery("#ajax-loader"+pId).show();
82-
jQuery("#ajax-loader"+pId).html("<img src=\'' . Uri::root() . 'components/com_tjnotifications/images/ajax-loader.gif\'><style=\'display:block\'>");
83-
},
84-
complete: function () {
85-
jQuery("#ajax-loader"+pId).hide();
86-
jQuery("#tick"+pId).show();
87-
jQuery("#tick"+pId).html("<img src=\'' . Uri::root() . 'components/com_tjnotifications/images/tick.png\'><style=\'display:block\'>");
88-
setTimeout(function() {
89-
jQuery("#tick"+pId).hide();
90-
}, 5000);
91-
}
92-
});
93-
jQuery.ajax({
94-
dataType:"json",
95-
data:
96-
{
97-
client_name:client,
98-
provider_name:provider,
99-
key:key,
100-
},
101-
success: function (response)
102-
{
103-
jQuery("#display_info").html("Item successfully saved");
104-
}
105-
});
106-
}
107-
else
108-
{
109-
jQuery("#display_info").html("Item not successfully saved");
110-
}
111-
}
112-
');
113-
?>
114-
115-
<form action="index.php?option=com_tjnotifications&view=preferences" method="post" id="adminForm" name="adminForm">
116-
<div class="row-fluid">
117-
<div class="span6">
118-
</div>
119-
</div>
120-
121-
<div id="display_info"></div>
122-
<ul class="nav nav-tabs">
123-
<?php if (!empty($this->clients)) : ?>
124-
<?php foreach ($this->clients as $i => $menu) :?>
125-
<li>
126-
<a data-toggle="tab" aria-controls="<?php echo($menu->client); ?>"
127-
href="<?php echo('#'.$menu->client); ?>">
128-
<?php echo str_replace("com_","",$menu->client); ?>
129-
</a>
130-
</li>
131-
<?php endforeach; ?>
132-
<?php endif; ?>
133-
</ul>
134-
135-
<div class="tab-content">
136-
<?php foreach ($this->clients as $i => $menu) :?>
137-
<div class="tab-pane" id="<?php echo($menu->client); ?>" >
138-
<table class="table table-striped table-hover">
139-
<thead>
140-
<tr>
141-
<th width="20%">
142-
143-
</th>
144-
<?php if (!empty($this->providers)) : ?>
145-
<?php foreach ($this->providers as $i => $head) :?>
146-
<th width="30%">
147-
<?php echo($head->provider); ?>
148-
</th>
149-
<?php endforeach; ?>
150-
<?php endif; ?>
151-
</tr>
152-
</thead>
153-
<tbody>
154-
<div class="row">
155-
<div class="col-md-3">
156-
<?php foreach($this->keys[$menu->client] as $key=>$values) : ?>
157-
<?php foreach($values as $value ) : ?>
158-
<tr>
159-
<td align="center">
160-
<?php echo $value; ?>
161-
</td>
162-
<?php foreach ($this->providers as $i => $head) :?>
163-
<td>
164-
<?php $temp=0; ?>
165-
<?php foreach ($this->adminPreferences[$head->provider] as $adminKey => $admin) :?>
166-
<?php if($admin->client == $menu->client && $admin->key == $value) : $temp++; ?>
167-
168-
<?php if(empty($this->preferences)) : ?>
169-
170-
<div class="control">
171-
<fieldset class="btn-group btn-group-yesno radio pull-left" >
172-
<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" />
173-
<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; ?>')" />
174-
<label class="btn-success" for="<?php echo $value.$i; ?>" ><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
175-
<label class="btn" for="<?php echo $key.$i; ?>" ><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
176-
</fieldset>
177-
</div>
178-
179-
<div class="pull-right" id="<?php echo 'ajax-loader'.$value.$i; ?>" ></div>
180-
<div class="pull-right" id="<?php echo 'tick'.$value.$i; ?>" ></div>
181-
<?php else: $count=0; ?>
182-
183-
<?php foreach ($this->preferences as $j => $prefer) :?>
184-
<?php if($prefer->client == $menu->client && $prefer->key == $value && $prefer->provider == $head->provider) : ?>
185-
<?php $count++; ?>
186-
<div class="control">
187-
<fieldset class="btn-group btn-group-yesno radio pull-left" >
188-
<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; ?>')" />
189-
<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" />
190-
<label class="btn" for="<?php echo $menu->client.$value.$i; ?>" ><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
191-
<label class="btn-danger" for="<?php echo $menu->client.$key.$i; ?>" ><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
192-
</fieldset>
193-
</div>
194-
<?php endif;?>
195-
<?php endforeach; ?>
196-
197-
<?php if ($count==0): ?>
198-
<div class="control">
199-
<fieldset class="btn-group btn-group-yesno radio pull-left" >
200-
<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" />
201-
<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; ?>')" />
202-
<label class="btn-success" for="<?php echo $menu->client.$value.$i; ?>" ><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_ENABLE'); ?></label>
203-
<label class="btn" for="<?php echo $menu->client.$key.$i; ?>" ><?php echo Text::_('COM_TJNOTIFICATION_VIEWS_PREFERENCES_FIELD_DISABLE'); ?></label>
204-
</fieldset>
205-
</div>
206-
<?php endif; ?>
207-
208-
<?php endif;?>
209-
210-
<?php endif;?>
211-
212-
<?php endforeach; ?>
213-
214-
<?php if ($temp == 0): ?>
215-
<span class="label label-warning"><?php echo Text::_('COM_TJNOTIFICATIONS_VIEW_PREFERENCES_TAB_UNSUBSCRIBED'); ?></span>
216-
<?php endif; ?>
217-
<div class="pull-right" id="<?php echo 'ajax-loader'.$menu->client.$value.$i; ?>" ></div>
218-
<div class="pull-right" id="<?php echo 'tick'.$menu->client.$value.$i; ?>" ></div>
219-
</td>
220-
<?php endforeach; ?>
221-
</tr>
222-
<?php endforeach; ?>
223-
<?php endforeach; ?>
224-
</div>
225-
</div>
226-
</tbody>
227-
</table>
228-
</div>
229-
<?php endforeach;?>
230-
</div>
231-
232-
<input type="hidden" name="task" value=""/>
233-
<input type="hidden" name="boxchecked" value="0"/>
234-
<?php echo HTMLHelper::_('form.token'); ?>
235-
</form>
14+
$bsVersion = (JVERSION > '4.0.0') ? 'bs5' : 'bs3';
23615

16+
echo $this->loadTemplate($bsVersion);

0 commit comments

Comments
 (0)