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

Preview email in tjnotification #66

Open
wants to merge 52 commits into
base: release-3.1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6241c87
Task #146075 chore: create MVC for creating notification logs listview
punambaravkar Jun 19, 2019
ebe0ecb
Task #146075 chore: create MVC for creating notification logs listview
punambaravkar Jun 19, 2019
e6013f0
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 20, 2019
7cc5a9b
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 20, 2019
16f1a32
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 21, 2019
1e50ffc
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 21, 2019
5440210
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 21, 2019
f077d79
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 21, 2019
ef61de7
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 21, 2019
a1787b8
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 21, 2019
950ec0a
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 21, 2019
47cf553
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 24, 2019
9bbda37
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 24, 2019
3a871db
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 24, 2019
c3c8239
Issue #48 chore: Log Email details in DB table - Tj Notification #47
punambaravkar Jun 24, 2019
7eb2758
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 25, 2019
fdebfb5
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jun 25, 2019
4ccc3f2
Issue #48 chore: Code Review
punambaravkar Jun 25, 2019
8d99d11
Issue #48 chore: code review changes
punambaravkar Jun 26, 2019
c0b5322
Issue #48 chore: code review changes
punambaravkar Jun 26, 2019
489f3ad
Issue #48 chore: code review changes
punambaravkar Jun 26, 2019
8e443c2
Issue #48 chore: code review changes
punambaravkar Jun 26, 2019
ae4831a
Issue #48 chore: code review changes
punambaravkar Jun 26, 2019
a9242a7
Issue #48 chore: code review
punambaravkar Jun 26, 2019
ced08e2
Issue #48 chore: Log code review issue
punambaravkar Jun 28, 2019
76189e7
Issue #48 chore: Log code review issue
punambaravkar Jun 28, 2019
46925d0
Issue #48 chore: Log code review issue
punambaravkar Jun 28, 2019
1ab1de7
Issue #48 chore: Log code review issue
punambaravkar Jun 28, 2019
cf358c0
Merge remote-tracking branch 'upstream/release-1.1.0' into logs
punambaravkar Jun 28, 2019
8d77a29
Issue #48 chore: Log code review issue
punambaravkar Jun 28, 2019
9e6c8cb
Issue #48 chore: Log code review issue
punambaravkar Jun 28, 2019
e66e412
Issue #48 chore: Log code review issue
punambaravkar Jun 28, 2019
ac064a6
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
be21e3f
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
4f15523
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
ed9135b
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
3430e09
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
d31314e
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
3b83ece
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
13b89e6
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
56d82fc
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
578c4ea
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
f006121
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
7fc56ed
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 1, 2019
dd5c000
Issue #48 chore: Log Email details in DB table
punambaravkar Jul 2, 2019
22160db
Issue #48 chore: Log Email details in DB table
punambaravkar Jul 2, 2019
52caa47
Issue #48 chore: Log Email details in DB table
punambaravkar Jul 2, 2019
48ba815
Issue #48 chore: Log Email details in DB table
punambaravkar Jul 2, 2019
102d3b2
Issue #48 chore: Log Email details in DB table
punambaravkar Jul 2, 2019
dc8b615
Issue #48 chore: Log Email details in DB table
punambaravkar Jul 2, 2019
b634bbf
Issue #48 chore: Log Email details in DB table - Tj Notification
punambaravkar Jul 17, 2019
b9946a0
Preview email facility in tjnotification #65
punambaravkar Nov 25, 2019
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
11 changes: 11 additions & 0 deletions src/com_tjnotifications/admin/access.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<access component="com_tjnotifications">
<section name="component">
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
<action name="core.options" title="JACTION_OPTIONS" description="JACTION_OPTIONS_COMPONENT_DESC" />
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
<action name="core.view" title="JACTION_VIEW" description="JACTION_VIEW_COMPONENT_DESC" />
<action name="core.export" title="JACTION_EXPORT" description="JACTION_EXPORT_COMPONENT_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
</section>
</access>
3 changes: 3 additions & 0 deletions src/com_tjnotifications/admin/assets/css/tjnotifcations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.minwidth-150px{min-width:150px}
.minwidth-100px{min-width:100px}
.table-responsive{width:100%;margin-bottom:15px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}
12 changes: 12 additions & 0 deletions src/com_tjnotifications/admin/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<fieldset label="COM_TJNOTIFICATION" name="Notifications">
<field name="enable_logs" type="radio" class="btn-group btn-group-yesno" default="0" label="COM_TJNOTIFICATIONS_ALLOW_SAVE_OPTION" description="COM_TJNOTIFICATIONS_APPLICATION_OPTION_DESC">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
<fieldset name="permissions" description="JCONFIG_PERMISSIONS_DESC" label="JCONFIG_PERMISSIONS_LABEL">
<field name="rules" type="rules" component="com_tjnotifications" class="inputbox" filter="rules" validate="rules" label="JCONFIG_PERMISSIONS_LABEL" section="component" />
</fieldset>
</config>
23 changes: 23 additions & 0 deletions src/com_tjnotifications/admin/controllers/log.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* @package TJNotifications
* @subpackage com_tjnotifications
*
* @author Techjoomla <extensions@techjoomla.com>
* @copyright Copyright (C) 2009 - 2019 Techjoomla. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/

