// Customer group
This commit is contained in:
1 parent
15622fbf45
commit
3b465111b9
1 file changed
+37
-77
@@ -28,7 +28,7 @@
|
|||||||
{block name="label"}
|
{block name="label"}
|
||||||
{if $input['type'] == 'modules'}
|
{if $input['type'] == 'modules'}
|
||||||
<div style="{if !$form_id}display:none{/if}">
|
<div style="{if !$form_id}display:none{/if}">
|
||||||
<label class="control-label col-lg-3">{l s='Module restrictions:'}</label>
|
<label class="control-label col-lg-3">{l s='Authorized modules:'}</label>
|
||||||
</div>
|
</div>
|
||||||
{elseif $input['type'] == 'group_discount_category'}
|
{elseif $input['type'] == 'group_discount_category'}
|
||||||
<div style="{if !$form_id}display:none{/if}">
|
<div style="{if !$form_id}display:none{/if}">
|
||||||
@@ -63,39 +63,6 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
function toogleCheck(elt)
|
|
||||||
{
|
|
||||||
if ($(elt).hasClass('select_all'))
|
|
||||||
{
|
|
||||||
$(elt).addClass('unselect_all').removeClass('select_all');
|
|
||||||
$('ul#sortable_module_'+$(elt).attr('id')).find('input[type="checkbox"]').removeAttr('checked');
|
|
||||||
$(elt).html('{l s='Select all'}');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$(elt).addClass('select_all').removeClass('unselect_all');
|
|
||||||
$('ul#sortable_module_'+$(elt).attr('id')).find('input[type="checkbox"]').attr('checked', true);
|
|
||||||
$(elt).html('{l s='Unselect all'}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function unauthorizeChecked()
|
|
||||||
{
|
|
||||||
$('ul#sortable_module_unauthorize_list').find('input[type="checkbox"]:checked').each( function () {
|
|
||||||
$('ul#sortable_module_authorize_list').prepend($(this).parent());
|
|
||||||
$(this).removeAttr('checked');
|
|
||||||
$(this).parent().children('input["type=hidden"]').attr('name', 'modulesBoxAuth[]');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function authorizeChecked()
|
|
||||||
{
|
|
||||||
$('ul#sortable_module_authorize_list').find('input[type="checkbox"]:checked').each( function () {
|
|
||||||
$('ul#sortable_module_unauthorize_list').prepend($(this).parent());
|
|
||||||
$(this).removeAttr('checked');
|
|
||||||
$(this).parent().children('input["type=hidden"]').attr('name', 'modulesBoxUnauth[]');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function addCategoryReduction()
|
function addCategoryReduction()
|
||||||
{
|
{
|
||||||
@@ -206,54 +173,47 @@
|
|||||||
<div class="margin-form">
|
<div class="margin-form">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$( "#sortable_module_authorize_list, #sortable_module_unauthorize_list" ).sortable({
|
$('#authorized-modules').find('[value="0"]').click(function() {
|
||||||
connectWith: ".connectedSortable",
|
$(this).parent().parent().find('input[type=hidden]').attr('name', 'modulesBoxUnauth[]');
|
||||||
stop: function(event, ui)
|
});
|
||||||
{
|
|
||||||
if ($(event.toElement).parent('ul').attr('id') == 'sortable_module_authorize_list')
|
$('#authorized-modules').find('[value="1"]').click(function() {
|
||||||
$(event.toElement).children('input["type=hidden"]').attr('name', 'modulesBoxAuth[]');
|
$(this).parent().parent().find('input[type=hidden]').attr('name', 'modulesBoxAuth[]');
|
||||||
else
|
});
|
||||||
$(event.toElement).children('input["type=hidden"]').attr('name', 'modulesBoxUnauth[]');
|
|
||||||
}
|
|
||||||
}).disableSelection();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="col-lg-9">
|
<div class="col-lg-9" id="authorized-modules">
|
||||||
<div class="row">
|
{foreach $input['values']['auth_modules'] key=key item=module }
|
||||||
<div class="col-lg-6">
|
<div class="form-group">
|
||||||
<label>{$input['label']['auth_modules']}</label>
|
<label class="control-label col-lg-2"><img src="../modules/{$module->name}/logo.gif"> {$module->displayName}</label>
|
||||||
<ul id="sortable_module_authorize_list" class="connectedSortable list-unstyled">
|
<div class="input-group col-lg-2">
|
||||||
{foreach $input['values']['auth_modules'] key=key item=module }
|
<span class="switch prestashop-switch">
|
||||||
<li class="module_list" id="module_{$module->id}">
|
<input type="radio" name="{$module->name}" id="{$module->name}_on" value="1" checked="checked">
|
||||||
<input type="checkbox" style="margin-right:5px">
|
<label class="radio" for="{$module->name}_on"><i class="icon-check-sign color_success"></i> Yes</label>
|
||||||
<img src="../modules/{$module->name}/logo.gif">
|
<input type="radio" name="{$module->name}" id="{$module->name}_off" value="0">
|
||||||
{$module->displayName}
|
<label class="radio" for="{$module->name}_off"><i class="icon-ban-circle color_danger"></i> No</label>
|
||||||
<input type="hidden" name="modulesBoxAuth[]" value="{$module->id}">
|
<span class="slide-button btn btn-default"></span>
|
||||||
</li>
|
</span>
|
||||||
|
<input type="hidden" name="modulesBoxAuth[]" value="{$module->id}">
|
||||||
{/foreach}
|
|
||||||
</ul>
|
|
||||||
<button id="authorize_list" onclick="toogleCheck(this);return false;" class="btn btn-default">{l s='Select all'}</button>
|
|
||||||
<button onclick="authorizeChecked();return false;" class="btn btn-default">{l s='Unauthorize >>'}</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<label>{$input['label']['unauth_modules']}</label>
|
|
||||||
<ul id="sortable_module_unauthorize_list" class="connectedSortable list-unstyled">
|
|
||||||
{foreach $input['values']['unauth_modules'] key=key item=module }
|
|
||||||
<li class="module_list" id="module_{$module->id}">
|
|
||||||
<input type="checkbox" style="margin-right:5px">
|
|
||||||
<img src="../modules/{$module->name}/logo.gif">
|
|
||||||
{$module->displayName}
|
|
||||||
<input type="hidden" name="modulesBoxUnauth[]" value="{$module->id}">
|
|
||||||
</li>
|
|
||||||
{/foreach}
|
|
||||||
</ul>
|
|
||||||
<button id="unauthorize_list" onclick="toogleCheck(this);return false;" class="btn btn-default">{l s='Select all'}</button>
|
|
||||||
<button onclick="unauthorizeChecked();return false;" class="btn btn-default">{l s='<< Authorize'}</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/foreach}
|
||||||
|
{foreach $input['values']['unauth_modules'] key=key item=module }
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-lg-2"><img src="../modules/{$module->name}/logo.gif"> {$module->displayName}</label>
|
||||||
|
<div class="input-group col-lg-2">
|
||||||
|
<span class="switch prestashop-switch">
|
||||||
|
<input type="radio" name="{$module->name}" id="{$module->name}_on" value="1">
|
||||||
|
<label class="radio" for="{$module->name}_on"><i class="icon-check-sign color_success"></i> Yes</label>
|
||||||
|
<input type="radio" name="{$module->name}" id="{$module->name}_off" value="0" checked="checked">
|
||||||
|
<label class="radio" for="{$module->name}_off"><i class="icon-ban-circle color_danger"></i> No</label>
|
||||||
|
<span class="slide-button btn btn-default"></span>
|
||||||
|
</span>
|
||||||
|
<input type="hidden" name="modulesBoxUnauth[]" value="{$module->id}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/foreach}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{else}
|
{else}
|
||||||
|
|||||||
Reference in new issue
Block a user