[*] BO : you can now disable automatic indexation of the products #PSCFV-3258

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16528 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-07-23 10:55:35 +00:00
parent 6a5d3f8e0e
commit da117efe58
6 changed files with 22 additions and 9 deletions
+2 -2
View File
@@ -4712,7 +4712,7 @@ class ProductCore extends ObjectModel
public function addWs($autodate = true, $null_values = false)
{
$success = parent::add($autodate, $null_values);
if ($success)
if ($success && Configuration::get('PS_SEARCH_INDEXATION'))
Search::indexation(false, $this->id);
return $success;
}
@@ -4720,7 +4720,7 @@ class ProductCore extends ObjectModel
public function updateWs($null_values = false)
{
$success = parent::update($null_values);
if ($success)
if ($success && Configuration::get('PS_SEARCH_INDEXATION'))
Search::indexation(false, $this->id);
return $success;
}
+2 -1
View File
@@ -200,7 +200,8 @@ class TagCore extends ObjectModel
if ($result)
{
$result &= Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'product_tag (id_product, id_tag) VALUES '.implode(',', $ids));
$result &= Search::indexation(false);
if (Configuration::get('PS_SEARCH_INDEXATION'))
$result &= Search::indexation(false);
}
}
return $result;
+2 -1
View File
@@ -1397,7 +1397,8 @@ class AdminImportControllerCore extends AdminController
}
Search::indexation(true);
if (Configuration::get('PS_SEARCH_INDEXATION'))
Search::indexation(true);
$this->closeCsvFile($handle);
}
@@ -455,7 +455,7 @@ class AdminProductsControllerCore extends AdminController
else
{
Hook::exec('actionProductAdd', array('product' => $product));
if (in_array($product->visibility, array('both', 'search')))
if (in_array($product->visibility, array('both', 'search')) && Configuration::get('PS_SEARCH_INDEXATION'))
Search::indexation(false, $product->id);
$this->redirect_after = self::$currentIndex.(Tools::getIsset('id_category') ? '&id_category='.(int)Tools::getValue('id_category') : '').'&conf=19&token='.$this->token;
}
@@ -1483,7 +1483,7 @@ class AdminProductsControllerCore extends AdminController
else
{
Hook::exec('actionProductAdd', array('product' => $this->object));
if (in_array($this->object->visibility, array('both', 'search')))
if (in_array($this->object->visibility, array('both', 'search')) && Configuration::get('PS_SEARCH_INDEXATION'))
Search::indexation(false, $this->object->id);
}
@@ -1610,7 +1610,7 @@ class AdminProductsControllerCore extends AdminController
{
Hook::exec('actionProductUpdate', array('product' => $object));
if (in_array($object->visibility, array('both', 'search')))
if (in_array($object->visibility, array('both', 'search')) && Configuration::get('PS_SEARCH_INDEXATION'))
Search::indexation(false, $object->id);
// Save and preview
@@ -73,7 +73,16 @@ class AdminSearchConfControllerCore extends AdminController
$this->l('Add missing products to index.').'</a><br />
-&gt; <a href="searchcron.php?full=1&token='.substr(_COOKIE_KEY_, 34, 8).'&redirect=1" class="bold">'.
$this->l('Re-build entire index.').'</a><br /><br />
'.$this->l('You can set a cron job that will rebuild your index using the following URL:').' <a href="'.$cron_url.'">'.$cron_url.'</a>'
'.$this->l('You can set a cron job that will rebuild your index using the following URL:').' <a href="'.$cron_url.'">'.$cron_url.'</a>',
'fields' => array(
'PS_SEARCH_INDEXATION' => array(
'title' => $this->l('Indexation'),
'validation' => 'isBool',
'type' => 'bool',
'cast' => 'intval',
'desc' => $this->l('Enable automatic indexation of the products. If you enable this feature, the products will be indexed in the search automatically when they are saved, but if the feature is disabled, you will have to index the products manually by using the links provided in this fieldset.')
)
)
),
'search' => array(
'title' => $this->l('Search'),
+3 -1
View File
@@ -22,4 +22,6 @@ CREATE TABLE IF NOT EXISTS `PREFIX_order_invoice_tax` (
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
ALTER TABLE `PREFIX_order_invoice`
ADD `shipping_tax_computation_method` INT NOT NULL AFTER `total_shipping_tax_incl`;
ADD `shipping_tax_computation_method` INT NOT NULL AFTER `total_shipping_tax_incl`;
INSERT INTO `PREFIX_configuration`(`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_SEARCH_INDEXATION', '1', NOW(), NOW());