//merge 1.4 => 1.5
This commit is contained in:
@@ -540,8 +540,8 @@ class AdminImport extends AdminTab
|
|||||||
$res = $category->update();
|
$res = $category->update();
|
||||||
|
|
||||||
// If no id_category or update failed
|
// If no id_category or update failed
|
||||||
if (!$res AND $res = $category->add())
|
if (!$res)
|
||||||
$category->addGroups(array(1));
|
$res = $category->add();
|
||||||
}
|
}
|
||||||
//copying images of categories
|
//copying images of categories
|
||||||
if (isset($category->image) AND !empty($category->image))
|
if (isset($category->image) AND !empty($category->image))
|
||||||
|
|||||||
@@ -89,16 +89,16 @@ class AdminModules extends AdminTab
|
|||||||
'PS_SHOW_ENABLED_MODULES_'.$id_employee
|
'PS_SHOW_ENABLED_MODULES_'.$id_employee
|
||||||
));
|
));
|
||||||
//reset filtre
|
//reset filtre
|
||||||
if (Tools::isSubmit('desactive') && $filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee] != 'enabledDisabled')
|
if (Tools::isSubmit('desactive') && isset($filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee]) && $filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee] != 'enabledDisabled')
|
||||||
$this->setFilterModules($filter_conf['PS_SHOW_TYPE_MODULES_'.$id_employee], $filter_conf['PS_SHOW_COUNTRY_MODULES_'.$id_employee], $filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee], 'disabled');
|
$this->setFilterModules($filter_conf['PS_SHOW_TYPE_MODULES_'.$id_employee], $filter_conf['PS_SHOW_COUNTRY_MODULES_'.$id_employee], $filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee], 'disabled');
|
||||||
|
|
||||||
if (Tools::isSubmit('active') && $filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee] != 'enabledDisabled')
|
if (Tools::isSubmit('active') && isset($filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee]) && $filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee] != 'enabledDisabled')
|
||||||
$this->setFilterModules($filter_conf['PS_SHOW_TYPE_MODULES_'.$id_employee], $filter_conf['PS_SHOW_COUNTRY_MODULES_'.$id_employee], $filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee], 'enabled');
|
$this->setFilterModules($filter_conf['PS_SHOW_TYPE_MODULES_'.$id_employee], $filter_conf['PS_SHOW_COUNTRY_MODULES_'.$id_employee], $filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee], 'enabled');
|
||||||
|
|
||||||
if (Tools::isSubmit('uninstall') && $filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee] != 'installedUninstalled')
|
if (Tools::isSubmit('uninstall') && isset($filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee]) && $filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee] != 'installedUninstalled')
|
||||||
$this->setFilterModules($filter_conf['PS_SHOW_TYPE_MODULES_'.$id_employee], $filter_conf['PS_SHOW_COUNTRY_MODULES_'.$id_employee], 'unistalled', $filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee]);
|
$this->setFilterModules($filter_conf['PS_SHOW_TYPE_MODULES_'.$id_employee], $filter_conf['PS_SHOW_COUNTRY_MODULES_'.$id_employee], 'unistalled', $filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee]);
|
||||||
|
|
||||||
if (Tools::isSubmit('install') && $filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee] != 'installedUninstalled')
|
if (Tools::isSubmit('install') && isset($filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee]) && $filter_conf['PS_SHOW_INSTALLED_MODULES_'.$id_employee] != 'installedUninstalled')
|
||||||
$this->setFilterModules($filter_conf['PS_SHOW_TYPE_MODULES_'.$id_employee], $filter_conf['PS_SHOW_COUNTRY_MODULES_'.$id_employee], 'installed', $filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee]);
|
$this->setFilterModules($filter_conf['PS_SHOW_TYPE_MODULES_'.$id_employee], $filter_conf['PS_SHOW_COUNTRY_MODULES_'.$id_employee], 'installed', $filter_conf['PS_SHOW_ENABLED_MODULES_'.$id_employee]);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* 2007-2011 PrestaShop
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.txt.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* http://opensource.org/licenses/osl-3.0.php
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to http://www.prestashop.com for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA <contact@prestashop.com>
|
||||||
|
* @copyright 2007-2011 PrestaShop SA
|
||||||
|
* @version Release: $Revision: 1.4 $
|
||||||
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||||
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
|
*/
|
||||||
|
|
||||||
|
function alter_blocklink()
|
||||||
|
{
|
||||||
|
// No one will know if the table does not exist :] Thanks Damien for your solution ;)
|
||||||
|
DB::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'blocklink_lang` CHANGE `id_link` `id_blocklink` INT( 10 ) UNSIGNED NOT NULL');
|
||||||
|
|
||||||
|
DB::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'blocklink` CHANGE `id_link` `id_blocklink` INT( 10 ) UNSIGNED NOT NULL');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -2,3 +2,4 @@ SET NAMES 'utf8';
|
|||||||
|
|
||||||
ALTER TABLE `PREFIX_tab_lang` MODIFY `id_lang` int(10) unsigned NOT NULL AFTER `id_tab`;
|
ALTER TABLE `PREFIX_tab_lang` MODIFY `id_lang` int(10) unsigned NOT NULL AFTER `id_tab`;
|
||||||
|
|
||||||
|
/* PHP:alter_blocklink(); */;
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'update_for_13version.php');
|
|||||||
|
|
||||||
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'alter_cms_block.php');
|
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'alter_cms_block.php');
|
||||||
|
|
||||||
|
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'alter_blocklink.php');
|
||||||
|
|
||||||
//old version detection
|
//old version detection
|
||||||
global $oldversion;
|
global $oldversion;
|
||||||
$oldversion = false;
|
$oldversion = false;
|
||||||
|
|||||||
@@ -849,4 +849,5 @@ if (!isset($doneCategories[(int)$id_category]['p']))
|
|||||||
|
|
||||||
return $products;
|
return $products;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,17 +53,17 @@ class BlockLink extends Module
|
|||||||
!$this->registerHook('leftColumn') OR
|
!$this->registerHook('leftColumn') OR
|
||||||
!Db::getInstance()->Execute('
|
!Db::getInstance()->Execute('
|
||||||
CREATE TABLE '._DB_PREFIX_.'blocklink (
|
CREATE TABLE '._DB_PREFIX_.'blocklink (
|
||||||
`id_link` int(2) NOT NULL AUTO_INCREMENT,
|
`id_blocklink` int(2) NOT NULL AUTO_INCREMENT,
|
||||||
`url` varchar(255) NOT NULL,
|
`url` varchar(255) NOT NULL,
|
||||||
`new_window` TINYINT(1) NOT NULL,
|
`new_window` TINYINT(1) NOT NULL,
|
||||||
PRIMARY KEY(`id_link`))
|
PRIMARY KEY(`id_blocklink`))
|
||||||
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
|
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
|
||||||
!Db::getInstance()->Execute('
|
!Db::getInstance()->Execute('
|
||||||
CREATE TABLE '._DB_PREFIX_.'blocklink_lang (
|
CREATE TABLE '._DB_PREFIX_.'blocklink_lang (
|
||||||
`id_link` int(2) NOT NULL,
|
`id_blocklink` int(2) NOT NULL,
|
||||||
`id_lang` int(2) NOT NULL,
|
`id_lang` int(2) NOT NULL,
|
||||||
`text` varchar(64) NOT NULL,
|
`text` varchar(64) NOT NULL,
|
||||||
PRIMARY KEY(`id_link`, `id_lang`))
|
PRIMARY KEY(`id_blocklink`, `id_lang`))
|
||||||
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
|
ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR
|
||||||
!Configuration::updateValue('PS_BLOCKLINK_TITLE', array('1' => 'Block link', '2' => 'Bloc lien')))
|
!Configuration::updateValue('PS_BLOCKLINK_TITLE', array('1' => 'Block link', '2' => 'Bloc lien')))
|
||||||
return false;
|
return false;
|
||||||
@@ -106,16 +106,16 @@ class BlockLink extends Module
|
|||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
/* Get id and url */
|
/* Get id and url */
|
||||||
if (!$links = Db::getInstance()->ExecuteS('SELECT `id_link`, `url`, `new_window` FROM '._DB_PREFIX_.'blocklink'.((int)(Configuration::get('PS_BLOCKLINK_ORDERWAY')) == 1 ? ' ORDER BY `id_link` DESC' : '')))
|
if (!$links = Db::getInstance()->ExecuteS('SELECT `id_blocklink`, `url`, `new_window` FROM '._DB_PREFIX_.'blocklink'.((int)(Configuration::get('PS_BLOCKLINK_ORDERWAY')) == 1 ? ' ORDER BY `id_blocklink` DESC' : '')))
|
||||||
return false;
|
return false;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($links AS $link)
|
foreach ($links AS $link)
|
||||||
{
|
{
|
||||||
$result[$i]['id'] = $link['id_link'];
|
$result[$i]['id'] = $link['id_blocklink'];
|
||||||
$result[$i]['url'] = $link['url'];
|
$result[$i]['url'] = $link['url'];
|
||||||
$result[$i]['newWindow'] = $link['new_window'];
|
$result[$i]['newWindow'] = $link['new_window'];
|
||||||
/* Get multilingual text */
|
/* Get multilingual text */
|
||||||
if (!$texts = Db::getInstance()->ExecuteS('SELECT `id_lang`, `text` FROM '._DB_PREFIX_.'blocklink_lang WHERE `id_link`='.(int)($link['id_link'])))
|
if (!$texts = Db::getInstance()->ExecuteS('SELECT `id_lang`, `text` FROM '._DB_PREFIX_.'blocklink_lang WHERE `id_blocklink`='.(int)($link['id_blocklink'])))
|
||||||
return false;
|
return false;
|
||||||
foreach ($texts AS $text)
|
foreach ($texts AS $text)
|
||||||
$result[$i]['text_'.$text['id_lang']] = $text['text'];
|
$result[$i]['text_'.$text['id_lang']] = $text['text'];
|
||||||
@@ -149,14 +149,14 @@ class BlockLink extends Module
|
|||||||
public function updateLink()
|
public function updateLink()
|
||||||
{
|
{
|
||||||
/* Url registration */
|
/* Url registration */
|
||||||
if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'blocklink SET `url`=\''.pSQL($_POST['url']).'\', `new_window`='.(isset($_POST['newWindow']) ? 1 : 0).' WHERE `id_link`='.(int)($_POST['id'])))
|
if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'blocklink SET `url`=\''.pSQL($_POST['url']).'\', `new_window`='.(isset($_POST['newWindow']) ? 1 : 0).' WHERE `id_blocklink`='.(int)($_POST['id'])))
|
||||||
return false;
|
return false;
|
||||||
/* Multilingual text */
|
/* Multilingual text */
|
||||||
$languages = Language::getLanguages();
|
$languages = Language::getLanguages();
|
||||||
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
|
||||||
if (!$languages)
|
if (!$languages)
|
||||||
return false;
|
return false;
|
||||||
if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink_lang WHERE `id_link` = '.(int)($_POST['id'])))
|
if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink_lang WHERE `id_blocklink` = '.(int)($_POST['id'])))
|
||||||
return false ;
|
return false ;
|
||||||
foreach ($languages AS $language)
|
foreach ($languages AS $language)
|
||||||
if (!empty($_POST['text_'.$language['id_lang']]))
|
if (!empty($_POST['text_'.$language['id_lang']]))
|
||||||
@@ -172,7 +172,7 @@ class BlockLink extends Module
|
|||||||
|
|
||||||
public function deleteLink()
|
public function deleteLink()
|
||||||
{
|
{
|
||||||
return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink WHERE `id_link`='.(int)($_GET['id']));
|
return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink WHERE `id_blocklink`='.(int)($_GET['id']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateTitle()
|
public function updateTitle()
|
||||||
|
|||||||
@@ -9,4 +9,5 @@
|
|||||||
<confirmUninstall>Are you sure you want to delete all your links ?</confirmUninstall>
|
<confirmUninstall>Are you sure you want to delete all your links ?</confirmUninstall>
|
||||||
<is_configurable>1</is_configurable>
|
<is_configurable>1</is_configurable>
|
||||||
<need_instance>1</need_instance>
|
<need_instance>1</need_instance>
|
||||||
</module>
|
<limited_countries></limited_countries>
|
||||||
|
</module>
|
||||||
|
|||||||
Reference in New Issue
Block a user