// Merge -> revision 8097

This commit is contained in:
rMalie
2011-08-17 16:10:20 +00:00
parent 5b26bb28b8
commit 66d4533e68
41 changed files with 107 additions and 135 deletions
+1 -1
View File
@@ -625,7 +625,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
{
$result = array();
$protocol = (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off') ? 'https' : 'http';
$protocol = Tools::usingSecureMode() ? 'https' : 'http';
$isoUser = Context::getContext()->language->iso_code;
$isoCountry = Context::getContext()->country->iso_code;
$stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
+6 -4
View File
@@ -340,7 +340,11 @@ class AdminDiscounts extends AdminTab
</div>
<label>'.$this->l('Minimum amount').'</label>
<div class="margin-form">
<input type="text" size="15" name="minimal" value="'.($this->getFieldValue($obj, 'minimal') ? (float)($this->getFieldValue($obj, 'minimal')) : '0').'" onkeyup="javascript:this.value = this.value.replace(/,/g, \'.\'); " /> <sup>*</sup>
<input type="text" size="15" name="minimal" value="'.($this->getFieldValue($obj, 'minimal') ? (float)($this->getFieldValue($obj, 'minimal')) : '0').'" onkeyup="javascript:this.value = this.value.replace(/,/g, \'.\'); " /> <sup>*</sup>&nbsp;
<select name="include_tax" id="include_tax" style="vertical-align: middle;">
<option value="0">'.$this->l('tax excl.').'</option>
<option value="1">'.$this->l('tax incl.').'</option>
</select>
<p class="clear">'.$this->l('0 if not applicable').'</p>
</div>
<div class="margin-form">
@@ -540,6 +544,4 @@ class AdminDiscounts extends AdminTab
if ($key != 'infos')
self::recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite);
}
}
}
+1 -1
View File
@@ -154,7 +154,7 @@ class AdminHome extends AdminTab
$this->warnDomainName();
$tab = get_class();
$protocol = (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')?'https':'http';
$protocol = Tools::usingSecureMode()?'https':'http';
$isoUser = $this->context->language->iso_code;
$currency = $this->context->currency;
echo '<div>
+31 -8
View File
@@ -751,11 +751,17 @@ class AdminImport extends AdminTab
// check quantity
if ($product->quantity == NULL)
$product->quantity = 0;
// If id product AND id product already in base, trying to update
if ($product->id AND Product::existsInDatabase((int)($product->id), 'product'))
{
// If match ref is specified AND ref product AND ref product already in base, trying to update
if (Tools::getValue('match_ref') == 1 AND $product->reference AND Product::existsRefInDatabase($product->reference))
{
$datas = Db::getInstance()->getRow('SELECT `date_add`, `id_product` FROM `'._DB_PREFIX_.'product` WHERE `reference` = "'.$product->reference.'"');
$product->id = pSQL($datas['id_product']);
$product->date_add = pSQL($datas['date_add']);
$res = $product->update();
} // Else If id product AND id product already in base, trying to update
else if ($product->id AND Product::existsInDatabase((int)($product->id), 'product'))
{
$datas = Db::getInstance()->getRow('SELECT `date_add` FROM `'._DB_PREFIX_.'product` WHERE `id_product` = '.(int)($product->id));
$product->date_add = pSQL($datas['date_add']);
$res = $product->update();
@@ -767,7 +773,7 @@ class AdminImport extends AdminTab
$res = $product->add(false);
else
$res = $product->add();
}
}
}
// If both failed, mysql error
if (!$res)
@@ -1396,14 +1402,21 @@ class AdminImport extends AdminTab
</div>
<label for="truncate" class="clear">'.$this->l('Delete all').' <span id="entitie">'.$this->l('categories').'</span> '.$this->l('before import ?').' </label>
<div class="margin-form">
<input name="truncate" id="truncate" type="checkbox" style="margin-top: 6px;"/>
<input name="truncate" id="truncate" type="checkbox"/>
</div>
<label for="match_ref" class="clear" style="display: none">'.$this->l('Use product reference as key ?').'</label>
<div class="margin-form">
<input name="match_ref" id="match_ref" type="checkbox" style="margin-top: 6px; display:none"/>
</div>
<div class="space margin-form">
<input type="submit" name="submitImportFile" value="'.$this->l('Next step').'" class="button"/>
</div>
<div>
'.$this->l('Note that the category import does not support categories of the same name').'
'.$this->l('Note that the category import does not support categories of the same name').'.
</div>
<div>
'.$this->l('Note that references are not specified as UNIQUE in the database').'.
</div>
';
}
else
@@ -1427,6 +1440,14 @@ class AdminImport extends AdminTab
<div class="clear">&nbsp;</div>
<script type="text/javascript">
$("select#entity").change( function() {
if ($("#entity > option:selected").val() != 1)
{
$("label[for=match_ref],#match_ref").hide();
}
if ($("#entity > option:selected").val() == 1)
{
$("label[for=match_ref],#match_ref").show();
}
$("#entitie").html($("#entity > option:selected").text().toLowerCase());
$.getJSON("'.dirname(self::$currentIndex).'/ajax.php",
{
@@ -1577,13 +1598,15 @@ class AdminImport extends AdminTab
echo '
<form action="'.self::$currentIndex.'&token='.$this->token.'" method="post" id="import_form" name="import_form">
'.$this->l('Skip').' <input type="text" size="2" name="skip" value="0" /> '.$this->l('lines').'.
'.$this->l('Skip').' <input type="text" size="2" name="skip" value="0" /> '.$this->l('lines').'
<input type="hidden" name="csv" value="'.Tools::getValue('csv').'" />
<input type="hidden" name="convert" value="'.Tools::getValue('convert').'" />
<input type="hidden" name="entity" value="'.(int)(Tools::getValue('entity')).'" />
<input type="hidden" name="iso_lang" value="'.Tools::getValue('iso_lang').'" />';
if (Tools::getValue('truncate'))
echo '<input type="hidden" name="truncate" value="1" />';
if (Tools::getValue('match_ref'))
echo '<input type="hidden" name="match_ref" value="1" />';
echo '
<input type="hidden" name="separator" value="'.strval(trim(Tools::getValue('separator'))).'">
<input type="hidden" name="multiple_value_separator" value="'.strval(trim(Tools::getValue('multiple_value_separator'))).'">
+1 -1
View File
@@ -106,7 +106,7 @@ class AdminPreferences extends AdminTab
$fields['PS_TIMEZONE'] = array('title' => $this->l('Time Zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => $timezones, 'identifier' => 'name', 'visibility' => Shop::CONTEXT_ALL);
// No HTTPS activation if you haven't already.
if (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off')
if (!Tools::usingSecureMode())
{
$fields['PS_SSL_ENABLED']['type'] = 'disabled';
$fields['PS_SSL_ENABLED']['disabled'] = '<a href="https://'.Tools::getShopDomainSsl().$_SERVER['REQUEST_URI'].'">'.$this->l('Please click here to use HTTPS protocol before enabling SSL.').'</a>';