|
@@ -1,15 +1,6 @@
|
|
|
// Specific code for the 'federation-structures' page
|
|
// Specific code for the 'federation-structures' page
|
|
|
|
|
|
|
|
-const default_uri = "https://api.opentalent.fr";
|
|
|
|
|
-const variants_uris = {
|
|
|
|
|
- "preprod.opentalent.fr": "https://api.preprod.opentalent.fr",
|
|
|
|
|
- "local.sub.opentalent.fr": "https://local.api.opentalent.fr",
|
|
|
|
|
- "typo3": "http://docker.nginx.opentalent.fr"
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-const base_uri = variants_uris[$(location).attr('hostname')] ?? default_uri;
|
|
|
|
|
-let apiGetUrl = base_uri + '/api/public/federation_structures?_format=json&page=1&itemsPerPage=99999';
|
|
|
|
|
-
|
|
|
|
|
|
|
+const apiGetUrl = "http://local.sub.opentalent.fr/typo3conf/ext/ot_core/Resources/Public/getStructures.php";
|
|
|
|
|
|
|
|
// Converts numeric degrees to radians
|
|
// Converts numeric degrees to radians
|
|
|
function toRad(Value)
|
|
function toRad(Value)
|
|
@@ -368,23 +359,30 @@ $(document).ready(function() {
|
|
|
|
|
|
|
|
// #### Load structures data and refresh
|
|
// #### Load structures data and refresh
|
|
|
var structures = [];
|
|
var structures = [];
|
|
|
- $.ajax({
|
|
|
|
|
- type: 'GET',
|
|
|
|
|
- url: apiGetUrl,
|
|
|
|
|
- dataType: "json",
|
|
|
|
|
- contentType: "application/json; charset=utf-8",
|
|
|
|
|
- timeout : 5000
|
|
|
|
|
- })
|
|
|
|
|
- .done(function(res) {
|
|
|
|
|
- structures = res["hydra:member"];
|
|
|
|
|
- populateFederationsSelect();
|
|
|
|
|
- refresh();
|
|
|
|
|
- })
|
|
|
|
|
- .fail(function(xhr, textStatus, errorThrown) {
|
|
|
|
|
- pleaseWaitSpan.hide();
|
|
|
|
|
- errorMsgSpan.show();
|
|
|
|
|
- throw 'Error while fetching the API data: ' + textStatus + ' - ' + errorThrown;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
|
|
+ function loadStructures() {
|
|
|
|
|
+ structures = []
|
|
|
|
|
+
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ type: 'GET',
|
|
|
|
|
+ url: apiGetUrl,
|
|
|
|
|
+ dataType: "json",
|
|
|
|
|
+ contentType: "application/json; charset=utf-8",
|
|
|
|
|
+ headers : {'Accept-Encoding': 'deflate '},
|
|
|
|
|
+ timeout : 5000,
|
|
|
|
|
+ })
|
|
|
|
|
+ .done(function(res) {
|
|
|
|
|
+ structures = res["hydra:member"];
|
|
|
|
|
+ populateFederationsSelect();
|
|
|
|
|
+ refresh();
|
|
|
|
|
+ })
|
|
|
|
|
+ .fail(function(xhr, textStatus, errorThrown) {
|
|
|
|
|
+ pleaseWaitSpan.hide();
|
|
|
|
|
+ errorMsgSpan.show();
|
|
|
|
|
+ throw 'Error while fetching the API data: ' + textStatus + ' - ' + errorThrown;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ loadStructures();
|
|
|
|
|
|
|
|
|
|
|
|
|
// #### Events
|
|
// #### Events
|