1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
|
|
|
4 |
Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
it under the terms of the GNU General Public License as published by
|
|
|
6 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
(at your option) any later version.
|
|
|
8 |
|
|
|
9 |
Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
GNU General Public License for more details.
|
|
|
13 |
|
|
|
14 |
You should have received a copy of the GNU General Public License
|
|
|
15 |
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
}}
|
|
|
17 |
{{!
|
|
|
18 |
@template tool_policy/page_agreedocs
|
|
|
19 |
|
|
|
20 |
Template for showing to the user the policy docs to agree.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
* policyactions
|
|
|
24 |
|
|
|
25 |
Data attributes required for JS:
|
|
|
26 |
-
|
|
|
27 |
|
|
|
28 |
Context variables required for this template:
|
|
|
29 |
* pluginbaseurl
|
|
|
30 |
* myurl
|
|
|
31 |
* sesskey
|
|
|
32 |
* policies - policy array
|
|
|
33 |
* behalfuser - If behalfid is defined and valid, full name of the behalf user with a link to his/her profile; null otherwise
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
Example context (json):
|
|
|
37 |
{
|
|
|
38 |
"myurl": "/admin/tool/policy/index.php",
|
|
|
39 |
"sesskey": "123456",
|
|
|
40 |
"behalfuser": "Sam Student",
|
|
|
41 |
"policies": [
|
|
|
42 |
{
|
|
|
43 |
"id": 1,
|
|
|
44 |
"name": "Terms & conditions",
|
|
|
45 |
"policymodal": "<a href=\"#\">Terms & conditions</a>",
|
|
|
46 |
"summary": "Policy <u>summary</u>",
|
|
|
47 |
"versionagreed": false,
|
|
|
48 |
"versionlangsagreed": "Agreed",
|
|
|
49 |
"versionbehalfsagreed": ""
|
|
|
50 |
}
|
|
|
51 |
]
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
}}
|
|
|
55 |
|
|
|
56 |
<div class="rui-book-wrapper wrapper-fw">
|
|
|
57 |
{{#messages}}{{{.}}}{{/messages}}
|
|
|
58 |
|
|
|
59 |
<form id="agreedocsform" method="post" action="{{myurl}}">
|
|
|
60 |
<input type="hidden" name="sesskey" value="{{sesskey}}">
|
|
|
61 |
|
|
|
62 |
{{#behalfuser}}
|
|
|
63 |
<div class="clearfix">
|
|
|
64 |
<div class="float-right mb-2">
|
|
|
65 |
<span class="badge-sq badge-danger">
|
|
|
66 |
<svg class="mr-2" width="20" height="20" fill="none" viewBox="0 0 24 24">
|
|
|
67 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4.9522 16.3536L10.2152 5.85658C10.9531 4.38481 13.0539 4.3852 13.7913 5.85723L19.0495 16.3543C19.7156 17.6841 18.7487 19.25 17.2613 19.25H6.74007C5.25234 19.25 4.2854 17.6835 4.9522 16.3536Z"></path>
|
|
|
68 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10V12"></path>
|
|
|
69 |
<circle cx="12" cy="16" r="1" fill="currentColor"></circle>
|
|
|
70 |
</svg>
|
|
|
71 |
{{# str }} viewconsentpageforuser, tool_policy, {{{ . }}} {{/ str }}
|
|
|
72 |
</span>
|
|
|
73 |
</div>
|
|
|
74 |
</div>
|
|
|
75 |
{{/behalfuser}}
|
|
|
76 |
|
|
|
77 |
<div class="clearfix">
|
|
|
78 |
<div class="float-left">
|
|
|
79 |
<h3>{{# str }}consentpagetitle, tool_policy{{/ str }}</h3>
|
|
|
80 |
</div>
|
|
|
81 |
</div>
|
|
|
82 |
|
|
|
83 |
<div class="clearfix mt-2">
|
|
|
84 |
<h4>{{# str }}agreepolicies, tool_policy {{/ str }}</h4>
|
|
|
85 |
</div>
|
|
|
86 |
|
|
|
87 |
<hr>
|
|
|
88 |
|
|
|
89 |
{{#policies}}
|
|
|
90 |
|
|
|
91 |
<input value="{{id}}" name="listdoc[]" type="hidden">
|
|
|
92 |
|
|
|
93 |
<div class="agreedoc-policy clearfix mt-2 mb-1">
|
|
|
94 |
<h3>{{{name}}}</h3>
|
|
|
95 |
<div class="agreedoc-content">
|
|
|
96 |
<div class="agreedoc-summary mb-2">
|
|
|
97 |
{{{summary}}}
|
|
|
98 |
</div>
|
|
|
99 |
<div class="agreedoc-msg">
|
|
|
100 |
{{# str }}refertofullpolicytext, tool_policy, {{{policymodal}}} {{/ str }}
|
|
|
101 |
</div>
|
|
|
102 |
<div class="agreedoc-form mt-1">
|
|
|
103 |
{{#optional}}
|
|
|
104 |
<div class="agreedoc-radios">
|
|
|
105 |
<div class="agreedoc-radios-1">
|
|
|
106 |
<label>
|
|
|
107 |
<input type="radio" name="status{{id}}" value="1" {{#versionagreed}}checked="{{.}}"{{/versionagreed}}>
|
|
|
108 |
{{# str }}iagree, tool_policy, {{{name}}} {{/ str }}
|
|
|
109 |
</label>
|
|
|
110 |
</div>
|
|
|
111 |
<div class="agreedoc-radios-0">
|
|
|
112 |
<label>
|
|
|
113 |
<input type="radio" name="status{{id}}" value="0" {{#versiondeclined}}checked="{{.}}"{{/versiondeclined}}>
|
|
|
114 |
{{# str }}idontagree, tool_policy, {{{name}}} {{/ str }}
|
|
|
115 |
</label>
|
|
|
116 |
</div>
|
|
|
117 |
</div>
|
|
|
118 |
{{/optional}}
|
|
|
119 |
{{^optional}}
|
|
|
120 |
<div class="agreedoc-checkbox d-inline-flex">
|
|
|
121 |
<div class="custom-control custom-switch mt-2">
|
|
|
122 |
<input class="custom-control-input" value="1" name="status{{id}}" id="status{{id}}" {{#versionagreed}}checked="{{.}}"{{/versionagreed}} type="checkbox">
|
|
|
123 |
<label class="custom-control-label" for="status{{id}}">
|
|
|
124 |
{{# str }}iagree, tool_policy, {{{name}}} {{/ str }}
|
|
|
125 |
<svg
|
|
|
126 |
width="14"
|
|
|
127 |
height="14"
|
|
|
128 |
viewBox="0 0 24 24"
|
|
|
129 |
fill="none"
|
|
|
130 |
xmlns="http://www.w3.org/2000/svg"
|
|
|
131 |
>
|
|
|
132 |
<path
|
|
|
133 |
d="M11 6H13V10.079L16.3413 7.73938L17.4885 9.37768L13.7434 12L17.4885 14.6223L16.3413 16.2606L13 13.921V18H11V13.921L7.65864 16.2606L6.51148 14.6223L10.2565 12L6.51147 9.37769L7.65863 7.73938L11 10.079V6Z"
|
|
|
134 |
fill="#ef1010"
|
|
|
135 |
/>
|
|
|
136 |
</svg>
|
|
|
137 |
</label>
|
|
|
138 |
</div>
|
|
|
139 |
</div>
|
|
|
140 |
<ul class="agreedoc-msg list-unstyled">
|
|
|
141 |
{{#versionlangsagreed}}
|
|
|
142 |
<li><small>{{{.}}}</small></li>
|
|
|
143 |
{{/versionlangsagreed}}
|
|
|
144 |
{{#versionbehalfsagreed}}
|
|
|
145 |
<li><small>{{{.}}}</small></li>
|
|
|
146 |
{{/versionbehalfsagreed}}
|
|
|
147 |
</ul>
|
|
|
148 |
{{/optional}}
|
|
|
149 |
</div>
|
|
|
150 |
</div>
|
|
|
151 |
</div>
|
|
|
152 |
|
|
|
153 |
{{/policies}}
|
|
|
154 |
|
|
|
155 |
<small>
|
|
|
156 |
{{# str }}somefieldsrequired, form,
|
|
|
157 |
<svg
|
|
|
158 |
width="14"
|
|
|
159 |
height="14"
|
|
|
160 |
viewBox="0 0 24 24"
|
|
|
161 |
fill="none"
|
|
|
162 |
xmlns="http://www.w3.org/2000/svg"
|
|
|
163 |
>
|
|
|
164 |
<path
|
|
|
165 |
d="M11 6H13V10.079L16.3413 7.73938L17.4885 9.37768L13.7434 12L17.4885 14.6223L16.3413 16.2606L13 13.921V18H11V13.921L7.65864 16.2606L6.51148 14.6223L10.2565 12L6.51147 9.37769L7.65863 7.73938L11 10.079V6Z"
|
|
|
166 |
fill="#ef1010"
|
|
|
167 |
/>
|
|
|
168 |
</svg>
|
|
|
169 |
{{/ str }}
|
|
|
170 |
</small>
|
|
|
171 |
<hr>
|
|
|
172 |
|
|
|
173 |
<input type="submit" class="btn btn-success" name="submit" value={{#quote}}{{#str}} next {{/str}}{{/quote}}>
|
|
|
174 |
{{#cancancel}}
|
|
|
175 |
<input type="submit" class="btn btn-danger" name="cancel" value={{#quote}}{{#str}} cancel {{/str}}{{/quote}}>
|
|
|
176 |
{{/cancancel}}
|
|
|
177 |
</form>
|
|
|
178 |
</div>
|
|
|
179 |
{{#js}}
|
|
|
180 |
// Initialise the JS for the modal window which displays the policy versions.
|
|
|
181 |
require(['tool_policy/policyactions'], function(ActionsMod) {
|
|
|
182 |
ActionsMod.init('[data-action="view"]');
|
|
|
183 |
});
|
|
|
184 |
{{/js}}
|