forum::edit (public)

 forum::edit -forum_id forum_id [ -name name ] [ -charter charter ] \
    [ -presentation_type presentation_type ] \
    [ -posting_policy posting_policy ] \
    [ -new_questions_allowed_p new_questions_allowed_p ] \
    [ -anonymous_allowed_p anonymous_allowed_p ] \
    [ -attachments_allowed_p attachments_allowed_p ] [ -no_callback ]

Defined in packages/forums/tcl/forums-procs.tcl

Edit a forum

Switches:
-forum_id
(required)
-name
(optional)
-charter
(optional)
-presentation_type
(optional)
-posting_policy
(optional)
-new_questions_allowed_p
(optional)
-anonymous_allowed_p
(optional)
-attachments_allowed_p
(optional)
-no_callback
(boolean) (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_web_forum_edit web_forum_edit (test forums) forum::edit forum::edit test_web_forum_edit->forum::edit test_web_forums_message_and_reply web_forums_message_and_reply (test forums) test_web_forums_message_and_reply->forum::edit ad_conn ad_conn (public) forum::edit->ad_conn callback callback (public) forum::edit->callback db_dml db_dml (public) forum::edit->db_dml forum::flush_cache forum::flush_cache (public) forum::edit->forum::flush_cache forum::get forum::get (public) forum::edit->forum::get forum::posting_policy_set forum::posting_policy_set (public, deprecated) forum::posting_policy_set->forum::edit packages/forums/lib/forums/edit.tcl packages/forums/ lib/forums/edit.tcl packages/forums/lib/forums/edit.tcl->forum::edit

Testcases:
web_forum_edit, web_forums_message_and_reply
Source code:
    forum::get -forum_id $forum_id -array forum
    foreach var {
        name charter presentation_type posting_policy new_questions_allowed_p anonymous_allowed_p attachments_allowed_p} {
        if {![info exists $var]} {
            set $var $forum($var)
        }
    }

    # This is a straight DB update
    db_dml update_forum {}
    db_dml update_forum_object {}

    if {!$no_callback_p} {
        callback forum::forum_edit -package_id [ad_conn package_id] -forum_id $forum_id
    }

    forum::flush_cache  -forum_id $forum_id
Generic XQL file:
<fullquery name="forum::edit.update_forum">
    <querytext>
          update forums_forums set
             name                    = :name,
             charter                 = :charter,
             presentation_type       = :presentation_type,
             posting_policy          = :posting_policy,
             new_questions_allowed_p = :new_questions_allowed_p,
             anonymous_allowed_p     = :anonymous_allowed_p,
             attachments_allowed_p   = :attachments_allowed_p
         where forum_id = :forum_id
        </querytext>
</fullquery>

<fullquery name="forum::edit.update_forum_object">
    <querytext>
          update acs_objects set
             title          = :name,
             last_modified  = current_timestamp,
             modifying_user = [ad_conn user_id]
            where object_id = :forum_id
        </querytext>
</fullquery>
packages/forums/tcl/forums-procs.xql

PostgreSQL XQL file:
packages/forums/tcl/forums-procs-postgresql.xql

Oracle XQL file:
packages/forums/tcl/forums-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: