Skip to content

Commit

Permalink
Merge pull request #3 from opencart/3.0.x.x_Maintenance
Browse files Browse the repository at this point in the history
3.0.x.x maintenance
  • Loading branch information
condor2 authored Jul 21, 2020
2 parents 541a213 + 3cca96c commit c22ce8b
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 68 deletions.
50 changes: 25 additions & 25 deletions upload/admin/controller/mail/affiliate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@
class ControllerMailAffiliate extends Controller {
public function approve(&$route, &$args, &$output) {
$this->load->model('customer/customer');

$customer_info = $this->model_customer_customer->getCustomer($args[0]);

if ($customer_info) {
$this->load->model('setting/store');

$store_info = $this->model_setting_store->getStore($customer_info['store_id']);

if ($store_info) {
$store_name = html_entity_decode($store_info['name'], ENT_QUOTES, 'UTF-8');
$store_url = $store_info['url'] . 'index.php?route=account/login';
$store_url = $store_info['url'];
} else {
$store_name = html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8');
$store_url = HTTP_CATALOG . 'index.php?route=account/login';
$store_url = HTTP_CATALOG;
}

$this->load->model('localisation/language');

$language_info = $this->model_localisation_language->getLanguage($customer_info['language_id']);

if ($language_info) {
$language_code = $language_info['code'];
} else {
$language_code = $this->config->get('config_language');
}

$language = new Language($language_code);
$language->load($language_code);
$language->load('mail/affiliate_approve');

$subject = sprintf($language->get('text_subject'), $store_name);

$data['text_welcome'] = sprintf($language->get('text_welcome'), $store_name);
$data['login'] = $store_url . 'index.php?route=account/login';

$data['login'] = $store_url . 'index.php?route=affiliate/login';
$data['store'] = $store_name;

$mail = new Mail($this->config->get('config_mail_engine'));
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');

$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
Expand All @@ -55,10 +55,10 @@ public function approve(&$route, &$args, &$output) {
$mail->send();
}
}

public function deny(&$route, &$args, &$output) {
$this->load->model('customer/customer');

$customer_info = $this->model_customer_customer->getCustomer($args[0]);

if ($customer_info) {
Expand All @@ -68,14 +68,14 @@ public function deny(&$route, &$args, &$output) {

if ($store_info) {
$store_name = html_entity_decode($store_info['name'], ENT_QUOTES, 'UTF-8');
$store_url = $store_info['url'] . 'index.php?route=account/login';
$store_url = $store_info['url'];
} else {
$store_name = html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8');
$store_url = HTTP_CATALOG . 'index.php?route=account/login';
$store_url = HTTP_CATALOG;
}

$this->load->model('localisation/language');

$language_info = $this->model_localisation_language->getLanguage($customer_info['language_id']);

if ($language_info) {
Expand All @@ -87,14 +87,14 @@ public function deny(&$route, &$args, &$output) {
$language = new Language($language_code);
$language->load($language_code);
$language->load('mail/affiliate_deny');
$subject = sprintf($language->get('text_subject'), $store_name);

$subject = sprintf($language->get('text_subject'), $store_name);

$data['text_welcome'] = sprintf($language->get('text_welcome'), $store_name);
$data['contact'] = $store_url . 'index.php?route=information/contact';

$data['contact'] = $store_url . 'index.php?route=information/contact';
$data['store'] = $store_name;

$mail = new Mail($this->config->get('config_mail_engine'));
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
Expand All @@ -111,4 +111,4 @@ public function deny(&$route, &$args, &$output) {
$mail->send();
}
}
}
}
50 changes: 25 additions & 25 deletions upload/admin/controller/mail/customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,63 @@
class ControllerMailCustomer extends Controller {
public function approve(&$route, &$args, &$output) {
$this->load->model('customer/customer');

$customer_info = $this->model_customer_customer->getCustomer($args[0]);

if ($customer_info) {
$this->load->model('setting/store');

$store_info = $this->model_setting_store->getStore($customer_info['store_id']);

if ($store_info) {
$store_name = html_entity_decode($store_info['name'], ENT_QUOTES, 'UTF-8');
$store_url = $store_info['url'] . 'index.php?route=account/login';
$store_url = $store_info['url'];
} else {
$store_name = html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8');
$store_url = HTTP_CATALOG . 'index.php?route=account/login';
$store_url = HTTP_CATALOG;
}

$this->load->model('localisation/language');

$language_info = $this->model_localisation_language->getLanguage($customer_info['language_id']);

if ($language_info) {
$language_code = $language_info['code'];
} else {
$language_code = $this->config->get('config_language');
}

$language = new Language($language_code);
$language->load($language_code);
$language->load('mail/customer_approve');

$subject = sprintf($language->get('text_subject'), $store_name);

$data['text_welcome'] = sprintf($language->get('text_welcome'), $store_name);
$data['login'] = $store_url;

$data['login'] = $store_url . 'index.php?route=account/login';
$data['store'] = $store_name;

$mail = new Mail($this->config->get('config_mail_engine'));
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
$mail->smtp_username = $this->config->get('config_mail_smtp_username');
$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
$mail->smtp_port = $this->config->get('config_mail_smtp_port');
$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');

$mail->setTo($customer_info['email']);
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($store_name);
$mail->setSubject($subject);
$mail->setText($this->load->view('mail/customer_approve', $data));
$mail->send();
$mail->send();
}
}

public function deny(&$route, &$args, &$output) {
$this->load->model('customer/customer');

$customer_info = $this->model_customer_customer->getCustomer($args[0]);

if ($customer_info) {
Expand All @@ -68,14 +68,14 @@ public function deny(&$route, &$args, &$output) {

if ($store_info) {
$store_name = html_entity_decode($store_info['name'], ENT_QUOTES, 'UTF-8');
$store_url = $store_info['url'] . 'index.php?route=account/login';
$store_url = $store_info['url'];
} else {
$store_name = html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8');
$store_url = HTTP_CATALOG . 'index.php?route=account/login';
$store_url = HTTP_CATALOG;
}

$this->load->model('localisation/language');

$language_info = $this->model_localisation_language->getLanguage($customer_info['language_id']);

if ($language_info) {
Expand All @@ -87,12 +87,12 @@ public function deny(&$route, &$args, &$output) {
$language = new Language($language_code);
$language->load($language_code);
$language->load('mail/customer_deny');

$subject = sprintf($language->get('text_subject'), $store_name);

$data['text_welcome'] = sprintf($language->get('text_welcome'), $store_name);
$data['contact'] = $store_url . 'index.php?route=information/contact';

$data['contact'] = $store_url . 'index.php?route=information/contact';
$data['store'] = $store_name;

$mail = new Mail($this->config->get('config_mail_engine'));
Expand All @@ -111,4 +111,4 @@ public function deny(&$route, &$args, &$output) {
$mail->send();
}
}
}
}
8 changes: 4 additions & 4 deletions upload/admin/view/template/marketing/contact.twig
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ $('input[name=\'customers\']').autocomplete({
'select': function(item) {
$('input[name=\'customers\']').val('');
$('#input-customer' + item['value']).remove();
$('#customer' + item['value']).remove();
$('#input-customer').parent().find('.well').append('<div id="customer' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="customer[]" value="' + item['value'] + '" /></div>');
}
Expand Down Expand Up @@ -173,7 +173,7 @@ $('input[name=\'affiliates\']').autocomplete({
'select': function(item) {
$('input[name=\'affiliates\']').val('');
$('#input-affiliate' + item['value']).remove();
$('#affiliate' + item['value']).remove();
$('#input-affiliate').parent().find('.well').append('<div id="affiliate' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="affiliate[]" value="' + item['value'] + '" /></div>');
}
Expand Down Expand Up @@ -205,7 +205,7 @@ $('input[name=\'products\']').autocomplete({
'select': function(item) {
$('input[name=\'products\']').val('');
$('#input-product' + item['value']).remove();
$('#product' + item['value']).remove();
$('#input-product').parent().find('.well').append('<div id="product' + item['value'] + '"><i class="fa fa-minus-circle"></i> ' + item['label'] + '<input type="hidden" name="product[]" value="' + item['value'] + '" /></div>');
}
Expand Down Expand Up @@ -262,4 +262,4 @@ function send(url) {
});
}
//--></script></div>
{{ footer }}
{{ footer }}
23 changes: 9 additions & 14 deletions upload/system/modification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<modification>
<name>Modification Default</name>
<code>default</code>
<version>1.0</version>
<version>1.1</version>
<author>OpenCart Ltd</author>
<link>http://www.opencart.com</link>
<file path="system/{engine,library}/{action,loader,config,language}*.php|system/library/template/template.php">
<operation>
<operation>
<search regex="true">
<![CDATA[~(require|include)(_once)?\(([^)]+)~]]>
</search>
Expand All @@ -16,21 +16,16 @@
</operation>
</file>
<file path="system/library/template/twig.php">
<operation>
<operation>
<search>
<![CDATA[$loader = new \Twig_Loader_Filesystem(DIR_TEMPLATE);]]>
<![CDATA[if (is_file($file)) {]]>
</search>
<add position="replace">
<![CDATA[
$loader = new \Twig_Loader_Filesystem();
if (defined('DIR_CATALOG') && is_dir(DIR_MODIFICATION . 'admin/view/template/')) {
$loader->addPath(DIR_MODIFICATION . 'admin/view/template/');
} elseif (is_dir(DIR_MODIFICATION . 'catalog/view/theme/')) {
$loader->addPath(DIR_MODIFICATION . 'catalog/view/theme/');
}
$loader->addPath(DIR_TEMPLATE);]]>
<![CDATA[if (defined('DIR_CATALOG') && is_file(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig')) {
$code = file_get_contents(DIR_MODIFICATION . 'admin/view/template/' . $filename . '.twig');
} elseif (is_file(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig')) {
$code = file_get_contents(DIR_MODIFICATION . 'catalog/view/theme/' . $filename . '.twig');
} elseif (is_file($file)) {]]>
</add>
</operation>
</file>
Expand Down

0 comments on commit c22ce8b

Please sign in to comment.