MDL-62535 tool_dataprivacy: Registry shows deprecated interfaces.
authorAdrian Greeve <abgreeve@gmail.com>
Thu, 16 Aug 2018 06:34:29 +0000 (14:34 +0800)
committerAdrian Greeve <abgreeve@gmail.com>
Mon, 20 Aug 2018 03:32:01 +0000 (11:32 +0800)
admin/tool/dataprivacy/classes/metadata_registry.php
admin/tool/dataprivacy/lang/en/tool_dataprivacy.php
admin/tool/dataprivacy/templates/component_status.mustache
admin/tool/dataprivacy/templates/data_registry_compliance.mustache

index ca50157..e29174a 100644 (file)
@@ -76,6 +76,16 @@ class metadata_registry {
                 if (isset($contributedplugins[$plugintype][$shortname])) {
                     $internaldata['external'] = true;
                 }
+
+                // Check if the interface is deprecated.
+                if (!$manager->is_empty_subsystem($component)) {
+                    $classname = $manager->get_provider_classname_for_component($component);
+                    $componentclass = new $classname();
+                    if ($componentclass instanceof \core_privacy\local\deprecated) {
+                        $internaldata['deprecated'] = true;
+                    }
+                }
+
                 return $internaldata;
             }, $leaves['plugins']);
             $fullyrichtree[$branch]['plugin_type_raw'] = $plugintype;
index 3c1c31c..7b5906e 100644 (file)
@@ -85,6 +85,8 @@ $string['deletepurposetext'] = 'Are you sure you want to delete "{$a}" purpose?'
 $string['defaultssaved'] = 'Defaults saved';
 $string['deny'] = 'Deny';
 $string['denyrequest'] = 'Deny request';
+$string['deprecated'] = 'Deprecated';
+$string['deprecatedexplanation'] = 'This plugin is using an old version of one of the privacy interfaces and should be updated.';
 $string['download'] = 'Download';
 $string['dporolemapping'] = 'Privacy officer role mapping';
 $string['dporolemapping_desc'] = 'The privacy officer can manage data requests. The capability tool/dataprivacy:managedatarequests must be allowed for a role to be listed as a privacy officer role mapping option.';
index c62dc0b..3f7b691 100644 (file)
@@ -61,6 +61,9 @@
         {{#external}}
             <span class="badge badge-pill badge-notice">{{#str}}external, tool_dataprivacy{{/str}}</span>
         {{/external}}
+        {{#deprecated}}
+            <span class="badge badge-pill badge-warning">{{#str}}deprecated, tool_dataprivacy{{/str}}</span>
+        {{/deprecated}}
     </div>
 
     {{#compliant}}
index caadac1..c4a9c1b 100644 (file)
@@ -45,6 +45,8 @@
         <dd>{{#str}}requiresattentionexplanation, tool_dataprivacy{{/str}}</dd>
         <dt><span class="badge badge-pill badge-notice">{{#str}}external, tool_dataprivacy{{/str}}</span></dt>
         <dd>{{#str}}externalexplanation, tool_dataprivacy{{/str}}</dd>
+        <dt><span class="badge badge-pill badge-warning">{{#str}}deprecated, tool_dataprivacy{{/str}}</span></dt>
+        <dd>{{#str}}deprecatedexplanation, tool_dataprivacy{{/str}}</dd>
     </dl>
     <hr />
     <div class="clearfix"><a class="tool_dataprivacy-expand-all pull-right" href="#" data-visibility-state='visible'>{{#str}}visible, tool_dataprivacy{{/str}}</a></div>