Merge pull request #3 from PrestaShop/development

update from prestashop/development
This commit is contained in:
Cosmin Hutanu
2013-09-30 02:47:52 -07:00
9 changed files with 50 additions and 53 deletions
+2 -2
View File
@@ -139,7 +139,7 @@ class AttributeCore extends ObjectModel
ON (a.`id_attribute` = al.`id_attribute` AND al.`id_lang` = '.(int)$id_lang.')
'.Shop::addSqlAssociation('attribute_group', 'ag').'
'.Shop::addSqlAssociation('attribute', 'a').'
'.($not_null ? 'WHERE a.`id_attribute` IS NOT NULL AND al.`name` IS NOT NULL' : '').'
'.($not_null ? 'WHERE a.`id_attribute` IS NOT NULL AND al.`name` IS NOT NULL AND agl.`id_attribute_group` IS NOT NULL' : '').'
ORDER BY agl.`name` ASC, a.`position` ASC
');
}
@@ -343,4 +343,4 @@ class AttributeCore extends ObjectModel
return (is_numeric($position)) ? $position : -1;
}
}
}
+28 -18
View File
@@ -30,6 +30,7 @@ class AdminGroupsControllerCore extends AdminController
{
$this->table = 'group';
$this->className = 'Group';
$this->list_id = 'group';
$this->lang = true;
$this->addRowAction('edit');
$this->addRowAction('view');
@@ -153,6 +154,16 @@ class AdminGroupsControllerCore extends AdminController
if (Tools::isSubmit('changeShowPricesVal') && $this->id_object)
$this->action = 'change_show_prices_val';
if (Tools::getIsset('viewgroup'))
{
$this->list_id = 'customer_group';
if (isset($_POST['submitReset'.$this->list_id]))
$this->processResetFilters();
}
else
$this->list_id = 'group';
parent::initProcess();
}
@@ -181,30 +192,29 @@ class AdminGroupsControllerCore extends AdminController
$genders_icon[$gender->id] = '../genders/'.(int)$gender->id.'.jpg';
$genders[$gender->id] = $gender->name;
}
$customer_fields_display = (array(
'id_customer' => array('title' => $this->l('ID'), 'width' => 15, 'align' => 'center'),
$this->table = 'customer_group';
$this->lang = false;
$this->list_id = 'customer_group';
$this->actions = array();
$this->bulk_actions = false;
$this->list_no_link = true;
$this->fields_list = (array(
'id_customer' => array('title' => $this->l('ID'), 'width' => 15, 'align' => 'center', 'filter_key' => 'c!id_customer'),
'id_gender' => array('title' => $this->l('Titles'), 'align' => 'center', 'width' => 50,'icon' => $genders_icon, 'list' => $genders),
'firstname' => array('title' => $this->l('Name'), 'align' => 'center'),
'lastname' => array('title' => $this->l('Name'), 'align' => 'center'),
'email' => array('title' => $this->l('Email address'), 'width' => 150, 'align' => 'center'),
'firstname' => array('title' => $this->l('First name'), 'align' => 'center'),
'lastname' => array('title' => $this->l('Last name'), 'align' => 'center'),
'email' => array('title' => $this->l('Email address'), 'width' => 150, 'align' => 'center', 'filter_key' => 'c!email', 'orderby' => true),
'birthday' => array('title' => $this->l('Birth date'), 'width' => 150, 'align' => 'right', 'type' => 'date'),
'date_add' => array('title' => $this->l('Register date'), 'width' => 150, 'align' => 'right', 'type' => 'date'),
'orders' => array('title' => $this->l('Orders'), 'align' => 'center'),
'active' => array('title' => $this->l('Enabled'),'align' => 'center','width' => 20, 'active' => 'status','type' => 'bool')
));
$customer_list = $group->getCustomers(false, 0, 100, true);
$helper = new HelperList();
$helper->currentIndex = Context::getContext()->link->getAdminLink('AdminCustomers', false);
$helper->token = Tools::getAdminTokenLite('AdminCustomers');
$helper->shopLinkType = '';
$helper->table = 'customer';
$helper->identifier = 'id_customer';
$helper->actions = array('edit', 'view');
$helper->show_toolbar = false;
return $helper->generateList($customer_list, $customer_fields_display);
$this->_select = 'c.*';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (a.`id_customer` = c.`id_customer`)';
$this->_where = 'AND a.`id_group` = '.(int)$group->id.' AND c.`deleted` != 1';
self::$currentIndex = self::$currentIndex.'&viewgroup';
$this->processFilter();
return parent::renderList();
}
public function renderForm()
@@ -58,10 +58,8 @@ class AdminInvoicesControllerCore extends AdminController
'PS_INVOICE_FREE_TEXT' => array(
'title' => $this->l('Footer text:'),
'desc' => $this->l('This text will appear at the bottom of the invoice'),
'size' => 6,
'type' => 'textareaLang',
'cols' => 40,
'rows' => 8
'size' => 50,
'type' => 'textLang',
),
'PS_INVOICE_MODEL' => array(
'title' => $this->l('Invoice model:'),
@@ -2023,7 +2023,7 @@ class AdminProductsControllerCore extends AdminController
// Check multilingual fields validity
foreach ($rules['validateLang'] as $fieldLang => $function)
foreach ($languages as $language)
if ($this->isProductFieldUpdated('description_short', $language['id_lang']) && ($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])))
if ($this->isProductFieldUpdated($fieldLang, $language['id_lang']) && ($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])))
if (!Validate::$function($value, (int)Configuration::get('PS_ALLOW_HTML_IFRAME')))
$this->errors[] = sprintf(
Tools::displayError('The %1$s field (%2$s) is invalid.'),
@@ -372,6 +372,7 @@ class ParentOrderControllerCore extends FrontController
'currencyFormat' => $this->context->currency->format,
'currencyBlank' => $this->context->currency->blank,
'show_option_allow_separate_package' => $show_option_allow_separate_package,
'smallSize' => Image::getSize(ImageType::getFormatedName('small')),
));
+3 -1
View File
@@ -76,11 +76,13 @@ var moderation_active = {$moderation_active};
</div>
{/if}
{/foreach}
{if (!$too_early AND ($logged OR $allow_guests))}
<p class="align_center">
<a id="new_comment_tab_btn" class="open-comment-form" href="#new_comment_form">{l s='Write your review' mod='productcomments'} !</a>
</p>
{/if}
{else}
{if ($too_early == false AND ($logged OR $allow_guests))}
{if (!$too_early AND ($logged OR $allow_guests))}
<p class="align_center">
<a id="new_comment_tab_btn" class="open-comment-form" href="#new_comment_form">{l s='Be the first to write your review' mod='productcomments'} !</a>
</p>
+6 -12
View File
@@ -31,23 +31,17 @@ $('document').ready(function(){
});
$('#sendEmail').click(function(){
var datas = [];
$('#send_friend_form_content').find(':input').each(function(index){
var o = {};
o.key = $(this).attr('name');
o.value = $(this).val();
if (o.value != '')
datas.push(o);
});
if (datas.length >= 3)
var name = $('#friend_name').val();
var email = $('#friend_email').val();
var id_product = $('#id_product_comment_send').val();
if (name && email && !isNaN(id_product))
{
$.ajax({
{/literal}url: "{$module_dir}sendtoafriend_ajax.php",{literal}
type: "POST",
headers: {"cache-control": "no-cache"},
data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', friend: unescape(JSON.stringify(datas).replace(/\\u/g, '%u'))},{/literal}{literal}
data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', name: name, email: email, id_product: id_product},{/literal}{literal}
dataType: "json",
success: function(result) {
$.fancybox.close();
+3 -13
View File
@@ -33,19 +33,9 @@ $module = new SendToAFriend();
if (Tools::getValue('action') == 'sendToMyFriend' && Tools::getValue('secure_key') == $module->secure_key)
{
$friend_infos = Tools::jsonDecode(Tools::getValue('friend'));
$friendName = "";
$friendMail = "";
$id_product = null;
foreach ($friend_infos as $entry)
{
if ($entry->key == "friend_name")
$friendName = $entry->value;
else if ($entry->key == "friend_email")
$friendMail = $entry->value;
else if ($entry->key == "id_product")
$id_product = $entry->value;
}
$friendName = Tools::getValue('name');
$friendMail = Tools::getValue('email');
$id_product = Tools::getValue('id_product');
if (!$friendName || !$friendMail || !$id_product)
die('0');
@@ -76,11 +76,13 @@ var moderation_active = {$moderation_active};
</div>
{/if}
{/foreach}
{if (!$too_early AND ($logged OR $allow_guests))}
<p class="align_center">
<a id="new_comment_tab_btn" class="open-comment-form" href="#new_comment_form">{l s='Write your review' mod='productcomments'} !</a>
</p>
{/if}
{else}
{if ($too_early == false AND ($logged OR $allow_guests))}
{if (!$too_early AND ($logged OR $allow_guests))}
<p class="align_center">
<a id="new_comment_tab_btn" class="open-comment-form" href="#new_comment_form">{l s='Be the first to write your review' mod='productcomments'} !</a>
</p>
@@ -141,7 +143,7 @@ var moderation_active = {$moderation_active};
{/if}
<div id="new_comment_form_footer">
<input id="id_product_comment_send" name="id_product" type="hidden" value='{$id_product_comment_form}'></input>
<input id="id_product_comment_send" name="id_product" type="hidden" value='{$id_product_comment_form}' />
<p class="fl required"><sup>*</sup> {l s='Required fields' mod='productcomments'}</p>
<p class="fr">
<button id="submitNewMessage" name="submitMessage" type="submit">{l s='Send' mod='productcomments'}</button>&nbsp;