This commit is contained in:
Marion Muszynski 2017-03-08 16:11:36 +01:00
commit 17c6ac82b6
10 changed files with 83 additions and 26 deletions

View File

@ -1,5 +1,5 @@
<!-- MODULE Gift Voucher -->
<link href="{$content_dir}modules/giftvoucher/giftvoucher.css" rel="stylesheet" type="text/css" />
<link href="{$base_dir_ssl}modules/giftvoucher/giftvoucher.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var giftvoucher_products = "{$GIFT_VOUCHER_PRODUCTS}";
@ -23,5 +23,5 @@
{/literal}
</script>
<script type="text/javascript" src="{$content_dir}modules/giftvoucher/giftvoucher.js?v=3"></script>
<script type="text/javascript" src="{$base_dir_ssl}modules/giftvoucher/giftvoucher.js?v=3"></script>
<!-- /MODULE Gift Voucher -->

View File

@ -23,8 +23,7 @@ if(($sponsor = Tools::getValue('sponsor')) && strlen($sponsor) > 12) {
if(Tools::getIsset('lp')) {
$lp = Tools::getValue('lp');
}
$urlHttps = 'https://'.Tools::getShopDomainSsl();
Tools::redirectLink($urlHttps.'/authentication.php?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '').(isset($lp)? '&lp='.$lp: ''));
Tools::redirectLink($link->getPageLinkSsl('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '').(isset($lp)? '&lp='.$lp: ''));
// Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: ''));
}
}

View File

@ -130,7 +130,7 @@ class GenerateBarcode {
for ($i=1; $i <= $quantity; $i++) {
$this->products[] = array(
'key' => ($id_product.'-'.$id_product_attribute),
'label' => substr(($name_combination . ' ' . $p['name']),0,28),
'label' => ($name_combination . ' ' . $p['name']),
'ref' => $ref,
'decli' => substr($name_combination,0,-1)
);
@ -294,7 +294,7 @@ class GenerateBarcode {
private function _printLabel($pdf, $label, $limit = 1, $width = 48, $height = 4, $font_size = 5) {
$pdf->SetFont('Arial', '', $font_size);
for ($i=0; $i < $limit; $i++) {
$pdf->Cell($width, $height, substr(utf8_decode($label), 0, 35), 0,0, 'C');
$pdf->Cell($width, $height, substr(utf8_decode($label), 0, 30), 0,0, 'C');
}
}

View File

@ -64,7 +64,6 @@ class Print_Ean extends Module {
global $cookie, $smarty, $currentIndex;
$product = new Product(Tools::getValue('id_product'));
$combinations = $product->getAttributeCombinaisons($cookie->id_lang);
if ($combinations) {
foreach ($combinations as $key => $combination) {
if (empty($combination['ean13'])) {
@ -73,7 +72,11 @@ class Print_Ean extends Module {
} else {
$ean_generate = $combination['ean13'];
}
$this->printEAN13($ean_generate,1,Configuration::get('LOGISTICS_QUEUE_'.(int) $cookie->id_employee));
$label = array(
'ref' => $product->reference,
'name' => $combination['attribute_name'].' - '.$product->name[2],
);
$this->printEAN13($ean_generate,$label,1,Configuration::get('LOGISTICS_QUEUE_'.(int) $cookie->id_employee));
}
} else {
if (empty($product->ean13)) {
@ -82,7 +85,11 @@ class Print_Ean extends Module {
} else {
$ean_generate = $product->ean13;
}
$this->printEAN13($ean_generate,1,Configuration::get('LOGISTICS_QUEUE_'.(int) $cookie->id_employee));
$label = array(
'ref' => $product->reference,
'name' => $product->name[2],
);
$this->printEAN13($ean_generate,$label,1,Configuration::get('LOGISTICS_QUEUE_'.(int) $cookie->id_employee));
}
Tools::redirectAdmin($currentIndex.'&id_product='.(int)$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&updateproduct'.'&tabs=7&token='.Tools::getAdminTokenLite('AdminCatalog'));
}
@ -99,7 +106,11 @@ class Print_Ean extends Module {
} else {
$ean_generate = $combination['ean13'];
}
$this->printEAN13($ean_generate,1,Configuration::get('LOGISTICS_QUEUE_'.(int) $cookie->id_employee));
$label = array(
'ref' => $product->reference,
'name' => $combination['attribute_name'].' - '.$product->name[2],
);
$this->printEAN13($ean_generate,$label,1,Configuration::get('LOGISTICS_QUEUE_'.(int) $cookie->id_employee));
}
Tools::redirectAdmin($currentIndex.'&id_product='.(int)$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&updateproduct'.'&tabs=7&token='.Tools::getAdminTokenLite('AdminCatalog'));
@ -226,7 +237,7 @@ class Print_Ean extends Module {
');
}
public function printEAN13($ean13, $quantity, $queue) {
public function printEAN13($ean13, $label, $quantity, $queue) {
if((string) $queue == '') {
return;
}
@ -282,6 +293,8 @@ class Print_Ean extends Module {
.'C0000'."\n"
.'D11'."\n"
.chr(2).'L'."\n"
.'121100000000100'.substr($label['ref'],0,30)."\n"
.'121100000000100'.substr($label['name'],0,30)."\n"
.'1'.(strlen($ean13) == 12? 'B': (strlen($ean13) == 13? 'F': 'E')).'0000000150340'.$ean13."\n"
.'Q'.sprintf('%04d', $quantity)."\n"
.'E'."\n"

View File

@ -16,7 +16,7 @@
_ts.type = 'text/javascript';
_ts.charset = 'utf-8';
_ts.async = true;
_ts.src = 'http://widgets.trustedshops.com/js/' + _tsid + '.js';
_ts.src = 'https://widgets.trustedshops.com/js/' + _tsid + '.js';
var __ts = document.getElementsByTagName('script')[0];
__ts.parentNode.insertBefore(_ts, __ts);
})();

View File

@ -17,7 +17,7 @@
_ts.type = 'text/javascript';
_ts.charset = 'utf-8';
_ts.async = true;
_ts.src = 'http://widgets.trustedshops.com/js/' + _tsid + '.js';
_ts.src = 'https://widgets.trustedshops.com/js/' + _tsid + '.js';
var __ts = document.getElementsByTagName('script')[0];
__ts.parentNode.insertBefore(_ts, __ts);
})();

View File

@ -9,7 +9,7 @@ class FrontController extends FrontControllerCore {
$useSSL = $this->ssl;
}
}
public function displayHeader()
{
self::$smarty->assign(array(
@ -18,7 +18,7 @@ class FrontController extends FrontControllerCore {
parent::displayHeader();
}
public function init() {
public function init() {
global $useSSL, $cookie, $smarty, $cart, $iso, $defaultCountry, $protocol_link, $protocol_content, $link, $css_files, $js_files, $site_version;
if (self::$initialized)
@ -35,7 +35,7 @@ class FrontController extends FrontControllerCore {
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
exit();
}
ob_start();
/* Loading default country */
@ -79,7 +79,7 @@ class FrontController extends FrontControllerCore {
global $currency;
$currency = Tools::setCurrency();
/* Cart already exists */
if ((int)$cookie->id_cart)
{
@ -168,7 +168,7 @@ class FrontController extends FrontControllerCore {
$cart->id_address_invoice = 0;
}
}
if (!$cart->nbProducts())
$cart->id_carrier = NULL;
@ -204,7 +204,8 @@ class FrontController extends FrontControllerCore {
$navigationPipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>');
$smarty->assign('navigationPipe', $navigationPipe);
$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR Tools::usingSecureMode()) ? 'https://' : 'http://';
//$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR Tools::usingSecureMode()) ? 'https://' : 'http://';
$protocol_link = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')?'https://':'http://';
$useSSL = ((isset($this->ssl) AND $this->ssl AND Configuration::get('PS_SSL_ENABLED')) OR Tools::usingSecureMode()) ? true : false;
$protocol_content = ($useSSL) ? 'https://' : 'http://';
@ -280,9 +281,11 @@ class FrontController extends FrontControllerCore {
);
foreach ($assignArray as $assignKey => $assignValue)
if (substr($assignValue, 0, 1) == '/' OR $protocol_content == 'https://')
if (substr($assignValue, 0, 1) == '/' OR $protocol_content == 'https://') {
$smarty->assign($assignKey, $protocol_content.Tools::getMediaServer($assignValue).$assignValue);
else
} else if (substr($assignValue, 0, 1) == '/' OR $protocol_link == 'https://') {
$smarty->assign($assignKey, $protocol_link.Tools::getMediaServer($assignValue).$assignValue);
} else
$smarty->assign($assignKey, $assignValue);
// setting properties from global var
@ -305,7 +308,7 @@ class FrontController extends FrontControllerCore {
$this->iso = $iso;
$this->setMedia();
}
protected function canonicalRedirection() {
global $link, $cookie;
@ -403,7 +406,7 @@ class FrontController extends FrontControllerCore {
'module-advsendtoafriend-sendtoafriend-form', 'featured',
'list-tag-sales', */
);
$countCols = count(array_keys($displayLeft + $displayRight, $page_name));
$addclass = '';

View File

@ -25,7 +25,47 @@ class Link extends LinkCore
private function moduleGuideDir($ssl)
{
$base = (($ssl AND Configuration::get('PS_SSL_ENABLED')) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true));
return $base._MODULE_DIR_.'/'.Module::getModuleNameFromClass('AdminGuidePosts').'/';
}
public function getPageLinkSsl($filename, $ssl = false, $id_lang = NULL)
{
global $cookie;
if ($id_lang == NULL)
$id_lang = (int)($cookie->id_lang);
if (array_key_exists($filename.'_'.$id_lang, self::$cache['page']) AND !empty(self::$cache['page'][$filename.'_'.$id_lang]))
$uri_path = self::$cache['page'][$filename.'_'.$id_lang];
else
{
if ($this->allow == 1)
{
$url_rewrite = '';
if ($filename != 'index.php')
{
$pagename = substr($filename, 0, -4);
$url_rewrite = Db::getInstance()->getValue('
SELECT url_rewrite
FROM `'._DB_PREFIX_.'meta` m
LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.id_meta = ml.id_meta)
WHERE id_lang = '.(int)($id_lang).' AND `page` = \''.pSQL($pagename).'\'');
$uri_path = $this->getLangLink((int)$id_lang).($url_rewrite ? $url_rewrite : $filename);
}
else
$uri_path = $this->getLangLink((int)$id_lang);
}
else
{
$uri_path = '';
if ($filename != 'index.php')
$uri_path = $filename;
}
self::$cache['page'][$filename.'_'.$id_lang] = $uri_path;
}
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')?'https://':'http://';
return $protocol.Tools::getShopDomainSsl().__PS_BASE_URI__.ltrim($uri_path, '/');
}
}

View File

@ -43,9 +43,10 @@
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
<link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
{if isset($page_name) && $page_name == 'authentication'}
<link rel="canonical" href="{$link->getPageLink('authentication.php', TRUE)}" />
<link rel="canonical" href="{$link->getPageLinkSsl('authentication.php', TRUE)}" />
{/if}
<script type="text/javascript">
var baseDirSsl = '{$base_dir_ssl}';
var baseDir = '{$content_dir}';
var static_token = '{$static_token}';
var token = '{$token}';

View File

@ -49,9 +49,10 @@
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
<link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
{if isset($page_name) && $page_name == 'authentication'}
<link rel="canonical" href="{$link->getPageLink('authentication.php', TRUE)}" />
<link rel="canonical" href="{$link->getPageLinkSsl('authentication.php', TRUE)}" />
{/if}
<script type="text/javascript">
var baseDirSsl = '{$base_dir_ssl}';
var baseDir = '{$content_dir}';
var static_token = '{$static_token}';
var token = '{$token}';