Forum OpenACS Q&A: Re: About calendar...

2: Re: About calendar... (response to 1)
Posted by Jarkko Laine on
Is the "calendar::item::new" the function which creates   the item ?
Yes, it is.
where can I find the database inserts ??
See calendar/tcl/cal-item-procs.tcl:
        set cal_item_id [db_exec_plsql cal_item_add {}]
The SQL in question is in cal-item-procs-postgresql.xql (look for cal_item_add).
where does it update the acs-object table particulary?
Look for cal_item__new in api-doc for plsql functions (
When the .adp is submitted... where does the info go ? to   another .adp ??
We are using ad_form here. Please read the docs for it to get further information.
- Why do we need a "-new_request" flag & a "-edit_request"?   is it possible to mergue them ?? - I believe that the "-new_data" & "-edit_data" flags were   made for create/edit an item... is it true ?
See the previous answer.
- In the "-edit_request" section, we have   "calendar::item::get -cal_item_id $cal_item_id -array     cal_item"... this function get info in the var cal_item,   doesn't it ?, then it set some vars as "set start_time   $cal_item(start_time)"... $cal_item(start_time) is an   indexed array, doesn't it ? and $cal_item_id is... maybe   the id for the new calendar item ??
cal_item is an array where all the info that we get from calendar::item::get is put. $cal_item(start_time) is then the value in the array with key start_time. And yes, cal_item_id is the id we get when we put the new item in the db.

Hope this helps. BTW, these are quite basic things you need to know in order to use OpenACS effectively. I would suggest that you'd read Jade's "Getting Started with OpenACS" and take a look at his other articles, too.