// AdminProducts informations fix, saveAndStay fix,
[+] BO : if json, ajax-layout.tpl can generate json with conf, _errors, warnings, informations and page var // HelpAccess improvement // now Product does not require quantity anymore git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10377 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -122,6 +122,29 @@
|
||||
});
|
||||
return false;
|
||||
});
|
||||
if($('.help-context'))
|
||||
{
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'index.php',
|
||||
data: {
|
||||
'ajax' : '1',
|
||||
'action' : 'helpAccess',
|
||||
'item' : '{$class_name}',
|
||||
'isoUser' : '{$iso_user}',
|
||||
'country' : '{$country_iso_code}',
|
||||
'version' : '{$smarty.const._PS_VERSION_}'
|
||||
},
|
||||
async : true,
|
||||
success: function(msg) {
|
||||
if(msg.status == 'ok' && msg.content != 'none')
|
||||
{
|
||||
$(".help-context").html(msg.content);
|
||||
$(".help-context").fadeIn("slow").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -23,56 +23,77 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{if isset($conf)}
|
||||
<div class="conf">
|
||||
{$conf}
|
||||
</div>
|
||||
{/if}{if count($errors)} {* @todo what is ??? AND $this->_includeContainer *}
|
||||
<div class="error">
|
||||
<span style="float:right"><a id="hideError" href=""><img alt="X" src="../img/admin/close.png" /></a></span><img src="../img/admin/error2.png" />
|
||||
{if count($errors) == 1}
|
||||
{$errors[0]}
|
||||
{else}
|
||||
{$errors|count} {l s='errors'}
|
||||
<br/>
|
||||
<ol>
|
||||
{foreach $errors AS $error}
|
||||
<li>{$error}</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}{if isset($informations) && count($informations) && $informations}
|
||||
<div class="hint clear" style="display:block;">
|
||||
{foreach $informations as $info}
|
||||
{$info}<br />
|
||||
{/foreach}
|
||||
</div><br />
|
||||
{/if}{if isset($confirmations) && count($confirmations) && $confirmations}
|
||||
<div class="conf" style="display:block;">
|
||||
{foreach $confirmations as $conf}
|
||||
{$conf}<br />
|
||||
{/foreach}
|
||||
</div><br />
|
||||
{/if}{if count($warnings)}
|
||||
<div class="warn">
|
||||
<span style="float:right">
|
||||
<a id="hideWarn" href=""><img alt="X" src="../img/admin/close.png" /></a>
|
||||
</span>
|
||||
<img src="../img/admin/warn2.png" />
|
||||
{if count($warnings) > 1}
|
||||
{l s='There are'} {count($warnings)} {l s='warnings'}
|
||||
{else}
|
||||
{l s='There is'} {count($warnings)} {l s='warning'}
|
||||
{/if}
|
||||
<span style="margin-left:20px;" id="labelSeeMore">
|
||||
<a id="linkSeeMore" href="#" style="text-decoration:underline">{l s='Click here to see more'}</a>
|
||||
<a id="linkHide" href="#" style="text-decoration:underline;display:none">{l s='Hide warning'}</a>
|
||||
</span>
|
||||
<ul style="display:none;" id="seeMore">
|
||||
{foreach $warnings as $warning}
|
||||
<li>{$warning}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}{$page}
|
||||
{if isset($json)}
|
||||
{
|
||||
status:{$status},
|
||||
conf:{$json},
|
||||
informations:{$informations},
|
||||
error:{$errors},
|
||||
warnings:{$warnings},
|
||||
content:{$page}
|
||||
}
|
||||
{else}
|
||||
|
||||
{if isset($conf)}
|
||||
<div class="conf">
|
||||
{$conf}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if count($errors)} {* @todo what is ??? AND $this->_includeContainer *}
|
||||
<div class="error">
|
||||
<span style="float:right"><a id="hideError" href=""><img alt="X" src="../img/admin/close.png" /></a></span><img src="../img/admin/error2.png" />
|
||||
{if count($errors) == 1}
|
||||
{$errors[0]}
|
||||
{else}
|
||||
{$errors|count} {l s='errors'}
|
||||
<br/>
|
||||
<ol>
|
||||
{foreach $errors AS $error}
|
||||
<li>{$error}</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($informations) && count($informations) && $informations}
|
||||
<div class="hint clear" style="display:block;">
|
||||
{foreach $informations as $info}
|
||||
{$info}<br />
|
||||
{/foreach}
|
||||
</div><br />
|
||||
{/if}
|
||||
|
||||
{if isset($confirmations) && count($confirmations) && $confirmations}
|
||||
<div class="conf" style="display:block;">
|
||||
{foreach $confirmations as $conf}
|
||||
{$conf}<br />
|
||||
{/foreach}
|
||||
</div><br />
|
||||
{/if}
|
||||
|
||||
{if count($warnings)}
|
||||
<div class="warn">
|
||||
<span style="float:right">
|
||||
<a id="hideWarn" href=""><img alt="X" src="../img/admin/close.png" /></a>
|
||||
</span>
|
||||
<img src="../img/admin/warn2.png" />
|
||||
{if count($warnings) > 1}
|
||||
{l s='There are'} {count($warnings)} {l s='warnings'}
|
||||
{else}
|
||||
{l s='There is'} {count($warnings)} {l s='warning'}
|
||||
{/if}
|
||||
<span style="margin-left:20px;" id="labelSeeMore">
|
||||
<a id="linkSeeMore" href="#" style="text-decoration:underline">{l s='Click here to see more'}</a>
|
||||
<a id="linkHide" href="#" style="text-decoration:underline;display:none">{l s='Hide warning'}</a>
|
||||
</span>
|
||||
<ul style="display:none;" id="seeMore">
|
||||
{foreach $warnings as $warning}
|
||||
<li>{$warning}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
{$page}
|
||||
{/if}
|
||||
|
||||
@@ -227,7 +227,7 @@ $(document).ready(function(){
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
<form id="product_form" action="{$form_action}" method="post" enctype="multipart/form-data" name="product">
|
||||
<form id="product_form" action="{$form_action}&{$submit_action}=1" method="post" enctype="multipart/form-data" name="product">
|
||||
<input type="hidden" name="id_product" value="{$id_product}" />
|
||||
<input type="hidden" name="tabs" id="tabs" value="0" />
|
||||
<div class="tab-pane" id="tabPane1">
|
||||
@@ -255,6 +255,8 @@ $(document).ready(function(){
|
||||
{/if}
|
||||
</div>
|
||||
<input type="hidden" name="id_product_attribute" id="id_product_attribute" value="0" />
|
||||
<input id="product_form_submit_btn" type="submit" value="{l s='Save'}" name="submitAdd{$table}" class="button" />
|
||||
<input type="submit" value="{l s='Save and stay'}" name="submitAdd{$table}AndStay" class="button" />
|
||||
</form>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
@@ -962,8 +962,88 @@ $(document).ready(function(){
|
||||
}
|
||||
</script>
|
||||
{/if}
|
||||
{$last_content}
|
||||
|
||||
<tr>
|
||||
<td class="col-left"><label>{l s='Tags:'}</label></td>
|
||||
<td style="padding-bottom:5px;" class="translatable">
|
||||
|
||||
{foreach from=$languages item=language}
|
||||
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if}float: left;">
|
||||
<input size="55" type="text" id="tags_{$language.id_lang}" name="tags_{$language.id_lang}"
|
||||
value="{$product->getTags($language.id_lang, true)|htmlentitiesUTF8}" />
|
||||
<span class="hint" name="help_box">{l s='Forbidden characters:'} !<;>;?=+#"°{}_$%<span class="hint-pointer"> </span></span>
|
||||
</div>
|
||||
{/foreach}
|
||||
<p class="clear">{l s='Tags separated by commas (e.g., dvd, dvd player, hifi)'}</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-left"><label>{l s='Accessories:'}<br /><br /><i>{l s='(Do not forget to Save the product afterward)'}</i></label></td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<div id="divAccessories">
|
||||
{* @todo : donot use 3 foreach, but assign var *}
|
||||
{foreach from=$accessories item=accessory}
|
||||
{$accessory.name|htmlentitiesUTF8}{if !empty($accessory.reference)}{$accessory.reference}{/if} <span onclick="delAccessory({$accessory.id_product});" style="cursor: pointer;"><img src="../img/admin/delete.gif" class="middle" alt="" /></span><br />
|
||||
{/foreach}
|
||||
</div>
|
||||
<input type="hidden" name="inputAccessories" id="inputAccessories" value="{foreach from=$accessories item=accessory}{$accessory.id_product}-{/foreach}" />
|
||||
<input type="hidden" name="nameAccessories" id="nameAccessories" value="{foreach from=$accessories item=accessory}{$accessory.name|htmlentitiesUTF8}¤{/foreach}" />
|
||||
<script type="text/javascript">
|
||||
var formProduct;
|
||||
var accessories = new Array();
|
||||
</script>
|
||||
|
||||
<div id="ajax_choose_product" style="padding:6px; padding-top:2px; width:600px;">
|
||||
<p class="clear">{l s='Begin typing the first letters of the product name, then select the product from the drop-down list:'}</p>
|
||||
<input type="text" value="" id="product_autocomplete_input" />
|
||||
<img onclick="$(this).prev().search();" style="cursor: pointer;" src="../img/admin/add.gif" alt="{l s='Add an accessory'}" title="{l s='Add an accessory'}" />
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
urlToCall = null;
|
||||
/* function autocomplete */
|
||||
$(document).ready(function() {
|
||||
$('#product_autocomplete_input')
|
||||
.autocomplete('ajax_products_list.php', {
|
||||
minChars: 1,
|
||||
autoFill: true,
|
||||
max:20,
|
||||
matchContains: true,
|
||||
mustMatch:true,
|
||||
scroll:false,
|
||||
cacheLength:0,
|
||||
formatItem: function(item) {
|
||||
return item[1]+' - '+item[0];
|
||||
}
|
||||
}).result(addAccessory);
|
||||
$('#product_autocomplete_input').setOptions({
|
||||
extraParams: {
|
||||
excludeIds : getAccessorieIds()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function getAccessorieIds()
|
||||
{
|
||||
var ids = {$product->id}+',';
|
||||
ids += $('#inputAccessories').val().replace(/\\-/g,',').replace(/\\,$/,'');
|
||||
ids = ids.replace(/\,$/,'');
|
||||
|
||||
return ids;
|
||||
}
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" style="padding-bottom:10px;"><div class="separation"></div></td></tr>
|
||||
</table>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
toggleVirtualProduct(getE(\'is_virtual_good\'));
|
||||
unitPriceWithTax(\'unit\');
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -33,6 +33,14 @@
|
||||
<div>{$btn.desc}</div>
|
||||
</a>
|
||||
</li>
|
||||
{if isset($ps_help_context) && $ps_help_context}
|
||||
<li class="help-context" style="display:none">
|
||||
<a id="desc-{$table}-help" class="toolbar_btn" href="#" title="{l s='Help'}">
|
||||
<span class="process-icon-help"></span>
|
||||
<div>{l s='Help'}</div>
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
<script language="javascript">
|
||||
|
||||
Reference in New Issue
Block a user