// fix bug added and remove attachement in AdminProductsController

This commit is contained in:
lLefevre
2011-11-23 21:37:18 +00:00
parent 91f238a2cd
commit 6404f952f0
2 changed files with 8 additions and 8 deletions
+6 -6
View File
@@ -135,16 +135,16 @@ $(document).ready(function(){
$("#product-tab-content-wait").hide(); $("#product-tab-content-wait").hide();
var languages = new Array(); var languages = new Array();
if (id == 3) if (id == "4-Combinations")
populate_attrs(); populate_attrs();
if (id == 7) if (id == '7-Attachments')
{ {
$("#addAttachment").click(function() { $("#addAttachment").live('click', function() {
return !$("#selectAttachment1 option:selected").remove().appendTo("#selectAttachment2");
});
$("#removeAttachment").click(function() {
return !$("#selectAttachment2 option:selected").remove().appendTo("#selectAttachment1"); return !$("#selectAttachment2 option:selected").remove().appendTo("#selectAttachment1");
}); });
$("#removeAttachment").live('click', function() {
return !$("#selectAttachment1 option:selected").remove().appendTo("#selectAttachment2");
});
$("#product").submit(function() { $("#product").submit(function() {
$("#selectAttachment1 option").each(function(i) { $("#selectAttachment1 option").each(function(i) {
$(this).attr("selected", "selected"); $(this).attr("selected", "selected");
@@ -2595,7 +2595,7 @@ class AdminProductsControllerCore extends AdminController
foreach ($attach1 as $attach) foreach ($attach1 as $attach)
$content .= '<option value="'.$attach['id_attachment'].'">'.$attach['name'].'</option>'; $content .= '<option value="'.$attach['id_attachment'].'">'.$attach['name'].'</option>';
$content .= ' </select><br /><br /> $content .= ' </select><br /><br />
<a href="#" id="addAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px"> <a href="#" id="removeAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px">
'.$this->l('Remove').' &gt;&gt; '.$this->l('Remove').' &gt;&gt;
</a> </a>
</td> </td>
@@ -2605,7 +2605,7 @@ class AdminProductsControllerCore extends AdminController
foreach ($attach2 as $attach) foreach ($attach2 as $attach)
$content .= '<option value="'.$attach['id_attachment'].'">'.$attach['name'].'</option>'; $content .= '<option value="'.$attach['id_attachment'].'">'.$attach['name'].'</option>';
$content .= ' </select><br /><br /> $content .= ' </select><br /><br />
<a href="#" id="removeAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px"> <a href="#" id="addAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px">
&lt;&lt; '.$this->l('Add').' &lt;&lt; '.$this->l('Add').'
</a> </a>
</div> </div>