Yii 1.1: cal

Event calendar as Module and as Controller (jQuery full calendar wrapper)
61 followers

jQuery full calendar wrapper.

  • add/modify/remove event
  • multi-user
  • autocreate table
  • usefull events list
  • simple cron
  • use jQuery themes

Requirements

Yii 1.1.5 or above.

Usage

1 Add in config/main.php:

'modules' => array(
        'cal' => array(
            'debug' => true // For first run only!
        ),

2 Check & set user privileges in modules/cal/components/ChangeUser.php

protected function renderContent()
    {
        $isAdmin = true;    // check admin privileges
        if (true == $isAdmin)
            $users = array(// create you own users list

For delete event save it as text-empty message.

As Controller

Unlike a widget:

  • has no side portlets,
  • text links replace with images,
  • cron is action.

Sample controller is present under controller folder.

Change log:

ver 1.1 (Feb 8, 2011)

  • added demo site
  • added public property "layout"
  • added public property "cronPeriod"
  • fixed bug in url routing
  • user Id store in session state now

ver 1.0 (Dec 12, 2010)

  • Initial release

Donate to next release:

  • represent Event Calendar as Base Controller

Resources

See other extensions:

Total 16 comments

#11777 report it
flyshoppa at 2013/02/03 06:23am
creating event..

I'm using this excellent porting of fullcalendar in a project. It happened to me to have a wrong placement of the event after its creation. Whether creating a full-day event or not it would display the event in the full-day box. When refreshing the page the event will eventually fit its position in the week/daily agenda.

So I modified cal/components/fulcal/eventCal.js and after every

$("#EventCal").fullCalendar( 'updateEvent', tempEvent);

I added

$('#EventCal').fullCalendar("refetchEvents");

as to refetch events and refresh the component. My two cents D

#9765 report it
Precaseptica at 2012/09/09 01:31am
CDbException

I downloaded and unzipped the cal-controller-1.0 and cal_1.1 files into my protected folder. Now I'm getting this error message and have yet to see anything resembling a calendar on my page:

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'admin' in 'where clause'. The SQL statement executed was: SELECT * FROM events_helper t WHERE user_id=admin

To clarify, I have no experience with frame works and their extensions, so technically oriented solutions will have to be well worded.

Thanks.

#9089 report it
nights at 2012/07/19 02:36am
this is great

but.. why isnt there any sample code for how to call the module other than going to index.php?r=cal , isnt there a way to just call to place the module anywhere? like most other components work

#7961 report it
Anthony Gaudino at 2012/04/29 09:07am
Bug / Incompatibility with newer JQuery

If you're going to use the cal extension v1.1 with JQuery 1.6+ there's a bug on cal/components/fullCal/eventCal.js related to checkboxes.

In JQuery 1.6+ the checkbox parameters are set using this syntax:

$(".myCheckbox").prop("checked", true);

but the file uses the older:

$('.myCheckbox').attr('checked','checked')

so in this file you must change all

.attr

to

.prop

A ctrl+f / crtl+h and replace all will do the job.

This solves:

  • Undefined index: allDay (/var/www/caltest/protected/modules/cal/controllers/MainController.php:84
  • New events were created as all day events even if the user specified them as not all day.
  • New events were created as being not editable even if the checkbox was not checked.

Hope this will help others.

#6051 report it
tanimgt at 2011/12/08 03:36am
ok i solved it :-)

that was my fault, i already installed a jquery ui(old version) manually in my project, when i remove that from my project, the module worked fine as i want, thanks again very much to the developer who created this for us :-)

#6050 report it
tanimgt at 2011/12/08 03:24am
the same problem as mentioned above

hello sir, the demo is working perfectly, but when i installed the module in my project , the ok and cancel button is not showing but 0 and 1 showing instead, and when i clicked them, nothing heppens, but the cross icon of that dialog box is worked, im using yii 1.1.8 . what am i supposed to do ?

o another thing, how can i delete an event, as you mentioned above, save as empty-text msg, i dont get it, what does that mean, please can you give me some suggestion\/ ?

again thanks in advance, it really an useful module.

#4569 report it
Tibor Katelbach at 2011/07/21 05:23am
changing background color

Hi I'm trying to change the 'backgroundColor' => '#EF1D1D' of an event , when I do this in the Json demo on the array of an event it works fine but when I do the same in on the events in actionList MainController, it is never applied. how to get this great feature to work ?

#3583 report it
nickcv at 2011/04/20 05:41am
delete button

i did notice that, but i thought it was not really user friendly... it's not really intuitive and it takes more time to edit the event then to press a button :D

#3582 report it
FlyBot at 2011/04/20 05:24am
delete button

Delete button is not need here. Simple modify your event and save it without any text. Empty events will delete from DB.

#3581 report it
nickcv at 2011/04/20 04:50am
a little addition

i downloaded this and just love it, but there was no delete button on the event.

i added the button, integrated the new function in the eventcal.js file and added a new delete action to the controller.

if you want to i can send you the changed files ^^

#3157 report it
sp1D3R at 2011/03/22 11:24am
Impressive!

Simply impressive. That's a HUGE work, and it's released opensource. Thank you, thank you, thank you.

#2747 report it
Thim at 2011/02/04 10:20am
installation

Thanks Gustavo of the forum, I found out how-to.

it depends of your url rules: if you use path then http://localhost/cal, if you use index.php in the name http://localhost/index.php/cal if you dont use path http://localhost/?r=cal

#2745 report it
Thim at 2011/02/04 08:06am
Install

Hi,

Can you provide some more info how to install and kick-start this module.

I followed all the above steps but without any success.

  1. I created a webapp (ex testdrive) and installed the module in testdrive/modules/cal/
  2. Add in config/main.php
  3. Check & set user privileges in modules/cal/components/ChangeUser.php

What's next? How do I surf to my the calendar pages?

#2415 report it
macinville at 2010/12/27 09:22pm
very nice!

This is impressive! Keep posting valuable extensions!

Good job!

#2354 report it
FlyBot at 2010/12/16 08:28am
re: js problem

Yes. Yii 1.1.5 release upgrade jQuery UI to new version.

#2343 report it
luc at 2010/12/15 08:17am
js problem

It looks like a nice extension of the "artshaw's fullcalendar" but I'm experiencing some troubles with the jquery libraries: On event inserting while using the ui-dialog pop up: - 'OK' and 'Cancel' buttons showing '0' and '1' instead - by clicking one of these buttons, a javascript error raise: "h.apply is not a function" in jquery-ui.min.js line 337.

I'm using YII 1.1.4 and the script libraries are loaded in that order: jquery, jquery-ui.min, fullcalendar.min, eventCal.

Have I to upgrade to Yii 1.1.5 ???

Leave a comment

Please to leave your comment.

Create extension