Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.0.4 #167

Merged
merged 18 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
create tjnotification menu shwing error in FE
  • Loading branch information
ManasiBadave committed Jul 13, 2023
commit e8eb4260020d1ae9728b197382d4cbbf6936e7b1
8 changes: 5 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,11 @@ 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'));
// print_r($query->dump());die;
$db->setQuery($query);

return $db->loadObjectList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
$language->load('com_tjnotification', JPATH_SITE, null, true);

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 +121,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 ' : ''?>">
<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 +135,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
6 changes: 4 additions & 2 deletions src/com_tjnotifications/site/views/preferences/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ public function display($tpl = null)

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

$model = $this->getModel();
$model_preferences = 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] = $model_preferences->adminPreferences($this->providers[$i]->provider);
// echo "<pre>";
// print_r($this->adminPreferences);
}

parent::display($tpl);
Expand Down