note description: "Summary description for {ES_CLOUD_SUBSCRIPTIONS_ADMIN_HANDLER}." author: "" date: "$Date$" revision: "$Revision$" class ES_CLOUD_SUBSCRIPTIONS_ADMIN_HANDLER inherit ES_CLOUD_ADMIN_HANDLER WSF_URI_HANDLER create make feature -- Execution execute (req: WSF_REQUEST; res: WSF_RESPONSE) local r: like new_generic_response sub: detachable ES_CLOUD_PLAN_SUBSCRIPTION s: STRING l_user: ES_CLOUD_USER l_org: ES_CLOUD_ORGANIZATION l_plan_filter: detachable READABLE_STRING_GENERAL orgs: detachable LIST [ES_CLOUD_ORGANIZATION] do if api.has_permission ("manage es accounts") then if attached {WSF_STRING} req.query_parameter ("plan") as p_plan then l_plan_filter := p_plan.value end r := new_generic_response (req, res) add_primary_tabs (r) if l_plan_filter /= Void then create s.make_from_string ("
Entity | Plan | Until | Last | organization(s) | ") -- s.append ("Action | ") s.append ("|||
---|---|---|---|---|---|---|---|---|
") if l_org /= Void then s.append ("[ORG] ") s.append (html_encoded (l_org.name)) elseif l_user /= Void then s.append ("") s.append (html_encoded (api.real_user_display_name (l_user))) end s.append (" | ") if sub /= Void then s.append ("") s.append (html_encoded (sub.plan.title_or_name)) s.append (" | ") s.append ("") if sub.is_active then if attached sub.expiration_date as dt then s.append (html_encoded (date_time_to_string (dt))) s.append (" ( " + sub.days_remaining.out + " days remaining )") else s.append ("ACTIVE") s.append (" (since ") s.append (html_encoded (date_time_to_string (sub.creation_date))) s.append (")") end else s.append ("EXPIRED") if attached sub.expiration_date as dt then s.append (" (since ") s.append (html_encoded (date_time_to_string (dt))) s.append (")") end end s.append (" | ") s.append ("") if l_user /= Void then if attached {ES_CLOUD_SESSION} es_cloud_api.last_user_session (l_user, Void) as l_last and then attached l_last.last_date as dt then s.append ("") end end s.append (" | ") else s.append ("") s.append (" | ") s.append ("") s.append (" | ") s.append ("") s.append (" | ") end if l_user /= Void and orgs /= Void then s.append ("") across orgs as o_ic loop s.append ("") s.append (html_encoded (o_ic.item.name)) s.append (" ") end s.append (" | ") else s.append ("") s.append (" | ") end s.append ("
organizations | Plan | Until | ") -- s.append ("Action | ") s.append ("|||
---|---|---|---|---|---|---|
") s.append (html_encoded (ic.item.name)) s.append (" | ") if sub /= Void then s.append ("") s.append (html_encoded (sub.plan.title_or_name)) s.append (" | ") s.append ("") if sub.is_active then if attached sub.expiration_date as dt then s.append (html_encoded (date_time_to_string (dt))) s.append (" ( " + sub.days_remaining.out + " days remaining )") else s.append ("ACTIVE") s.append (" (since ") s.append (html_encoded (date_time_to_string (sub.creation_date))) s.append (")") end else s.append ("EXPIRED") if attached sub.expiration_date as dt then s.append (" (since ") s.append (html_encoded (date_time_to_string (dt))) s.append (")") end end s.append (" | ") -- s.append ("") -- s.append ("Cancel | Upgrade") -- s.append (" | ") else s.append ("") s.append (" | ") s.append ("") s.append (" | ") -- s.append ("") -- s.append ("Upgrade") -- s.append (" | ") end s.append ("