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 0000000000..910e9d2ab0 Binary files /dev/null and b/source/web/images/icons/cancel_checkout.gif differ diff --git a/source/web/images/icons/cancel_checkout_large.gif b/source/web/images/icons/cancel_checkout_large.gif index bec0134e1b..c4a0c8e8d9 100644 Binary files a/source/web/images/icons/cancel_checkout_large.gif and b/source/web/images/icons/cancel_checkout_large.gif differ diff --git a/source/web/images/icons/done_editing_large.gif b/source/web/images/icons/done_editing_large.gif index 40824ba034..68fe58e15b 100644 Binary files a/source/web/images/icons/done_editing_large.gif and b/source/web/images/icons/done_editing_large.gif differ 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