Yii Framework Forum: How to use yii cal extension? - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

How to use yii cal extension? Rate Topic: -----

#1 User is offline   hgdien 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 23-January 11

Posted 23 January 2011 - 11:59 PM

Hi all,

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.
0

#2 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 24 January 2011 - 12:01 AM

it is a module
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
0

#3 User is offline   hgdien 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 23-January 11

Posted 24 January 2011 - 12:09 AM

Firstly, thank you Gustavo for the timely response.

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?
0

#4 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 24 January 2011 - 12:10 AM

please post the complete error along with your url rules
--
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
0

#5 User is offline   hgdien 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 23-January 11

Posted 31 January 2011 - 09:53 PM

It's working now, I made a mistake about the allias. Thank you for the help. :)
0

#6 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 31 January 2011 - 10:08 PM

Glad i could help :)
--
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
0

#7 User is offline   Thim 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 31-December 10

Posted 04 February 2011 - 08:13 AM

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?
0

#8 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 04 February 2011 - 08:51 AM

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
--
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
0

#9 User is offline   Thim 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 31-December 10

Posted 04 February 2011 - 10:05 AM

Hi Gustavo,

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?
0

#10 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 04 February 2011 - 11:31 AM

sure thing
here is the link
glad i could help
--
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
0

#11 User is offline   donfuego 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 05-March 11

Posted 05 March 2011 - 01:00 PM

Hi I'm a Yii newbie and haven't yet grasped it but I managed to get Cal working after some real headache.

- 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
0

#12 User is offline   FlyBot 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 20-January 09
  • Location:Ukraine

Posted 06 March 2011 - 10:36 AM

Why does the EVENTS table need an AUTO_INCREMENT=4?
I also do not know. But most jQuery-based multi-users calendars are something that way.

Yes. This calendar requires user authentication
0

#13 User is offline   jtimely 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 20-March 11

Posted 20 March 2011 - 07:45 PM

First of all, thanks for this nice module.
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
0

#14 User is offline   FlyBot 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 20-January 09
  • Location:Ukraine

Posted 21 March 2011 - 01:58 PM

View Postjtimely, on 20 March 2011 - 07:45 PM, said:

First of all, thanks for this nice module.
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.
0

#15 User is offline   chriscao 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 03-February 10

Posted 30 June 2011 - 02:16 AM

Hi, this is a great module. Would you show some examples which integrate Zii calendar and cal? Thank you.
0

#16 User is offline   chriscao 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 03-February 10

Posted 30 June 2011 - 07:36 PM

I solved it.

 '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());
        }

0

#17 User is offline   trenchard 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 47
  • Joined: 07-December 10
  • Location:California

Posted 19 August 2011 - 12:51 AM

What is the best way to set this up to serve as a list of events (from a 3rd party events table) and allow users to sign up for specific events (click and go to form)? I want to use this as a single calendar with available appointments and allow people to take the appointments. Once reserved, the appointment would not show on calendar.

i have the module up and running now and am looking at all the configs, etc.
0

#18 User is offline   Preacher 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 74
  • Joined: 01-October 11

Posted 27 October 2011 - 10:10 AM

I get the following error when I first fun http://mysite/cmms/cal



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

0

#19 User is offline   Marinov 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 09-August 11

Posted 30 November 2011 - 09:38 AM

Hello,

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?
0

#20 User is offline   mrtain 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 29-November 11

Posted 10 April 2012 - 04:39 AM

View PostMarinov, on 30 November 2011 - 09:38 AM, said:

Hello,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?



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.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users