Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/joomla4/ |
| [Home] [System Details] [Kill Me] |
email_history.php000064400000005057151157024320010134 0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.1
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class plgHikashopEmail_history extends JPlugin {
public function __construct(&$subject, $config) {
parent::__construct($subject, $config);
}
private function init() {
if(class_exists('hikashopPlg_email_historyClass'))
return true;
$file = dirname(__FILE__) . DS . 'email_history_class.php';
if(file_exists($file))
include_once $file;
return class_exists('hikashopPlg_email_historyClass');
}
public function onBeforeMailSend(&$mail, &$mailer) {
if(!$this->init())
return false;
$emailHistoryClass = new hikashopPlg_email_historyClass();
$emailHistoryClass->beforeMailSend($mail, $mailer);
}
public function onHikashopBeforeCheckDB(&$createTable,
&$custom_fields, &$structure, &$helper) {
if(!$this->init())
return;
$emailHistoryClass = new hikashopPlg_email_historyClass();
$emailHistoryClass->beforeCheckDB($createTable, $custom_fields,
$structure, $helper);
}
public function onHikashopPluginController($ctrl) {
if($ctrl != 'email_history')
return;
$app = JFactory::getApplication();
if(!hikashop_isClient('administrator'))
return;
if(!$this->init())
return;
return array(
'type' => 'hikashop',
'name' => 'email_history',
'prefix' => 'ctrl'
);
}
public function onHikashopBeforeDisplayView(&$viewObj) {
$app = JFactory::getApplication();
if(!hikashop_isClient('administrator'))
return;
$viewName = $viewObj->getName();
if(!in_array($viewName, array('menu', 'config')))
return;
switch($viewName) {
case 'menu':
return $this->hikashopProcessMenu($viewObj);
case 'config':
if($viewObj->getLayout() == 'config')
return $this->hikashopProcessConfig($viewObj);
return;
}
}
private function hikashopProcessConfig(&$view) {
if(empty($view->aclcats))
return;
$view->aclcats['email_log'] =
array('view','manage','delete');
$view->acltrans['email_log'] = 'email_history';
}
private function hikashopProcessMenu(&$view) {
if(empty($view->menus))
return;
$view->menus['customers']['children'][] = array(
'name' => JText::_('EMAIL_HISTORY'),
'check' => 'ctrl=email_history',
'icon' => 'fa fa-envelope',
'url' => hikashop_completeLink('email_history'),
'acl' => 'email_log',
);
}
}
email_history.xml000064400000002420151157024320010134 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<extension type="plugin" version="2.5"
method="upgrade" group="hikashop">
<name>Hikashop Email History Plugin</name>
<creationDate>12 février 2021</creationDate>
<version>4.4.1</version>
<author>Hikashop</author>
<authorEmail>dev@hikashop.com</authorEmail>
<authorUrl>http://www.hikashop.com</authorUrl>
<copyright>(C) 2010-2021 HIKARI SOFTWARE. All rights
reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html
GNU/GPL</license>
<description>This plugin enables you to check your mail's
history</description>
<files>
<filename
plugin="email_history">email_history.php</filename>
<filename>email_history_ctrl.php</filename>
<filename>email_history_class.php</filename>
<folder>views</folder>
</files>
<params addpath="/components/com_hikashop/params">
<param name="number_of_days" type="text"
size="50" default="" label="NUMBER_OF_DAYS"
description="EMAIL_HISTORY_NUMBER_OF_DAYS" />
</params>
<config>
<fields name="params"
addfieldpath="/components/com_hikashop/fields">
<fieldset name="basic">
<field name="number_of_days" type="text"
label="NUMBER_OF_DAYS" size="50" default=""
description="EMAIL_HISTORY_NUMBER_OF_DAYS" />
</fieldset>
</fields>
</config>
</extension>
email_history_class.php000064400000023754151157024320011325
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.1
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class hikashopPlg_email_historyClass extends hikashopClass {
public $tables = array('email_log');
public $pkeys = array('email_log_id');
protected $db = null;
private $dbStructure = array(
'hikashop_email_log' => array(
'fields' => array(
'email_log_id' => 'int(10) unsigned NOT NULL
AUTO_INCREMENT',
'email_log_sender_email' => 'varchar(255) NOT NULL
DEFAULT \'\'',
'email_log_sender_name' => 'varchar(255) NOT NULL
DEFAULT \'\'',
'email_log_recipient_email' => 'varchar(255) NOT NULL
DEFAULT \'\'',
'email_log_recipient_name' => 'varchar(255) NOT NULL
DEFAULT \'\'',
'email_log_reply_email' => 'varchar(255) NOT NULL
DEFAULT \'\'',
'email_log_reply_name' => 'varchar(255) NOT NULL
DEFAULT \'\'',
'email_log_cc_email' => 'varchar(255) NOT NULL
DEFAULT \'\'',
'email_log_bcc_email' => 'varchar(255) NOT NULL
DEFAULT \'\'',
'email_log_subject' => 'text NOT NULL',
'email_log_altbody' => 'text NOT NULL',
'email_log_body' => 'text NOT NULL',
'email_log_name' => 'varchar(255) NOT NULL DEFAULT
\'\'',
'email_log_ref_id' => 'varchar(255) NOT NULL DEFAULT
\'\'',
'email_log_params' => 'text NOT NULL',
'email_log_date' => 'int(10) NOT NULL',
'email_log_published' => 'tinyint(3) unsigned NOT
NULL DEFAULT \'1\'',
),
'primary' => array('email_log_id')
),
);
public function __construct( $config = array() ) {
parent::__construct($config);
$this->db = JFactory::getDBO();
}
public function initDB() {
try {
$current =
$this->db->getTableColumns(hikashop_table('email_log'));
} catch(Exception $e) {
$current = null;
}
if(!empty($current))
return true;
$query = $this->getDBCreateQuery('hikashop_email_log');
$this->db->setQuery($query);
$this->db->execute();
return true;
}
public function get($element, $default = null) {
$ret = parent::get($element);
if(!empty($ret->email_log_params))
$ret->email_log_params = json_decode($ret->email_log_params);
return $ret;
}
public function beforeCheckDb(&$createTable, &$custom_fields,
&$structure, &$helper) {
$createTable['#__hikashop_email_log'] =
$this->getDBCreateQuery('hikashop_email_log');
if(!isset($structure['']))
$structure['#__hikashop_email_log'] =
$this->dbStructure['hikashop_email_log']['fields'];
}
private function getDBCreateQuery($name) {
if(!isset($this->dbStructure[$name]))
return false;
$data = array();
foreach($this->dbStructure[$name]['fields'] as $k => $v)
{
$data[] = '`'.$k.'` ' . $v;
}
if(isset($this->dbStructure[$name]['primary'])) {
if(!is_array($this->dbStructure[$name]['primary']))
$this->dbStructure[$name]['primary'] =
array($this->dbStructure[$name]['primary']);
$data[] = 'PRIMARY KEY (`'. implode('`, `',
$this->dbStructure[$name]['primary']) . '`)';
} else {
$k =
reset(array_keys($this->dbStructure[$name]['fields']));
$data[] = 'PRIMARY KEY (`'. $k . '`)';
}
return 'CREATE TABLE IF NOT EXISTS `#__'.$name.'` ('
. "\r\n" . implode(",\r\n", $data) . ')
ENGINE=MyISAM;';
}
public function resend($email_log_id) {
$mailClass = hikashop_get('class.mail');
$email_log = $this->get($email_log_id);
if(empty($email_log))
return false;
$email = new stdClass();
$email->published = 1;
$email->html = 1;
$email->mail_name = $email_log->email_log_name;
$email->from_email = $email_log->email_log_sender_email;
$email->from_name = $email_log->email_log_sender_name;
$email->dst_email = $email_log->email_log_recipient_email;
$email->dst_name = $email_log->email_log_recipient_name;
$email->reply_email = $email_log->email_log_reply_email;
$email->reply_name = $email_log->email_log_reply_name;
$email->cc_email = $email_log->email_log_cc_email;
$email->bcc_email = $email_log->email_log_bcc_email;
$email->subject = $email_log->email_log_subject;
$email->body = $email_log->email_log_body;
$email->full_body = true;
$email->altbody = $email_log->email_log_altbody;
switch($email->mail_name) {
case 'user_account_admin_notification':
case 'user_account':
$userClass = hikashop_get('class.user');
$email->data = $userClass->get($email_log->email_log_ref_id);
$email->data->user_data = $email->data;
break;
case 'order_cancel':
case 'order_notification':
case 'order_admin_notification':
case 'order_creation_notification':
case 'order_status_notification':
case 'payment_notification':
$orderClass = hikashop_get('class.order');
$email->data =
$orderClass->get($email_log->email_log_ref_id);
break;
case 'contact_request':
$productClass = hikashop_get('class.product');
$email->data = new stdClass();
$email->data->product =
$productClass->get($email_log->email_log_ref_id);
break;
case 'new_comment':
$productClass = hikashop_get('class.product');
$email->data = new stdClass();
$email->data->type =
$productClass->get($email_log->email_log_ref_id);
break;
default:
break;
}
JPluginHelper::importPlugin('hikashop');
$app = JFactory::getApplication();
$app->triggerEvent('onBeforeEmail_logResend', array(
&$email, &$email_log ));
$result = $mailClass->sendMail($email);
if(!$result || !empty($result->message)){
if(!empty($result->message) &&
is_string($mailClass->message)){
$app = JFactory::getApplication();
$app->enqueueMessage($mailClass->message, 'error');
}
return false;
}
return true;
}
public function save(&$email_log) {
if(!empty($email_log->email_log_params) &&
!is_string($email_log->email_log_params))
$email_log->email_log_params =
json_encode($email_log->email_log_params);
$do = true;
$app = JFactory::getApplication();
if(!empty($new)) {
$app->triggerEvent('onBeforeEmail_logCreate', array(
&$email_log, &$do ));
} else {
$app->triggerEvent('onBeforeEmail_logUpdate', array(
&$email_log, &$do ));
}
if(!$do)
return false;
$status = parent::save($email_log);
if(!$status)
return $status;
if(!empty($new)) {
$app->triggerEvent('onAfterEmail_logCreate', array(
&$email_log ));
} else {
$app->triggerEvent('onAfterEmail_logUpdate', array(
&$email_log ));
}
return $status;
}
public function beforeMailSend(&$mail, &$mailer) {
if(!$this->initDB())
return false;
$data = new stdClass();
$data->email_log_sender_email = strip_tags($mail->from_email);
if(!empty($mail->from_name))
$data->email_log_sender_name = strip_tags($mail->from_name);
if(empty($mail->dst_email))
$data->email_log_recipient_email = '';
elseif(is_array($mail->dst_email))
$data->email_log_recipient_email = strip_tags(implode(',',
$mail->dst_email));
else
$data->email_log_recipient_email = strip_tags($mail->dst_email);
if(!empty($mail->dst_name)) {
if(is_array($mail->dst_name))
$data->email_log_recipient_name = strip_tags(implode(',',
$mail->dst_name));
else
$data->email_log_recipient_name = strip_tags($mail->dst_name);
}
if(!empty($mail->reply_email))
$data->email_log_reply_email = strip_tags($mail->reply_email);
if(!empty($mail->reply_name))
$data->email_log_reply_name = strip_tags($mail->reply_name);
if(!empty($mail->cc_email)) {
if(is_array($mail->cc_email))
$data->email_log_cc_email = strip_tags(implode(',',
$mail->cc_email));
else
$data->email_log_cc_email = strip_tags($mail->cc_email);
}
if(!empty($mail->bcc_email)) {
if(is_array($mail->bcc_email))
$data->email_log_bcc_email = strip_tags(implode(',',
$mail->bcc_email));
else
$data->email_log_bcc_email = strip_tags($mail->bcc_email);
}
if(!empty($mail->subject))
$data->email_log_subject = strip_tags($mail->subject);
if(!empty($mail->altbody))
$data->email_log_altbody = strip_tags($mail->altbody);
if(!empty($mail->body))
$data->email_log_body = $mail->body;
if(!isset($mail->email_log_published)) {
$config =& hikashop_config();
$data->email_log_published =
$config->get($mail->mail_name.'.email_log_published', 1);
} else
$data->email_log_published = $mail->email_log_published;
$data->email_log_date = time();
$data->email_log_name = $mail->mail_name;
if(!empty($mail->name_info) && $mail->name_info !=
$mail->mail_name)
$data->email_log_name = $mail->name_info;
if(!empty($mail->attachments)) {
if(!isset($data->email_log_params))
$data->email_log_params = array();
$data->email_log_params['attachments'] =
$mail->attachments;
}
switch($mail->mail_name) {
case 'user_account_admin_notification':
case 'user_account':
$data->email_log_ref_id = $mail->data->user_data->user_id;
break;
case 'order_cancel':
case 'order_notification':
case 'order_admin_notification':
case 'order_creation_notification':
case 'order_status_notification':
case 'payment_notification':
$data->email_log_ref_id = $mail->data->order_id;
break;
case 'contact_request':
$data->email_log_ref_id =
@$mail->data->product->product_id;
break;
case 'new_comment':
$data->email_log_ref_id = $mail->data->type->product_id;
break;
default:
break;
}
$this->save($data);
$pluginsClass = hikashop_get('class.plugins');
$plugin = $pluginsClass->getByName('hikashop',
'email_history');
if(!empty($plugin->params['number_of_days']))
$this->clearEntries((int)$plugin->params['number_of_days']);
}
protected function clearEntries($days = 0) {
if(empty($days) || (int)$days <= 0)
return;
$query = 'DELETE FROM
'.hikashop_table('email_log').' '.
' WHERE email_log_date < '.(time() - ((3600 * 24) *
(int)$days));
$this->db->setQuery($query);
$this->db->execute();
}
}
email_history_ctrl.php000064400000003132151157024320011150
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.1
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
include_once dirname(__FILE__) . DS . 'email_history_class.php';
class email_historyController extends hikashopController {
public $display =
array('listing','show','cancel','');
public $modify_views = array('edit');
public $add = array();
public $modify = array('resend');
public $delete = array('delete','remove');
public $pluginCtrl = array('hikashop',
'email_history');
public $type = 'plg_email_history';
public function __construct($config = array(), $skip = false) {
parent::__construct($config, $skip);
if(!$skip)
$this->registerDefaultTask('listing');
}
protected function getACLName($task) {
return 'email_log';
}
public function listing() {
hikaInput::get()->set('layout', 'listing');
return $this->display();
}
public function resend() {
$cid = hikashop_getCID('email_log_id');
if(!$cid) {
hikaInput::get()->set('layout', 'listing');
} else {
$emailHistoryClass = new hikashopPlg_email_historyClass();
$app = JFactory::getApplication();
if($emailHistoryClass->resend($cid))
$app->enqueueMessage(JText::_('THE_EMAIL_HAS_BEEN_RESENT'),
'notice');
else
$app->enqueueMessage(JText::_('AN_ERROR_HAPPENED_DURING_THE_RESENDING_OF_THE_EMAIL'),
'error');
hikaInput::get()->set('layout', 'form');
}
return $this->display();
}
}
index.html000064400000000054151157024320006540 0ustar00<html><body
bgcolor="#FFFFFF"></body></html>views/email_history/index.html000064400000000054151157024320012545
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>views/email_history/tmpl/form.php000064400000015131151157024320013202
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.1
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div class="iframedoc"
id="iframedoc"></div>
<form action="<?php echo
hikashop_completeLink('email_history'); ?>"
method="post" name="adminForm" id="adminForm"
>
<div id="page-email_log" class="hk-row-fluid
hikashop_backend_tile_edition">
<div class="hkc-md-6">
<div class="hikashop_tile_block">
<div>
<div class="hikashop_tile_title"><?php
echo JText::_('MAIN_INFORMATION');
?></div>
<table class="admintable table">
<tr>
<td class="key">
<?php echo JText::_( 'FROM_NAME' ); ?>
</td>
<td>
<?php echo
$this->escape(@$this->element->email_log_sender_name); ?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'FROM_ADDRESS' ); ?>
</td>
<td>
<?php echo
$this->escape(@$this->element->email_log_sender_email); ?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'TO_NAME' ); ?>
</td>
<td>
<?php echo
$this->escape(@$this->element->email_log_recipient_name); ?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'TO_ADDRESS' ); ?>
</td>
<td>
<?php echo
$this->escape(@$this->element->email_log_recipient_email); ?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'REPLYTO_NAME' ); ?>
</td>
<td>
<?php echo
$this->escape(@$this->element->email_log_reply_name); ?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'REPLYTO_ADDRESS' ); ?>
</td>
<td>
<?php echo
$this->escape(@$this->element->email_log_reply_email); ?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'BCC' ); ?>
</td>
<td>
<?php echo
$this->escape(@$this->element->email_log_bcc_email); ?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'CC' ); ?>
</td>
<td>
<?php echo
$this->escape(@$this->element->email_log_cc_email); ?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'EMAIL_SUBJECT' ); ?>
</td>
<td>
<?php echo
$this->escape($this->element->email_log_subject); ?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'DATE' ); ?>
</td>
<td>
<?php echo
hikashop_getDate($this->element->email_log_date);?>
</td>
</tr>
</table>
</div></div>
<div class="hikashop_tile_block">
<div>
<div class="hikashop_tile_title"><?php
echo JText::_('ORDER_ADD_INFO');
?></div>
<table class="admintable table">
<tr>
<td class="key">
<?php echo JText::_( 'HIKA_EMAIL' ); ?>
</td>
<td>
<?php echo JText::_(@$this->element->email_log_name);
?>
</td>
</tr>
<?php if(!empty($this->element->email_log_ref_id)){ ?>
<tr>
<td class="key">
<?php
if(in_array($this->element->email_log_name,$this->email_order_id)
)
echo JText::_( 'ORDER_NUMBER' );
if(in_array($this->element->email_log_name,$this->email_product_id)
)
echo JText::_( 'PRODUCT_NAME' );
if(in_array($this->element->email_log_name,$this->email_user_id)
)
echo JText::_( 'CLIENT' );
?>
</td>
<td>
<?php
if(in_array($this->element->email_log_name,$this->email_order_id)
){ ?>
<a href="<?php echo
hikashop_completeLink('order&task=edit&cid[]='.$this->element->email_log_ref_id.'&cancel_redirect='.urlencode(base64_encode(hikashop_completeLink('email_log&task=edit&cid[]='.$this->element->email_log_id))));
?>"><?php echo @$this->email_order_number;
?></a>
<?php } ?>
<?php
if(in_array($this->element->email_log_name,$this->email_product_id)
){ ?>
<a href="<?php echo
hikashop_completeLink('product&task=edit&cid[]='.$this->element->email_log_ref_id.'&cancel_redirect='.urlencode(base64_encode(hikashop_completeLink('email_log&task=edit&cid[]='.$this->element->email_log_id))));
?>"><?php echo @$this->email_product_name;
?></a>
<?php } ?>
<?php
if(in_array($this->element->email_log_name,$this->email_user_id)
){ ?>
<a href="<?php echo
hikashop_completeLink('user&task=edit&cid[]='.$this->element->email_log_ref_id.'&cancel_redirect='.urlencode(hikashop_completeLink('email_log&task=edit&cid[]='.$this->element->email_log_id)));
?>"><?php echo $this->escape(@$this->email_user_name);
?></a>
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
</div></div>
<?php if(!empty($data->email_log_params['attachments'])) {
?>
<div class="hikashop_tile_block">
<div>
<div class="hikashop_tile_title"><?php
echo JText::_('ATTACHMENTS');
?></div>
<table class="adminlist table table-striped
table-hover">
<thead>
<tr>
<th class="title titlenum">
<?php echo JText::_( 'HIKA_NUM' );?>
</th>
<th class="title">
<?php echo JText::_( 'HIKA_NAME' );?>
</th>
<th class="title">
<?php echo JText::_( 'HIKA_PATH' );?>
</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$k = 0;
foreach($data->email_log_params['attachments'] as
$attach) {
?>
<tr class="row<?php echo $k; ?>">
<td class="hk_center">
<?php echo $i; ?>
</td>
<td>
<a href="<?php echo $attach->url;
?>"><?php echo $attach->name; ?></a>
</td>
<td>
<?php echo $attach->filename; ?>
</td>
</tr>
<?php
$k = 1-$k;
$i++;
}
?>
</tbody>
</table>
</div></div>
<?php } ?>
</div>
<div class="hkc-md-6">
<?php echo $this->loadTemplate('param'); ?>
</div>
</div>
<div style="clear:both"
class="clr"></div>
<input type="hidden" name="option"
value="<?php echo HIKASHOP_COMPONENT; ?>" />
<input type="hidden" name="cid"
value="<?php echo $this->element->email_log_id; ?>"
/>
<input type="hidden" name="task" value=""
/>
<input type="hidden" name="ctrl"
value="email_history" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
views/email_history/tmpl/form_param.php000064400000002375151157024320014370
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.1
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div id="hikashop_email_preview">
<ul class="hika_tabs"
rel="tabs:hikashop_email_history_tab_">
<li class="active"><a href="#html_version"
rel="tab:html_version" onclick="return
window.hikashop.switchTab(this);"><?php echo
JText::_('HTML_VERSION'); ?></a></li>
<li><a href="#text_version"
rel="tab:text_version" onclick="return
window.hikashop.switchTab(this);"><?php echo
JText::_('TEXT_VERSION'); ?></a></li>
</ul>
<div id="hikashop_email_history_tab_html_version">
<?php
if (!empty($this->element->email_log_body)) {
$pattern = '/(src=")(?!https?:\/\/)/i';
$replacement = '$1';
$this->element->email_log_body =
preg_replace($pattern,$replacement.HIKASHOP_LIVE,@$this->element->email_log_body);
echo @$this->element->email_log_body;
}
?>
</div>
<div id="hikashop_email_history_tab_text_version"
style="display:none;background-color:white;">
<?php
if (!empty($this->element->email_log_altbody))
echo nl2br(@$this->element->email_log_altbody);
?>
</div>
</div>
views/email_history/tmpl/index.html000064400000000054151157024320013521
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>views/email_history/tmpl/listing.php000064400000010324151157024320013707
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.1
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div class="iframedoc"
id="iframedoc"></div>
<form action="<?php echo
hikashop_completeLink('email_history'); ?>"
method="post" name="adminForm"
id="adminForm">
<div class="hk-row-fluid">
<div class="hkc-md-5 hika_j4_search"><?php
echo $this->loadHkLayout('search', array());
?></div>
<div id="hikashop_listing_filters_id" class="hkc-md-7
hikashop_listing_filters" style="text-align: right;">
<?php echo
$this->filter_type->display('filter_type',$this->pageInfo->filter->filter_type)
?>
</div>
</div>
<table id="hikashop_email_history_listing"
class="adminlist table table-striped table-hover"
cellpadding="1">
<thead>
<tr>
<th class="title titlenum">
<?php echo JText::_( 'HIKA_NUM' );?>
</th>
<th class="title titlebox">
<input type="checkbox" name="toggle"
value="" onclick="hikashop.checkAll(this);" />
</th>
<th class="title">
<?php echo JHTML::_('grid.sort',
JText::_('TO_ADDRESS'), 'a.email_log_recipient_email',
$this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value
); ?>
</th>
<th class="title">
<?php echo JHTML::_('grid.sort',
JText::_('REPLYTO_ADDRESS'), 'a.email_log_reply_email',
$this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value
); ?>
</th>
<th class="title">
<?php echo JHTML::_('grid.sort',
JText::_('EMAIL_SUBJECT'), 'a.email_log_subject',
$this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value
); ?>
</th>
<th class="title">
<?php echo JHTML::_('grid.sort',
JText::_('DATE'), 'a.email_log_date',
$this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value
); ?>
</th>
<th class="title">
<?php echo JHTML::_('grid.sort',
JText::_('HIKA_EMAIL'), 'a.email_log_name',
$this->pageInfo->filter->order->dir,$this->pageInfo->filter->order->value
); ?>
</th>
<th class="title">
<?php echo JHTML::_('grid.sort',
JText::_('ID'), 'a.email_log_id',
$this->pageInfo->filter->order->dir,
$this->pageInfo->filter->order->value ); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="8">
<?php echo $this->pagination->getListFooter(); ?>
<?php echo $this->pagination->getResultsCounter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
$i = 0;
foreach($this->rows as $row){
?>
<tr class="row<?php echo $k; ?>">
<td class="hk_center">
<?php echo $this->pagination->getRowOffset($i); ?>
</td>
<td class="hk_center">
<?php echo JHTML::_('grid.id', $i, $row->email_log_id
); ?>
</td>
<td>
<?php echo $row->email_log_recipient_email; ?>
</td>
<td>
<?php echo $row->email_log_reply_email; ?>
</td>
<td>
<?php if($this->manage){ ?>
<a href="<?php echo
hikashop_completeLink('email_history&task=edit&cid[]='.(int)$row->email_log_id);
?>">
<?php } ?>
<?php
if(!empty($row->email_log_subject))
echo $row->email_log_subject;
else
echo
'<em>'.JText::_('HIKA_NONE').'</em>';
?>
<?php if($this->manage){ ?>
</a>
<?php } ?>
</td>
<td>
<?php echo hikashop_getDate($row->email_log_date); ?>
</td>
<td>
<?php echo
str_replace('%s','',JText::_(strip_tags($row->email_log_name)));
?>
</td>
<td width="1%" class="hk_center">
<?php echo (int)$row->email_log_id; ?>
</td>
</tr>
<?php
$k = 1-$k;
$i++;
}
?>
</tbody>
</table>
<input type="hidden" name="option"
value="<?php echo HIKASHOP_COMPONENT; ?>" />
<input type="hidden" name="task" value=""
/>
<input type="hidden" name="ctrl"
value="<?php echo hikaInput::get()->getCmd('ctrl');
?>" />
<input type="hidden" name="boxchecked"
value="0" />
<input type="hidden" name="filter_order"
value="<?php echo
$this->pageInfo->filter->order->value; ?>" />
<input type="hidden" name="filter_order_Dir"
value="<?php echo $this->pageInfo->filter->order->dir;
?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
views/email_history/view.html.php000064400000013477151157024320013213
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.1
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
class Email_historyViewEmail_history extends hikashopView {
var $ctrl = 'email_history';
var $nameListing = 'EMAIL_LOG';
var $nameForm = 'EMAIL_LOG';
var $icon = 'envelope';
function display($tpl = null) {
$this->paramBase =
HIKASHOP_COMPONENT.'.'.$this->getName();
$function = $this->getLayout();
if(method_exists($this,$function))
$this->$function();
parent::display($tpl);
}
function listing() {
$app = JFactory::getApplication();
$database = JFactory::getDBO();
$config =& hikashop_config();
include_once dirname(dirname(dirname(__FILE__))) . DS .
'email_history_class.php';
$emailHistoryClass = new hikashopPlg_email_historyClass();
$emailHistoryClass->initDB();
$pageInfo = $this->getPageInfo('a.email_log_id',
'DESC');
$pageInfo->filter->filter_type = $app->getUserStateFromRequest(
$this->paramBase.".filter_type",'filter_type','','string');
$filters = array();
$order = '';
$searchMap =
array('a.email_log_recipient_email','a.email_log_id');
if(!empty($pageInfo->filter->filter_type)){
switch($pageInfo->filter->filter_type){
case 'all':
break;
default:
$filters[] = 'a.email_log_name =
'.$database->Quote($pageInfo->filter->filter_type);
break;
}
}
$filters[] = 'a.email_log_published = 1';
$this->processFilters($filters, $order, $searchMap);
$query = ' FROM '.hikashop_table('email_log').'
AS a'.$filters.$order;
$this->getPageInfoTotal($query, '*');
$database->setQuery('SELECT
a.*'.$query,$pageInfo->limit->start,$pageInfo->limit->value);
$rows = $database->loadObjectList();
$fields = array('email_log_recipient_email',
'email_log_reply_email', 'email_log_subject');
foreach($rows as &$row) {
foreach($fields as $field) {
if(isset($row->$field))
$row->$field = $this->escape($row->$field);
}
}
unset($row);
if(!empty($pageInfo->search)){
$rows = hikashop_search($pageInfo->search, $rows,
'email_log_id');
}
$emailType = hikashop_get('type.email_log');
$this->assignRef('filter_type',$emailType);
$this->assignRef('rows',$rows);
$this->assignRef('pageInfo',$pageInfo);
$this->getPagination();
$this->getOrdering('a.email_log_date', true);
$this->assignRef('order',$order);
hikashop_setTitle(JText::_($this->nameListing),$this->icon,$this->ctrl);
$manage =
hikashop_isAllowed($config->get('acl_email_log_manage','all'));
$this->assignRef('manage',$manage);
$this->toolbar = array(
array('name' =>
'editList','display'=>$manage),
array('name' =>
'deleteList','display'=>hikashop_isAllowed($config->get('acl_email_log_delete','all'))),
'|',
array('name' => 'pophelp', 'target'
=> $this->ctrl.'-listing'),
'dashboard'
);
}
function form() {
$tabs = hikashop_get('helper.tabs');
$email_log_id = hikashop_getCID('email_log_id');
$config =& hikashop_config();
$email_logClass = hikashop_get('class.plg_email_history');
if(!empty($email_log_id)) {
$element = $email_logClass->get($email_log_id,true);
$task='edit';
}
hikashop_setTitle(JText::_($this->nameForm),$this->icon,$this->ctrl.'&task='.$task.'&email_log_id='.$email_log_id);
$manage =
hikashop_isAllowed($config->get('acl_email_log_manage','all'));
$this->toolbar = array(
array('name' => 'custom', 'icon' =>
'mail', 'alt' => JText::_('RESEND'),
'task' => 'resend', 'check' => false,
'display' => $manage),
'cancel',
'|',
array('name' => 'pophelp', 'target'
=> $this->ctrl.'-listing')
);
$email_order_id = array(
'order_admin_notification',
'order_creation_notification',
'order_status_notification',
'order_notification',
'payment_notification',
'order_cancel'
);
$email_product_id = array(
'contact_request',
'new_comment',
);
$email_user_id = array(
'user_account',
'user_account_admin_notification',
);
if(in_array($element->email_log_name,$email_product_id)){
$productClass = hikashop_get('class.product');
$productClass->getProducts($element->email_log_ref_id);
if(isset($productClass->products[$element->email_log_ref_id]))
$fullProduct =
$productClass->products[$element->email_log_ref_id];
elseif(isset($productClass->all_products[$element->email_log_ref_id])
&&
isset($productClass->all_products[$element->email_log_ref_id]->product_parent_id)){
$productClass->getProducts($productClass->all_products[$element->email_log_ref_id]->product_parent_id);
$fullProduct =
$productClass->products[$productClass->all_products[$element->email_log_ref_id]->product_parent_id];
}
if(isset($fullProduct->product_name) &&
!empty($fullProduct->product_name))
$this->assignRef('email_product_name',$fullProduct->product_name);
}
if(in_array($element->email_log_name,$email_order_id)){
$orderClass = hikashop_get('class.order');
$fullOrder = $orderClass->get($element->email_log_ref_id);
if(isset($fullOrder->order_number) &&
!empty($fullOrder->order_number))
$this->assignRef('email_order_number',$fullOrder->order_number);
}
if(in_array($element->email_log_name,$email_user_id)){
$userClass = hikashop_get('class.user');
$fullUser = $userClass->get($element->email_log_ref_id);
if(isset($fullUser->name) && !empty($fullUser->name))
$this->assignRef('email_user_name',$fullUser->name);
}
$this->assignRef('email_order_id',$email_order_id);
$this->assignRef('email_product_id',$email_product_id);
$this->assignRef('email_user_id',$email_user_id);
$this->assignRef('tabs',$tabs);
$this->assignRef('element',$element);
}
}
views/index.html000064400000000054151157024320007675
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>