[Zope-CMF] Errors with onlinePIM - "patch" here

Gitte Wange gitte@mmmanager.org
Sun, 31 Mar 2002 22:47:14 +0200


----- Original Message -----=20
From: "Mehmet Yousouf" <mehmety@auslin.com.au>
To: "zope-cmf" <zope-cmf@zope.org>
Sent: Sunday, March 31, 2002 12:01 PM
Subject: [Zope-CMF] Errors with onlinePIM


> Hi, I'm trying to setup onlinePIM in CMF(running Zope-2.5.0 installed =
from=20
> source, CMF-1.2, python 2.2) and although most things work, The =
calendar=20
> doesn't. clicking on "edit your calendar settings" displays a form =
with=20
> nothing in  the section available types.=20

This happens when you haven't set up anyting in the toolbox ...=20
If you are an administrator, you can go to =
<portal_url>/toolbox_global_edit_form and setup the types you want your =
members to be able to add.
Then the members click on the little tool icon on their desktop and =
decide what types they want easy access to from their desktop. If they =
don't setup anything, they will have access to all the types the =
administrator selected.

Now the types should also turn up on the "edit your calendar settings" =
display.


> -when you click on a day, the=20
> following error occurs:
>=20

I wrote a little "patch" for Mehmet ... I discovered this silly error =
just after releasing 0.2 :-(

The fuction getHeadlin in the CalendarTool should look like this:
   security.declarePublic('getMonthName')
    def getHeadline(self, date=3DNone, mode=3D'month'):
        """
            Return the headline for the calendar.
        """
        if date is None:
            date =3D DateTime()
        else:
            date =3D DateTime(date)

        if mode =3D=3D 'day':
            dname =3D date.Day()
            if use_localizer:
                dname =3D _(dname)
            daydate =3D date.dd()
            mname =3D date.Month()
            if use_localizer:
                mname =3D _(mname)
            zLOG.LOG('Calendar', zLOG.INFO, 'translated: %s' % mname)
            mname =3D str(dname) + ' ' + str(daydate) + ' ' + str(mname)

        elif mode =3D=3D 'month':
            mname =3D date.Month()
            if use_localizer:
                mname =3D _(mname)
            year =3D date.year()
            mname =3D str(mname) + ' ' + str(year)

        return mname

The error-producing lines are these:
if mode =3D=3D 'day':
    dname =3D date.Day()
    if use_localizer:
        dname =3D _(dname)

It's the use_localizer line that is missing ..=20
So if you are running OnlinePIM in a Zope instance without Localizer =
installed, you really need to add the line in your CalendarTool.py file =
..=20

Greetings,
Gitte Wange