// Merge -> 8910

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8917 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-09-30 08:17:25 +00:00
parent 4b56fa5c68
commit 3620f0837f
28 changed files with 2046 additions and 118 deletions
+18 -18
View File
@@ -1,6 +1,6 @@
<?php
/*
* 2007-2011 PrestaShop
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
@@ -31,27 +31,27 @@ class AdminStores extends AdminTab
{
/** @var array countries list */
private $countriesArray = array();
public function __construct()
{
$this->context = Context::getContext();
$this->context = Context::getContext();
$this->table = 'store';
$this->className = 'Store';
$this->lang = false;
$this->edit = true;
$this->delete = true;
$this->fieldImageSettings = array('name' => 'image', 'dir' => 'st');
$this->_select = 'cl.`name` country, st.`name` state';
$this->_join = '
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')
LEFT JOIN `'._DB_PREFIX_.'state` st ON (st.`id_state` = a.`id_state`)';
$countries = Country::getCountries($this->context->language->id);
foreach ($countries AS $country)
$this->countriesArray[$country['id_country']] = $country['name'];
$this->fieldsDisplay = array(
'id_store' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'country' => array('title' => $this->l('Country'), 'width' => 100, 'filter_key' => 'cl!name'),
@@ -78,7 +78,7 @@ class AdminStores extends AdminTab
);
parent::__construct();
}
protected function postImage($id)
{
$ret = parent::postImage($id);
@@ -90,14 +90,14 @@ class AdminStores extends AdminTab
}
return $ret;
}
public function displayOptionsList()
{
parent::displayOptionsList();
echo '<br /><p><img src="../img/admin/asterisk.gif" class="middle" /> '.$this->l('You can also replace the icon representing your store in Google Maps. Go to the Preferences tab, and then the Appearance subtab.').'</p>';
}
public function postProcess()
{
if (isset($_POST['submitAdd'.$this->table]))
@@ -152,11 +152,11 @@ class AdminStores extends AdminTab
if (!sizeof($this->_errors))
parent::postProcess();
}
public function displayForm($isMainTab = true)
{
parent::displayForm();
if (!($obj = $this->loadObject(true)))
return;
echo '
@@ -234,7 +234,7 @@ class AdminStores extends AdminTab
</div>
<label>'.$this->l('Latitude / Longitude:').'</label>
<div class="margin-form">
<input type="text" size="8" maxlength="10" name="latitude" value="'.htmlentities($this->getFieldValue($obj, 'latitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" /> / <input type="text" size="8" maxlength="10" name="longitude" value="'.htmlentities($this->getFieldValue($obj, 'longitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" />
<input type="text" size="11" maxlength="12" name="latitude" value="'.htmlentities($this->getFieldValue($obj, 'latitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" /> / <input type="text" size="11" maxlength="12" name="longitude" value="'.htmlentities($this->getFieldValue($obj, 'longitude'), ENT_COMPAT, 'UTF-8').'" onKeyUp="javascript:this.value = this.value.replace(/,/g, \'.\');" />
<sup>*</sup>
<p class="clear">'.$this->l('Store coords, eg. 45.265469 / -47.226478').'</p>
</div>
@@ -270,7 +270,7 @@ class AdminStores extends AdminTab
<p class="clear">'.$this->l('Store window picture').'</p>';
echo $this->displayImage($obj->id, _PS_STORE_IMG_DIR_.'/'.$obj->id.'.jpg', 350, NULL, Tools::getAdminToken('AdminStores'.(int)(Tab::getIdFromClassName('AdminStores')).(int)$this->context->employee->id), true);
echo '</div>
<table cellpadding="2" cellspacing="2" style="padding: 10px; margin-top: 15px; border: 1px solid #BBB;">
<tr>
@@ -280,7 +280,7 @@ class AdminStores extends AdminTab
<td>&nbsp;</td>
<td style="font-size: 0.85em;">'.$this->l('Sample: 10:00AM - 9:30PM').'</td>
</tr>';
$days = array();
$days[1] = $this->l('Monday');
$days[2] = $this->l('Tuesday');
@@ -289,11 +289,11 @@ class AdminStores extends AdminTab
$days[5] = $this->l('Friday');
$days[6] = $this->l('Saturday');
$days[7] = $this->l('Sunday');
$hours = $this->getFieldValue($obj, 'hours');
if (!empty($hours))
$hoursUnserialized = unserialize($hours);
for ($i = 1; $i < 8; $i++)
echo '
<tr style="color: #7F7F7F; font-size: 0.85em;">