diff --git a/productMods/edit/forms/personHasPositionHistory.jsp b/productMods/edit/forms/personHasPositionHistory.jsp index e3af80d4..ca6a77e9 100644 --- a/productMods/edit/forms/personHasPositionHistory.jsp +++ b/productMods/edit/forms/personHasPositionHistory.jsp @@ -19,10 +19,10 @@ <%@ taglib prefix="v" uri="http://vitro.mannlib.cornell.edu/vitro/tags" %> <% - VitroRequest vreq = new VitroRequest(request); - WebappDaoFactory wdf = vreq.getWebappDaoFactory(); - vreq.setAttribute("defaultNamespace", wdf.getDefaultNamespace()); - + VitroRequest vreq = new VitroRequest(request); + WebappDaoFactory wdf = vreq.getWebappDaoFactory(); + vreq.setAttribute("defaultNamespace", wdf.getDefaultNamespace()); + String flagURI = null; if (vreq.getAppBean().isFlag1Active()) { flagURI = VitroVocabulary.vitroURI+"Flag1Value"+vreq.getPortal().getPortalId()+"Thing"; @@ -45,22 +45,22 @@ and in the literalsOnForm --%> - SELECT ?titleExisting WHERE { - ?positionUri <${titlePred}> ?titleExisting } + SELECT ?titleExisting WHERE { + ?positionUri <${titlePred}> ?titleExisting } <%-- Pair the "existing" query with the skeleton of what will be asserted for a new statement involving this field. The actual assertion inserted in the model will be created via string substitution into the ? variables. NOTE the pattern of punctuation (a period after the prefix URI and after the ?field) --%> - ?positionUri <${titlePred}> ?title . - ?positionUri <${rdf}label> ?title. + ?positionUri <${titlePred}> ?title . + ?positionUri <${rdf}label> ?title. SELECT ?existingOrgName WHERE { - ?positionUri <${involvedOrgNamePred}> ?existingOrgName } + ?positionUri <${involvedOrgNamePred}> ?existingOrgName } ?positionUri <${involvedOrgNamePred}> ?organizationName . @@ -69,7 +69,7 @@ SELECT ?startYearExisting WHERE { - ?positionUri <${startYearPred}> ?startYearExisting } + ?positionUri <${startYearPred}> ?startYearExisting } ?positionUri <${startYearPred}> ?startYear . @@ -78,7 +78,7 @@ SELECT ?endYearExisting WHERE { - ?positionUri <${endYearPred}> ?endYearExisting } + ?positionUri <${endYearPred}> ?endYearExisting } ?positionUri <${endYearPred}> ?endYear . @@ -89,12 +89,12 @@ or in the SparqlForExistingUris, as well as perhaps in how the options are prepared --%> - SELECT ?existingOrgUri WHERE { - ?positionUri <${positionInOrgPred}> ?existingOrgUri } + SELECT ?existingOrgUri WHERE { + ?positionUri <${positionInOrgPred}> ?existingOrgUri } - ?positionUri <${positionInOrgPred}> ?organizationUri . - ?organizationUri <${vivo}organizationForPosition> ?positionUri . + ?positionUri <${positionInOrgPred}> ?organizationUri . + ?organizationUri <${vivo}organizationForPosition> ?positionUri . @@ -129,7 +129,7 @@ "literalsInScope": { }, "urisOnForm" : [ "organizationUri" ], "literalsOnForm" : [ "title", "organizationName", - "startYear", "endYear" ], + "startYear", "endYear" ], "filesOnForm" : [ ], "sparqlForLiterals" : { }, "sparqlForUris" : { }, @@ -158,7 +158,7 @@ "newResource" : "false", "validators" : [ ], "optionsType" : "INDIVIDUALS_VIA_VCLASS", - "literalOptions" : [ "--" ], + "literalOptions" : [ "Select one" ], "predicateUri" : "", "objectClassUri" : "${organizationClass}", "rangeDatatypeUri" : "", @@ -203,35 +203,35 @@ <% - EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request); - if (editConfig == null) { - editConfig = new EditConfiguration( - (String) request - .getAttribute("editjson")); - EditConfiguration.putConfigInSession(editConfig,session); - } - - Model model = (Model) application.getAttribute("jenaOntModel"); - String objectUri = (String) request.getAttribute("objectUri"); - if (objectUri != null) { - editConfig.prepareForObjPropUpdate(model); - } else { - editConfig.prepareForNonUpdate(model); - } - - /* prepare the page title and text for the submit button */ - String subjectName = ((Individual) request.getAttribute("subject")).getName(); - String submitLabel = ""; - if (objectUri != null) { - request.setAttribute("title","Edit position entry for "+ subjectName); - submitLabel = "Save changes"; - } else { - request.setAttribute("title","Create a new position entry for " + subjectName); - submitLabel = "Create new position history entry"; - } - - List customJs = new ArrayList(Arrays.asList("../js/customForms/personHasPositionHistory.js")); - request.setAttribute("customJs", customJs); + EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request); + if (editConfig == null) { + editConfig = new EditConfiguration( + (String) request + .getAttribute("editjson")); + EditConfiguration.putConfigInSession(editConfig,session); + } + + Model model = (Model) application.getAttribute("jenaOntModel"); + String objectUri = (String) request.getAttribute("objectUri"); + if (objectUri != null) { + editConfig.prepareForObjPropUpdate(model); + } else { + editConfig.prepareForNonUpdate(model); + } + + /* prepare the page title and text for the submit button */ + String subjectName = ((Individual) request.getAttribute("subject")).getName(); + String submitLabel = ""; + if (objectUri != null) { + request.setAttribute("title","Edit position entry for "+ subjectName); + submitLabel = "Save changes"; + } else { + request.setAttribute("title","Create a new position entry for " + subjectName); + submitLabel = "Create new position history entry"; + } + + List customJs = new ArrayList(Arrays.asList("../js/customForms/personHasPositionHistory.js")); + request.setAttribute("customJs", customJs); %> @@ -239,6 +239,10 @@

${title}

" > +
+ If your organization is not listed, please add a new organization +
+
@@ -248,7 +252,7 @@
- + diff --git a/productMods/js/customForms/personHasPositionHistory.js b/productMods/js/customForms/personHasPositionHistory.js index e69de29b..acdc908c 100644 --- a/productMods/js/customForms/personHasPositionHistory.js +++ b/productMods/js/customForms/personHasPositionHistory.js @@ -0,0 +1,12 @@ +var personHasPositionHistory = { + + onLoad: function() { + $("#newOrg").hide(); + $("#position").hide(); + $("#submit").val("Continue"); + } +}; + +$(document).ready(function(){ + personHasPositionHistory.onLoad(); +});