// Merge -> revision 8059

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8062 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-08-16 09:10:40 +00:00
parent bbb8acc0de
commit 21ca4d15d7
31 changed files with 188 additions and 84 deletions
+1
View File
@@ -84,6 +84,7 @@ echo '
<option value="0">'.translate('everywhere').'</option>
<option value="1" '.(Tools::getValue('bo_search_type') == 1 ? 'selected="selected"' : '').'>'.translate('catalog').'</option>
<option value="2" '.(Tools::getValue('bo_search_type') == 2 ? 'selected="selected"' : '').'>'.translate('customers').'</option>
<option value="6" '.(Tools::getValue('bo_search_type') == 6 ? 'selected="selected"' : '').'>'.translate('ip address').'</option>
<option value="3" '.(Tools::getValue('bo_search_type') == 3 ? 'selected="selected"' : '').'>'.translate('orders').'</option>
<option value="4" '.(Tools::getValue('bo_search_type') == 4 ? 'selected="selected"' : '').'>'.translate('invoices').'</option>
<option value="5" '.(Tools::getValue('bo_search_type') == 5 ? 'selected="selected"' : '').'>'.translate('carts').'</option>
+10 -7
View File
@@ -214,13 +214,16 @@ class AdminCategories extends AdminTab
<label class="t" for="active_off"><img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
</div>
<label>'.$this->l('Parent category:').' </label>
<div class="margin-form">
<select name="id_parent">';
$categories = Category::getCategories((int)$this->context->language->id, false);
Category::recurseCategory($categories, $categories[0][1], 1, ($obj->id ? $this->getFieldValue($obj, 'id_parent') : $id_category));
echo '
</select>
</div>
<div class="margin-form">';
// Translations are not automatic for the moment ;)
$trads = array(
'Home' => $this->l('Home'),
'selected' => $this->l('selected'),
'Collapse All' => $this->l('Collapse All'),
'Expand All' => $this->l('Expand All')
);
echo Helper::renderAdminCategorieTree($trads, array(isset($obj->id_parent) ? $obj->id_parent : 1), 'id_parent', true);
echo '</div>
<label>'.$this->l('Description:').' </label>
<div class="margin-form translatable">';
foreach ($this->_languages AS $language)
+2 -2
View File
@@ -2830,7 +2830,7 @@ class AdminProducts extends AdminTab
</td></tr>
<tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr>
<tr>
<td class="col-left">'.$this->l('Short description:').'<br /><br /><i>('.$this->l('appears in search results').')</i></td>
<td class="col-left">'.$this->l('Short description:').'<br /><br /><i>('.$this->l('appears in the product lists and on the top of the product page').')</i></td>
<td style="padding-bottom:5px;" class="translatable">';
foreach ($this->_languages as $language)
echo ' <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').';float: left;">
@@ -2840,7 +2840,7 @@ class AdminProducts extends AdminTab
</td>
</tr>
<tr>
<td class="col-left">'.$this->l('Description:').'</td>
<td class="col-left">'.$this->l('Description:').'<br /><br /><i>('.$this->l('appears in the body of the product page').')</i></td>
<td style="padding-bottom:5px;" class="translatable">';
foreach ($this->_languages as $language)
echo ' <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').';float: left;">
+23 -5
View File
@@ -28,6 +28,19 @@
class AdminSearch extends AdminTab
{
public function searchIP($query)
{
if (!ip2long(trim($query)))
return;
$this->_list['customers'] = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT DISTINCT c.*
FROM `'._DB_PREFIX_.'customer` c
LEFT JOIN `'._DB_PREFIX_.'guest` g ON g.id_customer = c.id_customer
LEFT JOIN `'._DB_PREFIX_.'connections` co ON g.id_guest = co.id_guest
WHERE co.`ip_address` = \''.ip2long(trim($query)).'\'');
}
/**
* Search a specific string in the products and categories
*
@@ -120,9 +133,7 @@ class AdminSearch extends AdminTab
'reference' => array('title' => $this->l('Reference')),
'name' => array('title' => $this->l('Name')),
'price' => array('title' => $this->l('Price')),
'tax' => array('title' => $this->l('Tax')),
'stock' => array('title' => $this->l('Stock')),
'weight' => array('title' => $this->l('Weight')),
'status' => array('title' => $this->l('Status')),
'action' => array('title' => $this->l('Actions'))
));
@@ -137,7 +148,7 @@ class AdminSearch extends AdminTab
}
/* Customer */
if (!$searchType OR $searchType == 2)
if (!$searchType OR $searchType == 2 OR $searchType == 6)
{
$this->fieldsDisplay['customers'] = (array(
'ID' => array('title' => $this->l('ID')),
@@ -151,6 +162,8 @@ class AdminSearch extends AdminTab
'actions' => array('title' => $this->l('Actions'))
));
if (!$searchType OR $searchType == 2)
{
/* Handle customer ID */
if ($searchType AND (int)$query AND Validate::isUnsignedInt((int)$query))
if ($customer = new Customer((int)$query) AND Validate::isLoadedObject($customer))
@@ -160,6 +173,10 @@ class AdminSearch extends AdminTab
$this->searchCustomer($query);
}
if ($searchType == 6)
$this->searchIP($query);
}
/* Order */
if ($searchType == 3)
{
@@ -183,6 +200,9 @@ class AdminSearch extends AdminTab
Tools::redirectAdmin('index.php?tab=AdminCarts&id_cart='.(int)($cart->id).'&viewcart'.'&token='.Tools::getAdminToken('AdminCarts'.(int)(Tab::getIdFromClassName('AdminCarts')).(int)$this->context->employee->id));
$this->_errors[] = Tools::displayError('No cart found with this ID:').' '.Tools::htmlentitiesUTF8($query);
}
/* IP */
// 6 - but it is included in the customer block
}
}
@@ -222,9 +242,7 @@ class AdminSearch extends AdminTab
<td>'.$product['reference'].'</td>
<td><a href="'.self::$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&addproduct&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'">'.stripslashes($product['nameh']).'</a></td>
<td>'.Tools::displayPrice($product['price'], $this->context->currency).'</td>
<td>'.stripslashes($product['tax_name']).'</td>
<td align="center">'.$product['quantity'].'</td>
<td align="center">'.$product['weight'].' '.Configuration::get('PS_WEIGHT_UNIT').'</td>
<td align="center"><a href="'.self::$currentIndex.'?tab=AdminCatalog&id_product='.$product['id_product'].'&status&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)$this->context->employee->id).'">
<img src="../img/admin/'.($product['active'] ? 'enabled.gif' : 'forbbiden.gif').'" alt="" /></a></td>
<td>
+2 -1
View File
@@ -50,7 +50,8 @@ class AdminTranslations extends AdminTab
{
parent::__construct();
self::$tpl_regexp = '/\{l s=\''._PS_TRANS_PATTERN_.'\'( mod=\'.+\')?( js=1)?\}/U';
self::$php_regexp = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, \'(.+)\')?(, (.+))?\)/U';
// added ? after spaces because some peoples forget them. see PSCFI-2501
self::$php_regexp = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U';
}
/**
+1 -1
View File
@@ -199,7 +199,7 @@ class GroupReductionCore extends ObjectModel
WHERE pgr.`id_product` = '.(int)$id_product_old
);
if (!$row)
return false;
return true;
$query = 'INSERT INTO `'._DB_PREFIX_.'product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES ';
$query .= '('.(int)($id_product).', '.(int)($row['id_group']).', '.(float)($row['reduction']).')';
+19 -7
View File
@@ -59,8 +59,11 @@ class HelperCore
* @param type $input_name name of input
* @return string
*/
public static function renderAdminCategorieTree($trads, $selected_cat = array(), $input_name = 'categoryBox')
public static function renderAdminCategorieTree($trads, $selected_cat = array(), $input_name = 'categoryBox', $use_radio = false)
{
if (!$use_radio)
$input_name = $input_name.'[]';
$html = '
<script src="../js/jquery/treeview/jquery.treeview.js" type="text/javascript"></script>
<script src="../js/jquery/treeview/jquery.treeview.async.js" type="text/javascript"></script>
@@ -68,11 +71,18 @@ class HelperCore
<script src="../js/admin-categories-tree.js" type="text/javascript"></script>
<script type="text/javascript">
var inputName = "'.$input_name.'";
var selectedCat = "'.implode(',', array_keys($selected_cat)).'";
</script>
<script type="text/javascript">
';
if (sizeof($selected_cat) > 0)
{
if (isset($selected_cat[0]))
$html .= 'var selectedCat = "'.implode(',', $selected_cat).'"';
else
$html .= 'var selectedCat = "'.implode(',', array_keys($selected_cat)).'"';
}
$html .= '
var selectedLabel = \''.$trads['selected'].'\';
var home = \''.$trads['Home'].'\';
var use_radio = '.(int)$use_radio.';
</script>
<link type="text/css" rel="stylesheet" href="../css/jquery.treeview.css" />
';
@@ -81,8 +91,10 @@ class HelperCore
<div style="background-color:#F4E6C9; width:99%;padding:5px 0 5px 5px;">
<a href="#" id="collapse_all" >'.$trads['Collapse All'].'</a>
- <a href="#" id="expand_all" >'.$trads['Expand All'].'</a>
'.(!$use_radio ? '
- <a href="#" id="check_all" >'.$trads['Check All'].'</a>
- <a href="#" id="uncheck_all" >'.$trads['Uncheck All'].'</a>
' : '').'
</div>
';
@@ -92,14 +104,14 @@ class HelperCore
if (is_array($cat))
{
if ($cat['id_category'] != 1)
$html .= '<input type="hidden" name="'.$input_name.'[]" value="'.$cat['id_category'].'" >';
$html .= '<input type="hidden" name="'.$input_name.'" value="'.$cat['id_category'].'" >';
else
$home_is_selected = true;
}
else
{
if ($cat != 1)
$html .= '<input type="hidden" name="'.$input_name.'[]" value="'.$cat.'" >';
$html .= '<input type="hidden" name="'.$input_name.'" value="'.$cat.'" >';
else
$home_is_selected = true;
}
@@ -107,7 +119,7 @@ class HelperCore
$html .= '
<ul id="categories-treeview" class="filetree">
<li id="1" class="hasChildren">
<span class="folder"> <input type="checkbox" name="'.$input_name.'[]" value="1" '.($home_is_selected ? 'checked' : '').' onclick="clickOnCategoryBox($(this));" /> '.$trads['Home'].'</span>
<span class="folder"> <input type="'.(!$use_radio ? 'checkbox' : 'radio').'" name="'.$input_name.'" value="1" '.($home_is_selected ? 'checked' : '').' onclick="clickOnCategoryBox($(this));" /> '.$trads['Home'].'</span>
<ul>
<li><span class="placeholder">&nbsp;</span></li>
</ul>
+31 -1
View File
@@ -117,13 +117,43 @@ class LanguageCore extends ObjectModel
if (file_exists(_PS_MAIL_DIR_.$this->iso_code))
rename(_PS_MAIL_DIR_.$this->iso_code, _PS_MAIL_DIR_.$newIso);
foreach (Module::getModulesDirOnDisk() as $moduleDir) {
$modulesList = Module::getModulesDirOnDisk();
foreach ($modulesList as $moduleDir)
{
if (file_exists(_PS_MODULE_DIR_.$moduleDir.'/mails/'.$this->iso_code))
rename(_PS_MODULE_DIR_.$moduleDir.'/mails/'.$this->iso_code, _PS_MODULE_DIR_.$moduleDir.'/mails/'.$newIso);
if (file_exists(_PS_MODULE_DIR_.$moduleDir.'/'.$this->iso_code.'.php'))
rename(_PS_MODULE_DIR_.$moduleDir.'/'.$this->iso_code.'.php', _PS_MODULE_DIR_.$moduleDir.'/'.$newIso.'.php');
}
foreach ($this->_getThemesList() as $theme => $data)
{
if (file_exists(_PS_ALL_THEMES_DIR_.$theme.'/lang/'.$this->iso_code.'.php'))
rename(_PS_ALL_THEMES_DIR_.$theme.'/lang/'.$this->iso_code.'.php', _PS_ALL_THEMES_DIR_.$theme.'/lang/'.$newIso.'.php');
if (file_exists(_PS_ALL_THEMES_DIR_.$theme.'/mails/'.$this->iso_code))
rename(_PS_ALL_THEMES_DIR_.$theme.'/mails/'.$this->iso_code, _PS_ALL_THEMES_DIR_.$theme.'/mails/'.$newIso);
foreach ($modulesList as $module)
if (file_exists(_PS_ALL_THEMES_DIR_.$theme.'/modules/'.$module.'/'.$this->iso_code.'.php'))
rename(_PS_ALL_THEMES_DIR_.$theme.'/modules/'.$module.'/'.$this->iso_code.'.php', _PS_ALL_THEMES_DIR_.$theme.'/modules/'.$module.'/'.$newIso.'.php');
}
}
/**
* Return an array with themes and thumbnails
*
* @return array
*/
private function _getThemesList()
{
$dir = opendir(_PS_ALL_THEMES_DIR_);
while ($folder = readdir($dir))
if ($folder != '.' AND $folder != '..' AND file_exists(_PS_ALL_THEMES_DIR_.'/'.$folder.'/preview.jpg'))
$themes[$folder]['name'] = $folder;
closedir($dir);
return isset($themes) ? $themes : array();
}
public function add($autodate = true, $nullValues = false)
+14 -15
View File
@@ -549,7 +549,7 @@ class ProductCore extends ObjectModel
if ($die) die (Tools::displayError().' ('.get_class($this).'->description: length > '.$limit.' for language '.$k.')');
return $errorReturn ? get_class($this).'->'.Tools::displayError('description: length >').' '.$limit.' '.Tools::displayError('for language').' '.$k : false;
}
return $this->validateFieldsLang($die, $errorReturn);
return parent::validateFieldsLang($die, $errorReturn);
}
public function delete()
@@ -880,13 +880,14 @@ class ProductCore extends ObjectModel
$price = str_replace(',', '.', $price);
$weight = str_replace(',', '.', $weight);
Db::getInstance()->AutoExecute(_DB_PREFIX_.'product_attribute', array(
'id_product' => $this->id,
'id_product' => (int)$this->id,
'price' => (float)$price,
'ecotax' => (float)$ecotax,
'quantity' => (int)$quantity,
'weight' => $weight ? (float)$weight : 0,
'unit_price_impact' => $unit_impact ? (float)$unit_impact : 0,
'quantity' => 0,
'weight' => ($weight ? (float)$weight : 0),
'unit_price_impact' => ($unit_impact ? (float)$unit_impact : 0),
'reference' => pSQL($reference),
'supplier_reference' => pSQL($supplier_reference),
'location' => pSQL($location),
@@ -894,12 +895,16 @@ class ProductCore extends ObjectModel
'upc' => pSQL($upc),
'default_on' => (int)$default
), 'INSERT');
$id_product_attribute = Db::getInstance()->Insert_ID();
$this->setStock($quantity, $id_product_attribute);
Product::updateDefaultAttribute($this->id);
if (!$id_product_attribute)
return false;
$this->addStockMvt((int)$quantity, 1, $id_product_attribute);
if (empty($id_images))
return (int)($id_product_attribute);
$query = 'INSERT INTO `'._DB_PREFIX_.'product_attribute_image` (`id_product_attribute`, `id_image`) VALUES ';
@@ -2432,23 +2437,18 @@ class ProductCore extends ObjectModel
if (!$context)
$context = Context::getContext();
$sql = 'SELECT p.`id_product`, pl.`name`, pl.`link_rewrite`, p.`weight`, p.`active`, p.`ecotax`, i.`id_image`, p.`reference`, p.`cache_is_pack`,
il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name
$sql = 'SELECT p.`id_product`, pl.`name`, p.`active`, p.`reference`, m.`name` AS manufacturer_name, stock.quantity
FROM `'._DB_PREFIX_.'category_product` cp
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product`
'.$context->shop->sqlAsso('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.$context->shop->sqlLang('pl').')
LEFT JOIN `'._DB_PREFIX_.'tax_rule` tr ON (p.`id_tax_rules_group` = tr.`id_tax_rules_group`
AND tr.`id_country` = '.(int)Context::getContext()->country->id.'
AND tr.`id_state` = 0)
LEFT JOIN `'._DB_PREFIX_.'tax` t ON (t.`id_tax` = tr.`id_tax`)
LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.(int)$id_lang.')
LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer`
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`) AND i.`cover` = 1
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.')
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON pa.`id_product` = p.`id_product`
'.Product::sqlStock('p', 'pa', false, $context->shop).'
WHERE pl.`name` LIKE \'%'.pSQL($query).'%\'
OR p.`reference` LIKE \'%'.pSQL($query).'%\'
OR p.`supplier_reference` LIKE \'%'.pSQL($query).'%\'
OR pa.`reference` LIKE \'%'.pSQL($query).'%\'
GROUP BY `id_product`
ORDER BY pl.`name` ASC';
$result = Db::getInstance()->ExecuteS($sql);
@@ -2460,7 +2460,6 @@ class ProductCore extends ObjectModel
foreach ($result AS $row)
{
$row['price'] = Product::getPriceStatic($row['id_product'], true, NULL, 2);
$row['quantity'] = Product::getQuantity($row['id_product'], NULL, $row['cache_is_pack']);
$resultsArray[] = $row;
}
return $resultsArray;
+8 -4
View File
@@ -646,6 +646,7 @@ class ToolsCore
/* Categories specifics meta tags */
elseif ($id_category = self::getValue('id_category'))
{
$page_number = self::getValue('p');
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`, `description`
FROM `'._DB_PREFIX_.'category_lang`
@@ -654,13 +655,16 @@ class ToolsCore
{
if (empty($row['meta_description']))
$row['meta_description'] = strip_tags($row['description']);
return self::completeMetaTags($row, $row['name']);
$row['meta_title'] .= $row['name'] . (!empty($page_number) ? ' ('.$page_number.')' : '');
$row['meta_title'] .= ' - '.Configuration::get('PS_SHOP_NAME');
return self::completeMetaTags($row, $row['meta_title']);
}
}
/* Manufacturers specifics meta tags */
elseif ($id_manufacturer = self::getValue('id_manufacturer'))
{
$page_number = self::getValue('p');
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT `name`, `meta_title`, `meta_description`, `meta_keywords`
FROM `'._DB_PREFIX_.'manufacturer_lang` ml
@@ -670,9 +674,9 @@ class ToolsCore
{
if (empty($row['meta_description']))
$row['meta_description'] = strip_tags($row['meta_description']);
if (!empty($row['meta_title']))
$row['meta_title'] = $row['meta_title'].' - '.Configuration::get('PS_SHOP_NAME');
return self::completeMetaTags($row, $row['name']);
$row['meta_title'] .= $row['name'] . (!empty($page_number) ? ' ('.$page_number.')' : '');
$row['meta_title'] .= ' - '.Configuration::get('PS_SHOP_NAME');
return self::completeMetaTags($row, $row['meta_title']);
}
}
+6
View File
@@ -228,6 +228,12 @@ function updateNbSubCategorySelected(category, add)
var currentSpan = category.parent().parent().parent().children('.nb_sub_cat_selected');
var parentNbSubCategorySelected = currentSpan.children('.nb_sub_cat_selected_value').html();
if (use_radio)
{
$('.nb_sub_cat_selected').hide();
return false;
}
if (add)
var newValue = parseInt(parentNbSubCategorySelected)+1;
else
+2 -2
View File
@@ -19,14 +19,14 @@ function load(settings, root, child, container) {
function createNode(parent) {
var id_category = this.id_category;
var checked = false;
$('input[name="'+inputName+'[]"][type=hidden]').each( function () {
$('input[name="'+inputName+'"][type=hidden]').each( function () {
if ($(this).attr('value') == id_category)
{
checked = true;
$(this).remove();
}
});
var current = $("<li/>").attr("id", this.id_category || "").html(" <input type=\"checkbox\" value=\""+this.id_category+"\"/ name=\""+inputName+"[]\" "+(checked ? 'checked' : '')+" onclick=\"clickOnCategoryBox($(this));\"/> <span class=\"category_label\">" + this.name +"</span> <span class=\"category_level\" style=\"display: none;\">" + this.level_depth +"</span> <span class=\"nb_sub_cat_selected\" style=\"font-weight: bold;"+(this.nbSelectedSubCat == 0 ? 'display: none;' : '')+"\">(<span class=\"nb_sub_cat_selected_value\">"+this.nbSelectedSubCat+"</span> "+selectedLabel+")</span>").appendTo(parent);
var current = $("<li/>").attr("id", this.id_category || "").html(" <input type=\""+(!use_radio ? 'checkbox' : 'radio')+"\" value=\""+this.id_category+"\"/ name=\""+inputName+"\" "+(checked ? 'checked' : '')+" onclick=\"clickOnCategoryBox($(this));\"/> <span class=\"category_label\">" + this.name +"</span> <span class=\"category_level\" style=\"display: none;\">" + this.level_depth +"</span> <span class=\"nb_sub_cat_selected\" style=\"font-weight: bold;"+(this.nbSelectedSubCat == 0 ? 'display: none;' : '')+"\">(<span class=\"nb_sub_cat_selected_value\">"+this.nbSelectedSubCat+"</span> "+selectedLabel+")</span>").appendTo(parent);
if (this.classes) {
current.children("span").addClass(this.classes);
}
+4
View File
@@ -0,0 +1,4 @@
{reply}
Attention, vous ne devez pas répondre à ce message en utilisant votre logiciel de messagerie, nous ne recevrons pas votre message.
Pour répondre, merci d'utiliser exclusivement le lien suivant : {link}
+1 -1
View File
@@ -34,7 +34,7 @@ class authorizeAIM extends PaymentModule
{
$this->name = 'authorizeaim';
$this->tab = 'payments_gateways';
$this->version = '1.0';
$this->version = '1.1';
$this->author = 'PrestaShop';
$this->limited_countries = array('us');
$this->need_instance = 0;
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>authorizeaim</name>
<displayName><![CDATA[Authorize.net AIM (Advanced Integration Method)]]></displayName>
<version><![CDATA[1.0]]></version>
<version><![CDATA[1.1]]></version>
<description><![CDATA[Receive payment with Authorize.net]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[payments_gateways]]></tab>
+4 -2
View File
@@ -42,9 +42,11 @@ foreach ($_POST AS $key => $value)
$postString .= $key.'='.urlencode($value).'&';
$postString .= 'x_exp_date='.str_pad($_POST["x_exp_date_m"], 2, "0",STR_PAD_LEFT).$_POST["x_exp_date_y"];
if (Tools::getValue('x_test_request'))
$postString .= 'Test_Mode=1';
/* Do the CURL request ro Authorize.net */
$request = curl_init(
Tools::getValue('x_test_request') ? 'https://test.authorize.net/gateway/transact.dll' : 'https://secure.authorize.net/gateway/transact.dll');
$request = curl_init('https://secure.authorize.net/gateway/transact.dll');
curl_setopt($request, CURLOPT_HEADER, 0);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $postString);
+1 -1
View File
@@ -1363,7 +1363,7 @@ class CanadaPost extends CarrierModule
'width' => ($product['width'] ? $product['width'] : 1),
'height' => ($product['height'] ? $product['height'] : 1),
'depth' => ($product['depth'] ? $product['depth'] : 1),
'weight' => ($product['weight'] ? $product['weight'] : 1),
'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1),
'quantity' => $product['quantity'],
'id_product' => $product['id_product'],
);
+1 -1
View File
@@ -1536,7 +1536,7 @@ class FedexCarrier extends CarrierModule
'width' => ($product['width'] ? $product['width'] : 1),
'height' => ($product['height'] ? $product['height'] : 1),
'depth' => ($product['depth'] ? $product['depth'] : 1),
'weight' => ($product['weight'] ? $product['weight'] : 1),
'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1),
'pickup_type' => (isset($config['pickup_type_code']) ? $config['pickup_type_code'] : Configuration::get('FEDEX_CARRIER_PICKUP_TYPE')),
);
+1 -1
View File
@@ -376,7 +376,7 @@ class Followup extends Module
/* For all customers with more than x euros in 90 days */
private function bestCustomer($count = false)
{
$emailLogs = $this->getLogsEmail(2);
$emailLogs = $this->getLogsEmail(3);
$sql = '
SELECT SUM(o.total_paid) total, c.id_cart, c.id_lang, cu.id_customer, cu.firstname, cu.lastname, cu.email
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>moneybookers</name>
<displayName><![CDATA[Moneybookers]]></displayName>
<version><![CDATA[1.5]]></version>
<version><![CDATA[1.6]]></version>
<description><![CDATA[Accepts payments by Moneybookers.]]></description>
<author><![CDATA[]]></author>
<tab><![CDATA[payments_gateways]]></tab>
+8 -1
View File
@@ -38,7 +38,7 @@ class MoneyBookers extends PaymentModule
{
$this->name = 'moneybookers';
$this->tab = 'payments_gateways';
$this->version = '1.5';
$this->version = '1.6';
parent::__construct();
@@ -49,6 +49,13 @@ class MoneyBookers extends PaymentModule
if (Configuration::get('MB_PAY_TO_EMAIL') == 'testmerchant@moneybookers.com')
$this->warning = $this->l('You are currently using the default Moneybookers e-mail address, please use your own e-mail address.');
/* For 1.4.3 and less compatibility */
$updateConfig = array('PS_OS_CHEQUE', 'PS_OS_PAYMENT', 'PS_OS_PREPARATION', 'PS_OS_SHIPPING', 'PS_OS_CANCELED', 'PS_OS_REFUND', 'PS_OS_ERROR', 'PS_OS_OUTOFSTOCK', 'PS_OS_BANKWIRE', 'PS_OS_PAYPAL', 'PS_OS_WS_PAYMENT');
if (!Configuration::get('PS_OS_PAYMENT'))
foreach ($updateConfig as $u)
if (!Configuration::get($u) && defined('_'.$u.'_'))
Configuration::updateValue($u, constant('_'.$u.'_'));
/* MoneyBookers payment methods */
$this->_internationalPaymentMethods = array(
0 => array('file' => 'amex', 'name' => 'American Express', 'code' => 'AMX'),
+1 -1
View File
@@ -44,7 +44,7 @@ if (Tools::getValue('hash') != md5(Configuration::get($module->prefix.'SALT') +
$result = $module->getDispositionState((int)($cart->id));
$state = Configuration::get('PS_OS_ERROR');
$disposition = Disposition::getByCartId((int)($cart->id));
$disposition = PSCDisposition::getByCartId((int)($cart->id));
$message = 'Transaction ID #'.$disposition['mtid'].': '.$disposition['amount'].$disposition['currency'].'<br />'. date('Y-m-d').' ';
if ($result[0] == 0)
+1 -4
View File
@@ -578,10 +578,7 @@ class shopimporter extends ImportModule
foreach($item as $key => $val)
{
if ($key == 'passwd')
{
$password = $val;
$val = substr($val,0,29);
}
$val = '------';
if (is_array($val) AND $key != 'images')
{
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>treepodia</name>
<displayName><![CDATA[Treepodia]]></displayName>
<version><![CDATA[1.4]]></version>
<version><![CDATA[1.6]]></version>
<description><![CDATA[Cover your entire catalog with product videos in 24 hours.]]></description>
<author><![CDATA[]]></author>
<tab><![CDATA[front_office_features]]></tab>
+33 -8
View File
@@ -47,7 +47,7 @@ class Treepodia extends Module
{
$this->name = 'treepodia';
$this->tab = 'front_office_features';
$this->version = '1.5';
$this->version = '1.6';
$this->displayName = 'Treepodia';
parent::__construct();
@@ -199,9 +199,18 @@ XML;
$price->addChild('retail-price-with-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], true, NULL, 6, NULL, false, false));
$price->addChild('retail-price-without-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], false, NULL, 6, NULL, false, false));
$price->addChild('final-retail-price-with-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], true));
if (version_compare(_PS_VERSION_, '1.4') < 0)
{
$price->addChild('final-retail-price-without-tax', Product::getPriceStatic(intval($sqlProduct['id_product']), false));
$price->addChild('reduction_percent', floatval($sqlProduct['reduction_percent']));
$price->addChild('reduction_price', floatval($sqlProduct['reduction_price']));
}
else
{
$price->addChild('final-retail-price-without-tax', Product::getPriceStatic((int)$sqlProduct['id_product'], false, NULL, 6, NULL, false, true, 1, false, NULL, NULL, NULL, $specificPrice));
$price->addChild('reduction_percent', ($specificPrice AND $specificPrice['reduction_type'] == 'percentage') ? $specificPrice['reduction'] * 100 : 0.00);
$price->addChild('reduction_price', ($specificPrice AND $specificPrice['reduction_type'] == 'amount') ? (float)$specificPrice['reduction'] : 0.00);
}
$price->addChild('display-on-sale', (int)$sqlProduct['on_sale']);
$product->addChild('downloadable', $sqlProduct['id_product_download'] >= 1 ? 1 : 0);
@@ -264,14 +273,30 @@ XML;
}
}
$quantityDiscounts = SpecificPrice::getQuantityDiscounts((int)$sqlProduct['id_product'], $this->context->shop->getGroupID(), 0, 0, 0);
foreach ($quantityDiscounts AS $quantityDiscount)
if (version_compare(_PS_VERSION_, '1.4') < 0)
{
$discount = $product->addChild('discount');
$discount->addChild('discount-quantity', (int)($quantityDiscount['from_quantity']));
$discount->addChild('discount-value', ((float)($quantityDiscount['price']) AND $quantityDiscount['reduction_type'] == 'amount') ? (float)($quantityDiscount['price']) : $quantityDiscount['reduction'] * 100);
$discount->addChild('discount-type', ($quantityDiscount['reduction_type'] == 'amount' ? $defaultCurrencyIsoCode : '%'));
$quantityDiscounts = Db::getInstance()->ExecuteS('
SELECT dq.quantity, dq.value, dq.id_discount_type
FROM '._DB_PREFIX_.'discount_quantity dq
WHERE dq.id_product = '.intval($sqlProduct['id_product']));
foreach ($quantityDiscounts AS $quantityDiscount)
{
$discount = $product->addChild('discount');
$discount->addChild('discount-quantity', intval($quantityDiscount['quantity']));
$discount->addChild('discount-value', floatval($quantityDiscount['value']));
$discount->addChild('discount-type', ($quantityDiscount['id_discount_type'] == 1 ? $defaultCurrencyIsoCode : '%'));
}
}
else
{
$quantityDiscounts = SpecificPrice::getQuantityDiscounts((int)$sqlProduct['id_product'], $this->context->shop->getGroupID(), 0, 0, 0);
foreach ($quantityDiscounts AS $quantityDiscount)
{
$discount = $product->addChild('discount');
$discount->addChild('discount-quantity', (int)($quantityDiscount['from_quantity']));
$discount->addChild('discount-value', ((float)($quantityDiscount['price']) AND $quantityDiscount['reduction_type'] == 'amount') ? (float)($quantityDiscount['price']) : $quantityDiscount['reduction'] * 100);
$discount->addChild('discount-type', ($quantityDiscount['reduction_type'] == 'amount' ? $defaultCurrencyIsoCode : '%'));
}
}
$categories = Db::getInstance()->ExecuteS('
+2 -2
View File
@@ -1489,7 +1489,7 @@ class UpsCarrier extends CarrierModule
'width' => ($width > 0 ? $width : 7),
'height' => ($height > 0 ? $height : 3),
'depth' => ($depth > 0 ? $depth : 5),
'weight' => ($weight > 0 ? $weight : 0.5),
'weight' => ($weight > 0.1 ? $weight : 0.1),
'packaging_type' => Configuration::get('UPS_CARRIER_PACKAGING_TYPE'),
);
}
@@ -1513,7 +1513,7 @@ class UpsCarrier extends CarrierModule
'width' => ($product['width'] ? $product['width'] : 7),
'height' => ($product['height'] ? $product['height'] : 3),
'depth' => ($product['depth'] ? $product['depth'] : 5),
'weight' => ($product['weight'] ? $product['weight'] : 0.5),
'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1),
'packaging_type' => ($config['packaging_type_code'] ? $config['packaging_type_code'] : Configuration::get('UPS_CARRIER_PACKAGING_TYPE')),
);
+2 -2
View File
@@ -1515,7 +1515,7 @@ class UspsCarrier extends CarrierModule
'width' => ($width > 0 ? $width : 1),
'height' => ($height > 0 ? $height : 1),
'depth' => ($depth > 0 ? $depth : 1),
'weight' => ($weight > 0 ? $weight : 0.5),
'weight' => ($weight > 0.1 ? $weight : 0.1),
'packaging_type' => Configuration::get('USPS_CARRIER_PACKAGING_TYPE'),
'packaging_size' => Configuration::get('USPS_CARRIER_PACKAGING_SIZE'),
'machinable' => Configuration::get('USPS_CARRIER_MACHINABLE'),
@@ -1541,7 +1541,7 @@ class UspsCarrier extends CarrierModule
'width' => ($product['width'] ? $product['width'] : 1),
'height' => ($product['height'] ? $product['height'] : 1),
'depth' => ($product['depth'] ? $product['depth'] : 1),
'weight' => ($product['weight'] ? $product['weight'] : 1),
'weight' => ($product['weight'] > 0.1 ? $product['weight'] : 0.1),
'packaging_type' => (isset($config['packaging_type_code']) ? $config['packaging_type_code'] : Configuration::get('USPS_CARRIER_PACKAGING_TYPE')),
'packaging_size' => (isset($config['packaging_size_code']) ? $config['packaging_size_code'] : Configuration::get('USPS_CARRIER_PACKAGING_SIZE')),
'machinable' => (isset($config['machinable_code']) ? $config['machinable_code'] : Configuration::get('USPS_CARRIER_MACHINABLE')),
+1 -1
View File
@@ -28,4 +28,4 @@ include(dirname(__FILE__). '/../../config/config.inc.php');
include(dirname(__FILE__). '/../../init.php');
include(dirname(__FILE__). '/vatnumber.php');
echo VatNumber::isApplicable($_GET['id_country']);
echo VatNumber::isApplicable(Tools::getValue('id_country'));
+2 -7
View File
@@ -103,13 +103,8 @@ class VatNumber extends Module
public static function isApplicable($id_country)
{
$isApplicable = in_array(Country::getIsoById((int)$id_country), VatNumber::getPrefixIntracomVAT());
if ($isApplicable == "")
{
return 0;
return (((int)$id_country AND in_array(Country::getIsoById($id_country), self::getPrefixIntracomVAT())) ? 1 : 0);
}
return 1;
}
public static function WebServiceCheck($vatNumber)
{
@@ -142,7 +137,7 @@ class VatNumber extends Module
else
sleep(1);
}
ini_restore('default_socket_timeout');
@ini_restore('default_socket_timeout');
return array(Tools::displayError('VAT number validation service unavailable'));
}
+1 -1
View File
@@ -32,7 +32,7 @@
<li>{$error}</li>
{/foreach}
</ol>
{if isset($smarty.server.HTTP_REFERER) && !strstr($request_uri, 'authentication')}
{if isset($smarty.server.HTTP_REFERER) && !strstr($request_uri, 'authentication') && preg_replace('#^http://[^/]+/#', '/', $smarty.server.HTTP_REFERER) != $request_uri}
<p class="align_right"><a href="{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}" class="button_small" title="{l s='Back'}">&laquo; {l s='Back'}</a></p>
{/if}
</div>
+3 -3
View File
@@ -2185,7 +2185,8 @@ $_LANGADM['AdminProducts32b919d18cfaca89383f6000dcc9c031'] = 'Générer';
$_LANGADM['AdminProductsb06f68603b4cf2f867480c4d1eb6a611'] = 'URL simplifié basée sur le nom du produit';
$_LANGADM['AdminProducts92ab5edf4194cb5a84d6808cb8d8b696'] = 'Le lien vers la fiche produit sera :';
$_LANGADM['AdminProducts234078adec0a64008b6ae77653776cfa'] = 'Résumé :';
$_LANGADM['AdminProducts83d4043f36afbc6c2549ec9309d9aee8'] = 'apparaîtra dans les moteurs de recherche';
$_LANGADM['AdminProducts38d301f7ef549a79620e99fd8b51fa34'] = 'apparaît dans les listings produits et au haut des fiches produits';
$_LANGADM['AdminProducts9be976b8052c984a95997e4a4f8eef96'] = 'apparaît sur les pages produits';
$_LANGADM['AdminProducts32b502f33a535f75dcbf63f6753c631e'] = 'Tags :';
$_LANGADM['AdminProducts8fca858b27c5837dcb22c398aca5e0fc'] = 'Tags séparés par des virgules (ex : dvd, lecteur dvd, hifi)';
$_LANGADM['AdminProductsbe26ade2055790d0e8d19eed69309574'] = 'Accessoires :';
@@ -2491,9 +2492,7 @@ $_LANGADM['AdminSearchc0bd7654d5b278e65f21cf4e9153fdb4'] = 'Fabriquant';
$_LANGADM['AdminSearch63d5049791d9d79d86e9a108b0a999ca'] = 'Référence';
$_LANGADM['AdminSearch49ee3087348e8d44e1feda1917443987'] = 'Nom';
$_LANGADM['AdminSearch3601146c4e948c32b6424d2c0a7f0118'] = 'Prix';
$_LANGADM['AdminSearch4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Taxe';
$_LANGADM['AdminSearch27ce7f8b5623b2e2df568d64cf051607'] = 'Stock';
$_LANGADM['AdminSearch8c489d0946f66d17d73f26366a4bf620'] = 'Poids';
$_LANGADM['AdminSearchec53a8c4f07baed5d8825072c89799be'] = 'Statut';
$_LANGADM['AdminSearch06df33001c1d7187fdd81ea1f5b277aa'] = 'Actions';
$_LANGADM['AdminSearchdaab80c5dadc81fa2d019c562f805994'] = 'Genre';
@@ -3324,6 +3323,7 @@ $_LANGADM['indexf84b4e2770ec98e3db2926cd49864d2f'] = 'Mes préférences';
$_LANGADM['indexcbebc850f5f849e8956b5f8075f48f69'] = 'tout';
$_LANGADM['index46f22f2a56ddd091f4b2b2c35c5ca989'] = 'catalogue';
$_LANGADM['index4b6f7d34a58ba399f077685951d06738'] = 'clients';
$_LANGADM['index50d7eaecd64b277cdaac58e0cd48ad83'] = 'adresse IP';
$_LANGADM['index12c500ed0b7879105fb46af0f246be87'] = 'commandes';
$_LANGADM['index56deca22a707214865f7ea3ae6391d67'] = 'factures';
$_LANGADM['index8642a2f37a5d42b54ce53b1fbdd1583f'] = 'paniers';