Skip to content

Commit

Permalink
Gestione dei supervisori delle sedi di lavoro
Browse files Browse the repository at this point in the history
  • Loading branch information
mspasiano committed Dec 20, 2024
1 parent ce5d1c2 commit 9ce848c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import it.cnr.si.cool.jconon.repository.CommissionConfProperties;
import it.cnr.si.cool.jconon.repository.dto.CmisObjectCache;
import it.cnr.si.cool.jconon.util.EnvParameter;
import it.cnr.si.cool.jconon.util.JcononGroups;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -90,6 +91,7 @@ protected Map<String, Object> getModel(HttpServletRequest req) {
model.put("dataDictionary", folderService.getDataDictionaryId());
model.put("zones", zoneRepository.get());
model.put(EnvParameter.QUERY_INDEX_ENABLE, Boolean.valueOf(env.getProperty(EnvParameter.QUERY_INDEX_ENABLE, "true")));
model.put(EnvParameter.GROUPS_SUPERVISOR_SEDI, env.getProperty(EnvParameter.GROUPS_SUPERVISOR_SEDI, JcononGroups.CONCORSI.group()).split(","));
model.put("commissionVideoGender", commissionConfProperties.getGender());
final CmisObjectCache competitionFolder = cacheRepository.getCompetitionFolder();
model.put(CacheRepository.COMPETITION, competitionFolder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@

public final class EnvParameter {
public static final String QUERY_INDEX_ENABLE = "query.index.enable";
public static final String GROUPS_SUPERVISOR_SEDI = "groups.supervisor.sedi";
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*global params*/
define(['jquery', 'cnr/cnr.url', 'cnr/cnr.ui.select', 'cnr/cnr', 'json!common'], function ($, URL, Select, CNR, common) {
define(['jquery', 'cnr/cnr.url', 'cnr/cnr.ui.select', 'cnr/cnr', 'json!common', 'json!cache'], function ($, URL, Select, CNR, common, cache) {

"use strict";

Expand All @@ -20,7 +20,7 @@ define(['jquery', 'cnr/cnr.url', 'cnr/cnr.ui.select', 'cnr/cnr', 'json!common'],
struttura_destinataria.val(riga[0].citta);
sede.val(riga[0].descrizione);
} else {
if(common.User.admin || common.User.groupsArray.indexOf("GROUP_CONCORSI") !== -1) {
if(common.User.admin || isGestore()) {
struttura_destinataria.prop('disabled', false);
sede.prop('disabled', false);
}
Expand All @@ -33,6 +33,17 @@ define(['jquery', 'cnr/cnr.url', 'cnr/cnr.ui.select', 'cnr/cnr', 'json!common'],
});
select.trigger("change", true);
}

function isGestore() {
var gestore = false;
cache['groups.supervisor.sedi'].forEach(function(group) {
if (common.User.groupsArray.indexOf(group) !== -1) {
gestore = true;
}
});
return gestore;
}

function widget(id, labelText, item) {
var obj = Select.CustomWidget(id, labelText, item),
callType = params['call-type'],
Expand Down

0 comments on commit 9ce848c

Please sign in to comment.