v2 up 9ugoisgjicpl
This commit is contained in:
@@ -473,7 +473,6 @@ class AutomaticDispose {
|
||||
this.Collect_Jails();
|
||||
} else {
|
||||
let MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1);
|
||||
console.log('Check_Call_Police_Active', MissionID)
|
||||
this.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => {
|
||||
$("#adis-sprechwunsch-police-frame").attr("src", "");
|
||||
$("#adis-sprechwunsch-police-frame").attr("mission_id", "empty");
|
||||
@@ -1117,21 +1116,20 @@ class AutomaticDispose {
|
||||
} else {
|
||||
self.MissionType = null;
|
||||
}
|
||||
console.log("MissionID", self.MissionID);
|
||||
console.log("MissionType", self.MissionType);
|
||||
console.log("Window", window.name);
|
||||
console.log("self.MyRunner", self.MyRunner);
|
||||
console.log("self.MyRunnerSettings", self.MyRunnerSettings);
|
||||
// console.log("MissionID", self.MissionID);
|
||||
// console.log("MissionType", self.MissionType);
|
||||
// console.log("Window", window.name);
|
||||
// console.log("self.MyRunner", self.MyRunner);
|
||||
// console.log("self.MyRunnerSettings", self.MyRunnerSettings);
|
||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => {
|
||||
self.ADSettings().then((setting) => {
|
||||
if (setting[self.MyRunnerSettings] === 'true') {
|
||||
|
||||
let where = {
|
||||
missionID: self.MissionID,
|
||||
runner: self.MyRunner,
|
||||
done: 'false'
|
||||
}
|
||||
console.log(where);
|
||||
// console.log(where);
|
||||
return self.ADisDB.ADisMissions.where(where).and(function (item) {
|
||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||
}).limit(1)
|
||||
@@ -1163,14 +1161,12 @@ class AutomaticDispose {
|
||||
MainHandler() {
|
||||
const self = this;
|
||||
if (self.includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
|
||||
console.log("DONE!");
|
||||
console.log("DONE: " + self.MissionID);
|
||||
return self.RemoveMissionsFromQueue(self.MissionID).then(() => {
|
||||
return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
|
||||
})
|
||||
}
|
||||
if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').size() > 0*/ ) {
|
||||
console.log("SEND");
|
||||
console.log("SEND: " + self.MissionID);
|
||||
return self.UpdateMissionsToDone(self.MissionID).then(() => {
|
||||
return tellParent(`console.log('handler:2000:update:${window.name}:${self.MissionID}');`); // update Mission here as updated or full
|
||||
@@ -1178,7 +1174,6 @@ class AutomaticDispose {
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
if (['adis-ownmissions', 'adis-plannedeventss', 'adis-krankentransporte'].indexOf(window.name) != -1) {
|
||||
console.log("WILL SEND?")
|
||||
self.CheckMissionAutomatic();
|
||||
} else if (['adis-verbandmission', 'adis-verbandmission-event'].indexOf(window.name) != -1) {
|
||||
self.WorkVerbandMission();
|
||||
@@ -1296,7 +1291,7 @@ class AutomaticDispose {
|
||||
}).then((availableMission) => {
|
||||
if (availableMission != undefined && availableMission.jsondata) {
|
||||
self.MissionConfig = availableMission.jsondata;
|
||||
console.log('MissionConfig: ', MissionType.toString(), JSON.stringify(self.MissionConfig, null, 2))
|
||||
// console.log('MissionConfig: ', MissionType.toString(), JSON.stringify(self.MissionConfig, null, 2))
|
||||
self.StartAlarmProcess();
|
||||
} else {
|
||||
var updateData = {
|
||||
@@ -1314,50 +1309,40 @@ class AutomaticDispose {
|
||||
StartAlarmProcess() {
|
||||
const self = this;
|
||||
setTimeout(function () {
|
||||
console.log('StartAlarmProcess')
|
||||
Promise.resolve().then(async () => {
|
||||
console.log('PrepareVehicleNeedList')
|
||||
return await self.PrepareVehicleNeedList();
|
||||
}).then(async () => {
|
||||
console.log('CollectInvolvedVehicles')
|
||||
return await self.CollectInvolvedVehicles();
|
||||
}).then(async () => {
|
||||
console.log('CollectPatients')
|
||||
return await self.CollectPatients();
|
||||
})
|
||||
.then(async () => {
|
||||
console.log('ProcessEmergencyMedicalService')
|
||||
return await self.ProcessEmergencyMedicalService()
|
||||
})
|
||||
.then(async () => {
|
||||
console.log('ProcessFireDepartment')
|
||||
return await self.ProcessFireDepartment()
|
||||
})
|
||||
.then(async () => {
|
||||
console.log('ProcessPoliceDepartment')
|
||||
return await self.ProcessPoliceDepartment()
|
||||
})
|
||||
.then(async () => {
|
||||
console.log('ProcessTechnicalEmergencyService')
|
||||
return await self.ProcessTechnicalEmergencyService()
|
||||
})
|
||||
.then(async () => {
|
||||
console.log('ProcessWaterRescue')
|
||||
return await self.ProcessWaterRescue()
|
||||
}).then(() => {
|
||||
|
||||
console.log('OweSecure?')
|
||||
if (self.OweSecure) {
|
||||
if ($('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]:not(:checked)').length > 0) {
|
||||
$('#vehicle_show_table_all tr[vehicle_type="FuStW"] input[type="checkbox"]:not(:checked)')[0].click();
|
||||
}
|
||||
}
|
||||
console.log('MissionConfig.share?')
|
||||
|
||||
// TODO check cars driving or already there
|
||||
if (self.MissionConfig.share){
|
||||
console.log('self.MissionConfig.share',self.MissionConfig.share)
|
||||
// console.log('self.MissionConfig.share',self.MissionConfig.share)
|
||||
const elems = $('#vehicle_show_table_all tr input[type="checkbox"]:checked')
|
||||
console.log('elems', elems)
|
||||
// console.log('elems', elems)
|
||||
for (let i = 0; i < elems.length; i++) {
|
||||
if (i === 0) {
|
||||
continue;
|
||||
@@ -1366,10 +1351,8 @@ class AutomaticDispose {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('MissionConfig.share - after')
|
||||
|
||||
console.log("Clicked Vehicles: ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked'));
|
||||
console.log("WILL KLICK SEND")
|
||||
// console.log("Clicked Vehicles: ", $('#vehicle_show_table_all input[type="checkbox"]:checked').length, $('#vehicle_show_table_all input[type="checkbox"]:checked'));
|
||||
// console.log("WILL KLICK SEND")
|
||||
setTimeout(() => {
|
||||
self.UpdateMissionsToDone(self.MissionID).then(() => {
|
||||
tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},500);`);
|
||||
|
||||
Reference in New Issue
Block a user