liquid_feedback_frontend

annotate app/main/admin/_action/area_update.lua @ 124:f740026b1518

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.
author Daniel Poelzleithner <poelzi@poelzi.org>
date Mon Sep 20 20:32:04 2010 +0200 (2010-09-20)
parents 915cc0341538
children 36aedac3e4bf
rev   line source
bsw/jbe@5 1 if not app.session.member.admin then
bsw/jbe@5 2 error()
bsw/jbe@5 3 end
bsw/jbe@5 4
bsw/jbe@5 5 local id = param.get_id()
bsw/jbe@5 6
bsw/jbe@5 7 local area
bsw/jbe@5 8 if id then
bsw/jbe@5 9 area = Area:new_selector():add_where{ "id = ?", id }:single_object_mode():exec()
bsw/jbe@5 10 else
bsw/jbe@5 11 area = Area:new()
bsw/jbe@5 12 end
bsw/jbe@5 13
bsw/jbe@5 14
bsw/jbe@5 15 param.update(area, "name", "description", "active")
bsw/jbe@5 16
bsw/jbe@5 17 area:save()
bsw/jbe@5 18
poelzi@119 19 param.update_relationship{
poelzi@119 20 param_name = "allowed_policies",
poelzi@119 21 id = area.id,
poelzi@119 22 connecting_model = AllowedPolicy,
poelzi@119 23 own_reference = "area_id",
poelzi@119 24 foreign_reference = "policy_id"
poelzi@119 25 }
poelzi@119 26
bsw/jbe@5 27 slot.put_into("notice", _"Area successfully updated")

Impressum / About Us