// Fix some bug on multishop + improve display of shop pages
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10518 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -31,7 +31,7 @@ class AdminContactControllerCore extends AdminController
|
||||
{
|
||||
$this->className = 'Configuration';
|
||||
$this->table = 'configuration';
|
||||
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$temporyArrayFields = $this->_getDefaultFieldsContent();
|
||||
@@ -40,7 +40,7 @@ class AdminContactControllerCore extends AdminController
|
||||
|
||||
private function _getDefaultFieldsContent()
|
||||
{
|
||||
$this->context = Context::getContext();
|
||||
$this->context = Context::getContext();
|
||||
$countryList = array();
|
||||
$countryList[] = array('id' => '0', 'name' => $this->l('Choose your country'));
|
||||
foreach (Country::getCountries($this->context->language->id) AS $country)
|
||||
@@ -49,7 +49,7 @@ class AdminContactControllerCore extends AdminController
|
||||
$stateList[] = array('id' => '0', 'name' => $this->l('Choose your state (if applicable)'));
|
||||
foreach (State::getStates($this->context->language->id) AS $state)
|
||||
$stateList[] = array('id' => $state['id_state'], 'name' => $state['name']);
|
||||
|
||||
|
||||
$formFields = array(
|
||||
'PS_SHOP_NAME' => array('title' => $this->l('Shop name:'), 'desc' => $this->l('Displayed in e-mails and page titles'), 'validation' => 'isGenericName', 'required' => true, 'size' => 30, 'type' => 'text'),
|
||||
'PS_SHOP_EMAIL' => array('title' => $this->l('Shop e-mail:'), 'desc' => $this->l('Displayed in e-mails sent to customers'), 'validation' => 'isEmail', 'required' => true, 'size' => 30, 'type' => 'text'),
|
||||
@@ -77,10 +77,10 @@ class AdminContactControllerCore extends AdminController
|
||||
'PS_SHOP_CODE' => 'postcode',
|
||||
'PS_SHOP_COUNTRY_ID' => 'Country:name',
|
||||
'PS_SHOP_PHONE' => 'phone');
|
||||
|
||||
|
||||
$fields = array();
|
||||
$orderedFields = AddressFormat::getOrderedAddressFields(Configuration::get('PS_SHOP_COUNTRY_ID'), false, true);
|
||||
|
||||
|
||||
foreach($orderedFields as $lineFields)
|
||||
if (($patterns = explode(' ', $lineFields)))
|
||||
foreach($patterns as $pattern)
|
||||
@@ -89,7 +89,7 @@ class AdminContactControllerCore extends AdminController
|
||||
foreach($formFields as $key => $value)
|
||||
if (!isset($fields[$key]))
|
||||
$fields[$key] = $formFields[$key];
|
||||
|
||||
|
||||
$this->options = array(
|
||||
'general' => array(
|
||||
'title' => $this->l('Contact details'),
|
||||
|
||||
@@ -42,9 +42,25 @@ class AdminGroupShopControllerCore extends AdminController
|
||||
$this->deleted = false;
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_group_shop' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'name' => array('title' => $this->l('County'), 'width' => 130, 'filter_key' => 'b!name'),
|
||||
'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'active'),
|
||||
'id_group_shop' => array(
|
||||
'title' => $this->l('ID'),
|
||||
'align' => 'center',
|
||||
'width' => 25,
|
||||
),
|
||||
'name' => array(
|
||||
'title' => $this->l('Group shop'),
|
||||
'width' => 'auto',
|
||||
'filter_key' => 'b!name',
|
||||
),
|
||||
'active' => array(
|
||||
'title' => $this->l('Enabled'),
|
||||
'align' => 'center',
|
||||
'active' => 'status',
|
||||
'type' => 'bool',
|
||||
'orderby' => false,
|
||||
'filter_key' => 'active',
|
||||
'width' => 50,
|
||||
),
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
@@ -155,7 +171,7 @@ class AdminGroupShopControllerCore extends AdminController
|
||||
'tax_rules_group' => $this->l('Tax rules groups'),
|
||||
'zone' => $this->l('Zones'),
|
||||
);
|
||||
|
||||
|
||||
if (!$this->object->id)
|
||||
$this->fields_import_form = array(
|
||||
'legend' => array(
|
||||
|
||||
@@ -42,16 +42,16 @@ class AdminShopControllerCore extends AdminController
|
||||
),
|
||||
'name' => array(
|
||||
'title' => $this->l('Shop'),
|
||||
'width' => 130,
|
||||
'width' => 'auto',
|
||||
'filter_key' => 'b!name'
|
||||
),
|
||||
'group_shop_name' => array(
|
||||
'title' => $this->l('Group Shop'),
|
||||
'width' => 70
|
||||
'width' => 150
|
||||
),
|
||||
'category_name' => array(
|
||||
'title' => $this->l('Category Root'),
|
||||
'width' => 70
|
||||
'width' => 150
|
||||
),
|
||||
'active' => array(
|
||||
'title' => $this->l('Enabled'),
|
||||
@@ -59,7 +59,8 @@ class AdminShopControllerCore extends AdminController
|
||||
'active' => 'status',
|
||||
'type' => 'bool',
|
||||
'orderby' => false,
|
||||
'filter_key' => 'active'
|
||||
'filter_key' => 'active',
|
||||
'width' => 50,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -82,10 +83,10 @@ class AdminShopControllerCore extends AdminController
|
||||
);
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
$id_shop = ($this->context->shop->getContextType() == Shop::CONTEXT_SHOP ? $this->context->shop->id : false);
|
||||
$shops = Shop::getShopWithoutUrls($id_shop);
|
||||
$shops = Shop::getShopWithoutUrls();
|
||||
if (count($shops))
|
||||
{
|
||||
$shop_url_configuration = '';
|
||||
@@ -93,9 +94,9 @@ class AdminShopControllerCore extends AdminController
|
||||
$shop_url_configuration .= sprintf($this->l('No url is configured for shop: %s'), '<b>'.$shop['name'].'</b>').' <a href="'.$this->context->link->getAdminLink('AdminShopUrl').'&addshop_url&id_shop='.$shop['id_shop'].'">'.$this->l('click here').'</a><br />';
|
||||
$this->content .= '<div class="warn">'.$shop_url_configuration.'</div>';
|
||||
}
|
||||
parent::initContent();
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
|
||||
public function initList()
|
||||
{
|
||||
$this->addRowAction('edit');
|
||||
|
||||
@@ -40,13 +40,48 @@ class AdminShopUrlControllerCore extends AdminController
|
||||
$this->deleted = false;
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_shop_url' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'domain' => array('title' => $this->l('Domain'), 'width' => 130, 'filter_key' => 'domain'),
|
||||
'domain_ssl' => array('title' => $this->l('Domain SSL'), 'width' => 130, 'filter_key' => 'domain'),
|
||||
'uri' => array('title' => $this->l('Uri'), 'width' => 130, 'filter_key' => 'uri'),
|
||||
'shop_name' => array('title' => $this->l('Shop name'), 'width' => 70),
|
||||
'main' => array('title' => $this->l('Main URL'), 'align' => 'center', 'activeVisu' => 'main', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'main'),
|
||||
'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'active'),
|
||||
'id_shop_url' => array(
|
||||
'title' => $this->l('ID'),
|
||||
'align' => 'center',
|
||||
'width' => 25
|
||||
),
|
||||
'domain' => array(
|
||||
'title' => $this->l('Domain'),
|
||||
'width' => 'auto',
|
||||
'filter_key' => 'domain'
|
||||
),
|
||||
'domain_ssl' => array(
|
||||
'title' => $this->l('Domain SSL'),
|
||||
'width' => 130,
|
||||
'filter_key' => 'domain'
|
||||
),
|
||||
'uri' => array(
|
||||
'title' => $this->l('Uri'),
|
||||
'width' => 200,
|
||||
'filter_key' => 'uri'
|
||||
),
|
||||
'shop_name' => array(
|
||||
'title' => $this->l('Shop name'),
|
||||
'width' => 70
|
||||
),
|
||||
'main' => array(
|
||||
'title' => $this->l('Main URL'),
|
||||
'align' => 'center',
|
||||
'activeVisu' => 'main',
|
||||
'type' => 'bool',
|
||||
'orderby' => false,
|
||||
'filter_key' => 'main',
|
||||
'width' => 50,
|
||||
),
|
||||
'active' => array(
|
||||
'title' => $this->l('Enabled'),
|
||||
'align' => 'center',
|
||||
'active' => 'status',
|
||||
'type' => 'bool',
|
||||
'orderby' => false,
|
||||
'filter_key' => 'active',
|
||||
'width' => 50,
|
||||
),
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
@@ -87,14 +122,14 @@ class AdminShopUrlControllerCore extends AdminController
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Physical URI:'),
|
||||
'name' => 'physical_uri',
|
||||
'desc' => $this->l('Physical folder of your store on your server. Leave this field empty if your store is installed on root path.')
|
||||
'desc' => $this->l('Physical folder of your store on your server. Leave this field empty if your store is installed on root path. E.g. if your store is available from www.my-prestashop.com/my-store/, you have to set my-store/ in this field.')
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Virtual URI:'),
|
||||
'name' => 'virtual_uri',
|
||||
'desc' => array(
|
||||
$this->l('This virtual folder must not exist on your server and is used to associate an URI to a shop.'),
|
||||
$this->l('You can use this option if you want to create a store with an URI that doesn\'t exist on your server. E.g. if you want your store to be available with url www.my-prestashop.com/my-store/shoes/, you have to set shoes/ in this field (we considere that my-store/ is your physical URI).'),
|
||||
'<strong>'.$this->l('URL rewriting must be activated on your server to use this feature.').'</strong>'
|
||||
)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user