Project

General

Profile

1
var orgsModule = angular.module('orgs', ['ngRoute', 'checklist-model']);
2

    
3
orgsModule.service('vocabulariesService', function($http) {
4
    this.vocs = {};
5
    this.getVocs = function(f) {
6
   		if (Object.keys(this.vocs).length === 0) {
7
   			$http.get('api/vocabularies').then(function successCallback(res) {
8
   				if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
9
	    		this.vocs = res.data;
10
	    		f(angular.copy(this.vocs));
11
			}, function errorCallback(res) {
12
				alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
13
			});
14
   		} else {
15
   			f(this.vocs);
16
   		}
17
    };
18
});
19

    
20
orgsModule.directive('organizationInfo', function() {
21
	return {
22
		restrict: 'E',
23
		scope: {
24
			'info'    : '=',
25
			'message' : '='
26
		},
27
		templateUrl: 'resources/html/part/org_info.html'
28
     }
29
});
30

    
31
orgsModule.directive('selectOrgModal', function($http) {
32
	return {
33
		restrict: 'E',
34
		scope: {
35
			'modalId'     : '@',
36
			'selectedOrg' : '='
37
		},
38
		templateUrl: 'resources/html/modals/select_org.html',
39
		link: function(scope, element, attrs, ctrl) {
40
			scope.searchOrgs = {};
41
			scope.searchValue = '';
42
			
43
			scope.search = function(text, page, size) {
44
				scope.searchOrgs = {};
45
				$http.get('api/organizations/search/' + page + '/' + size + '?q=' + text).then(function successCallback(res) {
46
					if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
47
					scope.searchValue = text;
48
					scope.searchOrgs = res.data;
49
				}, function errorCallback(res) {
50
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
51
				});
52
			}
53
		}
54
	}
55
});
56

    
57
		
