liquid_feedback_frontend

diff app/main/member/show_tab.lua @ 151:1652c4cd3154

add broken delegations tab on homepage

if a user has delegations to an inactive account, a new red tab will apear on the homepage of the user listing his broken delegations
author Daniel Poelzleithner <poelzi@poelzi.org>
date Fri Oct 08 05:24:14 2010 +0200 (2010-10-08)
parents 43ac94c7575b
children ccdf197b3f9b
line diff
     1.1 --- a/app/main/member/show_tab.lua	Fri Oct 08 04:29:20 2010 +0200
     1.2 +++ b/app/main/member/show_tab.lua	Fri Oct 08 05:24:14 2010 +0200
     1.3 @@ -43,6 +43,22 @@
     1.4      }
     1.5    end
     1.6  
     1.7 +  local broken_delegations = Delegation:new_selector()
     1.8 +    :join("member", nil, "delegation.trustee_id = member.id")
     1.9 +    :add_where{"member.active = 'f' AND delegation.truster_id = ?", member.id}
    1.10 +
    1.11 +  if broken_delegations:count() then
    1.12 +    tabs[#tabs+1] = {
    1.13 +      class = "red",
    1.14 +      name = "problem_delegations",
    1.15 +      label = _"Delegation problems" .. " (" .. tostring(broken_delegations:count()) .. ")",
    1.16 +      icon = { static = "icons/16/table_go.png" },
    1.17 +      module = "delegation",
    1.18 +      view = "_list",
    1.19 +      params = { delegations_selector = broken_delegations, outgoing = true },
    1.20 +    }
    1.21 +  end
    1.22 +
    1.23    local selector = Area:new_selector()
    1.24      :reset_fields()
    1.25      :add_field("area.id", nil, { "grouped" })

Impressum / About Us