Merge remote-tracking branch 'origin/ticket/r15782-stats' into develop

This commit is contained in:
Michael RICOIS 2018-02-06 15:21:35 +01:00
commit b59f0e70b1
3 changed files with 7 additions and 17 deletions

View File

@ -237,7 +237,7 @@ class AdminStatsLogistic extends AdminTab
$fname = 'export-remb-'.$this->date_export_begin.'-'.$this->date_export_end.'.csv'; $fname = 'export-remb-'.$this->date_export_begin.'-'.$this->date_export_end.'.csv';
$this->exportCSV($result, $fname); $this->exportCSV($result, $fname);
echo '<p class="conf">'.$this->l('Export complete.'). echo '<p class="conf">'.$this->l('Export complete.').
' <a onclick="window.open(this.href); return false;" href="'.(Tools::usingSecureMode() ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].'/modules/stats_logistic/'.$fname.'">'. ' <a onclick="window.open(this.href); return false;" href="'.Tools::getShopDomain(true).'/modules/stats_logistic/'.$fname.'">'.
$this->l('Click here to download the file').'</a></p>'; $this->l('Click here to download the file').'</a></p>';
} else { } else {
echo '<p class="conf">'.$this->l('No result for these dates.').'</p>'; echo '<p class="conf">'.$this->l('No result for these dates.').'</p>';
@ -599,7 +599,7 @@ class AdminStatsLogistic extends AdminTab
echo '<br><br><h2 style="margin-top:15px">Export Remboursements</h2> echo '<br><br><h2 style="margin-top:15px">Export Remboursements</h2>
<fieldset> <fieldset>
<p>Exporter le détail des ventes dont la date de début est comprise entre : </p> <p>Exporter le détail des ventes dont la date de début est comprise entre : </p>
<form method="POST" action="'.(Tools::usingSecureMode() ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].'/modules/stats_logistic/ajax.php?action=export">' <form method="POST" action="'.Tools::getShopDomain(true).'/modules/stats_logistic/ajax.php?action=export">'
.'<span class="form-group">' .'<span class="form-group">'
.'<label style="float: none;" class="control-label" for="date_export_begin">Date de début :</label>' .'<label style="float: none;" class="control-label" for="date_export_begin">Date de début :</label>'
.'<input type="date" name="date_export_begin" value="'.pSQl($this->date_export_begin).'" id="date_export_begin" class="form-control" />' .'<input type="date" name="date_export_begin" value="'.pSQl($this->date_export_begin).'" id="date_export_begin" class="form-control" />'

View File

@ -26,8 +26,7 @@ switch ($action) {
if (empty($start) || empty($end)) { if (empty($start) || empty($end)) {
$url = ''; $url = '';
} else { } else {
$url = Tools::getCurrentUrlProtocolPrefix() . Tools::getShopDomain() . '/' . $url = Tools::getShopDomain(true) . '/modules/stats_logistic/ajax.php?action=check&token='.Tools::getValue('token');
'modules/stats_logistic/ajax.php?action=check&token='.Tools::getValue('token');
} }
$cmd = dirname(__FILE__).'/bin/export.php --start '.$start.' --end '.$end.''; $cmd = dirname(__FILE__).'/bin/export.php --start '.$start.' --end '.$end.'';

View File

@ -15,22 +15,13 @@ class Tools extends ToolsCore {
$domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8'); $domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8');
} }
if($http) { if($http) {
$domain = (($_SERVER['SERVER_PORT'] == _PS_SSL_PORT_ || !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PORT'] == '443') || Configuration::get('PS_SSL_ENABLED'))? 'https://': 'http://').$domain; $domain = (($_SERVER['SERVER_PORT'] == _PS_SSL_PORT_
|| !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on'
|| (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PORT'] == '443')
|| Configuration::get('PS_SSL_ENABLED')) ? 'https://': 'http://').$domain;
} }
return $domain; return $domain;
// if(!($domain = Configuration::get( _PS_MOBILE_ ? 'PS_MOBILE_DOMAIN' : 'PS_SHOP_DOMAIN'))) {
// $domain = self::getHttpHost();
// }
// if($entities) {
// $domain = htmlspecialchars($domain, ENT_COMPAT, 'UTF-8');
// }
// if($http) {
// $domain = (($_SERVER['SERVER_PORT'] == _PS_SSL_PORT_ || !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' || Configuration::get('PS_SSL_ENABLED'))? 'https://': 'http://').$domain;
// }
// return $domain;
} }
public static function getShopDomainSsl($http=FALSE, $entities=FALSE) { public static function getShopDomainSsl($http=FALSE, $entities=FALSE) {