fix record deletion from story workzone && enhance deletion "when no elements selected the story or basket itself is deleted"

This commit is contained in:
Nicolas Le Goff
2012-05-10 14:32:37 +02:00
parent d3cf7fb835
commit 21c2d15754
2 changed files with 15 additions and 5 deletions

View File

@@ -54,11 +54,12 @@
{% endif %} {% endif %}
<button class="ui-corner-all TOOL_trash_btn story_window" title="{% trans 'action : supprimer' %}"> <button class="ui-corner-all TOOL_trash_btn story_window" title="{% trans 'action : supprimer' %}">
<img src="/skins/icons/delete.png"/> <img src="/skins/icons/delete.png"/>
<input type="hidden" name="story_key" value="{{ Story.get_serialize_key() }}"/>
</button> </button>
</div> </div>
<div class="alert_datas_changed ui-corner-all"> <div class="alert_datas_changed ui-corner-all">
{% trans 'Certaines donnees du panier ont change' %} {% trans 'Certaines donnees du reportage ont change' %}
<a class="basket_refresher" href="#"> <a class="basket_refresher" href="#">
{% trans 'rafraichir' %} {% trans 'rafraichir' %}
</a> </a>

View File

@@ -1880,6 +1880,10 @@ function activeIcons()
{ {
if(p4.WorkZone.Selection.length() > 0) if(p4.WorkZone.Selection.length() > 0)
type = 'CHIM'; type = 'CHIM';
else{
type = 'SSTT';
el = $('.SSTT.active');
}
} }
else else
{ {
@@ -1887,11 +1891,12 @@ function activeIcons()
{ {
if(p4.WorkZone.Selection.length() > 0) if(p4.WorkZone.Selection.length() > 0)
{ {
value = 'lst=' + p4.WorkZone.Selection.serialize(); type = 'CHIM';
} }
else else
{ {
value = 'story=' + $('.SSTT.active').attr('id').split('_').slice(1,2).pop(); type = 'STORY';
el = $(this).find('input[name=story_key]');
} }
} }
} }
@@ -2366,7 +2371,7 @@ $('.TOOL_disktt_btn').live('click', function(){
} }
} }
for(i in datas) for(var i in datas)
{ {
return downloadThis(datas); return downloadThis(datas);
} }
@@ -2419,6 +2424,10 @@ function checkDeleteThis(type, el)
$('#tooltip').hide(); $('#tooltip').hide();
return; return;
break; break;
case "STORY":
lst = el.val();
deleteThis(lst);
break;
} }
} }
@@ -2712,7 +2721,7 @@ function archiveBasket(basket_id)
function deleteBasket(item) function deleteBasket(item)
{ {
$('#DIALOG').dialog("destroy"); $('#DIALOG').dialog("destroy");
k = $(item).attr('id').split('_').slice(1,2).pop(); // id de chutier var k = $(item).attr('id').split('_').slice(1,2).pop(); // id de chutier
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "/prod/baskets/"+k+'/delete/', url: "/prod/baskets/"+k+'/delete/',