diff options
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/rdxport.rh.js | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/www/js/rdxport.rh.js b/www/js/rdxport.rh.js index 3c949ac..fc3bc83 100644 --- a/www/js/rdxport.rh.js +++ b/www/js/rdxport.rh.js @@ -62,7 +62,40 @@ Rivendell.Rdxport.prototype.addAndEditCut = function(cartNumber, options, succes return $.post(this.endpoint, options, success, "xml"); }; -// todo: addAndEditCart +Rivendell.Rdxport.prototype.copyCut = function(sourceCartNumber, sourceCutNumber, + destinationCartNumber, + success) { + var self = this; + var returnJqXHR = null; + this.addCut(destinationCartNumber, function(data, textStatus, jqXHR) { + var command = { + COMMAND: 24, + LOGIN_NAME: self.username, + PASSWORD: self.token, + SOURCE_CART_NUMBER: sourceCartNumber, + SOURCE_CUT_NUMBER: sourceCutNumber, + DESTINATION_CART_NUMBER: destinationCartNumber, + DESTINATION_CUT_NUMBER: $('cutAdd cut cutNumber', data).text() + }; + returnJqXHR = $.post(self.endpoint, command, success, 'xml') + .fail(function() { + self.removeCut(destinationCartNumber, command.DESTINATION_CUT_NUMBER, null); + }); + }); + return returnJqXHR; +}; + +Rivendell.Rdxport.prototype.addAndEditCart = function(groupName, type, cartNumber, options, success) { + options.COMMAND = 12; + options.LOGIN_NAME = this.username; + options.PASSWORD = this.token; + options.GROUP_NAME = groupName; + options.TYPE = type; + if (cartNumber !== null) { + options.CART_NUMBER = cartNumber; + } + return $.post(this.endpoint, options, success, 'xml'); +}; Rivendell.Rdxport.prototype.getMusicgrid = function(success) { var command = { |