calendar::create (public)

 calendar::create owner_id private_p [ calendar_name ]

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

Create a new calendar.

Parameters:
owner_id (required)
private_p (required)
defaults to true since the default calendar is a private calendar.
calendar_name (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::create calendar::create test_cal_item_add_delete->calendar::create test_cal_item_edit_recurrence cal_item_edit_recurrence (test calendar) test_cal_item_edit_recurrence->calendar::create ad_conn ad_conn (public) calendar::create->ad_conn db_exec_plsql db_exec_plsql (public) calendar::create->db_exec_plsql permission::set_not_inherit permission::set_not_inherit (public) calendar::create->permission::set_not_inherit calendar_create calendar_create (public, deprecated) calendar_create->calendar::create packages/calendar/www/admin/calendar-create.tcl packages/calendar/ www/admin/calendar-create.tcl packages/calendar/www/admin/calendar-create.tcl->calendar::create

Testcases:
cal_item_edit_recurrence, cal_item_add_delete
Source code:

    # find out configuration info
    set package_id [ad_conn package_id]
    set creation_ip [ad_conn "peeraddr"]
    set creation_user [ad_conn "user_id"]

    # BMA:FIXME: this needs to be fixed a LOT more, but for now we patch the obvious
    if {$creation_user == 0} {
        set creation_user $owner_id
    }

    set calendar_id [db_exec_plsql create_new_calendar {
        begin
        :1 := calendar.new(
          owner_id      => :owner_id,
          private_p     => :private_p,
          calendar_name => :calendar_name,
          package_id    => :package_id,
          creation_user => :creation_user,
          creation_ip   => :creation_ip
        );
        end;
    }
    ]
    #removing inherited permissions
    permission::set_not_inherit -object_id $calendar_id

    return $calendar_id
Generic XQL file:
packages/calendar/tcl/calendar-procs.xql

PostgreSQL XQL file:
<fullquery name="calendar::create.create_new_calendar">
    <querytext>
    select calendar__new(
    	null,
    	:calendar_name,
    	'calendar',
    	:owner_id,
    	:private_p,
    	:package_id,
    	null,
    	now(),
    	:creation_user,
    	:creation_ip
    );
  </querytext>
</fullquery>
packages/calendar/tcl/calendar-procs-postgresql.xql

Oracle XQL file:
<fullquery name="calendar::create.create_new_calendar">
    <querytext>
  
    begin
    :1 := calendar.new(
      owner_id      => :owner_id,
      private_p     => :private_p,
      calendar_name => :calendar_name,
      package_id    => :package_id,
      creation_user => :creation_user,
      creation_ip   => :creation_ip
    );	
    end;

  </querytext>
</fullquery>
packages/calendar/tcl/calendar-procs-oracle.xql

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