Hi, I've created a custom document action to wrap the onActionCancelEditingdocument action with a warning message, like this:
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);
}
}
});
Also did the share-config-custom.xml change:
<!– 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>
and:
<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>
I now have the popup warning and can step through the javascript in Firebug, butmy call to Alfresco.doclib.Actions.prototype.onActionCancelEditing(); does not cancelthe edit. How do I call this method? Thanks for any help,-jon