@@ -51,10 +51,30 @@ private function buildCollectionArray($sources)
51
51
foreach ($ collections as $ collection ) {
52
52
$ selection = isset ($ collection ['usedBy ' ]);
53
53
$ prohibited = isset ($ collection ['usageProhibitedBy ' ]);
54
+ $ accessDenied = false ;
55
+ $ disableCheckbox = false ;
56
+ if (isset ($ collection ['isRestricted ' ]) && $ collection ['isRestricted ' ] == 'http://vocab.ub.uni-leipzig.de/amsl/Yes ' ){
57
+ $ accessDenied = true ;
58
+ $ disableCheckbox = true ;
59
+ }
60
+ if ($ prohibited || $ accessDenied ){
61
+ $ disableCheckbox = true ;
62
+ }
63
+ $ permitted = false ;
64
+ if (isset ($ collection ['permittedForLibrary ' ]) && $ collection ['permittedForLibrary ' ] == 'http://lobid.org/organisation/DE-15 ' ){
65
+ $ permitted = true ;
66
+ }
67
+
68
+ $ usage_note = '' ;
69
+ if ($ accessDenied && $ permitted ){
70
+ $ usage_note = '</br><b> -> you need to contact your admin to select/deselect this collection</b> ' ;
71
+ }
54
72
$ resultArray ['children ' ][] = array (
55
- "title " => isset ($ collection ['label ' ]) ? $ collection ['label ' ] : $ collection ['collection ' ],
73
+ "title " => isset ($ collection ['label ' ]) ? $ collection ['label ' ] . $ usage_note : $ collection ['collection ' ] . $ usage_note ,
56
74
"selected " => $ selection ,
57
- "hideCheckbox " => $ prohibited ,
75
+ "hideCheckbox " => $ disableCheckbox ,
76
+ "accessDenied " => $ accessDenied ,
77
+ "permitted " => $ permitted ,
58
78
"data " => array ("collection " => $ collection ['collection ' ]));
59
79
}
60
80
}
@@ -84,15 +104,18 @@ public function queryMetadataCollections($metadataSource)
84
104
PREFIX amsl: <http://vocab.ub.uni-leipzig.de/amsl/>
85
105
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
86
106
87
- // SELECT ?collection ?usedBy ?label ?usageProhibitedBy WHERE {
107
+ // SELECT ?collection ?usedBy ?label ?isRestricted ?permittedForLibrary WHERE {
88
108
?collection a amsl:MetadataCollection .
89
109
?collection amsl:includedInMetadataSource < " . $ metadataSource . "> .
90
110
?collection rdfs:label ?label
91
111
OPTIONAL {
92
112
?collection amsl:metadataUsedByLibrary ?usedBy . FILTER (?usedBy = < " . $ membership . ">)
93
113
}
94
114
OPTIONAL {
95
- ?collection amsl:metadataUsageProhibited ?usageProhibitedBy . FILTER (?usageProhibitedBy = < " . $ membership . ">)
115
+ ?collection amsl:metadataUsageRestricted ?isRestricted .
116
+ }
117
+ OPTIONAL {
118
+ ?collection amsl:metadataUsagePermittedForLibrary ?permittedForLibrary . FILTER (?permittedForLibrary = < " . $ membership . ">)
96
119
}
97
120
} " ;
98
121
$ result = $ this ->_model ->sparqlQuery ($ query );
0 commit comments