[-] Classes : all classes and controllers now use their name in static calls instead of self (improve override) #PSFV-376
This commit is contained in:
@@ -70,7 +70,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
/**
|
||||
* Init the available fields by export type with associated translation
|
||||
*/
|
||||
private function initExportFieldList()
|
||||
protected function initExportFieldList()
|
||||
{
|
||||
$this->exportTypeList = array(
|
||||
'global_export' => array(
|
||||
@@ -109,7 +109,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
/**
|
||||
* Init the block Menu
|
||||
*/
|
||||
private function initMenu()
|
||||
protected function initMenu()
|
||||
{
|
||||
$this->context->smarty->assign(array(
|
||||
'exportTypeList' => $this->exportTypeList,
|
||||
@@ -132,7 +132,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
$this->addJqueryUi('ui.datepicker');
|
||||
}
|
||||
|
||||
private function checkRights()
|
||||
protected function checkRights()
|
||||
{
|
||||
if (!is_writeable($this->downloadDir))
|
||||
$this->errors[] = $this->l('The download folder doesn\'t have the sufficient right…');
|
||||
@@ -214,7 +214,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* Write the exported content tout a file
|
||||
* @var array $list Result of the SQL query
|
||||
*/
|
||||
private function writeExportToFile($list)
|
||||
protected function writeExportToFile($list)
|
||||
{
|
||||
$this->checkRights();
|
||||
|
||||
@@ -241,7 +241,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
/**
|
||||
* Start the reconciliation export type
|
||||
*/
|
||||
private function runReconciliationExport()
|
||||
protected function runReconciliationExport()
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
@@ -276,7 +276,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* @param $line_number
|
||||
* @return array
|
||||
*/
|
||||
private function createLine($row, $line_number)
|
||||
protected function createLine($row, $line_number)
|
||||
{
|
||||
$line = array();
|
||||
|
||||
@@ -320,7 +320,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* @param $db_details
|
||||
* @return array
|
||||
*/
|
||||
private function buildGlobalExportlist($db_details)
|
||||
protected function buildGlobalExportlist($db_details)
|
||||
{
|
||||
// List use to write data in csv file
|
||||
$list = array();
|
||||
@@ -401,7 +401,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* Start the global export type
|
||||
*
|
||||
*/
|
||||
private function runGlobalExport()
|
||||
protected function runGlobalExport()
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
@@ -462,7 +462,7 @@ class AdminAccountingExportControllerCore extends AdminController
|
||||
* Allow to download the last export file
|
||||
* @var string File name
|
||||
*/
|
||||
private function downloadFile($fileName)
|
||||
protected function downloadFile($fileName)
|
||||
{
|
||||
$path = $this->downloadDir.$fileName;
|
||||
header('Content-length: ' . filesize($path));
|
||||
|
||||
@@ -104,7 +104,7 @@ class AdminAccountingManagementControllerCore extends AdminController
|
||||
/**
|
||||
* Update the account number for each shop liable to their zones
|
||||
*/
|
||||
private function updateAccountNumber()
|
||||
protected function updateAccountNumber()
|
||||
{
|
||||
$id_shop = $this->context->shop->getID();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
private function addAttribute($arr, $price = 0, $weight = 0)
|
||||
protected function addAttribute($arr, $price = 0, $weight = 0)
|
||||
{
|
||||
foreach ($arr as $attr)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
$first = array_pop($list);
|
||||
foreach ($first as $attribute)
|
||||
{
|
||||
$tab = self::createCombinations($list);
|
||||
$tab = AdminAttributeGeneratorController::createCombinations($list);
|
||||
foreach ($tab as $to_add)
|
||||
$res[] = is_array($to_add) ? array_merge($to_add, array($attribute)) : array($to_add, $attribute);
|
||||
}
|
||||
@@ -90,8 +90,8 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
$tab = array_values($_POST['options']);
|
||||
if (count($tab) && Validate::isLoadedObject($this->product))
|
||||
{
|
||||
self::setAttributesImpacts($this->product->id, $tab);
|
||||
$this->combinations = array_values(self::createCombinations($tab));
|
||||
AdminAttributeGeneratorController::setAttributesImpacts($this->product->id, $tab);
|
||||
$this->combinations = array_values(AdminAttributeGeneratorController::createCombinations($tab));
|
||||
$values = array_values(array_map(array($this, 'addAttribute'), $this->combinations));
|
||||
|
||||
// @since 1.5.0
|
||||
@@ -183,7 +183,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
{
|
||||
$combinations_groups = $this->product->getAttributesGroups($this->context->language->id);
|
||||
$attributes = array();
|
||||
$impacts = self::getAttributesImpacts($this->product->id);
|
||||
$impacts = AdminAttributeGeneratorController::getAttributesImpacts($this->product->id);
|
||||
foreach ($combinations_groups as &$combination)
|
||||
{
|
||||
$target = &$attributes[$combination['id_attribute_group']][$combination['id_attribute']];
|
||||
@@ -225,7 +225,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
|
||||
|
||||
$this->initGroupTable();
|
||||
|
||||
$js_attributes = self::displayAndReturnAttributeJs();
|
||||
$js_attributes = AdminAttributeGeneratorController::displayAndReturnAttributeJs();
|
||||
$attribute_groups = AttributeGroup::getAttributesGroups($this->context->language->id);
|
||||
$this->product = new Product((int)Tools::getValue('id_product'));
|
||||
|
||||
|
||||
@@ -604,7 +604,7 @@ class AdminCarriersControllerCore extends AdminController
|
||||
$object->copyCarrierData((int)$old_id);
|
||||
}
|
||||
|
||||
private function changeGroups($id_carrier, $delete = true)
|
||||
protected function changeGroups($id_carrier, $delete = true)
|
||||
{
|
||||
if ($delete)
|
||||
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$id_carrier);
|
||||
|
||||
@@ -38,7 +38,7 @@ class AdminContactControllerCore extends AdminController
|
||||
$this->_buildOrderedFieldsShop($temporyArrayFields);
|
||||
}
|
||||
|
||||
private function _getDefaultFieldsContent()
|
||||
protected function _getDefaultFieldsContent()
|
||||
{
|
||||
$this->context = Context::getContext();
|
||||
$countryList = array();
|
||||
@@ -66,7 +66,7 @@ class AdminContactControllerCore extends AdminController
|
||||
return $formFields;
|
||||
}
|
||||
|
||||
private function _buildOrderedFieldsShop($formFields)
|
||||
protected function _buildOrderedFieldsShop($formFields)
|
||||
{
|
||||
$associatedOrderKey = array(
|
||||
'PS_SHOP_NAME' => 'company',
|
||||
|
||||
@@ -402,7 +402,7 @@ class AdminCountriesControllerCore extends AdminController
|
||||
return parent::postProcess();
|
||||
}
|
||||
|
||||
private function displayValidFields()
|
||||
protected function displayValidFields()
|
||||
{
|
||||
$html = '<ul>';
|
||||
|
||||
|
||||
@@ -381,12 +381,12 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
public function initContent()
|
||||
{
|
||||
if (isset($_GET['filename']) && file_exists(_PS_UPLOAD_DIR_.$_GET['filename']))
|
||||
self::openUploadedFile();
|
||||
AdminCustomerThreadsController::openUploadedFile();
|
||||
|
||||
return parent::initContent();
|
||||
}
|
||||
|
||||
private function openUploadedFile()
|
||||
protected function openUploadedFile()
|
||||
{
|
||||
$filename = $_GET['filename'];
|
||||
|
||||
@@ -522,7 +522,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
return parent::renderView();
|
||||
}
|
||||
|
||||
private function displayMessage($message, $email = false, $id_employee = null)
|
||||
protected function displayMessage($message, $email = false, $id_employee = null)
|
||||
{
|
||||
$tpl = $this->createTemplate('message.tpl');
|
||||
|
||||
@@ -559,7 +559,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
return $tpl->fetch();
|
||||
}
|
||||
|
||||
private function displayButton($content)
|
||||
protected function displayButton($content)
|
||||
{
|
||||
return '
|
||||
<div style="margin-bottom:10px;border:1px solid #005500;width:200px;height:130px;padding:10px;background:#EFE">
|
||||
|
||||
@@ -359,7 +359,7 @@ class AdminEmployeesControllerCore extends AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
$assos = self::getAssoShop($this->table);
|
||||
$assos = AdminEmployeesController::getAssoShop($this->table);
|
||||
|
||||
if (count($assos[0]) == 0 && $this->table = 'employee')
|
||||
if (Shop::isFeatureActive() && _PS_ADMIN_PROFILE_ != $_POST['id_profile'])
|
||||
|
||||
@@ -147,7 +147,7 @@ class AdminGeolocationControllerCore extends AdminController
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
private function isGeoLiteCityAvailable()
|
||||
protected function isGeoLiteCityAvailable()
|
||||
{
|
||||
if (file_exists(_PS_GEOIP_DIR_.'GeoLiteCity.dat'))
|
||||
return true;
|
||||
|
||||
@@ -29,7 +29,7 @@ class AdminHomeControllerCore extends AdminController
|
||||
{
|
||||
const TIPS_TIMEOUT = 5;
|
||||
|
||||
private function _displayOptimizationTips()
|
||||
protected function _displayOptimizationTips()
|
||||
{
|
||||
$link = $this->context->link;
|
||||
|
||||
@@ -169,7 +169,7 @@ class AdminHomeControllerCore extends AdminController
|
||||
$this->l('Click here if you want to modify the main shop domain name').'</a>');
|
||||
}
|
||||
|
||||
private function getQuickLinks()
|
||||
protected function getQuickLinks()
|
||||
{
|
||||
$quick_links['first'] = array(
|
||||
'href' => $this->context->link->getAdminLink('AdminCategories').'&addcategory',
|
||||
|
||||
@@ -317,7 +317,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
/**
|
||||
* Delete resized image then regenerate new one with updated settings
|
||||
*/
|
||||
private function _deleteOldImages($dir, $type, $product = false)
|
||||
protected function _deleteOldImages($dir, $type, $product = false)
|
||||
{
|
||||
if (!is_dir($dir))
|
||||
return false;
|
||||
@@ -350,7 +350,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
// Regenerate images
|
||||
private function _regenerateNewImages($dir, $type, $productsImages = false)
|
||||
protected function _regenerateNewImages($dir, $type, $productsImages = false)
|
||||
{
|
||||
if (!is_dir($dir))
|
||||
return false;
|
||||
@@ -397,7 +397,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
// Regenerate no-pictures images
|
||||
private function _regenerateNoPictureImages($dir, $type, $languages)
|
||||
protected function _regenerateNoPictureImages($dir, $type, $languages)
|
||||
{
|
||||
$errors = false;
|
||||
foreach ($type AS $k => $imageType)
|
||||
@@ -416,7 +416,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
// Hook watermark optimization
|
||||
private function _regenerateWatermark($dir)
|
||||
protected function _regenerateWatermark($dir)
|
||||
{
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT m.`name` FROM `'._DB_PREFIX_.'module` m
|
||||
@@ -442,7 +442,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private function _regenerateThumbnails($type = 'all', $deleteOldImages = false)
|
||||
protected function _regenerateThumbnails($type = 'all', $deleteOldImages = false)
|
||||
{
|
||||
$this->start_time = time();
|
||||
ini_set('max_execution_time', $this->max_execution_time); // ini_set may be disabled, we need the real value
|
||||
@@ -509,7 +509,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
/**
|
||||
* Move product images to the new filesystem
|
||||
*/
|
||||
private function _moveImagesToNewFileSystem()
|
||||
protected function _moveImagesToNewFileSystem()
|
||||
{
|
||||
if (!Image::testFileSystem())
|
||||
$this->errors[] = Tools::displayError('Error: your server configuration is not compatible with the new image system. No images were moved');
|
||||
|
||||
@@ -527,7 +527,7 @@ class AdminImportControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private function generateContentTable($current_table, $nb_column, $handle, $glue)
|
||||
protected function generateContentTable($current_table, $nb_column, $handle, $glue)
|
||||
{
|
||||
$html = '<table id="table'.$current_table.'" style="display: none;" class="table" cellspacing="0" cellpadding="0">
|
||||
<tr>';
|
||||
@@ -550,7 +550,7 @@ class AdminImportControllerCore extends AdminController
|
||||
</th>';
|
||||
$html .= '</tr>';
|
||||
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $current_line < 10 && $line = fgetcsv($handle, MAX_LINE_SIZE, $glue); $current_line++)
|
||||
{
|
||||
/* UTF-8 conversion */
|
||||
@@ -563,7 +563,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$html .= '</tr>';
|
||||
}
|
||||
$html .= '</table>';
|
||||
self::rewindBomAware($handle);
|
||||
AdminImportController::rewindBomAware($handle);
|
||||
return $html;
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ class AdminImportControllerCore extends AdminController
|
||||
return $res;
|
||||
}
|
||||
|
||||
private function getTypeValuesOptions($nb_c)
|
||||
protected function getTypeValuesOptions($nb_c)
|
||||
{
|
||||
$i = 0;
|
||||
$no_pre_select = array('price_tin', 'feature');
|
||||
@@ -690,7 +690,7 @@ class AdminImportControllerCore extends AdminController
|
||||
return implode("\n\r", $fields);
|
||||
}
|
||||
|
||||
private function receiveTab()
|
||||
protected function receiveTab()
|
||||
{
|
||||
$type_value = Tools::getValue('type_value') ? Tools::getValue('type_value') : array();
|
||||
foreach ($type_value as $nb => $type)
|
||||
@@ -804,19 +804,19 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
$default_language_id = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
if (!isset($info['id']) || (int)$info['id'] < 2)
|
||||
continue;
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
$category = new Category();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $category);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $category);
|
||||
|
||||
if (isset($category->parent) && is_numeric($category->parent))
|
||||
{
|
||||
@@ -832,7 +832,7 @@ class AdminImportControllerCore extends AdminController
|
||||
else
|
||||
{
|
||||
$category_to_create = new Category();
|
||||
$category_to_create->name = self::createMultiLangField($category->parent);
|
||||
$category_to_create->name = AdminImportController::createMultiLangField($category->parent);
|
||||
$category_to_create->active = 1;
|
||||
$category_to_create->id_parent = 1; // Default parent is home for unknown category to create
|
||||
if (($field_error = $category_to_create->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
@@ -861,7 +861,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$category->link_rewrite = 'friendly-url-autogeneration-failed';
|
||||
$this->warnings[] = Tools::displayError('URL rewriting failed to auto-generate a friendly URL for: ').$category->name[$default_language_id];
|
||||
}
|
||||
$category->link_rewrite = self::createMultiLangField($category->link_rewrite);
|
||||
$category->link_rewrite = AdminImportController::createMultiLangField($category->link_rewrite);
|
||||
}
|
||||
|
||||
if (!$valid_link)
|
||||
@@ -898,7 +898,7 @@ class AdminImportControllerCore extends AdminController
|
||||
}
|
||||
//copying images of categories
|
||||
if (isset($category->image) && !empty($category->image))
|
||||
if (!(self::copyImg($category->id, null, $category->image, 'categories')))
|
||||
if (!(AdminImportController::copyImg($category->id, null, $category->image, 'categories')))
|
||||
$this->warnings[] = $category->image.' '.Tools::displayError('Cannot be copied');
|
||||
// If both failed, mysql error
|
||||
if (!$res)
|
||||
@@ -920,12 +920,12 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
$default_language_id = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
if (array_key_exists('id', $info) && (int)$info['id'] && Product::existsInDatabase((int)$info['id'], 'product'))
|
||||
{
|
||||
$product = new Product((int)$info['id']);
|
||||
@@ -936,8 +936,8 @@ class AdminImportControllerCore extends AdminController
|
||||
}
|
||||
else
|
||||
$product = new Product();
|
||||
self::setEntityDefaultValues($product);
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $product);
|
||||
AdminImportController::setEntityDefaultValues($product);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $product);
|
||||
|
||||
if ((int)$product->id_tax_rules_group != 0)
|
||||
{
|
||||
@@ -1025,7 +1025,7 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$category_to_create = new Category();
|
||||
$category_to_create->id = (int)$value;
|
||||
$category_to_create->name = self::createMultiLangField($value);
|
||||
$category_to_create->name = AdminImportController::createMultiLangField($value);
|
||||
$category_to_create->active = 1;
|
||||
$category_to_create->id_parent = 1; // Default parent is home for unknown category to create
|
||||
if (($field_error = $category_to_create->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
@@ -1048,7 +1048,7 @@ class AdminImportControllerCore extends AdminController
|
||||
else
|
||||
{
|
||||
$category_to_create = new Category();
|
||||
$category_to_create->name = self::createMultiLangField($value);
|
||||
$category_to_create->name = AdminImportController::createMultiLangField($value);
|
||||
$category_to_create->active = 1;
|
||||
$category_to_create->id_parent = 1; // Default parent is home for unknown category to create
|
||||
if (($field_error = $category_to_create->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
@@ -1081,7 +1081,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->warnings[] = Tools::displayError('Rewrite link for').' '.$link_rewrite.(isset($info['id']) ? ' (ID '.$info['id'].') ' : '').
|
||||
' '.Tools::displayError('was re-written as').' '.$link_rewrite;
|
||||
|
||||
$product->link_rewrite = self::createMultiLangField($link_rewrite);
|
||||
$product->link_rewrite = AdminImportController::createMultiLangField($link_rewrite);
|
||||
|
||||
$res = false;
|
||||
$field_error = $product->validateFields(UNFRIENDLY_ERROR, true);
|
||||
@@ -1172,7 +1172,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$tag = new Tag();
|
||||
if (!is_array($product->tags))
|
||||
{
|
||||
$product->tags = self::createMultiLangField($product->tags);
|
||||
$product->tags = AdminImportController::createMultiLangField($product->tags);
|
||||
foreach ($product->tags as $key => $tags)
|
||||
{
|
||||
$is_tag_added = $tag->addTags($key, $product->id, $tags);
|
||||
@@ -1222,7 +1222,7 @@ class AdminImportControllerCore extends AdminController
|
||||
if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
($lang_field_error = $image->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true && $image->add())
|
||||
{
|
||||
if (!self::copyImg($product->id, $image->id, $url))
|
||||
if (!AdminImportController::copyImg($product->id, $image->id, $url))
|
||||
$this->warnings[] = Tools::displayError('Error copying image: ').$url;
|
||||
}
|
||||
else
|
||||
@@ -1270,15 +1270,15 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
$fsep = ((is_null(Tools::getValue('multiple_value_separator')) || trim(Tools::getValue('multiple_value_separator')) == '' ) ? ',' : Tools::getValue('multiple_value_separator'));
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
$info = array_map('trim', $info);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
$product = new Product((int)$info['id_product'], false, $default_language);
|
||||
$id_image = null;
|
||||
@@ -1300,7 +1300,7 @@ class AdminImportControllerCore extends AdminController
|
||||
if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
($lang_field_error = $image->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true && $image->add())
|
||||
{
|
||||
if (!self::copyImg($product->id, $image->id, $url))
|
||||
if (!AdminImportController::copyImg($product->id, $image->id, $url))
|
||||
$this->warnings[] = Tools::displayError('Error copying image: ').$url;
|
||||
else
|
||||
$id_image = array($image->id);
|
||||
@@ -1417,16 +1417,16 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
$customer = new Customer();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $customer);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $customer);
|
||||
|
||||
if ($customer->passwd)
|
||||
$customer->passwd = md5(_COOKIE_KEY_.$customer->passwd);
|
||||
@@ -1468,16 +1468,16 @@ class AdminImportControllerCore extends AdminController
|
||||
$this->receiveTab();
|
||||
$default_language_id = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
$address = new Address();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $address);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $address);
|
||||
|
||||
if (isset($address->country) && is_numeric($address->country))
|
||||
{
|
||||
@@ -1492,7 +1492,7 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$country = new Country();
|
||||
$country->active = 1;
|
||||
$country->name = self::createMultiLangField($address->country);
|
||||
$country->name = AdminImportController::createMultiLangField($address->country);
|
||||
$country->id_zone = 0; // Default zone for country to create
|
||||
$country->iso_code = strtoupper(substr($address->country, 0, 2)); // Default iso for country to create
|
||||
$country->contains_states = 0; // Default value for country to create
|
||||
@@ -1613,20 +1613,20 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
if (array_key_exists('id', $info) && (int)$info['id'] && Manufacturer::existsInDatabase((int)$info['id'], 'manufacturer'))
|
||||
$manufacturer = new Manufacturer((int)$info['id']);
|
||||
else
|
||||
$manufacturer = new Manufacturer();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $manufacturer);
|
||||
$manufacturer = new Manufacturer();
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $manufacturer);
|
||||
|
||||
$res = false;
|
||||
if (($field_error = $manufacturer->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
@@ -1671,21 +1671,21 @@ class AdminImportControllerCore extends AdminController
|
||||
{
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||
{
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
if (array_key_exists('id', $info) && (int)$info['id'] && Supplier::existsInDatabase((int)$info['id'], 'supplier'))
|
||||
$supplier = new Supplier((int)$info['id']);
|
||||
else
|
||||
$supplier = new Supplier();
|
||||
$supplier = new Supplier();
|
||||
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supplier);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supplier);
|
||||
if (($field_error = $supplier->validateFields(UNFRIENDLY_ERROR, true)) === true &&
|
||||
($lang_field_error = $supplier->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true)
|
||||
{
|
||||
@@ -1733,7 +1733,7 @@ class AdminImportControllerCore extends AdminController
|
||||
// opens CSV & sets locale
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
|
||||
// main loop, for each supply orders to import
|
||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); ++$current_line)
|
||||
@@ -1741,10 +1741,10 @@ class AdminImportControllerCore extends AdminController
|
||||
// if convert requested
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
// sets default values if needed
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
// if an id is set, instanciates a supply order with this id if possible
|
||||
if (array_key_exists('id', $info) && (int)$info['id'] && SupplyOrder::exists((int)$info['id']))
|
||||
@@ -1805,7 +1805,7 @@ class AdminImportControllerCore extends AdminController
|
||||
$info['id_supply_order_state'] = 1;
|
||||
|
||||
// sets parameters
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supply_order);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supply_order);
|
||||
|
||||
// updatesd($supply_order);
|
||||
$res = true;
|
||||
@@ -1829,7 +1829,7 @@ class AdminImportControllerCore extends AdminController
|
||||
// opens CSV & sets locale
|
||||
$this->receiveTab();
|
||||
$handle = $this->openCsvFile();
|
||||
self::setLocale();
|
||||
AdminImportController::setLocale();
|
||||
|
||||
$products = array();
|
||||
$reset = true;
|
||||
@@ -1839,10 +1839,10 @@ class AdminImportControllerCore extends AdminController
|
||||
// if convert requested
|
||||
if (Tools::getValue('convert'))
|
||||
$line = $this->utf8EncodeArray($line);
|
||||
$info = self::getMaskedRow($line);
|
||||
$info = AdminImportController::getMaskedRow($line);
|
||||
|
||||
// sets default values if needed
|
||||
self::setDefaultValues($info);
|
||||
AdminImportController::setDefaultValues($info);
|
||||
|
||||
// gets the supply order
|
||||
if (array_key_exists('supply_order_reference', $info) && pSQL($info['supply_order_reference']) && SupplyOrder::exists(pSQL($info['supply_order_reference'])))
|
||||
@@ -1901,7 +1901,7 @@ class AdminImportControllerCore extends AdminController
|
||||
|
||||
// creates new product
|
||||
$supply_order_detail = new SupplyOrderDetail();
|
||||
self::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supply_order_detail);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $supply_order_detail);
|
||||
|
||||
// sets parameters
|
||||
$supply_order_detail->id_supply_order = $supply_order->id;
|
||||
@@ -1952,10 +1952,10 @@ class AdminImportControllerCore extends AdminController
|
||||
return $array;
|
||||
}
|
||||
|
||||
private function getNbrColumn($handle, $glue)
|
||||
protected function getNbrColumn($handle, $glue)
|
||||
{
|
||||
$tmp = fgetcsv($handle, MAX_LINE_SIZE, $glue);
|
||||
self::rewindBomAware($handle);
|
||||
AdminImportController::rewindBomAware($handle);
|
||||
return count($tmp);
|
||||
}
|
||||
|
||||
@@ -1970,26 +1970,26 @@ class AdminImportControllerCore extends AdminController
|
||||
return ($a < $b) ? 1 : -1;
|
||||
}
|
||||
|
||||
private function openCsvFile()
|
||||
protected function openCsvFile()
|
||||
{
|
||||
$handle = fopen(_PS_ADMIN_DIR_.'/import/'.strval(preg_replace('/\.{2,}/', '.', Tools::getValue('csv'))), 'r');
|
||||
|
||||
if (!$handle)
|
||||
$this->errors[] = Tools::displayError('Cannot read the CSV file');
|
||||
|
||||
self::rewindBomAware($handle);
|
||||
AdminImportController::rewindBomAware($handle);
|
||||
|
||||
for ($i = 0; $i < (int)Tools::getValue('skip'); ++$i)
|
||||
$line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator', ';'));
|
||||
return $handle;
|
||||
}
|
||||
|
||||
private function closeCsvFile($handle)
|
||||
protected function closeCsvFile($handle)
|
||||
{
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
private function truncateTables($case)
|
||||
protected function truncateTables($case)
|
||||
{
|
||||
switch ((int)$case)
|
||||
{
|
||||
|
||||
@@ -451,7 +451,7 @@ class AdminLanguagesControllerCore extends AdminController
|
||||
* @param string $id_language
|
||||
* @return boolean true if no error
|
||||
*/
|
||||
private function deleteNoPictureImages($id_language)
|
||||
protected function deleteNoPictureImages($id_language)
|
||||
{
|
||||
$language = Language::getIsoById($id_language);
|
||||
$images_types = ImageType::getImagesTypes('products');
|
||||
|
||||
@@ -331,7 +331,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
return $url;
|
||||
}
|
||||
|
||||
private function extractArchive($file, $redirect = true)
|
||||
protected function extractArchive($file, $redirect = true)
|
||||
{
|
||||
$success = false;
|
||||
if (substr($file, -4) == '.zip')
|
||||
@@ -355,7 +355,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=8'.'&token='.$this->token);
|
||||
}
|
||||
|
||||
private function recursiveDeleteOnDisk($dir)
|
||||
protected function recursiveDeleteOnDisk($dir)
|
||||
{
|
||||
if (strpos(realpath($dir), realpath(_PS_MODULE_DIR_)) === false)
|
||||
return ;
|
||||
@@ -385,7 +385,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
** Set and reset filter configuration
|
||||
*/
|
||||
|
||||
private function setFilterModules($module_type, $country_module_value, $module_install, $module_status)
|
||||
protected function setFilterModules($module_type, $country_module_value, $module_install, $module_status)
|
||||
{
|
||||
Configuration::updateValue('PS_SHOW_TYPE_MODULES_'.(int)$this->id_employee, $module_type);
|
||||
Configuration::updateValue('PS_SHOW_COUNTRY_MODULES_'.(int)$this->id_employee, $country_module_value);
|
||||
@@ -393,7 +393,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
Configuration::updateValue('PS_SHOW_ENABLED_MODULES_'.(int)$this->id_employee, $module_status);
|
||||
}
|
||||
|
||||
private function resetFilterModules()
|
||||
protected function resetFilterModules()
|
||||
{
|
||||
Configuration::updateValue('PS_SHOW_TYPE_MODULES_'.(int)$this->id_employee, 'allModules');
|
||||
Configuration::updateValue('PS_SHOW_COUNTRY_MODULES_'.(int)$this->id_employee, 0);
|
||||
@@ -718,7 +718,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
* @param $module_errors
|
||||
* @return string
|
||||
*/
|
||||
private function generateHtmlMessage($module_errors)
|
||||
protected function generateHtmlMessage($module_errors)
|
||||
{
|
||||
$html_error = '';
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class AdminPaymentControllerCore extends AdminController
|
||||
}
|
||||
|
||||
|
||||
private function saveRestrictions($type)
|
||||
protected function saveRestrictions($type)
|
||||
{
|
||||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'module_'.bqSQL($type).'` WHERE id_shop = '.Context::getContext()->shop->getID(true));
|
||||
foreach ($this->payment_modules as $module)
|
||||
|
||||
@@ -398,7 +398,7 @@ class AdminPreferencesControllerCore extends AdminController
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
private function getConf($fields, $languages)
|
||||
protected function getConf($fields, $languages)
|
||||
{
|
||||
$tab['_MEDIA_SERVER_1_'] = _MEDIA_SERVER_1_;
|
||||
$tab['_MEDIA_SERVER_2_'] = _MEDIA_SERVER_2_;
|
||||
|
||||
@@ -191,7 +191,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
private function _cleanMetaKeywords($keywords)
|
||||
protected function _cleanMetaKeywords($keywords)
|
||||
{
|
||||
if (!empty($keywords) && $keywords != '')
|
||||
{
|
||||
@@ -1273,7 +1273,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
// Checking customs feature
|
||||
private function checkFeatures($languages, $feature_id)
|
||||
protected function checkFeatures($languages, $feature_id)
|
||||
{
|
||||
$rules = call_user_func(array('FeatureValue', 'getValidationRules'), 'FeatureValue');
|
||||
$feature = Feature::getFeature(Configuration::get('PS_LANG_DEFAULT'), $feature_id);
|
||||
@@ -1610,14 +1610,14 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->errors[] = $this->l('Tags list').' ('.$language['name'].') '.$this->l('is invalid');
|
||||
}
|
||||
|
||||
private function _removeTaxFromEcotax()
|
||||
protected function _removeTaxFromEcotax()
|
||||
{
|
||||
$ecotaxTaxRate = Tax::getProductEcotaxRate();
|
||||
if ($ecotax = Tools::getValue('ecotax'))
|
||||
$_POST['ecotax'] = Tools::ps_round(Tools::getValue('ecotax') / (1 + $ecotaxTaxRate / 100), 6);
|
||||
}
|
||||
|
||||
private function _applyTaxToEcotax($product)
|
||||
protected function _applyTaxToEcotax($product)
|
||||
{
|
||||
$ecotaxTaxRate = Tax::getProductEcotaxRate();
|
||||
if ($product->ecotax)
|
||||
@@ -1954,11 +1954,11 @@ class AdminProductsControllerCore extends AdminController
|
||||
if (isset($categories[$id_category]))
|
||||
foreach ($categories[$id_category] as $key => $row)
|
||||
if ($key != 'infos')
|
||||
$content .= self::recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite);
|
||||
$content .= AdminProductsController::recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite);
|
||||
return $content;
|
||||
}
|
||||
|
||||
private function _displayDraftWarning($active)
|
||||
protected function _displayDraftWarning($active)
|
||||
{
|
||||
$content = '<div class="warn draft" style="'.($active ? 'display:none' : '').'">
|
||||
<p>
|
||||
@@ -2725,7 +2725,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
|
||||
private function _getFinalPrice($specific_price, $productPrice, $taxRate)
|
||||
protected function _getFinalPrice($specific_price, $productPrice, $taxRate)
|
||||
{
|
||||
$price = Tools::ps_round((float)($specific_price['price']) ? $specific_price['price'] : $productPrice, 2);
|
||||
if (!(float)($specific_price['reduction']))
|
||||
@@ -2901,7 +2901,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
return $content;
|
||||
}
|
||||
|
||||
private function _getCustomizationFieldIds($labels, $alreadyGenerated, $obj)
|
||||
protected function _getCustomizationFieldIds($labels, $alreadyGenerated, $obj)
|
||||
{
|
||||
$customizableFieldIds = array();
|
||||
if (isset($labels[Product::CUSTOMIZE_FILE]))
|
||||
@@ -2919,7 +2919,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
return implode('¤', $customizableFieldIds);
|
||||
}
|
||||
|
||||
private function _displayLabelField(&$label, $languages, $default_language, $type, $fieldIds, $id_customization_field)
|
||||
protected function _displayLabelField(&$label, $languages, $default_language, $type, $fieldIds, $id_customization_field)
|
||||
{
|
||||
$content = '';
|
||||
$fieldsName = 'label_'.$type.'_'.(int)($id_customization_field);
|
||||
@@ -2942,7 +2942,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
return $content;
|
||||
}
|
||||
|
||||
private function _displayLabelFields(&$obj, &$labels, $languages, $default_language, $type)
|
||||
protected function _displayLabelFields(&$obj, &$labels, $languages, $default_language, $type)
|
||||
{
|
||||
$content = '';
|
||||
$type = (int)($type);
|
||||
@@ -3785,7 +3785,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
private function initPack(Product $product)
|
||||
protected function initPack(Product $product)
|
||||
{
|
||||
$this->tpl_form_vars['is_pack'] = ($product->id && Pack::isPack($product->id)) || Tools::getValue('ppack');
|
||||
$product->packItems = Pack::getItems($product->id, $this->context->language->id);
|
||||
|
||||
@@ -353,7 +353,7 @@ class AdminReferrersControllerCore extends AdminController
|
||||
|
||||
public function displayCalendar($action = null, $table = null, $identifier = null, $id = null)
|
||||
{
|
||||
return self::displayCalendarForm(array(
|
||||
return AdminReferrersController::displayCalendarForm(array(
|
||||
'Calendar' => $this->l('Calendar'),
|
||||
'Day' => $this->l('Today'),
|
||||
'Month' => $this->l('Month'),
|
||||
@@ -399,7 +399,7 @@ class AdminReferrersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private function enableCalendar()
|
||||
protected function enableCalendar()
|
||||
{
|
||||
return (!Tools::isSubmit('add'.$this->table) && !Tools::isSubmit('submitAdd'.$this->table) && !Tools::isSubmit('update'.$this->table));
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
|
||||
|
||||
public function displayCalendar()
|
||||
{
|
||||
return self::displayCalendarForm(array(
|
||||
return AdminStatsTabController::displayCalendarForm(array(
|
||||
'Calendar' => $this->l('Calendar', 'AdminStatsTab'),
|
||||
'Day' => $this->l('Day', 'AdminStatsTab'),
|
||||
'Month' => $this->l('Month', 'AdminStatsTab'),
|
||||
@@ -137,7 +137,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
|
||||
return $tpl->fetch();
|
||||
}
|
||||
|
||||
private function getModules()
|
||||
protected function getModules()
|
||||
{
|
||||
$sql = 'SELECT h.`name` AS hook, m.`name`
|
||||
FROM `'._DB_PREFIX_.'module` m
|
||||
|
||||
@@ -416,7 +416,7 @@ class AdminStatusesControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private function getTemplates($iso_code)
|
||||
protected function getTemplates($iso_code)
|
||||
{
|
||||
$array = array();
|
||||
if (!file_exists(_PS_ADMIN_DIR_.'/../mails/'.$iso_code))
|
||||
|
||||
@@ -267,7 +267,7 @@ class AdminStockCoverControllerCore extends AdminController
|
||||
*
|
||||
* @return int coverage period
|
||||
*/
|
||||
private function getCurrentCoveragePeriod()
|
||||
protected function getCurrentCoveragePeriod()
|
||||
{
|
||||
static $coverage_period = 0;
|
||||
|
||||
@@ -285,7 +285,7 @@ class AdminStockCoverControllerCore extends AdminController
|
||||
*
|
||||
* @return int id_warehouse
|
||||
*/
|
||||
private function getCurrentCoverageWarehouse()
|
||||
protected function getCurrentCoverageWarehouse()
|
||||
{
|
||||
static $warehouse = 0;
|
||||
|
||||
@@ -303,7 +303,7 @@ class AdminStockCoverControllerCore extends AdminController
|
||||
*
|
||||
* @return int warn_days
|
||||
*/
|
||||
private function getCurrentWarning()
|
||||
protected function getCurrentWarning()
|
||||
{
|
||||
static $warning = 0;
|
||||
|
||||
|
||||
@@ -228,7 +228,7 @@ class AdminStockInstantStateControllerCore extends AdminController
|
||||
*
|
||||
* @return int id_warehouse
|
||||
*/
|
||||
private function getCurrentCoverageWarehouse()
|
||||
protected function getCurrentCoverageWarehouse()
|
||||
{
|
||||
static $warehouse = 0;
|
||||
|
||||
|
||||
@@ -922,7 +922,7 @@ class AdminStockManagementControllerCore extends AdminController
|
||||
* @param array $item reference to the current item
|
||||
* @param bool $is_product_attribute specify if it's a product or a product variation
|
||||
*/
|
||||
private function skipActionByStock(&$item, $is_product_variation = false)
|
||||
protected function skipActionByStock(&$item, $is_product_variation = false)
|
||||
{
|
||||
$stock_manager = StockManagerFactory::getManager();
|
||||
|
||||
|
||||
@@ -2059,7 +2059,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
*
|
||||
* @return int id_warehouse
|
||||
*/
|
||||
private function getCurrentWarehouse()
|
||||
protected function getCurrentWarehouse()
|
||||
{
|
||||
static $warehouse = 0;
|
||||
|
||||
@@ -2077,7 +2077,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
*
|
||||
* @return int status
|
||||
*/
|
||||
private function getFilterStatus()
|
||||
protected function getFilterStatus()
|
||||
{
|
||||
static $status = 0;
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
if (!is_dir($target_dir.$file))
|
||||
mkdir($target_dir.$file, Theme::$access_rights);
|
||||
|
||||
$res &= self::copyTheme($base_theme_dir.$file, $target_theme_dir.$file);
|
||||
$res &= AdminThemesController::copyTheme($base_theme_dir.$file, $target_theme_dir.$file);
|
||||
}
|
||||
elseif (!file_exists($target_theme_dir.$file))
|
||||
$res &= copy($base_dir.$file, $target_dir.$file);
|
||||
@@ -326,7 +326,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
* @param string $theme_dir theme directory
|
||||
* @return boolean Validity is ok or not
|
||||
*/
|
||||
private function _isThemeCompatible($theme_dir)
|
||||
protected function _isThemeCompatible($theme_dir)
|
||||
{
|
||||
$all_errors='';
|
||||
$return=true;
|
||||
@@ -380,7 +380,7 @@ class AdminThemesControllerCore extends AdminController
|
||||
* @param mixed $configItem will precise the attribute which not matches. If empty, will check every attributes
|
||||
* @return error message, or null if disabled
|
||||
*/
|
||||
private function _checkConfigForFeatures($arrFeatures, $configItem = array())
|
||||
protected function _checkConfigForFeatures($arrFeatures, $configItem = array())
|
||||
{
|
||||
$return = true;
|
||||
if (is_array($configItem))
|
||||
|
||||
@@ -114,7 +114,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
'packs_to_install' => $packs_to_install,
|
||||
'packs_to_update' => $packs_to_update,
|
||||
'url_submit' => self::$currentIndex.'&token='.$this->token,
|
||||
'themes' => $themes = self::getThemesList(),
|
||||
'themes' => $themes = AdminTranslationsController::getThemesList(),
|
||||
'url_create_language' => 'index.php?tab=AdminLanguages&addlang&token='.Tools::getAdminToken('AdminLanguages'.(int)(Tab::getIdFromClassName('AdminLanguages')).(int)$this->context->employee->id),
|
||||
);
|
||||
|
||||
@@ -1478,7 +1478,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
);
|
||||
$arr_files_to_parse = array_merge($arr_files_to_parse, $modules_has_mails);
|
||||
foreach ($arr_files_to_parse as $path) {
|
||||
$subject_mail = self::getSubjectMail($path, $subject_mail);
|
||||
$subject_mail = AdminTranslationsController::getSubjectMail($path, $subject_mail);
|
||||
}
|
||||
|
||||
$core_mails = $this->getMailFiles(_PS_MAIL_DIR_, $lang, 'core_mail');
|
||||
@@ -1580,7 +1580,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
if ($filename != '.svn' AND $filename != '.' AND $filename != '..' AND is_dir(($directory.'/'.$filename)))
|
||||
$subject_mail = self::getSubjectMail($directory.'/'.$filename, $subject_mail);
|
||||
$subject_mail = AdminTranslationsController::getSubjectMail($directory.'/'.$filename, $subject_mail);
|
||||
}
|
||||
return $subject_mail;
|
||||
}
|
||||
@@ -1682,7 +1682,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
if ($module{0} != '.' AND is_dir($root_dir.$module))
|
||||
{
|
||||
@include($root_dir.$module.'/'.$lang.'.php');
|
||||
self::getModuleTranslations($is_default);
|
||||
AdminTranslationsController::getModuleTranslations($is_default);
|
||||
$this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $root_dir.$module.'/'.$lang.'.php', $is_default);
|
||||
}
|
||||
}
|
||||
@@ -1750,7 +1750,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
* @return array containing all datas needed for building the translation form
|
||||
* @since 1.4.5.0
|
||||
*/
|
||||
private function _parsePdfClass($filepath, $regex, $langArray, $tab, $tabs_array)
|
||||
protected function _parsePdfClass($filepath, $regex, $langArray, $tab, $tabs_array)
|
||||
{
|
||||
$content = file_get_contents($filepath);
|
||||
preg_match_all($regex, $content, $matches);
|
||||
|
||||
Reference in New Issue
Block a user