Last active
August 29, 2015 14:07
-
-
Save softwareloop/7b99a3ae7bff1c2909aa to your computer and use it in GitHub Desktop.
alfresco-inboxes-how-to-customise-action-buttons
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
approveAction: function () { | |
this.updateStatus("Active"); | |
}, | |
rejectAction: function () { | |
this.updateStatus("Retired"); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button class="inboxes-item-button inboxes-item-button-approve" | |
data-dojo-attach-event="click:approveAction">${approveLabel} | |
</button> | |
<button class="inboxes-item-button inboxes-item-button-reject" | |
data-dojo-attach-event="click:rejectAction">${rejectLabel} | |
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
updateStatus: function (status) { | |
var url = lang.replace( | |
"{proxyUri}cmis/s/workspace:SpacesStore/i/{entryId}", | |
{ | |
proxyUri: Alfresco.constants.PROXY_URI, | |
entryId: this.entry.id | |
} | |
); | |
var dossierStatus = this.entry.attributes["owd:dossierStatus"]; | |
dossierStatus.values[0] = status; | |
var updateAttributes = {}; | |
updateAttributes["owd:dossierStatus"] = dossierStatus; | |
cmis.updateEntry(url, updateAttributes, function() { | |
location.reload(false); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment