From 21c2d15754100e8542a108960d4a010bb960000c Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Thu, 10 May 2012 14:32:37 +0200 Subject: [PATCH] fix record deletion from story workzone && enhance deletion "when no elements selected the story or basket itself is deleted" --- templates/web/prod/WorkZone/Story.html.twig | 3 ++- www/prod/page0.js | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/templates/web/prod/WorkZone/Story.html.twig b/templates/web/prod/WorkZone/Story.html.twig index c8bb284056..48fd729f55 100644 --- a/templates/web/prod/WorkZone/Story.html.twig +++ b/templates/web/prod/WorkZone/Story.html.twig @@ -54,11 +54,12 @@ {% endif %}
- {% trans 'Certaines donnees du panier ont change' %} + {% trans 'Certaines donnees du reportage ont change' %} {% trans 'rafraichir' %} diff --git a/www/prod/page0.js b/www/prod/page0.js index 9cbd6041b3..f68308fd3d 100644 --- a/www/prod/page0.js +++ b/www/prod/page0.js @@ -1880,6 +1880,10 @@ function activeIcons() { if(p4.WorkZone.Selection.length() > 0) type = 'CHIM'; + else{ + type = 'SSTT'; + el = $('.SSTT.active'); + } } else { @@ -1887,11 +1891,12 @@ function activeIcons() { if(p4.WorkZone.Selection.length() > 0) { - value = 'lst=' + p4.WorkZone.Selection.serialize(); + type = 'CHIM'; } 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); } @@ -2419,6 +2424,10 @@ function checkDeleteThis(type, el) $('#tooltip').hide(); return; break; + case "STORY": + lst = el.val(); + deleteThis(lst); + break; } } @@ -2712,7 +2721,7 @@ function archiveBasket(basket_id) function deleteBasket(item) { $('#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({ type: "POST", url: "/prod/baskets/"+k+'/delete/',