forum::new (public)

 forum::new [ -forum_id forum_id ] -name name [ -charter charter ] \
    [ -presentation_type presentation_type ] \
    [ -posting_policy posting_policy ] -package_id package_id \
    [ -new_questions_allowed_p new_questions_allowed_p ] \
    [ -anonymous_allowed_p anonymous_allowed_p ] [ -no_callback ]

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

create a new forum

Switches:
-forum_id (optional)
-name (required)
-charter (optional)
-presentation_type (defaults to "flat") (optional)
-posting_policy (defaults to "open") (optional)
-package_id (required)
-new_questions_allowed_p (defaults to "t") (optional)
-anonymous_allowed_p (defaults to "f") (optional)
-no_callback (boolean) (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_forum_count_test forum_count_test (test forums) forum::new forum::new test_forum_count_test->forum::new test_forum_message_new forum_message_new (test forums) test_forum_message_new->forum::new test_forum_new forum_new (test forums) test_forum_new->forum::new test_web_forum_edit web_forum_edit (test forums) test_web_forum_edit->forum::new test_web_forum_new web_forum_new (test forums) test_web_forum_new->forum::new callback callback (public) forum::new->callback db_dml db_dml (public) forum::new->db_dml package_instantiate_object package_instantiate_object (public) forum::new->package_instantiate_object callback::pm::project_new::impl::forums callback::pm::project_new::impl::forums (public) callback::pm::project_new::impl::forums->forum::new install::xml::action::forum-create install::xml::action::forum-create (private) install::xml::action::forum-create->forum::new packages/forums/lib/forums/new.tcl packages/forums/ lib/forums/new.tcl packages/forums/lib/forums/new.tcl->forum::new

Testcases:
forum_new, forum_message_new, forum_count_test, web_forum_new, web_forum_view, web_forum_edit, web_forums_message_and_reply
Source code:
    set var_list [list  [list forum_id $forum_id]  [list name $name]  [list charter $charter]  [list presentation_type $presentation_type]  [list posting_policy $posting_policy]  [list package_id $package_id]]

    set forum_id [package_instantiate_object -var_list $var_list forums_forum]

    db_dml update_extra_cols {
        update forums_forums set
           new_questions_allowed_p = :new_questions_allowed_p,
           anonymous_allowed_p     = :anonymous_allowed_p
        where forum_id = :forum_id
    }

    if {!$no_callback_p} {
        callback forum::forum_new -package_id $package_id -forum_id $forum_id
    }

    forum::flush_templating_cache  -forum_id $forum_id    

    return $forum_id
Generic XQL file:
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: