rsanchez
2014-10-28 1d9d7b5f03b3e7b6af5600574a0ae6053843b77b
securis/src/main/resources/static/js/licenses.js
....@@ -105,11 +105,12 @@
105105 var _error = _createErrorCallback(pack, $L.get('Put on hold'), _onerror);
106106 packResource.putonhold({id: pack.id}, _success, _error);
107107 }
108
- this.cancel = function(pack, _onsuccess, _onerror) {
108
+ this.cancel = function(pack, extra_data, _onsuccess, _onerror) {
109109 console.log('Cancellation on pack: ' + pack.id);
110110 var _success = _createSuccessCallback($L.get('Cancellation'), $L.get("Pack '{0}' {1} successfully", pack.code, $L.get("cancelled")), _onsuccess);
111111 var _error = _createErrorCallback(pack, $L.get('Cancellation'), _onerror);
112
- packResource.cancel({id: pack.id}, _success, _error);
112
+ var params = angular.extend({id: pack.id}, extra_data);
113
+ packResource.cancel(params, _success, _error);
113114 }
114115 this.delete = function(pack, _onsuccess, _onerror) {
115116 console.log('Delete on pack: ' + pack.id);
....@@ -334,10 +335,17 @@
334335 */
335336 $scope.execute = function(action, pack) {
336337 var _execute = function(extra_data) {
337
- Packs[action](pack || $scope.pack, extra_data, function() {
338
- if (!$scope.isNew) $scope.showForm = false;
339
- $scope.packs = Packs.getPacksList();
340
- });
338
+ if (extra_data) {
339
+ Packs[action](pack || $scope.pack, extra_data, function() {
340
+ if (!$scope.isNew) $scope.showForm = false;
341
+ $scope.packs = Packs.getPacksList();
342
+ });
343
+ } else {
344
+ Packs[action](pack || $scope.pack, function() {
345
+ if (!$scope.isNew) $scope.showForm = false;
346
+ $scope.packs = Packs.getPacksList();
347
+ });
348
+ }
341349 }
342350 if (action === 'delete') {
343351 BootstrapDialog.confirm($L.get("The pack '{0}' will be deleted, are you sure ?", $scope.pack.code), function(answer) {