// No direct access
defined('_JEXEC') or die;

use Joomla\CMS\MVC\Controller\FormController;

/**
* Log Controller
*
* @since 1.1.0
*/
class TjnotificationsControllerLog extends FormController
{
}
38 changes: 38 additions & 0 deletions src/com_tjnotifications/admin/controllers/logs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* @package TJNotifications
* @subpackage com_tjnotifications
*
* @author Techjoomla <extensions@techjoomla.com>
* @copyright Copyright (C) 2009 - 2019 Techjoomla. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/

// No direct access
defined('_JEXEC') or die;

use Joomla\CMS\MVC\Controller\AdminController;

/**
* Logs controller class.
*
* @since 1.1.0
*/
class TjnotificationsControllerLogs extends AdminController
{
/**
* Proxy for getModel.
*
* @param string $name The name of the model.
* @param string $prefix The prefix for the PHP class name.
* @param array $config Array of configuration parameters.
*
* @return JModelLegacy
*
* @since 1.1.0
*/
public function getModel($name = 'log', $prefix = 'TjnotificationsModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
}
14 changes: 13 additions & 1 deletion src/com_tjnotifications/admin/helpers/tjnotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @subpackage com_tjnotifications
* @since 2.2
*/
class TjnotificationsHelper
class TjnotificationsHelper extends JHelperContent
{
/**
* Configure the Linkbar.
Expand Down Expand Up @@ -63,5 +63,17 @@ public static function addSubmenu($view = '')
}
}
}

JHtmlSidebar::addEntry(
JText::_('COM_TJNOTIFICATIONS_TITLE_NOTIFICATIONS'),
'index.php?option=com_tjnotifications&view=notifications',
$view == 'notifications'
);

JHtmlSidebar::addEntry(
JText::_('COM_TJNOTIFICATIONS_TITLE_NOTIFICATIONLOGS'),
'index.php?option=com_tjnotifications&view=logs',
$view == 'logs'
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,54 @@ COM_TJNOTIFICATIONS_CORE_TEMPLATE_VALUE="No"
COM_TJNOTIFICATIONS_TAGS_DESC="Enter the tag given on left in to the editor these tag names will be replaced by description given in notification template"
COM_TJNOTIFICATIONS_REPLACEMENT_TAGS="Replacement Tag"
COM_TJNOTIFICATIONS_REPLACEMENT_TAGS_DESC="Description"
; Since v1.1.0
COM_TJNOTIFICATION="Notifications"
COM_TJNOTIFICATIONS_ALLOW_SAVE_OPTION="Enable logs?"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_SUBJECT="Subject"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_KEY="Key"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_TITLE="Title"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_PROVIDER="Provider"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_FROM="From"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_TO="To"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_CC="CC"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_BCC="BCC"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_DATE="Date"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_STATE="State"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_PARAMS="Params"
COM_TJNOTIFICATIONS_TITLE_NOTIFICATIONS="Notifications"
COM_TJNOTIFICATIONS_TITLE_NOTIFICATIONLOGS="Notifications Logs"
COM_TJNOTIFICATIONS_LOGS="Logs"
COM_TJLMS_EXPORT_FILE_SUCCESS="Download complete"
COM_TJNOTIFICATIONS_VIEW_EMAIL_BODY="Email Body"
COM_TJNOTIFICATIONS_VIEW_EMAIL_POPUP_CLOSE="Close"
COM_TJNOTIFICATIONS_VIEW_PARAMS_POPUP="Show Params"
COM_TJNOTIFICATIONS_FIELD_PROVIDER_LABEL="Provider"
COM_TJNOTIFICATIONS_FIELD_PROVIDER_DESC="The provider that is defining the notifications"
COM_TJNOTIFICATIONS_PROVIDER_EMAIL="Email"
COM_TJNOTIFICATIONS_PROVIDER_SMS="SMS"
COM_TJNOTIFICATIONS_PROVIDER_PUSH="Push Message"
COM_TJNOTIFICATIONS_FIELD_KEY_LABEL="Key"
COM_TJNOTIFICATIONS_FIELD_KEY_DESC="The key that is defining the notifications"
COM_TJNOTIFICATIONS_FIELD_KEY_OPTION="-- Select Key --"
COM_TJNOTIFICATIONS_EXPORT_FILE_SUCCESS="Download Complete"
COM_TJNOTIFICATIONS_EXPORT_FILE_ERROR="<strong>Something went wrong.</strong>"
COM_TJNOTIFICATIONS_EXPORT_FILE_NOTICE="<strong>Do not click anywhere or refresh the page until CSV download successfully.</strong>"
COM_TJNOTIFICATIONS_FIELD_STATE_LABEL="State"
COM_TJNOTIFICATIONS_FIELD_STATE_OPTION="-- Select State --"
COM_TJNOTIFICATIONS_STATE_SENT="Sent"
COM_TJNOTIFICATIONS_STATE_FAILED="Failed"
COM_TJNOTIFICATIONS_LIST_LOGS="List Logs"
COM_TJNOTIFICATIONS_EMPTY_PARAMS="-"
COM_TJNOTIFICATIONS_APPLICATION_OPTION_DESC="Enable logs?"
COM_TJNOTIFICATIONS_PROVIDER_WEB="Web"
COM_TJNOTIFICATIONS_VIEW_NOTIFICATIONS_DEFAULT_FIELD_BODY="Body"
COM_TJNOTIFICATIONS_TITLE_VIEW_CONTENTS="View Content"
COM_TJNOTIFICATIONS_STATE_SENT="Sent"
COM_TJNOTIFICATIONS_STATE_FAILED="Failed"
COM_TJNOTIFICATIONS_FIELD_NOTIFICATION_BODY_LABEL="Notification Body"
COM_TJNOTIFICATIONS_LIST_LOGS_DESC="List all notifiaction logs"
; permissions
JACTION_VIEW="View"
JACTION_VIEW_COMPONENT_DESC="Allow user to view notifications logs"
JACTION_EXPORT="Export"
JACTION_EXPORT_COMPONENT_DESC="Allow user to export notifications logs data"
23 changes: 23 additions & 0 deletions src/com_tjnotifications/admin/models/forms/filter_logs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="filter">
<field name="search" type="text" label="search" hint="search" class="js-stools-search-string" />
<field name="client" label="COM_TJNOTIFICATIONS_FIELD_CLIENT_LABEL" description="COM_TJNOTIFICATIONS_FIELD_CLIENT_DESC" onchange="this.form.submit();" type="sql" class="inputbox" query="SELECT DISTINCT(client) FROM `#__tj_notification_templates`" key_field="client" value_field="client">
<option value=''>COM_TJNOTIFICATIONS_FIELD_CLIENT_OPTION</option>
</field>
<field name="provider" type="list" class="inputbox" label="COM_TJNOTIFICATIONS_FIELD_PROVIDER_LABEL" default="email" description="COM_TJNOTIFICATIONS_FIELD_PROVIDER_DESC" onchange="this.form.submit();" key_field="provider" value_field="provider">
<option value="email">COM_TJNOTIFICATIONS_PROVIDER_EMAIL</option>
<option value="sms">COM_TJNOTIFICATIONS_PROVIDER_SMS</option>
<option value="push">COM_TJNOTIFICATIONS_PROVIDER_PUSH</option>
<option value="web">COM_TJNOTIFICATIONS_PROVIDER_WEB</option>
</field>
<field name="key" label="COM_TJNOTIFICATIONS_FIELD_KEY_LABEL" description="COM_TJNOTIFICATIONS_FIELD_KEY_DESC" onchange="this.form.submit();" type="sql" class="inputbox" query="SELECT DISTINCT(notemp.key as tmpkey FROM `#__tj_notification_templates` as notemp" key_field="tmpkey" value_field="tmpkey">
<option value=''>COM_TJNOTIFICATIONS_FIELD_KEY_OPTION</option>
</field>
<field name="state" type="list" class="inputbox" label="COM_TJNOTIFICATIONS_FIELD_STATE_LABEL" description="COM_TJNOTIFICATIONS_FIELD_STATE_DESC" onchange="this.form.submit();" key_field="provider" value_field="provider">
<option value="">COM_TJNOTIFICATIONS_FIELD_STATE_OPTION</option>
<option value="1">COM_TJNOTIFICATIONS_STATE_SENT</option>
<option value="0">COM_TJNOTIFICATIONS_STATE_FAILED</option>
</field>
</fields>
</form>
62 changes: 62 additions & 0 deletions src/com_tjnotifications/admin/models/log.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
/**
* @package TJNotifications
* @subpackage com_tjnotifications
*
* @author Techjoomla <extensions@techjoomla.com>
* @copyright Copyright (C) 2009 - 2019 Techjoomla. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/

// No direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.model');

use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Table\Table;

/**
* Log model.
*
* @since 1.1.0
*/
class TjnotificationsModelLog extends AdminModel
{
/**
* Method to get the record form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return JForm|boolean A JForm object on success, false on failure
*
* @since 1.1.0
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_tjnotifications.log', 'log', array('control' => 'jform', 'load_data' => $loadData));

if (empty($form))
{
return false;
}

return $form;
}

/**
* Returns a Table object, always creating it.
*
* @param string $type The table type to instantiate
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return JTable A database object
*/
public function getTable($type = 'Log', $prefix = 'TjnotificationsTable', $config = array())
{
return Table::getInstance($type, $prefix, $config);
}
}
Loading