In this tutorial we will see how to create an implementation calendar to filter by users. For this, we will use two applications, Calendar and Control that will act as users of the filter.
Creating the calendar
1. The table that will be used for the implementation of the calendar 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 fields from the table that will be used in the application.
Items with “*” are required to create the application. The other fields are only used for calendar information.
- Id: Used to identify the record, select the primary key field in this table. (Int (11))
- Id .: To identify the record, select the primary key field in this table. (Int (11))
- Title: used to store the theme of each activity that is displayed in the application. ((Varchar (50))
- Start date: the start date of the activity will be recorded. * (Date or date and time)
- Start time: record the start time of the activity. * (Date or date and time)
- End date: the end date of the activity will be recorded. * (Date or date and time)
- End time: will record the end time of the activity. * (Date or date and time)
- Recurrence: used to indicate whether the event is repeated in a month, week or day. (Int) (1)
- Period: used to indicate the type of repetition reptição: month, week or day. (Int) (1)
Note: If you have a type field datetime in the database, you can list the date and time options using the same datetime field in the database.The application will take both values and concatenate them before saving them in the database
3. Edit the field “USERS“, select “Defined value” and enter the name of the Global variable [var_login]
4. Use this field as parameter to receive the value of a global variable
In the WHERE clause of the Calendar application, 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 link type of the Application and click Continue
10. Select the calendar
11. Now we will pass the field as a parameter to the Calendar.
12. Click on the Run button on the toolbar.