From c172eba346abf4902b167ac261df8d0a93ba06c1 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Thu, 12 Mar 2009 12:04:24 +0000 Subject: [PATCH] Merged V3.1 to HEAD 13371: Fix for ETHREEOH-1371, ETHREEOH-1373, ETHREEOH-1374. Rule comparator now correctly deals with MLTEXT datatype fields such as name/title/description. 13372: Fix for ETHREEOH-1291. Fixes the general issue that "decodeURI()" should not be used to decode javascript encoded strings -unless- you specifically want to ignore certain characters, "unescape()" should be used instead. 13373: Fix for ETHREEOH-1284. Clean up of generated javascript for UIDataPager component - also moved to include file for performance and ease of modification. 13384: Fix for ETHREEOH-1459. Sweep through and clean up of the Edit Online/Offline editing and Checkin/Checkout process as per latest wireframes. A number of minor fixes to JSF action evaluators and related JSPs also. Icons updated as per wires. 13396: Fix for ETHREEOH-1424. Web-framework script connector now generates an Accept-Language header based on current user locale by default for remote calls. 13404: Missing paging controls added to task and workflow dialogs (part of ETHREEOH-1410). git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13596 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/messages/webclient.properties | 6 +- config/alfresco/web-client-config-actions.xml | 70 +++++----- config/alfresco/web-client-config-dialogs.xml | 2 +- .../evaluator/CancelCheckoutDocEvaluator.java | 7 +- .../evaluator/CancelEditingDocEvaluator.java | 8 +- .../action/evaluator/CheckinDocEvaluator.java | 7 +- .../evaluator/DoneEditingDocEvaluator.java | 6 +- .../evaluator/ForumsCheckinDocEvaluator.java | 3 +- .../action/evaluator/UpdateDocEvaluator.java | 13 +- .../evaluator/UploadNewVersionEvaluator.java | 26 ++-- .../web/bean/coci/CancelEditingDialog.java | 4 +- .../web/bean/coci/DoneEditingDialog.java | 20 +-- .../ui/common/component/data/UIDataPager.java | 120 ++++++------------ .../org/alfresco/web/ui/repo/tag/PageTag.java | 2 - source/web/images/icons/cancel_checkout.gif | Bin 0 -> 1045 bytes .../images/icons/cancel_checkout_large.gif | Bin 1473 -> 1392 bytes .../web/images/icons/done_editing_large.gif | Bin 1526 -> 1481 bytes source/web/jsp/actions/actions.jsp | 4 +- source/web/jsp/coci/checkout-file-link.jsp | 2 +- source/web/jsp/coci/done-editing.jsp | 2 +- source/web/jsp/content/add-content-dialog.jsp | 2 +- .../content/create-content-wizard/details.jsp | 2 +- source/web/jsp/content/upload-new-version.jsp | 116 +++-------------- source/web/jsp/forums/create-dialog.jsp | 2 +- source/web/jsp/forums/create-topic-dialog.jsp | 2 +- source/web/jsp/ml/add-translation-dialog.jsp | 2 +- source/web/jsp/rules/composite-condition.jsp | 4 +- source/web/jsp/rules/conditions.jsp | 4 +- source/web/jsp/spaces/create-space-dialog.jsp | 2 +- .../spaces/create-space-wizard/details.jsp | 2 +- source/web/jsp/wcm/add-content-dialog.jsp | 2 +- source/web/jsp/wcm/create-folder-dialog.jsp | 2 +- .../wcm/create-web-content-wizard/details.jsp | 2 +- source/web/jsp/wcm/create-webapp.jsp | 2 +- .../jsp/wcm/create-website-wizard/details.jsp | 4 +- .../workflow-options.jsp | 1 + .../workflow/view-completed-task-dialog.jsp | 1 + source/web/scripts/ajax/common.js | 100 +++++++++++++++ source/web/scripts/onload.js | 15 --- 39 files changed, 259 insertions(+), 310 deletions(-) create mode 100644 source/web/images/icons/cancel_checkout.gif delete mode 100644 source/web/scripts/onload.js diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 88dc9190f9..a3df611ac0 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -99,6 +99,7 @@ search_description=This view allows you to see the results from your search. checkinfile_description=Check in your working copy for other team members to work with. checkoutfilelink_description=Edit the checked out file, undo the check out or carry on working. checkoutfile_description=Enter information about the check out. +doneediting_description=Finish editing your working copy to allow other team members to work it with. documentdetails_description=View the details about the content. linkdetails_description=View the details about the link object. previewdocument_description=Preview the content or space within a Template. @@ -352,9 +353,10 @@ delete=Delete edit=Edit checkin=Check In checkout=Check Out +done_editing=Done Editing checkout_document=Check out this document undocheckout=Undo Check Out -cancel_editing=Cancel File Editing +cancel_editing=Cancel Editing delete_space=Delete Space delete_file=Delete File delete_rule=Delete Rule @@ -707,7 +709,7 @@ undo_checkout_for=Undo Check Out for undo_checkout=Undo Check Out undo_checkout_info=If you undo the check out of a document, the associated working copy will be deleted and all changes to it since the Check Out will be lost. cancel_editing_for=Cancel Editing for -cancel_editing_info=If you cancel editing of a document, the associated working copy will be deleted and all changes to it since the Check Out will be lost. +cancel_editing_info=Are you sure you want to Cancel Editing? Any changes to the working copy will be lost. complete=complete working_copy_for=Working copy for working_copy_missing_info=The working copy is no longer available. This could be due to an active rule(s) applied to the space you checked-out to. diff --git a/config/alfresco/web-client-config-actions.xml b/config/alfresco/web-client-config-actions.xml index 836de3b604..ee7a29caa6 100644 --- a/config/alfresco/web-client-config-actions.xml +++ b/config/alfresco/web-client-config-actions.xml @@ -175,7 +175,7 @@ org.alfresco.web.action.evaluator.CancelCheckoutDocEvaluator undocheckout - /images/icons/undo_checkout.gif + /images/icons/cancel_checkout.gif #{CCUndoCheckoutFileDialog.setupContentAction} dialog:undoCheckoutFile @@ -198,7 +198,7 @@ org.alfresco.web.action.evaluator.DoneEditingDocEvaluator - checkin + done_editing /images/icons/done_editing.gif #{DoneEditingDialog.handle} @@ -974,59 +974,47 @@ false inlineAction + - + - - - - - - - + + + + + + + - - - - + + + - + @@ -1036,7 +1024,7 @@ - + false @@ -1080,29 +1068,29 @@ + - - - - - + + + + - + + - + + diff --git a/config/alfresco/web-client-config-dialogs.xml b/config/alfresco/web-client-config-dialogs.xml index dfec936242..1759b25f4f 100644 --- a/config/alfresco/web-client-config-dialogs.xml +++ b/config/alfresco/web-client-config-dialogs.xml @@ -611,7 +611,7 @@ description-id="checkinfile_description" /> + icon="/images/icons/done_editing_large.gif" description-id="doneediting_description" /> diff --git a/source/java/org/alfresco/web/action/evaluator/CancelCheckoutDocEvaluator.java b/source/java/org/alfresco/web/action/evaluator/CancelCheckoutDocEvaluator.java index 4895b83ee9..63834da162 100644 --- a/source/java/org/alfresco/web/action/evaluator/CancelCheckoutDocEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/CancelCheckoutDocEvaluator.java @@ -42,7 +42,8 @@ public class CancelCheckoutDocEvaluator extends BaseActionEvaluator */ public boolean evaluate(Node node) { - return (node.hasPermission(PermissionService.CANCEL_CHECK_OUT) && - node.hasAspect(ContentModel.ASPECT_WORKING_COPY)); + return (node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && + node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE) == null && + node.hasPermission(PermissionService.CANCEL_CHECK_OUT)); } -} +} \ No newline at end of file diff --git a/source/java/org/alfresco/web/action/evaluator/CancelEditingDocEvaluator.java b/source/java/org/alfresco/web/action/evaluator/CancelEditingDocEvaluator.java index 4218a63be7..26e28c8ef0 100644 --- a/source/java/org/alfresco/web/action/evaluator/CancelEditingDocEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/CancelEditingDocEvaluator.java @@ -30,18 +30,16 @@ import org.alfresco.web.bean.repository.Node; /** * UI Action Evaluator - Cancel editing document. - * */ public class CancelEditingDocEvaluator extends BaseActionEvaluator { - /** * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node) */ public boolean evaluate(Node node) { - return (node.hasPermission(PermissionService.CANCEL_CHECK_OUT) && - node.hasAspect(ContentModel.ASPECT_WORKING_COPY)); + return (node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && + node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE) != null && + node.hasPermission(PermissionService.CANCEL_CHECK_OUT)); } - } diff --git a/source/java/org/alfresco/web/action/evaluator/CheckinDocEvaluator.java b/source/java/org/alfresco/web/action/evaluator/CheckinDocEvaluator.java index f468fec736..17b446dab4 100644 --- a/source/java/org/alfresco/web/action/evaluator/CheckinDocEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/CheckinDocEvaluator.java @@ -42,7 +42,8 @@ public class CheckinDocEvaluator extends BaseActionEvaluator */ public boolean evaluate(Node node) { - return (node.hasPermission(PermissionService.CHECK_IN) && - node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == true); + return (node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && + node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE) == null && + node.hasPermission(PermissionService.CHECK_IN)); } -} +} \ No newline at end of file diff --git a/source/java/org/alfresco/web/action/evaluator/DoneEditingDocEvaluator.java b/source/java/org/alfresco/web/action/evaluator/DoneEditingDocEvaluator.java index 7215ea624e..afa68a6226 100644 --- a/source/java/org/alfresco/web/action/evaluator/DoneEditingDocEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/DoneEditingDocEvaluator.java @@ -30,7 +30,6 @@ import org.alfresco.web.bean.repository.Node; /** * UI Action Evaluator - Done editing document. - * */ public class DoneEditingDocEvaluator extends BaseActionEvaluator { @@ -39,7 +38,8 @@ public class DoneEditingDocEvaluator extends BaseActionEvaluator */ public boolean evaluate(Node node) { - return (node.hasPermission(PermissionService.CHECK_IN) && - node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == true); + return (node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE) != null && + node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && + node.hasPermission(PermissionService.CHECK_IN)); } } \ No newline at end of file diff --git a/source/java/org/alfresco/web/action/evaluator/ForumsCheckinDocEvaluator.java b/source/java/org/alfresco/web/action/evaluator/ForumsCheckinDocEvaluator.java index 06834ced06..d26882bbf5 100644 --- a/source/java/org/alfresco/web/action/evaluator/ForumsCheckinDocEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/ForumsCheckinDocEvaluator.java @@ -50,7 +50,8 @@ public class ForumsCheckinDocEvaluator extends BaseActionEvaluator { boolean allow = false; - if (node.hasAspect(ContentModel.ASPECT_WORKING_COPY)) + if (node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && + node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE) == null) { if (node.hasAspect(ForumModel.ASPECT_DISCUSSABLE)) { diff --git a/source/java/org/alfresco/web/action/evaluator/UpdateDocEvaluator.java b/source/java/org/alfresco/web/action/evaluator/UpdateDocEvaluator.java index 5e2920bac8..5d7eebce0c 100644 --- a/source/java/org/alfresco/web/action/evaluator/UpdateDocEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/UpdateDocEvaluator.java @@ -24,8 +24,6 @@ */ package org.alfresco.web.action.evaluator; -import java.util.Map; - import javax.faces.context.FacesContext; import org.alfresco.model.ContentModel; @@ -51,12 +49,11 @@ public class UpdateDocEvaluator extends BaseActionEvaluator DictionaryService dd = Repository.getServiceRegistry( FacesContext.getCurrentInstance()).getDictionaryService(); - Map props = node.getProperties(); - - boolean isOfflineEditing = props.get(ContentModel.PROP_WORKING_COPY_MODE) != null && props.get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOfflineDialog.OFFLINE_EDITING); + boolean isOfflineEditing = + (EditOfflineDialog.OFFLINE_EDITING.equals(node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE))); return dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT) && - ((node.isWorkingCopyOwner() == true && !isOfflineEditing) || - (node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false)); + ((node.isWorkingCopyOwner() && !isOfflineEditing) || + (!node.isLocked() && !node.hasAspect(ContentModel.ASPECT_WORKING_COPY))); } -} +} \ No newline at end of file diff --git a/source/java/org/alfresco/web/action/evaluator/UploadNewVersionEvaluator.java b/source/java/org/alfresco/web/action/evaluator/UploadNewVersionEvaluator.java index a2c2028dc8..303ef64484 100644 --- a/source/java/org/alfresco/web/action/evaluator/UploadNewVersionEvaluator.java +++ b/source/java/org/alfresco/web/action/evaluator/UploadNewVersionEvaluator.java @@ -24,8 +24,6 @@ */ package org.alfresco.web.action.evaluator; -import java.util.Map; - import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.security.PermissionService; import org.alfresco.web.bean.coci.EditOfflineDialog; @@ -33,20 +31,16 @@ import org.alfresco.web.bean.repository.Node; /** * UI Action Evaluator - Upload new version - * */ public class UploadNewVersionEvaluator extends BaseActionEvaluator { - - /** - * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node) - */ - public boolean evaluate(Node node) - { - Map props = node.getProperties(); - - return (node.hasPermission(PermissionService.CHECK_IN) && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == true && - props.get(ContentModel.PROP_WORKING_COPY_MODE) != null && props.get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOfflineDialog.OFFLINE_EDITING)); - } - -} + /** + * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node) + */ + public boolean evaluate(Node node) + { + return (node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && + EditOfflineDialog.OFFLINE_EDITING.equals(node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE)) && + node.hasPermission(PermissionService.CHECK_IN)); + } +} \ No newline at end of file diff --git a/source/java/org/alfresco/web/bean/coci/CancelEditingDialog.java b/source/java/org/alfresco/web/bean/coci/CancelEditingDialog.java index 499b9adad9..65acdf055c 100644 --- a/source/java/org/alfresco/web/bean/coci/CancelEditingDialog.java +++ b/source/java/org/alfresco/web/bean/coci/CancelEditingDialog.java @@ -35,7 +35,7 @@ import org.apache.commons.logging.LogFactory; public class CancelEditingDialog extends CheckinCheckoutDialog { - public static final String LBL_CANCEL_EDITING = "cancel_editing"; + public static final String MSG_CANCEL_EDITING = "cancel_editing"; public static final String MSG_CANCEL_EDITING_FOR = "cancel_editing_for"; private static Log logger = LogFactory.getLog(CheckinCheckoutDialog.class); @@ -62,7 +62,7 @@ public class CancelEditingDialog extends CheckinCheckoutDialog @Override public String getFinishButtonLabel() { - return Application.getMessage(FacesContext.getCurrentInstance(), LBL_CANCEL_EDITING); + return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CANCEL_EDITING); } /** diff --git a/source/java/org/alfresco/web/bean/coci/DoneEditingDialog.java b/source/java/org/alfresco/web/bean/coci/DoneEditingDialog.java index 259e9b9cb6..431032a6e0 100644 --- a/source/java/org/alfresco/web/bean/coci/DoneEditingDialog.java +++ b/source/java/org/alfresco/web/bean/coci/DoneEditingDialog.java @@ -47,13 +47,13 @@ import org.alfresco.web.ui.common.Utils; */ public class DoneEditingDialog extends CheckinCheckoutDialog { - - private final static String MSG_DONE = "done"; - private static final String MSG_CHECK_IN = "check_in"; + private final static String MSG_OK = "ok"; + private static final String MSG_DONE_EDITING = "done_editing"; private final static String MSG_MISSING_ORIGINAL_NODE = "missing_original_node"; private final static String DIALOG_NAME = AlfrescoNavigationHandler.DIALOG_PREFIX + "doneEditingFile"; + /** * this flag indicates occurrence when source node isn't versionable, but working copy yet is versionable */ @@ -95,7 +95,7 @@ public class DoneEditingDialog extends CheckinCheckoutDialog /** * @return Returns true if source node for selected working copy founded */ - public boolean isSourceFounded() + public boolean isSourceFound() { return (sourceNodeRef != null); } @@ -132,28 +132,30 @@ public class DoneEditingDialog extends CheckinCheckoutDialog { sourceNodeRef = getSourceNodeRef(node.getNodeRef()); if (sourceNodeRef != null) + { sourceVersionable = getNodeService().hasAspect(sourceNodeRef, ContentModel.ASPECT_VERSIONABLE); + } } } @Override public String getFinishButtonLabel() { - return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DONE); + return Application.getMessage(FacesContext.getCurrentInstance(), MSG_OK); } @Override public boolean getFinishButtonDisabled() { - return !isSourceFounded(); + return !isSourceFound(); } @Override public String getContainerTitle() { - if (isSourceFounded()) + if (isSourceFound()) { - return Application.getMessage(FacesContext.getCurrentInstance(), MSG_CHECK_IN) + " '" + getNodeService().getProperty(sourceNodeRef, ContentModel.PROP_NAME) + "'"; + return Application.getMessage(FacesContext.getCurrentInstance(), MSG_DONE_EDITING) + " '" + getNodeService().getProperty(sourceNodeRef, ContentModel.PROP_NAME) + "'"; } else { @@ -183,7 +185,7 @@ public class DoneEditingDialog extends CheckinCheckoutDialog */ private String getCurrentVersionLabel() { - if (isSourceFounded()) + if (isSourceFound()) { Version curVersion = property.getVersionQueryService().getCurrentVersion(sourceNodeRef); return curVersion.getVersionLabel(); diff --git a/source/java/org/alfresco/web/ui/common/component/data/UIDataPager.java b/source/java/org/alfresco/web/ui/common/component/data/UIDataPager.java index 51e24b391a..b43fffa10c 100644 --- a/source/java/org/alfresco/web/ui/common/component/data/UIDataPager.java +++ b/source/java/org/alfresco/web/ui/common/component/data/UIDataPager.java @@ -38,14 +38,12 @@ import javax.faces.event.AbortProcessingException; import javax.faces.event.ActionEvent; import javax.faces.event.FacesEvent; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.alfresco.web.app.Application; import org.alfresco.web.data.IDataContainer; import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.WebResources; -import org.springframework.util.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * @author Kevin Roast @@ -96,6 +94,10 @@ public class UIDataPager extends UICommand return; } + final String formClientId = Utils.getParentForm(context, this).getClientId(context); + final String pageInputId = getPageInputId(); + final String hiddenFieldName = getHiddenFieldName(); + ResponseWriter out = context.getResponseWriter(); ResourceBundle bundle = Application.getBundle(context); StringBuilder buf = new StringBuilder(512); @@ -130,15 +132,15 @@ public class UIDataPager extends UICommand imageVericalAlign = "middle"; imageStyle = "margin-top:0px;"; inputPageNumber.append(""); + inputPageNumber.append("onkeydown=\"").append(generateIE6InputOnkeydownScript(pageInputId, formClientId, hiddenFieldName)).append("\" "); + inputPageNumber.append("id=\"").append(pageInputId).append("\" />"); } else { inputPageNumber.append(""); + inputPageNumber.append("id=\"").append(pageInputId).append("\" />"); } } @@ -170,7 +172,7 @@ public class UIDataPager extends UICommand if (currentPage != 0) { buf.append(""); buf.append(Utils.buildImageTag(context, WebResources.IMAGE_FIRSTPAGE, 16, 16, bundle.getString(FIRST_PAGE), null, imageVericalAlign, imageStyle)); buf.append(""); @@ -186,7 +188,7 @@ public class UIDataPager extends UICommand if (currentPage != 0) { buf.append(""); buf.append(Utils.buildImageTag(context, WebResources.IMAGE_PREVIOUSPAGE, 16, 16, bundle.getString(PREVIOUS_PAGE), null, imageVericalAlign, imageStyle)); buf.append(""); @@ -232,7 +234,7 @@ public class UIDataPager extends UICommand if ((dataContainer.getCurrentPage() < dataContainer.getPageCount() - 1) == true) { buf.append(""); buf.append(Utils.buildImageTag(context, WebResources.IMAGE_NEXTPAGE, 16, 16, bundle.getString(NEXT_PAGE), null, imageVericalAlign, imageStyle)); buf.append(""); @@ -248,7 +250,7 @@ public class UIDataPager extends UICommand if ((dataContainer.getCurrentPage() < dataContainer.getPageCount() - 1) == true) { buf.append(""); buf.append(Utils.buildImageTag(context, WebResources.IMAGE_LASTPAGE, 16, 16, bundle.getString(LAST_PAGE), null, imageVericalAlign, imageStyle)); buf.append(""); @@ -266,17 +268,17 @@ public class UIDataPager extends UICommand private void createClicableDigitForPage(int num, StringBuilder buf) { buf.append("") - .append(num + 1) - .append(" "); + .append(generateEventScript(num, getHiddenFieldName())) + .append("\">") + .append(num + 1) + .append(" "); } private void createDigitForPage(int num, StringBuilder buf) { buf.append("") - .append(num + 1) - .append(" "); + .append(num + 1) + .append(" "); } private void encodeType0(StringBuilder buf, int currentPage, int pageCount) @@ -555,9 +557,9 @@ public class UIDataPager extends UICommand * * @param page page index to generate script to jump too */ - private String generateEventScript(int page) + private String generateEventScript(int page, String hiddenFieldName) { - return Utils.generateFormSubmit(getFacesContext(), this, getHiddenFieldName(), Integer.toString(page)); + return Utils.generateFormSubmit(getFacesContext(), this, hiddenFieldName, Integer.toString(page)); } /** @@ -579,31 +581,16 @@ public class UIDataPager extends UICommand * * @return JavaScript code */ - private String generateInputOnkeyupScript() + private String generateInputOnkeyupScript(String pageInputId, String formClientId, String hiddenFieldName) { - final String formClientId = Utils.getParentForm(getFacesContext(), this).getClientId(getFacesContext()); final StringBuilder script = new StringBuilder(128); - script.append("function validateAndSubmit(e)"); - script.append("{"); - script.append(" var keycode;"); - script.append(" if (window.event) keycode = window.event.keyCode;"); - script.append(" else if (e) keycode = e.which;"); - script.append(" if (keycode == 13)"); - script.append(" {"); - script.append(" var inputControl = $('").append(getPageInputId()).append("');"); - script.append(" var dialogForm = $('dialog');"); - script.append(" if (dialogForm) {dialogForm.removeProperty('onsubmit');}"); - script.append(" var val = parseInt(inputControl.value);"); - script.append(" if (val == 'NaN' || document.forms['").append(formClientId).append("']['").append(getHiddenFieldName()).append("']==undefined)"); - script.append(" { inputControl.value = 1; return false; }"); - script.append(" else"); - script.append(" { val = (val-1)>=0 ? val-1 : 0; "); - script.append(" document.forms['").append(formClientId).append("']['").append(getHiddenFieldName()).append("'].value=val;"); - script.append(" document.forms['").append(formClientId).append("'].submit(); return false;"); - script.append(" }"); - script.append(" }"); - script.append(" return true;"); - script.append("}; return validateAndSubmit(event);"); + script.append("return validateAndSubmit(event,'") + .append(getPageInputId()) + .append("','") + .append(formClientId) + .append("','") + .append(hiddenFieldName) + .append("');"); return script.toString(); } @@ -614,21 +601,7 @@ public class UIDataPager extends UICommand */ private String generateInputOnkeydownScript() { - final StringBuilder script = new StringBuilder(128); - script.append("function onlyDigits(e)"); - script.append("{"); - script.append(" var keycode;"); - script.append(" if (window.event) keycode = window.event.keyCode;"); - script.append(" else if (e) keycode = e.which;"); - script.append(" var keychar = String.fromCharCode(keycode);"); - script.append(" var numcheck = /\\d/;"); - script.append(" var dialogForm = $('dialog');"); - script.append(" if (dialogForm && keycode==13) { "); - script.append(" dialogForm.setProperty('onsubmit','return false;')"); - script.append(" }"); - script.append(" return keycode==13 || keycode==8 || keycode==37 || keycode==39 || keycode==46 || (keycode>=96 && keycode<=105) || numcheck.test(keychar);"); - script.append("}; return onlyDigits(event);"); - return script.toString(); + return "return onlyDigits(event);"; } /** @@ -636,31 +609,16 @@ public class UIDataPager extends UICommand * It handles only digits and some 'useful' keys. * @return JavaScript code */ - private String generateIE6InputOnkeydownScript() + private String generateIE6InputOnkeydownScript(String pageInputId, String formClientId, String hiddenFieldName) { - final String formClientId = Utils.getParentForm(getFacesContext(), this).getClientId(getFacesContext()); final StringBuilder script = new StringBuilder(128); - script.append("function onlyDigits(e)"); - script.append("{"); - script.append(" var keycode;"); - script.append(" if (window.event) keycode = window.event.keyCode;"); - script.append(" else if (e) keycode = e.which;"); - script.append(" var keychar = String.fromCharCode(keycode);"); - script.append(" var numcheck = /\\d/;"); - script.append(" if (keycode == 13)"); - script.append(" {"); - script.append(" var inputControl = $('").append(getPageInputId()).append("');"); - script.append(" var val = parseInt(inputControl.value);"); - script.append(" if (val == 'NaN' || document.forms['").append(formClientId).append("']['").append(getHiddenFieldName()).append("']==undefined)"); - script.append(" { inputControl.value = 1; return false; }"); - script.append(" else"); - script.append(" { val = (val-1)>=0 ? val-1 : 0; "); - script.append(" document.forms['").append(formClientId).append("']['").append(getHiddenFieldName()).append("'].value=val;"); - script.append(" document.forms['").append(formClientId).append("'].submit(); return false;"); - script.append(" }"); - script.append(" }"); - script.append(" return keycode==13 || keycode==8 || keycode==37 || keycode==39 || keycode==46 || (keycode>=96 && keycode<=105) || numcheck.test(keychar);"); - script.append("}; return onlyDigits(event);"); + script.append("return onlyDigitsIE6(event,'") + .append(getPageInputId()) + .append("','") + .append(formClientId) + .append("','") + .append(hiddenFieldName) + .append("');"); return script.toString(); } diff --git a/source/java/org/alfresco/web/ui/repo/tag/PageTag.java b/source/java/org/alfresco/web/ui/repo/tag/PageTag.java index b672def5a2..7708ee12cf 100644 --- a/source/java/org/alfresco/web/ui/repo/tag/PageTag.java +++ b/source/java/org/alfresco/web/ui/repo/tag/PageTag.java @@ -61,8 +61,6 @@ public class PageTag extends TagSupport "/scripts/menu.js", // webdav javascript "/scripts/webdav.js", - // functionality for window.onload - "/scripts/onload.js", // base yahoo file "/scripts/ajax/yahoo/yahoo/yahoo-min.js", // io handling (AJAX) diff --git a/source/web/images/icons/cancel_checkout.gif b/source/web/images/icons/cancel_checkout.gif new file mode 100644 index 0000000000000000000000000000000000000000..910e9d2ab050ba2a96e38cc1235534a5c6633ecf GIT binary patch literal 1045 zcmeH`T~AU00EUlB3{#6%ZjR{&&JUzSKr_r%XwLMa>D<_C<)(9X)!M2XZB7v~i2%Lm zLem7@wAosaD|1?Ypfj6d6D_D9&Vj?>^Pn6)4kC>5PjuD$1DI3gGdB9%dp$+ z-*i7BhQD1%;w*^?d@O) z|FXXBbUOTjfY0Y!Soq{cQLh*Mytd}U{0L&3oS6JLKQ9)GF$@c`ij2lza_Q6gxjCss zGCnqDg<%jhFD))I>pF29kHw+~;qXQ_?d#Uo?92zZ+oM@t?w3hNhXz+yR$NXOVzb4I zi{c>&r1 zAprnHz_}yy(I)^B2Jnrwnmn?CdIQ|dSXD#v;~kUD%E~3}$d$_!&aL9atG%bvNS(aa zw%Qa~7G;3y6AB(Bvm43maduh{v4I40ALJyYo-8eS4ACkyeaQ(AXAM?hpgO&BmC9YB z3WS^!M3SyOyFxg{Pp|4x1JdeDUYFqg&$bF#9wpXp5VVOzKoY@Gdrvr)#kol230PFs z6B^wm&LC)b$;=c&O(`@XI1O-8>&4Bt$)^-}A**Yz6sx}ucdaHnOER>cF#{{S*qhWP*h literal 0 HcmV?d00001 diff --git a/source/web/images/icons/cancel_checkout_large.gif b/source/web/images/icons/cancel_checkout_large.gif index bec0134e1b98adc5ece44b1aac60480c5e33d905..c4a0c8e8d9f47d56dbf7170e87828e30f8ee621b 100644 GIT binary patch literal 1392 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 PvdV3Y^YY9W1q1*)!_t@K delta 415 zcmV;Q0bu^g3-${PM@dFFIbk3GAOQFBu?%Dcf66mVMM8uSf(I`V0 z^2;yBvc@~Q7&3?^2RI9sQzaN9OBkxCF-imx?+jK6i?}jPBm`t&w9zKq(#ALj3H1B) J)ffc?06WwemzV$m diff --git a/source/web/jsp/actions/actions.jsp b/source/web/jsp/actions/actions.jsp index eb543576dd..280d06b27b 100644 --- a/source/web/jsp/actions/actions.jsp +++ b/source/web/jsp/actions/actions.jsp @@ -49,12 +49,12 @@ if (inputField.value == "no-condition") { - document.getElementById("wizard:wizard-body:set-add-button").value = decodeURI(short_label); + document.getElementById("wizard:wizard-body:set-add-button").value = unescape(short_label); document.getElementById("wizard:wizard-body:instruction-text").innerHTML = short_text; } else { - document.getElementById("wizard:wizard-body:set-add-button").value = decodeURI(long_label); + document.getElementById("wizard:wizard-body:set-add-button").value = unescape(long_label); document.getElementById("wizard:wizard-body:instruction-text").innerHTML = long_text; } } diff --git a/source/web/jsp/coci/checkout-file-link.jsp b/source/web/jsp/coci/checkout-file-link.jsp index a45eb06943..ba2e1ae4b4 100644 --- a/source/web/jsp/coci/checkout-file-link.jsp +++ b/source/web/jsp/coci/checkout-file-link.jsp @@ -65,7 +65,7 @@ <%-- downloadable file link generated by CheckinCheckoutDialog --%> - + diff --git a/source/web/jsp/coci/done-editing.jsp b/source/web/jsp/coci/done-editing.jsp index 954c41027d..67e66137d5 100644 --- a/source/web/jsp/coci/done-editing.jsp +++ b/source/web/jsp/coci/done-editing.jsp @@ -31,7 +31,7 @@ <%@ page buffer="32kb" contentType="text/html;charset=UTF-8"%> - + diff --git a/source/web/jsp/content/add-content-dialog.jsp b/source/web/jsp/content/add-content-dialog.jsp index 055f9f8f7e..4037432b0a 100644 --- a/source/web/jsp/content/add-content-dialog.jsp +++ b/source/web/jsp/content/add-content-dialog.jsp @@ -204,7 +204,7 @@ if (fileUploaded) { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:file-name"), - decodeURI(''), true); + unescape(''), true); } else { diff --git a/source/web/jsp/content/create-content-wizard/details.jsp b/source/web/jsp/content/create-content-wizard/details.jsp index 9c8d7ba157..866b26ebd1 100644 --- a/source/web/jsp/content/create-content-wizard/details.jsp +++ b/source/web/jsp/content/create-content-wizard/details.jsp @@ -62,7 +62,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("wizard:wizard-body:file-name"), - decodeURI(''), + unescape(''), true); } else diff --git a/source/web/jsp/content/upload-new-version.jsp b/source/web/jsp/content/upload-new-version.jsp index e4c2a8ff54..40ed29f5f3 100644 --- a/source/web/jsp/content/upload-new-version.jsp +++ b/source/web/jsp/content/upload-new-version.jsp @@ -60,108 +60,30 @@ if (fileUploaded) } %>
- - - - - - - - + + - -
- - - - - - - - - - - - <% - - if (fileUploaded) - { - %> -
- - - - - <% - } - %> - + +
- + + + +
- - - - - - - - - - - - - - - - - - - - - - -
- -
- - + + + +
-
- - - - - - -
-
- -
- -
-
- + + + + + +
- - - - - - - - -
- - - - - - - -
-
-
+
\ No newline at end of file diff --git a/source/web/jsp/forums/create-dialog.jsp b/source/web/jsp/forums/create-dialog.jsp index 6c8e4c5075..1d4504c931 100644 --- a/source/web/jsp/forums/create-dialog.jsp +++ b/source/web/jsp/forums/create-dialog.jsp @@ -61,7 +61,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:name"), - decodeURI(''), + unescape(''), true); } else diff --git a/source/web/jsp/forums/create-topic-dialog.jsp b/source/web/jsp/forums/create-topic-dialog.jsp index 3a5420feb5..e84e694aa7 100644 --- a/source/web/jsp/forums/create-topic-dialog.jsp +++ b/source/web/jsp/forums/create-topic-dialog.jsp @@ -62,7 +62,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:name"), - decodeURI(''), + unescape(''), true); } else diff --git a/source/web/jsp/ml/add-translation-dialog.jsp b/source/web/jsp/ml/add-translation-dialog.jsp index 71466b2a12..26fe863487 100644 --- a/source/web/jsp/ml/add-translation-dialog.jsp +++ b/source/web/jsp/ml/add-translation-dialog.jsp @@ -214,7 +214,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:file-name"), - decodeURI(''), true); + unescape(''), true); } else { diff --git a/source/web/jsp/rules/composite-condition.jsp b/source/web/jsp/rules/composite-condition.jsp index eb119a094e..547dc13cc7 100644 --- a/source/web/jsp/rules/composite-condition.jsp +++ b/source/web/jsp/rules/composite-condition.jsp @@ -63,12 +63,12 @@ if (inputField.value == "no-condition") { - document.getElementById("composite-condition:set-add-button").value = decodeURI(short_label); + document.getElementById("composite-condition:set-add-button").value = unescape(short_label); document.getElementById("composite-condition:instruction-text").innerHTML = short_text; } else { - document.getElementById("composite-condition:set-add-button").value = decodeURI(long_label); + document.getElementById("composite-condition:set-add-button").value = unescape(long_label); document.getElementById("composite-condition:instruction-text").innerHTML = long_text; } } diff --git a/source/web/jsp/rules/conditions.jsp b/source/web/jsp/rules/conditions.jsp index 9cce095b9d..860358fa0b 100644 --- a/source/web/jsp/rules/conditions.jsp +++ b/source/web/jsp/rules/conditions.jsp @@ -49,12 +49,12 @@ if (inputField.value == "no-condition") { - document.getElementById("wizard:wizard-body:set-add-button").value = decodeURI(short_label); + document.getElementById("wizard:wizard-body:set-add-button").value = unescape(short_label); document.getElementById("wizard:wizard-body:instruction-text").innerHTML = short_text; } else { - document.getElementById("wizard:wizard-body:set-add-button").value = decodeURI(long_label); + document.getElementById("wizard:wizard-body:set-add-button").value = unescape(long_label); document.getElementById("wizard:wizard-body:instruction-text").innerHTML = long_text; } } diff --git a/source/web/jsp/spaces/create-space-dialog.jsp b/source/web/jsp/spaces/create-space-dialog.jsp index 28c5ce1c41..412d820062 100644 --- a/source/web/jsp/spaces/create-space-dialog.jsp +++ b/source/web/jsp/spaces/create-space-dialog.jsp @@ -61,7 +61,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:name"), - decodeURI(''), + unescape(''), true); } else diff --git a/source/web/jsp/spaces/create-space-wizard/details.jsp b/source/web/jsp/spaces/create-space-wizard/details.jsp index 91def2d87b..7c43b0f863 100644 --- a/source/web/jsp/spaces/create-space-wizard/details.jsp +++ b/source/web/jsp/spaces/create-space-wizard/details.jsp @@ -84,7 +84,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("wizard:wizard-body:name"), - decodeURI(''), + unescape(''), true); } else diff --git a/source/web/jsp/wcm/add-content-dialog.jsp b/source/web/jsp/wcm/add-content-dialog.jsp index 2316abdf75..6d6d84090e 100644 --- a/source/web/jsp/wcm/add-content-dialog.jsp +++ b/source/web/jsp/wcm/add-content-dialog.jsp @@ -197,7 +197,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:file-name"), - decodeURI(''), true); + unescape(''), true); } else { diff --git a/source/web/jsp/wcm/create-folder-dialog.jsp b/source/web/jsp/wcm/create-folder-dialog.jsp index 56a116eea0..75461fe667 100644 --- a/source/web/jsp/wcm/create-folder-dialog.jsp +++ b/source/web/jsp/wcm/create-folder-dialog.jsp @@ -60,7 +60,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:name"), - decodeURI(''), + unescape(''), true); } else diff --git a/source/web/jsp/wcm/create-web-content-wizard/details.jsp b/source/web/jsp/wcm/create-web-content-wizard/details.jsp index c0d9ecff0d..85850f948b 100644 --- a/source/web/jsp/wcm/create-web-content-wizard/details.jsp +++ b/source/web/jsp/wcm/create-web-content-wizard/details.jsp @@ -62,7 +62,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("wizard:wizard-body:file-name"), - decodeURI(''), + unescape(''), true); } else diff --git a/source/web/jsp/wcm/create-webapp.jsp b/source/web/jsp/wcm/create-webapp.jsp index a7a28963de..c3bab6f5c3 100644 --- a/source/web/jsp/wcm/create-webapp.jsp +++ b/source/web/jsp/wcm/create-webapp.jsp @@ -60,7 +60,7 @@ { finishButtonPressed = false; return validateName(document.getElementById("dialog:dialog-body:name"), - decodeURI(''), + unescape(''), true); } else diff --git a/source/web/jsp/wcm/create-website-wizard/details.jsp b/source/web/jsp/wcm/create-website-wizard/details.jsp index 507b89aaae..30daf8b981 100644 --- a/source/web/jsp/wcm/create-website-wizard/details.jsp +++ b/source/web/jsp/wcm/create-website-wizard/details.jsp @@ -64,13 +64,13 @@ { finishButtonPressed = false; var valid = validateName(document.getElementById("wizard:wizard-body:name"), - decodeURI(''), + unescape(''), true); if (valid == true) { valid = validateRegex(document.getElementById("wizard:wizard-body:dnsname"), "^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$", true, null, - decodeURI(''), true); + unescape(''), true); } return valid; } diff --git a/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp b/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp index 8de9dd7fc1..17106f03e4 100644 --- a/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp +++ b/source/web/jsp/workflow/start-workflow-wizard/workflow-options.jsp @@ -121,6 +121,7 @@ + diff --git a/source/web/jsp/workflow/view-completed-task-dialog.jsp b/source/web/jsp/workflow/view-completed-task-dialog.jsp index 3dd790ef5b..ae93f0a31b 100644 --- a/source/web/jsp/workflow/view-completed-task-dialog.jsp +++ b/source/web/jsp/workflow/view-completed-task-dialog.jsp @@ -97,6 +97,7 @@ + diff --git a/source/web/scripts/ajax/common.js b/source/web/scripts/ajax/common.js index 23ca708289..f1b23af5e2 100644 --- a/source/web/scripts/ajax/common.js +++ b/source/web/scripts/ajax/common.js @@ -3,6 +3,7 @@ // Gavin Cornwell 14-07-2006 // + // Global Alfresco namespace object if (typeof Alfresco == "undefined") { @@ -11,6 +12,22 @@ if (typeof Alfresco == "undefined") var _alfContextPath = null; + +/** + * window.onload function for r:page tag + */ +function onloadFunc(webdavUrl, cifsPath) +{ + if (webdavUrl != "") + { + openDoc(webdavUrl); + } + if (cifsPath != "") + { + window.open(cifsPath, "_blank"); + } +} + /** * Error handler for errors caught in a catch block */ @@ -119,6 +136,89 @@ if (typeof document.ELEMENT_NODE == "undefined") document.NOTATION_NODE = 12; } +/** + * UIDataPager functions + */ +function validateAndSubmit(e, pageInputId, formClientId, hiddenFieldName) +{ + var keycode; + if (window.event) keycode = window.event.keyCode; + else if (e) keycode = e.which; + if (keycode == 13) + { + var inputControl = $(pageInputId); + var dialogForm = $('dialog'); + if (dialogForm) + { + dialogForm.removeProperty('onsubmit'); + } + var val = parseInt(inputControl.value); + if (val == 'NaN' || document.forms[formClientId][hiddenFieldName] == undefined) + { + inputControl.value = 1; + //console.log("validateAndSubmit: reverting to 1"); + return false; + } + else + { + val = (val-1)>=0 ? val-1 : 0; + document.forms[formClientId][hiddenFieldName].value = val; + document.forms[formClientId].submit(); + //console.log("validateAndSubmit: submitting value: " + val); + return false; + } + } + //console.log("validateAndSubmit: passthrough..."); + return true; +} + +function onlyDigitsIE6(e, pageInputId, formClientId, hiddenFieldName) +{ + var keycode; + if (window.event) keycode = window.event.keyCode; + else if (e) keycode = e.which; + var keychar = String.fromCharCode(keycode); + var numcheck = /\d/; + if (keycode == 13) + { + var inputControl = $(pageInputId); + var val = parseInt(inputControl.value); + if (val == 'NaN' || document.forms[formClientId][hiddenFieldName] == undefined) + { + inputControl.value = 1; + return false; + } + else + { + val = (val-1)>=0 ? val-1 : 0; + document.forms[formClientId][hiddenFieldName].value = val; + document.forms[formClientId].submit(); + return false; + } + } + var result = (keycode==13 || keycode==8 || keycode==37 || keycode==39 || keycode==46 || (keycode>=96 && keycode<=105) || numcheck.test(keychar)); + //console.log("onlyDigits: " + result); + return result; +} + +function onlyDigits(e) +{ + var keycode; + if (window.event) keycode = window.event.keyCode; + else if (e) keycode = e.which; + var keychar = String.fromCharCode(keycode); + var numcheck = /\d/; + var dialogForm = $('dialog'); + if (dialogForm && keyCode == 13) + { + dialogForm.setProperty('onsubmit', 'return false;'); + } + var result = (keycode==13 || keycode==8 || keycode==37 || keycode==39 || keycode==46 || (keycode>=96 && keycode<=105) || numcheck.test(keychar)); + //console.log("onlyDigits: " + result); + return result; +} + + /** * Alfresco Utility libraries */ diff --git a/source/web/scripts/onload.js b/source/web/scripts/onload.js deleted file mode 100644 index 2535054261..0000000000 --- a/source/web/scripts/onload.js +++ /dev/null @@ -1,15 +0,0 @@ -// -// window.onload function for r:page tag -// - -function onloadFunc(webdavUrl, cifsPath) -{ - if (webdavUrl != "") - { - openDoc(webdavUrl); - } - if (cifsPath != "") - { - window.open(cifsPath, "_blank"); - } -} \ No newline at end of file