How to use yii cal extension?
#1
Posted 23 January 2011 - 11:59 PM
I am new and still learning to use Yii framework. So I need some help with installing and using the cal extension.
I tried to follow instructions from the Yii website: downloaded and put the cal folder into the extension folder, updated the main config file, but after that I have no idea how to call/display the calendar in view class.
I tried to call it as an application component, a Widget as well as a generic component following the examples of using extension on Yii website, but all of them return errors.
Any help is much appreciated here. Thank you.
#2
Posted 24 January 2011 - 12:01 AM
put it under application.modules and the access it using the url /cal, if you are using urlFormat=path
also as explained in the extension, in your configuration file you must add the module to the modules index
like
return array(
'modules'=>array(
'cal'=>array(),//options
),
'components'=>//...
);
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application
Gustavo Salomé Silva
#3
Posted 24 January 2011 - 12:09 AM
I followed your instruction, put the cal under the modules and run the path:
http://localhost/yiiapp/index.php/cal/
However, I got this error:
Alias "cal.CalModule" is invalid. Make sure it points to an existing PHP file.
How can I fix this?
#4
Posted 24 January 2011 - 12:10 AM
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application
Gustavo Salomé Silva
#5
Posted 31 January 2011 - 09:53 PM
#6
Posted 31 January 2011 - 10:08 PM
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application
Gustavo Salomé Silva
#7
Posted 04 February 2011 - 08:13 AM
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?
#8
Posted 04 February 2011 - 08:51 AM
if you dont use path http://localhost/?r=cal
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application
Gustavo Salomé Silva
#9
Posted 04 February 2011 - 10:05 AM
I had no URL rewrite turned on so ?r=cal did the trick.
Can you point me to a URL where I can read up on how to specify a path in YII?
#10
Posted 04 February 2011 - 11:31 AM
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application
Gustavo Salomé Silva
#11
Posted 05 March 2011 - 01:00 PM
- The first was self inflicted since i intend to use SQLite. It was quite easy to solve though. I removed the Character Set properties and adjusted the Auto Increment. But why does the EVENTS table need an AUTO_INCREMENT=4?? SQLite doesn't support this but it seems to work nonetheless.
- Secondly I had some serious trouble with the User Authentication. If I drop the Cal module in a default webapp it seems I need to implement the 'password' and 'id' properties of the UserIdentity component (and the getId method) as provided in the Cal Demo, right? This wasn't mentioned anywhere and took some serious code digging to find. Or am I just lost in the blue on this one?
After all it looks and runs great. I will continue testing it now and get back with more questions soon....
Kind regards
Don
#12
Posted 06 March 2011 - 10:36 AM
I also do not know. But most jQuery-based multi-users calendars are something that way.
Yes. This calendar requires user authentication
#13
Posted 20 March 2011 - 07:45 PM
I need to customize the module to allow user to block multiple days/select day range.
Would you advise where should I change in your code?
Many thanks
#14
Posted 21 March 2011 - 01:58 PM
jtimely, on 20 March 2011 - 07:45 PM, said:
I need to customize the module to allow user to block multiple days/select day range.
Would you advise where should I change in your code?
You do not need rewrite the controller's action.
To select day range you can use sample code from Full Calendar official demo:
selectable: true,
selectHelper: true,
select: function(start, end, allDay) {
var title = prompt('Event Title:');
if (title) {
$("#EventCal").fullCalendar('renderEvent',
{
title: title,
start: start,
end: end,
allDay: allDay
},
true // make the event "stick"
);
}
$("#EventCal").fullCalendar('unselect');
},
You need paste this code into components\fullCal\eventCal.js and purge assets dir, of course.
#15
Posted 30 June 2011 - 02:16 AM
#16
Posted 30 June 2011 - 07:36 PM
'options' => array(
'dateFormat' => 'yy-mm-dd',
'changeMonth' => 'true',
'changeYear' => 'true',
'showButtonPanel' => 'true',
'constrainInput' => 'false',
'onSelect' => "js:function(selectedDate) { selectDateFromCalendar(selectedDate);}",
),In eventCal.js
selectDateFromCalendar = function($selectDate)
{
var selectdstr = $selectDate;
var selectdate = $.fullCalendar.parseDate(selectdstr, "yyyy-mm-dd");
$('#EventCal').fullCalendar( 'gotoDate', selectdate.getFullYear(), selectdate.getMonth(), selectdate.getDate());
}
#17
Posted 19 August 2011 - 12:51 AM
i have the module up and running now and am looking at all the configs, etc.
#18
Posted 27 October 2011 - 10:10 AM
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'kmgoddard' in 'where clause'. The SQL statement executed was: SELECT * FROM `events_helper` `t` WHERE user_id=kmgoddard
added my username to:
protected function renderContent()
{
$isAdmin = true; // check admin privileges
if (true == $isAdmin)
$users = array(// create you own users list
#19
Posted 30 November 2011 - 09:38 AM
I have the following problem(bug) and I can't find the solution of it..
When I create a "New event" and select some time frame (exp. 7:30-8:30) I do NOT check "All day" and press "Ok" - the event go up at the top of the calendar where is the section "All day". I mean the event don't "stick" to the defined hours (7:40-8:30) but go for whole day. I checked the DB - all day is set to "0", also when you open the event to edit it, it is with correct value (7:40-8:30). If I drag&drop it, it stay on correct place, if I resize to other time frame - it's stay ok.
Only problem is when I create for first time some event, the new event don't "stick" to his defined hours but go at top as "all day" event.
I guess I can fix this from eventCal.js but I can't find where is problem. Do you have some ideas?
#20
Posted 10 April 2012 - 04:39 AM
Marinov, on 30 November 2011 - 09:38 AM, said:
Any luck with this? I'm having the exact same problem, I've noticed that when the event div is created, it is placed inside the top div(allday container) but outside of the allday events.

Help















