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_dataprivacy/purposes
|
|
|
19 |
|
|
|
20 |
Manage purposes.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
|
|
|
24 |
Data attributes required for JS:
|
|
|
25 |
|
|
|
26 |
Context variables required for this template:
|
|
|
27 |
* purposes - array of objects
|
|
|
28 |
* actions - array of actions (already in HTML).
|
|
|
29 |
|
|
|
30 |
Example context (json):
|
|
|
31 |
{
|
|
|
32 |
"purposesexist": 1,
|
|
|
33 |
"purposes": [
|
|
|
34 |
{
|
|
|
35 |
"name" : "Purpose 1",
|
|
|
36 |
"description": "<strong>Purpose 1 description</strong>",
|
|
|
37 |
"retentionperiod": 86400,
|
|
|
38 |
"protected": 1,
|
|
|
39 |
"formattedretentionperiod": "1 day",
|
|
|
40 |
"actions": [
|
|
|
41 |
]
|
|
|
42 |
}, {
|
|
|
43 |
"name" : "Purpose 2",
|
|
|
44 |
"description": "<strong>Purpose 2 description</strong>",
|
|
|
45 |
"retentionperiod": 7200,
|
|
|
46 |
"protected": 0,
|
|
|
47 |
"formattedretentionperiod": "2 hours",
|
|
|
48 |
"actions": [
|
|
|
49 |
]
|
|
|
50 |
}
|
|
|
51 |
]
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
}}
|
|
|
55 |
|
|
|
56 |
{{#navigation}}
|
|
|
57 |
<div class="my-3">
|
|
|
58 |
{{> core/action_link}}
|
|
|
59 |
</div>
|
|
|
60 |
{{/navigation}}
|
|
|
61 |
|
|
|
62 |
<p class="lead-2">
|
|
|
63 |
{{#str}}purposeoverview, tool_dataprivacy{{/str}}
|
|
|
64 |
</p>
|
|
|
65 |
|
|
|
66 |
<div data-region="purposes" class="mb-1">
|
|
|
67 |
<div class="my-1">
|
|
|
68 |
<button class="btn btn-secondary" data-add-element="purpose" title="{{#str}}addpurpose, tool_dataprivacy{{/str}}">
|
|
|
69 |
{{#pix}}t/add, moodle, {{#str}}addpurpose, tool_dataprivacy{{/str}}{{/pix}} <span class="ml-2">{{#str}}addpurpose, tool_dataprivacy{{/str}}</span>
|
|
|
70 |
</button>
|
|
|
71 |
</div>
|
|
|
72 |
|
|
|
73 |
<div class="overflow-auto">
|
|
|
74 |
<table class="table table-striped table-hover" style="min-width: max-content">
|
|
|
75 |
<caption class="accesshide">{{#str}}purposeslist, tool_dataprivacy{{/str}}</caption>
|
|
|
76 |
<thead>
|
|
|
77 |
<tr>
|
|
|
78 |
<th scope="col" style="max-width: 300px">{{#str}}name{{/str}}</th>
|
|
|
79 |
<th scope="col" style="max-width: 300px">{{#str}}lawfulbases, tool_dataprivacy{{/str}}</th>
|
|
|
80 |
<th scope="col" style="max-width: 300px">{{#str}}sensitivedatareasons, tool_dataprivacy{{/str}}</th>
|
|
|
81 |
<th scope="col">{{#str}}retentionperiod, tool_dataprivacy{{/str}}</th>
|
|
|
82 |
<th scope="col">{{#str}}protected, tool_dataprivacy{{/str}}</th>
|
|
|
83 |
<th scope="col">{{#str}}roleoverrides, tool_dataprivacy{{/str}}</th>
|
|
|
84 |
<th scope="col">{{#str}}actions{{/str}}</th>
|
|
|
85 |
</tr>
|
|
|
86 |
</thead>
|
|
|
87 |
<tbody>
|
|
|
88 |
{{#purposes}}
|
|
|
89 |
<tr data-purposeid="{{id}}">
|
|
|
90 |
<td style="max-width: 300px">
|
|
|
91 |
<dl>
|
|
|
92 |
<dt>
|
|
|
93 |
{{{name}}}
|
|
|
94 |
</dt>
|
|
|
95 |
<dd class="small">
|
|
|
96 |
{{{description}}}
|
|
|
97 |
</dd>
|
|
|
98 |
</dl>
|
|
|
99 |
</td>
|
|
|
100 |
<td style="max-width: 300px">
|
|
|
101 |
<ul class="small">
|
|
|
102 |
{{#formattedlawfulbases}}
|
|
|
103 |
<li class="py-2 mb-1">
|
|
|
104 |
<span class="mr-1">{{name}}</span> {{# pix }} i/info, core, {{description}} {{/ pix }}
|
|
|
105 |
</li>
|
|
|
106 |
{{/formattedlawfulbases}}
|
|
|
107 |
</ul>
|
|
|
108 |
</td>
|
|
|
109 |
<td style="max-width: 300px">
|
|
|
110 |
<ul class="small">
|
|
|
111 |
{{#formattedsensitivedatareasons}}
|
|
|
112 |
<li class="py-2 mb-1">
|
|
|
113 |
<span class="mr-1">{{name}}</span>{{# pix }} i/info, core, {{description}} {{/ pix }}
|
|
|
114 |
</li>
|
|
|
115 |
{{/formattedsensitivedatareasons}}
|
|
|
116 |
</ul>
|
|
|
117 |
</td>
|
|
|
118 |
<td>{{formattedretentionperiod}}</td>
|
|
|
119 |
<td class="text-align: center">
|
|
|
120 |
{{#protected}}
|
|
|
121 |
<span class="badge badge-success">{{#pix}}i/checked, core, {{#str}}yes{{/str}}{{/pix}}</span>
|
|
|
122 |
{{/protected}}
|
|
|
123 |
{{^protected}}
|
|
|
124 |
<span class="badge badge-warning">{{#str}}no{{/str}}</span>
|
|
|
125 |
{{/protected}}
|
|
|
126 |
</td>
|
|
|
127 |
<td>
|
|
|
128 |
{{#roleoverrides}}
|
|
|
129 |
<span class="badge badge-success">{{#str}}yes{{/str}}</span>
|
|
|
130 |
{{/roleoverrides}}
|
|
|
131 |
{{^roleoverrides}}
|
|
|
132 |
<span class="badge badge-warning">{{#str}}no{{/str}}</span>
|
|
|
133 |
{{/roleoverrides}}
|
|
|
134 |
</td>
|
|
|
135 |
<td>
|
|
|
136 |
{{#actions}}
|
|
|
137 |
{{> core/action_menu}}
|
|
|
138 |
{{/actions}}
|
|
|
139 |
</td>
|
|
|
140 |
</tr>
|
|
|
141 |
{{/purposes}}
|
|
|
142 |
</tbody>
|
|
|
143 |
</table>
|
|
|
144 |
</div>
|
|
|
145 |
|
|
|
146 |
{{^purposes}}
|
|
|
147 |
<span class="badge badge-warning">
|
|
|
148 |
{{#str}}nopurposes, tool_dataprivacy{{/str}}
|
|
|
149 |
</span>
|
|
|
150 |
{{/purposes}}
|
|
|
151 |
|
|
|
152 |
|
|
|
153 |
</div>
|