liquid_feedback_frontend
diff app/main/delegation/_show_box.lua @ 111:bf885faf3452
add initiator support in delegation
if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Mon Sep 20 20:32:04 2010 +0200 (2010-09-20) |
parents | 00d1004545f1 |
children | 02aacb3dffe0 |
line diff
1.1 --- a/app/main/delegation/_show_box.lua Sun Sep 19 04:56:11 2010 +0200 1.2 +++ b/app/main/delegation/_show_box.lua Mon Sep 20 20:32:04 2010 +0200 1.3 @@ -1,4 +1,4 @@ 1.4 -function change_delegation(scope, area_id, issue, delegation) 1.5 +function change_delegation(scope, area_id, issue, delegation, initiative_id) 1.6 local image 1.7 local text 1.8 if scope == "global" and delegation then 1.9 @@ -34,6 +34,7 @@ 1.10 view = "new", 1.11 params = { 1.12 issue_id = issue and issue.id or nil, 1.13 + initiative_id = initiative_id or nil, 1.14 area_id = area_id 1.15 }, 1.16 } 1.17 @@ -62,11 +63,13 @@ 1.18 local delegation 1.19 local area_id 1.20 local issue_id 1.21 +local initiative_id 1.22 1.23 local scope = "global" 1.24 1.25 if param.get("initiative_id", atom.integer) then 1.26 - issue_id = Initiative:by_id(param.get("initiative_id", atom.integer)).issue_id 1.27 + initiative_id = param.get("initiative_id", atom.integer) 1.28 + issue_id = Initiative:by_id(initiative_id).issue_id 1.29 scope = "issue" 1.30 end 1.31 1.32 @@ -84,6 +87,7 @@ 1.33 1.34 local delegation 1.35 local issue 1.36 + 1.37 if issue_id then 1.38 issue = Issue:by_id(issue_id) 1.39 delegation = Delegation:by_pk(app.session.member.id, nil, issue_id) 1.40 @@ -149,7 +153,7 @@ 1.41 :exec() 1.42 1.43 if not issue or (issue.state ~= "finished" and issue.state ~= "cancelled") then 1.44 - change_delegation(scope, area_id, issue, delegation) 1.45 + change_delegation(scope, area_id, issue, delegation, initiative_id) 1.46 end 1.47 1.48 for i, record in ipairs(delegation_chain) do 1.49 @@ -210,6 +214,6 @@ 1.50 end 1.51 } 1.52 else 1.53 - change_delegation(scope, area_id, issue) 1.54 + change_delegation(scope, area_id, issue, nil, initiative_id) 1.55 end 1.56 end)