[*] BO : #PSFV-94 - added AdminDbController
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9452 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -1006,7 +1006,8 @@ class AdminControllerCore extends Controller
|
||||
{
|
||||
$this->context->smarty->assign(array(
|
||||
'current' => self::$currentIndex,
|
||||
'token' => $this->token
|
||||
'token' => $this->token,
|
||||
'table' => $this->table
|
||||
));
|
||||
|
||||
if ($this->display == 'edit' || $this->display == 'add')
|
||||
|
||||
@@ -72,7 +72,7 @@ class HelperFormCore extends Helper
|
||||
'back' => Tools::getValue('back'),
|
||||
'fields' => $this->fields_form,
|
||||
'fields_value' => $this->fields_value,
|
||||
'requiredFields' => $this->getFieldsRequired(),
|
||||
'required_fields' => $this->getFieldsRequired(),
|
||||
'vat_number' => file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'),
|
||||
'module_dir' => _MODULE_DIR_,
|
||||
'contains_states' => (isset($this->fields_value['id_country']) && isset($this->fields_value['id_state'])) ? Country::containsStates($this->fields_value['id_country']) : null,
|
||||
|
||||
@@ -46,7 +46,7 @@ class HelperListCore extends Helper
|
||||
public $_orderBy;
|
||||
|
||||
/** @var string Default ORDER BY clause when $_orderBy is not defined */
|
||||
protected $_defaultOrderBy = false;
|
||||
public $_defaultOrderBy = false;
|
||||
|
||||
/** @var string Order way (ASC, DESC) determined by arrows in list header */
|
||||
public $_orderWay;
|
||||
@@ -95,8 +95,7 @@ class HelperListCore extends Helper
|
||||
'id_category' => 'id_category_to_move',
|
||||
'id_cms_category' => 'id_cms_category_to_move',
|
||||
'id_cms' => 'id_cms',
|
||||
'id_attribute' => 'id_attribute',
|
||||
'id_carrier' => 'id_carrier'
|
||||
'id_attribute' => 'id_attribute'
|
||||
);
|
||||
|
||||
// @var boolean ask for simple header : no filters, no paginations and no sorting
|
||||
@@ -218,7 +217,7 @@ class HelperListCore extends Helper
|
||||
else if (isset($params['position']))
|
||||
{
|
||||
$this->_list[$index][$key] = array(
|
||||
'position' => (int)$tr[$key],
|
||||
'position' => $tr[$key],
|
||||
'position_url_down' => $this->currentIndex.
|
||||
'&'.$key_to_get.'='.(int)$id_category.'&'.$this->identifiersDnd[$this->identifier].'='.$id.
|
||||
'&way=1&position='.((int)$tr['position'] + 1).'&token='.$this->token,
|
||||
@@ -282,7 +281,6 @@ class HelperListCore extends Helper
|
||||
'id_category' => $id_category,
|
||||
'bulk_actions' => $this->bulk_actions,
|
||||
'key_to_get' => $key_to_get,
|
||||
'order_by' => $this->_orderBy,
|
||||
'positions' => isset($positions) ? $positions : null,
|
||||
'is_cms' => $this->is_cms,
|
||||
'fields_display' => $this->fieldsDisplay,
|
||||
|
||||
@@ -109,6 +109,10 @@ class HelperOptionsCore extends Helper
|
||||
|
||||
// Assign the modifications back to parent array
|
||||
$category_data['fields'][$key] = $field;
|
||||
|
||||
// Is at least one required field present?
|
||||
if (isset($field['required']) && $field['required'])
|
||||
$required_fields = true;
|
||||
}
|
||||
// Assign the modifications back to parent array
|
||||
$option_list[$category] = $category_data;
|
||||
@@ -118,6 +122,7 @@ class HelperOptionsCore extends Helper
|
||||
'current' => $this->currentIndex,
|
||||
'option_list' => $option_list,
|
||||
'current_id_lang' => $this->context->language->id,
|
||||
'required_fields' => $required_fields,
|
||||
));
|
||||
return $this->context->smarty->fetch(_PS_ADMIN_DIR_.'/themes/template/'.$this->tpl);
|
||||
}
|
||||
@@ -202,4 +207,13 @@ class HelperOptionsCore extends Helper
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getFieldsRequired()
|
||||
{
|
||||
if (isset($this->fields_form['input']))
|
||||
foreach ($this->fields_form['input'] as $input)
|
||||
if (array_key_exists('required', $input) && $input['required'])
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user