10-17-2013 10:04 AM
YAHOO.Bubbling.fire("registerAction", {
actionName: "sgiOnActionCancelEditing",
fn: function sgi_onActionCancelEditing(record)
{
var displayName = record.displayName;
var rv = confirm("WARNING! You are about to delete this working copy and any edits you may have made!");
if (rv === true) {
Alfresco.doclib.Actions.prototype.onActionCancelEditing(record);
}
}
});
<!– Cancel editing (cancel checkout) –>
<action id="document-cancel-editing"
type="javascript"
label="actions.document.cancel-editing">
<param name="function">sgiOnActionCancelEditing</param>
<permissions>
<permission allow="true">CancelCheckOut</permission>
</permissions>
<evaluator>evaluator.doclib.action.isWorkingCopy</evaluator>
<evaluator>evaluator.doclib.action.editableByCurrentUser</evaluator>
</action>
<config evaluator="string-compare" condition="DocLibCustom" replace="true">
<dependencies>
<!– js src="components/sgi-object-finder/sgi-cancelEdit-min.js" / –>
<js src="components/sgi-object-finder/sgi-cancelEdit.js" />
</dependencies>
</config>
10-20-2013 08:53 PM
YAHOO.Bubbling.fire("registerAction", {
actionName: "sgiOnActionCancelEditing",
fn: function sgi_onActionCancelEditing(asset)
{
var rv = confirm("WARNING! You are about to delete this working copy and any edits you may have made!");
if (rv === true) {
var displayName = asset.displayName,
nodeRef = new Alfresco.util.NodeRef(asset.nodeRef);
this.modules.actions.genericAction(
{
success:
{
callback:
{
fn: function DocumentActions_oACE_success(data)
{
var oldNodeRef = this.recordData.jsNode.nodeRef.nodeRef,
newNodeRef = data.json.results[0].nodeRef;
this.recordData.jsNode.setNodeRef(newNodeRef);
window.location = this.getActionUrls(this.recordData).documentDetailsUrl + "#editCancelled";
if (oldNodeRef == newNodeRef)
{
window.location.reload();
}
},
scope: this
}
},
failure:
{
message: this.msg("message.edit-cancel.failure", displayName)
},
webscript:
{
method: Alfresco.util.Ajax.POST,
name: "cancel-checkout/node/{nodeRef}",
params:
{
nodeRef: nodeRef.uri
}
}
});
}
}
});
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.