[-] BO : fixed bug #PSCFV-5991 - CMS friendly URL does not automatically copied

This commit is contained in:
vAugagneur committed 2012-12-10 10:51:46 +01:00
1 parent 60e99d6b66
commit eb451604af
5 files changed
+34 -5

No files matched your search

@@ -24,7 +24,20 @@
*} *}
{extends file="helpers/form/form.tpl"} {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"} {block name="script"}
$(document).ready(function() { $(document).ready(function() {
if (btn_submit.length > 0) if (btn_submit.length > 0)
@@ -24,7 +24,20 @@
*} *}
{extends file="helpers/form/form.tpl"} {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"} {block name="input"}
{if $input.type == 'select_category'} {if $input.type == 'select_category'}
<select name="id_parent"> <select name="id_parent">
@@ -302,7 +302,7 @@ class AdminCmsCategoriesControllerCore extends AdminController
'class' => 'button' 'class' => 'button'
) )
); );
$this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
return parent::renderForm(); return parent::renderForm();
} }
} }
+2 -2
View File
@@ -180,9 +180,9 @@ class AdminCmsControllerCore extends AdminController
} }
$this->tpl_form_vars = array( $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(); return parent::renderForm();
} }
+3
View File
@@ -52,6 +52,9 @@ function str2url(str,encoding,ucfirst)
function copy2friendlyURL() 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 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('%', '')); $('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8').replace('%', ''));