buttons form merge all
This commit is contained in:
parent
33697d60cf
commit
cfdfed43b1
|
@ -31,10 +31,17 @@
|
||||||
</table>
|
</table>
|
||||||
<div class="card-footer bg-secondary py-1">
|
<div class="card-footer bg-secondary py-1">
|
||||||
<button class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#addNewConflictModal" ng-click="prepareAddConflictModal(w)">add</button>
|
<button class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#addNewConflictModal" ng-click="prepareAddConflictModal(w)">add</button>
|
||||||
|
<div class="btn-group">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="btn btn-sm btn-primary"
|
class="btn btn-sm btn-primary pull-right"
|
||||||
data-toggle="modal" data-target="#resolveConflictsModal"
|
data-toggle="modal" data-target="#resolveConflictsModal"
|
||||||
ng-click="prepareConflictsModal(w)">resolve</button>
|
ng-click="prepareConflictsModal(w)">resolve manually</button>
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-sm btn-warning pull-right" ng-click="resolveConflictGroup(w, true)">merge all</button>
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-sm btn-danger pull-right" ng-click="resolveConflictGroup(w, false)">all differents</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -643,6 +643,29 @@ orgsModule.controller('conflictsCtrl', function ($scope, $http, $routeParams, $l
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.resolveConflictGroup = function(group, merge) {
|
||||||
|
if (group.length > 1) {
|
||||||
|
if (merge && !confirm("You are merging " + group.length + " organization(s).\n\nDo you confirm?" )) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!merge && !confirm("You are marking as different " + group.length + " organization(s).\n\nDo you confirm?" )) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ids = [];
|
||||||
|
angular.forEach(group, function(o, pos) { ids.push(o.id); });
|
||||||
|
|
||||||
|
var url = "/api/organizations/conflicts/fix/";
|
||||||
|
if (merge) { url += "similar"; }
|
||||||
|
else { url += "different"; }
|
||||||
|
|
||||||
|
call_http_post($http, url, ids, function(res) { $route.reload(); });
|
||||||
|
} else {
|
||||||
|
alert('Invalid group !!!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$scope.getInfo = function() {
|
$scope.getInfo = function() {
|
||||||
suggestionInfo.updateInfo(function(info) {
|
suggestionInfo.updateInfo(function(info) {
|
||||||
if ($scope.country == '_') {
|
if ($scope.country == '_') {
|
||||||
|
|
Loading…
Reference in New Issue