In this tutorial we will see how to create a calendar for implementation to filter by users. For this, we will use two applications, Calendar and Control application that will act as the filter users.
Creating the Calendar
1. The table that will be used for the calendar implementation is “events”.
CREATE TABLE `events` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `title` VARCHAR(64) DEFAULT NULL, `description` VARCHAR(128) DEFAULT NULL, `start_date` DATE DEFAULT NULL, `start_time` TIME DEFAULT NULL, `end_date` DATE DEFAULT NULL, `end_time` TIME DEFAULT NULL, `recurrent` VARCHAR(1) DEFAULT NULL, `period` VARCHAR(1) DEFAULT NULL, `users` VARCHAR(10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
2. Select the table fields that will be used in the application.
Items with “*” are required to create the application. The other fields are only used for information to the agenda.
- Id: Used to identify the record, select the primary key field in this table. (Int (11))
- Title: Used to store the subject of each activity that is displayed in the application. ((Varchar (50))
- Start date: the start date of the activity will be recorded. * (Date or datetime)
- Start Time: Will record the start time of the activity. * (Date or datetime)
- End date: end date of the activity will be recorded. * (Date or datetime)
- End Time: Will record the finish time of the activity. * (Date or datetime)
- Recurrence: Used to state whether the event repeats in a month, week or day. (Int) (1)
- Period: Used to state the type of recurrence reptição: month, week or day. (Int) (1)
Note: If you have a field of type datetime in the database, you can list the options date and time using the same datetime field from the database. The application will take the two values and will concatenate them before saving in the database.
3. Edit the field “USERS” , select “Defined value” and enter the variable name Global [var_login]
4. Use this field as parameter to receive the value of a global variable
In WHERE clause of app Calendar, use this condition:
Creating the Control application
5. Create a Control application
6. Create a field to inform the specific user
7. In this part we can change the label
8. Create the link to the Calendar
9. Select the Application link type and click in Continue.
10. Select the Calendar
11. Now we will pass the field as parameter to the Calendar
12. Click the Run button on the toolbar.