-
Notifications
You must be signed in to change notification settings - Fork 6
Integrating with extensions
To use T & C manager for specific extension by creating unique T & C from T & C Manager. When you create the T & C then you need to add unique 'version and client' for that T & C. Client field contains the component name [Ex. com_tjlms,com_subusers]. All T & C's get stored in #__tc_content database table. T & C manager developers can use the following fields to save the T & C's.
tc_id, title, version, client, URL_pattern[option,view,params], content[body], start_date, global, groups, is_blacklist, enforce_delays_day,created_on, modified_on
URL_pattern [view,option,params] is add more field for adding view,option,params values of URL. These fields are stored in #__tc_pattern table. Below is the entry fields of #__tc_pattern table.
tc_id, client, option, view, params.
Based on T & C version, client and start date the user will accept the latest T & C. If the user has accepted latest T & C then he will get the access to pages. In this case, we will check the latest T & C id is available or not in #__tc_users table against logged in user's id. If the latest T & C id is available against logged in user's id, then will he get access easily.
Once the stored T & C start date will match the current date then that latest T & C will apply for users.[Ex. start date: 15/04/2017 == current date: 15/04/2017 ]. In addition, the latest T & C has to be created with unique version & client.
After accepting T & C that accepted user's entry will add in #__tc_users table in the database. Below is the entry fields for storing in Database.
user_id, tc_id, client, accepted_date, params.
Once you install the T & C Manager component then you can create the T & C's. Below is the form field of Create new T & C form.
Ex. of Create T & C form:
1.Title = "T & C for TJLMS and Subusers"- [textbox] --> Title of your T & C
2.Version = "1.1" - [textbox] --> Unique Version of your T & C
3.Client = "TJLMS and Subusers"- [textbox] --> Unique Client of your T & C
4.URL_pattern:[Add More field] --> Construct T & C view URL
>> Option[add component name],View[add view name] - [textbox]
I. Option = "com_tjlms" View = "report" *[remove]
II. Option = "com_subusers" View = "partner" *[remove]
III. Option = " " View = " " +[add] *[remove]
5.Content[body]= "All T & C's" - [textarea] --> Add your all T & C's in a list format
6.Start Date : "25/04/2017" - [datepicker] --> Add feature date for starting to accept T & C on pages for users
7.Global : Yes | No [Radio buttons]--> Yes - To show your T & C on all view pages. No - To show your T & C on URL_pattern pages only
8.Groups : Select user types [multiselect dropdown list]
9.Is Blacklist : Yes | No [Radio buttons]--> Yes - To show your T & C for selected list of user groups. No - To show your T & C for non selected list of user groups.
10.Enforce Delays Day: "5" - [textbox] --> Here after 5 days[Ex. 5 days] system will enforce to users for accepting T & C. You can add any limit days.
In this T & C system plugin, we will check 1st the user has accepted or not latest T & C. If he already accepted the latest T & C then that T & C's will not display again for that user. We need to check here for every heating URL is a match or not with stored T & C URL. If the URL is a match then we need to check that logged in user is already accepted or not the T & C.