Added :Show/hide nationality required field and add option for not selected Nationality in filter
This commit is contained in:
@@ -173,7 +173,7 @@ class CustomerCore extends ObjectModel
|
||||
'passwd' => array('type' => self::TYPE_STRING, 'validate' => 'isPasswd', 'required' => true, 'size' => 60),
|
||||
'last_passwd_gen' => array('type' => self::TYPE_STRING, 'copy_post' => false),
|
||||
'id_gender' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isInt', 'copy_post' => false),
|
||||
'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
||||
'birthday' => array('type' => self::TYPE_DATE, 'validate' => 'isBirthDate'),
|
||||
'newsletter' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'newsletter_date_add' => array('type' => self::TYPE_DATE,'copy_post' => false),
|
||||
|
||||
@@ -89,6 +89,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$selected_nationalities[$row['id_country']] = $row['name'];
|
||||
}
|
||||
$selected_nationalities[-1] = $this->l('Other');
|
||||
$selected_nationalities[0] = $this->l('None');
|
||||
|
||||
$selected_countries = array();
|
||||
$countries_result = Db::getInstance()->executeS('
|
||||
|
||||
12
js/admin.js
12
js/admin.js
@@ -504,6 +504,14 @@ function changeCMSActivationAuthorization()
|
||||
getE('PS_CONDITIONS_CMS_ID').disabled = 'disabled';
|
||||
}
|
||||
|
||||
function toggleNationalityMandatoryField()
|
||||
{
|
||||
if ($('#PS_CUSTOMER_NATIONALITY_on').prop('checked'))
|
||||
$('#conf_id_PS_CUSTOMER_NATIONALITY_MANDATORY').closest('.form-group').show();
|
||||
else
|
||||
$('#conf_id_PS_CUSTOMER_NATIONALITY_MANDATORY').closest('.form-group').hide();
|
||||
}
|
||||
|
||||
function changeOverbookingOrderAction()
|
||||
{
|
||||
if (getE('PS_OVERBOOKING_ORDER_ACTION').value == $("input[name='OVERBOOKING_ORDER_CANCEL_ACTION']").val())
|
||||
@@ -998,6 +1006,10 @@ $(document).ready(function()
|
||||
if ($('.kpi-container').length) {
|
||||
refresh_kpis();
|
||||
}
|
||||
if ($('#PS_CUSTOMER_NATIONALITY_on').length) {
|
||||
toggleNationalityMandatoryField();
|
||||
$('input[name="PS_CUSTOMER_NATIONALITY"]').on('change', toggleNationalityMandatoryField);
|
||||
}
|
||||
});
|
||||
|
||||
function bindSwapSave()
|
||||
|
||||
Reference in New Issue
Block a user