Commit 7df4323c authored by Nezael's avatar Nezael
Browse files

We can now deleter paperboard

parent 56a38608
......@@ -115,21 +115,35 @@ root.controller('OverviewWorkshopCtrl', ['$scope', '$stateParams', '$http', '$wo
workshopsCtrl.deleteWorkshop = function (workshop) {
var txt;
var r = confirm($languageFactory._labels.confirmDeleteWorkshop + workshop.title + "?");
if (r != true) {
return false;
}
$scope._showAlert({status: 2, message: $languageFactory._labels.alerts_deleteWorkshop});
$workshopFactory.deleteWorkshop($scope._getProject(), workshop.id, function (data) {
if (data.status == "success") {
$scope._showAlert({status: 1, message: $languageFactory._labels.alerts_deleteWorkshopSuccess});
workshopsCtrl.refreshWorkshops(workshopsCtrl.workshopType);
} else {
$scope._showAlert({status: 3, message: $languageFactory._labels.alerts_deleteWorkshopFailure});
}
})
if(workshop.type == 1)
{
$scope._showAlert({status: 2, message: $languageFactory._labels.alerts_deleteWorkshop});
$paperboardFactory.deletePaperBoard($scope._getProject(), workshop.id, function (data) {
if (data.status == "success") {
$scope._showAlert({status: 1, message: $languageFactory._labels.alerts_deleteWorkshopSuccess});
workshopsCtrl.refreshWorkshops(workshopsCtrl.workshopType);
} else {
$scope._showAlert({status: 3, message: $languageFactory._labels.alerts_deleteWorkshopFailure});
}
});
}
else
{
$scope._showAlert({status: 2, message: $languageFactory._labels.alerts_deleteWorkshop});
$workshopFactory.deleteWorkshop($scope._getProject(), workshop.id, function (data) {
if (data.status == "success") {
$scope._showAlert({status: 1, message: $languageFactory._labels.alerts_deleteWorkshopSuccess});
workshopsCtrl.refreshWorkshops(workshopsCtrl.workshopType);
} else {
$scope._showAlert({status: 3, message: $languageFactory._labels.alerts_deleteWorkshopFailure});
}
});
}
}
......
......@@ -32,6 +32,13 @@ function $paperboardFactory($rootScope, $serverFactory) {
}, success, failure);
};
returns.deletePaperBoard = function (projectId, id, success, failure){
return $serverFactory.runCommand("delete_paperboard", {
projectId: projectId,
id: id,
}, success, failure);
};
/**
* [getPaperboard description]
* @param {[int]} projectId [description]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment