Forum OpenACS Q&A: Calendar 4.6 - Which files are being used?

Could someone who knows a lot about the calendar tell me which files
are being used in the /packages/calendar/tcl directory? There are a
lot of files and some of them seem to be redundant so it's confusing
me!!! ^^

Thanks.

Collapse
Posted by Andrew Zeon on
Would I be correct in saying that ALL of the files with '2' replace
the files without the '2' (e.g. cal-item-procs.tcl is redundant and
is replaced with cal-item-2-procs.tcl).

Thanks.

Collapse
Posted by Tom Jackson on

I don't think so, since all the procs in both files will be available. But, some files in the www directory look like they have been replaced by tcl procs: cal-dayview, cal-weekview, cal-monthview, cal-listview for instance.

While we are at it, I wish Ben, or Don could explain what variables are made available by the form, or template::form procs. Hopefully you can override the default form that is generated and directly access the variables, minus the html. The current practice of using these form procs and then just using the formtemplate tag on the adp page leave the future developer with little to work with. Wouldn't it be nice if we had an 'inspect' tool that would read a page and tell you what @vars@ and @array.vars@ were available to the developer? Maybe this exists, seems like I have seen it around.

Collapse
Posted by Ben Adida on
Andrew,

If you're trying to understand the code, definitely start with the -2 tcl files.
However, don't get rid of the original ones, as they're still needed.

The -2 files generally are a rewrite of the APIs. I've switched (almost all) the
Tcl scripts to use the procs in the -2 files. The APIs in the original files are a
tad confusing and hard to understand at times.

Tom: can you tell me a bit more about the issue you're having with the form
manager?

Collapse
Posted by Tom Jackson on

Does the form manager provide a set of tcl vars to the adp page, or just a formatted form? If not, that seems to break the separation of code/presentation. I know you are able to override the output of formtemplate if the tag contains content, but the extent of the override and what you can do I haven't look at yet.

Otherwise I like the one page for form presentation/error/submit idea.

Collapse
Posted by Jeff Davis on
forms are generated from templates in
packages/acs-templating/resources/forms
which have all the markup.

You can change the styling by telling it to use a different template
just like ad_return_template.  Currently an underexploited bit of functionality.

Collapse
Posted by defunct defunct on
I haven't used it, but I also assume the templates can themselves have masters?
Collapse
Posted by Ola Hansson on
Simon,

The master of the formtemplate is in effect the the .ADP page that holds the formtemplate tag itself, so that page could in turn wrap itself in a master template by putting a <master> tag at the top.

Tom,

if you like the "one page for form presentation/error/submit idea" of the form manager you will LOVE ad_form. It does presentation/error/submit and also edit, all from one tcl/adp pair!
The only package that uses ad_form, to date, that I'm aware of, is the survey package that Dave Bauer recently committed to cvs. That should be a good place to look if you want to see how it works.

Collapse
Posted by Tom Jackson on

Thanks Ola! However I have just uncovered bigger issues with Calendar. Only admins can create new calendars :(. Also, at this time the admin cannot delete calendars, or change from public to private, or even create a private calendar. It looks like if a regular user goes to calendar, they can add items to a public calendar. Somehow when I logged in as an admin, a 'personal' calendar existed already. Don't know how this happens, or why regular users are shut out.

Anyway, I think time is up for code changes to 4.6.

Collapse
Posted by Ben Adida on
Yes, with respect to creating/modifying calendars, I took a big hack to the
current system because it was too complicated to use. Let's think about a
better interface for creating/managing calendars. Right now you get a
personal calendar created by default.
Collapse
Posted by Tom Jackson on

Ben, I will hopefully look into this today, but the original admin account did have a 'Personal' calendar, but I have added several regular users. When they visit Calendar, they do not have a private Personal calendar. They can add to public calendars, but that is it. So I will hunt down the code that is supposed to create the calendar and see why it isn't working for me.

Collapse
Posted by Tom Jackson on

The calendar index page creates a personal calendar for the user only if no other calendars exist that the user can post to. What that means is that if the site has a public calendar, users will not get their personal calendar created. I'm not sure why users shouldn't be allowed to create their own calendars: unless someone complains, I am going to add this in today before the freeze.