[-] BO : fixed bug #PSCFV-5991 - CMS friendly URL does not automatically copied
This commit is contained in:
@@ -24,7 +24,20 @@
|
||||
*}
|
||||
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="input"}
|
||||
{if $input.name == "link_rewrite"}
|
||||
<script type="text/javascript">
|
||||
{if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 1;
|
||||
{else}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 0;
|
||||
{/if}
|
||||
</script>
|
||||
{$smarty.block.parent}
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
$(document).ready(function() {
|
||||
if (btn_submit.length > 0)
|
||||
|
||||
@@ -24,7 +24,20 @@
|
||||
*}
|
||||
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="input"}
|
||||
{if $input.name == "link_rewrite"}
|
||||
<script type="text/javascript">
|
||||
{if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 1;
|
||||
{else}
|
||||
var PS_ALLOW_ACCENTED_CHARS_URL = 0;
|
||||
{/if}
|
||||
</script>
|
||||
{$smarty.block.parent}
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{/block}
|
||||
{block name="input"}
|
||||
{if $input.type == 'select_category'}
|
||||
<select name="id_parent">
|
||||
|
||||
@@ -302,7 +302,7 @@ class AdminCmsCategoriesControllerCore extends AdminController
|
||||
'class' => 'button'
|
||||
)
|
||||
);
|
||||
|
||||
$this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
|
||||
return parent::renderForm();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,9 +180,9 @@ class AdminCmsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$this->tpl_form_vars = array(
|
||||
'active' => $this->object->active
|
||||
'active' => $this->object->active,
|
||||
'PS_ALLOW_ACCENTED_CHARS_URL', (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL')
|
||||
);
|
||||
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@ function str2url(str,encoding,ucfirst)
|
||||
|
||||
function copy2friendlyURL()
|
||||
{
|
||||
if (typeof(id_product) == 'undefined')
|
||||
id_product = false;
|
||||
|
||||
if (!$('#link_rewrite_' + id_language).val().length || !id_product)//check if user didn't type anything in rewrite field, to prevent overwriting
|
||||
{
|
||||
$('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8').replace('%', ''));
|
||||
|
||||
Reference in New Issue
Block a user