Yii 1.1: availability

Table with selectable cells representing periods of the week
4 followers

Renders a 7x3 table (days of the week X periods of the day) representing the availability of the users.
If the var readOny is set false then allow users to modify the availability.
If the var userId the the same of the logged user, readOnly is set true.

Sorry it has been developed in Italian, but the code is in English.
Should be translated easily, if you have any problem just comment the extension.
If you translate it please let me know so I can make it available to the others

Now available in Portuguese-Brazilian by scoob.junior

Example

Installation

Extract to the project main folder.

Import the Date component in config/main.php

return array(
...
    'import'=>array(
        'components.Date',
    ),
...

Add this column to the user table

availabiliy TEXT NULL DEFAULT NULL,

Add this line to the css/main.css

#availability .selected {
    background-color: #33FF33;
}
 
#availability th {
    background: none repeat scroll 0 0 #C3D9FF;
}
 
#availability td,
#availability th {
    cursor: pointer;
    /*Stupid IE*/
    cursor: hand;
}
 
.hidden {
    display: none;
}

Usage

Start the widget like this

$this->widget('Availability', array(
    'userId'=> $model->id,
    ));

Changelog

May 5, 2011 version 1.1

fixed cells toggling.
Now select all, day and period clicking select or deselect all cells instead of toggle them

Total 4 comments

#3682 report it
Draga at 2011/04/27 02:35pm
prtg trans

Hey scoob.junior, thanks, I've sent you an email ;)

#3669 report it
Junior - df9 at 2011/04/27 07:07am
Portuguese Translation

Hey! Good job!

How do I send you the pt-br translation?

Regards!

#3647 report it
Draga at 2011/04/26 06:51am
that's right

You're right johnatan, thanks.

#3646 report it
Johnatan at 2011/04/26 06:49am
Error?

If the var readOny is set true then allow users to modify the availability.

I guess that if value readOnly is set to true, then users shouldn't be able to modify the availability.

Leave a comment

Please to leave your comment.

Create extension