summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-02-22 18:58:29 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-02-22 18:58:29 (GMT)
commit502912ed02337c8b3420b9c3acf328e822c2c4f3 (patch)
treed8d12ff4a8e620efb1844ca98af3f8b2a8e81570 /www
parent13fc3657a2668d83f70636ac4d1156d38a1b1007 (diff)
add copyCut and addAndEditCart function to rdxport.rh.js
Diffstat (limited to 'www')
-rw-r--r--www/js/rdxport.rh.js35
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 = {