58
orgsModule.directive('orgTabsMenu', function($http) {
59
	return {
60
		restrict: 'E',
61
		scope: {
62
			'orgId'    : '@',
63
			'info'     : '=',
64
			'selected' : '=',
65
			'org'      : '=',
66
			'events'   : '=',
67
		},
68
		templateUrl: 'resources/html/part/org_tabs_menu.html',
69
		link: function(scope, element, attrs, ctrl) {
70

    
71
			scope.loadOrg = function() {
72
				scope.org = {};
73
				$http.get('api/organizations/get?id=' + scope.orgId).then(function successCallback(res) {
74
					if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
75
					scope.org = res.data;
76
				}, function errorCallback(res) {
77
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
78
				});
79
				scope.selected = 1;
80
			}
81
			
82
			scope.loadDedupEvents = function() {
83
				scope.events = {};
84

    
85
				$http.get('api/organizations/conflicts?id=' + scope.orgId).then(function successCallback(res) {
86
					if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
87
					scope.events.conflicts = res.data;
88
					$http.get('api/organizations/duplicates?id=' + scope.orgId).then(function successCallback(res) {
89
						if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
90
						scope.events.duplicates = res.data;
91
					}, function errorCallback(res) {
92
						alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
93
					});
94
				}, function errorCallback(res) {
95
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
96
				});
97
				scope.selected = 2;
98
			};
99
								
100
			scope.loadOrg();
101
		}
102
     }
103
});
104

    
105

    
106
orgsModule.directive('orgFormMetadata', function($http, $location, $route, $routeParams) {
107
	return {
108
		restrict: 'E',
109
		scope: {
110
			'orgId'        : '@',
111
			'org'          : '=',
112
			'vocabularies' : '=',
113
			'mode'         : '@',  // insert or update
114
			'infoMethod'   : '&'
115
		},
116
		templateUrl: 'resources/html/part/org_form_metadata.html',
117
		link: function(scope, element, attrs, ctrl) {
118
			
119
			scope.newRelation = {};
120
			scope.newRelType = '';
121
							
122
			scope.resetSelectedRelation = function() {
123
				scope.newRelation = {};
124
			}
125
		
126
			scope.addNewRelation = function(r) {
127
				scope.org.relations.push({
128
					'relatedOrgId'   : scope.newRelation.id,
129
					'relatedOrgName' : scope.newRelation.name,
130
					'type'           : scope.newRelType
131
				});
132
				scope.newRelation = {};
133
				scope.newRelType = '';
134
			}
135
			
136
			scope.save = function() {
137
				$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
138
				$http.post('api/organizations/save', scope.org).then(function successCallback(res) {
139
					if      ((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
140
					else if (scope.mode == 'insert')        { $location.url('/edit/1/' + res.data[0]);    }
141
					else if ($routeParams.msg == 2)         { $route.reload(); }
142
					else                                    { $location.url('/edit/2/' + res.data[0]); }
143
				}, function errorCallback(res) {
144
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
145
				}); 
146
			}
147
		}
148
     }
149
});
150

    
151
orgsModule.directive('orgFormDedupEvents', function($http, $location, $route) {
152
	return {
153
		restrict: 'E',
154
		scope: {
155
			'orgId'        : '@',
156
			'events'       : '=',
157
			'vocabularies' : '=',
158
			'infoMethod'   : '&'
159
		},
160
		templateUrl: 'resources/html/part/org_form_dedup_events.html',
161
		link: function(scope, element, attrs, ctrl) {
162
			
163
			scope.currentOrgDetails = {};
164
			
165
			$http.get('api/organizations/get?id=' + scope.orgId).then(function successCallback(res) {
166
				if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
167
				scope.currentOrgDetails = res.data;
168
			}, function errorCallback(res) {
169
				alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
170
			});
171
			
172
			scope.saveDuplicates = function() {
173
				$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
174
				$http.post('api/organizations/duplicates', scope.events.duplicates).then(function successCallback(res) {
175
					if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
176
					if (scope.infoMethod)             { scope.infoMethod(); }
177
					alert('Events updated !!!');
178
					scope.events.duplicates = res.data;
179
				}, function errorCallback(res) {
180
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
181
				});
182
			}
183
			
184
			scope.saveConflicts = function() {
185
				alert('todo');
186
			}
187
		}
188
     }
189
});
190

    
191

    
192
orgsModule.directive('orgDetails', function($http, $location, $route) {
193
	return {
194
		restrict: 'E',
195
		scope: {
196
			'org' : '='
197
		},
198
		templateUrl: 'resources/html/part/org_details.html',
199
		link: function(scope, element, attrs, ctrl) {}
200
     }
201
});
202

    
203
orgsModule.directive('orgResults', function($http, $location, $route) {
204
	return {
205
		restrict: 'E',
206
		scope: {
207
			'searchMessage' : '@',
208
			'orgs'          : '=',
209
			'nextFunction'  : '&',
210
			'prevFunction'  : '&',
211
			'selectedOrg'   : '=',
212
			'mode'          : '@'
213
		},
214
		templateUrl: 'resources/html/part/org_results.html',
215
		link: function(scope, element, attrs, ctrl) {
216
			scope.selectOrg = function(o) {
217
				scope.selectedOrg = o;
218
			}
219
		}
220
     }
221
});
222

    
223

    
224
orgsModule.directive('allConflicts', function($http, $location, $route) {
225
	return {
226
		restrict: 'E',
227
		scope: {
228
			'conflicts'    : '=',
229
			'country'      : '@',
230
			'info'         : '=',
231
			'infoMethod'   : '&'
232
		},
233
		templateUrl: 'resources/html/part/all_conflicts.html',
234
		link: function(scope, element, attrs, ctrl) {}
235
     }
236
});
237

    
238
orgsModule.directive('orgDuplicates', function($http, $location, $route) {
239
	return {
240
		restrict: 'E',
241
		scope: {
242
			'duplicates'     : '=',
243
			'showSaveButton' : '@',
244
			'saveFunction'   : '&'
245
		},
246
		templateUrl: 'resources/html/part/org_duplicates.html',
247
		link: function(scope, element, attrs, ctrl) {}
248
     }
249
});
250

    
251
orgsModule.directive('orgConflicts', function($http, $location, $route) {
252
	return {
253
		restrict: 'E',
254
		scope: {
255
			'conflicts'      : '=',
256
			'showSaveButton' : '@',
257
			'saveFunction'   : '&'
258
		},
259
		templateUrl: 'resources/html/part/org_conflicts.html',
260
		link: function(scope, element, attrs, ctrl) {}
261
     }
262
});
263

    
264
orgsModule.directive('allDuplicates', function($http, $location, $route) {
265
	return {
266
		restrict: 'E',
267
		scope: {
268
			'duplicates'   : '=',
269
			'country'      : '@',
270
			'info'         : '=',
271
			'infoMethod'   : '&'
272
		},
273
		templateUrl: 'resources/html/part/all_duplicates.html',
274
		link: function(scope, element, attrs, ctrl) {
275
			scope.currentOrg = {};
276
			scope.currentOrgDetails = {};
277
			scope.currentDuplicates = [];
278
			
279
			scope.prepareDuplicatesModal = function(org) {
280
				scope.currentOrg = org;
281
				scope.currentOrgDetails = {};
282
				scope.currentDuplicates = [];
283
				
284
				$http.get('api/organizations/get?id=' + org.id).then(function successCallback(res) {
285
					if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
286
					scope.currentOrgDetails = res.data;
287
				}, function errorCallback(res) {
288
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
289
				});
290
				
291
				$http.get('api/organizations/duplicates?id=' + org.id).then(function successCallback(res) {
292
					if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
293
					scope.currentDuplicates = res.data;
294
				}, function errorCallback(res) {
295
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
296
				});
297
			};
298
			
299
			scope.saveCurrentDuplicates = function() {
300
				$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
301
				$http.post('api/organizations/duplicates', scope.currentDuplicates).then(function successCallback(res) {
302
					if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
303
					if (scope.infoMethod)             { scope.infoMethod(); }
304
					scope.currentOrg.numberOfDuplicates = 0;
305
					for (var i=0; i<res.data.length; i++) {
306
						if (res.data[i].relType == 'suggested') {
307
							scope.currentOrg.numberOfDuplicates++;
308
						}
309
					}
310
					scope.currentDuplicates = [];
311
				}, function errorCallback(res) {
312
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
313
				});
314
			};
315
		}
316
    }
317
});
318

    
319
orgsModule.config(function($routeProvider) {
320
	$routeProvider
321
		.when('/new',                              { templateUrl: 'resources/html/new.html',              controller: 'newOrgCtrl' })
322
		.when('/search',                           { templateUrl: 'resources/html/search.html',           controller: 'searchCtrl' })
323
		.when('/searchResults/:page/:size/:text*', { templateUrl: 'resources/html/searchResults.html',    controller: 'searchResultsCtrl' })
324
		.when('/countries',                        { templateUrl: 'resources/html/browse.html',           controller: 'countriesCtrl' })
325
		.when('/byCountry/:page/:size/:code*',     { templateUrl: 'resources/html/resultsByCountry.html', controller: 'byCountryCtrl' })
326
		.when('/types',                            { templateUrl: 'resources/html/browse.html',           controller: 'typesCtrl' })
327
		.when('/byType/:page/:size/:type*',        { templateUrl: 'resources/html/resultsByType.html',    controller: 'byTypeCtrl' })
328
		.when('/edit/:msg/:id',                    { templateUrl: 'resources/html/edit.html',             controller: 'showEditCtrl' })
329
		.when('/suggestions/:country/:tab',        { templateUrl: 'resources/html/suggestions.html',      controller: 'showSuggestionsCtrl' })
330
		.when('/users',                            { templateUrl: 'resources/html/users.html',            controller: 'usersCtrl' })
331
		.otherwise({ redirectTo: '/suggestions/_/1' });
332
});
333

    
334
orgsModule.filter('escape', function() {
335
	return function(input) {
336
		return encodeURIComponent(encodeURIComponent(input));
337
	}; 
338
});
339

    
340
orgsModule.filter('unescape', function() {
341
	return function(input) {
342
		return decodeURIComponent(input);
343
	};
344
});
345

    
346
orgsModule.controller('newOrgCtrl', function ($scope, $http, $routeParams, $location, vocabulariesService) {
347
	$scope.org = {
348
		"id": "",
349
		"name": "",
350
		"type": null,
351
		"lat": 0.0,
352
		"lng": 0.0,
353
		"city": "",
354
		"country": "",
355
		"source": "user",
356
		"otherIdentifiers": [],
357
		"otherNames": [],
358
		"relations": [],
359
		"acronyms": [],
360
		"urls": [],
361
		"relations": []
362
	};
363
	
364
	$scope.vocabularies = {};
365
	vocabulariesService.getVocs(function(vocs) { $scope.vocabularies = vocs; });
366
	
367
});
368

    
369
orgsModule.controller('searchCtrl', function ($scope, $location) {
370
	$scope.searchText = '';
371
	$scope.search = function() {
372
		$location.url('/searchResults/0/50/' + encodeURIComponent(encodeURIComponent($scope.searchText)));
373
	}
374
});
375

    
376
orgsModule.controller('searchResultsCtrl', function ($scope, $http, $routeParams, $location) {
377
	$scope.searchText = decodeURIComponent($routeParams.text);
378
	$scope.orgs = {};
379
	
380
	$http.get('api/organizations/search/' + $routeParams.page + '/' + $routeParams.size + '?q=' + $scope.searchText).then(function successCallback(res) {
381
		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
382
		$scope.orgs = res.data;
383
	}, function errorCallback(res) {
384
		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
385
	});
386
	
387
	$scope.prev = function() {
388
		$location.url('/searchResults/' + ($scope.orgs.number - 1) + '/' + $scope.orgs.size + '/' + encodeURIComponent($scope.searchText));
389
	}
390
	
391
	$scope.next = function() {
392
		$location.url('/searchResults/' + ($scope.orgs.number + 1) + '/' + $scope.orgs.size + '/' + encodeURIComponent($scope.searchText));
393
	}
394
});
395

    
396
orgsModule.controller('countriesCtrl', function ($scope, $http, $routeParams) {
397
	$scope.field = 'Country';
398
	$scope.resultsBasePath = '/byCountry'
399
	$scope.entries = [];
400
	
401
	$http.get('api/organizations/browse/countries').then(function successCallback(res) {
402
		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
403
		$scope.entries = res.data;
404
	}, function errorCallback(res) {
405
		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
406
	});
407
	
408
});
409

    
410
orgsModule.controller('byCountryCtrl', function ($scope, $http, $routeParams, $location) {
411
	$scope.fieldValue = decodeURIComponent($routeParams.code);
412
	$scope.orgs = {};
413
	
414
	$http.get('api/organizations/byCountry/' + $routeParams.code + '/' + $routeParams.page + '/' + $routeParams.size).then(function successCallback(res) {
415
		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
416
		$scope.orgs = res.data;
417
	}, function errorCallback(res) {
418
		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
419
	});
420
	
421
	$scope.prev = function() {
422
		$location.url('/byCountry/' + ($scope.orgs.number - 1) + '/' + $scope.orgs.size + '/' + encodeURIComponent($scope.fieldValue));
423
	}
424
	
425
	$scope.next = function() {
426
		$location.url('/byCountry/' + ($scope.orgs.number + 1) + '/' + $scope.orgs.size + '/' + encodeURIComponent($scope.fieldValue));
427
	}
428

    
429
});
430

    
431
orgsModule.controller('typesCtrl', function ($scope, $http, $routeParams) {
432
	$scope.field = 'Organization type';
433
	$scope.resultsBasePath = '/byType'
434
	$scope.entries = [];
435
	
436
	$http.get('api/organizations/browse/types').then(function successCallback(res) {
437
		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
438
		$scope.entries = res.data;
439
	}, function errorCallback(res) {
440
		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
441
	});
442
	
443
});
444

    
445
orgsModule.controller('byTypeCtrl', function ($scope, $http, $routeParams, $location) {
446
	
447
	$scope.fieldValue = $routeParams.type;
448
	
449
	$scope.orgs = {};
450
	
451
	$http.get('api/organizations/byType/' + $routeParams.type + '/' + $routeParams.page + '/' + $routeParams.size).then(function successCallback(res) {
452
		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
453
		$scope.orgs = res.data;
454
	}, function errorCallback(res) {
455
		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
456
	});
457
	
458
	$scope.prev = function() {
459
		$location.url('/byType/' + ($scope.orgs.number - 1) + '/' + $scope.orgs.size + '/' + encodeURIComponent($scope.fieldValue));
460
	}
461
	
462
	$scope.next = function() {
463
		$location.url('/byType/' + ($scope.orgs.number + 1) + '/' + $scope.orgs.size + '/' + encodeURIComponent($scope.fieldValue));
464
	}
465
});
466

    
467

    
468
orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $route, $location, $timeout, vocabulariesService) {
469
	$scope.orgId = $routeParams.id;
470
	$scope.org = {};
471
	$scope.events = {};
472
	$scope.info = {};
473
	
474
	$scope.getInfo = function() {
475
    	$http.get('api/organizations/info?id=' + $scope.orgId).then(function successCallback(res) {
476
    		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
477
    		$scope.info = res.data;
478
		}, function errorCallback(res) {
479
			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
480
		});
481
    };
482
	
483
    $scope.getInfo();
484
	
485
	$scope.vocabularies = {};
486
	vocabulariesService.getVocs(function(vocs) { $scope.vocabularies = vocs; });
487
	
488
	if      ($routeParams.msg == 1) { $scope.message = 'New organization registered !!!'; }
489
	else if ($routeParams.msg == 2) { $scope.message = 'Organization updated !!!';        }
490
	else                            { $scope.message = '';                                }
491
	
492
	$timeout(function() { $scope.message = ''; }, 3000)
493
		
494
});
495

    
496
orgsModule.controller('showSuggestionsCtrl', function ($scope, $http, $routeParams, $location) {
497
	$scope.info = {};
498
	$scope.conflicts = [];
499
	$scope.duplicates = [];
500
	$scope.newGroups = [];
501
	$scope.currentTab = $routeParams.tab;
502
	$scope.country = $routeParams.country;
503
	
504
	$scope.getInfo = function() {
505
    	$http.get('api/organizations/suggestionsInfo').then(function successCallback(res) {
506
    		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
507
    		$scope.info = res.data;
508
    		if ($scope.country == '_') {
509
    			var found = '';
510
    			
511
    			angular.forEach($scope.info.byCountry, function(values, c) {
512
    				if (!found && (($scope.currentTab == 1 && values.nGroups > 0) || ($scope.currentTab == 2 && values.nDuplicates > 0) || ($scope.currentTab == 3 && values.nConflicts > 0))) {
513
    					found = c;
514
    				}
515
    			});
516
    			if (found) { $location.url('/suggestions/' + found + '/' + $scope.currentTab); }
517
    		}
518
 		}, function errorCallback(res) {
519
			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
520
		});
521
	};
522
	
523

    
524
	$scope.refresh = function() {
525
		$scope.conflicts = [];
526
		$scope.duplicates = [];
527
		$scope.newGroups = [];
528
		
529
		if ($scope.country != '_') {
530
			if ($scope.currentTab == 1) {
531
				$scope.groups = []; //TODO
532
			} else if ($scope.currentTab == 2) {
533
				$http.get('api/organizations/duplicates/byCountry/' + $scope.country).then(function successCallback(res) {
534
					if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
535
					$scope.duplicates = res.data;
536
					if ($scope.duplicates.length > 0) {
537
						//$scope.currentCountry = $scope.duplicates.
538
					}
539
				}, function errorCallback(res) {
540
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
541
				});
542
			} else if ($scope.currentTab == 3) {
543
				$http.get('api/organizations/conflicts/byCountry/' + $scope.country).then(function successCallback(res) {
544
					if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
545
					$scope.conflicts = res.data;
546
				}, function errorCallback(res) {
547
					alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
548
				});
549
			} else {  }
550
		}
551
		$scope.getInfo();
552
	}
553
	
554
	$scope.refresh();
555
});
556

    
557

    
558
orgsModule.controller('usersCtrl', function ($scope, $http, $timeout, $route, vocabulariesService) {
559
	$scope.users = [];
560
	$scope.vocs = {};
561
	$scope.currentUser = {};
562
	$scope.superAdminMode = superAdminMode();
563
	
564
	$scope.vocabularies = {};
565
	vocabulariesService.getVocs(function(vocs) { $scope.vocabularies = vocs; });
566
	
567
	$http.get('api/users').then(function successCallback(res) {
568
		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
569
		$scope.users = res.data;
570
	}, function errorCallback(res) {
571
		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
572
	});
573
		
574
	$scope.setCurrentUser = function(user) {
575
		angular.copy(user, $scope.currentUser);
576
		if (!$scope.currentUser.role || $scope.currentUser.role == 'PENDING') {		
577
			$scope.currentUser.role = 'USER';
578
		}
579
	}
580
	
581
	$scope.saveUser = function(user) {
582
		$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
583
		$http.post('api/users', user).then(function successCallback(res) {
584
			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
585
			$scope.users = res.data;
586
		}, function errorCallback(res) {
587
			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
588
		});
589
	}
590
	
591
	$scope.deleteUser = function(email) {
592
		if (confirm("Are you sure ?")) {
593
			$http.delete('api/users?email=' + email).then(function successCallback(res) {
594
				if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
595
				$scope.users = res.data;
596
			}, function errorCallback(res) {
597
				alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
598
			});
599
		}
600
	}
601
});
(10-10/12)