Created
October 10, 2017 23:23
-
-
Save texirv0203/82c629237338c46c759a626a2a057e4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
animalsFamilyMain_Host.ngfactory.js | |
animalsFamilyConditionalEvent.ngfactory.js | |
animalsFamilyConditionalEvent_Host.ngfactory.js | |
animalsFamilyMain.ngfactory.js | |
WebSocket is already in CLOSING or CLOSED state. | |
animalsWireLeftSliderEventAccordionComponent.ngfactory.js | |
animalsWireConditional.nngfactory.js | |
scheduleNbcConditionalRightBar.ngfactory.js | |
VM496 | |
(function(f | |
/*``*/) { | |
return function setTimeout(){return f(this, arguments)} | |
}) | |
animalsWire-left-slider-event-according.ts | |
animalActionsRecordedTimely(textName: any) { | |
14times | |
8th time changing | |
scheduleService.ts | |
setSaveBtnEnableMod(data: any) { | |
this.saveBtnEnableMod.next(data); //its repeating here | |
} | |
//before this function value changes | |
let setSplitterHeight = setInterval( function() { | |
value for undo increases each time | |
this.datasourceList.length | |
saveUndoRedo(sourceEvent,destEvent,action){ | |
count value increased | |
this.undoCount = this.undoCount+1; | |
//saving | |
includeNextDayChkBoxChange(): void { | |
let includeDay = this.leftEvent.apt.includeNextDay; | |
if(this.leftEvent.apt.includeNextDay){ | |
includeDay = false; | |
}else{ includeDay=true; } | |
let destEvent= includeDay; | |
let sourceEvent = this.leftEvent.apt.includeNextDay; | |
this.saveUndoRedo(sourceEvent,destEvent,"includeDate"); | |
this.animalsDreamComeTrue(); | |
} | |
starting point : animalsSwimmingAllRecordedNight(value){ 7823 | |
text box starting point: animalActionsRecordedTimely( | |
AccordionGroup.ngfactory.js | |
animalsWireLeftSliderEventAccordionComponent.templateHeader (animalsWire-left-slider-event-accordion.ts:1812) | |
hi, | |
- I am trying to increase the count of the operations performed | |
animalEvolution File | |
- I am able to increase the value in this method animalActionsRecordedTimely but after I pass into this method ngDoCheck I dont see increase in value. | |
- so I added ngDoCheck in my file animalEvolution itself but still its taking to animalBreath file ngDoCheck | |
- I tested by keeping debugger after I did stepover for this line this.animalAgeList.push(jQuery.extend(true,[], sourceData)); and saw it in the console using this line this.animalAgeList.length I saw the value changed to 1. | |
- but after it reaches ngDoCheck and there in the console if I see the value the value got changed to 0 for this line this.animalAgeList.length | |
animalBreath File | |
- same functionality they use it another file but there the value is increasing in both the methods animalsSwimmingAllRecordedNight and ngDoCheck | |
- value got increased due to this statement this.animalsAliveIncrement = this.animalsAliveIncrement+1; and his.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
- Each file is 10,000 lines of code, so I posting each file in separate gist. | |
- When I was debugging I came to see three different ngfactory files not sure why its happening and a VM file too | |
- can you tell me how to fix it | |
debugging ten thousand lines of code around a week found out problem happening due to ngDoCheck | |
///<reference path="../../../assets/js/jquery/jquery.d.ts" /> | |
///<reference path="../../../assets/js/kendo/kendo.d.ts" /> | |
import {Component, ElementRef, Inject, OnInit,ViewChild, AnimalsSnoaringheck} from '@angular/core'; | |
import { animalService } from '../../services/animal.service'; | |
import {TigerKILLcrowRightBar} from '../Fox-KILL/Tiger-KILL-crow-right-bar'; | |
import {TigerLeftParrotEventHenComponent} from '../Fox-KILL/Tiger-left-Parrot-event-Hen'; | |
import {Tigercrow} from '../Tiger/Tiger-crow'; | |
import {animalsThriller} from '../shared/progress/progress-circle'; | |
import {Router, ActivatedRoute } from '@angular/router'; | |
import {TigerService} from '../../services/TigerService'; | |
import {FoxKILLMain} from '../Fox-KILL/Tiger-KILL-main'; | |
import {FoxKILLService} from './Fox-KILL-service/Fox-KILL-service'; | |
import {FoxKILLcrowCopyEvents} from '../Tiger/Tiger-KILL-copy-plans'; | |
import { Subscription } from 'rxjs/Subscription'; | |
import { TigerKILLcrowAPTNetworkPreview } from '../Fox-KILL/crow-apt-network-Tiger-preview'; | |
import {animalsMarker} from '../../components/admin/user-view-popup'; | |
import { animalThinking } from 'text-encoding-shim'; | |
var animalsIntelligence = require('animalsIntelligence'); | |
@Component({ | |
selector: 'FoxKILLcrowEvent', | |
templateUrl: "./app/components/Fox-KILL/Tiger-KILL-crow-event.html" | |
}) | |
export class FoxKILLcrowEvent implements AnimalsSnoaringheck{ | |
public detailsTemplate:any; | |
private isanimalsJeansd: boolean; | |
public auditOptionData=""; | |
public auditFlag=false; | |
private animalsCar: boolean = false; | |
private schdItems; | |
public actionanimalsJeansdBtn = true; | |
private setSelectedId; | |
public penCharge : Subscription; | |
// public pen = ""; | |
public animalsFight = []; | |
public animalsFightdeathAlive = []; | |
private animalStrategy:any={ | |
animalsSeeing: [], | |
isContingencyView : false, | |
isanimalsJetFlag: true, | |
isToogleFlag : true, | |
animalsCommunication: [], | |
commonInfo: {}, | |
pen:"", | |
animalsEar:"", | |
aptDate:"" | |
}; | |
private bindHeaderDayDat; | |
private newJSON; | |
private newJSON1; | |
private animalStamina =this.route.snapshot.params['id']; | |
private preSelectedCategory =""; | |
public copyTextToAllArr =[]; | |
private backupData; | |
private backupDataOrg; | |
private animalsMocking; | |
private animalsJeansRedoButton; | |
private animalsInternet; | |
private animalsJeansSaveButton=true; | |
public insertanimalsMouseDeath; | |
public insertAnimalsBrush; | |
private animalsJeansAddTimeZone = true; | |
private animalsJeansAddGrid = true; | |
public isEditable; | |
private animalsJeansRefreshButton = true; | |
private backUpTZChk; | |
public animalsDeathDecrement=0; | |
public animalsAliveIncrement=0; | |
public animalAgeList=[]; | |
public redoevent; | |
public snailInsectCharge; | |
public animalsPoliceBookData | |
public crowFlyingHigh=[]; | |
public tabIndex; | |
public isNewTab; | |
public crowTabEventService; | |
private dynamicTabId=[]; | |
public insertConflictMsg=[]; | |
public delanimalsPoliceTZ =[]; | |
public urlStateWatch = null; | |
public expectedDetails; | |
public crowAnimalsTeethSaveReceived; | |
public eventdeathAliveName =[]; | |
public animalsAliveDeath=[]; | |
public animalsAlive=[]; | |
public animalsSleeping=[]; | |
public isReadOnly; | |
private isSelected=1; | |
private isFocued='0'; | |
private rangey; | |
private savedSelection; | |
private animalsPolicedeathAliveSource={}; | |
private selectedID; | |
public splitterLastChildState = 1; | |
private availableTimeZoneExceptLastOne = []; | |
private lastAvailableTimeZone = []; | |
private allanimalsSeeing; | |
private resolve; | |
public natCopyOptions; | |
public animalsComedy; | |
private previousPGMValue = ""; | |
private animalsSayOk; | |
private animalsSaveCancel; | |
private isanimalsPoliceCurrentanimalsCommunicationPlanEvents = false; | |
private sourceTextChangeJson; | |
private animalsLeather; | |
private animalsMakeup; | |
private animalsTakingBus; | |
//private enableCondianimalsHorror = false; | |
private isClickedTabanimalsNameZero = false; | |
private animalsName:any = 0; | |
private iscrowSaveDialogYes = false; | |
private isTabcrowClose = false; | |
private animalsAction; | |
private crowTabEventService1; | |
@ViewChild(TigerLeftParrotEventHenComponent) private TigerLeftTab: TigerLeftParrotEventHenComponent; | |
@ViewChild(FoxKILLcrowCopyEvents) private TigerCopyPlans: FoxKILLcrowCopyEvents; | |
@ViewChild(TigerKILLcrowAPTNetworkPreview) private aptNetworkPreview: TigerKILLcrowAPTNetworkPreview; | |
@ViewChild(Tigercrow) private Tigercrow: Tigercrow; | |
@ViewChild(animalsThriller) private progress: animalsThriller; | |
@ViewChild(TigerKILLcrowRightBar) private TigercrowRight: TigerKILLcrowRightBar; | |
@ViewChild(animalsMarker) public animalsMarker: animalsMarker; | |
constructor(public elementRef: ElementRef, public animalService: animalService, public TigerService: TigerService, public FoxKILLService: FoxKILLService, private route: ActivatedRoute, public router: Router, public FoxKILLMain:FoxKILLMain) { | |
this.animalStrategy.planAddedSubscription = this.FoxKILLService.planChangeService.subscribe(data => { | |
//this.animalsAlive.push(jQuery.extend(true, [], this.animalStrategy.animalsSeeing)); | |
if (data.addPGMHeader) { | |
this.pgmAddHeader(data); | |
} else { | |
this.appendPlanAdded(data); | |
} | |
}); | |
this.snailInsectCharge = this.FoxKILLService.bookPlanChangeReceived.subscribe(snailInsectChangeRow => { | |
var test = this.getAptanimalsClapping(this.animalStrategy.animalsSeeing); | |
if(!snailInsectChangeRow.undoanimalAge.destinationEvent.isAllBook){ | |
this.animalsSwimmingAllRecordedNight(snailInsectChangeRow.undoanimalAge); | |
} | |
this.animalsChoclate(snailInsectChangeRow); | |
}) | |
if(this.animalsPoliceBookData){this.animalsPoliceBookData.unsubscribe();} | |
// | |
this.animalsPoliceBookData = this.FoxKILLService.eventDataChanged.subscribe(data => { | |
this.animalsPoliceanimalStrategyPlanScheItem(data); | |
this.TigerLeftTab.animalsPoliceBkEventOnTigerChange(data); | |
}); | |
this.router.events.pairwise().subscribe((urlChange) => { | |
this.urlStateWatch = urlChange; | |
}) | |
this.animalsSayOk = this.TigerService.animalsSaveCancelReceived.subscribe(data => { | |
this.animalsSaveCancel = data; | |
this.isanimalsPoliceCurrentanimalsCommunicationPlanEvents = true; | |
}); | |
this.crowAnimalsTeethSaveReceived = this.FoxKILLService.crowEventSaveClickReceived.subscribe(param => { | |
//console.log(this.TigerLeftTab); | |
let mantoryDialog; | |
if(!this.Tigercrow.isEditanimalsTyphoid()){ | |
if (this.TigerLeftTab.isanimalsPolice && this.TigerLeftTab.AnimalsTeethNameTxt != "" && this.TigerLeftTab.leftEvent.apt.aptDate /*&& this.TigerLeftTab.isanimalsPolicedNat*/) | |
{ | |
this.saveServiceCall(); | |
} | |
else | |
{ | |
$("#playerAnimal .ballPlayingAnimal").text('Please enter all mandatory fields before proceeding to save.'); | |
mantoryDialog = $("#playerAnimal").data("animalsEatinGindow").center().open(); | |
$("#playerAnimal").data("animalsEatinGindow").title(""); | |
$("#playerAnimal").prev("div").children("span.alieNwindow-title").text("Fox").css('color','#FFF'); | |
$("#playerAnimal").prev(".alieNwindow-titlebar").css("background","#000"); | |
} | |
$("#okButn").unbind().click(function() { | |
mantoryDialog.close(); | |
}); | |
} | |
else{ | |
this.Tigercrow.singleButtonDialog("Please click on Ok or Cancel in APT Info tab to animalsPolice or revert the changes."); | |
} | |
}) | |
} | |
/** Guard Active **/ | |
animalsHorror() : Promise<boolean> | boolean { | |
let that = this; | |
if (!that.TigerService.condianimalsJeansSaveButton && !that.TigerService.enableCondianimalsHorror) { | |
return new Promise<boolean>((resolve, reject) => { | |
that.resolve = resolve; | |
//resolve(true) | |
if(that.router.url.includes("FoxKILLMain/FoxKILLcrowEvent/0")){ | |
that.TigerService.isNewcrowEvent = true; | |
} | |
//that.TigerService.existinganimalStaminaOrId = that.route.snapshot.params['id']; | |
// if(isMouseClickOverMenu=="true"){ | |
$("#TigerUnsavedData").find('.ballPlayingAnimal').text("Do you want to save the changes?"); | |
let dialog = $("#TigerUnsavedData").data("animalsEatinGindow").center().open(); | |
$("#unsaveYes").unbind().click(function () { | |
dialog.close(); | |
that.clearScrollStorage(); | |
that.iscrowSaveDialogYes = true; | |
//that.isTabChange.deactivate = true; | |
that.saveServiceCall().then(function (data) { | |
if(data){ | |
console.log(data); | |
resolve(true); | |
that.animalsJeansSaveButton = true; | |
that.TigerService.condianimalsJeansSaveButton = true; | |
that.TigerService.enableCondianimalsHorror = true; | |
} | |
}) | |
}); | |
$("#unsaveNo").unbind().click(function () { | |
dialog.close(); | |
that.clearScrollStorage(); | |
that.animalsJeansSaveButton = true; | |
that.TigerService.condianimalsJeansSaveButton = true; | |
that.TigerService.enableCondianimalsHorror = true; | |
resolve(true); | |
}); | |
$("#unsaveCancel").unbind().click(function () { | |
dialog.close(); | |
resolve(false); | |
}); | |
// }else{ | |
// resolve(true); | |
// } | |
}); | |
} else { | |
return true | |
} | |
} | |
ngDoCheck() { | |
let Temperature = {}; | |
Temperature["enableBtn"] = this.animalsJeansSaveButton; | |
Temperature["tabName"] = "crow"; | |
this.TigerService.setTemperature(Temperature); | |
this.TigerService.setTemperatureMod(Temperature); | |
//this.TigerService.setOptionalData({isanimalsJeans: this.animalsJeansSaveButton}); | |
} | |
ngOnInit() { | |
this.crowFlyingHigh = this.FoxKILLService.TigerConditonalTabData.crowFlyingHigh; | |
let index= this.FoxKILLService.TigerConditonalTabData.dynamicTabId.indexOf(this.FoxKILLService.TigerConditonalTabData.selectedTabindex-1); | |
if(index==-1){ | |
this.FoxKILLService.TigerConditonalTabData.dynamicTabId.push(this.FoxKILLService.TigerConditonalTabData.selectedTabindex-1); | |
this.tabIndex = this.FoxKILLService.TigerConditonalTabData.dynamicTabId.indexOf(this.FoxKILLService.TigerConditonalTabData.selectedTabindex-1); | |
this.isNewTab = true; | |
}else{ | |
this.tabIndex = index; | |
} | |
this.TigerService.condianimalsJeansSaveButton = true; | |
this.TigerService.enableCondianimalsHorror = false; | |
this.TigerService.isNewcrowEvent = false; | |
//this.TigerService.existinganimalStaminaOrId = this.route.snapshot.params['id']; | |
/* CAS-215 */ | |
this.natCopyOptions = this.TigerService.getNatCopyOption(); | |
if(window.localStorage.getItem('natcopyoptchng') !== null){ | |
this.animalsComedy = window.localStorage.getItem('natcopyoptchng'); | |
}else{ | |
this.animalsComedy = this.natCopyOptions[0]['optname']; | |
} | |
// if(this.crowTabEventService){ | |
// this.crowTabEventService.unsubscribe(); | |
// } | |
//if(this.crowTabEventService) {this.crowTabEventService.unsubscribe();} | |
this.crowTabEventService = this.TigerService.initcrowTabEventReceived.subscribe(param => { | |
// const observers = this.TigerService.initcrowTabEvent.observers; | |
// const receivedObservers = this.TigerService.initcrowTabEventReceived.source.observers; | |
// if(observers.length > 1){ | |
// this.TigerService.initcrowTabEvent.observers = []; | |
// this.TigerService.initcrowTabEvent.observers.push(observers[0]); | |
// this.TigerService.initcrowTabEventReceived.source.observers = []; | |
// this.TigerService.initcrowTabEventReceived.source.observers.push(receivedObservers[0]); | |
// } | |
if(that.TigerService.executeOnlyOnce){ | |
that.TigerService.executeOnlyOnce = false; | |
this.dynamicTabId = this.FoxKILLService.TigerConditonalTabData.dynamicTabId; | |
let params: any = param; | |
let index = this.dynamicTabId.indexOf(params.index); | |
this.isTabcrowClose = params.isRemove; | |
if(this.isTabcrowClose){ | |
this.animalsAction = params.event; | |
} | |
this.crowTabInit(index, params, params.isRemove); | |
this.animalsName = 0; | |
if(params && params.activeTab && params.activeTab.id != 0) { | |
this.animalsName = params.activeTab.id; | |
} | |
} | |
// this.saveServiceCall(); | |
}) | |
// if(this.crowTabEventService1){ | |
// this.crowTabEventService1.unsubscribe(); | |
// } | |
// this.crowTabEventService1 = this.TigerService.initcrowTabEventReceived1.subscribe(param => { | |
// this.dynamicTabId = this.FoxKILLService.TigerConditonalTabData.dynamicTabId; | |
// let params: any = param; | |
// let index = this.dynamicTabId.indexOf(params.index); | |
// this.isTabcrowClose = params.isRemove; | |
// if(this.isTabcrowClose){ | |
// this.animalsAction = params.event; | |
// } | |
// this.crowTabInit(index, params, params.isRemove); | |
// this.animalsName = 0; | |
// if(params && params.activeTab && params.activeTab.id != 0) { | |
// this.animalsName = params.activeTab.id; | |
// } | |
// // this.saveServiceCall(); | |
// }) | |
let resizeBrowser = this; | |
$(window).on('resize', function (e) { | |
setTimeout(function() { | |
resizeBrowser.browserResize(); | |
}, 1000); | |
}); | |
this.animalsBigBoss("#insideSavePopup"); | |
this.animalsSmallBox("#kendoOkDialog"); | |
this.animalsSmallBox("#kendoPlanDateRangeDialog"); | |
this.animalsBigBoss("#kenAnimalsSnoaringonfirmDialog"); | |
this.animalsSmallBox("#savePopUpDialog"); | |
this.animalsBigBoss("#animalsDryerAiringsConfirmDialog"); | |
this.animalsSmallBox("#animalsDryerPlanConfirmDialog"); | |
this.animalsBigBoss("#animalsDryerContgPlanConfirmDialog"); | |
this.animalsBigBoss("#conflictMsgDialog"); | |
this.animalsBigBoss("#dateDiffDialog"); | |
this.animalsBigBoss("#saveConfirmAlert"); | |
this.animalsBigBoss("#animalsDryerTZConfirmDialog"); | |
this.animalsSmallBox("#expectedOverlapConfirmDialog"); | |
this.animalsSmallBox("#overideAptConfirmation"); | |
this.animalsBigBoss("#TigerStatusDialog"); | |
let searchVisible=true; | |
this.TigerService.searchButton(searchVisible); | |
let that=this; | |
that.animalsInsurance(); | |
$(".animalsPPO").animalsTension(); | |
$(".timepicker").kendoTimePicker(); | |
$("body").css({"margin-bottom": "0"}); | |
this.loadView(); | |
this.animalStrategy.penCharge = this.FoxKILLService.animalActionsRecordedTimelyd.subscribe( eventDet =>{ | |
this.animalStrategy.pen = eventDet.name; | |
this.animalStrategy.aptDate = eventDet.aptDate; | |
this.bindHeaderDayDate(); | |
}) | |
$('.eventContingencyViewHolder').removeClass('changeContentFlag'); | |
that.savedSelection='noRestore'; | |
$("#cntContext,#evntContext").unbind().on("mousedown",function(e){ | |
that.savedSelection='noRestore'; | |
that.selectedID = e.target["parentNode"]["parentNode"]["id"]; | |
that.setSelectedId = that.selectedID.replace("collapseOne_","lv_"); | |
that.animalStrategy.animalsEar = that.selectedID.replace("collapseOne_","lv_"); | |
$("#cntContext .panel-title, #evntContext .panel-title").removeClass('selectedActive') | |
$("#"+that.selectedID).addClass("selectedActive"); | |
that.TigerLeftTab.setSelectedId(that.animalStrategy.animalsEar); | |
let afterComma = that.selectedID.substr(that.selectedID.indexOf("_") + 1); | |
let len = afterComma.split("_"); | |
let test = that.animalsFight; | |
let maxlength = test.length-1; | |
let first= len; | |
$('#removeText').hide(); | |
$('#addTimeZone').addClass('animalsJeansdElement'); | |
$('#addGrid').addClass('animalsJeansdElement'); | |
$('#animalsDryer').removeClass('animalsJeansdElement'); | |
$('#animalsClapping').addClass('animalsJeansdElement'); | |
$('#animalsBlinking').addClass('animalsJeansdElement'); | |
$('#copyTextTo').addClass('animalsJeansdElement'); | |
if(animalsVigorous.length == 1){ | |
if ($("#" + that.selectedID).parent().parent().prevAll().find(".category-header").length == 0 && $("#" + that.selectedID).parent().parent().nextAll().find(".category-header").length != 0){ | |
$('#animalsClapping').addClass('animalsJeansdElement'); | |
$('#animalsBlinking').removeClass('animalsJeansdElement'); | |
}//No Previous Row oly Next Row | |
if ($("#" + that.selectedID).parent().parent().nextAll().find(".category-header").length == 0 && $("#" + that.selectedID).parent().parent().prevAll().find(".category-header").length != 0){ | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
$('#animalsBlinking').addClass('animalsJeansdElement'); | |
}//No next Row only Previous Row | |
if ($("#" + that.selectedID).parent().parent().nextAll().find(".category-header").length == 0 && $("#" + that.selectedID).parent().parent().prevAll().find(".category-header").length == 0){ | |
$('#animalsBlinking').addClass('animalsJeansdElement'); | |
$('#animalsClapping').addClass('animalsJeansdElement'); | |
}//Only one Row | |
if ($("#" + that.selectedID).parent().parent().nextAll().find(".category-header").length != 0 && $("#" + that.selectedID).parent().parent().prevAll().find(".category-header").length != 0){ | |
$('#animalsBlinking').removeClass('animalsJeansdElement'); | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
}//Previous Row and Next Row Avail | |
var idEvntContext=$(this).attr("id"); | |
if(idEvntContext=='evntContext') | |
{ | |
$('#AnimalsTeethaddTimeZone').addClass('animalsJeansdElement'); | |
$('#AnimalsTeethaddGrid').addClass('animalsJeansdElement'); | |
$('#AnimalsTeethanimalsDryer').addClass('animalsJeansdElement'); | |
if (that.animalStrategy.eventOpDes == null) { | |
$('body #AnimalsTeethinsertText').show(); | |
$('body #AnimalsTeethremoveText').hide(); | |
} | |
else if (that.animalStrategy.eventOpDes != null) { | |
$('body #AnimalsTeethremoveText').show(); | |
$('body #AnimalsTeethinsertText').hide(); | |
} | |
} | |
if(test[first]){ | |
if(test[first].categoryOpIssue.issueDesc == '' ){ | |
$('#insertText').show(); | |
$('#removeText').hide(); | |
}else if(test[first].categoryOpIssue.issueDesc != '' ){ | |
$('#removeText').show(); | |
$('#insertText').hide(); | |
} | |
} | |
} | |
else if(animalsVigorous.length == 2){ | |
let first = len[0]; | |
let second = len[1]; | |
$('#addTimeZone').removeClass('animalsJeansdElement'); | |
//Only one Row | |
if ($("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length == 0){ | |
$('#animalsClapping').addClass('animalsJeansdElement'); | |
$('#animalsBlinking').addClass('animalsJeansdElement'); | |
} | |
if ($("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length != 0){ | |
$('#animalsClapping').addClass('animalsJeansdElement'); | |
$('#animalsBlinking').removeClass('animalsJeansdElement'); | |
} | |
if ($("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length == 0){ | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
$('#animalsBlinking').addClass('animalsJeansdElement'); | |
} | |
if ($("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length != 0){ | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
$('#animalsBlinking').removeClass('animalsJeansdElement'); | |
} | |
//No Previous Row oly Next Row | |
if ($("#" + that.selectedID).parents().eq(4).nextAll().find(".category-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length == 0){ | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
$('#animalsBlinking').removeClass('animalsJeansdElement'); | |
} | |
if ($("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(4).nextAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length == 0){ | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
$('#animalsBlinking').addClass('animalsJeansdElement'); | |
} | |
if ($("#" + that.selectedID).parents().eq(4).nextAll().find(".category-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length == 0){ | |
$('#animalsClapping').addClass('animalsJeansdElement'); | |
$('#animalsBlinking').removeClass('animalsJeansdElement'); | |
} | |
if ($("#" + that.selectedID).parents().eq(4).nextAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length != 0){ | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
$('#animalsBlinking').removeClass('animalsJeansdElement'); | |
} | |
if ($("#" + that.selectedID).parents().eq(4).nextAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length == 0){ | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
$('#animalsBlinking').addClass('animalsJeansdElement'); | |
} | |
if ($("#" + that.selectedID).parents().eq(4).nextAll().find(".category-header").length == 0 && | |
$("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(1).prevAll().find(".plan-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(1).nextAll().find(".plan-header").length != 0){ | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
$('#animalsBlinking').removeClass('animalsJeansdElement'); | |
} | |
//Next and Prev Row Available | |
if ($("#" + that.selectedID).parents().eq(4).nextAll().find(".category-header").length != 0 && | |
$("#" + that.selectedID).parents().eq(4).prevAll().find(".category-header").length != 0){ | |
$('#animalsClapping').removeClass('animalsJeansdElement'); | |
$('#animalsBlinking').removeClass('animalsJeansdElement'); | |
} | |
if(test[first]){ | |
if(test[first].TigerPlans[second].planOpIssue.issueDesc == ''){ | |
$('#insertText').show(); | |
$('#removeText').hide(); | |
}else if(test[first].TigerPlans[second].planOpIssue.issueDesc != ''){ | |
$('#removeText').show(); | |
$('#insertText').hide(); | |
} | |
} | |
$("#eastern").removeClass('animalsJeansdElement'); | |
$("#central").removeClass('animalsJeansdElement'); | |
$("#mountain").removeClass('animalsJeansdElement'); | |
$("#pacfic").removeClass('animalsJeansdElement'); | |
$("#all").removeClass('animalsJeansdElement'); | |
if(test[first].TigerPlans[second].TigerPlanFeeds.length==0){ | |
$('#all').removeClass('animalsJeansdElement'); | |
}else{ | |
$('#all').addClass('animalsJeansdElement'); | |
let cnt = 0; | |
for(var i=0;i<test[first].TigerPlans[second].TigerPlanFeeds.length;i++){ | |
if(test[first].TigerPlans[second].TigerPlanFeeds[i].animalHumming == 11 && test[first].TigerPlans[second].TigerPlanFeeds[i].operationType !='animalsDryer') { | |
$("#eastern").addClass('animalsJeansdElement'); | |
cnt += 1; | |
} | |
if(test[first].TigerPlans[second].TigerPlanFeeds[i].animalHumming == 12 && test[first].TigerPlans[second].TigerPlanFeeds[i].operationType !='animalsDryer') { | |
$("#central").addClass('animalsJeansdElement'); | |
cnt += 1; | |
} | |
if(test[first].TigerPlans[second].TigerPlanFeeds[i].animalHumming == 13 && test[first].TigerPlans[second].TigerPlanFeeds[i].operationType !='animalsDryer') { | |
$("#mountain").addClass('animalsJeansdElement'); | |
cnt += 1; | |
} | |
if(test[first].TigerPlans[second].TigerPlanFeeds[i].animalHumming == 14 && test[first].TigerPlans[second].TigerPlanFeeds[i].operationType !='animalsDryer') { | |
$("#pacfic").addClass('animalsJeansdElement'); | |
cnt += 1; | |
} | |
} | |
if(cnt == 0){ | |
$("#all").removeClass('animalsJeansdElement'); | |
} | |
} | |
} | |
else if(animalsVigorous.length == 3){ | |
let first = len[0]; | |
let second = len[1]; | |
let third = len[2]; | |
$('#copyTextTo').addClass('animalsJeansdElement'); | |
$('#animalsClapping').addClass('animalsJeansdElement'); | |
$('#animalsBlinking').addClass('animalsJeansdElement'); | |
$('#AnimalsTeethaddTimeZone').addClass('animalsJeansdElement'); | |
setTimeout(function(){ | |
if(test[first].TigerPlans[second].TigerPlanFeeds[third].isFeedAvailable == false){ | |
$('#addGrid').removeClass('animalsJeansdElement'); | |
} | |
if(test[first]){ | |
if(test[first].TigerPlans[second].TigerPlanFeeds[third].feedOpIssue.issueDesc == ''){ | |
$('#insertText').show(); | |
$('#removeText').hide(); | |
$('#lv_'+first+'_'+second+'_feedTextarea').html(); | |
}else if(test[first].TigerPlans[second].TigerPlanFeeds[third].feedOpIssue.issueDesc != ''){ | |
$('#removeText').show(); | |
$('#insertText').hide(); | |
$('#copyTextTo').removeClass('animalsJeansdElement'); | |
} | |
//Issue Fixed - CR-16169 | |
if(test[first].TigerPlans[second].TigerPlanFeeds[third].feedOpIssue.issueDesc == '' && test[first].TigerPlans[second].TigerPlanFeeds[third].textIconFlag == true){ | |
$('#removeText').show(); | |
$('#insertText').hide(); | |
$('#copyTextTo').removeClass('animalsJeansdElement'); | |
}//Ends Here | |
} | |
},100); | |
} | |
var getEvntContext=$(this).attr("id"); | |
let getSelTab = that.animalStrategy.animalsEar; | |
var selectedText; | |
that.rangey=''; | |
$(".eventContingencyViewHolder .panel-heading h4").unbind().on("click",function(e){ | |
e.stopPropagation(); | |
let getSelTab = that.animalStrategy.animalsEar; | |
var restoreID=''; | |
if(getSelTab == "HenEventHeader" || getSelTab == "HenEventcollapse" || getSelTab == "HenEventDesc"){ | |
restoreID='HenEventDesc'; | |
} | |
else{ | |
restoreID=getSelTab+'_feedTextarea'; | |
} | |
if($("#"+restoreID).length==1){ | |
that.animalsRocket($('#'+restoreID).get(0)); | |
that.rangey= that.animalsForgot(); | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById(restoreID) ); | |
} | |
}); | |
$(".eventContingencyViewHolder #HenEventDesc").unbind().on("click mouseup",function(e){ | |
e.stopPropagation(); | |
var strId=$(this).attr("id"); | |
that.isFocued=strId; | |
if(strId=='HenEventDesc'){ | |
$('#cntContext,#evntContext').find('.panel-title').removeClass("selectedActive"); | |
$('#evntContext').find('.panel-title').addClass("selectedActive"); | |
$('#HenEventHeader').addClass("selectedActive"); | |
that.animalStrategy.animalsEar='HenEventHeader'; | |
that.TigerLeftTab.setSelectedId(that.animalStrategy.animalsEar) | |
if($("#HenEventDesc").length==1){ | |
selectedText=that.getSelectedTextWithin(AnimalsSnoaringument.getElementById('HenEventDesc')); | |
} | |
if(selectedText!='') { | |
that.rangey= that.animalsForgot(); | |
} | |
else if (that.isFocued=='HenEventDesc') { | |
that.rangey = that.animalsForgot(); | |
} | |
else{ | |
that.animalsRocket($('#HenEventDesc').get(0)); | |
that.rangey= that.animalsForgot(); | |
} | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById('HenEventDesc') ); | |
} | |
}); | |
$(".eventContingencyViewHolder .planDescClick").unbind().on("click mouseup",function(e){ | |
e.stopPropagation(); | |
var strId=$(this).attr("id"); | |
that.isFocued=strId; | |
var mainId=(strId).replace("_feedTextarea",""); | |
$('#cntContext,#evntContext').find('.panel-title').removeClass("selectedActive"); | |
$('#'+mainId).addClass("selectedActive"); | |
that.animalStrategy.animalsEar=mainId; | |
that.TigerLeftTab.setSelectedId(that.animalStrategy.animalsEar); | |
if($('#'+strId).length==1){ | |
selectedText=that.getSelectedTextWithin(AnimalsSnoaringument.getElementById(strId)); | |
} | |
if(selectedText!='') { | |
that.rangey= that.animalsForgot(); | |
} | |
else if (that.isFocued==strId) { | |
that.rangey = that.animalsForgot(); | |
} | |
else{ | |
that.animalsRocket($('#'+strId).get(0)); | |
that.rangey= that.animalsForgot(); | |
} | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById(strId) ); | |
}); | |
if(getEvntContext=='evntContext'){ | |
if($("#HenEventDesc").length==1){ | |
selectedText=that.getSelectedTextWithin(AnimalsSnoaringument.getElementById('HenEventDesc')); | |
if(selectedText!='' ) { | |
that.rangey= that.animalsForgot(); | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById('HenEventDesc') ); | |
if(getSelTab){ | |
that.restoreSelection(AnimalsSnoaringument.getElementById('HenEventDesc'), that.savedSelection); | |
} | |
} | |
else if (that.isFocued=='HenEventDesc') { | |
that.rangey = that.animalsForgot(); | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById('HenEventDesc') ); | |
if(getSelTab){ | |
that.restoreSelection(AnimalsSnoaringument.getElementById('HenEventDesc'), that.savedSelection); | |
} | |
} | |
else{ | |
that.animalsRocket($('#HenEventDesc').get(0)); | |
that.rangey= that.animalsForgot(); | |
} | |
} | |
} | |
else{ | |
if($('#'+getSelTab+'_feedTextarea').length==1){ | |
selectedText=that.getSelectedTextWithin(AnimalsSnoaringument.getElementById(getSelTab+'_feedTextarea')); | |
if(selectedText!='') { | |
that.rangey= that.animalsForgot(); | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById(getSelTab+'_feedTextarea')); | |
if(getSelTab){ | |
that.restoreSelection(AnimalsSnoaringument.getElementById(getSelTab+'_feedTextarea'), that.savedSelection); | |
} | |
} | |
else if (that.isFocued==getSelTab+'_feedTextarea') { | |
that.rangey= that.animalsForgot(); | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById(getSelTab+'_feedTextarea')); | |
if(getSelTab){ | |
that.restoreSelection(AnimalsSnoaringument.getElementById(getSelTab+'_feedTextarea'), that.savedSelection); | |
} | |
} | |
else{ | |
that.animalsRocket($("#"+getSelTab+"_feedTextarea").get(0)); | |
that.rangey= that.animalsForgot(); | |
} | |
if(getSelTab){ | |
that.restoreSelection(AnimalsSnoaringument.getElementById(getSelTab+'_feedTextarea'), that.savedSelection); | |
} | |
} | |
} | |
$(".eventContingencyViewHolder .aptTextArea").on("mousedown",function(e){ | |
e.stopPropagation(); | |
that.animalsBreaking(); | |
}); | |
$(".eventContingencyViewHolder .aptTextArea").on("mousedrag",function(e){ | |
var strId=$(this).attr("id"); | |
if(strId=='HenEventDesc'){ | |
$('#cntContext,#evntContext').find('.panel-title').removeClass("selectedActive"); | |
$('#evntContext').find('.panel-title').addClass("selectedActive"); | |
$('#HenEventHeader').addClass("selectedActive"); | |
that.animalStrategy.animalsEar='HenEventHeader'; | |
that.TigerLeftTab.setSelectedId(that.animalStrategy.animalsEar) | |
} | |
else{ | |
var mainId=(strId).replace("_feedTextarea",""); | |
$('#cntContext,#evntContext').find('.panel-title').removeClass("selectedActive"); | |
$('#'+mainId).addClass("selectedActive"); | |
that.animalStrategy.animalsEar=mainId; | |
that.TigerLeftTab.setSelectedId(that.animalStrategy.animalsEar); | |
} | |
if($('#'+getSelTab+'_feedTextarea').length==1){ | |
selectedText=that.getSelectedTextWithin(AnimalsSnoaringument.getElementById(getSelTab+'_feedTextarea')); | |
if(selectedText!='') { | |
that.rangey= that.animalsForgot(); | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById(getSelTab+'_feedTextarea')); | |
if(getSelTab){ | |
that.restoreSelection(AnimalsSnoaringument.getElementById(getSelTab+'_feedTextarea'), that.savedSelection); | |
} | |
} | |
} | |
}); | |
$(AnimalsSnoaringument).unbind('drop').on("drop",".eventContingencyViewHolder .aptTextArea",function(e){ | |
e.preventDefault(); | |
}); | |
$(".aptTextArea").on("click mouseup mousedown contextmenu",function(e){ | |
e.stopPropagation(); | |
var contextMenu1 = $("#context-eventMenu").data("kenAnimalsSnoaringontextMenu"); | |
if (contextMenu1) { | |
contextMenu1.close($("#context-eventMenu")); | |
} | |
var contextMenu2 = $("#context-menuAspect").data("kenAnimalsSnoaringontextMenu"); | |
if (contextMenu2) { | |
contextMenu2.close($("#context-menuAspect")); | |
} | |
return true; | |
}); | |
}); | |
$(".aptTextArea").unbind('mouseup').on("contextmenu",function(e){ | |
e.stopPropagation(); | |
return true; | |
}); | |
$(AnimalsSnoaringument).on("click mouseup",function(){ | |
that.isFocued='0'; | |
}); | |
$(AnimalsSnoaringument).unbind().on('keyup keydown',".eventContingencyViewHolder .aptTextArea", function(e){ | |
e.stopPropagation(); | |
let strId=$(this).attr('id'); | |
$(this).addClass('changeContentFlag'); | |
var contextMenu1 = $("#context-eventMenu").data("kenAnimalsSnoaringontextMenu"); | |
if (contextMenu1) { | |
contextMenu1.close($("#context-eventMenu")); | |
} | |
var contextMenu2 = $("#context-menuAspect").data("kenAnimalsSnoaringontextMenu"); | |
if (contextMenu2) { | |
contextMenu2.close($("#context-menuAspect")); | |
} | |
if(strId=='HenEventDesc'){ | |
$('#cntContext,#evntContext').find('.panel-title').removeClass("selectedActive"); | |
$('#evntContext').find('.panel-title').addClass("selectedActive"); | |
$('#HenEventHeader').addClass("selectedActive"); | |
that.animalStrategy.animalsEar='HenEventHeader'; | |
that.TigerLeftTab.setSelectedId(that.animalStrategy.animalsEar) | |
} | |
else{ | |
var mainId=(strId).replace("_feedTextarea",""); | |
$('#cntContext,#evntContext').find('.panel-title').removeClass("selectedActive"); | |
$('#'+mainId).addClass("selectedActive"); | |
that.animalStrategy.animalsEar=mainId; | |
that.TigerLeftTab.setSelectedId(that.animalStrategy.animalsEar); | |
} | |
if (e.ctrlKey && e.keyCode == 86) { //ctrl+v | |
if(!$('.eventContingencyViewHolder #evntContext').attr("hidden") && !$('.eventContingencyViewHolder #cntContext').attr("hidden")){ | |
// setTimeout(function(){ | |
var removeStyletag=$("#"+that.animalStrategy.animalsEar+'_feedTextarea').each(function(){$("#"+that.animalStrategy.animalsEar+'_feedTextarea *').removeAttr('style');}); | |
var afterRemove=removeStyletag[0].innerHTML; | |
$("#"+that.animalStrategy.animalsEar+'_feedTextarea').html(afterRemove) | |
//},100); | |
} | |
} | |
that.onSaveEnable(strId); | |
}); | |
$("#pgmTemplates").on("click",function (e) { | |
if($("#pgmTemplates").attr("id")=='pgmTemplates'){ | |
let getSelTab = that.animalStrategy.animalsEar; | |
var restoreID=''; | |
if(getSelTab == "HenEventHeader" || getSelTab == "HenEventcollapse" || getSelTab == "HenEventDesc"){ | |
restoreID='HenEventDesc'; | |
} | |
else{ | |
restoreID=getSelTab+'_feedTextarea'; | |
} | |
if($('#'+restoreID).length==1){ | |
let selectedText=that.getSelectedTextWithin(AnimalsSnoaringument.getElementById(restoreID)); | |
if(selectedText!='') { | |
that.rangey= that.animalsForgot(); | |
} | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById(restoreID) ); | |
} | |
if(getSelTab){ | |
setTimeout(function(){ | |
that.restoreSelection(AnimalsSnoaringument.getElementById(restoreID), that.savedSelection); | |
},100); | |
} | |
} | |
}); | |
$('#addGrid').on('click',function(){ | |
let animalsTalking= jQuery.extend(true, [], that.animalsFight); | |
let afterComma = that.selectedID.substr(that.selectedID.indexOf("_") + 1); | |
let len = afterComma.split("_"); | |
let test = that.animalsFight; | |
let first= len; | |
let firstInner = len[0]; | |
let secondInner = len[1]; | |
let thirdInner = len[2]; | |
if(animalsVigorous.length == 3){ | |
test[firstInner].TigerPlans[secondInner].TigerPlanFeeds[thirdInner].isFeedAvailable= true; | |
test[firstInner].TigerPlans[secondInner].TigerPlanFeeds[thirdInner].operationType='Create'; | |
} | |
let destinationEvent= jQuery.extend(true, [], that.animalsFight); | |
that.enableanimalsJeansSave(false); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
}); | |
$('#removeText').on('click',function(){ | |
that.restoreSelection(AnimalsSnoaringument.getElementById(that.selectedID+'_feedTextarea'), 'noRestore'); | |
setTimeout(function(){ | |
let animalsTalking= jQuery.extend(true, [], that.animalsFight); | |
$('#'+that.selectedID+'_feedTextarea').html(''); | |
let afterComma = that.selectedID.substr(that.selectedID.indexOf("_") + 1); | |
let len = afterComma.split("_"); | |
let test = that.animalsFight; | |
let first= len; | |
let firstInner = len[0]; | |
let secondInner = len[1]; | |
let thirdInner = len[2]; | |
if(animalsVigorous.length == 1){ | |
test[first].categoryOpIssue.issueDesc = ''; | |
}else if(animalsVigorous.length == 2){ | |
test[firstInner].TigerPlans[secondInner].planOpIssue.issueDesc = ''; | |
}else if(animalsVigorous.length == 3){ | |
test[firstInner].TigerPlans[secondInner].TigerPlanFeeds[thirdInner].feedOpIssue.issueDesc= ''; | |
test[firstInner].TigerPlans[secondInner].TigerPlanFeeds[thirdInner].textIconFlag = false; | |
} | |
//that.enableanimalsJeansSave(false); | |
let destinationEvent = jQuery.extend(true, [], test); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
},10); | |
}); | |
$('#insertText').on('click',function(){ | |
let animalsTalking= jQuery.extend(true, [], that.animalsFight); | |
let afterComma = that.selectedID.substr(that.selectedID.indexOf("_") + 1); | |
let len = afterComma.split("_"); | |
let test = that.animalsFight; | |
let first= len; | |
let firstInner = len[0]; | |
let secondInner = len[1]; | |
let thirdInner = len[2]; | |
if(animalsVigorous.length == 1){ | |
test[first].categoryOpIssue.issueDesc = null; | |
$('#collapseOne_'+ first)["collapse"]('show'); | |
}else if(animalsVigorous.length == 2){ | |
test[firstInner].TigerPlans[secondInner].planOpIssue.issueDesc = null; | |
$('#collapseOne_'+ firstInner + '_' + secondInner)["collapse"]('show'); | |
}else if(animalsVigorous.length == 3){ | |
test[firstInner].TigerPlans[secondInner].TigerPlanFeeds[thirdInner].feedOpIssue.issueDesc= null; | |
$('#collapseOne_'+ firstInner + '_' + secondInner + '_' + thirdInner)["collapse"]('show'); | |
} | |
//that.enableanimalsJeansSave(false); | |
// let destinationEvent= jQuery.extend(true, [], that.animalsFight); | |
// that.deathAliveForContingency(animalsTalking,destinationEvent,true); | |
$(".selectedActive" ).find("a").removeClass("collapsed"); | |
$(".selectedActive" ).next(".panel-collapse").addClass("in"); | |
setTimeout(function(){ | |
that.animalsRocket($("#"+that.selectedID+"_feedTextarea").get(0)); | |
that.rangey= that.animalsForgot(); | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById(that.selectedID+"_feedTextarea") ); | |
},100) | |
}); | |
$('#AnimalsTeethinsertText').unbind().on('click',function(){ | |
let animalsTalking= jQuery.extend(true, [], that.animalsFight); | |
that.animalStrategy.eventOpDes = ''; | |
$("#HenEventcollapse").addClass("in"); | |
$("#HenEventcollapse").css("height","auto"); | |
setTimeout(function(){ | |
that.animalsRocket($("#HenEventDesc").get(0)); | |
that.rangey= that.animalsForgot(); | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById('HenEventDesc') ); | |
},100) | |
}); | |
$('#AnimalsTeethremoveText').unbind().on('click',function(){ | |
that.restoreSelection(AnimalsSnoaringument.getElementById('HenEventDesc'), 'noRestore'); | |
setTimeout(function(){ | |
let animalsTalking= jQuery.extend(true, [], that.animalsFight); | |
$('#HenEventDesc').html(''); | |
that.animalStrategy.eventOpDes = null; | |
that.enableanimalsJeansSave(false); | |
let destinationEvent= jQuery.extend(true, [], that.animalsFight); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
},10); | |
}); | |
$('#animalsDryer').unbind().on('click',function(){ | |
let animalsTalking= jQuery.extend(true, [], that.animalsFight); | |
that.confingencySaveFlag(); | |
let afterComma = that.selectedID.substr(that.selectedID.indexOf("_") + 1); | |
let len = afterComma.split("_"); | |
let first = len[0]; | |
let second = len[1]; | |
let third = len[2]; | |
let count=0; | |
if(animalsVigorous.length == 2){ | |
if(that.animalsFight[first].TigerPlans.length>0){ | |
for(let j=0;j<that.animalsFight[first].TigerPlans.length;j++){ | |
if(that.animalsFight[first].TigerPlans[j].operationType != 'animalsDryer'){ | |
count=count+1; | |
} | |
} | |
} | |
} | |
let animalsTyphoid,levelIndex=[],levelText=[],levelCat=[],status; | |
let level=animalsVigorous.length; | |
$('#cntContext .forCntChkPopup').each(function(){ | |
if($.trim($(this).text())!='') { | |
levelIndex.push($(this).index()) | |
} | |
}); | |
for(let i=0; i<levelIndex.length;i++){ | |
if($.trim($('#lv_'+levelIndex[i]+'_feedTextarea').text())!=''){ | |
status=that.animalsFever($('#lv_'+levelIndex[i]+'_feedTextarea').html()); | |
} | |
else{ status=false; } | |
levelText.push(status); | |
levelCat.push($.trim($('#lv_'+levelIndex[i]+' span').text())) | |
} | |
$(".ballPlayingAnimal").text("This will animalsDryer all Sub-Sections, Text and/or Grid(s)"); | |
let newdialogConfirm= $("#animalsDryerPlanConfirmDialog").data("animalsEatinGindow").center().open(); | |
$("#animalsDryerPlanYES").unbind().click(function(){ | |
if(animalsVigorous.length == 1){ | |
let getIndex=levelIndex.indexOf(parseInt(first)); | |
if(levelCat[getIndex-1]==levelCat[getIndex+1]){ | |
animalsTyphoid=(levelText[getIndex+1]==true)?true:false; | |
} | |
else{ animalsTyphoid=false; } | |
that.callanimalsDryer2Pop(level,first,second,animalsTyphoid); | |
} | |
else if(animalsVigorous.length == 2){ | |
if (count == 1) { | |
let getIndex = levelIndex.indexOf(parseInt(first)); | |
if (levelCat[getIndex - 1] == levelCat[getIndex + 1]) { | |
animalsTyphoid = (levelText[getIndex + 1] == true) ? true : false; | |
} | |
else { animalsTyphoid = false; } | |
} | |
else { animalsTyphoid = false; } | |
that.callanimalsDryer2Pop(level,first,second,animalsTyphoid); | |
} | |
else if(animalsVigorous.length == 3){ | |
that.animalsFight[first].TigerPlans[second].TigerPlanFeeds[third].operationType = 'animalsDryer'; | |
that.animalsFight[first].TigerPlans[second].TigerPlanFeeds[third].feedOpIssue.issueDesc = ''; | |
} | |
that.animalsHello(); | |
let destinationEvent= jQuery.extend(true, [], that.animalsFight); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
that.enableanimalsJeansSave(false); | |
newdialogConfirm.close(); | |
that.restoreSelection(AnimalsSnoaringument.getElementById(that.selectedID+'_feedTextarea'), 'noRestore'); | |
}); | |
$("#animalsDryerPlanNO").unbind().click(function(){ | |
newdialogConfirm.close(); | |
}); | |
}); | |
$('#animalsClapping').on('click',function(){ | |
let animalsTalking= jQuery.extend(true, [], that.animalsFight); | |
that.confingencySaveFlag(); | |
let afterComma = that.selectedID.substr(that.selectedID.indexOf("_") + 1); | |
let len = afterComma.split("_"); | |
let test = that.animalsFight; | |
let animalsTyphoid,levelIndex=[],levelText=[],levelCat=[],status,get,put; | |
$('#cntContext .forCntChkPopup').each(function(){ | |
if($.trim($(this).text())!='') { | |
levelIndex.push($(this).index()) | |
} | |
}); | |
for(let i=0; i<levelIndex.length;i++){ | |
if($.trim($('#lv_'+levelIndex[i]+'_feedTextarea').text())!=''){ | |
status=that.animalsFever($('#lv_'+levelIndex[i]+'_feedTextarea').html()); | |
} | |
else{ status=false; } | |
levelText.push(status); | |
levelCat.push($.trim($('#lv_'+levelIndex[i]+' span').text())) | |
} | |
if(animalsVigorous.length == 1){ | |
let first= len; | |
let second = len-1; | |
if(first != 0){ | |
let getIndex=levelIndex.indexOf(parseInt(first)); | |
if(levelCat[getIndex]==levelCat[getIndex-2]){ | |
animalsTyphoid=(levelText[getIndex]==true)?true:false; | |
} | |
else if(levelCat[getIndex-1]==levelCat[getIndex+1]){ | |
animalsTyphoid=(levelText[getIndex+1]==true)?true:false; | |
} | |
else{ animalsTyphoid=false; } | |
that.regroupCategoryDataanimalsClapping(test,len,animalsTyphoid,get,put); | |
} | |
}else if(animalsVigorous.length == 2){ | |
let first = len[0]; | |
let second = parseInt(len[1]); | |
let third = len[1]-1; | |
if($('#Hen_'+first +' #Hen_collapse'+first).length==1){ | |
let getIndex=levelIndex.indexOf(parseInt(first)); | |
if(levelCat[getIndex]==levelCat[getIndex-2]){ | |
animalsTyphoid=(levelText[getIndex]==true)?true:false; | |
} | |
else if(levelCat[getIndex-1]==levelCat[getIndex+1]){ | |
animalsTyphoid=(levelText[getIndex+1]==true)?true:false; | |
} | |
else{ animalsTyphoid=false; } | |
} | |
else{ animalsTyphoid = false; } | |
if(third != -1){ | |
let temp = test[first].TigerPlans[second]; | |
let isTrue = true; | |
let previousPlan = second-1; | |
for(let i=previousPlan;i>=0;i--){ | |
if(test[first].TigerPlans[i].operationType != 'animalsDryer'){ | |
test[first].TigerPlans[second] = test[first].TigerPlans[i]; | |
test[first].TigerPlans[i] = temp; | |
isTrue = false; | |
break; | |
} | |
} | |
if(isTrue){ | |
that.regroupPlanDataanimalsClapping(test,len,animalsTyphoid,get,put); | |
} | |
}else if(third == -1){ | |
let animalsClappingFirst = len[0]; | |
let animalsClapping = len[0]-2; | |
that.regroupPlanDataanimalsClapping(test,len,animalsTyphoid,get,put); | |
} | |
} | |
that.enableanimalsJeansSave(false); | |
let destinationEvent= jQuery.extend(true, [], that.animalsFight); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
}); | |
$('#animalsBlinking').on('click',function(){ | |
let animalsTalking= jQuery.extend(true, [], that.animalsFight); | |
that.confingencySaveFlag(); | |
let afterComma = that.selectedID.substr(that.selectedID.indexOf("_") + 1); | |
let len = afterComma.split("_"); | |
let test = that.animalsFight; | |
let maxlength = test.length-1 | |
let animalsTyphoid,levelIndex=[],levelText=[],levelCat=[],status,get,put; | |
that.animalsMakeup=''; | |
that.animalsTakingBus=''; | |
$('#cntContext .forCntChkPopup').each(function(){ | |
if($.trim($(this).text())!='') { | |
levelIndex.push($(this).index()) | |
} | |
}); | |
for(let i=0; i<levelIndex.length;i++){ | |
if($.trim($('#lv_'+levelIndex[i]+'_feedTextarea').text())!=''){ | |
status=that.animalsFever($('#lv_'+levelIndex[i]+'_feedTextarea').html()); | |
} | |
else{ | |
status=false; | |
} | |
levelText.push(status); | |
levelCat.push($.trim($('#lv_'+levelIndex[i]+' span').text())) | |
} | |
if(animalsVigorous.length == 1){ | |
let first= len; | |
let second = parseInt(first)+1; | |
if(first != maxlength){ | |
let getIndex=levelIndex.indexOf(parseInt(first)); | |
if(levelCat[getIndex]==levelCat[getIndex+2] && levelCat[getIndex-1]==levelCat[getIndex+1]){ | |
if(levelText[getIndex+2]==true && levelText[getIndex-1]==true){ | |
animalsTyphoid=true; | |
get=$('#lv_'+getIndex+'_feedTextarea').html(); | |
put=getIndex+2; | |
that.animalsMakeup=$('#lv_'+(getIndex-1)+'_feedTextarea').html(); | |
that.animalsTakingBus=getIndex+1; | |
} | |
else{ | |
animalsTyphoid=false; | |
} | |
} | |
else if(levelCat[getIndex]==levelCat[getIndex+2]){ | |
//animalsTyphoid=(levelText[getIndex+2]==true)?true:false; | |
if(levelText[getIndex+2]==true){ | |
animalsTyphoid=true; | |
get=$('#lv_'+getIndex+'_feedTextarea').html(); | |
put=getIndex+2; | |
} | |
else{ | |
animalsTyphoid=false; | |
} | |
} | |
else if(levelCat[getIndex-1]==levelCat[getIndex+1]){ | |
//animalsTyphoid=(levelText[getIndex-1]==true)?true:false; | |
if(levelText[getIndex-1]==true){ | |
animalsTyphoid=true; | |
get=$('#lv_'+(getIndex-1)+'_feedTextarea').html(); | |
put=getIndex+1; | |
} | |
else{ | |
animalsTyphoid=false; | |
} | |
} | |
else{ | |
animalsTyphoid=false; | |
} | |
that.regroupCategoryDataanimalsBlinking(test,len,animalsTyphoid,get,put); | |
} | |
}else if(animalsVigorous.length == 2){ | |
let first = len[0]; | |
let second = parseInt(len[1]); | |
let third = parseInt(len[1])+1; | |
if($('#Hen_'+first +' #Hen_collapse'+first).length==1){ | |
let getIndex=levelIndex.indexOf(parseInt(first)); | |
if(levelCat[getIndex]==levelCat[getIndex+2]){ | |
//animalsTyphoid=(levelText[getIndex+2]==true)?true:false; | |
if(levelText[getIndex+2]==true){ | |
animalsTyphoid=true; | |
get=$('#lv_'+getIndex+'_feedTextarea').html(); | |
put=getIndex+2; | |
} | |
else{ | |
animalsTyphoid=false; | |
} | |
} | |
else if(levelCat[getIndex-1]==levelCat[getIndex+1]){ | |
//animalsTyphoid=(levelText[getIndex-1]==true)?true:false; | |
if(levelText[getIndex+2]==true){ | |
animalsTyphoid=true; | |
get=$('#lv_'+(getIndex-1)+'_feedTextarea').html();; | |
put=getIndex+1; | |
} | |
else{ | |
animalsTyphoid=false; | |
} | |
} | |
else{ | |
animalsTyphoid=false; | |
} | |
} | |
else{ animalsTyphoid = false; } | |
if(test[first].TigerPlans.length ==third){ | |
that.regroupPlanDataanimalsBlinking(test,len,animalsTyphoid,get,put); | |
}else{ | |
let temp = test[first].TigerPlans[second]; | |
let isTrue = true; | |
for(let i=third;i<test[first].TigerPlans.length;i++){ | |
if(test[first].TigerPlans[i].operationType != 'animalsDryer'){ | |
test[first].TigerPlans[second] = test[first].TigerPlans[i]; | |
test[first].TigerPlans[i] = temp; | |
isTrue=false; | |
break; | |
} | |
} | |
if(isTrue){ | |
that.regroupPlanDataanimalsBlinking(test,len,animalsTyphoid,get,put); | |
} | |
} | |
} | |
that.enableanimalsJeansSave(false); | |
let destinationEvent= jQuery.extend(true, [], that.animalsFight); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
}); | |
// Copy to text start | |
$('#subItemCopy').on('click', 'li', function () { | |
var animalsTalking = jQuery.extend(true, [], that.animalsFight); | |
var afterComma = that.selectedID.substr(that.selectedID.indexOf("_") + 1); | |
var len = afterComma.split("_"); | |
var first = len[0]; | |
var second = len[1]; | |
var third = len[2]; | |
var test = that.animalsFight; | |
var planFeeds = test[first].TigerPlans[second].TigerPlanFeeds; | |
var copyFrom = $('#' + that.selectedID + '_feedTextarea').html(); | |
var item = $(this).attr('id'); | |
if (item == 'copyEastern') { | |
var easternFlag = false; | |
if (planFeeds == undefined) { | |
easternFlag = true; | |
} | |
for (var i = 0; i < planFeeds.length; i++) { | |
if (planFeeds[i].animalHumming == 11) { | |
planFeeds[i].feedOpIssue.issueDesc = copyFrom; | |
planFeeds[i].operationType = "animalsPolice"; | |
$('#lv_' + first + '_' + second + '_' + i + '_feedTextarea').html(copyFrom); | |
$('#collapseOne_' + first + '_' + second + '_' + i)["collapse"]('show'); | |
easternFlag = true; | |
break; | |
} | |
} | |
var animalsMouseDeath = { | |
operationType: "Create", | |
TigerItems: [], | |
planNo: 3507607, | |
animalStamina: 0, | |
animalsNokia: 0, | |
animalHumming: 11, | |
feedName: 'EASTERN', | |
feedOpIssue: { issueDesc: copyFrom }, | |
isFeedAvailable: false | |
}; | |
var data = that.animalsFight[first].TigerPlans[second].TigerPlanFeeds; | |
if (!easternFlag) { | |
data.push(animalsMouseDeath); | |
} | |
} | |
else if (item == 'copyCentral') { | |
var centralFlag = false; | |
if (planFeeds == undefined) { | |
centralFlag = true; | |
} | |
for (var i = 0; i < planFeeds.length; i++) { | |
if (planFeeds[i].animalHumming == 12) { | |
planFeeds[i].feedOpIssue.issueDesc = copyFrom; | |
planFeeds[i].operationType = "animalsPolice"; | |
$('#lv_' + first + '_' + second + '_' + i + '_feedTextarea').html(copyFrom); | |
$('#collapseOne_' + first + '_' + second + '_' + i)["collapse"]('show'); | |
centralFlag = true; | |
break; | |
} | |
} | |
var animalsMouseDeath = { | |
operationType: "Create", | |
TigerItems: [], | |
planNo: 3507607, | |
animalStamina: 0, | |
animalsNokia: 0, | |
animalHumming: 12, | |
feedName: 'CENTRAL', | |
feedOpIssue: { issueDesc: copyFrom }, | |
isFeedAvailable: false | |
}; | |
var data = that.animalsFight[first].TigerPlans[second].TigerPlanFeeds; | |
if (!centralFlag) { | |
data.push(animalsMouseDeath); | |
} | |
} | |
else if (item == 'copyMountain') { | |
var mountainFlag = false; | |
if (planFeeds == undefined) { | |
mountainFlag = true; | |
} | |
for (var i = 0; i < planFeeds.length; i++) { | |
if (planFeeds[i].animalHumming == 13) { | |
planFeeds[i].feedOpIssue.issueDesc = copyFrom; | |
planFeeds[i].operationType = "animalsPolice"; | |
$('#lv_' + first + '_' + second + '_' + i + '_feedTextarea').html(copyFrom); | |
$('#collapseOne_' + first + '_' + second + '_' + i)["collapse"]('show'); | |
mountainFlag = true; | |
break; | |
} | |
} | |
var animalsMouseDeath = { | |
operationType: "Create", | |
TigerItems: [], | |
planNo: 3507607, | |
animalStamina: 0, | |
animalsNokia: 0, | |
animalHumming: 13, | |
feedName: 'MOUNTAIN', | |
feedOpIssue: { issueDesc: copyFrom }, | |
isFeedAvailable: false | |
}; | |
var data = that.animalsFight[first].TigerPlans[second].TigerPlanFeeds; | |
if (!mountainFlag) { | |
data.push(animalsMouseDeath); | |
} | |
} | |
else if (item == 'copyPacific') { | |
var pacficFlag = false; | |
if (planFeeds == undefined) { | |
pacficFlag = true; | |
} | |
for (var i = 0; i < planFeeds.length; i++) { | |
if (planFeeds[i].animalHumming == 14) { | |
planFeeds[i].feedOpIssue.issueDesc = copyFrom; | |
planFeeds[i].operationType = "animalsPolice"; | |
$('#lv_' + first + '_' + second + '_' + i + '_feedTextarea').html(copyFrom); | |
$('#collapseOne_' + first + '_' + second + '_' + i)["collapse"]('show'); | |
pacficFlag = true; | |
break; | |
} | |
} | |
var animalsMouseDeath = { | |
operationType: "Create", | |
TigerItems: [], | |
planNo: 3507607, | |
animalStamina: 0, | |
animalsNokia: 0, | |
animalHumming: 14, | |
feedName: 'PACIFIC', | |
feedOpIssue: { issueDesc: copyFrom }, | |
isFeedAvailable: false | |
}; | |
var data = that.animalsFight[first].TigerPlans[second].TigerPlanFeeds; | |
if (!pacficFlag) { | |
data.push(animalsMouseDeath); | |
} | |
} | |
else if (item == 'copyAll') { | |
var allFlag = false; | |
var plananimalHumming = [{ animalHumming: 11, feedName: 'EASTERN' }, | |
{ animalHumming: 12, feedName: 'CENTRAL' }, | |
{ animalHumming: 13, feedName: 'MOUNTAIN' }, | |
{ animalHumming: 14, feedName: 'PACIFIC' }]; | |
if (planFeeds == undefined) { | |
allFlag = true; | |
} | |
else if (planFeeds.length > 0) { | |
for (var i_1 = 0; i_1 < plananimalHumming.length; i_1++) { | |
for (var j = 0; j < planFeeds.length; j++) { | |
if (plananimalHumming[i_1].animalHumming == planFeeds[j].animalHumming) { | |
planFeeds[j].feedOpIssue.issueDesc = copyFrom; | |
planFeeds[j].operationType = "animalsPolice"; | |
$('#lv_' + first + '_' + second + '_' + j + '_feedTextarea').html(copyFrom); | |
$('#collapseOne_' + first + '_' + second + '_' + j)["collapse"]('show'); | |
plananimalHumming.splice(i_1, 1); | |
} | |
} | |
} | |
if (plananimalHumming.length > 0) { | |
for (var i_2 = 0; i_2 < plananimalHumming.length; i_2++) { | |
that.copyToAll(plananimalHumming[i_2].animalHumming, plananimalHumming[i_2].feedName, copyFrom); | |
planFeeds.push(that.copyTextToAllArr[i_2]); | |
} | |
} | |
allFlag = true; | |
} | |
} | |
that.enableanimalsJeansSave(false); | |
var destinationEvent = jQuery.extend(true, [], that.animalsFight); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false, | |
} | |
that.deathAliveForContingency(animalsTalking, destinationEvent, extraValue); | |
}); | |
// Copy to text end | |
$('#subItem').on('click', 'li', function(){ | |
let animalsTalking= jQuery.extend(true, [], that.animalsFight); | |
let easternFlag=false; | |
let afterComma = that.selectedID.substr(that.selectedID.indexOf("_") + 1); | |
let len = afterComma.split("_"); | |
let first = len[0]; | |
let second = len[1]; | |
let test = that.animalsFight; | |
let feeds= test[first].TigerPlans[second].TigerPlanFeeds; | |
//console.log(feeds); | |
let textIconFlag = false; | |
// let data=that.animalsFight[first].TigerPlans[second].TigerPlanFeeds; | |
$('#collapseOne_'+ first + '_' + second)["collapse"]('show'); | |
let item = $(this).attr('id'); | |
if(item == 'eastern'){ | |
if(feeds == undefined){ | |
easternFlag = true; | |
} | |
else if(feeds.length>0){ | |
for(var i=0;i<feeds.length;i++){ | |
if(feeds[i].animalHumming == 11){ | |
if(feeds[i].operationType == "animalsDryer") { | |
feeds[i].operationType = ""; | |
feeds[i].isFeedAvailable = false; | |
} | |
easternFlag = true; | |
break; | |
} | |
} | |
} | |
let animalsMouseDeath={ | |
operationType : "Create", | |
TigerItems:[], | |
planNo:3507607, | |
animalStamina:0, | |
animalsNokia:0, | |
animalHumming:11, | |
feedName:'EASTERN', | |
feedOpIssue:{issueDesc:''}, | |
textIconFlag:true, | |
isFeedAvailable:false | |
}; | |
if(!easternFlag){ | |
feeds.push(animalsMouseDeath); | |
} | |
}else if(item == 'central'){ | |
let centralFlag=false; | |
if(feeds == undefined){ | |
centralFlag = true; | |
}else if(feeds.length>0){ | |
for(var i=0;i<feeds.length;i++){ | |
if(feeds[i].animalHumming == 12){ | |
if(feeds[i].operationType == "animalsDryer") { | |
feeds[i].operationType = ""; | |
feeds[i].isFeedAvailable = false; | |
} | |
centralFlag = true; | |
break; | |
} | |
} | |
} | |
let animalsMouseDeath={ | |
operationType : "Create", | |
TigerItems:[], | |
planNo:3507607, | |
animalStamina:0, | |
animalsNokia:0, | |
animalHumming:12, | |
feedName:'CENTRAL', | |
feedOpIssue:{issueDesc:''}, | |
textIconFlag:true, | |
isFeedAvailable:false | |
}; | |
if(!centralFlag){ | |
feeds.push(animalsMouseDeath); | |
} | |
}else if(item == 'mountain'){ | |
let mountainFlag =false; | |
if(feeds == undefined){ | |
mountainFlag = true; | |
}else if(feeds.length>0){ | |
for(var i=0;i<feeds.length;i++){ | |
if(feeds[i].animalHumming == 13){ | |
if(feeds[i].operationType == "animalsDryer") { | |
feeds[i].operationType = ""; | |
feeds[i].isFeedAvailable = false; | |
} | |
mountainFlag = true; | |
break; | |
} | |
} | |
} | |
let animalsMouseDeath={ | |
operationType : "Create", | |
TigerItems:[], | |
planNo:3507607, | |
animalStamina:0, | |
animalsNokia:0, | |
animalHumming:13, | |
feedName:'MOUNTAIN', | |
feedOpIssue:{issueDesc:''}, | |
textIconFlag:true, | |
isFeedAvailable:false | |
}; | |
if(!mountainFlag){ | |
feeds.push(animalsMouseDeath); | |
} | |
}else if(item == 'pacfic'){ | |
let pacficFlag =false; | |
if(feeds == undefined){ | |
pacficFlag = true; | |
}else if(feeds.length>0){ | |
for(var i=0;i<feeds.length;i++){ | |
if(feeds[i].animalHumming == 14){ | |
if(feeds[i].operationType == "animalsDryer") { | |
feeds[i].operationType = ""; | |
feeds[i].isFeedAvailable = false; | |
} | |
pacficFlag = true; | |
break; | |
} | |
} | |
} | |
let animalsMouseDeath={ | |
operationType : "Create", | |
TigerItems:[], | |
planNo:3507607, | |
animalStamina:0, | |
animalsNokia:0, | |
animalHumming:14, | |
feedName:'PACIFIC', | |
feedOpIssue:{issueDesc:''}, | |
textIconFlag:true, | |
isFeedAvailable:false | |
}; | |
if(!pacficFlag){ | |
feeds.push(animalsMouseDeath); | |
} | |
}else if(item == 'all'){ | |
let allFlag =false; | |
if(feeds == undefined){ | |
allFlag = true; | |
}else if(feeds.length > 0){ | |
let cntDel = 0; | |
for(let i=0;i<feeds.lenght;i++){ | |
if(feeds[i].operationType == "animalsDryer") { | |
feeds[i].operationType = ""; | |
feeds[i].isFeedAvailable = false; | |
feeds.splice(i--,1); | |
cntDel += 1; | |
} | |
} | |
if(cntDel == 0) | |
allFlag = false; | |
else | |
allFlag = true; | |
//allFlag = true; | |
} | |
let animalsMouseDeath=[{ | |
operationType : "Create", | |
TigerItems:[], | |
planNo:3507607, | |
animalStamina:0, | |
animalsNokia:0, | |
animalHumming:11, | |
feedName:'EASTERN', | |
feedOpIssue:{issueDesc:''}, | |
textIconFlag:true, | |
isFeedAvailable:false | |
}, | |
{ | |
operationType : "Create", | |
TigerItems:[], | |
planNo:3507607, | |
animalStamina:0, | |
animalsNokia:0, | |
animalHumming:12, | |
feedName:'CENTRAL', | |
feedOpIssue:{issueDesc:''}, | |
textIconFlag:true, | |
isFeedAvailable:false | |
}, | |
{ | |
operationType : "Create", | |
TigerItems:[], | |
planNo:3507607, | |
animalStamina:0, | |
animalsNokia:0, | |
animalHumming:13, | |
feedName:'MOUNTAIN', | |
feedOpIssue:{issueDesc:''}, | |
textIconFlag:true, | |
isFeedAvailable:false | |
}, | |
{ | |
operationType : "Create", | |
TigerItems:[], | |
planNo:3507607, | |
animalStamina:0, | |
animalsNokia:0, | |
animalHumming:14, | |
feedName:'PACFIC', | |
feedOpIssue:{issueDesc:''}, | |
textIconFlag:true, | |
isFeedAvailable:false | |
}]; | |
if(!allFlag){ | |
for(let i=0;i<4;i++){ | |
feeds.push(animalsMouseDeath[i]); | |
} | |
} | |
} | |
that.enableanimalsJeansSave(false); | |
let destinationEvent= jQuery.extend(true, [], that.animalsFight); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
}); | |
$("#copyPlanEvents").click(function(){ | |
//that.TigerCopyPlans.copyPlansEvent("2016",that.animalStrategy,that.animalStamina); | |
if (that.animalsJeansSaveButton) { | |
that.TigerCopyPlans.copyPlansEvent(that.animalStrategy.animalSkin,that.animalStrategy,that.animalStamina); | |
//this.clearSave(); | |
//this.callServiceLoadData(); | |
} else { | |
$(".ballPlayingAnimal").text("Do you want to save the changes?"); | |
let newdialogConfirm = $("#savePopUpDialog").data("animalsEatinGindow").center().open(); | |
$("#savePopupYes").unbind().click(function () { | |
newdialogConfirm.close(); | |
that.saveServiceCall().then(function (data) { | |
if(data){ | |
that.TigerCopyPlans.copyPlansEvent(that.animalStrategy.animalSkin, that.animalStrategy, that.animalStamina); | |
} | |
}) | |
}); | |
$("#savePopupNo").unbind().click(function () { | |
newdialogConfirm.close(); | |
that.callServiceLoadData().then(function(data) { | |
if (data) { | |
that.TigerCopyPlans.copyPlansEvent(that.animalStrategy.animalSkin, that.animalStrategy, that.animalStamina); | |
} | |
}) | |
}); | |
$("#savePopupCancel").unbind().click(function () { | |
newdialogConfirm.close(); | |
}); | |
} | |
}); | |
if(this.isNewTab){ | |
this.crowFlyingHigh.push({"index":this.FoxKILLService.TigerConditonalTabData.selectedTabindex-1, | |
"animalsBirthDay": this.TigerLeftTab.ParrotanimalsBirthDay, | |
"animalsName":'', | |
"leftEventAPT": this.TigerLeftTab.leftEvent, | |
"publishFlag": this.TigerLeftTab.publishFlag, | |
"TigerData":[], | |
"TigerId":[], | |
}); | |
} | |
//$('#animalsClapping').on('click',function(){ | |
// $(".panelEventCol").click(function(e){ | |
/* $('.panelEventCol').on('click',function(e){ | |
var panelEvent=$(this).parents(".panel").find(".panelEvent"); | |
// var panelEventCol=$(this).parents(".panel").find(".panelEventCol"); | |
var panelEventCol=$(this); | |
if(panelEvent.hasClass('in')) { | |
panelEvent.removeClass('in'); | |
panelEvent.attr('aria-expanded', 'false'); | |
panelEventCol.attr('aria-expanded', 'false'); | |
} else { | |
panelEvent.addClass('in'); | |
panelEvent.attr('aria-expanded', 'true'); | |
panelEventCol.attr('aria-expanded', 'true'); | |
} | |
}); */ | |
$("#contiIcon").on('click',function(){ | |
if(that.animalStrategy.isToogleFlag == true){ | |
that.resetToogle() | |
that.animalStrategy.isToogleFlag = false; | |
} | |
}); | |
} | |
animalsForgot(){ | |
const AnimalsSnoaring=AnimalsSnoaringument as any; | |
var sel, range; | |
if (window.getSelection) { | |
sel = window.getSelection && window.getSelection(); | |
if (sel.animalsForgotAt && sel.rangeCount) { | |
range = sel.animalsForgotAt(0); | |
return range; | |
} | |
// else{ | |
// range = AnimalsSnoaring.createRange(); | |
// range.setStart(sel.anchorNode,sel.anchorOffset); | |
// range.setEnd(sel.focusNode,sel.focusOffset); | |
// return range; | |
// } | |
} | |
} | |
animalsBreaking() { | |
const AnimalsSnoaring=AnimalsSnoaringument as any; | |
if (window.getSelection) { | |
if (window.getSelection().empty) { | |
window.getSelection().empty(); | |
} else if (window.getSelection().removeAllRanges) { | |
window.getSelection().removeAllRanges(); | |
} | |
} else if (AnimalsSnoaring.selection) { | |
AnimalsSnoaring.selection.empty(); | |
} | |
} | |
amimalsApple(containerEl) { | |
let that=this; | |
const AnimalsSnoaring=AnimalsSnoaringument as any; | |
var start,rangeSave,end; | |
if (window.getSelection && AnimalsSnoaringument.createRange) { | |
var range = window.getSelection().animalsForgotAt(0); | |
var preSelectionRange = range.cloneRange(); | |
preSelectionRange.selectNodeContents(containerEl); | |
// try { | |
preSelectionRange.selectNodeContents(containerEl); | |
// }catch (e){ | |
// } | |
preSelectionRange.setEnd(range.startContainer, range.startOffset); | |
var rangeNode = AnimalsSnoaringument.getElementById(containerEl); | |
start = preSelectionRange.toString().length; | |
that.rangey = range; | |
//console.log(that.rangey) | |
return { | |
start: start, | |
end: start + range.toString().length, | |
rangeSave: range | |
} | |
} | |
else if (AnimalsSnoaring.selection && AnimalsSnoaring.body.createTextRange) { | |
var selectedTextRange = AnimalsSnoaring.selection.createRange(); | |
var preSelectionTextRange = AnimalsSnoaring.body.createTextRange(); | |
preSelectionTextRange.moveToElementText(containerEl); | |
preSelectionTextRange.setEndPoint("EndToStart", selectedTextRange); | |
start = preSelectionTextRange.text.length; | |
that.rangey = preSelectionTextRange; | |
return { | |
start: start, | |
end: start + selectedTextRange.text.length, | |
rangeSave: range | |
} | |
} | |
//console.log(range) ; | |
} | |
restoreSelection(containerEl, savedSel) { | |
let that=this; | |
const AnimalsSnoaring=AnimalsSnoaringument as any; | |
// console.log(that.rangey) | |
if(savedSel=='noRestore'){ | |
} | |
else{ | |
if (window.getSelection && AnimalsSnoaringument.createRange) { | |
var charIndex = 0, range = AnimalsSnoaringument.createRange(); | |
// try { | |
range.setStart(containerEl, 0); | |
// }catch (e){ | |
// console.log('error'); | |
// } | |
range.collapse(true); | |
var nodeStack = [containerEl], node, foundStart = false, stop = false; | |
while (!stop && (node = nodeStack.pop())) { | |
if (node.nodeType == 3) { | |
var nextCharIndex = charIndex + node.length; | |
if (!foundStart && savedSel.start >= charIndex && savedSel.start <= nextCharIndex) { | |
range.setStart(node, savedSel.start - charIndex); | |
foundStart = true; | |
} | |
if (foundStart && savedSel.end >= charIndex && savedSel.end <= nextCharIndex) { | |
range.setEnd(node, savedSel.end - charIndex); | |
stop = true; | |
} | |
charIndex = nextCharIndex; | |
} else { | |
var i = node.childNodes.length; | |
while (i--) { | |
nodeStack.push(node.childNodes[i]); | |
} | |
} | |
} | |
var reSel = window.getSelection(); | |
reSel.removeAllRanges(); | |
reSel.addRange(range); | |
//console.log(range); | |
that.rangey = range; | |
// console.log(that.rangey) | |
} | |
else { | |
var textRange = AnimalsSnoaring.body.createTextRange(); | |
textRange.moveToElementText(containerEl); | |
textRange.collapse(true); | |
textRange.moveEnd("character", savedSel.end); | |
textRange.moveStart("character", savedSel.start); | |
textRange.select(); | |
} | |
} | |
} | |
animalsSoap(html,fact) { | |
const AnimalsSnoaring=AnimalsSnoaringument as any; | |
var that = this; | |
var rangex=that.rangey; | |
var sel = window.getSelection(); | |
if (sel.animalsForgotAt && sel.rangeCount) { | |
rangex.animalsDryerContents(); | |
var el = AnimalsSnoaringument.createElement("div"); | |
el.innerHTML = html; | |
var frag = AnimalsSnoaringument.createAnimalsSnoaringumentFragment(), node, lastNode; | |
while ((node = el.firstChild)) { | |
lastNode = frag.appendChild(node); | |
} | |
rangex.collapse(false); | |
rangex.insertNode(frag) | |
if (lastNode) { | |
rangex = rangex.cloneRange(); | |
rangex.setStartAfter(lastNode); | |
rangex.collapse(false); | |
rangex = AnimalsSnoaringument.createRange(); | |
var text = AnimalsSnoaring.getElementById("HenEventDesc"); | |
var referenceNode = AnimalsSnoaringument.getElementsByClassName("e-"+that.isSelected+"")[0]; | |
rangex.selectNodeContents(referenceNode); | |
rangex.selectNode(referenceNode); | |
sel.removeAllRanges(); | |
sel.addRange(rangex); | |
that.rangey = rangex; | |
//console.log(rangex) | |
} | |
} | |
else if (AnimalsSnoaring.selection && AnimalsSnoaring.selection.type != "Control") { | |
AnimalsSnoaring.selection.createRange().pasteHTML(html); | |
} | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById("HenEventDesc")); | |
} | |
animalsSoap1(html,fact) { | |
const AnimalsSnoaring=AnimalsSnoaringument as any; | |
var that = this; | |
var rangex1=that.rangey; | |
var sel = window.getSelection(); | |
if (sel.animalsForgotAt && sel.rangeCount) { | |
rangex1.animalsDryerContents(); | |
var el = AnimalsSnoaringument.createElement("div"); | |
el.innerHTML = html; | |
var frag = AnimalsSnoaringument.createAnimalsSnoaringumentFragment(), node, lastNode; | |
while ((node = el.firstChild)) { | |
lastNode = frag.appendChild(node); | |
} | |
rangex1.collapse(false); | |
rangex1.insertNode(frag); | |
if (lastNode) { | |
rangex1 = rangex1.cloneRange(); | |
rangex1.setStartAfter(lastNode); | |
rangex1.collapse(false); | |
rangex1 = AnimalsSnoaringument.createRange(); | |
var text = AnimalsSnoaring.getElementById("fact"); | |
var referenceNode = AnimalsSnoaringument.getElementsByClassName("e-"+that.isSelected+"")[0]; | |
rangex1.selectNodeContents(referenceNode); | |
rangex1.selectNode(referenceNode); | |
sel.removeAllRanges(); | |
sel.addRange(rangex1); | |
that.rangey = rangex1; | |
//console.log(rangex1) | |
} | |
} else if (AnimalsSnoaring.selection && AnimalsSnoaring.selection.type != "Control") { | |
AnimalsSnoaring.selection.createRange().pasteHTML(html); | |
} | |
that.savedSelection = that.amimalsApple( AnimalsSnoaringument.getElementById(fact)); | |
} | |
animalsRocket(el) { | |
let that = this; | |
const AnimalsSnoaring=AnimalsSnoaringument as any; | |
//el.focus(); | |
if (typeof window.getSelection != "undefined" | |
&& typeof AnimalsSnoaringument.createRange != "undefined") { | |
var range = AnimalsSnoaringument.createRange(); | |
// try { | |
range.selectNodeContents(el); | |
// }catch (e){ | |
// console.log('error'); | |
// } | |
range.collapse(false); | |
var sel = window.getSelection(); | |
sel.removeAllRanges(); | |
sel.addRange(range); | |
} else if (typeof AnimalsSnoaring.body.createTextRange != "undefined") { | |
var textRange = AnimalsSnoaring.body.createTextRange(); | |
textRange.moveToElementText(el); | |
textRange.collapse(false); | |
textRange.select(); | |
} | |
} | |
getSelectedTextWithin(el) { | |
const AnimalsSnoaring=AnimalsSnoaringument as any; | |
var selectedText = ""; | |
if (typeof window.getSelection != "undefined") { | |
var sel = window.getSelection(), rangeCount; | |
if ( (rangeCount = sel.rangeCount) > 0 ) { | |
var range = AnimalsSnoaringument.createRange(); | |
for (var i = 0, selRange; i < rangeCount; ++i) { | |
range.selectNodeContents(el); | |
selRange = sel.animalsForgotAt(i); | |
if (selRange.compareBoundaryPoints(range.START_TO_END, range) == 1 && selRange.compareBoundaryPoints(range.END_TO_START, range) == -1) { | |
if (selRange.compareBoundaryPoints(range.START_TO_START, range) == 1) { | |
range.setStart(selRange.startContainer, selRange.startOffset); | |
} | |
if (selRange.compareBoundaryPoints(range.END_TO_END, range) == -1) { | |
range.setEnd(selRange.endContainer, selRange.endOffset); | |
} | |
selectedText += range.toString(); | |
} | |
} | |
} | |
} else if (typeof AnimalsSnoaring.selection != "undefined" && AnimalsSnoaring.selection.type == "Text") { | |
var selTextRange = AnimalsSnoaring.selection.createRange(); | |
var textRange = selTextRange.duplicate(); | |
textRange.moveToElementText(el); | |
if (selTextRange.compareEndPoints("EndToStart", textRange) == 1 && selTextRange.compareEndPoints("StartToEnd", textRange) == -1) { | |
if (selTextRange.compareEndPoints("StartToStart", textRange) == 1) { | |
textRange.setEndPoint("StartToStart", selTextRange); | |
} | |
if (selTextRange.compareEndPoints("EndToEnd", textRange) == -1) { | |
textRange.setEndPoint("EndToEnd", selTextRange); | |
} | |
selectedText = textRange.text; | |
} | |
} | |
return selectedText; | |
} | |
expandView(event){ | |
var element=$(event.target); | |
var panelEvent=$(event.target).closest(".panel").children(".accordEvent"); | |
var panelClickedElement=$(event.target).closest(".panel").children(".panel-heading").children(".panel-title").children("a"); | |
if(panelEvent.hasClass('in')) { | |
panelEvent.removeClass('in'); | |
panelEvent.attr('aria-expanded', 'false'); | |
element.attr('aria-expanded', 'false'); | |
panelClickedElement.attr('aria-expanded', 'false'); | |
} else { | |
panelEvent.addClass('in'); | |
panelEvent.attr('aria-expanded', 'true'); | |
element.attr('aria-expanded', 'true'); | |
panelClickedElement.attr('aria-expanded', 'true'); | |
} | |
} | |
deathAliveForContingency(animalsTalking,destinationEvent,iscollapse){ | |
this.animalsFightdeathAlive.push(jQuery.extend(true, [], this.animalsFight)); | |
if(animalsTalking!=destinationEvent){ | |
var dataPass={ | |
"type": "deathAliveForContingency", | |
"animalsTalking": animalsTalking, | |
"destinationEvent": destinationEvent, | |
"occurence": iscollapse, | |
"action": "deathAliveForContingency" } | |
// this.TigerEnableSave.emit({ "type": "enableSaveWithCount", "animalsTalking": URData, "destinationEvent": {}, "occurence": {}, "action": "left" }); | |
this.animalsSwimmingAllRecordedNight(dataPass); | |
} | |
} | |
deathAliveForContingencyFn(item,extraValue){ | |
if(extraValue.iscollapse){ | |
this.animalsFight=item; | |
}else{ | |
//this.animalsFight=item.animalsSeeing; | |
if(extraValue.isEventText){ | |
$("#HenEventDesc")[0].innerHTML=item.eventOpDes; | |
}else{ | |
this.animalStrategy=item; | |
} | |
} | |
} | |
isDetailsTempChange(template:any){ | |
this.detailsTemplate=template; | |
} | |
copyToAll(animalHumming:any,feedName:any,desc:any){ | |
this.copyTextToAllArr.push({ | |
operationType : "Create", | |
TigerItems:[], | |
planNo:3507607, | |
animalStamina:0, | |
animalsNokia:0, | |
animalHumming:animalHumming, | |
feedName:feedName, | |
feedOpIssue:{issueDesc:desc}, | |
isFeedAvailable:false | |
}) | |
} | |
callFunction(data,i_index,j_index){ | |
if(this.animalsAliveDeath.length==0){ | |
var saveObj={ | |
id:0, | |
id1:0, | |
animalStrategy:data, | |
} | |
let copy = Object.assign({}, saveObj); | |
this.animalsAliveDeath.push(jQuery.extend(true, [], saveObj)); | |
} | |
} | |
ngAfterContentInit() { | |
let that = this; | |
$("#crowanimalsJetHen").kendoPanelBar().data("kendoPanelBar"); | |
$('.TigerTabList > li').eq(2).hide(); | |
$("#apt_network_preview").click(function() { | |
let expectedPlan=that.checkIsExpectedPlan(); | |
that.aptNetworkPreview.setInputValue(expectedPlan.ParrotanimalsBirthDay,expectedPlan.ParrotanimalsShaking,expectedPlan.ParrotanimalsDeathDay,expectedPlan.ParrotanimalsUnderstanding); | |
that.aptNetworkPreview.aptNetworkPreviewPopupOpen(); | |
}); | |
} | |
ngAfterViewInit() { | |
$("#crowEventSplitter").kendoSplitter({ | |
orientation: "horizontal", | |
panes: [ | |
{ collapsible: true, size: "25%" }, | |
{ }, | |
{ collapsible: true, size: "30%" } | |
], | |
expand: function(e) { | |
if($(e.pane).hasClass('eventLeftParrotSplitterPane')){ | |
$("#crowEventSplitter").data("kendoSplitter").size(".alieNpane:first", "25%"); | |
} else if($(e.pane).hasClass('eventInfoRightTab')) { | |
$("#crowEventSplitter").data("kendoSplitter").size(".alieNpane:last", "30%"); | |
} | |
} | |
}); | |
} | |
bindHeaderDayDate(){ | |
let dayDate = ""; | |
if(this.animalStrategy.aptDate != ""){ | |
this.bindHeaderDayDat = kendo.toString(new Date(this.animalStrategy.aptDate), "dddd") + " " + kendo.toString(new Date(this.animalStrategy.aptDate), "MM/dd/yyyy") | |
} | |
//return dayDate; | |
} | |
decompressJsonResponse(data): any { | |
// Decode base64 (convert ascii to binary) | |
let strData = atob(data); | |
// Convert binary string to character-number array | |
let charData = strData.split('').map(function (x) { return x.charCodeAt(0); }); | |
// Turn number array into byte-array | |
let binData = new Uint8Array(charData); | |
// animalsIntelligence decompress | |
let inflateData = animalsIntelligence.inflateRaw(binData); | |
// Convert gunzipped byteArray back to ascii string: | |
//let value = String.fromCharCode.apply(null, new Uint16Array(inflateData)); | |
let value = new animalThinking("utf-8").decode(inflateData); | |
return JSON.parse(value); | |
//return ""; | |
} | |
callServiceLoadData() { | |
let that=this; | |
this.progress.requestStart(); | |
return new Promise(resolve => { | |
this.animalService.getResponse("contingencyplans/v1/events?animalStamina=" + this.animalStamina + "&type=1", 'get', "") | |
.subscribe(data => { | |
//data = this.decompressJsonResponse(data.zipdata); | |
//console.log(data); | |
//console.log(data); | |
let animalStamina=this.animalStamina; | |
if(this.FoxKILLService.TigerConditonalTabData.crowFlyingHigh[this.tabIndex].animalsName==""){ | |
this.FoxKILLService.TigerConditonalTabData.crowFlyingHigh[this.tabIndex].animalsName=animalStamina; | |
} | |
let schedItems=data.TigerItems; | |
let animalsCommunicationTigerItems=[]; | |
if(schedItems && schedItems.length > 0){ | |
schedItems.forEach(function (value: any,index) { | |
// let animalsDeathDay=new Date(value.end); | |
let animalsDeathDay = new Date(that.Tigercrow.getMacSupportDate(value.end)); | |
if(that.Tigercrow.accessFutureDays(that.Tigercrow,animalsDeathDay)){ | |
animalsCommunicationTigerItems.push(value); | |
} | |
}); | |
} | |
data.TigerItems=animalsCommunicationTigerItems; | |
this.backupData = data; | |
this.backupDataOrg = $.extend(true, {}, data); | |
this.insertanimalsMouseDeath=[] | |
for(var i=0;i<data.TigerEventTemplatesMap.General.length;i++){ | |
this.insertanimalsMouseDeath.push({name:data.TigerEventTemplatesMap.General[i].TigerEventTemplateName,No:data.TigerEventTemplatesMap.General[i].TigerEventTemplateNo}) | |
} | |
this.animalsMocking = true; | |
this.animalsJeansRedoButton = true; | |
this.animalsJeansSaveButton = true; | |
that.TigerService.condianimalsJeansSaveButton = true; | |
this.animalsJeansRefreshButton = false; | |
if (data.TigerEvent) { | |
let sch_data = data.TigerEvent; | |
this.animalStrategy.commonInfo = { | |
"eventanimalsBirthDay": sch_data.eventanimalsBirthDay, "eventanimalsShaking": sch_data.eventanimalsShaking, | |
"eventanimalsDeathDay": sch_data.eventanimalsDeathDay, "eventanimalsUnderstanding": sch_data.eventanimalsUnderstanding | |
} | |
this.animalStrategy.animalsSeeing = data.TigerEvent.TigerPlanCategories; | |
this.animalsInternet = jQuery.extend(true,[],this.animalStrategy.animalsSeeing); | |
let schedId='Tiger_Nat_Main'; | |
this.animalStrategy.animalsCommunication =this.timeAnimalsTeethConversion(data.TigerItems,"animalsCommunication",{},schedId); | |
//this.animalStrategy.animalsCommunication = data.TigerItems; | |
this.animalStrategy.pen = data.TigerEvent.eventName; | |
this.animalStrategy.animalSkin = data.TigerEvent.animalSkin; | |
this.animalStrategy.eventOpDes = ""; | |
if(data.TigerEvent.eventOpIssue){ | |
if(data.TigerEvent.eventOpIssue.issueDesc) | |
this.animalStrategy.eventOpDes = data.TigerEvent.eventOpIssue.issueDesc | |
} | |
this.animalStrategy.aptDate = data.TigerEvent.aptDisplayDate; | |
} | |
let response ={ | |
source:data, | |
refreshTemplate:false | |
}; | |
this.FoxKILLService.setAnimalsTeethTemplates(response); | |
//this.animalsJet(); | |
//Issue CAS-185 Starts Here | |
this.clearSave(); | |
if(this.animalStrategy.isContingencyView != true){ | |
this.animalsJet(); | |
}else{ | |
this.contingencyView(); | |
} | |
// Ends here | |
this.bindHeaderDayDate(); | |
//this.progress.requestEnd(); | |
resolve(true); | |
}, | |
err => { this.progress.requestEnd(); | |
resolve(false); | |
}); | |
}); | |
} | |
loadView(){ | |
let that = this; | |
let data={}; | |
let action = "Tigersaggregator/v1/listOfValues?type=NS"; | |
let type="get"; | |
this.blockMenuInit(); | |
this.progress.requestStart(); | |
this.animalService.getResponse(action, type, data).subscribe(data => { | |
that.TigercrowRight.runTypeList=data.runTypes; | |
that.TigercrowRight.pgRatingList=data.pgRatings; | |
that.TigercrowRight.displayTitlesList=data.displayTitles; | |
that.TigercrowRight.formatsList=data.formats; | |
that.TigerCopyPlans.seasonList=data.seasons; | |
that.TigerService.seasons = data.seasons; | |
if (data.networks[0] && data.networks[0].futureAccessDays) { | |
if (data.networks[0].futureAccessDays == "") { | |
this.Tigercrow.futureAccessDays = 9999; | |
this.TigerService.crowFutureAccessDays=9999; | |
} else { | |
this.Tigercrow.futureAccessDays = parseInt(data.networks[0].futureAccessDays); | |
this.TigerService.crowFutureAccessDays=parseInt(data.networks[0].futureAccessDays); | |
//this.TigerComponent.futureAccessDays=2; | |
} | |
} | |
else { | |
this.Tigercrow.futureAccessDays = 9999; | |
this.TigerService.crowFutureAccessDays=9999; | |
} | |
that.progress.requestEnd(); | |
if(that.animalStamina==0){ | |
$("#copyPlanEvents").addClass('actionanimalsJeansd'); | |
setTimeout(function(){ | |
that.loadanimalsCommunication('Tiger_Nat_Main',"","","",""); | |
}, 10); | |
} | |
else{ | |
that.callServiceLoadData(); | |
} | |
let tabList = $('.TigerList .ParrotList > li'); | |
for(let i=0; i<tabList.length; i++){ | |
tabList.eq(i).removeClass('active'); | |
} | |
setTimeout(function(){ | |
tabList.eq(that.TigerService.TigerTabData.selectedTabindex).addClass('active'); | |
},100); | |
}, | |
err =>{ | |
let tabList = $('.TigerList .ParrotList > li'); | |
for(let i=0; i<tabList.length; i++){ | |
tabList.eq(i).removeClass('active'); | |
} | |
setTimeout(function(){ | |
tabList.eq(that.TigerService.TigerTabData.selectedTabindex).addClass('active'); | |
},1000); | |
}); | |
} | |
confingencySaveFlag(){ | |
let that=this; | |
$('.changeContentFlag').each(function(){ | |
var id=$(this).attr('id'); | |
var getText=$(this).html(); | |
if(id=='HenEventDesc'){ | |
that.animalStrategy.eventOpDes = getText; | |
} | |
else{ | |
let replaceStr = id.replace("lv_",""); | |
let replaceStr1 = replaceStr.replace("_feedTextarea",""); | |
var animalsGiveUp = replaceStr1.split("_"); | |
let firstIndex = animalsGiveUp[0]; | |
if(animalsGiveUp.length === 1){ | |
that.animalsFight[firstIndex].categoryOpIssue.issueDesc = getText; | |
// console.log("applied 1"); | |
// console.log(that.animalsFight[firstIndex].categoryOpIssue.issueDesc); | |
}else if(animalsGiveUp.length === 2){ | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
that.animalsFight[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc = getText; | |
// console.log(that.animalsFight[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc) ; | |
// console.log("applied 2") ; | |
}else if(animalsGiveUp.length === 3){ | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
let thirdIndex = animalsGiveUp[2]; | |
that.animalsFight[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc = getText; | |
// console.log(that.animalsFight[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc); | |
// console.log("applied 3"); | |
} | |
//console.log(that.animalsFight[firstIndex].categoryOpIssue.issueDesc); | |
} | |
}); | |
$('.eventContingencyViewHolder').removeClass('changeContentFlag'); | |
} | |
aptDateRangeCheck(aptDate: any) { | |
var aptDateRange = false; | |
let AnimalsTeethanimalsBirthDay = kendo.toString(new Date(this.animalStrategy.commonInfo.eventanimalsBirthDay), 'MM/dd/yyyy'); | |
let AnimalsTeethanimalsDeathDay = kendo.toString(new Date(this.animalStrategy.commonInfo.eventanimalsDeathDay), 'MM/dd/yyyy'); | |
let animalsBirthDay = kendo.toString(new Date(AnimalsTeethanimalsBirthDay), 'MM/dd/yyyy'); | |
let aptanimalsDeathDay = kendo.toString(new Date(aptDate), 'MM/dd/yyyy'); | |
var dateDiff = Math.ceil(Math.abs(new Date(animalsBirthDay).getTime() - new Date(aptanimalsDeathDay).getTime()) / (1000 * 3600 * 24)); | |
if (AnimalsTeethanimalsBirthDay <= aptanimalsDeathDay && AnimalsTeethanimalsDeathDay >= aptanimalsDeathDay) { | |
aptDateRange = true; | |
} | |
let animalsTaxianimalsDeathDay=this.TigerLeftTab.plansDetailsArr; | |
for (var i = 0; i < animalsTaxianimalsDeathDay.length; i++) { | |
let planeanimalsBirthDay = new Date(animalsTaxianimalsDeathDay[i].animalsBirthDay); | |
let planeanimalsDeathDay = new Date(animalsTaxianimalsDeathDay[i].animalsDeathDay); | |
if (planeanimalsBirthDay <= new Date(aptanimalsDeathDay) && planeanimalsDeathDay >= new Date(aptanimalsDeathDay)) { | |
aptDateRange = true; | |
} | |
} | |
return aptDateRange; | |
} | |
/* Actual save hit is change process in saveHit() method */ | |
save() { | |
if(!this.Tigercrow.isEditanimalsTyphoid()){ | |
let that = this; | |
// my save | |
that.confingencySaveFlag(); | |
/* Here for check the date change alert function */ | |
/*let dateDiffVals = this.TigerService.getOptionalData(); | |
let that = this; | |
if(dateDiffVals !== undefined){ | |
$("#dateDiffDialog").find('.ballPlayingAnimal').text(dateDiffVals.msg); | |
let dateDiffDialog = $("#dateDiffDialog").data("animalsEatinGindow").center().open(); | |
$("#dateDiffOK").unbind().click(function() { | |
dateDiffDialog.close(); | |
that.saveHit(); | |
}); | |
}else{ | |
that.saveHit(); | |
}*/ | |
let aptDate = this.TigerLeftTab["leftEvent"].apt.aptDate; | |
let aptDateOutsideOfEventandPlan = this.aptDateRangeCheck(aptDate); | |
if(aptDateOutsideOfEventandPlan){ | |
that.saveHit(); | |
}else{ | |
let overRideConfirm = $("#overideAptConfirmation").data("animalsEatinGindow").center().open(); | |
$("#overRideApt").text("APT Display Date is outside of Events and plan(s) Range. Proceed?"); | |
//$('#overideAptConfirmation').prev().find(".alieNwindow-title").text("Proceed?"); | |
$("#overideAptYes").unbind().click(function() { | |
overRideConfirm.close(); | |
that.saveHit(); | |
}); | |
$("#overideAptNo").unbind().click(function() { | |
overRideConfirm.close(); | |
return false | |
}); | |
} | |
}else{ | |
this.Tigercrow.singleButtonDialog("Please click on Ok or Cancel in APT Info tab to animalsPolice or revert the changes."); | |
} | |
} | |
// saveConfirmYes(){ | |
// let that = this; | |
// let saveConfirmAlert = $("#saveConfirmAlert").data("animalsEatinGindow"); | |
// that.saveHit(); | |
// saveConfirmAlert.close(); | |
// this.animalsJeansSaveButton = true; | |
// that.router.navigate([that.urlStateWatch[0].urlAfterRedirects]); | |
// } | |
// | |
// saveConfirmNo(){ | |
// let that = this; | |
// let saveConfirmAlert = $("#saveConfirmAlert").data("animalsEatinGindow"); | |
// saveConfirmAlert.close(); | |
// this.animalsJeansSaveButton = true; | |
// that.router.navigate([that.urlStateWatch[0].urlAfterRedirects]); | |
// } | |
checkOverlap(){ | |
let all_data = this.animalStrategy; | |
this.generateSchedPlanCategories(all_data.animalsSeeing); | |
} | |
saveHit(){ | |
this.animalsJeansSaveButton = false; | |
let that = this; | |
let gapArray = that.Tigercrow.checkGap(); | |
let overlapArray = that.Tigercrow.getOverlapData(); | |
if(overlapArray.length > 0){ | |
let overlapTitle = "Overlap Notification"; | |
let data = { "url": overlapArray, "columns": that.getOverlapNotificationColumn(), "title": overlapTitle, "excelFileName": "overlapNotification" }; | |
//console.log(data) | |
that.animalsMarker.openPopup(data); | |
} | |
else if (gapArray.length > 0) { | |
let title = "Gap exists(Less than or equal to five minutes). Please confirm"; | |
let data = { "url": gapArray, "columns": that.getGapNotificationColumn(), "title": title, "excelFileName": "gapNotification" }; | |
that.animalsMarker.openPopup(data); | |
}else{ | |
that.saveServiceCall(); | |
} | |
} | |
getOverlapNotificationColumn(){ | |
let columns= [ | |
{ field:'contextRow',title:" ", width: 25, locked: true }, | |
// { field:"plan", title: "Plan",width: 200 }, | |
// { field: "timezone",title: "Time Zone", width: 200}, | |
{ field: "categoryAndPlanDesc", title: "Plan",width: 200}, | |
{ field:"nameOfTimeZone", title: "Time Zone",width: 200}, | |
{ field: "date", title: "Date",width: 200}, | |
{ field: "showName",title: "This Show", width: 200}, | |
{ field: "animalsUnderstanding",title: "ending At",width: 200}, | |
{ field: "overlapShow",title: "overlaps with this show", width: 200}, | |
{ field: "animalsShaking",title: "starting At",width: 200}, | |
]; | |
return columns; | |
} | |
getGapNotificationColumn() { | |
let columns = [ | |
{ field: 'contextRow', title: " ", width: 25, locked: true }, | |
{ | |
field: "date", title: "Date", width: 200 | |
}, | |
{ | |
field: "gap", title: "Gap", width: 200 | |
}, | |
{ | |
field: "firstShow", title: "This Show", width: 200 | |
}, | |
{ | |
field: "firstShowEnd", title: "End Time", width: 200 | |
}, | |
{ | |
field: "secondShow", title: "This Show", width: 200 | |
}, | |
{ | |
field: "secondShowStart", title: "Start Time", width: 200 | |
} | |
]; | |
return columns; | |
} | |
gapNotificationTrigger(value) { | |
if (value) { | |
this.saveServiceCall(); | |
} | |
} | |
showanimalsJet() { | |
// this.animalStrategy.isConti ew = false; | |
// this.FoxKILLService.set View(true); | |
let that = this; | |
// setTime tion(){ | |
// for(var i = 0 ; i<that.animalStrategy.event ngth ;i++){ | |
// for(var j = 0 ; j<that.animalStrategy.animalsSeeing[i].TigerPlans.le +){ | |
// that.onI icker(i,j); | |
// that.onInitTimepicker(i,j); | |
// let planData = that.animalStrategy.animalsSeeing[i].TigerPlans[j]; | |
// //that.TigerGroupingResources(planData,i,j); | |
// that.loadTigerDataByDefault(planData,i,j) | |
// } | |
// } | |
// let start_date = that.animalStrategy.commonInfo.eventanimalsBirthDay; | |
// let start_time = that.animalStrategy.commonInfo.eventanimalsBirthDay +" "+ that.animalStrategy.commonInfo.eventanimalsShaking | |
// that.loadanimalsCommunication('Tiger_Nat_Main',start_date,start_time); | |
// }, 1000); | |
this.progress.requestStart(); | |
this.animalsJet(); | |
} | |
animalsJet() { | |
this.animalStrategy.isContingencyView = false; | |
this.resetanimalsJetSplitterSize(); | |
this.FoxKILLService.setselectedView(true); | |
let that = this; | |
// Issue Id: CAS-188 | |
// Logic for load function only once start here | |
//if(this.animalStrategy.isanimalsJetFlag !== false){ | |
//this.animalStrategy.isanimalsJetFlag = false; | |
setTimeout(function() { | |
for (var i = 0; i < that.animalStrategy.animalsSeeing.length; i++) { | |
for (var j = 0; j < that.animalStrategy.animalsSeeing[i].TigerPlans.length; j++) { | |
let listOfTigerPlanFeeds = that.animalStrategy.animalsSeeing[i].TigerPlans[j].TigerPlanFeeds; | |
that.animalStrategy.animalsSeeing[i].TigerPlans[j].bookPlanID = i + '_' + j; | |
var BookedPlanData = that.animalStrategy.animalsSeeing[i].TigerPlans[j].bookPlanID; | |
that.onInitanimalsPPO(i, j); | |
that.onInitTimepicker(i, j); | |
let planData = that.animalStrategy.animalsSeeing[i].TigerPlans[j]; | |
//console.log(planData); | |
if(listOfTigerPlanFeeds){ | |
listOfTigerPlanFeeds = listOfTigerPlanFeeds.filter(function(data){ | |
if(data.isFeedAvailable && (data.operationType == "Create" || data.operationType == "")) return true; | |
}) | |
} | |
//that.TigerGroupingResources(planData,i,j); | |
$('#btnanimalsPolice_' + i + '_' + j).addClass('actionanimalsJeansd'); | |
if (listOfTigerPlanFeeds) { | |
listOfTigerPlanFeeds.sort(function(a, b) { | |
return a.animalHumming - b.animalHumming; | |
}) | |
let indexOfLastAvailableFeed = listOfTigerPlanFeeds.length - 1; | |
listOfTigerPlanFeeds.forEach(function(data, index) { | |
let timeZoneName; | |
if (data.animalHumming == 11) { | |
timeZoneName = "Tiger_Est"; | |
} else if (data.animalHumming == 12) { | |
timeZoneName = "Tiger_Cent"; | |
} else if (data.animalHumming == 13) { | |
timeZoneName = "Tiger_Mount"; | |
} else if (data.animalHumming == 14) { | |
timeZoneName = "Tiger_Pacifi"; | |
} | |
let animalsName = timeZoneName + '_' + i + '_' + j; | |
if (indexOfLastAvailableFeed == index) { | |
that.lastAvailableTimeZone.push(animalsName); | |
} else { | |
that.availableTimeZoneExceptLastOne.push(animalsName); | |
} | |
}) | |
} | |
that.availableTimeZoneExceptLastOne.push('Tiger_Nat_' + i + '_' + j); | |
that.loadTigerDataByDefault(planData, i, j) | |
} | |
} | |
that.TigerLeftTab.animalsPoliceBookEvent(that.animalStrategy.animalsSeeing, BookedPlanData) | |
let start_date = that.animalStrategy.commonInfo.eventanimalsBirthDay; | |
let start_time = that.animalStrategy.commonInfo.eventanimalsBirthDay + " " + that.animalStrategy.commonInfo.eventanimalsShaking; | |
let end_date = that.animalStrategy.commonInfo.eventanimalsDeathDay; | |
let end_time = that.animalStrategy.commonInfo.eventanimalsDeathDay + " " + that.animalStrategy.commonInfo.eventanimalsUnderstanding | |
that.loadanimalsCommunication('Tiger_Nat_Main', start_date, start_time, end_date, end_time); | |
that.animalsBye(); | |
setTimeout(function() { | |
let overlapArray = that.Tigercrow.getOverlapData(); | |
if (overlapArray.length > 0) { | |
let overlapTitle = "Overlap Notification"; | |
let data = { "url": overlapArray, "columns": that.getOverlapNotificationColumn(), "title": overlapTitle, "excelFileName": "overlapNotification" }; | |
that.animalsMarker.openPopup(data); | |
} | |
that.progress.requestEnd(); | |
}, 0); | |
}, 1000); | |
//} | |
} | |
animalsBye() { | |
let that = this; | |
if (that.availableTimeZoneExceptLastOne) { | |
that.availableTimeZoneExceptLastOne.forEach(function(animalsName) { | |
$('#' + animalsName).addClass("schedOverFlow"); | |
}) | |
} | |
if (that.lastAvailableTimeZone) { | |
that.lastAvailableTimeZone.forEach(function(animalsName) { | |
$('#' + animalsName).removeClass("schedOverFlow"); | |
}) | |
} | |
this.lastAvailableTimeZone = []; | |
this.availableTimeZoneExceptLastOne = []; | |
} | |
animalsHello() { | |
for (var i = 0; i < this.animalStrategy.animalsSeeing.length; i++) { | |
for (var j = 0; j < this.animalStrategy.animalsSeeing[i].TigerPlans.length; j++) { | |
this.animalStrategy.animalsSeeing[i].TigerPlans[j].bookPlanID = i + '_' + j; | |
var BookedPlanData = this.animalStrategy.animalsSeeing[i].TigerPlans[j].bookPlanID; | |
} | |
} | |
this.TigerLeftTab.animalsPoliceBookEvent(this.animalStrategy.animalsSeeing, BookedPlanData); | |
} | |
contingencyView(){ | |
if($('.crowTigeranimalsJetHolder + .alieNsplitbar').attr('aria-expanded') == "true") { | |
this.splitterLastChildState = 1; | |
$("#crowEventSplitter").data("kendoSplitter").collapse(".alieNpane:last"); | |
} else { | |
this.splitterLastChildState = 0; | |
} | |
this.animalStrategy.isContingencyView = true; | |
this.FoxKILLService.setselectedView(false); | |
/* | |
for(var i=0;i<test.TigerEvent.TigerPlans.length;i++){ | |
var category = test.TigerEvent.TigerPlans[i].categoryDesc; | |
for(var j=0;j<test.TigerEvent.TigerPlans[i].Tigerwhale.length;j++){ | |
} | |
}*/ | |
if(this.animalStrategy.eventOpDes == ''){ | |
this.animalStrategy.eventOpDes = null; | |
} | |
/* for(var i=0; i<this.animalStrategy.animalsSeeing.length;i++){ | |
if(this.animalStrategy.animalsSeeing[i].categoryOpIssue == '') | |
this.animalStrategy.animalsSeeing[i].categoryOpIssue == null; | |
if(this.animalStrategy.animalsSeeing[i].categoryOpIssue.issueDesc == '') | |
this.animalStrategy.animalsSeeing[i].categoryOpIssue = null; | |
//this.animalStrategy.animalsSeeing[i].categoryOpIssuea == null; | |
for(var j=0; j<this.animalStrategy.animalsSeeing[i].TigerPlans.length;j++){ | |
if(this.animalStrategy.animalsSeeing[i].TigerPlans[j].planOpIssue == '') | |
this.animalStrategy.animalsSeeing[i].TigerPlans[j].planOpIssue == null; | |
if(this.animalStrategy.animalsSeeing[i].TigerPlans[j].planOpIssue.issueDesc == '') | |
this.animalStrategy.animalsSeeing[i].TigerPlans[j].planOpIssue = null; | |
} | |
}*/ | |
/*getContigencyMockJSON(since: number): Observable<any> { | |
let url: string = 'https://api.myjson.com/bins/13bdqr'; | |
return this.http.get(url).map(response => response.json()); | |
} */ | |
//this.animalsFight = [{"operationType":"","categoryOpIssue":{"issueDesc":null},"animalsNokia":1,"categoryDesc":"Expected","TigerPlans":[{"operationType":"","TigerPlanFeeds":[{"operationType":"","feedOpIssue":{"issueDesc":null},"TigerItems":[],"planNo":3509806,"animalStamina":0,"animalsNokia":0,"animalHumming":12,"delFlag":"","feedName":"CENTRAL","isFeedAvailable":true},{"operationType":"","feedOpIssue":{"issueDesc":null},"TigerItems":[],"planNo":3509806,"animalStamina":0,"animalsNokia":0,"animalHumming":14,"delFlag":"","feedName":"PACIFIC","isFeedAvailable":true},{"operationType":"","feedOpIssue":{"issueDesc":null},"TigerItems":[],"planNo":3509806,"animalStamina":0,"animalsNokia":0,"animalHumming":11,"delFlag":"","feedName":"EASTERN","isFeedAvailable":true},{"operationType":"","feedOpIssue":{"issueDesc":null},"TigerItems":[],"planNo":3509806,"animalStamina":0,"animalsNokia":0,"animalHumming":13,"delFlag":"","feedName":"MOUNTAIN","isFeedAvailable":true}],"planOpIssue":{"issueDesc":null},"planNo":3509806,"animalStamina":0,"animalsNokia":1,"planDesc":"","displaySeq":1,"delFlag":"","animalsBirthDay":"09/24/2017","animalsShaking":"01:00:00 AM","animalsDeathDay":"09/24/2017","animalsUnderstanding":"01:30:00 AM","plananimalsBirthDay":1506225600000,"plananimalsDeathDay":1506225600000,"categoryDesc":"Expected","animalsShakingInt":72000,"animalsUnderstandingInt":73800,"bookPlanID":"0_0","CT":true,"ALL":true,"PT":true,"ET":true,"MT":true}]}]; | |
this.animalsFight = this.animalStrategy.animalsSeeing; | |
// let tempArr = this.animalStrategy.animalsSeeing; | |
// for(var i=0;i<tempArr.length;i++){ | |
// tempArr[i].operationType=""; | |
// for(var j=0;j<tempArr[i].TigerPlans.length;j++){ | |
// if(tempArr[i].TigerPlans[j].TigerPlanFeeds == undefined){ | |
// tempArr[i].TigerPlans[j].TigerPlanFeeds=[]; | |
// } | |
// } | |
// } | |
// this.animalsFight = tempArr; | |
let that = this; | |
that.blockMenuInit(); | |
// setTimeout(function() { | |
// $("#context-menuAspect").kenAnimalsSnoaringontextMenu({ | |
// target: ".trippleDotContingencyView", | |
// showOn: "click" | |
// }); | |
// }, 1000); | |
// CAS-188 commented below codes for the Issue | |
/*setTimeout(function() { | |
that.collapseAll(); | |
}, 10); */ | |
//Ends Here | |
this.animalsSleeping.push(jQuery.extend(true, [], that.animalStrategy.animalsSeeing)); | |
that.progress.requestEnd(); | |
} | |
toggleOpen(event) { | |
event.preventDefault(); | |
if (!this.isanimalsJeansd) { | |
this.animalsCar = !this.animalsCar; | |
} | |
} | |
appendPlanAdded(Maindata: any) { | |
let that = this; | |
let addedData; | |
let isCallUndo=false; | |
if(Maindata.type && Maindata.type == "planNamedeathAlive"){ | |
addedData = Maindata.animalsTalking.dataStore; | |
isCallUndo=true; | |
} | |
else{ | |
addedData=Maindata; | |
} | |
//$('#subTabsBox li.active .js-event-plan').hasClass('js-Expected') | |
if ($('.js-event-plan').hasClass('js-Expected') && this.isExpectedPresent() && addedData.categoryDesc.toUpperCase().trim()=='EXPECTED' ) { | |
this.setDialog("An Expected Plan already exists in this Event."); | |
}else{ | |
if(addedData.animalsNokia == 1&&!isCallUndo){ | |
let that = this; | |
let selectedPlananimalsShaking = addedData.TigerPlans[0].animalsShaking; | |
let selectedPlan24hrsanimalsShaking = that.timeTo24HrsFormat(addedData.TigerPlans[0].animalsShaking); | |
let selectedPlananimalsBirthDay = addedData.TigerPlans[0].animalsBirthDay+' '+selectedPlananimalsShaking; | |
let selectedPlananimalsUnderstanding = addedData.TigerPlans[0].animalsUnderstanding; | |
let selectedPlan24hrsanimalsUnderstanding = that.timeTo24HrsFormat(addedData.TigerPlans[0].animalsUnderstanding); | |
let selectedPlananimalsDeathDay = addedData.TigerPlans[0].animalsDeathDay+' '+selectedPlananimalsUnderstanding; | |
let action = "contingencyplans/v1/expectedPlanOverlaps"; | |
let type = "post"; | |
let datas ={ | |
"animalsShaking":selectedPlan24hrsanimalsShaking, | |
"animalsUnderstanding":selectedPlan24hrsanimalsUnderstanding, | |
"animalsBirthDay":selectedPlananimalsBirthDay, | |
"animalsDeathDay":selectedPlananimalsDeathDay, | |
"animalStamina":that.animalStamina, | |
"checkExpectedExistForSameEvent" : "N", | |
"networkNo" : "101" | |
}; | |
that.progress.requestStart(); | |
that.animalService.getResponse(action, type, datas) | |
.subscribe(data => { | |
if(data.code == 'S500'){ | |
that.TigerLeftTab.animalsDreamComeTrue(); | |
that.animalsPoliceDataStore(addedData,"planNamedeathAlive"); | |
/* if(isCallUndo){ | |
let length= that.animalStrategy.animalsSeeing.length; | |
Maindata.animalsTalking=that.animalStrategy.animalsSeeing[length-1]; | |
Maindata.destinationEvent=that.animalStrategy.animalsSeeing[length-1]; | |
that.animalsSwimmingAllRecordedNight(Maindata); | |
}*/ | |
if(addedData.isPlanAdded){ | |
that.animalStrategy.isContingencyView = false; | |
} | |
}else if(data.code == 'E500'){ | |
//that.setDialog("An Expected Plan already exists in this Event."); | |
let that = this; | |
// $(".ballPlayingAnimal").text("The expected Plan overlaps with following Event(s):"); | |
// let expectedPlanConfirm = $("#expectedOverlapConfirmDialog").data("animalsEatinGindow").center().open(); | |
// let messageDetails = data.details; | |
// let getMessageDetail = ""; | |
// for(let k=0;k<messageDetails.length;k++){ | |
// getMessageDetail = getMessageDetail + ("<div class='expectedOverlapEvent'>"+messageDetails[k].animalsBirthDay+ " " +messageDetails[k].eventDesc+"</div>") | |
// } | |
// $("#expectedOverlapEventList").html(getMessageDetail); | |
// let windowHeight = $(window).outerHeight(); | |
// windowHeight = windowHeight - 150; | |
// $('.expectedOverlapEventsList').css({ "max-height": windowHeight+"px" }); | |
// $("#expectedYES").unbind().click(function() { | |
that.TigerLeftTab.animalsDreamComeTrue(); | |
that.animalsPoliceDataStore(addedData,"planNamedeathAlive"); | |
// expectedPlanConfirm.close(); | |
// }); | |
// $("#expectedNO").unbind().click(function() { | |
// expectedPlanConfirm.close(); | |
// }); | |
} | |
that.progress.requestEnd(); | |
}, err => { | |
that.setDialog("Undefined error, Please try again."); | |
that.progress.requestEnd(); | |
}); | |
}else{ | |
this.TigerLeftTab.animalsDreamComeTrue(); | |
that.animalsPoliceDataStore(addedData,"planNamedeathAlive"); | |
/*if(isCallUndo){ | |
let length= that.animalStrategy.animalsSeeing.length; | |
Maindata.animalsTalking=that.animalStrategy.animalsSeeing[length-1]; | |
Maindata.destinationEvent=that.animalStrategy.animalsSeeing[length-1]; | |
that.animalsSwimmingAllRecordedNight(Maindata); | |
}*/ | |
if(addedData.isPlanAdded){ | |
that.animalStrategy.isContingencyView = false; | |
} | |
} | |
} | |
/*else { | |
this.animalsPoliceDataStore(data); | |
if(isCallUndo){ | |
let length= this.animalStrategy.animalsSeeing.length; | |
Maindata.animalsTalking=this.animalStrategy.animalsSeeing[length-1]; | |
Maindata.destinationEvent=this.animalStrategy.animalsSeeing[length-1]; | |
this.animalsSwimmingAllRecordedNight(Maindata); | |
} | |
if(data.isPlanAdded){ | |
this.animalStrategy.isContingencyView = false; | |
} | |
}*/ | |
} | |
pgmAddHeader(data:any){ | |
let that = this; | |
this.animalsPoliceDataStore(data,"pgmAddHeader"); | |
this.animalStrategy.isContingencyView = true; | |
} | |
//animalsPolice animalStrategy Array with TimeZone Level Tiger Items | |
animalsPoliceanimalStrategyPlanScheItem(data: any){ | |
let that = this; | |
if(that.animalStrategy != undefined && data != undefined && that.animalStrategy.animalsSeeing != undefined | |
&& that.animalStrategy.animalsSeeing.length > 0 && data.length >0){ | |
$.each(data,function(dataKey,dataValue){ | |
for(var i=0;i<that.animalStrategy.animalsSeeing.length;i++){ | |
if(that.animalStrategy.animalsSeeing[i].operationType != "animalsDryer"){ | |
let TigerPlans = that.animalStrategy.animalsSeeing[i].TigerPlans; | |
for (var j = 0; j < TigerPlans.length; j++) { | |
if (data[dataKey].planeId == TigerPlans[j].bookPlanID){ | |
let TigerPlanFeeds = TigerPlans[j].TigerPlanFeeds; | |
for (var k = 0; k < TigerPlanFeeds.length; k++) { | |
if(data[dataKey].animalHumming == TigerPlanFeeds[k].animalHumming){ | |
if(TigerPlanFeeds[k].TigerItems != undefined){ | |
TigerPlanFeeds[k].TigerItems = data[dataKey].value; | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
}); | |
} | |
} | |
//Ends Here | |
animalsPoliceDataStore(data: any,planAdded) { | |
let that = this; | |
let animalsTalking= jQuery.extend(true,[],that.animalStrategy); | |
let levelIndex=[],lastItem; | |
if(that.animalStrategy.animalsSeeing.length>0){ | |
for(let i=1; i<=that.animalStrategy.animalsSeeing.length; i++){ | |
if(that.animalStrategy.animalsSeeing[i-1].operationType !== "animalsDryer"){ | |
levelIndex.push(i-1); | |
} | |
} | |
lastItem = levelIndex[levelIndex.length-1]; //let lastItem = that.animalStrategy.animalsSeeing.length - 1; | |
} | |
else{ lastItem=-1;} | |
if (lastItem != -1) { | |
//setTimeout(function(){ | |
if ((that.animalStrategy.animalsSeeing[lastItem].categoryDesc.toUpperCase().trim() === data.categoryDesc.toUpperCase()) && (that.animalStrategy.animalsSeeing[lastItem].operationType !== "animalsDryer")) { | |
that.animalStrategy.animalsSeeing[lastItem].TigerPlans.push(data.TigerPlans[0]); | |
let firstIndex = that.animalStrategy.animalsSeeing.length - 1;; | |
let secondIndex = that.animalStrategy.animalsSeeing[lastItem].TigerPlans.length - 1; | |
let thirdIndex = secondIndex-1; | |
$('#collapseOne_'+ firstIndex)["collapse"]('show'); | |
$('#btnanimalsPolice_' + firstIndex + '_' + secondIndex).addClass('actionanimalsJeansd'); | |
setTimeout(function() { | |
/*$("#lv_" + firstIndex + '_' + secondIndex).parent().addClass("selectedActive"); | |
$("#lv_" + firstIndex + '_' + 0).parent().removeClass("selectedActive"); | |
$("#lv_" + firstIndex + '_' + thirdIndex).parent().removeClass("selectedActive");*/ | |
$("#lv_" + firstIndex + '_' + secondIndex).addClass("selectedActive"); | |
that.animalStrategy.animalsEar = "lv_" + firstIndex + '_' + secondIndex; | |
that.TigerLeftTab.setSelectedId(that.animalStrategy.animalsEar); | |
$("#lv_" + firstIndex + '_' + 0).removeClass("selectedActive"); | |
$("#lv_" + firstIndex + '_' + thirdIndex).removeClass("selectedActive"); | |
that.onInitanimalsPPO(firstIndex, secondIndex); | |
that.onInitTimepicker(firstIndex, secondIndex); | |
let destinationEvent= jQuery.extend(true, [], that.animalStrategy); | |
if(planAdded=="planNamedeathAlive"){ | |
that.setEventUndo(animalsTalking,destinationEvent,firstIndex,secondIndex,"planNamedeathAlive",that); | |
}else{ | |
let extraValue={ | |
"iscollapse":false, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
} | |
}, 100); | |
} else { | |
that.animalStrategy.animalsSeeing.push(data); | |
let firstIndex = that.animalStrategy.animalsSeeing.length - 1; | |
/*$('#btnanimalsPolice_' + firstIndex + '_' + 0).parent().addClass('actionanimalsJeansd'); | |
setTimeout(function() { | |
$("#lv_" + firstIndex + '_' + 0).parent().addClass("selectedActive"); | |
that.onInitanimalsPPO(firstIndex, 0); | |
that.onInitTimepicker(firstIndex, 0); | |
}, 100);*/ | |
$('#btnanimalsPolice_' + firstIndex + '_' + 0).addClass('actionanimalsJeansd'); | |
setTimeout(function() { | |
$("#lv_" + firstIndex + '_' + 0).addClass("selectedActive"); | |
that.animalStrategy.animalsEar = "lv_" + firstIndex+ '_' + 0; | |
that.TigerLeftTab.setSelectedId(that.animalStrategy.animalsEar); | |
that.onInitanimalsPPO(firstIndex, 0); | |
that.onInitTimepicker(firstIndex, 0); | |
let destinationEvent= jQuery.extend(true, [], that.animalStrategy); | |
if(planAdded=="planNamedeathAlive"){ | |
that.setEventUndo(animalsTalking,destinationEvent,firstIndex,0,"planNamedeathAlive",that); | |
}else{ | |
let extraValue={ | |
"iscollapse":false, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
} | |
}, 100); | |
} | |
} else { | |
that.animalStrategy.animalsSeeing.push(data); | |
let firstIndex = that.animalStrategy.animalsSeeing.length - 1; | |
//$('#btnanimalsPolice_' + firstIndex + '_' + 0).parent().addClass('actionanimalsJeansd'); | |
$('#btnanimalsPolice_' + firstIndex + '_' + 0).addClass('actionanimalsJeansd'); | |
setTimeout(function() { | |
that.onInitanimalsPPO(firstIndex, 0); | |
that.onInitTimepicker(firstIndex, 0); | |
let destinationEvent= jQuery.extend(true, [], that.animalStrategy); | |
if(planAdded=="planNamedeathAlive"){ | |
that.setEventUndo(animalsTalking,destinationEvent,firstIndex,0,"planNamedeathAlive",that); | |
}else{ | |
let extraValue={ | |
"iscollapse":false, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
} | |
}, 100); | |
} | |
//that.animalsAliveDeathSet(firstIndex,0,that.animalStrategy.animalsSeeing,that.animalsInternet); | |
that.animalsInternet = jQuery.extend(true,[],that.animalStrategy.animalsSeeing); | |
} | |
animalsPoliceDataStoreForCopyPlan(data: any) { | |
let that = this; | |
for (var i = 0; i < data.length; i++) { | |
let lastItem = that.animalStrategy.animalsSeeing.length - 1; | |
if (lastItem != -1) { | |
//setTimeout(function(){ | |
if (that.animalStrategy.animalsSeeing[lastItem].categoryDesc.toUpperCase().trim() === data[i].categoryDesc.toUpperCase()) { | |
that.animalStrategy.animalsSeeing[lastItem].TigerPlans.push(data[i].TigerPlans[0]); | |
let firstIndex = that.animalStrategy.animalsSeeing.length - 1; | |
let secondIndex = that.animalStrategy.animalsSeeing[lastItem].TigerPlans.length - 1; | |
$('#btnanimalsPolice_' + firstIndex + '_' + secondIndex).addClass('actionanimalsJeansd'); | |
setTimeout(function() { | |
that.onInitanimalsPPO(firstIndex, secondIndex); | |
that.onInitTimepicker(firstIndex, secondIndex); | |
}, 100); | |
} else { | |
that.animalStrategy.animalsSeeing.push(data[i]); | |
let firstIndex = that.animalStrategy.animalsSeeing.length - 1; | |
$('#btnanimalsPolice_' + firstIndex + '_' + 0).addClass('actionanimalsJeansd'); | |
setTimeout(function() { | |
that.onInitanimalsPPO(firstIndex, 0); | |
that.onInitTimepicker(firstIndex, 0); | |
}, 100); | |
} | |
} else { | |
that.animalStrategy.animalsSeeing.push(data[i]); | |
let firstIndex = that.animalStrategy.animalsSeeing.length - 1; | |
$('#btnanimalsPolice_' + firstIndex + '_' + 0).addClass('actionanimalsJeansd'); | |
setTimeout(function() { | |
that.onInitanimalsPPO(firstIndex, 0); | |
that.onInitTimepicker(firstIndex, 0); | |
}, 100); | |
} | |
} | |
} | |
auditOptions(data){ | |
this.auditFlag=true; | |
this.Tigercrow.targetvalue=data.target.value; | |
this.Tigercrow.changevalue=this.auditFlag; | |
this.Tigercrow.auditOptions(); | |
} | |
auditChangeOptions(data){ | |
this.auditFlag=data.target.checked; | |
this.Tigercrow.changevalue=this.auditFlag; | |
this.Tigercrow.auditOptions(); | |
} | |
storedanimalsTyphoidlValues(animalsDots: any):any{ | |
let that = this; | |
let animalsTyphoidlValues = {"animalsBirthDay":"","animalsDeathDay":"","animalsShaking":"","animalsUnderstanding":""}; | |
let findId = animalsDots.substr(animalsDots.indexOf("_") + 1); | |
if(!isNaN(findId)){ | |
animalsTyphoidlValues.animalsBirthDay = that.animalStrategy.animalsSeeing[findId]['animalsBirthDay']; | |
animalsTyphoidlValues.animalsDeathDay = that.animalStrategy.animalsSeeing[findId]['animalsDeathDay']; | |
animalsTyphoidlValues.animalsShaking = that.animalStrategy.animalsSeeing[findId]['animalsShaking']; | |
animalsTyphoidlValues.animalsUnderstanding = that.animalStrategy.animalsSeeing[findId]['animalsUnderstanding']; | |
} | |
return animalsTyphoidlValues; | |
} | |
onInitanimalsPPO(id:any,id1:any){ | |
let that = this; | |
$('#animalsBirthDay_'+id+'_'+id1).animalsTension({ | |
min: new Date(1000, 0, 1), max: new Date(3000, 11, 31), | |
format: "MM/dd/yyyy", parseFormats: ["MM/dd/yyyy"], | |
change(e){ | |
let a = this.value(); | |
let animalsDots = this.element[0].id; | |
let findId = animalsDots.substr(animalsDots.indexOf("_") + 1); | |
var animalsGiveUp = findId.split("_"); | |
var firstIndex = animalsGiveUp[0]; | |
var secondIndex = animalsGiveUp[1]; | |
//that.animalStrategy.animalsSeeing.animalsBirthDay=this._oldText; | |
//that.animalStrategy.animalsSeeing[firstIndex].TigerPlans[secondIndex].animalsBirthDay = this._oldText; | |
//that.animalsPoliceFieldNganimalsTyphoidl(this.value(),firstIndex,secondIndex,"animalsBirthDay_",that.animalStrategy.animalsSeeing,"animalsBirthDay","MM/dd/yyyy"); | |
//let dataStored = that.storedanimalsTyphoidlValues(this.element[0].id); | |
that.datechangeStart(that.animalStrategy.animalsSeeing,firstIndex,secondIndex); | |
} | |
}); | |
$('#animalsDeathDay_'+id+'_'+id1).animalsTension({ | |
min: new Date(1000, 0, 1), max: new Date(3000, 11, 31), | |
format: "MM/dd/yyyy", parseFormats: ["MM/dd/yyyy"], | |
change(e){ | |
//that.animalStrategy.animalsSeeing.animalsDeathDay=this._oldText; | |
let a = this.value(); | |
let animalsDots = this.element[0].id; | |
let findId = animalsDots.substr(animalsDots.indexOf("_") + 1); | |
var animalsGiveUp = findId.split("_"); | |
var firstIndex = animalsGiveUp[0]; | |
var secondIndex = animalsGiveUp[1]; | |
//that.animalStrategy.animalsSeeing[firstIndex].TigerPlans[secondIndex].animalsDeathDay = this._oldText; | |
//that.animalsPoliceFieldNganimalsTyphoidl(this.value(),firstIndex,secondIndex,"animalsDeathDay_",that.animalStrategy.animalsSeeing,"animalsDeathDay","MM/dd/yyyy"); | |
//let dataStored = that.storedanimalsTyphoidlValues(this.element[0].id); | |
that.datechangeEnd(that.animalStrategy.animalsSeeing,firstIndex,secondIndex); | |
} | |
}); | |
} | |
onInitTimepicker(id:any,id1:any){ | |
let that=this; | |
let animalsShaking = $('#animalsShaking_'+id+'_'+id1).kendoTimePicker({ | |
format: "hh:mm:ss tt", | |
interval: 60, | |
min: new Date(2000, 0, 1, 5, 0, 0), | |
max: new Date(3000, 11, 31, 4, 0, 0), | |
parseFormats: ["hh:mm:ss tt"], | |
change(e){ | |
//that.pickerTimeChnage('#animalsShaking_'+id+'_'+id1); | |
//that.animalStrategy.animalsSeeing.animalsShaking=this._oldText; | |
let a = this.value(); | |
let animalsDots = this.element[0].id; | |
let findId = animalsDots.substr(animalsDots.indexOf("_") + 1); | |
var animalsGiveUp = findId.split("_"); | |
var firstIndex = animalsGiveUp[0]; | |
var secondIndex = animalsGiveUp[1]; | |
//that.animalStrategy.animalsSeeing[firstIndex].TigerPlans[secondIndex].animalsShaking = this._oldText; | |
//that.animalsPoliceFieldNganimalsTyphoidl(this.value(),firstIndex,secondIndex,"animalsShaking_",that.animalStrategy.animalsSeeing,"animalsShaking","hh:mm:ss tt"); | |
//let dataStored = that.storedanimalsTyphoidlValues(this.element[0].id); | |
that.timeChangeStart(that.animalStrategy.animalsSeeing,firstIndex,secondIndex); | |
} | |
}); | |
let animalsUnderstanding = $('#animalsUnderstanding_'+id+'_'+id1).kendoTimePicker({ | |
format: "hh:mm:ss tt", | |
interval: 60, | |
parseFormats: ["hh:mm:ss tt"], | |
min: new Date(2000, 0, 1, 5, 0, 0), | |
max: new Date(3000, 11, 31, 4, 0, 0), | |
change(e){ | |
//that.pickerTimeChnage('#animalsUnderstanding_'+id+'_'+id1); | |
//that.animalStrategy.animalsSeeing.animalsUnderstanding=this._oldText; | |
let a = this.value(); | |
let animalsDots = this.element[0].id; | |
let findId = animalsDots.substr(animalsDots.indexOf("_") + 1); | |
var animalsGiveUp = findId.split("_"); | |
var firstIndex = animalsGiveUp[0]; | |
var secondIndex = animalsGiveUp[1]; | |
//that.animalStrategy.animalsSeeing[firstIndex].TigerPlans[secondIndex].animalsUnderstanding = this._oldText; | |
//that.animalsPoliceFieldNganimalsTyphoidl(this.value(),firstIndex,secondIndex,"animalsUnderstanding_",that.animalStrategy.animalsSeeing,"animalsUnderstanding","hh:mm:ss tt"); | |
//let dataStored = that.storedanimalsTyphoidlValues(this.element[0].id); | |
that.timeChangeEnd(that.animalStrategy.animalsSeeing,firstIndex,secondIndex); | |
} | |
}); | |
} | |
sameDayValidation(plananimalsShaking,plananimalsUnderstanding,id,id1,controlFrom): any { | |
// if ET < "05:00:00 AM" && ST > "01:00:00 AM" | |
let isValidTime = false; | |
if (kendo.parseDate(plananimalsUnderstanding) >= kendo.parseDate("12:00:00 AM")) { | |
//$("#saveEventAction").removeClass('actionanimalsJeansd'); | |
//checking between 12am to 5 am | |
if (kendo.parseDate(plananimalsShaking) >= kendo.parseDate("12:00:00 AM") | |
&& kendo.parseDate(plananimalsShaking) < kendo.parseDate("05:00:00 AM") | |
&& kendo.parseDate(plananimalsUnderstanding) < kendo.parseDate("05:00:00 AM") | |
&& kendo.parseDate(plananimalsUnderstanding) > kendo.parseDate("12:00:00 AM") | |
) { | |
if (kendo.parseDate(plananimalsShaking) < kendo.parseDate(plananimalsUnderstanding)) { | |
isValidTime = true; | |
} | |
} | |
// checking between (start time)4am to 12 and (ent time) bw 12 to 5am | |
else if (kendo.parseDate(plananimalsShaking) < kendo.parseDate("11:59:59 PM") | |
&& kendo.parseDate(plananimalsShaking) >= kendo.parseDate("05:00:00 AM") | |
&& kendo.parseDate(plananimalsUnderstanding) < kendo.parseDate("05:00:00 AM") | |
&& kendo.parseDate(plananimalsUnderstanding) >= kendo.parseDate("12:00:00 AM")) { | |
isValidTime = true; | |
} | |
} | |
// checking between 5am to 12 | |
if (kendo.parseDate(plananimalsUnderstanding) < kendo.parseDate("11:59:59 PM") | |
&& kendo.parseDate(plananimalsShaking) >= kendo.parseDate("05:00:00 AM")) { | |
if (kendo.parseDate(plananimalsShaking) < kendo.parseDate(plananimalsUnderstanding)) { | |
isValidTime = true; | |
} | |
} | |
if(isValidTime){ | |
this.clearFields(id+"_"+id1); | |
}else{ | |
if(controlFrom == "st"){ | |
$("#stError_"+id+"_"+id1).addClass('mandatoryField'); | |
}else if(controlFrom == "et"){ | |
$("#etError_"+id+"_"+id1).addClass('mandatoryField'); | |
}else if(controlFrom == "sd"){ | |
$("#animalsHMO_"+id+"_"+id1).addClass('mandatoryField'); | |
}else if(controlFrom == "ed"){ | |
$("#edError_"+id+"_"+id1).addClass('mandatoryField'); | |
} | |
$('#btnanimalsPolice_'+id+'_'+id1).addClass('actionanimalsJeansd'); | |
//$("#saveEventAction").addClass('actionanimalsJeansd'); | |
} | |
/* */ | |
//else if "12:10:00 AM" < "12:20:00 AM" | |
} | |
animalsPoliceFieldNganimalsTyphoidl(selectedVal: any, firstIndex: any, secondIndex: any, replaceStr: string,animalsTyphoidlArray: any,animalsTyphoidlField: string,format:string){ | |
animalsTyphoidlArray[firstIndex].TigerPlans[secondIndex].animalsTyphoidlField = kendo.toString(new Date(selectedVal), format); | |
/*if(!isNaN(findId)){ | |
animalsTyphoidlArray[findId][animalsTyphoidlField] = kendo.toString(new Date(selectedVal), format); | |
}*/ | |
} | |
animalsPoliceCheckboxNganimalsTyphoidl(whale:any,timeZone:any){ | |
/*var isChecked = false; | |
if(whale.TigerPlanFeeds){ | |
for(var i=0; i<whale.TigerPlanFeeds.length;i++){ | |
if(whale.TigerPlanFeeds[i].feedName.toUppercase().trim() === timeZone){ | |
isChecked = true; | |
} | |
} | |
}else{ | |
isChecked = false; | |
} | |
return isChecked; */ | |
} | |
animalsFever(data){ | |
var regex = /(<([^>]+)>)/ig; | |
if(data != undefined || data != null){ | |
var removeHtmlTag=data.replace(regex, ""); | |
var removeSpace=removeHtmlTag.replace(/\ /g,''); | |
var finalData=removeSpace.replace(/\s/g,''); | |
if(finalData.length>0){ | |
return true | |
} | |
else{ | |
return false; | |
} | |
} | |
else{ | |
return false; | |
} | |
} | |
finalizereturnData(data){ | |
if(data != undefined || data != null){ | |
var dom = $("<p/>").html(data).html(); | |
var finalData=dom; | |
// console.log(data); | |
// console.log(finalData); | |
return finalData; | |
} | |
} | |
animalsDryerPlansItem(id:number,id1:number,event){ | |
event.stopPropagation(); | |
let that=this; | |
var status=false; | |
let data; | |
if(this.animalStrategy.animalsSeeing.length>0){ | |
if(this.animalStrategy.animalsSeeing[id].operationType!='animalsDryer'){ | |
if(this.animalStrategy.animalsSeeing[id].categoryOpIssue.issueDesc!='' && this.animalStrategy.animalsSeeing[id].categoryOpIssue.issueDesc!= "undefined"){ | |
data=this.animalStrategy.animalsSeeing[id].categoryOpIssue.issueDesc; | |
if(data==null){ | |
if($('#lv_'+id+'_feedTextarea').length>0){ | |
data=$('#lv_'+id+'_feedTextarea').html(); | |
} | |
} | |
if(that.animalsFever(data)==true){ | |
status=true; | |
} | |
} | |
if(this.animalStrategy.animalsSeeing[id].TigerPlans.length>0){ | |
if(this.animalStrategy.animalsSeeing[id].TigerPlans[id1].operationType != "animalsDryer" ){ | |
if(this.animalStrategy.animalsSeeing[id].TigerPlans[id1].planOpIssue.issueDesc!='' && this.animalStrategy.animalsSeeing[id].TigerPlans[id1].planOpIssue.issueDesc!= "undefined"){ | |
var newCreateData=this.animalStrategy.animalsSeeing[id].TigerPlans[id1].planOpIssue.issueDesc; | |
if(newCreateData==null){ | |
if($('#lv_'+id+'_'+id1+'_feedTextarea').length>0){ | |
newCreateData=$('#lv_'+id+'_'+id1+'_feedTextarea').html(); | |
} | |
} | |
if(typeof(newCreateData) == "undefined" ){ | |
status= false; | |
} | |
else{ | |
if(that.animalsFever(newCreateData)==true){ | |
status=true; | |
} | |
} | |
} | |
for(let c=0;c<this.animalStrategy.animalsSeeing[id].TigerPlans[id1].TigerPlanFeeds.length;c++){ | |
if(this.animalStrategy.animalsSeeing[id].TigerPlans[id1].TigerPlanFeeds[c].operationType != "animalsDryer"){ | |
if(this.animalStrategy.animalsSeeing[id].TigerPlans[id1].TigerPlanFeeds[c].feedOpIssue.issueDesc!='' && this.animalStrategy.animalsSeeing[id].TigerPlans[id1].TigerPlanFeeds[c].feedOpIssue.issueDesc!= "undefined"){ | |
var newCreateData=this.animalStrategy.animalsSeeing[id].TigerPlans[id1].TigerPlanFeeds[c].feedOpIssue.issueDesc; | |
if(newCreateData==null){ | |
if($('#lv_'+id+'_'+id1+'_'+c+'_feedTextarea').length>0){ | |
newCreateData=$('#lv_'+id+'_'+id1+'_'+c+'_feedTextarea').html(); | |
} | |
} | |
if(typeof(newCreateData) == "undefined" ){ | |
status= false; | |
} | |
else{ | |
if(that.animalsFever(newCreateData)==true){ | |
status=true; | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
if(status==false) { | |
that.confirmDialog("This will animalsDryer the plan",id,id1); | |
} | |
else{ | |
that.confirmDialog("This will animalsDryer the Plan and Contingency Text",id,id1); | |
} | |
} | |
categoryDD(category:any,id:any,id1: any,oldCategory:any){ | |
this.preSelectedCategory = oldCategory.animalsNokia; | |
var isError = this.isFieldError(id+"_"+id1); | |
if(isError){ | |
//$("#btnanimalsPolice_"+id).prop('animalsJeansd', true); | |
$('#btnanimalsPolice_' +id+'_'+id1).addClass('actionanimalsJeansd'); | |
}else{ | |
//$("#btnanimalsPolice_"+id).prop('animalsJeansd', false); | |
$('#btnanimalsPolice_' +id+'_'+id1).removeClass('actionanimalsJeansd'); | |
} | |
} | |
selectedCheckbox(selectedIdChk: any, plansItem:any,planRowId:any,id1:any,isChecked:any,currentPlan:any){ | |
let that = this; | |
this.animalsPolicedeathAliveSource={ | |
"id":planRowId, | |
"id1":id1, | |
"animalStrategy":this.animalStrategy, | |
}; | |
var isError = this.isFieldError(planRowId+"_"+id1); | |
if(isError){ | |
//$("#btnanimalsPolice_"+planRowId+"_"+id1).prop('animalsJeansd', true); | |
$('#btnanimalsPolice_'+planRowId+'_'+id1).addClass('actionanimalsJeansd'); | |
}else{ | |
//$("#btnanimalsPolice_"+planRowId+"_"+id1).prop('animalsJeansd', false); | |
$('#btnanimalsPolice_'+planRowId+'_'+id1).removeClass('actionanimalsJeansd'); | |
} | |
//To Enable the Popup Dialog Box push the event status into delanimalsPoliceTZ variable | |
//Will used in animalsPoliceTiger Function | |
//that.backUpTZChk = jQuery.extend(true, [], that.animalStrategy.animalsSeeing); | |
let feedAvailable=false; | |
if(currentPlan.TigerPlanFeeds.length==0){ | |
this.delanimalsPoliceTZ.push(true); | |
}else { | |
for (let i=0;i<currentPlan.TigerPlanFeeds.length;i++){ | |
let selIntID=parseInt(selectedIdChk); | |
selIntID=selIntID+10; | |
if(currentPlan.TigerPlanFeeds[i].animalHumming == selIntID){ | |
if(currentPlan.TigerPlanFeeds[i].isFeedAvailable) | |
feedAvailable=true; | |
} | |
//If All Check box is TimeZone is UNCHECKED | |
if(selIntID == 15){ | |
if(currentPlan.TigerPlanFeeds[i].isFeedAvailable) | |
feedAvailable=true; | |
} | |
// | |
} | |
if(feedAvailable){ | |
this.delanimalsPoliceTZ[selectedIdChk]=isChecked; | |
} | |
} | |
/// | |
if(selectedIdChk === '5'){ | |
if(isChecked){ | |
currentPlan.ET =true; | |
currentPlan.CT = true; | |
currentPlan.MT = true; | |
currentPlan.PT = true; | |
}else{ | |
currentPlan.ET =false; | |
currentPlan.CT = false; | |
currentPlan.MT = false; | |
currentPlan.PT = false; | |
if(currentPlan.TigerPlanFeeds.length ==0 && feedAvailable == false){ | |
this.delanimalsPoliceTZ[selectedIdChk] = true; | |
} | |
} | |
} | |
else{ | |
//that.animalStrategy.animalsSeeing[planRowId]['ALL'] = false; | |
} | |
if(currentPlan.ET && currentPlan.MT && currentPlan.PT && currentPlan.CT){ | |
currentPlan.ALL = true; | |
} | |
else{ | |
currentPlan.ALL = false; | |
} | |
} | |
animalsPoliceCheckBoxFieldNganimalsTyphoidl(selectedVal: any,animalsDots: any, replaceStr: string,animalsTyphoidlArray: any,animalsTyphoidlField: string){ | |
animalsTyphoidlArray[animalsDots][animalsTyphoidlField] = selectedVal; | |
return animalsTyphoidlArray; | |
} | |
isExpectedPresent():boolean{ | |
let that = this; | |
for(var j = 0 ; j < this.animalStrategy.animalsSeeing.length ;j++){ | |
if(this.animalStrategy.animalsSeeing[j].categoryDesc.toUpperCase().trim() === "EXPECTED" && this.animalStrategy.animalsSeeing[j].TigerPlans.length !== 0 && this.animalStrategy.animalsSeeing[j].operationType !== "animalsDryer"){ | |
return true; | |
} | |
} | |
return false; | |
} | |
animalsPoliceTiger(id:any,id1:any){ | |
this.callanimalsPoliceTiger(id,id1,this.animalStrategy,false); | |
// this.animalsAliveDeath.push(copy); | |
} | |
animalsAliveDeathSet(id:any,id1:any,destinationData,sourceData){ | |
let animalsTalking={ | |
"id":id, | |
"id1":id1, | |
"animalStrategy":sourceData, | |
}; | |
let destinationEvent={ | |
"id":id, | |
"id1":id1, | |
"animalStrategy":destinationData, | |
}; | |
let passData={ | |
"type": "animalsAliveDeath", | |
"animalsTalking":animalsTalking, | |
"destinationEvent": destinationEvent, | |
"initialValue": this.animalsAliveDeath[this.animalsAliveDeath.length-1], | |
"occurence": {}, | |
"action": "animalsAliveDeath" | |
}; | |
//let copy2 = Object.assign({}, passData); | |
this.animalsSwimmingAllRecordedNight(passData); | |
} | |
animalsAliveDeathFn(obj:any){ | |
let id=obj.id; | |
let id1=obj.id1; | |
let animalStrategy=obj.animalStrategy; | |
//this.animalStrategy=obj.animalStrategy; | |
// | |
//this.animalsJet(); | |
//this.TigerGroupingResources(this.animalStrategy.animalsSeeing[id].TigerPlans[id1],id,id1); | |
//this.loadTigerDataByDefault(animalStrategy[id].TigerPlans[id1],id,id1); | |
this.callanimalsPoliceTiger(id,id1,this.animalStrategy,true); | |
this.loadPreviousPlanDataUndo(animalStrategy[id].TigerPlans[id1],id,id1); | |
//let that = this; | |
//this.animalsJet(); | |
} | |
timeTo12HrFormat(time) | |
{ | |
var time_part_array = time.split(":"); | |
if (time_part_array[0] > 12) { | |
time_part_array[0] = time_part_array[0] - 12; | |
if(time_part_array[0] < 10) | |
{ | |
time_part_array[0] = "0" + time_part_array[0]; | |
} | |
} | |
var formatted_time = time_part_array[0] + ':' + time_part_array[1] + ':' + time_part_array[2]; | |
return formatted_time; | |
} | |
timeTo24HrsFormat(time:any){ | |
var hours = Number(time.match(/^(\d+)/)[1]); | |
var minutes = Number(time.match(/:(\d+)/)[1]); | |
var AMPM = time.match(/\s(.*)$/)[1]; | |
if (AMPM == "PM" && hours < 12) hours = hours + 12; | |
if (AMPM == "AM" && hours == 12) hours = hours - 12; | |
var sHours = hours.toString(); | |
var sMinutes = minutes.toString(); | |
if (hours < 10) sHours = "0" + sHours; | |
if (minutes < 10) sMinutes = "0" + sMinutes; | |
return (sHours +':'+sMinutes+':00'); | |
} | |
callanimalsPoliceTiger(id:any,id1:any,animalStrategyPresent:any,isUndo){ | |
let that = this; | |
let selectedanimalsNokia = $("#selectCategory_"+id+"_"+id1).val(); | |
let isPlanOutofRange = false; | |
if(selectedanimalsNokia == 1){ | |
let that = this; | |
if(selectedanimalsNokia == 1 && that.animalStrategy.animalsSeeing.length !== 1){ | |
let isExpectedCount=0; | |
let selectedCategoryName = that.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsNokia; | |
for(var k = 0 ; k < that.animalStrategy.animalsSeeing.length ;k++){ | |
for(let m=0;m<that.animalStrategy.animalsSeeing[k].TigerPlans.length;m++){ | |
if(selectedCategoryName !==1 && that.animalStrategy.animalsSeeing[k].TigerPlans[m].animalsNokia == 1 && that.animalStrategy.animalsSeeing[k].TigerPlans[m].operationType !== 'animalsDryer'){ | |
animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsNokia = selectedCategoryName; | |
that.setDialog("An Expected Plan already exists in this Event."); | |
$('#btnanimalsPolice_' + id + '_' + id1).addClass('actionanimalsJeansd'); | |
$("#selectCategory_"+id+"_"+id1).val(animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsNokia); | |
return; | |
} | |
} | |
} | |
} | |
let selectedPlananimalsShaking = $("#animalsShaking_"+id+"_"+id1).val();//animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsShaking; | |
let selectedPlan24hrsanimalsShaking = that.timeTo24HrsFormat($("#animalsShaking_"+id+"_"+id1).val())//that.timeTo24HrsFormat(animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsShaking); | |
let selectedPlananimalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val()+' '+selectedPlananimalsShaking;//animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsBirthDay+' '+selectedPlananimalsShaking; | |
let selectedPlananimalsUnderstanding = $("#animalsUnderstanding_"+id+"_"+id1).val();//animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsUnderstanding; | |
let selectedPlan24hrsanimalsUnderstanding = that.timeTo24HrsFormat($("#animalsUnderstanding_"+id+"_"+id1).val());//that.timeTo24HrsFormat(animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsUnderstanding); | |
let selectedPlananimalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val()+' '+selectedPlananimalsUnderstanding; //animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsDeathDay+' '+selectedPlananimalsUnderstanding; | |
let action = "contingencyplans/v1/expectedPlanOverlaps"; | |
let type = "post"; | |
let data ={ | |
"animalsShaking":selectedPlan24hrsanimalsShaking, | |
"animalsUnderstanding":selectedPlan24hrsanimalsUnderstanding, | |
"animalsBirthDay":selectedPlananimalsBirthDay, | |
"animalsDeathDay":selectedPlananimalsDeathDay, | |
"animalStamina":this.animalStamina, | |
"checkExpectedExistForSameEvent" : "N", | |
"networkNo" : "101" | |
}; | |
that.progress.requestStart(); | |
that.animalService.getResponse(action, type, data) | |
.subscribe(data => { | |
if(data.code == 'S500'){ | |
that.callanimalsPolicePlan(id,id1,animalStrategyPresent,isUndo); | |
}else if(data.code == 'E500'){ | |
this.expectedDetails = data.details; | |
//Issue Fixed - CR-18586 - Observation 2 | |
isPlanOutofRange = that.validatePlanOutofRange(id,id1,animalStrategyPresent); | |
// | |
if(!isUndo) { | |
if(!isPlanOutofRange) | |
that.expectedDialog(id,id1,animalStrategyPresent,this.expectedDetails); | |
}else{ | |
that.callanimalsPolicePlan(id,id1,animalStrategyPresent,isUndo); | |
} | |
} | |
that.progress.requestEnd(); | |
}, err => { | |
that.setDialog("Undefined error, Please try again."); | |
that.progress.requestEnd(); | |
}); | |
}else{ | |
that.callanimalsPolicePlan(id,id1,animalStrategyPresent,isUndo); | |
} | |
//that.enableanimalsJeansSave(true) | |
} | |
validatePlanOutofRange(id:any,id1:any,animalStrategyPresent:any){ | |
let that = this; | |
// let selectedPlananimalsBirthDay = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsBirthDay; | |
// let selectedPlananimalsShaking = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsShaking; | |
let eventanimalsBirthDay = that.TigerLeftTab.ParrotanimalsBirthDay; | |
// let selectedPlananimalsDeathDay = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsDeathDay; | |
// let selectedPlananimalsUnderstanding = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsUnderstanding; | |
let selectedPlananimalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let selectedPlananimalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let selectedPlananimalsShaking = $("#animalsShaking_"+id+"_"+id1).val(); | |
let selectedPlananimalsUnderstanding = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
let eventanimalsDeathDay = that.TigerLeftTab.ParrotanimalsDeathDay; | |
let stTime = that.TigerLeftTab.ParrotanimalsShaking; | |
let animalsUnderstanding = that.TigerLeftTab.ParrotanimalsUnderstanding; | |
if(((Tigercrow.prototype.getNumberofDays(eventanimalsDeathDay,selectedPlananimalsDeathDay) -1) > 2) || ((Tigercrow.prototype.getNumberofDays(eventanimalsBirthDay,selectedPlananimalsBirthDay) -1) > 2)) | |
{ | |
// rohi code | |
if(((Tigercrow.prototype.getNumberofDays(eventanimalsDeathDay,selectedPlananimalsDeathDay) -1) > 2)) | |
{ | |
that.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsDeathDay=eventanimalsDeathDay; | |
} | |
if(((Tigercrow.prototype.getNumberofDays(eventanimalsBirthDay,selectedPlananimalsBirthDay) -1) > 2)) | |
{ | |
that.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsBirthDay=eventanimalsBirthDay; | |
} | |
// end | |
that.setDialogPlanDateRange(id,id1); | |
$('#btnanimalsPolice_' + id + '_' + id1).addClass('actionanimalsJeansd'); | |
//isPlanFallsOutside = true; | |
//isExpectedPresent = true; | |
return true; | |
} | |
} | |
callanimalsPolicePlan(id:any,id1:any,animalStrategyPresent:any,isUndo){ | |
let that = this; | |
let enableDialogPopup; | |
let plansLength = animalStrategyPresent.animalsSeeing.length; | |
let isExpectedPresent = false; | |
let isAirings = false; | |
let animalStrategy = animalStrategyPresent.animalsSeeing; | |
if(this.delanimalsPoliceTZ.length ===0){ | |
enableDialogPopup = true; | |
} | |
for(var i=0; i<this.delanimalsPoliceTZ.length; i++){ | |
if(this.delanimalsPoliceTZ[i] === false){ | |
enableDialogPopup = this.delanimalsPoliceTZ[i]; | |
} | |
} | |
this.delanimalsPoliceTZ = []; | |
let isPlanFallsOutside = false; | |
//Issue Fixed - CR-16268 | |
// let selectedPlananimalsBirthDay = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsBirthDay; | |
// let selectedPlananimalsShaking = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsShaking; | |
let eventanimalsBirthDay = that.TigerLeftTab.ParrotanimalsBirthDay; | |
// let selectedPlananimalsDeathDay = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsDeathDay; | |
// let selectedPlananimalsUnderstanding = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsUnderstanding; | |
let selectedPlananimalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let selectedPlananimalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let selectedPlananimalsShaking = $("#animalsShaking_"+id+"_"+id1).val(); | |
let selectedPlananimalsUnderstanding = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
let eventanimalsDeathDay = that.TigerLeftTab.ParrotanimalsDeathDay; | |
let stTime = that.TigerLeftTab.ParrotanimalsShaking; | |
let animalsUnderstanding = that.TigerLeftTab.ParrotanimalsUnderstanding; | |
if(((Tigercrow.prototype.getNumberofDays(eventanimalsDeathDay,selectedPlananimalsDeathDay) -1) > 2) || ((Tigercrow.prototype.getNumberofDays(eventanimalsBirthDay,selectedPlananimalsBirthDay) -1) > 2)) | |
{ | |
// rohi code | |
if(((Tigercrow.prototype.getNumberofDays(eventanimalsDeathDay,selectedPlananimalsDeathDay) -1) > 2)) | |
{ | |
that.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsDeathDay=eventanimalsDeathDay; | |
} | |
if(((Tigercrow.prototype.getNumberofDays(eventanimalsBirthDay,selectedPlananimalsBirthDay) -1) > 2)) | |
{ | |
that.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsBirthDay=eventanimalsBirthDay; | |
} | |
// end | |
that.setDialogPlanDateRange(id,id1); | |
$('#btnanimalsPolice_' + id + '_' + id1).addClass('actionanimalsJeansd'); | |
isPlanFallsOutside = true; | |
isExpectedPresent = true; | |
// setTimeout(function() { | |
// that.enableanimalsJeansSave(true); | |
// }, 1000); | |
return; | |
} | |
//Ends Here | |
let sch_plan_feeds = that.animalStrategy.animalsSeeing[id].TigerPlans[id1].TigerPlanFeeds; | |
let TigerPlananimalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let TigerPlananimalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let TigerPlananimalsShaking = $("#animalsShaking_"+id+"_"+id1).val(); | |
let TigerPlananimalsUnderstanding = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
/*let TigerPlananimalsBirthDay = that.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsBirthDay; | |
let TigerPlananimalsShaking = that.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsShaking; | |
let TigerPlananimalsDeathDay = that.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsDeathDay; | |
let TigerPlananimalsUnderstanding = that.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsUnderstanding; */ | |
//Condition to check prevData (that.animalsInternet) present for the selected plan | |
if(that.animalsInternet != undefined && that.animalsInternet.length > 0){ | |
if(that.animalsInternet[id] != undefined){ | |
if(that.animalsInternet[id].TigerPlans[id1] != undefined){ | |
let preTigerPlananimalsBirthDay = that.animalsInternet[id].TigerPlans[id1].animalsBirthDay; | |
let preTigerPlananimalsShaking = that.animalsInternet[id].TigerPlans[id1].animalsShaking; | |
let preTigerPlananimalsDeathDay = that.animalsInternet[id].TigerPlans[id1].animalsDeathDay; | |
let preTigerPlananimalsUnderstanding = that.animalsInternet[id].TigerPlans[id1].animalsUnderstanding; | |
//Condition to Check Airing while animalsPolice plan | |
// if((kendo.parseDate(TigerPlananimalsBirthDay + " " + TigerPlananimalsShaking).getTime() > (kendo.parseDate(preTigerPlananimalsBirthDay + " " + preTigerPlananimalsShaking).getTime())) || (kendo.parseDate(TigerPlananimalsDeathDay + " " + TigerPlananimalsUnderstanding).getTime() < (kendo.parseDate(preTigerPlananimalsDeathDay + " " + preTigerPlananimalsUnderstanding)).getTime()) ) | |
isAirings = true; | |
let animalsBirthDayTemp = new Date(TigerPlananimalsBirthDay + " " + TigerPlananimalsShaking); | |
let preanimalsBirthDayTemp = new Date(preTigerPlananimalsBirthDay + " " + preTigerPlananimalsShaking); | |
let animalsDeathDayTemp = new Date(TigerPlananimalsDeathDay + " " + TigerPlananimalsUnderstanding); | |
let preanimalsDeathDayTemp = new Date(preTigerPlananimalsDeathDay + " " + preTigerPlananimalsUnderstanding); | |
if(animalsBirthDayTemp.getHours() >= 5){ | |
animalsBirthDayTemp.setHours(animalsBirthDayTemp.getHours()-5); | |
}else{ | |
animalsBirthDayTemp.setHours(animalsBirthDayTemp.getHours()+19); | |
} | |
if(preanimalsBirthDayTemp.getHours() >= 5){ | |
preanimalsBirthDayTemp.setHours(preanimalsBirthDayTemp.getHours()-5); | |
}else{ | |
preanimalsBirthDayTemp.setHours(preanimalsBirthDayTemp.getHours()+19); | |
} | |
if(animalsDeathDayTemp.getHours() >= 5){ | |
animalsDeathDayTemp.setHours(animalsDeathDayTemp.getHours()-5); | |
}else{ | |
animalsDeathDayTemp.setHours(animalsDeathDayTemp.getHours()+19); | |
} | |
if(preanimalsDeathDayTemp.getHours() >= 5){ | |
preanimalsDeathDayTemp.setHours(preanimalsDeathDayTemp.getHours()-5); | |
}else{ | |
preanimalsDeathDayTemp.setHours(preanimalsDeathDayTemp.getHours()+19); | |
} | |
if((kendo.parseDate(TigerPlananimalsBirthDay + " " + TigerPlananimalsShaking).getTime() != (kendo.parseDate(preTigerPlananimalsBirthDay + " " + preTigerPlananimalsShaking).getTime()))){ | |
if(animalsBirthDayTemp > preanimalsBirthDayTemp){ | |
isAirings = true; | |
}else{ | |
isAirings = false; | |
} | |
} | |
if((kendo.parseDate(TigerPlananimalsDeathDay + " " + TigerPlananimalsUnderstanding).getTime() != (kendo.parseDate(preTigerPlananimalsDeathDay + " " + preTigerPlananimalsUnderstanding)).getTime()) ){ | |
if(animalsDeathDayTemp < preanimalsDeathDayTemp){ | |
isAirings = true; | |
}else{ | |
isAirings = false; | |
} | |
} | |
} | |
} | |
} | |
//Ends here | |
if(!isPlanFallsOutside){ | |
let selectedCategory = $("#selectCategory_"+id+"_"+id1).val(); | |
if(selectedCategory == 1 && animalStrategy.length !== 1){ | |
for(var k = 0 ; k < animalStrategy.length ;k++){ | |
if(id !== k){ | |
if(animalStrategy[k].animalsNokia == 1 && animalStrategy[k].operationType !== 'animalsDryer'){ | |
that.setDialog("An Expected Plan already exists in this Event."); | |
$("#selectCategory_"+id+"_"+id1).val(animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsNokia); | |
isExpectedPresent = true; | |
} | |
} | |
} | |
} | |
} | |
if(!isExpectedPresent){ | |
TigerPlananimalsBirthDay = TigerPlananimalsBirthDay + " " + TigerPlananimalsShaking; | |
TigerPlananimalsDeathDay = TigerPlananimalsDeathDay + " " + TigerPlananimalsUnderstanding; | |
let kendoanimalsBirthDayTime = new Date(TigerPlananimalsBirthDay); | |
let kendoanimalsDeathDayTime = new Date(TigerPlananimalsDeathDay); | |
if(kendoanimalsBirthDayTime.getHours() >= 5){ | |
kendoanimalsBirthDayTime.setHours(kendoanimalsBirthDayTime.getHours()-5); | |
}else{ | |
kendoanimalsBirthDayTime.setHours(kendoanimalsBirthDayTime.getHours()+19); | |
} | |
if(kendoanimalsDeathDayTime.getHours() >= 5){ | |
kendoanimalsDeathDayTime.setHours(kendoanimalsDeathDayTime.getHours()-5); | |
}else{ | |
kendoanimalsDeathDayTime.setHours(kendoanimalsDeathDayTime.getHours()+19); | |
} | |
let TigerPlanConfigData = that.Tigercrow.TigerPlanConfigData[id+'_'+id1]; | |
if(TigerPlanConfigData != undefined && TigerPlanConfigData.length >0 && isAirings){ | |
for(var i=0; i<TigerPlanConfigData.length; i++) { | |
if (!TigerPlanConfigData[i].includes("Tiger_Nat")) { | |
let animalAgeanimalsBirthDay:any = []; | |
let animalAgeanimalsDeathDay:any = []; | |
var animalAgeData = []; | |
if(that.Tigercrow._TigeranimalAge[TigerPlanConfigData[i]] !== undefined){ | |
animalAgeData = that.Tigercrow._TigeranimalAge[TigerPlanConfigData[i]]._data; | |
} | |
for(var j=0; j<animalAgeData.length; j++){ | |
var start = new Date(animalAgeData[j].start); | |
var end = new Date(animalAgeData[j].end); | |
if (TigerPlanConfigData[i].includes("Tiger_Est")) { | |
animalAgeanimalsBirthDay.push({"start":start}); | |
animalAgeanimalsDeathDay.push({"end":end}); | |
} else if (TigerPlanConfigData[i].includes("Tiger_Cent")) { | |
animalAgeanimalsBirthDay.push({"start":start}); | |
animalAgeanimalsDeathDay.push({"end":end}); | |
} else if (TigerPlanConfigData[i].includes("Tiger_Mount")) { | |
animalAgeanimalsBirthDay.push({"start":start}); | |
animalAgeanimalsDeathDay.push({"end":end}); | |
} else if (TigerPlanConfigData[i].includes("Tiger_Pacifi")) { | |
animalAgeanimalsBirthDay.push({"start":start}); | |
animalAgeanimalsDeathDay.push({"end":end}); | |
} | |
} | |
let cloneanimalsBirthDayanimalAge = new kendo.data.Query(animalAgeanimalsBirthDay); | |
let filteranimalsBirthDayData = cloneanimalsBirthDayanimalAge.filter({ | |
operator: "lt", | |
field: "start", | |
value: kendoanimalsBirthDayTime | |
}).data; | |
let cloneanimalsDeathDayanimalAge = new kendo.data.Query(animalAgeanimalsDeathDay); | |
let filteranimalsDeathDayData = cloneanimalsDeathDayanimalAge.filter({ | |
operator: "gt", | |
field: "end", | |
value: kendoanimalsDeathDayTime | |
}).data; | |
if(filteranimalsBirthDayData.length > 0 || filteranimalsDeathDayData.length >0 ){ | |
let selectedCategory = $("#selectCategory_"+id+"_"+id1).val(); | |
that.airingsConfirmDialog("This will animalsDryer airing(s) that fall outside new Plan range.", id, id1, animalStrategyPresent,selectedCategory,isUndo); | |
return; | |
} | |
} | |
} | |
} | |
/* for(var i =0 ; i<sch_plan_feeds.length ; i++){ | |
let TigerPlans = sch_plan_feeds[i]; | |
let animalAgeanimalsBirthDay:any = []; | |
let animalAgeanimalsDeathDay:any = []; | |
if(TigerPlans.TigerItems && TigerPlans.TigerItems.length > 0 && isAirings){ | |
for(var r=0; r<TigerPlans.TigerItems.length; r++){ | |
var start = new Date(TigerPlans.TigerItems[r].start); | |
var end = new Date(TigerPlans.TigerItems[r].end); | |
if(TigerPlans.TigerItems[r].animalHumming == 11){ | |
animalAgeanimalsBirthDay.push({"start":start}); | |
animalAgeanimalsDeathDay.push({"end":end}); | |
}else if(TigerPlans.TigerItems[r].animalHumming == 12){ | |
animalAgeanimalsBirthDay.push({"start":start}); | |
animalAgeanimalsDeathDay.push({"end":end}); | |
}else if(TigerPlans.TigerItems[r].animalHumming == 13){ | |
animalAgeanimalsBirthDay.push({"start":start}); | |
animalAgeanimalsDeathDay.push({"end":end}); | |
}else if(TigerPlans.TigerItems[r].animalHumming == 14){ | |
animalAgeanimalsBirthDay.push({"start":start}); | |
animalAgeanimalsDeathDay.push({"end":end}); | |
} | |
// | |
if(TigerPlans.TigerItems[r].animalHumming == 11){ | |
animalAgeanimalsBirthDay.push({"start":new Date(start.setHours(start.getHours()-5))}); | |
animalAgeanimalsDeathDay.push({"end":new Date(end.setHours(end.getHours()-5))}); | |
}else if(TigerPlans.TigerItems[r].animalHumming == 12){ | |
animalAgeanimalsBirthDay.push({"start":new Date(start.setHours(start.getHours()-4))}); | |
animalAgeanimalsDeathDay.push({"end":new Date(end.setHours(end.getHours()-4))}); | |
}else if(TigerPlans.TigerItems[r].animalHumming == 13){ | |
animalAgeanimalsBirthDay.push({"start":new Date(start.setHours(start.getHours()-3))}); | |
animalAgeanimalsDeathDay.push({"end":new Date(end.setHours(end.getHours()-3))}); | |
}else if(TigerPlans.TigerItems[r].animalHumming == 14){ | |
animalAgeanimalsBirthDay.push({"start":new Date(start.setHours(start.getHours()-2))}); | |
animalAgeanimalsDeathDay.push({"end":new Date(end.setHours(end.getHours()-2))}); | |
} | |
// | |
} | |
let cloneanimalsBirthDayanimalAge = new kendo.data.Query(animalAgeanimalsBirthDay); | |
let filteranimalsBirthDayData = cloneanimalsBirthDayanimalAge.filter({ | |
operator: "lt", | |
field: "start", | |
value: kendoanimalsBirthDayTime | |
}).data; | |
let cloneanimalsDeathDayanimalAge = new kendo.data.Query(animalAgeanimalsDeathDay); | |
let filteranimalsDeathDayData = cloneanimalsDeathDayanimalAge.filter({ | |
operator: "gt", | |
field: "end", | |
value: kendoanimalsDeathDayTime | |
}).data; | |
if(filteranimalsBirthDayData.length > 0 || filteranimalsDeathDayData.length >0 ){ | |
let selectedCategory = $("#selectCategory_"+id+"_"+id1).val(); | |
that.airingsConfirmDialog("This will animalsDryer airing(s) that fall outside new Plan range.", id, id1, animalStrategyPresent,selectedCategory); | |
return; | |
} | |
} | |
} | |
*/ | |
let animalsPoliceData; | |
if(enableDialogPopup === false) { | |
let animalsDryerTZConfirm = $("#animalsDryerTZConfirmDialog").data("animalsEatinGindow").center().open(); | |
$("#tZanimalsPoliceMsg").text("This will animalsDryer the TimeZone Grid"); | |
$('#animalsDryerTZConfirmDialog').prev().find(".alieNwindow-title").text("Fox"); | |
$("#animalsDryerTZYES").unbind().click(function() { | |
let planData = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1]; | |
let isanimalsCommunicationDataChanged = that.isanimalsCommunicationDataChanged(that.animalsInternet,id,id1); | |
//if the plan timings and date's are changed/modified means isanimalsCommunicationDataChanged will be true | |
if(isanimalsCommunicationDataChanged){ | |
that.plananimalsCommunicationanimalsPoliced(planData,id,id1, animalStrategyPresent,isUndo); | |
}else{ | |
that.plananimalsPolice(planData,id,id1, animalStrategyPresent,isUndo); | |
} | |
animalsDryerTZConfirm.close(); | |
}); | |
$("#animalsDryerTZNO").unbind().click(function() { | |
//console.log(that.animalsInternet); | |
that.loadPreviousPlanData(that.animalsInternet,id,id1); | |
animalsDryerTZConfirm.close(); | |
}); | |
}else if(typeof enableDialogPopup != undefined && enableDialogPopup != false){ | |
animalsPoliceData = true; | |
} | |
//that.animalStrategy.animalsSeeing[id].categoryDesc = that.animalStrategy.animalsSeeing[id]['name']; | |
//that.generateTiger("animalsCommunicationTiger_"+id); | |
if(animalsPoliceData){ | |
let that = this; | |
let planData = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1]; | |
let selectedCategory = $("#selectCategory_"+id+"_"+id1).val(); | |
if(that.animalsInternet != undefined){ | |
let isanimalsCommunicationDataChanged = that.isanimalsCommunicationDataChanged(that.animalsInternet,id,id1); | |
//if the plan timings and date's are changed/modified means isanimalsCommunicationDataChanged will be true | |
if(isanimalsCommunicationDataChanged){ | |
that.plananimalsCommunicationanimalsPoliced(planData,id,id1, animalStrategyPresent,isUndo); | |
}else{ | |
that.plananimalsPolice(planData,id,id1, animalStrategyPresent,isUndo); | |
} | |
} | |
} | |
} | |
//console.log(animalStrategyPresent); | |
this.enableanimalsJeansSave(false); | |
} | |
plananimalsPolice(planData:any,id:any,id1:any, animalStrategyPresent:any,isUndo:any){ | |
let that = this; | |
let TigerPlananimalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let TigerPlananimalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let TigerPlananimalsShaking = $("#animalsShaking_"+id+"_"+id1).val(); | |
let TigerPlananimalsUnderstanding = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
planData.animalsBirthDay = kendo.toString(kendo.parseDate(TigerPlananimalsBirthDay), "MM/dd/yyyy"); | |
planData.animalsDeathDay = kendo.toString(kendo.parseDate(TigerPlananimalsDeathDay), "MM/dd/yyyy"); | |
planData.animalsShaking = kendo.toString(kendo.parseDate(TigerPlananimalsShaking),"hh:mm:ss tt"); | |
planData.animalsUnderstanding = kendo.toString(kendo.parseDate(TigerPlananimalsUnderstanding), "hh:mm:ss tt"); | |
that.TigerGroupingResources(planData,id,id1); | |
that.Tigercrow.TigerId = 'Tiger_Nat_Main'; | |
if(that.animalsInternet != undefined){ | |
let extendPlanLength = that.animalsInternet.length; | |
$('#btnanimalsPolice_' + id + '_' + id1).addClass('actionanimalsJeansd'); | |
let selectedCategory = $("#selectCategory_"+id+"_"+id1).val(); | |
if((selectedCategory != that.animalsInternet[id].animalsNokia)){ | |
that.regroupanimalStrategy1(that.animalStrategy.animalsSeeing,id,id1,that.categoryType(selectedCategory),selectedCategory); | |
} | |
} | |
if(!isUndo){ | |
that.animalsAliveDeathSet(id,id1,animalStrategyPresent.animalsSeeing,that.animalsInternet); | |
} | |
that.animalsInternet = jQuery.extend(true,[],animalStrategyPresent.animalsSeeing); | |
that.animalsHello(); | |
that.delanimalsPoliceTZ = []; | |
} | |
plananimalsCommunicationanimalsPoliced(planData:any,id:any,id1:any, animalStrategyPresent:any,isUndo:any){ | |
let that = this; | |
let selectedanimalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let selectedanimalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let selectedanimalsShaking = $("#animalsShaking_"+id+"_"+id1).val(); | |
let selectedanimalsUnderstanding = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
let datas = { | |
"networks": [101], | |
"days": [0, 1, 2, 3, 4, 5, 6], | |
"animalsBirthDay": kendo.toString(new Date(selectedanimalsBirthDay), 'yyyy-MM-dd'), | |
"animalsDeathDay": kendo.toString(new Date(selectedanimalsDeathDay), 'yyyy-MM-dd'), | |
"animalsShaking": that.convertTo24HouranimalsCommunication(selectedanimalsShaking), | |
"animalsUnderstanding": that.convertTo24HouranimalsCommunication(selectedanimalsUnderstanding), | |
"type": "NE", | |
"strTime": selectedanimalsShaking, | |
"endEveTime": selectedanimalsUnderstanding | |
}; | |
let action = "Tigers/v1/Tigers"; | |
that.progress.requestStart(); | |
that.animalService.getResponse(action, 'post', datas).subscribe(data => { | |
let decompressedData = that.decompressJsonResponse(data.zipdata); | |
if (decompressedData.code == "S304") { | |
//console.log(decompressedData); | |
let decompressedData = that.decompressJsonResponse(data.zipdata); | |
var animalsCommunicationItems = jQuery.extend(true,[],decompressedData.Tigers.TigerItems); | |
if(that.backupDataOrg.TigerEvent.TigerPlanCategories){ | |
for(var t=0;t<that.backupDataOrg.TigerEvent.TigerPlanCategories.length;t++){ | |
for(var s=0;s<that.backupDataOrg.TigerEvent.TigerPlanCategories[t].TigerPlans.length;s++){ | |
that.backupDataOrg.TigerEvent.TigerPlanCategories[t].TigerPlans[s].animalsCommunicationItems = animalsCommunicationItems; | |
} | |
} | |
} | |
animalStrategyPresent.animalsSeeing[id].TigerPlans[id1].animalsCommunicationItems=decompressedData.Tigers.TigerItems; | |
let TigerPlananimalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let TigerPlananimalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let TigerPlananimalsShaking = $("#animalsShaking_"+id+"_"+id1).val(); | |
let TigerPlananimalsUnderstanding = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
planData.animalsBirthDay = kendo.toString(kendo.parseDate(TigerPlananimalsBirthDay), "MM/dd/yyyy"); | |
planData.animalsDeathDay = kendo.toString(kendo.parseDate(TigerPlananimalsDeathDay), "MM/dd/yyyy"); | |
planData.animalsShaking = kendo.toString(kendo.parseDate(TigerPlananimalsShaking),"hh:mm:ss tt"); | |
planData.animalsUnderstanding = kendo.toString(kendo.parseDate(TigerPlananimalsUnderstanding), "hh:mm:ss tt"); | |
that.TigerGroupingResources(planData,id,id1); | |
that.Tigercrow.TigerId = 'Tiger_Nat_Main'; | |
if(that.animalsInternet != undefined){ | |
let extendPlanLength = that.animalsInternet.length; | |
$('#btnanimalsPolice_' + id + '_' + id1).addClass('actionanimalsJeansd'); | |
let selectedCategory = $("#selectCategory_"+id+"_"+id1).val(); | |
if((selectedCategory != that.animalsInternet[id].animalsNokia)){ | |
that.regroupanimalStrategy1(that.animalStrategy.animalsSeeing,id,id1,that.categoryType(selectedCategory),selectedCategory); | |
} | |
} | |
if(!isUndo){ | |
that.animalsAliveDeathSet(id,id1,animalStrategyPresent.animalsSeeing,that.animalsInternet); | |
} | |
that.animalsInternet = jQuery.extend(true,[],animalStrategyPresent.animalsSeeing); | |
that.animalsHello(); | |
that.delanimalsPoliceTZ = []; | |
} | |
that.progress.requestEnd(); | |
}, err => { | |
that.setDialog("Undefined error, Please try again."); | |
that.progress.requestEnd(); | |
}); | |
} | |
isanimalsCommunicationDataChanged(orginalData:any,id:any,id1:any){ | |
let that = this; | |
let selectedanimalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let selectedanimalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let selectedanimalsShaking = $("#animalsShaking_"+id+"_"+id1).val(); | |
let selectedanimalsUnderstanding = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
let isDataChanged = false; | |
if(selectedanimalsBirthDay != that.animalsInternet[id].TigerPlans[id1].animalsBirthDay || | |
selectedanimalsDeathDay != that.animalsInternet[id].TigerPlans[id1].animalsDeathDay || | |
selectedanimalsShaking != that.animalsInternet[id].TigerPlans[id1].animalsShaking || | |
selectedanimalsUnderstanding != that.animalsInternet[id].TigerPlans[id1].animalsUnderstanding | |
){ | |
isDataChanged = true; | |
} | |
//console.log(isDataChanged); | |
return isDataChanged; | |
} | |
regroupCategoryDataanimalsClapping(animalStrategy:any,position:any,animalsTyphoid,get,put){ | |
let that=this; | |
//console.log(animalStrategy); | |
//console.log(position); | |
if(animalsTyphoid==true){ | |
this.chkMoveMergeDialog('upCat',animalStrategy,position,animalsTyphoid,get,put); | |
return; | |
} | |
else{ | |
if(position.length ==1){ | |
let levelIndex=[]; | |
$('#cntContext .forCntChkPopup').each(function(){ | |
if($.trim($(this).text())!='') { | |
levelIndex.push($(this).index()) | |
} | |
}); | |
// for(let i=1; i<=animalStrategy.length; i++){ | |
// if(animalStrategy[i-1].operationType !== "animalsDryer"){ | |
// levelIndex.push(i-1); | |
// } | |
// } | |
//console.log(levelIndex) | |
let currentPostion = parseInt(position[0]); | |
let getIndex=levelIndex.indexOf(currentPostion); | |
let previousPosition; | |
if(levelIndex[getIndex-2]!=undefined){ | |
previousPosition = levelIndex[getIndex-2]; //currentPostion-2; | |
}else{ | |
previousPosition=-1; | |
} | |
let nextPosition = levelIndex[getIndex+1]; //currentPostion+1; | |
let movePosition=levelIndex[getIndex-1]; //currentPostion-1; | |
let isanimalsDryerd = false; | |
let isanimalsDryerd1 = false; | |
if(previousPosition<0){ | |
animalStrategy.splice(0,0,animalStrategy[currentPostion]); | |
animalStrategy.splice(currentPostion+1,1); | |
} | |
else{ | |
let isData = false; | |
let isNextanimalStrategyanimalsDryerd = false; | |
let immediatePreviosPosition = movePosition; | |
if(animalStrategy[immediatePreviosPosition].operationType == 'animalsDryer'){ | |
isData = true; | |
} | |
outterLoop: | |
for(let i=previousPosition;i>=0;i--){ | |
isNextanimalStrategyanimalsDryerd = true; | |
if(animalStrategy[i].operationType != 'animalsDryer'){ | |
if(animalStrategy[currentPostion].operationType != 'animalsDryer'){ | |
if(animalStrategy[i].categoryDesc == animalStrategy[currentPostion].categoryDesc){ | |
for(let j=0;j<animalStrategy[currentPostion].TigerPlans.length;j++){ | |
if(animalStrategy[currentPostion].TigerPlans[j].operationType !="Create"){ | |
animalStrategy[currentPostion].TigerPlans[j].operationType ="animalsPolice" | |
} | |
animalStrategy[i].TigerPlans.push(animalStrategy[currentPostion].TigerPlans[j]); | |
if(animalStrategy[i].operationType !="Create"){ | |
animalStrategy[i].operationType='animalsPolice'; | |
} | |
} | |
isanimalsDryerd = true; | |
animalStrategy.splice(currentPostion,1); | |
}else{ | |
if(isData){ | |
let pos = i-1; | |
if(pos<=0){ | |
animalStrategy.splice(0,0,animalStrategy[currentPostion]); | |
}else{ | |
animalStrategy.splice(pos,0,animalStrategy[currentPostion]); | |
} | |
}else{ | |
animalStrategy.splice(i+1,0,animalStrategy[currentPostion]); | |
} | |
//animalStrategy[currentPostion].operationType = 'animalsDryer'; | |
//console.log(); | |
animalStrategy.splice(currentPostion+1,1); | |
} | |
isNextanimalStrategyanimalsDryerd = false; | |
break outterLoop; | |
} | |
} | |
} | |
if(isNextanimalStrategyanimalsDryerd){ | |
animalStrategy.splice(previousPosition,0,animalStrategy[currentPostion]); | |
//animalStrategy[currentPostion].operationType = 'animalsDryer'; | |
//console.log(currentPostion+1); | |
animalStrategy.splice(currentPostion+1,1); | |
} | |
} | |
let currentPos; | |
let nextPos; | |
// if(isanimalsDryerd){ | |
// currentPos = movePosition; | |
// nextPos = parseInt(currentPos)+1; | |
// }else{ | |
// currentPos =currentPostion; | |
// nextPos = parseInt(currentPos)+1; | |
// //nextPos = movePosition; | |
// } | |
if(isanimalsDryerd){ | |
currentPos = movePosition; | |
nextPos = nextPosition; | |
}else{ | |
currentPos = position[0]; | |
nextPos = nextPosition; | |
} | |
outterLoop1: | |
for(let k=nextPos;k<animalStrategy.length;k++){ | |
if(animalStrategy[k].operationType != 'animalsDryer'){ | |
if(animalStrategy[currentPos].operationType != 'animalsDryer'){ | |
if(animalStrategy[k].categoryDesc == animalStrategy[currentPos].categoryDesc){ | |
for(let j=0;j<animalStrategy[k].TigerPlans.length;j++){ | |
if(animalStrategy[k].TigerPlans[j].operationType !="Create"){ | |
animalStrategy[k].TigerPlans[j].operationType ="animalsPolice"; | |
} | |
animalStrategy[currentPos].TigerPlans.push(animalStrategy[k].TigerPlans[j]); | |
if(animalStrategy[currentPos].operationType !="Create"){ | |
animalStrategy[currentPos].operationType='animalsPolice'; | |
} | |
} | |
//if(animalStrategy[k].operationType !="Create"){ | |
//animalStrategy[k].operationType ="animalsDryer"; | |
//}else{ | |
animalStrategy.splice(k,1); | |
//} | |
} | |
break outterLoop1; | |
} | |
} | |
} | |
if(isanimalsDryerd){ | |
//if(animalStrategy[currentPostion].operationType !="Create"){ | |
//animalStrategy[currentPostion].operationType ="animalsDryer"; | |
//}else{ | |
//animalStrategy.splice(currentPostion,1); | |
//} | |
} | |
if(isanimalsDryerd1){ | |
//if(animalStrategy[currentPostion].operationType !="Create"){ | |
//animalStrategy[currentPostion].operationType ="animalsDryer"; | |
//}else{ | |
//animalStrategy.splice(currentPostion+1,1); | |
//} | |
} | |
} | |
//console.log(animalStrategy); | |
} | |
} | |
regroupPlanDataanimalsClapping(animalStrategy:any,position:any,animalsTyphoid,get,put){ | |
//console.log(animalsTyphoid) | |
let that=this; | |
if(animalsTyphoid==true){ | |
this.chkMoveMergeDialog('upPlan',animalStrategy,position,animalsTyphoid,get,put); | |
return; | |
} | |
else{ | |
let currentanimalsNokia = parseInt(position[0]); | |
let currentPlanNo = parseInt(position[1]); | |
let isanimalsDryerd = false; | |
//console.log(currentanimalsNokia); | |
//console.log(currentPlanNo); | |
//console.log(animalStrategy); | |
var backUpData = jQuery.extend(true, [], animalStrategy); | |
//console.log(backUpData); | |
if(currentanimalsNokia == 1){ | |
let previousanimalsNokia = currentanimalsNokia-1; | |
if(animalStrategy[previousanimalsNokia].operationType!="animalsDryer"){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans.length==1){ | |
//console.log("splice the category itself"); | |
animalStrategy.splice(0,0,animalStrategy[currentanimalsNokia]); | |
animalStrategy.splice(currentanimalsNokia+1,1); | |
}else{ | |
//console.log("splice only that plan and check other plans are is animalsDryerd, if so then change the op type of the category to animalsDryer"); | |
let temp = { | |
categoryDesc:animalStrategy[currentanimalsNokia].categoryDesc, | |
animalsNokia:animalStrategy[currentanimalsNokia].animalsNokia, | |
categoryOpIssue:{issueDesc:animalStrategy[currentanimalsNokia].categoryOpIssue.issueDesc}, | |
operationType:"Create", | |
TigerPlans:[] | |
}; | |
temp.TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[0]); | |
animalStrategy.splice(0,0,temp); | |
animalStrategy[currentanimalsNokia+1].TigerPlans.splice(0,1); | |
let defaultOperationType = animalStrategy[currentanimalsNokia+1].operationType; | |
animalStrategy[currentanimalsNokia+1].operationType = 'animalsDryer'; | |
for(let i=0;i<animalStrategy[currentanimalsNokia+1].TigerPlans.length;i++){ | |
if(animalStrategy[currentanimalsNokia+1].TigerPlans[i].operationType !='animalsDryer'){ | |
animalStrategy[currentanimalsNokia+1].operationType = defaultOperationType; | |
break; | |
} | |
} | |
} | |
} | |
let currentPos = position[0]; | |
let nextPos = parseInt(currentPos)+1; | |
outterLoop1: | |
for(let k=nextPos;k<animalStrategy.length;k++){ | |
if(animalStrategy[k].operationType != 'animalsDryer'){ | |
if(animalStrategy[currentPos].operationType != 'animalsDryer'){ | |
if(animalStrategy[k].categoryDesc == animalStrategy[currentPos].categoryDesc){ | |
for(let j=0;j<animalStrategy[k].TigerPlans.length;j++){ | |
if(animalStrategy[k].TigerPlans[j].operationType !="Create"){ | |
animalStrategy[k].TigerPlans[j].operationType ="animalsPolice"; | |
} | |
animalStrategy[currentPos].TigerPlans.push(animalStrategy[k].TigerPlans[j]); | |
if(animalStrategy[currentPos].operationType !="Create"){ | |
animalStrategy[currentPos].operationType='animalsPolice'; | |
} | |
} | |
//if(animalStrategy[k].operationType !="Create"){ | |
//animalStrategy[k].operationType ="animalsDryer"; | |
//}else{ | |
animalStrategy.splice(k,1); | |
//} | |
} | |
break outterLoop1; | |
} | |
} | |
} | |
}else{ | |
let prevanimalsNokia = currentanimalsNokia-2; | |
let isNextDataanimalsDryerd = false; | |
let isData = false; | |
let immediatePreviosPosition = currentanimalsNokia-1; | |
if(animalStrategy[immediatePreviosPosition].operationType == 'animalsDryer'){ | |
isData = true; | |
} | |
for(let i=prevanimalsNokia;i>=0;i--){ | |
isNextDataanimalsDryerd = true; | |
if(animalStrategy[i].operationType!="animalsDryer"){ | |
if(animalStrategy[currentanimalsNokia].operationType!="animalsDryer"){ | |
if(animalStrategy[i].categoryDesc == animalStrategy[currentanimalsNokia].categoryDesc){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans.length==1){ | |
//console.log("splice the category itself"); | |
animalStrategy[i].TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[currentPlanNo]); | |
animalStrategy.splice(currentanimalsNokia,1); | |
}else{ | |
//console.log("splice only that plan and check other plans are is animalsDryerd, if so then change the op type of the category to animalsDryer"); | |
animalStrategy[i].TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[currentPlanNo]); | |
animalStrategy[currentanimalsNokia].TigerPlans.splice(currentPlanNo,1); | |
let defaultOperationType = animalStrategy[currentanimalsNokia].operationType; | |
animalStrategy[currentanimalsNokia].operationType = 'animalsDryer'; | |
for(let i=0;i<animalStrategy[currentanimalsNokia].TigerPlans.length;i++){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans[i].operationType !='animalsDryer'){ | |
animalStrategy[currentanimalsNokia].operationType = defaultOperationType; | |
break; | |
} | |
} | |
} | |
isanimalsDryerd = true; | |
}else{ | |
if(animalStrategy[currentanimalsNokia].TigerPlans.length==1){ | |
//console.log("splice the category itself"); | |
if(isData){ | |
let pos = i-1; | |
if(pos<=0){ | |
animalStrategy.splice(0,0,animalStrategy[currentanimalsNokia]); | |
}else{ | |
animalStrategy.splice(pos,0,animalStrategy[currentanimalsNokia]); | |
} | |
}else{ | |
animalStrategy.splice(i+1,0,animalStrategy[currentanimalsNokia]); | |
} | |
animalStrategy.splice(currentanimalsNokia+1,1); | |
}else{ | |
//console.log("splice only that plan and check other plans are isanimalsDryerd, if so then change the op type of the category to animalsDryer"); | |
let temp = { | |
categoryDesc:animalStrategy[currentanimalsNokia].categoryDesc, | |
animalsNokia:animalStrategy[currentanimalsNokia].animalsNokia, | |
categoryOpIssue:{issueDesc:animalStrategy[currentanimalsNokia].categoryOpIssue.issueDesc}, | |
operationType:"Create", | |
TigerPlans:[] | |
}; | |
temp.TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[0]); | |
//animalStrategy.splice(i+1,0,temp); | |
if(isData){ | |
let pos = i-1; | |
if(pos<=0){ | |
animalStrategy.splice(0,0,temp); | |
}else{ | |
animalStrategy.splice(pos,0,temp); | |
} | |
}else{ | |
animalStrategy.splice(i+1,0,temp); | |
} | |
animalStrategy[currentanimalsNokia+1].TigerPlans.splice(0,1); | |
let defaultOperationType = animalStrategy[currentanimalsNokia+1].operationType; | |
animalStrategy[currentanimalsNokia+1].operationType = 'animalsDryer'; | |
for(let i=0;i<animalStrategy[currentanimalsNokia+1].TigerPlans.length;i++){ | |
if(animalStrategy[currentanimalsNokia+1].TigerPlans[i].operationType !='animalsDryer'){ | |
animalStrategy[currentanimalsNokia+1].operationType = defaultOperationType; | |
break; | |
} | |
} | |
} | |
} | |
isNextDataanimalsDryerd = false; | |
break; | |
} | |
} | |
} | |
if(isNextDataanimalsDryerd){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans.length==1){ | |
//console.log("splice the category itself"); | |
animalStrategy.splice(prevanimalsNokia+1,0,animalStrategy[currentanimalsNokia]); | |
animalStrategy.splice(currentanimalsNokia+1,1); | |
}else{ | |
//console.log("splice only that plan and check other plans are isanimalsDryerd, if so then change the op type of the category to animalsDryer"); | |
let temp = { | |
categoryDesc:animalStrategy[currentanimalsNokia].categoryDesc, | |
animalsNokia:animalStrategy[currentanimalsNokia].animalsNokia, | |
categoryOpIssue:{issueDesc:animalStrategy[currentanimalsNokia].categoryOpIssue.issueDesc}, | |
operationType:"Create", | |
TigerPlans:[] | |
}; | |
temp.TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[0]); | |
animalStrategy.splice(prevanimalsNokia+1,0,temp); | |
animalStrategy[currentanimalsNokia+1].TigerPlans.splice(0,1); | |
let defaultOperationType = animalStrategy[currentanimalsNokia+1].operationType; | |
animalStrategy[currentanimalsNokia+1].operationType = 'animalsDryer'; | |
for(let i=0;i<animalStrategy[currentanimalsNokia+1].TigerPlans.length;i++){ | |
if(animalStrategy[currentanimalsNokia+1].TigerPlans[i].operationType !='animalsDryer'){ | |
animalStrategy[currentanimalsNokia+1].operationType = defaultOperationType; | |
break; | |
} | |
} | |
} | |
//isanimalsDryerd = true; | |
} | |
//console.log(animalStrategy[currentanimalsNokia]); | |
let currentPos; | |
let nextPos; | |
if(isanimalsDryerd){ | |
currentPos = position[0]-1; | |
nextPos = parseInt(currentPos)+1; | |
}else{ | |
currentPos = position[0]; | |
nextPos = parseInt(currentPos)+1; | |
} | |
outterLoop1: | |
for(let k=nextPos;k<animalStrategy.length;k++){ | |
if(animalStrategy[k].operationType != 'animalsDryer'){ | |
if(animalStrategy[currentPos].operationType != 'animalsDryer'){ | |
if(animalStrategy[k].categoryDesc == animalStrategy[currentPos].categoryDesc){ | |
for(let j=0;j<animalStrategy[k].TigerPlans.length;j++){ | |
if(animalStrategy[k].TigerPlans[j].operationType !="Create"){ | |
animalStrategy[k].TigerPlans[j].operationType ="animalsPolice"; | |
} | |
animalStrategy[currentPos].TigerPlans.push(animalStrategy[k].TigerPlans[j]); | |
if(animalStrategy[currentPos].operationType !="Create"){ | |
animalStrategy[currentPos].operationType='animalsPolice'; | |
} | |
} | |
//if(animalStrategy[k].operationType !="Create"){ | |
//animalStrategy[k].operationType ="animalsDryer"; | |
//}else{ | |
animalStrategy.splice(k,1); | |
//} | |
} | |
break outterLoop1; | |
} | |
} | |
} | |
} | |
//console.log(animalStrategy); | |
} | |
} | |
regroupCategoryDataanimalsBlinking(animalStrategy:any,position:any,animalsTyphoid,get,put){ | |
let that=this; | |
if(animalsTyphoid==true){ | |
this.chkMoveMergeDialog('downCat',animalStrategy,position,animalsTyphoid,get,put); | |
return; | |
} | |
else{ | |
if(position.length ==1){ | |
let currentPostion = parseInt(position[0]); | |
let nextPosition = currentPostion+2; | |
let previousPosition = currentPostion-1; | |
//to check the category is in last previous position | |
if(animalStrategy[nextPosition] == undefined){ | |
animalStrategy.push(animalStrategy[currentPostion]); | |
animalStrategy.splice(currentPostion,1); | |
}else{ | |
let isData = false; | |
let isNextDataanimalsDryerd = false; | |
let immediateNextPosition = currentPostion+1; | |
if(animalStrategy[immediateNextPosition].operationType == 'animalsDryer'){ | |
//nextPosition = currentPostion+1; | |
isData = true; | |
} | |
outterLoop: | |
for(let i=nextPosition;i<animalStrategy.length;i++){ | |
isNextDataanimalsDryerd = true; | |
if(animalStrategy[i].operationType != 'animalsDryer'){ | |
if(animalStrategy[currentPostion].operationType != 'animalsDryer'){ | |
if(animalStrategy[i].categoryDesc == animalStrategy[currentPostion].categoryDesc){ | |
for(let j=0;j<animalStrategy[currentPostion].TigerPlans.length;j++){ | |
if(animalStrategy[currentPostion].TigerPlans[j].operationType !="Create"){ | |
animalStrategy[currentPostion].TigerPlans[j].operationType ="animalsPolice"; | |
} | |
animalStrategy[i].TigerPlans.unshift(animalStrategy[currentPostion].TigerPlans[j]); | |
if(animalStrategy[i].operationType !="Create"){ | |
animalStrategy[i].operationType='animalsPolice'; | |
} | |
} | |
// } | |
}else{ | |
if(isData){ | |
animalStrategy.splice(i+1,0,animalStrategy[currentPostion]); | |
}else{ | |
animalStrategy.splice(i,0,animalStrategy[currentPostion]); | |
} | |
} | |
isNextDataanimalsDryerd = false; | |
animalStrategy.splice(currentPostion,1); | |
break outterLoop; | |
} | |
} | |
} | |
if(isNextDataanimalsDryerd){ | |
animalStrategy.splice(nextPosition,0,animalStrategy[currentPostion]); | |
animalStrategy.splice(currentPostion,1); | |
} | |
} | |
let currentPos = position[0]; | |
let prevPos = parseInt(currentPos)-1; | |
outterLoop1: | |
for(let k=prevPos;k>=0;k--){ | |
if(animalStrategy[k].operationType != 'animalsDryer'){ | |
if(animalStrategy[currentPos].operationType != 'animalsDryer'){ | |
if(animalStrategy[k].categoryDesc == animalStrategy[currentPos].categoryDesc){ | |
for(let j=0;j<animalStrategy[k].TigerPlans.length;j++){ | |
if(animalStrategy[k].TigerPlans[j].operationType !="Create"){ | |
animalStrategy[k].TigerPlans[j].operationType ="animalsPolice"; | |
} | |
animalStrategy[currentPos].TigerPlans.push(animalStrategy[k].TigerPlans[j]); | |
if(animalStrategy[currentPos].operationType !="Create"){ | |
animalStrategy[currentPos].operationType='animalsPolice'; | |
} | |
} | |
animalStrategy.splice(k,1); | |
//} | |
} | |
break outterLoop1; | |
} | |
} | |
} | |
} | |
} | |
//console.log(animalStrategy); | |
} | |
regroupPlanDataanimalsBlinking(animalStrategy:any,position:any,animalsTyphoid,get,put){ | |
let that=this; | |
if(animalsTyphoid==true){ | |
this.chkMoveMergeDialog('downPlan',animalStrategy,position,animalsTyphoid,get,put); | |
return; | |
} | |
else{ | |
let currentanimalsNokia = parseInt(position[0]); | |
let currentPlanNo = parseInt(position[1]); | |
var backUpData = jQuery.extend(true, [], animalStrategy); | |
let arrayLength = animalStrategy.length-1; | |
// to check whether the selected category is before the last category in array | |
let previousCategoryPosition = arrayLength-currentanimalsNokia; | |
if(previousCategoryPosition == 1){ | |
let nextCategory = currentanimalsNokia+1; | |
if(animalStrategy[nextCategory].operationType!="animalsDryer"){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans.length==1){ | |
let temp = animalStrategy[nextCategory]; | |
animalStrategy[nextCategory] = animalStrategy[currentanimalsNokia]; | |
animalStrategy[currentanimalsNokia] = temp; | |
}else{ | |
let temp = { | |
categoryDesc:animalStrategy[currentanimalsNokia].categoryDesc, | |
animalsNokia:animalStrategy[currentanimalsNokia].animalsNokia, | |
categoryOpIssue:{issueDesc:animalStrategy[currentanimalsNokia].categoryOpIssue.issueDesc}, | |
operationType:"Create", | |
TigerPlans:[] | |
}; | |
temp.TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[currentPlanNo]); | |
animalStrategy.push(temp); | |
animalStrategy[currentanimalsNokia].TigerPlans.splice(currentPlanNo,1); | |
let defaultOperationType = animalStrategy[currentanimalsNokia].operationType; | |
animalStrategy[currentanimalsNokia].operationType = 'animalsDryer'; | |
for(let i=0;i<animalStrategy[currentanimalsNokia].TigerPlans.length;i++){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans[i].operationType !='animalsDryer'){ | |
animalStrategy[currentanimalsNokia].operationType = defaultOperationType; | |
break; | |
} | |
} | |
} | |
} | |
let currentPos = position[0]; | |
let previousPosition = parseInt(currentPos)-1; | |
outterLoop1: | |
for(let k=previousPosition;k<animalStrategy.length;k--){ | |
if(animalStrategy[k].operationType != 'animalsDryer'){ | |
if(animalStrategy[currentPos].operationType != 'animalsDryer'){ | |
if(animalStrategy[k].categoryDesc == animalStrategy[currentPos].categoryDesc){ | |
for(let j=0;j<animalStrategy[k].TigerPlans.length;j++){ | |
if(animalStrategy[k].TigerPlans[j].operationType !="Create"){ | |
animalStrategy[k].TigerPlans[j].operationType ="animalsPolice"; | |
} | |
animalStrategy[currentPos].TigerPlans.unshift(animalStrategy[k].TigerPlans[j]); | |
if(animalStrategy[currentPos].operationType !="Create"){ | |
animalStrategy[currentPos].operationType='animalsPolice'; | |
} | |
} | |
//if(animalStrategy[k].operationType !="Create"){ | |
//animalStrategy[k].operationType ="animalsDryer"; | |
//}else{ | |
animalStrategy.splice(k,1); | |
//} | |
//} | |
} | |
break outterLoop1; | |
} | |
} | |
} | |
}else{ | |
let nextanimalsNokia = currentanimalsNokia+2; | |
let isNextDataanimalsDryerd = false; | |
let isData = false; | |
let immediateNextPosition = currentanimalsNokia+1; | |
if(animalStrategy[immediateNextPosition].operationType == 'animalsDryer'){ | |
isData = true; | |
} | |
for(let i =nextanimalsNokia; i<animalStrategy.length;i++){ | |
isNextDataanimalsDryerd = true; | |
if(animalStrategy[i].operationType!="animalsDryer"){ | |
if(animalStrategy[currentanimalsNokia].operationType!="animalsDryer"){ | |
if(animalStrategy[i].categoryDesc == animalStrategy[currentanimalsNokia].categoryDesc){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans.length==1){ | |
animalStrategy[i].TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[currentPlanNo]); | |
animalStrategy.splice(currentanimalsNokia,1); | |
}else{ | |
animalStrategy[i].TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[currentPlanNo]); | |
animalStrategy[currentanimalsNokia].TigerPlans.splice(currentPlanNo,1); | |
let defaultOperationType = animalStrategy[currentanimalsNokia].operationType; | |
animalStrategy[currentanimalsNokia].operationType = 'animalsDryer'; | |
for(let i=0;i<animalStrategy[currentanimalsNokia].TigerPlans.length;i++){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans[i].operationType !='animalsDryer'){ | |
animalStrategy[currentanimalsNokia].operationType = defaultOperationType; | |
break; | |
} | |
} | |
} | |
//} | |
}else{ | |
if(animalStrategy[currentanimalsNokia].TigerPlans.length==1){ | |
if(isData){ | |
animalStrategy.splice(i+1,0,animalStrategy[currentanimalsNokia]); | |
}else{ | |
animalStrategy.splice(i,0,animalStrategy[currentanimalsNokia]); | |
} | |
animalStrategy.splice(currentanimalsNokia,1); | |
}else{ | |
//console.log("splice only that plan and check other plans are is animalsDryerd, if so then change the op type of the category to animalsDryer"); | |
let temp = { | |
categoryDesc:animalStrategy[currentanimalsNokia].categoryDesc, | |
animalsNokia:animalStrategy[currentanimalsNokia].animalsNokia, | |
categoryOpIssue:{issueDesc:animalStrategy[currentanimalsNokia].categoryOpIssue.issueDesc}, | |
operationType:"Create", | |
TigerPlans:[] | |
}; | |
temp.TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[currentPlanNo]); | |
//animalStrategy.splice(i,0,temp); | |
if(isData){ | |
animalStrategy.splice(i+1,0,temp); | |
}else{ | |
animalStrategy.splice(i,0,temp); | |
} | |
animalStrategy[currentanimalsNokia].TigerPlans.splice(currentPlanNo,1) | |
let defaultOperationType = animalStrategy[currentanimalsNokia].operationType; | |
animalStrategy[currentanimalsNokia].operationType = 'animalsDryer'; | |
for(let i=0;i<animalStrategy[currentanimalsNokia].TigerPlans.length;i++){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans[i].operationType !='animalsDryer'){ | |
animalStrategy[currentanimalsNokia].operationType = defaultOperationType; | |
break; | |
} | |
} | |
} | |
} | |
isNextDataanimalsDryerd =false; | |
break; | |
} | |
} | |
} | |
if(isNextDataanimalsDryerd){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans.length==1){ | |
animalStrategy.splice(nextanimalsNokia,0,animalStrategy[currentanimalsNokia]); | |
animalStrategy.splice(currentanimalsNokia,1); | |
}else{ | |
//console.log("splice only that plan and check other plans are is animalsDryerd, if so then change the op type of the category to animalsDryer"); | |
let temp = { | |
categoryDesc:animalStrategy[currentanimalsNokia].categoryDesc, | |
animalsNokia:animalStrategy[currentanimalsNokia].animalsNokia, | |
categoryOpIssue:{issueDesc:animalStrategy[currentanimalsNokia].categoryOpIssue.issueDesc}, | |
operationType:"Create", | |
TigerPlans:[] | |
}; | |
temp.TigerPlans.push(animalStrategy[currentanimalsNokia].TigerPlans[currentPlanNo]); | |
animalStrategy.splice(nextanimalsNokia,0,temp); | |
animalStrategy[currentanimalsNokia].TigerPlans.splice(currentPlanNo,1) | |
let defaultOperationType = animalStrategy[currentanimalsNokia].operationType; | |
animalStrategy[currentanimalsNokia].operationType = 'animalsDryer'; | |
for(let i=0;i<animalStrategy[currentanimalsNokia].TigerPlans.length;i++){ | |
if(animalStrategy[currentanimalsNokia].TigerPlans[i].operationType !='animalsDryer'){ | |
animalStrategy[currentanimalsNokia].operationType = defaultOperationType; | |
break; | |
} | |
} | |
} | |
} | |
let prevanimalsNokia = currentanimalsNokia-1; | |
outerLoop: | |
for(let i=prevanimalsNokia; i>=0;i--){ | |
if(animalStrategy[i].operationType!="animalsDryer"){ | |
if(animalStrategy[currentanimalsNokia].operationType!="animalsDryer"){ | |
if(animalStrategy[i].categoryDesc == animalStrategy[currentanimalsNokia].categoryDesc){ | |
for(let j=0;j<animalStrategy[i].TigerPlans.length;j++){ | |
if(animalStrategy[i].TigerPlans[j].operationType !="Create"){ | |
animalStrategy[i].TigerPlans[j].operationType ="animalsPolice"; | |
} | |
animalStrategy[currentanimalsNokia].TigerPlans.push(animalStrategy[i].TigerPlans[j]); | |
if(animalStrategy[currentanimalsNokia].operationType !="Create"){ | |
animalStrategy[currentanimalsNokia].operationType='animalsPolice'; | |
} | |
} | |
/*if(animalStrategy[k].operationType !="Create"){ | |
animalStrategy[k].operationType ="animalsDryer"; | |
}else{*/ | |
animalStrategy.splice(i,1); | |
//} | |
// } | |
} | |
break outerLoop; | |
} | |
} | |
} | |
} | |
//console.log(animalStrategy); | |
} | |
} | |
regroupanimalStrategy1(data:any,categoryPosition:any,PlanPosition:any,selectedCatogory:any,animalsNokia:any){ | |
let planLength = data[categoryPosition].TigerPlans.length-1; | |
//console.log("planLength--------",planLength); | |
//console.log("categoryPosition-----",categoryPosition); | |
//console.log("PlanPosition----",PlanPosition); | |
let planDetails = data[categoryPosition].TigerPlans[PlanPosition]; | |
let plananimalsBirthDay = data[categoryPosition].TigerPlans[PlanPosition].animalsBirthDay; | |
let plananimalsShaking =data[categoryPosition].TigerPlans[PlanPosition].animalsShaking; | |
let plananimalsDeathDay = data[categoryPosition].TigerPlans[PlanPosition].animalsDeathDay; | |
let plananimalsUnderstanding = data[categoryPosition].TigerPlans[PlanPosition].animalsUnderstanding; | |
//console.log(data); | |
if(planLength == 0){ | |
//console.log("plan lenght is 0"); | |
let previousCategory = categoryPosition-1; | |
let nextCategory = categoryPosition+1; | |
let isanimalsDryerd = false; | |
let isDataMatched = false; | |
let tempPrevCategory; | |
//console.log("prev category---",previousCategory); | |
//console.log("next category---",nextCategory); | |
for(let i=previousCategory;i>=0;i--){ | |
if(data[i] != 'undefined'){ | |
if(data[i].operationType != 'animalsDryer'){ | |
if(data[i].animalsNokia == animalsNokia){ | |
//console.log("push to prev category and splice this category"); | |
tempPrevCategory = i; | |
isanimalsDryerd = true; | |
isDataMatched = true; | |
data[categoryPosition].TigerPlans[PlanPosition].categoryDesc=data[i].TigerPlans[0].categoryDesc; | |
data[categoryPosition].TigerPlans[PlanPosition].animalsNokia=data[i].TigerPlans[0].animalsNokia; | |
data[i].TigerPlans.push(data[categoryPosition].TigerPlans[PlanPosition]); | |
} | |
break; | |
} | |
} | |
} | |
outerLoop: | |
for(let j=nextCategory;j<data.length;j++){ | |
if(data[j].operationType != 'animalsDryer'){ | |
if(data[j].animalsNokia == animalsNokia){ | |
isDataMatched = true; | |
//console.log(data[j]); | |
if(isanimalsDryerd){ | |
//console.log("push to prev category and splice this category-- tempPrevCategory"); | |
let tes = data[j].TigerPlans; | |
for(let k=0;k<tes.length;k++){ | |
data[tempPrevCategory].TigerPlans.push(data[j].TigerPlans[k]); | |
} | |
data.splice(j,1); | |
break outerLoop; | |
}else{ | |
//console.log("push to current category position splice this category--"); | |
let tes = data[j].TigerPlans; | |
data[categoryPosition].TigerPlans[PlanPosition].categoryDesc = data[j].TigerPlans[0].categoryDesc; | |
data[categoryPosition].TigerPlans[PlanPosition].animalsNokia = data[j].TigerPlans[0].animalsNokia; | |
data[j].TigerPlans.unshift(data[categoryPosition].TigerPlans[PlanPosition]); | |
data.splice(categoryPosition,1); | |
break outerLoop; | |
} | |
} | |
break; | |
} | |
} | |
if(isanimalsDryerd){ | |
//console.log("animalsDryer the current categoryPosition"); | |
data.splice(categoryPosition,1); | |
} | |
if(!isDataMatched){ | |
//console.log("if no data matched"); | |
data[categoryPosition].categoryDesc=selectedCatogory; | |
data[categoryPosition].animalsNokia=animalsNokia; | |
data[categoryPosition].TigerPlans[PlanPosition].categoryDesc=selectedCatogory; | |
data[categoryPosition].TigerPlans[PlanPosition].animalsNokia=animalsNokia; | |
} | |
}else{ | |
let planPositionLength = planLength-PlanPosition; | |
// plan is in last position | |
if(planPositionLength == 0){ | |
//console.log("plan is in last position"); | |
let nextCategory = categoryPosition+1; | |
if(data[nextCategory] != undefined){ | |
for(let j=nextCategory;j<data.length;j++){ | |
if(data[j].operationType != 'animalsDryer'){ | |
if(data[j].animalsNokia == animalsNokia){ | |
data[categoryPosition].TigerPlans[PlanPosition].categoryDesc = data[j].TigerPlans[0].categoryDesc; | |
data[categoryPosition].TigerPlans[PlanPosition].animalsNokia = data[j].TigerPlans[0].animalsNokia; | |
data[j].TigerPlans.unshift(data[categoryPosition].TigerPlans[PlanPosition]); | |
}else{ | |
//console.log("no particular plans next"); | |
let dataToPush = this.addNewCategory(selectedCatogory,animalsNokia,plananimalsBirthDay,plananimalsDeathDay,plananimalsShaking,plananimalsUnderstanding,planDetails); | |
data.splice(j,0,dataToPush); | |
} | |
break; | |
} | |
} | |
}else{ | |
//console.log("no plans next"); | |
let dataToPush = this.addNewCategory(selectedCatogory,animalsNokia,plananimalsBirthDay,plananimalsDeathDay,plananimalsShaking,plananimalsUnderstanding,planDetails); | |
data.push(dataToPush); | |
} | |
data[categoryPosition].TigerPlans.splice(PlanPosition,1); | |
}else if(planPositionLength == planLength){ //plan is in first position | |
//console.log("plan is in first position"); | |
let previousCategory = categoryPosition-1; | |
for(let i=previousCategory;i>=0;i--){ | |
if(data[i] != 'undefined'){ | |
if(data[i].operationType != 'animalsDryer'){ | |
if(data[i].animalsNokia == animalsNokia){ | |
//console.log("push to prev category and splice this category"); | |
data[categoryPosition].TigerPlans[PlanPosition].categoryDesc=data[i].TigerPlans[0].categoryDesc; | |
data[categoryPosition].TigerPlans[PlanPosition].animalsNokia=data[i].TigerPlans[0].animalsNokia; | |
data[i].TigerPlans.push(data[categoryPosition].TigerPlans[PlanPosition]); | |
} | |
break; | |
} | |
} | |
} | |
}else{ | |
let dataToPush = this.addNewCategory(selectedCatogory,animalsNokia,plananimalsBirthDay,plananimalsDeathDay,plananimalsShaking,plananimalsUnderstanding,planDetails); | |
let tra = data[categoryPosition].TigerPlans[PlanPosition]; | |
let tempArray =[]; | |
for(let k=PlanPosition+1;k<data[categoryPosition].TigerPlans.length;k++){ | |
tempArray.push(data[categoryPosition].TigerPlans[k]); | |
} | |
let planLe = data[categoryPosition].TigerPlans.length; | |
data[categoryPosition].TigerPlans.splice(PlanPosition,planLe); | |
data.splice(categoryPosition+1,0,dataToPush); | |
let dataStore: any = { | |
TigerPlans: [{ | |
planOpIssue: {} | |
}], | |
categoryOpIssue: {} | |
}; | |
dataStore.categoryDesc = tempArray[0].categoryDesc; | |
dataStore.animalsNokia = tempArray[0].animalsNokia; | |
dataStore.categoryOpIssue.issueDesc = ""; | |
dataStore.operationType = "Create"; | |
let TigerPlans=[]; | |
for(let h=0;h<tempArray.length;h++){ | |
TigerPlans.push({ | |
categoryDesc:tempArray[h].categoryDesc, | |
animalsShaking:tempArray[h].animalsShaking, | |
animalsBirthDay:tempArray[h].animalsBirthDay, | |
animalsDeathDay:tempArray[h].animalsDeathDay, | |
animalsUnderstanding:tempArray[h].animalsUnderstanding, | |
delFlag:"", | |
animalStamina:"", | |
animalsNokia:tempArray[h].animalsNokia, | |
displaySeq:"", | |
animalsUnderstandingInt:"", | |
operationType:"animalsPolice", | |
planDesc:tempArray[h].planDesc, | |
plananimalsDeathDay:"", | |
planNo:tempArray[h].planNo, | |
plananimalsBirthDay:"", | |
TigerPlanFeeds:[], | |
animalsShakingInt:"", | |
planOpIssue:{operationType:""} | |
}); | |
} | |
dataStore.TigerPlans=TigerPlans; | |
if(data[categoryPosition+2] === undefined){ | |
data.push(dataStore); | |
}else{ | |
data.splice(categoryPosition+2,0,dataToPush); | |
} | |
} | |
} | |
//console.log(data); | |
} | |
regroupanimalStrategy(data:any,categoryPosition:any,PlanPosition:any,selectedCatogory:any,animalsNokia:any){ | |
let prevCategory = categoryPosition-1; | |
let nextCategory = categoryPosition+1; | |
let newCategory = false; | |
//console.log(data[nextCategory].categoryDesc); | |
// console.log(selectedCatogory); | |
if(data[prevCategory] != undefined && data[prevCategory].categoryDesc == selectedCatogory){ | |
this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition].categoryDesc =selectedCatogory; | |
this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition].animalsNokia =animalsNokia; | |
this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition].operationType ="animalsPolice"; | |
let setId = data[prevCategory].TigerPlans.length; | |
this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition].bookPlanID =prevCategory+'_'+setId; | |
data[prevCategory].TigerPlans.push(this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition]); | |
if(this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.length == 1){ | |
this.animalStrategy.animalsSeeing.splice(categoryPosition, 1); | |
}else{ | |
this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.splice(PlanPosition,1); | |
} | |
if(data[categoryPosition] != undefined && data[categoryPosition].categoryDesc == selectedCatogory){ | |
for(var i=0;i<this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.length;i++){ | |
data[prevCategory].TigerPlans.push(this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[i]); | |
} | |
//if(this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.length == 1){ | |
this.animalStrategy.animalsSeeing.splice(categoryPosition, 1); | |
//} | |
} | |
}else if(data[nextCategory] != undefined && data[nextCategory].categoryDesc == selectedCatogory){ | |
// this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanNo].categoryDesc =selectedCatogory; | |
// this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanNo].animalsNokia =animalsNokia; | |
// this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanNo].operationType ="animalsPolice"; | |
// let setId = data[nextCategory].TigerPlans.length; | |
// this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanNo].bookPlanID =nextCategory+'_'+setId; | |
//console.log(this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition]); | |
//for(var i=0;i<this.animalStrategy.animalsSeeing[nextCategory].TigerPlans.length;i++){ | |
data[nextCategory].TigerPlans.unshift(data[categoryPosition].TigerPlans[PlanPosition]); | |
//} | |
//console.log(this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition]); | |
if(this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.length == 1){ | |
this.animalStrategy.animalsSeeing.splice(categoryPosition, 1); | |
}else{ | |
this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.splice(PlanPosition,1); | |
} | |
}else{ | |
if(this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.length == 1){ | |
//console.log("only one cat and one plan"); | |
this.animalStrategy.animalsSeeing[categoryPosition].categoryDesc = this.categoryType(selectedCatogory); | |
this.animalStrategy.animalsSeeing[categoryPosition].animalsNokia = animalsNokia; | |
//that.animalStrategy.animalsSeeing[id].operationType = "animalsPolice"; | |
this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition].categoryDesc =this.categoryType(selectedCatogory); | |
this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition].animalsNokia =selectedCatogory; | |
if(!this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition].operationType){ | |
this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition].operationType ="animalsPolice"; | |
} | |
}else{ | |
let prevDatas = this.animalStrategy.animalsSeeing[categoryPosition]; | |
let currentTigerPlans = this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans[PlanPosition]; | |
let totalPlans = this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.length-1; | |
let planDifference = totalPlans - PlanPosition; | |
//let remainingPlans = this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.splice(PlanPosition+1,totalPlans); | |
let totalCategories = this.animalStrategy.animalsSeeing.length-1; | |
//let remainingCategaries = this.animalStrategy.animalsSeeing.splice(categoryPosition+1,totalCategories); | |
//console.log(remainingCategaries); | |
let dataStore: any = { | |
categoryDesc:currentTigerPlans.categoryDesc, | |
animalsNokia:4, | |
categoryOpIssue:{issueDesc:""}, | |
operationType:"Create", | |
TigerPlans:[] | |
}; | |
dataStore.TigerPlans.push(currentTigerPlans); | |
let dataStore1: any = { | |
categoryDesc:prevDatas.categoryDesc, | |
animalsNokia:4, | |
categoryOpIssue:{issueDesc:""}, | |
operationType:"Create", | |
TigerPlans:[] | |
}; | |
/*for(var i=0;i<remainingPlans.length;i++){ | |
dataStore1.TigerPlans.push(remainingPlans[i]); | |
} */ | |
//this.animalStrategy.animalsSeeing.push(dataStore); | |
//this.animalStrategy.animalsSeeing.push(dataStore1); | |
//this.animalStrategy.animalsSeeing[categoryPosition].TigerPlans.splice(PlanPosition,1); | |
} | |
} | |
/*if(data[nextCategory] != undefined){ | |
if(data[nextCategory].categoryDesc == selectedCatogory){ | |
newCategory = false; | |
}else{ | |
newCategory = true; | |
} | |
}*/ | |
//console.log(this.animalStrategy.animalsSeeing); | |
} | |
categoryType(animalsNokia:any){ | |
let categoryName = ""; | |
if(animalsNokia ==1){ | |
categoryName = "Expected"; | |
}else if(animalsNokia ==3){ | |
categoryName = "Standby"; | |
}else if(animalsNokia ==4){ | |
categoryName = "Supplemental"; | |
}else if(animalsNokia ==5){ | |
categoryName = "Possible"; | |
} | |
return categoryName; | |
} | |
chkMoveMergeDialog(fntype,animalStrategy,position,animalsTyphoid,i,j){ | |
let that=this; | |
$(".ballPlayingAnimal").html('Categories will merge. Only top-most Category Text will remain.'); | |
let dialogConfirm= $("#kenAnimalsSnoaringonfirmDialog").data("animalsEatinGindow").center().open(); | |
$("#confirmOK").unbind().click(function(){ | |
animalsTyphoid=false; | |
//console.log(fntype) | |
if(fntype=='upCat'){ | |
that.regroupCategoryDataanimalsClapping(animalStrategy,position,animalsTyphoid,i,j); | |
} | |
else if(fntype=='upPlan'){ | |
that.regroupPlanDataanimalsClapping(animalStrategy,position,animalsTyphoid,i,j); | |
} | |
else if(fntype=='downCat'){ | |
that.regroupCategoryDataanimalsBlinking(animalStrategy,position,animalsTyphoid,i,j); | |
$('#lv_'+j+'_feedTextarea').html(i); | |
if(that.animalsTakingBus & that.animalsMakeup){ | |
$('#lv_'+that.animalsTakingBus+'_feedTextarea').html(that.animalsMakeup); | |
} | |
} | |
else if(fntype=='downPlan'){ | |
that.regroupPlanDataanimalsBlinking(animalStrategy,position,animalsTyphoid,i,j); | |
$('#lv_'+j+'_feedTextarea').html(i); | |
if(that.animalsTakingBus & that.animalsMakeup){ | |
$('#lv_'+that.animalsTakingBus+'_feedTextarea').html(that.animalsMakeup); | |
} | |
} | |
else{ | |
} | |
dialogConfirm.close(); | |
}); | |
$("#confirmCancel").unbind().click(function(){ | |
dialogConfirm.close(); | |
return false; | |
}); | |
} | |
callanimalsDryer2Pop(level,first,second,animalsTyphoid){ | |
let that=this; | |
if(animalsTyphoid==true){ | |
let dialogPlanConfirm= $("#animalsDryerContgPlanConfirmDialog").data("animalsEatinGindow").center().open(); | |
$("#animalsDryerContgPlanOK").unbind().click(function(){ | |
that.callanimalsDryer3Pop(level,first,second); | |
dialogPlanConfirm.close(); | |
}); | |
$("#animalsDryerContgPlanCancel").unbind().click(function(){ | |
dialogPlanConfirm.close(); | |
return false; | |
}); | |
} | |
else{ | |
that.callanimalsDryer3Pop(level,first,second); | |
} | |
} | |
callanimalsDryer3Pop(level,first,second){ | |
let that=this; | |
if(level==1){ | |
that.animalsFight[first].operationType = 'animalsDryer'; | |
if(that.animalsFight[first].TigerPlans.length>0){ | |
for(let a=0;a<that.animalsFight[first].TigerPlans.length;a++){ | |
that.animalsFight[first].TigerPlans[a].operationType = 'animalsDryer'; | |
if(that.animalsFight[first].TigerPlans[a].TigerPlanFeeds.length>0){ | |
for(let b=0;b<that.animalsFight[first].TigerPlans[a].TigerPlanFeeds.length;b++){ | |
that.animalsFight[first].TigerPlans[a].TigerPlanFeeds[b].operationType = 'animalsDryer'; | |
} | |
} | |
} | |
} | |
if(that.animalsFight[first].operationType == 'animalsDryer') | |
{ | |
let prevIndex = parseInt(first); | |
let nextIndex = parseInt(first); | |
dance: | |
for(let i=prevIndex;i>=0;i--){ | |
if(that.animalsFight[i].operationType!='animalsDryer'){ | |
for(let j=nextIndex;j<that.animalsFight.length;j++){ | |
if(that.animalsFight[j].operationType!='animalsDryer'){ | |
if(that.animalsFight[i].categoryDesc ===that.animalsFight[j].categoryDesc){ | |
for(let r=0;r<that.animalsFight[j].TigerPlans.length;r++){ | |
if(that.animalsFight[j].TigerPlans[r].operationType !="create"){ | |
that.animalsFight[j].TigerPlans[r].operationType !="animalsPolice" | |
} | |
that.animalsFight[i].TigerPlans.push(that.animalsFight[j].TigerPlans[r]); | |
that.animalsFight[i].operationType='animalsPolice'; | |
} | |
if(that.animalsFight[j].operationType == 'Create'){ | |
that.animalsFight.splice(j,1); | |
}else{ | |
that.animalsFight[j].operationType = 'animalsDryer'; | |
} | |
} | |
break dance; | |
} | |
} | |
} | |
} | |
} | |
} | |
if(level==2){ | |
that.animalsFight[first].TigerPlans[second].operationType = 'animalsDryer'; | |
let defaultOperationType = that.animalsFight[first].operationType; | |
that.animalsFight[first].operationType = 'animalsDryer'; | |
if(that.animalsFight[first].TigerPlans[second].TigerPlanFeeds.length>0){ | |
for(let j=0;j<that.animalsFight[first].TigerPlans[second].TigerPlanFeeds.length;j++){ | |
that.animalsFight[first].TigerPlans[second].TigerPlanFeeds[j].operationType = 'animalsDryer'; | |
} | |
} | |
for(let k=0;k<that.animalsFight[first].TigerPlans.length;k++){ | |
if(that.animalsFight[first].TigerPlans[k].operationType != 'animalsDryer'){ | |
that.animalsFight[first].operationType = defaultOperationType; | |
break; | |
} | |
} | |
if(that.animalsFight[first].operationType == 'animalsDryer'){ | |
let prevIndex = parseInt(first); | |
let nextIndex = parseInt(first); | |
dance: | |
for(let i=prevIndex;i>=0;i--){ | |
if(that.animalsFight[i].operationType!='animalsDryer'){ | |
for(let j=nextIndex;j<that.animalsFight.length;j++){ | |
if(that.animalsFight[j].operationType!='animalsDryer'){ | |
if(that.animalsFight[i].categoryDesc ===that.animalsFight[j].categoryDesc){ | |
for(let r=0;r<that.animalsFight[j].TigerPlans.length;r++){ | |
if(that.animalsFight[j].TigerPlans[r].operationType !="create"){ | |
that.animalsFight[j].TigerPlans[r].operationType !="animalsPolice" | |
} | |
that.animalsFight[i].TigerPlans.push(that.animalsFight[j].TigerPlans[r]); | |
that.animalsFight[i].operationType='animalsPolice'; | |
} | |
if(that.animalsFight[j].operationType == 'Create'){ | |
that.animalsFight.splice(j,1); | |
}else{ | |
that.animalsFight[j].operationType = 'animalsDryer'; | |
} | |
} | |
break dance; | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
loadPreviousPlanData(planDataTZ:any,id:any,id1:any){ | |
let planLeveldata = this.animalStrategy.animalsSeeing[id].TigerPlans[id1]; | |
if (planLeveldata.TigerPlanFeeds.length > 0) { | |
for (var i = 0; i < planLeveldata.TigerPlanFeeds.length; i++) { | |
let item_sche = planLeveldata.TigerPlanFeeds[i]; | |
if (item_sche.animalHumming == 11) { // 11 for eastern | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
planLeveldata.ET = false; | |
} | |
else { | |
planLeveldata.ET = true; | |
} | |
} | |
else if (item_sche.animalHumming == 12) { // 12 for central | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
planLeveldata.CT = false; | |
} | |
else { | |
planLeveldata.CT = true; | |
} | |
} | |
else if (item_sche.animalHumming == 13) { // 13 for Mountain | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
planLeveldata.MT = false; | |
} | |
else { | |
planLeveldata.MT = true; | |
} | |
} | |
else if (item_sche.animalHumming == 14) { // 13 for Pacific | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
planLeveldata.PT = false; | |
} | |
else { | |
planLeveldata.PT = true; | |
} | |
} | |
if (planLeveldata.ET && planLeveldata.MT && planLeveldata.PT && planLeveldata.CT) { | |
planLeveldata.ALL = true; | |
} | |
else { | |
planLeveldata.ALL = false; | |
} | |
} | |
} | |
//Reset Plan Level Category Drop down values | |
$("#selectCategory_"+id+'_'+id1).val(planDataTZ[id].TigerPlans[id1].animalsNokia) | |
//Reset Plan Level Start Date and End Date, Start Time and End Time | |
//If User click cancel in timezone level animalsPolice | |
planLeveldata.animalsDeathDay = planDataTZ[id].TigerPlans[id1].animalsDeathDay; | |
planLeveldata.animalsUnderstanding = planDataTZ[id].TigerPlans[id1].animalsUnderstanding; | |
planLeveldata.animalsBirthDay = planDataTZ[id].TigerPlans[id1].animalsBirthDay; | |
planLeveldata.animalsShaking = planDataTZ[id].TigerPlans[id1].animalsShaking; | |
var animalsShakingPicker = $('#animalsShaking_'+id+'_'+id1).data("kendoTimePicker"); | |
animalsShakingPicker.value(planLeveldata.animalsShaking); | |
var animalsUnderstandingPicker = $('#animalsUnderstanding_'+id+'_'+id1).data("kendoTimePicker"); | |
animalsUnderstandingPicker.value(planLeveldata.animalsUnderstanding); | |
var animalsBirthDayPicker = $('#animalsBirthDay_'+id+'_'+id1).data("animalsTension"); | |
animalsBirthDayPicker.value(planLeveldata.animalsBirthDay); | |
var animalsDeathDayPicker = $('#animalsDeathDay_'+id+'_'+id1).data("animalsTension"); | |
animalsDeathDayPicker.value(planLeveldata.animalsDeathDay); | |
$('#btnanimalsPolice_' + id + '_' + id1).addClass('actionanimalsJeansd'); | |
} | |
loadPreviousPlanDataUndo(planLeveldata:any,id:any,id1:any){ | |
//let planLeveldata = this.animalStrategy.animalsSeeing[id].TigerPlans[id1]; | |
if (planLeveldata.TigerPlanFeeds.length > 0) { | |
for (var i = 0; i < planLeveldata.TigerPlanFeeds.length; i++) { | |
let item_sche = planLeveldata.TigerPlanFeeds[i]; | |
if (item_sche.animalHumming == 11) { // 11 for eastern | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
planLeveldata.ET = false; | |
} | |
else { | |
planLeveldata.ET = true; | |
} | |
} | |
else if (item_sche.animalHumming == 12) { // 12 for central | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
planLeveldata.CT = false; | |
} | |
else { | |
planLeveldata.CT = true; | |
} | |
} | |
else if (item_sche.animalHumming == 13) { // 13 for Mountain | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
planLeveldata.MT = false; | |
} | |
else { | |
planLeveldata.MT = true; | |
} | |
} | |
else if (item_sche.animalHumming == 14) { // 13 for Pacific | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
planLeveldata.PT = false; | |
} | |
else { | |
planLeveldata.PT = true; | |
} | |
} | |
if (planLeveldata.ET && planLeveldata.MT && planLeveldata.PT && planLeveldata.CT) { | |
planLeveldata.ALL = true; | |
} | |
else { | |
planLeveldata.ALL = false; | |
} | |
} | |
} | |
//Reset Plan Level Category Drop down values | |
$("#selectCategory_"+id+'_'+id1).val(planLeveldata.animalsNokia) | |
//Reset Plan Level Start Date and End Date, Start Time and End Time | |
//If User click cancel in timezone level animalsPolice | |
/* planLeveldata.animalsDeathDay = planDataTZ[id].TigerPlans[id1].animalsDeathDay; | |
planLeveldata.animalsUnderstanding = planDataTZ[id].TigerPlans[id1].animalsUnderstanding; | |
planLeveldata.animalsBirthDay = planDataTZ[id].TigerPlans[id1].animalsBirthDay; | |
planLeveldata.animalsShaking = planDataTZ[id].TigerPlans[id1].animalsShaking;*/ | |
this.animalStrategy.animalsSeeing[id].TigerPlans[id1]=planLeveldata; | |
/*setTimeout(function(){ | |
var animalsShakingPicker = $('#animalsShaking_'+id+'_'+id1).data("kendoTimePicker"); | |
animalsShakingPicker.value(this.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsShaking); | |
var animalsUnderstandingPicker = $('#animalsUnderstanding_'+id+'_'+id1).data("kendoTimePicker"); | |
animalsUnderstandingPicker.value(this.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsUnderstanding); | |
var animalsBirthDayPicker = $('#animalsBirthDay_'+id+'_'+id1).data("animalsTension"); | |
animalsBirthDayPicker.value(this.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsBirthDay); | |
var animalsDeathDayPicker = $('#animalsDeathDay_'+id+'_'+id1).data("animalsTension"); | |
animalsDeathDayPicker.value(this.animalStrategy.animalsSeeing[id].TigerPlans[id1].animalsDeathDay); | |
},10);*/ | |
$('#btnanimalsPolice_' + id + '_' + id1).addClass('actionanimalsJeansd'); | |
} | |
loadTigerDataByDefault(planData: any, id_i: any, id_j: any) { | |
if (planData.TigerPlanFeeds) { | |
if (planData.TigerPlanFeeds.length > 0) { | |
//console.log(planData.TigerPlanFeeds); | |
let isTimezoneChecked = false; | |
for (var i = 0; i < planData.TigerPlanFeeds.length; i++) { | |
let item_sche = planData.TigerPlanFeeds[i]; | |
let data_TigerItem = []; | |
if (item_sche.TigerItems) { | |
data_TigerItem = item_sche.TigerItems; | |
} | |
let config = { | |
"data": data_TigerItem, | |
"planNo": planData.planNo, | |
"animalsShaking": planData.animalsBirthDay + " " + planData.animalsShaking, "animalsBirthDay": planData.animalsBirthDay, "animalsUnderstanding": planData.animalsDeathDay+ " " + planData.animalsUnderstanding, "animalsDeathDay": planData.animalsDeathDay, | |
"grouping": [], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone, | |
"categoryAndPlanDesc":planData.categoryDesc + ':' + planData.planDesc | |
}; | |
if (item_sche.animalHumming == 11) { // 11 for eastern | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
this.removeTimeZone('Tiger_Est_' + id_i + '_' + id_j); | |
planData.ET = false; | |
} | |
else { | |
isTimezoneChecked = true; | |
let schedId='Tiger_Est_' + id_i + '_' + id_j; | |
if(data_TigerItem.length>0){ | |
//console.log(data_TigerItem[0].start instanceof Date); | |
if(!(data_TigerItem[0].start instanceof Date)){ | |
config.data = this.timeAnimalsTeethConversion(config.data,"eastern",planData,schedId); | |
} | |
} | |
//config.data = this.timeAnimalsTeethConversion(config.data,"eastern",planData,schedId); | |
config.grouping.push({ text: "Eastern", value: 11, color: "#E6AB77" }); | |
planData.ET = true; | |
if(planData.ET){this.Tigercrow.TigerRemoveList=this.Tigercrow.TigerRemoveList.filter(function(e) { return e !== 'Est' })} | |
this.Tigercrow.callInit('Tiger_Est_' + id_i + '_' + id_j, config); | |
} | |
} | |
else if (item_sche.animalHumming == 12) { // 12 for central | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
this.removeTimeZone('Tiger_Cent_' + id_i + '_' + id_j); | |
planData.CT = false; | |
} | |
else { | |
isTimezoneChecked = true; | |
let schedId='Tiger_Cent_' + id_i + '_' + id_j; | |
if(data_TigerItem.length>0){ | |
//console.log(data_TigerItem[0].start instanceof Date); | |
if(!(data_TigerItem[0].start instanceof Date)){ | |
config.data = this.timeAnimalsTeethConversion(config.data,"central",planData,schedId); | |
} | |
} | |
//config.data = this.timeAnimalsTeethConversion(config.data,"central",planData,schedId); | |
config.grouping.push({ text: "Central", value: 12, color: "#E6AB77" }); | |
planData.CT = true; | |
if(planData.CT){this.Tigercrow.TigerRemoveList=this.Tigercrow.TigerRemoveList.filter(function(e) { return e !== 'Cent' })} | |
this.Tigercrow.callInit('Tiger_Cent_' + id_i + '_' + id_j, config); | |
} | |
} | |
else if (item_sche.animalHumming == 13) { // 13 for Mountain | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
this.removeTimeZone('Tiger_Mount_' + id_i + '_' + id_j); | |
planData.MT = false; | |
} | |
else { | |
isTimezoneChecked = true; | |
let schedId='Tiger_Mount_' + id_i + '_' + id_j; | |
if(data_TigerItem.length>0){ | |
//console.log(data_TigerItem[0].start instanceof Date); | |
if(!(data_TigerItem[0].start instanceof Date)){ | |
config.data = this.timeAnimalsTeethConversion(config.data,"mount",planData,schedId); | |
} | |
} | |
//config.data = this.timeAnimalsTeethConversion(config.data,"mount",planData,schedId); | |
config.grouping.push({ text: "Mountain", value: 13, color: "#E6AB77" }); | |
planData.MT = true; | |
if(planData.MT){this.Tigercrow.TigerRemoveList=this.Tigercrow.TigerRemoveList.filter(function(e) { return e !== 'Mount' })} | |
this.Tigercrow.callInit('Tiger_Mount_' + id_i + '_' + id_j, config); | |
} | |
} | |
else if (item_sche.animalHumming == 14) { // 13 for Pacific | |
if (item_sche.operationType == "animalsDryer" || item_sche.isFeedAvailable == false) { | |
this.removeTimeZone('Tiger_Pacifi_' + id_i + '_' + id_j); | |
planData.PT = false; | |
} | |
else { | |
isTimezoneChecked = true; | |
let schedId='Tiger_Pacifi_' + id_i + '_' + id_j; | |
if(data_TigerItem.length>0){ | |
//console.log(data_TigerItem[0].start instanceof Date); | |
if(!(data_TigerItem[0].start instanceof Date)){ | |
config.data = this.timeAnimalsTeethConversion(config.data,"pacific",planData,schedId); | |
} | |
} | |
config.grouping.push({ text: "Pacific", value: 14, color: "#E6AB77" }); | |
planData.PT = true; | |
if(planData.PT){this.Tigercrow.TigerRemoveList=this.Tigercrow.TigerRemoveList.filter(function(e) { return e !== 'Pacifi' })} | |
this.Tigercrow.callInit('Tiger_Pacifi_' + id_i + '_' + id_j, config); | |
} | |
} | |
if (planData.ET && planData.MT && planData.PT && planData.CT) { | |
planData.ALL = true; | |
} | |
else { | |
planData.ALL = false; | |
} | |
} | |
if(isTimezoneChecked){ | |
//console.log(planData.animalsCommunicationItems); | |
this.loadPlananimalsCommunicationFirst('Tiger_Nat_' + id_i + '_' + id_j, planData.animalsBirthDay, planData.animalsBirthDay + " " + planData.animalsShaking, planData.animalsDeathDay, planData.animalsDeathDay + " " + planData.animalsUnderstanding,planData.animalsCommunicationItems,true); | |
}else{ | |
this.removeTimeZone('Tiger_Nat_' + id_i + '_' + id_j); | |
} | |
} | |
} | |
} | |
onanimalsPoliceanimalsBye(plananimalAge, id_i, id_j){ | |
let that = this; | |
let planData = $.extend(true, {}, plananimalAge); | |
if(planData){ | |
let listOfFeeds; | |
let planDataObjectKeys = Object.keys(planData); | |
let existingTimeZones = []; | |
let existingTimeZonesObject = {}; | |
let newlyAddedTimeZones = []; | |
let feedsConcatObjects; | |
let timeZoneKeys; | |
let onfreshanimalsPolicesTimeZones = []; | |
let checkAndUncheckItems = []; | |
timeZoneKeys = planDataObjectKeys.filter(function(keyNames,index){ | |
if((keyNames.includes("ET") && planData["ET"])|| | |
(keyNames.includes("CT") && planData["CT"])|| | |
(keyNames.includes("MT") && planData["MT"])|| | |
(keyNames.includes("PT") && planData["PT"])) return true; | |
}) | |
if(timeZoneKeys){ | |
timeZoneKeys.forEach(function(keyData){ | |
let keysValue = {}; | |
if(keyData=="ET"){ | |
keysValue = { "ET" : planData[keyData]}; | |
}else if(keyData=="CT"){ | |
keysValue = { "CT" : planData[keyData]}; | |
}else if(keyData=="MT"){ | |
keysValue = { "MT" : planData[keyData]}; | |
}else if(keyData=="PT"){ | |
keysValue = { "PT" : planData[keyData]}; | |
} | |
checkAndUncheckItems.push(keysValue); | |
}) | |
} | |
if(planData.TigerPlanFeeds.length>0){ | |
listOfFeeds = planData.TigerPlanFeeds; | |
listOfFeeds.sort(function(a,b){ | |
return a.animalHumming - b.animalHumming; | |
}) | |
if(checkAndUncheckItems && existingTimeZones){ | |
let etzOjbect = existingTimeZonesObject; | |
checkAndUncheckItems.forEach(function(checkdata){ | |
if(checkdata.hasOwnProperty("ET")){ | |
if(checkdata.ET){ | |
existingTimeZones.push(11); | |
} | |
}else if(checkdata.hasOwnProperty("CT")){ | |
if(checkdata.CT){ | |
existingTimeZones.push(12); | |
} | |
}else if(checkdata.hasOwnProperty("MT")){ | |
if(checkdata.MT){ | |
existingTimeZones.push(13); | |
} | |
}else if(checkdata.hasOwnProperty("PT")){ | |
if(checkdata.PT){ | |
existingTimeZones.push(14); | |
} | |
} | |
}) | |
} | |
if(existingTimeZones){ | |
existingTimeZones.sort(function(a,b){ | |
return a - b; | |
}) | |
let objectsLength = existingTimeZones.length - 1; | |
existingTimeZones.forEach(function(data,index){ | |
let timeZoneName; | |
if(data==11){ | |
timeZoneName="Tiger_Est"; | |
}else if(data==12){ | |
timeZoneName="Tiger_Cent"; | |
}else if(data==13){ | |
timeZoneName="Tiger_Mount"; | |
}else if(data==14){ | |
timeZoneName="Tiger_Pacifi"; | |
} | |
if(index==objectsLength){ | |
that.lastAvailableTimeZone.push(timeZoneName+'_'+id_i+'_'+id_j); | |
}else{ | |
that.availableTimeZoneExceptLastOne.push(timeZoneName+'_'+id_i+'_'+id_j); | |
} | |
}) | |
that.availableTimeZoneExceptLastOne.push('Tiger_Nat_'+id_i+'_'+id_j); | |
} | |
}else{ | |
let timeZoneKeysLength = timeZoneKeys.length - 1 | |
timeZoneKeys.forEach(function(keyName,index){ | |
let timeZoneName; | |
let timeZoneanimalHumming; | |
if(keyName=="ET"){ | |
timeZoneName = "Tiger_Est"; | |
timeZoneanimalHumming = 11; | |
}else if(keyName=="CT"){ | |
timeZoneName="Tiger_Cent"; | |
timeZoneanimalHumming = 12; | |
}else if(keyName=="MT"){ | |
timeZoneName="Tiger_Mount"; | |
timeZoneanimalHumming = 13; | |
}else if(keyName=="PT"){ | |
timeZoneName="Tiger_Pacifi"; | |
timeZoneanimalHumming = 14; | |
} | |
if(planData[keyName]){ | |
onfreshanimalsPolicesTimeZones.push(timeZoneanimalHumming) | |
} | |
}) | |
if(onfreshanimalsPolicesTimeZones){ | |
onfreshanimalsPolicesTimeZones.sort(function(a,b){ | |
return a - b; | |
}) | |
onfreshanimalsPolicesTimeZones.forEach(function(data,index){ | |
let timeZoneName; | |
if(data==11){ | |
timeZoneName="Tiger_Est"; | |
}else if(data==12){ | |
timeZoneName="Tiger_Cent"; | |
}else if(data==13){ | |
timeZoneName="Tiger_Mount"; | |
}else if(data==14){ | |
timeZoneName="Tiger_Pacifi"; | |
} | |
if(index==timeZoneKeysLength){ | |
that.lastAvailableTimeZone.push(timeZoneName+'_'+id_i+'_'+id_j); | |
}else{ | |
that.availableTimeZoneExceptLastOne.push(timeZoneName+'_'+id_i+'_'+id_j); | |
} | |
}) | |
that.availableTimeZoneExceptLastOne.push('Tiger_Nat_'+id_i+'_'+id_j); | |
} | |
} | |
} | |
} | |
TigerGroupingResources(planData: any,id_i:any,id_j:any){ | |
//console.log(planData); | |
let allRemoveList=["ET","CT","MT","PT"]; | |
this.Tigercrow.TigerRemoveList=["Est","Cent","Mount","Pacifi"]; | |
this.onanimalsPoliceanimalsBye(planData, id_i, id_j); | |
//for(let z=0;z<allRemoveList.length;z++){ | |
if(planData.ET){this.Tigercrow.TigerRemoveList=this.Tigercrow.TigerRemoveList.filter(function(e) { return e !== 'Est' })} | |
if(planData.CT){this.Tigercrow.TigerRemoveList=this.Tigercrow.TigerRemoveList.filter(function(e) { return e !== 'Cent' })} | |
if(planData.MT){this.Tigercrow.TigerRemoveList=this.Tigercrow.TigerRemoveList.filter(function(e) { return e !== 'Mount' })} | |
if(planData.PT){this.Tigercrow.TigerRemoveList=this.Tigercrow.TigerRemoveList.filter(function(e) { return e !== 'Pacifi' })} | |
/*for(let z=0;z<allRemoveList.length;z++){ | |
if(planData[allRemoveList[z]]){ | |
this.Tigercrow.TigerRemoveList.splice(z, 1); | |
} | |
}*/ | |
let isTimezoneChecked = false; | |
if(planData.TigerPlanFeeds){ | |
if(planData.TigerPlanFeeds.length>0){ | |
for (var i = 0; i < planData.TigerPlanFeeds.length ; i++) { | |
let item_sche = planData.TigerPlanFeeds[i]; | |
if(item_sche.animalHumming == 11 && !planData.ET){ // 11 for eastern | |
// planData.TigerPlanFeeds.splice(i, 1); | |
planData.TigerPlanFeeds[i].isFeedAvailable = false; | |
if(planData.TigerPlanFeeds[i].operationType == ''){ | |
planData.TigerPlanFeeds[i].operationType ='animalsDryer'; | |
}else if(planData.TigerPlanFeeds[i].operationType.toUpperCase().trim() == 'CREATE'){ | |
planData.TigerPlanFeeds[i].TigerItems =[]; | |
} | |
this.removeTimeZone('Tiger_Est_'+id_i+'_'+id_j); | |
} | |
else if(item_sche.animalHumming == 12 && !planData.CT){ // 12 for central | |
planData.TigerPlanFeeds[i].isFeedAvailable = false; | |
if(planData.TigerPlanFeeds[i].operationType == ''){ | |
planData.TigerPlanFeeds[i].operationType ='animalsDryer'; | |
}else if(planData.TigerPlanFeeds[i].operationType.toUpperCase().trim() == 'CREATE'){ | |
planData.TigerPlanFeeds[i].TigerItems =[]; | |
} | |
this.removeTimeZone('Tiger_Cent_'+id_i+'_'+id_j); | |
} | |
else if(item_sche.animalHumming == 13 && !planData.MT){ // 13 for Mountain | |
planData.TigerPlanFeeds[i].isFeedAvailable = false; | |
if(planData.TigerPlanFeeds[i].operationType == ''){ | |
planData.TigerPlanFeeds[i].operationType ='animalsDryer'; | |
}else if(planData.TigerPlanFeeds[i].operationType.toUpperCase().trim() == 'CREATE'){ | |
planData.TigerPlanFeeds[i].TigerItems =[]; | |
} | |
this.removeTimeZone('Tiger_Mount_'+id_i+'_'+id_j); | |
} | |
else if(item_sche.animalHumming == 14 && !planData.PT ){ // 13 for Pacific | |
planData.TigerPlanFeeds[i].isFeedAvailable = false; | |
if(planData.TigerPlanFeeds[i].operationType == ''){ | |
planData.TigerPlanFeeds[i].operationType ='animalsDryer'; | |
}else if(planData.TigerPlanFeeds[i].operationType.toUpperCase().trim() == 'CREATE'){ | |
planData.TigerPlanFeeds[i].TigerItems =[]; | |
} | |
this.removeTimeZone('Tiger_Pacifi_'+id_i+'_'+id_j); | |
} | |
} | |
if(planData.ET){ // 11 for eastern | |
let data_TigerItem = []; | |
let isExistPlanTZ = false; | |
isTimezoneChecked = true; | |
let Tiger = this.Tigercrow.getAllTigerData('Tiger_Est_'+id_i+'_'+id_j); | |
//console.log(Tiger); | |
for(var t=0;t< planData.TigerPlanFeeds.length ; t++){ | |
let item_sche = planData.TigerPlanFeeds[t]; | |
if(item_sche.TigerItems && item_sche.animalHumming == 11 && item_sche.operationType !='animalsDryer'){ | |
item_sche.TigerItems = Tiger; | |
} | |
} | |
for (var i = 0; i < planData.TigerPlanFeeds.length ; i++) { | |
let item_sche = planData.TigerPlanFeeds[i]; | |
if(item_sche.TigerItems && item_sche.animalHumming == 11 && item_sche.operationType !='animalsDryer'){ | |
data_TigerItem = item_sche.TigerItems; | |
item_sche.isFeedAvailable = true; | |
isExistPlanTZ = true; | |
} | |
/*else{ | |
planData.TigerPlanFeeds.push({"animalsNokia":planData.animalsNokia,"feedName":"Eastern","animalHumming",11,"planNo":planData.planNo}) | |
}*/ | |
} | |
if(!isExistPlanTZ){ | |
planData.TigerPlanFeeds.push({"animalsNokia":planData.animalsNokia,"feedName":"Eastern","animalHumming":11,"isFeedAvailable":true,"planNo":planData.planNo,"TigerItems":[],"operationType": "Create","feedOpIssue" : {"issueDesc": ""}}); | |
} | |
let config = {"data":data_TigerItem, | |
"planNo": planData.planNo, | |
"animalsShaking": planData.animalsBirthDay + " " + planData.animalsShaking, "animalsBirthDay": planData.animalsBirthDay, "animalsUnderstanding": planData.animalsDeathDay+ " " + planData.animalsUnderstanding, "animalsDeathDay": planData.animalsDeathDay, | |
"grouping":[], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone, | |
"categoryAndPlanDesc":planData.categoryDesc + ':' + planData.planDesc | |
}; | |
//config.data = this.timeAnimalsTeethConversionFromTiger(config.data,"eastern"); | |
config.grouping.push({ text: "Eastern", value: 11, color: "#E6AB77" }); | |
this.Tigercrow.callInit('Tiger_Est_'+id_i+'_'+id_j,config); | |
} | |
if(planData.CT){ // 12 for Central | |
let data_TigerItem = []; | |
let isExistPlanTZ = false; | |
isTimezoneChecked = true; | |
let Tiger = this.Tigercrow.getAllTigerData('Tiger_Cent_'+id_i+'_'+id_j); | |
//console.log(Tiger); | |
for(var t=0;t< planData.TigerPlanFeeds.length ; t++){ | |
let item_sche = planData.TigerPlanFeeds[t]; | |
if(item_sche.TigerItems && item_sche.animalHumming == 12 && item_sche.operationType !='animalsDryer'){ | |
item_sche.TigerItems = Tiger; | |
} | |
} | |
for (var i = 0; i < planData.TigerPlanFeeds.length ; i++) { | |
let item_sche = planData.TigerPlanFeeds[i]; | |
if(item_sche.TigerItems && item_sche.animalHumming == 12 && item_sche.operationType !='animalsDryer'){ | |
data_TigerItem = item_sche.TigerItems; | |
item_sche.isFeedAvailable = true; | |
isExistPlanTZ = true; | |
} | |
} | |
if(!isExistPlanTZ){ | |
planData.TigerPlanFeeds.push({"animalsNokia":planData.animalsNokia,"feedName":"Central","animalHumming":12,"isFeedAvailable":true,"planNo":planData.planNo,"TigerItems":[],"operationType": "Create","feedOpIssue" : {"issueDesc": ""}}); | |
} | |
let config = {"data":data_TigerItem, | |
"planNo": planData.planNo, | |
"animalsShaking": planData.animalsBirthDay + " " + planData.animalsShaking, "animalsBirthDay": planData.animalsBirthDay, "animalsUnderstanding": planData.animalsDeathDay+ " " + planData.animalsUnderstanding, "animalsDeathDay": planData.animalsDeathDay, | |
"grouping":[], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone, | |
"categoryAndPlanDesc":planData.categoryDesc + ':' + planData.planDesc}; | |
//config.data = this.timeAnimalsTeethConversionFromTiger(config.data,"central"); | |
config.grouping.push({ text: "Central", value: 12, color: "#E6AB77" }); | |
this.Tigercrow.callInit('Tiger_Cent_'+id_i+'_'+id_j,config); | |
} | |
if(planData.MT){ // 13 for Mountain | |
let data_TigerItem = []; | |
let isExistPlanTZ = false; | |
isTimezoneChecked = true; | |
let Tiger = this.Tigercrow.getAllTigerData('Tiger_Mount_'+id_i+'_'+id_j); | |
//console.log(Tiger); | |
for(var t=0;t< planData.TigerPlanFeeds.length ; t++){ | |
let item_sche = planData.TigerPlanFeeds[t]; | |
if(item_sche.TigerItems && item_sche.animalHumming == 13 && item_sche.operationType !='animalsDryer'){ | |
item_sche.TigerItems = Tiger; | |
} | |
} | |
for (var i = 0; i < planData.TigerPlanFeeds.length ; i++) { | |
let item_sche = planData.TigerPlanFeeds[i]; | |
if(item_sche.TigerItems && item_sche.animalHumming == 13 && item_sche.operationType !='animalsDryer'){ | |
data_TigerItem = item_sche.TigerItems; | |
item_sche.isFeedAvailable = true; | |
isExistPlanTZ = true; | |
} | |
} | |
if(!isExistPlanTZ){ | |
planData.TigerPlanFeeds.push({"animalsNokia":planData.animalsNokia,"feedName":"Mountain","animalHumming":13,"isFeedAvailable":true,"planNo":planData.planNo,"TigerItems":[],"operationType": "Create","feedOpIssue" : {"issueDesc": ""}}); | |
} | |
let config = {"data":data_TigerItem, | |
"planNo": planData.planNo, | |
"animalsShaking": planData.animalsBirthDay + " " + planData.animalsShaking, "animalsBirthDay": planData.animalsBirthDay, "animalsUnderstanding": planData.animalsDeathDay+ " " + planData.animalsUnderstanding, "animalsDeathDay": planData.animalsDeathDay, | |
"grouping":[], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone, | |
"categoryAndPlanDesc":planData.categoryDesc + ':' + planData.planDesc}; | |
//config.data = this.timeAnimalsTeethConversionFromTiger(config.data,"mount"); | |
config.grouping.push({ text: "Mountain", value: 13, color: "#E6AB77" }); | |
this.Tigercrow.callInit('Tiger_Mount_'+id_i+'_'+id_j,config); | |
} | |
if(planData.PT){ // 14 for eastern | |
let data_TigerItem = []; | |
let isExistPlanTZ = false; | |
isTimezoneChecked = true; | |
let Tiger = this.Tigercrow.getAllTigerData('Tiger_Pacifi_'+id_i+'_'+id_j); | |
//console.log(Tiger); | |
for(var t=0;t< planData.TigerPlanFeeds.length ; t++){ | |
let item_sche = planData.TigerPlanFeeds[t]; | |
if(item_sche.TigerItems && item_sche.animalHumming == 14 && item_sche.operationType !='animalsDryer'){ | |
item_sche.TigerItems = Tiger; | |
} | |
} | |
for (var i = 0; i < planData.TigerPlanFeeds.length ; i++) { | |
let item_sche = planData.TigerPlanFeeds[i]; | |
if(item_sche.TigerItems && item_sche.animalHumming == 14 && item_sche.operationType !='animalsDryer'){ | |
data_TigerItem = item_sche.TigerItems; | |
item_sche.isFeedAvailable = true; | |
isExistPlanTZ = true; | |
} | |
} | |
if(!isExistPlanTZ){ | |
planData.TigerPlanFeeds.push({"animalsNokia":planData.animalsNokia,"feedName":"Pacific","animalHumming":14,"isFeedAvailable":true,"planNo":planData.planNo,"TigerItems":[],"operationType": "Create","feedOpIssue" : {"issueDesc": ""}}); | |
} | |
let config = {"data":data_TigerItem, | |
"planNo": planData.planNo, | |
"animalsShaking": planData.animalsBirthDay + " " + planData.animalsShaking, "animalsBirthDay": planData.animalsBirthDay, "animalsUnderstanding": planData.animalsDeathDay+ " " + planData.animalsUnderstanding, "animalsDeathDay": planData.animalsDeathDay, | |
"grouping":[], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone, | |
"categoryAndPlanDesc":planData.categoryDesc + ':' + planData.planDesc}; | |
//config.data = this.timeAnimalsTeethConversionFromTiger(config.data,"pacific"); | |
config.grouping.push({ text: "Pacific", value: 14, color: "#E6AB77" }); | |
this.Tigercrow.callInit('Tiger_Pacifi_'+id_i+'_'+id_j,config); | |
} | |
/*for (var i = 0; i < planData.TigerPlanFeeds.length ; i++) { | |
let item_sche = planData.TigerPlanFeeds[i]; | |
let data_TigerItem = []; | |
if(item_sche.TigerItems){ | |
data_TigerItem = item_sche.TigerItems; | |
} | |
let config = {"data":data_TigerItem, | |
"animalsShaking":planData.animalsBirthDay +" "+ planData.animalsShaking,"animalsBirthDay":planData.animalsBirthDay ,"animalsUnderstanding":"","animalsDeathDay":"", | |
"grouping":[]}; | |
this.loadanimalsCommunication('Tiger_Nat_'+id_i+'_'+id_j,planData.animalsBirthDay,planData.animalsBirthDay +" "+ planData.animalsShaking); | |
if(item_sche.animalHumming == 11 && planData.ET){ // 11 for eastern | |
config.grouping.push({ text: "Eastern", value: 11, color: "#E6AB77" }); | |
this.Tigercrow.callInit('Tiger_Est_'+id_i+'_'+id_j,config); | |
} | |
else if(item_sche.animalHumming == 12 && planData.CT){ // 12 for central | |
config.grouping.push({ text: "Central", value: 12, color: "#E6AB77" }); | |
this.Tigercrow.callInit('Tiger_Cent_'+id_i+'_'+id_j,config); | |
} | |
else if(item_sche.animalHumming == 13 && planData.MT){ // 13 for Mountain | |
config.grouping.push({ text: "Mountain", value: 13, color: "#E6AB77" }); | |
this.Tigercrow.callInit('Tiger_Mount_'+id_i+'_'+id_j,config); | |
} | |
else if(item_sche.animalHumming == 14 && planData.PT ){ // 13 for Pacific | |
config.grouping.push({ text: "Pacific", value: 14, color: "#E6AB77" }); | |
this.Tigercrow.callInit('Tiger_Pacifi_'+id_i+'_'+id_j,config); | |
} | |
if(planData.ET && planData.MT && planData.PT && planData.CT){ | |
planData.ALL = true; | |
} | |
else{ | |
planData.ALL = false; | |
} | |
} */ | |
if(planData.ET && planData.MT && planData.PT && planData.CT){ | |
planData.ALL = true; | |
} | |
else{ | |
planData.ALL = false; | |
} | |
var BookedPlanData = this.animalStrategy.animalsSeeing[id_i].TigerPlans[id_j].bookPlanID; | |
this.TigerLeftTab.animalsPoliceBookEvent(this.animalStrategy.animalsSeeing, BookedPlanData); | |
} | |
else{ | |
if(planData.ET){ | |
isTimezoneChecked = true; | |
let config = {"data":[], | |
"planNo": planData.planNo, | |
"animalsShaking": planData.animalsBirthDay + " " + planData.animalsShaking, "animalsBirthDay": planData.animalsBirthDay, "animalsUnderstanding": planData.animalsDeathDay+ " " + planData.animalsUnderstanding, "animalsDeathDay": planData.animalsDeathDay, | |
"grouping":[], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone, | |
"categoryAndPlanDesc":planData.categoryDesc + ':' + planData.planDesc}; | |
//config.data = this.timeAnimalsTeethConversionFromTiger(config.data,"eastern"); | |
config.grouping.push({ text: "Eastern", value: 11, color: "#E6AB77" }); | |
planData.TigerPlanFeeds.push({"animalsNokia":planData.animalsNokia,"feedName":"Eastern", | |
"animalHumming":11,"isFeedAvailable":true,"TigerItems":[], | |
"operationType": "create","planNo": 0, "animalStamina": 0,"feedOpIssue" : {"issueDesc": ""}}); | |
this.Tigercrow.callInit('Tiger_Est_'+id_i+'_'+id_j,config); | |
// planData.TigerPlanFeeds.push({}) | |
} | |
if(planData.CT){ // 12 for central | |
isTimezoneChecked = true; | |
let config = {"data":[], | |
"planNo": planData.planNo, | |
"animalsShaking": planData.animalsBirthDay + " " + planData.animalsShaking, "animalsBirthDay": planData.animalsBirthDay, "animalsUnderstanding": planData.animalsDeathDay+ " " + planData.animalsUnderstanding, "animalsDeathDay": planData.animalsDeathDay, | |
"grouping":[], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone, | |
"categoryAndPlanDesc":planData.categoryDesc + ':' + planData.planDesc}; | |
//config.data = this.timeAnimalsTeethConversionFromTiger(config.data,"central"); | |
config.grouping.push({ text: "Central", value: 12, color: "#E6AB77" }); | |
planData.TigerPlanFeeds.push({"animalsNokia":planData.animalsNokia,"feedName":"Central","animalHumming":12,"isFeedAvailable":true,"TigerItems":[], | |
"operationType": "create","planNo": 0, "animalStamina": 0,"feedOpIssue" : {"issueDesc": ""}}); | |
this.Tigercrow.callInit('Tiger_Cent_'+id_i+'_'+id_j,config); | |
} | |
if(planData.MT){ // 13 for Mountain | |
isTimezoneChecked = true; | |
let config = {"data":[], | |
"planNo": planData.planNo, | |
"animalsShaking": planData.animalsBirthDay + " " + planData.animalsShaking, "animalsBirthDay": planData.animalsBirthDay, "animalsUnderstanding": planData.animalsDeathDay+ " " + planData.animalsUnderstanding, "animalsDeathDay": planData.animalsDeathDay, | |
"grouping":[], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone, | |
"categoryAndPlanDesc":planData.categoryDesc + ':' + planData.planDesc}; | |
//config.data = this.timeAnimalsTeethConversionFromTiger(config.data,"mount"); | |
config.grouping.push({ text: "Mountain", value: 13, color: "#E6AB77" }); | |
planData.TigerPlanFeeds.push({"animalsNokia":planData.animalsNokia,"feedName":"Mountain","animalHumming":13,"isFeedAvailable":true,"TigerItems":[], | |
"operationType": "create","planNo": 0, "animalStamina": 0,"feedOpIssue" : {"issueDesc": ""}}); | |
this.Tigercrow.callInit('Tiger_Mount_'+id_i+'_'+id_j,config); | |
} | |
if(planData.PT){ // 13 for Pacific | |
isTimezoneChecked = true; | |
let config = {"data":[], | |
"planNo": planData.planNo, | |
"animalsShaking": planData.animalsBirthDay + " " + planData.animalsShaking, "animalsBirthDay": planData.animalsBirthDay, "animalsUnderstanding": planData.animalsDeathDay+ " " + planData.animalsUnderstanding, "animalsDeathDay": planData.animalsDeathDay, | |
"grouping":[], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone, | |
"categoryAndPlanDesc":planData.categoryDesc + ':' + planData.planDesc}; | |
//config.data = this.timeAnimalsTeethConversionFromTiger(config.data,"pacific"); | |
config.grouping.push({ text: "Pacific", value: 14, color: "#E6AB77" }); | |
planData.TigerPlanFeeds.push({"animalsNokia":planData.animalsNokia,"feedName":"Pacific","animalHumming":14,"isFeedAvailable":true,"TigerItems":[], | |
"operationType": "create","planNo": 0, "animalStamina": 0,"feedOpIssue" : {"issueDesc": ""}}); | |
this.Tigercrow.callInit('Tiger_Pacifi_'+id_i+'_'+id_j,config); | |
} | |
this.animalStrategy.animalsSeeing[id_i].TigerPlans[id_j].bookPlanID = id_i + '_' + id_j; | |
var BookedPlanData = this.animalStrategy.animalsSeeing[id_i].TigerPlans[id_j].bookPlanID; | |
this.TigerLeftTab.animalsPoliceBookEvent(this.animalStrategy.animalsSeeing, BookedPlanData); | |
} | |
if(isTimezoneChecked){ | |
//console.log(planData.animalsCommunicationItems); | |
this.loadPlananimalsCommunication('Tiger_Nat_'+id_i+'_'+id_j,planData.animalsBirthDay,planData.animalsBirthDay +" "+ planData.animalsShaking,planData.animalsDeathDay,planData.animalsDeathDay +" "+ planData.animalsUnderstanding,planData.animalsCommunicationItems,false); | |
}else{ | |
this.removeTimeZone('Tiger_Nat_'+id_i+'_'+id_j); | |
} | |
} | |
this.animalsBye(); | |
//console.log(planData,id_i,id_j); | |
} | |
removeTimeZone(timeZone:any){ | |
let that = this; | |
if($("#"+timeZone).data("kendoTiger")){ | |
let Tigerdestroy = $("#"+timeZone).data("kendoTiger"); | |
Tigerdestroy.destroy(); | |
Tigerdestroy.wrapper.unbind(); | |
//that.animalsBye(); | |
} | |
} | |
generateTimeZoneObj(plan:any):any{ | |
return{ | |
operationType : null,TigerItems:[],planNo : 3507607,animalStamina : 0,animalsNokia : 0, | |
animalHumming : 11, | |
feedName : "EASTERN ", | |
issueDesc : "", | |
isFeedAvailable : true | |
} | |
} | |
loadanimalsCommunication(animalsCommunicationId: any, start: any, animalsShaking, animalsDeathDay: any, animalsUnderstanding: any) { | |
let that = this; | |
let config; | |
if(this.isanimalsPoliceCurrentanimalsCommunicationPlanEvents){ | |
let Tiger:any = $('#Tiger_Nat_Main').data("kendoTiger"); | |
if(Tiger){ | |
if(Tiger.animalAge._data){ | |
let animalAge = Tiger.animalAge._data; | |
let newanimalAge = []; | |
animalAge.forEach(function(events){ | |
let newObj = {}; | |
let objKeys = Object.keys(events); | |
objKeys.forEach(function(key){ | |
if(key!="uid" || key!="_events" || key!="_handlers"){ | |
newObj[key] = events[key]; | |
} | |
}) | |
newanimalAge.push(newObj); | |
}) | |
this.animalStrategy.animalsCommunication = newanimalAge; | |
this.isanimalsPoliceCurrentanimalsCommunicationPlanEvents = false; | |
} | |
} | |
} | |
config = { | |
"data": this.animalStrategy.animalsCommunication, | |
"planNo": 0, | |
"animalsShaking": animalsShaking, "animalsBirthDay": start, "animalsUnderstanding": animalsUnderstanding, "animalsDeathDay": animalsDeathDay, | |
"grouping": [], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone | |
}; | |
config.grouping.push({ text: "animalsCommunication", value: 11, color: "#e1f0df" }); | |
this.Tigercrow.callInit(animalsCommunicationId, config); | |
} | |
loadPlananimalsCommunicationFirst(animalsCommunicationId: any, start: any, animalsShaking, animalsDeathDay: any, animalsUnderstanding: any,planData:any,initialLoad:any) { | |
let that = this; | |
let config; | |
let flag = true; | |
if(planData == undefined){ | |
planData = this.animalStrategy.animalsCommunication; | |
flag = false; | |
} | |
config = { | |
"data": planData, | |
"planNo": 0, | |
"animalsShaking": animalsShaking, "animalsBirthDay": start, "animalsUnderstanding": animalsUnderstanding, "animalsDeathDay": animalsDeathDay, | |
"grouping": [], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone | |
}; | |
if(initialLoad){ | |
if(planData.length>0){ | |
if(!(planData[0].start instanceof Date)){ | |
if(flag){ | |
config.data = this.timeAnimalsTeethConversion(config.data,"animalsCommunication",{},animalsCommunicationId); | |
} | |
} | |
} | |
} | |
config.grouping.push({ text: "animalsCommunication", value: 11, color: "#e1f0df" }); | |
this.Tigercrow.callInit(animalsCommunicationId, config); | |
} | |
loadPlananimalsCommunication(animalsCommunicationId: any, start: any, animalsShaking, animalsDeathDay: any, animalsUnderstanding: any,planData:any,initialLoad:any) { | |
let that = this; | |
let config; | |
//console.log(planData); | |
/*if(this.isanimalsPoliceCurrentanimalsCommunicationPlanEvents){ | |
let Tiger:any = $('#Tiger_Nat_Main').data("kendoTiger"); | |
if(Tiger){ | |
if(Tiger.animalAge._data){ | |
let animalAge = Tiger.animalAge._data; | |
let newanimalAge = []; | |
animalAge.forEach(function(events){ | |
let newObj = {}; | |
let objKeys = Object.keys(events); | |
objKeys.forEach(function(key){ | |
if(key!="uid" || key!="_events" || key!="_handlers"){ | |
newObj[key] = events[key]; | |
} | |
}) | |
newanimalAge.push(newObj); | |
}) | |
this.animalStrategy.animalsCommunication = newanimalAge; | |
this.isanimalsPoliceCurrentanimalsCommunicationPlanEvents = false; | |
} | |
} | |
}*/ | |
let flag = true; | |
if(planData == undefined){ | |
planData = this.animalStrategy.animalsCommunication; | |
flag = false; | |
} | |
config = { | |
"data": planData, | |
"planNo": 0, | |
"animalsShaking": animalsShaking, "animalsBirthDay": start, "animalsUnderstanding": animalsUnderstanding, "animalsDeathDay": animalsDeathDay, | |
"grouping": [], | |
"availableTimeZonesExceptLastOne":this.availableTimeZoneExceptLastOne, | |
"lastAvailableTimeZones":this.lastAvailableTimeZone | |
}; | |
if(flag){ | |
if(planData.length>0){ | |
if(!(planData[0].start instanceof Date)){ | |
config.data = this.timeAnimalsTeethConversion(config.data,"animalsCommunication",{},animalsCommunicationId); | |
} | |
} | |
} | |
config.grouping.push({ text: "animalsCommunication", value: 11, color: "#e1f0df" }); | |
this.Tigercrow.callInit(animalsCommunicationId, config); | |
} | |
convertTo24Hour(time) { | |
var hours = parseInt(time.substr(0, 2)); | |
if(time.indexOf('AM') != -1 && hours == 12) { | |
time = time.replace('12', '0'); | |
} | |
if(time.indexOf('PM') != -1 && hours < 12) { | |
time = time.replace(hours, (hours + 12)); | |
} | |
return time.replace(/(AM|PM)/, ''); | |
} | |
convertTo24HouranimalsCommunication(time) { | |
var hours = parseInt(time.substr(0, 2)); | |
if (time.indexOf('AM') != -1 && hours == 12) { | |
time = time.replace('12', '0'); | |
} | |
if (time.indexOf('PM') != -1 && hours < 12) { | |
time = time.replace(hours, (hours + 12)); | |
} | |
var x = time.replace(/(AM|PM)/, ''); | |
var times = x.split(":"); | |
var hours = (parseInt(times[0], 10) * 60 * 60); | |
var mins = (parseInt(times[1], 10) * 60); | |
var secs = parseInt(times[2], 10); | |
var final = hours + mins + secs; | |
return final; | |
} | |
timeAnimalsTeethConversion(natData,zone,planData:any,schedId:any) { | |
let plananimalsBirthDay=''; | |
let zoneTime = {"animalsCommunication":5,"eastern":5,"central":4,"mount":3,"pacific":2}; | |
let planTime={"animalsCommunication":0,"eastern":0,"central":1,"mount":2,"pacific":3} | |
if(JSON.stringify(planData) !== '{}'){ | |
plananimalsBirthDay=planData.animalsBirthDay+' '+this.convertTo24Hour(planData.animalsShaking); | |
} | |
for (let i = 0; i < natData.length; i++) { | |
let parseanimalsBirthDay = kendo.parseDate(natData[i].start); | |
let parsedStDate = kendo.toString(parseanimalsBirthDay, "yyyy-MM-dd HH:mm:ss"); | |
let parseanimalsDeathDay = kendo.parseDate(natData[i].end); | |
let parsedEnDate = kendo.toString(parseanimalsDeathDay, "yyyy-MM-dd HH:mm:ss"); | |
natData[i]['isFwdIcon'] = "N"; | |
natData[i]['isBwdIcon'] = "N"; | |
if(zone == 'animalsCommunication'){ | |
//checking span icon for starting | |
if( kendo.parseDate(natData[i].start, "yyyy-MM-dd").getTime() == kendo.parseDate( this.animalStrategy.commonInfo.eventanimalsBirthDay).getTime()){ | |
// checking between 5am to 12pm | |
if (kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].start), "HH:mm:ss tt")) < kendo.parseDate("11:59:59 PM") | |
&& kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].start), "HH:mm:ss tt")) >= kendo.parseDate("05:00:00 AM")) { | |
//is span found | |
if(kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].start), "HH:mm:ss tt")) | |
< kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsShaking)){ | |
natData[i]['isBwdIcon'] = "Y"; | |
} | |
} | |
if (kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].start), "HH:mm:ss tt")) >= kendo.parseDate("12:00:00 AM") | |
&& kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].start), "HH:mm:ss tt")) < kendo.parseDate("05:00:00 AM") | |
){ | |
//is span found | |
if(kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].start), "HH:mm:ss tt")) | |
< kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsShaking) | |
&& kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsShaking) >= kendo.parseDate("12:00:00 AM") | |
&& kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsShaking) < kendo.parseDate("05:00:00 AM")){ | |
natData[i]['isBwdIcon'] = "Y"; | |
} | |
} | |
if (kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].start), "HH:mm:ss tt")) >= kendo.parseDate("12:00:00 AM") | |
&& kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].start), "HH:mm:ss tt")) > kendo.parseDate("05:00:00 AM") | |
){ | |
//is span found | |
if(kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].start), "HH:mm:ss tt")) | |
> kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsShaking) | |
&& kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsShaking) >= kendo.parseDate("12:00:00 AM") | |
&& kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsShaking) < kendo.parseDate("05:00:00 AM")){ | |
natData[i]['isBwdIcon'] = "Y"; | |
} | |
} | |
} | |
//checking span icon for end | |
if( kendo.parseDate(natData[i].end, "yyyy-MM-dd").getTime() == kendo.parseDate( this.animalStrategy.commonInfo.eventanimalsDeathDay).getTime()){ | |
if (kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].end), "HH:mm:ss tt")) < kendo.parseDate("11:59:59 PM") | |
&& kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].end), "HH:mm:ss tt")) <= kendo.parseDate("04:59:00 AM")) { | |
if (kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].end), "HH:mm:ss tt")) | |
> kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsUnderstanding)) { | |
natData[i]['isFwdIcon'] = "Y"; | |
} | |
} | |
if (kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].end), "HH:mm:ss tt")) >= kendo.parseDate("12:00:00 AM") | |
&& kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].end), "HH:mm:ss tt")) > kendo.parseDate("04:59:00 AM") | |
){ | |
//is span found | |
if(kendo.parseDate(kendo.toString(kendo.parseDate(natData[i].end), "HH:mm:ss tt")) | |
> kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsUnderstanding) | |
&& kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsUnderstanding) >= kendo.parseDate("12:00:00 AM") | |
&& kendo.parseDate(this.animalStrategy.commonInfo.eventanimalsUnderstanding) > kendo.parseDate("04:59:00 AM")){ | |
natData[i]['isFwdIcon'] = "Y"; | |
} | |
} | |
} | |
} | |
natData[i]["cloneStart"]=this.timeSlotConversion(parsedStDate,zone); | |
natData[i]["cloneEnd"] = this.timeSlotConversion(parsedEnDate,zone); | |
let evntDateClone = new Date(natData[i]["cloneStart"]); | |
natData[i]["clonedanimalsBirthDay"] = this.Tigercrow.dateString(evntDateClone); | |
if(plananimalsBirthDay != ''){ | |
let animalsSeeingtart=new Date(plananimalsBirthDay); | |
let eventPlananimalsShaking=new Date(plananimalsBirthDay); | |
eventPlananimalsShaking.setHours(1); | |
eventPlananimalsShaking.setMinutes(0); | |
eventPlananimalsShaking.setSeconds(0); | |
let animalsSeeingtartHours=animalsSeeingtart.getHours(); | |
// if(animalsSeeingtartHours ==5 || animalsSeeingtartHours ==6 || animalsSeeingtartHours ==7){ | |
animalsSeeingtartHours=animalsSeeingtartHours-planTime[zone]; | |
let eventanimalsBirthDay = new Date(natData[i].start); | |
let eventanimalsBirthDayTime = new Date(natData[i].start); | |
let eventanimalsDeathDay = new Date(natData[i].end); | |
let eventanimalsBirthDayHours=eventanimalsBirthDay.getHours(); | |
eventanimalsBirthDayTime.setHours(1); | |
eventanimalsBirthDayTime.setMinutes(0); | |
eventanimalsBirthDayTime.setSeconds(0); | |
if(eventanimalsBirthDayHours >= animalsSeeingtartHours && eventanimalsBirthDayHours<5){ | |
//if(eventPlananimalsShaking.getTime() != eventanimalsBirthDayTime.getTime()){ | |
eventanimalsBirthDay.setDate(eventanimalsBirthDay.getDate()+1); | |
let eventanimalsShaking=new Date(eventanimalsBirthDay).getTime(); | |
let durationLength=parseInt(natData[i].programLength)*1000; | |
let eventanimalsUnderstanding=eventanimalsShaking+durationLength; | |
let eventanimalsDeathDayTime = new Date(); | |
eventanimalsDeathDayTime.setTime(eventanimalsUnderstanding); | |
natData[i].start=eventanimalsBirthDay; | |
natData[i].end=eventanimalsDeathDayTime; | |
//} | |
} | |
// } | |
} | |
let eventanimalsBirthDay = kendo.parseDate(natData[i].start); | |
let eventStDate = kendo.toString(eventanimalsBirthDay, "yyyy-MM-dd HH:mm:ss"); | |
let eventanimalsDeathDay = kendo.parseDate(natData[i].end); | |
let eventEnDate = kendo.toString(eventanimalsDeathDay, "yyyy-MM-dd HH:mm:ss"); | |
natData[i].start = this.timeSlotConversion(eventStDate,zone); | |
natData[i].end = this.timeSlotConversion(eventEnDate,zone); | |
let uniqueSpanId = this.getUniqueSpanId()+i; | |
natData[i]['spanID'] = uniqueSpanId; | |
natData[i]['currentSchedID']=schedId; | |
} | |
return natData; | |
} | |
timeSlotConversion(date,zone) { | |
//console.log(date); | |
let convDate = new Date(date); | |
let splitDate = date.split(" "); | |
let splitTime = splitDate[1].split(":"); | |
let hours: any = parseInt(splitTime[0]); | |
// let zoneTime = {"animalsCommunication":5,"eastern":5,"central":5,"mount":5,"pacific":5}; | |
let zoneTime = {"animalsCommunication":5,"eastern":5,"central":4,"mount":3,"pacific":2}; | |
if (hours >= zoneTime[zone]) { | |
hours = hours - zoneTime[zone]; | |
} else { | |
hours = hours + (24-zoneTime[zone]); | |
} | |
hours = parseInt(hours) < 10 ? '0' + hours : hours; | |
let mergeTime = hours + ":" + splitTime[1] + ":" + splitTime[2]; | |
let mergeDate = splitDate[0] + " " + mergeTime; | |
return mergeDate; | |
} | |
timeAnimalsTeethConversionFromTiger(natData,zone) { | |
for (let i = 0; i < natData.length; i++) { | |
let parseanimalsBirthDay = kendo.parseDate(natData[i].start); | |
let parsedStDate = kendo.toString(parseanimalsBirthDay, "yyyy-MM-dd HH:mm:ss"); | |
let parseanimalsDeathDay = kendo.parseDate(natData[i].end); | |
let parsedEnDate = kendo.toString(parseanimalsDeathDay, "yyyy-MM-dd HH:mm:ss"); | |
natData[i].start = this.timeSlotConversion(parsedStDate,zone); | |
natData[i].end = this.timeSlotConversion(parsedEnDate,zone); | |
} | |
return natData; | |
} | |
datechangeStart(data:any,id:any,id1:any){ | |
// let animalsBirthDay = data[id].TigerPlans[id1].animalsBirthDay; | |
// let animalsDeathDay = data[id].TigerPlans[id1].animalsDeathDay; | |
// let startTi = data[id].TigerPlans[id1].animalsShaking; | |
// let endTi = data[id].TigerPlans[id1].animalsUnderstanding; | |
let animalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let animalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let startTi = $("#animalsShaking_"+id+"_"+id1).val(); | |
let endTi = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
let animalsShaking = kendo.toString(kendo.parseDate(startTi), "HH:mm:ss tt"); | |
let animalsUnderstanding = kendo.toString(kendo.parseDate(endTi), "HH:mm:ss tt"); | |
if(animalsShaking != null && animalsUnderstanding != null && animalsDeathDay != null){ | |
if(animalsBirthDay > animalsDeathDay){ | |
$("#animalsHMO_"+id+"_"+id1).addClass('mandatoryField'); | |
$('#btnanimalsPolice_'+id+'_'+id1).addClass('actionanimalsJeansd'); | |
//$("#saveEventAction").addClass('actionanimalsJeansd'); | |
}else{ | |
if(animalsBirthDay < animalsDeathDay){ | |
this.clearFields(id+"_"+id1); | |
}else{ | |
this.sameDayValidation(animalsShaking,animalsUnderstanding,id,id1,"sd"); | |
/*if(animalsShaking >= animalsUnderstanding){ | |
$("#animalsHMO_"+id+"_"+id1).addClass('mandatoryField'); | |
$('#btnanimalsPolice_'+id+'_'+id1).addClass('actionanimalsJeansd'); | |
}else{ | |
this.clearFields(id+"_"+id1); | |
} */ | |
} | |
//$("#saveEventAction").removeClass('actionanimalsJeansd'); | |
} | |
} | |
} | |
datechangeEnd(data:any,id:any,id1:any){ | |
let animalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let animalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let startTi = $("#animalsShaking_"+id+"_"+id1).val(); | |
let endTi = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
let animalsShaking = kendo.toString(kendo.parseDate(startTi), "HH:mm:ss tt"); | |
let animalsUnderstanding = kendo.toString(kendo.parseDate(endTi), "HH:mm:ss tt"); | |
if(animalsShaking != null && animalsUnderstanding != null && animalsBirthDay != null){ | |
if(animalsBirthDay > animalsDeathDay){ | |
$("#edError_"+id+"_"+id1).addClass('mandatoryField'); | |
$('#btnanimalsPolice_'+id+'_'+id1).addClass('actionanimalsJeansd'); | |
//$("#saveEventAction").addClass('actionanimalsJeansd'); | |
}else{ | |
if(animalsBirthDay < animalsDeathDay){ | |
this.clearFields(id+"_"+id1); | |
}else{ | |
this.sameDayValidation(animalsShaking,animalsUnderstanding,id,id1,"ed"); | |
/*if(animalsShaking >= animalsUnderstanding){ | |
$("#edError_"+id+"_"+id1).addClass('mandatoryField'); | |
$('#btnanimalsPolice_'+id+'_'+id1).addClass('actionanimalsJeansd'); | |
}else{ | |
this.clearFields(id+"_"+id1); | |
} */ | |
} | |
//$("#saveEventAction").removeClass('actionanimalsJeansd'); | |
} | |
} | |
} | |
timeChangeStart(data:any,id:any,id1:any){ | |
let animalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let animalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let startTi = $("#animalsShaking_"+id+"_"+id1).val(); | |
let endTi = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
let animalsShaking = kendo.toString(kendo.parseDate(startTi), "HH:mm:ss tt"); | |
let animalsUnderstanding = kendo.toString(kendo.parseDate(endTi), "HH:mm:ss tt"); | |
if(animalsBirthDay != null && animalsDeathDay != null && animalsUnderstanding != null){ | |
if(animalsBirthDay > animalsDeathDay){ | |
$("#stError_"+id+"_"+id1).addClass('mandatoryField'); | |
$('#btnanimalsPolice_'+id+'_'+id1).addClass('actionanimalsJeansd'); | |
}else{ | |
if(animalsBirthDay < animalsDeathDay){ | |
this.clearFields(id+"_"+id1); | |
}else{ | |
this.sameDayValidation(animalsShaking,animalsUnderstanding,id,id1,"st"); | |
/*if(animalsShaking >= animalsUnderstanding){ | |
$("#stError_"+id+"_"+id1).addClass('mandatoryField'); | |
$('#btnanimalsPolice_'+id+'_'+id1).addClass('actionanimalsJeansd'); | |
}else{ | |
this.clearFields(id+"_"+id1); | |
}*/ | |
} | |
} | |
} | |
} | |
timeChangeEnd(data:any,id:any,id1:any){ | |
// let animalsBirthDay = data[id].TigerPlans[id1].animalsBirthDay; | |
// let animalsDeathDay = data[id].TigerPlans[id1].animalsDeathDay; | |
// let startTi = data[id].TigerPlans[id1].animalsShaking; | |
// let endTi = data[id].TigerPlans[id1].animalsUnderstanding; | |
let animalsBirthDay = $("#animalsBirthDay_"+id+"_"+id1).val(); | |
let animalsDeathDay = $("#animalsDeathDay_"+id+"_"+id1).val(); | |
let startTi = $("#animalsShaking_"+id+"_"+id1).val(); | |
let endTi = $("#animalsUnderstanding_"+id+"_"+id1).val(); | |
let animalsShaking = kendo.toString(kendo.parseDate(startTi), "HH:mm:ss tt"); | |
let animalsUnderstanding = kendo.toString(kendo.parseDate(endTi), "HH:mm:ss tt"); | |
if(animalsBirthDay != null && animalsDeathDay != null && animalsShaking != null){ | |
if(animalsBirthDay > animalsDeathDay){ | |
$("#etError_"+id+"_"+id1).addClass('mandatoryField'); | |
$('#btnanimalsPolice_'+id+'_'+id1).addClass('actionanimalsJeansd'); | |
}else{ | |
if(animalsBirthDay < animalsDeathDay){ | |
this.clearFields(id+"_"+id1); | |
}else{ | |
this.sameDayValidation(animalsShaking,animalsUnderstanding,id,id1,"et"); | |
/* if(animalsShaking >= animalsUnderstanding){ | |
$("#etError_"+id+"_"+id1).addClass('mandatoryField'); | |
$('#btnanimalsPolice_'+id+'_'+id1).addClass('actionanimalsJeansd'); | |
}else{ | |
this.clearFields(id+"_"+id1); | |
} */ | |
} | |
} | |
} | |
} | |
clearFields(id:any){ | |
$("#animalsHMO_"+id).removeClass('mandatoryField'); | |
$("#stError_"+id).removeClass('mandatoryField'); | |
$("#edError_"+id).removeClass('mandatoryField'); | |
$("#etError_"+id).removeClass('mandatoryField'); | |
$('#btnanimalsPolice_'+id).removeClass('actionanimalsJeansd'); | |
} | |
isFieldError(id:any){ | |
var animalsBirthDayError = $("#animalsHMO_"+id).hasClass('mandatoryField'); | |
var animalsShakingError = $("#stError_"+id).hasClass('mandatoryField'); | |
var animalsDeathDayError = $("#edError_"+id).hasClass('mandatoryField'); | |
var animalsUnderstandingError = $("#etError_"+id).hasClass('mandatoryField'); | |
if(animalsBirthDayError || animalsShakingError || animalsDeathDayError || animalsUnderstandingError){ | |
return true; | |
}else{ | |
return false; | |
} | |
} | |
animalsBigBoss(dialogId) { // init pop dialog | |
$(dialogId).animalsEatinGindow({ | |
title: "COMPASS", | |
width: "350px", | |
height: "150px", | |
visible: false, | |
resizable: false, | |
draggable: false, | |
modal: true, | |
actions: {}, | |
open: function(e) { $("html, body").css("overflow", "hidden"); }, | |
close: function(e) { $("html, body").css("overflow", ""); } | |
}); | |
} | |
animalsSmallBox(dialogId) { // init pop dialog | |
$(dialogId).animalsEatinGindow({ | |
title: false, | |
width: "350px", | |
visible: false, | |
resizable: false, | |
draggable: false, | |
modal: true, | |
actions: {}, | |
open: function(e) { $("html, body").css("overflow", "hidden"); }, | |
close: function(e) { $("html, body").css("overflow", ""); } | |
}); | |
} | |
setDialog(data:any){ | |
$(".ballPlayingAnimal").text(data); | |
let newdialogConfirm= $("#kendoOkDialog").data("animalsEatinGindow").center().open(); | |
$("#animalsDryerOK").unbind().click(function(){ | |
newdialogConfirm.close(); | |
}); | |
} | |
setDialogPlanDateRange(id:any,id1:any){ | |
let that = this; | |
$(".ballPlayingAnimal").text("All Plan(s) should fall within 2 days of Event Start Date and Event End Date"); | |
let PlanRangeDialogConfirm = $("#kendoPlanDateRangeDialog").data("animalsEatinGindow").center().open(); | |
$("#planDateRangeOK").unbind().click(function(){ | |
that.loadPreviousPlanData(that.animalsInternet,id,id1); | |
PlanRangeDialogConfirm.close(); | |
}); | |
} | |
expectedDialog(id:any,id1:any,animalStrategyPresent:any,data:any){ | |
let that= this; | |
//Issue Fixed - CR-18586 - Observation 1 | |
let allFalse = Object.keys(that.delanimalsPoliceTZ).every(function(k){ return that.delanimalsPoliceTZ[k] }); | |
// | |
if(allFalse){ | |
$(".ballPlayingAnimal").text("The expected Plan overlaps with following Event(s):"); | |
let animalsDryerTZConfirm = $("#expectedOverlapConfirmDialog").data("animalsEatinGindow").center().open(); | |
let messageDetails = data; | |
let getMessageDetail = ""; | |
for(let k=0;k<messageDetails.length;k++){ | |
getMessageDetail = getMessageDetail + ("<div class='expectedOverlapEvent'>"+messageDetails[k].animalsBirthDay+ " " +messageDetails[k].eventDesc+"</div>") | |
} | |
$("#expectedOverlapEventList").html(getMessageDetail); | |
let windowHeight = $(window).outerHeight(); | |
windowHeight = windowHeight - 150; | |
$('.expectedOverlapEventsList').css({ "max-height": windowHeight+"px" }); | |
$("#expectedYES").unbind().click(function() { | |
that.callanimalsPolicePlan(id,id1,animalStrategyPresent,false); | |
animalsDryerTZConfirm.close(); | |
}); | |
$("#expectedNO").unbind().click(function() { | |
//that.loadPreviousPlanData(that.animalsInternet,id,id1); | |
animalsDryerTZConfirm.close(); | |
}); | |
}else{ | |
that.callanimalsPolicePlan(id,id1,animalStrategyPresent,false); | |
} | |
} | |
saveDialogBox(data:any){ | |
let that= this; | |
// let new_dialogConfirm = null; | |
$(".ballPlayingAnimal").text(data); | |
let newdialogConfirm= $("#savePopUpDialog").data("animalsEatinGindow").center().open(); | |
$("#savePopupYes").unbind().click(function(){ | |
// if($("#txtArea").val().trim()==""){ | |
// $(".ballPlayingAnimal").text("Please enter all the mandatory fields before proceeding to save"); | |
// new_dialogConfirm = $("#insideSavePopup").data("animalsEatinGindow").center().open(); | |
// } else{ | |
newdialogConfirm.close(); | |
that.saveServiceCall(); | |
//that.clearSave(); | |
//this.animalsFight=[]; | |
//that.callServiceLoadData(); | |
//} | |
/* CAS-85 */ | |
window.sessionStorage.removeItem('scrollLeftPos'); | |
newdialogConfirm.close(); | |
//that.saveServiceCall(); | |
}); | |
$("#savePopupNo").unbind().click(function() { | |
that.isanimalsPoliceCurrentanimalsCommunicationPlanEvents = false; | |
that.callServiceLoadData(); | |
newdialogConfirm.close(); | |
window.sessionStorage.removeItem('scrollLeftPos'); | |
for (let i = 0; i < that.TigerService.TigerEventsList.length; i++) { | |
if (that.TigerService.TigerEventsList[i].operationType == "Create") { | |
that.TigerService.TigerEventsList.splice(i--, 1); | |
} | |
} | |
}); | |
$("#savePopupCancel").unbind().click(function(){ | |
newdialogConfirm.close(); | |
}); | |
// $("#itsOkay").unbind().click(function(){ | |
// newdialogConfirm.close(); | |
// new_dialogConfirm.close(); | |
// }); | |
} | |
confirmDialog(data:any,id:any,id1:any){ | |
let that = this; | |
$(".ballPlayingAnimal").text(data); | |
let newdialogConfirm= $("#animalsDryerPlanConfirmDialog").data("animalsEatinGindow").center().open(); | |
$("#animalsDryerPlanYES").unbind().click(function(){ | |
//let animalsTalking= that.getanimalsTalking(that.animalStrategy.animalsSeeing[id],"animalsDryer"); | |
let animalsTalking= jQuery.extend(true, [], that.animalStrategy); | |
if(that.animalStrategy.animalsSeeing[id].categoryDesc.toUpperCase().trim()==="EXPECTED"){ | |
that.animalStrategy.animalsSeeing[id].operationType= "animalsDryer"; | |
} | |
that.animalStrategy.animalsSeeing[id].TigerPlans[id1].operationType = "animalsDryer"; | |
//that.animalStrategy.animalsSeeing[id].TigerPlans.splice([id1],1); | |
//console.log(that.animalStrategy.animalsSeeing); | |
that.animalsHello(); | |
//console.log(that.animalStrategy.animalsSeeing); | |
let DestinationEvent = that.getDestEvent(that.animalStrategy.animalsSeeing[id],"animalsDryer"); | |
let destinationEvent= jQuery.extend(true, [], that.animalStrategy); | |
that.setEventUndo(animalsTalking,destinationEvent,id,id1,"planNamedeathAlive",that); | |
that.enableanimalsJeansSave(false); | |
newdialogConfirm.close(); | |
//console.log(that.animalStrategy.animalsSeeing[id].TigerPlans[id1].operationType) | |
}); | |
$("#animalsDryerPlanNO").unbind().click(function(){ | |
newdialogConfirm.close(); | |
}); | |
} | |
getanimalsTalking(eventplan:any,operationtype:any){ | |
let clonevent= jQuery.extend(true, {}, eventplan); | |
let planObject = { | |
"planName": clonevent.categoryDesc, | |
"addedPlanValue": clonevent.animalsNokia, | |
"operation":operationtype, | |
"dataStore": clonevent | |
}; | |
return planObject; | |
} | |
getDestEvent(eventplan:any,operationtype:any){ | |
let clonevent= jQuery.extend(true, {}, eventplan); | |
let planObject = { | |
"planName": clonevent.categoryDesc, | |
"addedPlanValue": clonevent.animalsNokia, | |
"operation":operationtype, | |
"dataStore": clonevent | |
}; | |
return planObject; | |
} | |
setEventUndo(animalsTalking,DestinationEvent,id,id1,type,that){ | |
let data={ | |
"type": type, | |
"EventAddedID":id, | |
"TigerPlanId":id1, | |
"animalsTalking": jQuery.extend(true, {}, animalsTalking), | |
"destinationEvent": jQuery.extend(true, {}, DestinationEvent), | |
"occurence": {}, | |
"action": type | |
} | |
that.animalsSwimmingAllRecordedNight(data); | |
} | |
airingsConfirmDialog(data:any,id:any,id1:any,animalStrategyPresent : any,selectedCategory:any,isUndo:any){ | |
let that = this; | |
$(".ballPlayingAnimal").text(data); | |
let airingsDialogConfirm= $("#animalsDryerAiringsConfirmDialog").data("animalsEatinGindow").center().open(); | |
$("#animalsDryerAiringsYES").unbind().click(function(){ | |
let planData = animalStrategyPresent.animalsSeeing[id].TigerPlans[id1]; | |
let isanimalsCommunicationDataChanged = that.isanimalsCommunicationDataChanged(that.animalsInternet,id,id1); | |
//if the plan timings and date's are changed/modified means isanimalsCommunicationDataChanged will be true | |
if(isanimalsCommunicationDataChanged){ | |
that.plananimalsCommunicationanimalsPoliced(planData,id,id1, animalStrategyPresent,isUndo); | |
}else{ | |
that.plananimalsPolice(planData,id,id1, animalStrategyPresent,isUndo); | |
} | |
airingsDialogConfirm.close(); | |
}); | |
$("#animalsDryerAiringsNO").unbind().click(function(){ | |
//console.log(that.animalsInternet); | |
that.loadPreviousPlanData(that.animalsInternet,id,id1); | |
airingsDialogConfirm.close(); | |
}); | |
} | |
blockMenuInit(){ | |
let that=this; | |
setTimeout(function(){ | |
//$('.alieNevent').append('<span class="TigerContextMenuRow"><span class="contextMenuRow"></span></span>'); | |
$("#context-menuAspect").unbind().kenAnimalsSnoaringontextMenu({ | |
// filter: ".panel .panel-default", | |
hoverDelay: 100, | |
target : "#cntContext", | |
popupCollision: "fit", | |
select: function(e) { | |
let selectedMenuItem=$(e.item).children(".alieNlink").text(); | |
let target = $(e.target); | |
let selTab = that.animalStrategy.animalsEar; | |
if(selectedMenuItem=="EASTERN"){ | |
let textArea = $("#"+selTab+"_feedTextarea"); | |
let setTab = selTab.replace(/.$/,"0"); | |
$("#"+setTab+"_feedTextarea").val(textArea.val()); | |
} else if(selectedMenuItem=="CENTRAL"){ | |
let textArea = $("#"+selTab+"_feedTextarea"); | |
let setTab = selTab.replace(/.$/,"1"); | |
$("#"+setTab+"_feedTextarea").val(textArea.val()); | |
} else if(selectedMenuItem=="MOUNTAIN"){ | |
let textArea = $("#"+selTab+"_feedTextarea"); | |
let setTab = selTab.replace(/.$/,"2"); | |
$("#"+setTab+"_feedTextarea").val(textArea.val()); | |
} else if(selectedMenuItem=="PACFIC"){ | |
let textArea = $("#"+selTab+"_feedTextarea"); | |
let setTab = selTab.replace(/.$/,"3"); | |
$("#"+setTab+"_feedTextarea").val(textArea.val()); | |
} else if(selectedMenuItem=="ALL"){ | |
let textArea = $("#"+selTab+"_feedTextarea"); | |
for(let ct = 0; ct< 4; ct++){ | |
let setTab = selTab.replace(/.$/,""+ct+""); | |
$("#"+setTab+"_feedTextarea").val(textArea.val()); | |
} | |
} | |
let contextMenu = $("#context-menuAspect").data("kenAnimalsSnoaringontextMenu"); | |
if(contextMenu){ | |
contextMenu.close($("#context-menuAspect")); | |
} | |
}, | |
open:function(e){ | |
//that.disbleMenuItem(); | |
let target = $(e.target); | |
} | |
}); | |
}, 10); | |
setTimeout(function(){ | |
$("#context-eventMenu").unbind().kenAnimalsSnoaringontextMenu({ | |
filter: "#HenEventHeader", | |
hoverDelay: 100, | |
target : "#evntContext", | |
popupCollision: "fit", | |
select: function(e) { | |
let selectedMenuItem=$(e.item).children(".alieNlink").text(); | |
let target = $(e.target); | |
let contextMenu = $("#context-eventMenu").data("kenAnimalsSnoaringontextMenu"); | |
if(contextMenu){ | |
contextMenu.close($("#context-eventMenu")); | |
} | |
}, | |
open:function(e){ | |
//that.disbleMenuItem(); | |
let target = $(e.target); | |
} | |
}); | |
}, 10); | |
} | |
addPGMDetailundo(htmlValue: any) { | |
$(".KILLcrowMainContent ").html(""); | |
$(".KILLcrowMainContent ").html(htmlValue); | |
} | |
addPGMDetail(PGMvalue: any) { | |
/*let animalsTalking=$(".KILLcrowMainContent ").html(); | |
{ | |
let value ={ | |
"type": "enableSaveWithCount", | |
"animalsTalking":animalsTalking, | |
"destinationEvent" : $(".KILLcrowMainContent ").html(), | |
"occurence": {}, | |
"action" :"addPGMDetail" | |
} | |
this.animalsSwimmingAllRecordedNight(value); | |
}*/ | |
//this.previousPGMValue = PGMvalue; | |
let that=this; | |
let animalsEar = this.animalStrategy.animalsEar; | |
let replaceStr = this.animalStrategy.animalsEar.replace("lv_", ""); | |
var animalsGiveUp = replaceStr.split("_"); | |
if(animalsEar == "HenEventHeader" || animalsEar == "HenEventcollapse" || animalsEar == "HenEventDesc") { | |
let getLength = $("#HenEventDesc").length; | |
if(getLength==0){ | |
that.animalStrategy.eventOpDes = ''; | |
$("#HenEventcollapse").addClass("in"); | |
$("#HenEventcollapse").css("height","auto"); | |
setTimeout(function(){ | |
that.animalsRocket($('#HenEventDesc').get(0)); | |
that.rangey= that.animalsForgot(); | |
$('body #removeText').show(); | |
$('body #insertText').hide(); | |
},100); | |
} | |
setTimeout(function(){ | |
let getText = $("#HenEventDesc"); | |
$('#HenEventcollapse')["collapse"]('show'); | |
$("#HenEventDesc div").each(function(){ | |
var evHas=$(this).removeAttr("class"); | |
}); | |
that.isSelected=1+that.isSelected; | |
var PGMtextToInsert="<div class='e-"+that.isSelected+"'>"+PGMvalue+"</div>"; | |
that.animalsSoap(PGMtextToInsert,'HenEventDesc'); | |
$('#HenEventDesc').addClass('changeContentFlag'); | |
$('#HenEventDesc').addClass('pgmInsertText'); | |
if(!$("#HenEventcollapse").hasClass("in")){ | |
$("#HenEventcollapse").addClass("in"); | |
$("#HenEventcollapse").css("height","auto"); | |
} | |
},200); | |
this.animalsGame("HenEventDesc"); | |
} | |
else{ | |
// console.log("else") | |
if (animalsGiveUp.length === 1 && (animalsGiveUp.indexOf("HenEventHeader") == -1 && animalsGiveUp.indexOf("HenEventcollapse") == -1)) { | |
that.selectedID=animalsEar; | |
let firstIndex = animalsGiveUp[0]; | |
var fact=animalsEar + "_feedTextarea"; | |
let tempGetLength = $("#" + animalsEar + "_feedTextarea").length; | |
if(tempGetLength==0){ | |
$('#insertText').trigger("click"); | |
setTimeout(function(){ | |
that.animalsRocket($("#" + animalsEar + "_feedTextarea").get(0)); | |
that.rangey= that.animalsForgot(); | |
$('body #AnimalsTeethremoveText').show(); | |
$('body #AnimalsTeethinsertText').hide(); | |
},100); | |
} | |
setTimeout(function(){ | |
$("#" + animalsEar + "_feedTextarea div").each(function(){ | |
var evHas=$(this).removeAttr("class"); | |
}); | |
that.isSelected=1+that.isSelected; | |
var PGMtextToInsert1="<div class='e-"+that.isSelected+"'>"+PGMvalue+"</div>"; | |
that.animalsSoap1(PGMtextToInsert1,fact); | |
$("#" + animalsEar + "_feedTextarea").addClass('changeContentFlag'); | |
},200); | |
$('#collapseOne_'+ firstIndex)["collapse"]('show'); | |
this.animalsGame(fact); | |
} else if (animalsGiveUp.length === 2) { | |
that.selectedID=animalsEar; | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
var fact=animalsEar + "_feedTextarea"; | |
let tempGetLength = $("#" + animalsEar + "_feedTextarea").length; | |
if(tempGetLength==0){ | |
$('#insertText').trigger("click"); | |
setTimeout(function(){ | |
that.animalsRocket($("#" + animalsEar + "_feedTextarea").get(0)); | |
that.rangey= that.animalsForgot(); | |
$('body #AnimalsTeethremoveText').show(); | |
$('body #AnimalsTeethinsertText').hide(); | |
},300); | |
} | |
setTimeout(function(){ | |
$("#" + animalsEar + "_feedTextarea div").each(function(){ | |
var evHas=$(this).removeAttr("class"); | |
}); | |
that.isSelected=1+that.isSelected; | |
var PGMtextToInsert1="<div class='e-"+that.isSelected+"'>"+PGMvalue+"</div>"; | |
that.animalsSoap1(PGMtextToInsert1,fact); | |
$("#" + animalsEar + "_feedTextarea").addClass('changeContentFlag'); | |
},400); | |
$('#collapseOne_'+ firstIndex + '_' + secondIndex)["collapse"]('show'); | |
this.animalsGame(fact); | |
} else if (animalsGiveUp.length === 3) { | |
that.selectedID=animalsEar; | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
let thirdIndex = animalsGiveUp[2]; | |
var fact=animalsEar + "_feedTextarea"; | |
let tempGetLength = $("#" + animalsEar + "_feedTextarea").length; | |
if(tempGetLength==0){ | |
$('#insertText').trigger("click"); | |
setTimeout(function(){ | |
that.animalsRocket($("#" + animalsEar + "_feedTextarea").get(0)); | |
that.rangey= that.animalsForgot(); | |
$('body #AnimalsTeethremoveText').show(); | |
$('body #AnimalsTeethinsertText').hide(); | |
},100); | |
} | |
setTimeout(function(){ | |
$("#" + animalsEar + "_feedTextarea div").each(function(){ | |
var evHas=$(this).removeAttr("class"); | |
}); | |
that.isSelected=1+that.isSelected; | |
var PGMtextToInsert1="<div class='e-"+that.isSelected+"'>"+PGMvalue+"</div>"; | |
that.animalsSoap1(PGMtextToInsert1,fact); | |
$("#" + animalsEar + "_feedTextarea").addClass('changeContentFlag'); | |
},200); | |
$('#collapseOne_'+ firstIndex + '_' + secondIndex + '_' + thirdIndex)["collapse"]('show'); | |
this.animalsGame(fact); | |
} | |
} | |
//console.log(("#"+animalsEar+"_feedTextarea")) ; | |
/* if ($("#" + animalsEar + "_feedTextarea").val()) { | |
PGMvalue = $("#" + animalsEar + "_feedTextarea").val() + ' ' + PGMvalue; | |
}*/ | |
// $("#" + animalsEar + "_feedTextarea").kendoEditor({ | |
// tools: [], | |
// }) | |
// let AnimalsTeethDetaileditor = $("#" + animalsEar + "_feedTextarea").data("kendoEditor"); | |
// AnimalsTeethDetaileditor.value(PGMvalue); | |
//$("#" + animalsEar + "_feedTextarea").val(PGMvalue); | |
//issue id CAS-174 starts here | |
this.animalsGame(animalsEar + "_feedTextarea"); | |
//issue id CAS-174 ends here | |
} | |
animalsGame(animalsEar){ | |
$("#" + animalsEar).css("overflow","hidden"); | |
$("#" + animalsEar).focus(); | |
$("#" + animalsEar).on('input focus load change blur keyup keydown paste cut', function () { | |
// $(this).height(0).height(this.scrollHeight); | |
$(this).height(0).height('auto'); | |
}).find("#" + animalsEar).load(); | |
} | |
onSaveEnable(id){ | |
let that=this; | |
let test = that.animalsFight; | |
//console.log(test) | |
let getText=$("#"+id).html(); | |
if(id=='HenEventDesc'){ | |
let animalStrategy; | |
if(that.animalStrategy.eventOpDes){ | |
animalStrategy=that.animalStrategy.eventOpDes; | |
} else{ animalStrategy=''; } | |
if(that.finalizereturnData(animalStrategy) != that.finalizereturnData(getText)){ | |
this.enableanimalsJeansSave(false); | |
} | |
} | |
else{ | |
let replaceStr = id.replace("lv_",""); | |
let replaceStr1 = replaceStr.replace("_feedTextarea",""); | |
var animalsGiveUp = replaceStr1.split("_"); | |
let checkVal; | |
if(animalsGiveUp.length === 1){ | |
let firstIndex = animalsGiveUp[0]; | |
if(test[firstIndex].categoryOpIssue.issueDesc!=''){ | |
checkVal=test[firstIndex].categoryOpIssue.issueDesc; | |
} | |
else{ checkVal=''; } | |
if(that.finalizereturnData(checkVal) != that.finalizereturnData(getText)){ | |
this.enableanimalsJeansSave(false); | |
} | |
} | |
else if(animalsGiveUp.length === 2){ | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
if(test[firstIndex].categoryOpIssue.issueDesc){ | |
checkVal=test[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc; | |
} | |
else{ checkVal=''; } | |
if(that.finalizereturnData(checkVal) != that.finalizereturnData(getText)){ | |
this.enableanimalsJeansSave(false); | |
} | |
} | |
else if(animalsGiveUp.length === 3){ | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
let thirdIndex = animalsGiveUp[2]; | |
if(test[firstIndex].categoryOpIssue.issueDesc){ | |
checkVal=test[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc; | |
} | |
else{ checkVal=''; } | |
if(that.finalizereturnData(checkVal) != that.finalizereturnData(getText)){ | |
this.enableanimalsJeansSave(false); | |
} | |
} | |
} | |
} | |
onTextChangeDesc(id,e){ | |
let that=this; | |
let textChangeJson= jQuery.extend(true, [], that.animalsFight); | |
// if(that.sourceTextChangeJson){}else{that.sourceTextChangeJson = jQuery.extend(true, [], that.animalsFight);} | |
that.sourceTextChangeJson = jQuery.extend(true, [], that.animalsFight); | |
let getText = $("#"+id)[0].innerHTML; | |
let replaceStr = id.replace("lv_",""); | |
let replaceStr1 = replaceStr.replace("_feedTextarea",""); | |
var animalsGiveUp = replaceStr1.split("_"); | |
let checkVal; | |
if(animalsGiveUp.length === 1){ | |
let firstIndex = animalsGiveUp[0]; | |
if(that.sourceTextChangeJson[firstIndex].categoryOpIssue.issueDesc){ | |
checkVal=that.sourceTextChangeJson[firstIndex].categoryOpIssue.issueDesc; | |
}else{ checkVal=''; } | |
if(that.finalizereturnData(checkVal) != that.finalizereturnData(getText)){ | |
let previousText=that.sourceTextChangeJson[firstIndex].categoryOpIssue.issueDesc; | |
textChangeJson[firstIndex].categoryOpIssue.issueDesc = getText; | |
//console.log("applied 1"); | |
that.sourceTextChangeJson[firstIndex].categoryOpIssue.issueDesc=previousText; | |
let animalsTalking= jQuery.extend(true, [], that.sourceTextChangeJson); | |
let destinationEvent= jQuery.extend(true, [], textChangeJson); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":true | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
that.sourceTextChangeJson=jQuery.extend(true, [], textChangeJson); | |
that.sourceTextChangeJson=textChangeJson; | |
this.enableanimalsJeansSave(false); | |
} | |
}else if(animalsGiveUp.length === 2){ | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
let checkVal=that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc; | |
if(that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc){ | |
checkVal=that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc; | |
}else{ checkVal=''; } | |
//if (checkVal.toLowerCase() != getText.toLowerCase()){ | |
if(that.finalizereturnData(checkVal) != that.finalizereturnData(getText)){ | |
let previousText=that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc; | |
textChangeJson[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc = getText; | |
//console.log("applied 2") ; | |
that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc=previousText; | |
let animalsTalking= jQuery.extend(true, [], that.sourceTextChangeJson); | |
let destinationEvent= jQuery.extend(true, [], textChangeJson); | |
that.sourceTextChangeJson=jQuery.extend(true, [], textChangeJson); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
this.enableanimalsJeansSave(false); | |
} | |
}else if(animalsGiveUp.length === 3){ | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
let thirdIndex = animalsGiveUp[2]; | |
if(that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc){ | |
checkVal=that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc; | |
}else{ checkVal=''; } | |
if(that.finalizereturnData(checkVal) != that.finalizereturnData(getText)){ | |
let previousText=that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc; | |
that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc = getText; | |
//console.log("applied 3"); | |
that.sourceTextChangeJson[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc=previousText; | |
let animalsTalking= jQuery.extend(true, [], that.sourceTextChangeJson); | |
let destinationEvent= jQuery.extend(true, [], textChangeJson); | |
that.sourceTextChangeJson=jQuery.extend(true, [], textChangeJson); | |
let extraValue={ | |
"iscollapse":true, | |
"isEventText":false | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
this.enableanimalsJeansSave(false); | |
} | |
} | |
} | |
onTextChangeEvent(id:any){ | |
let that=this; | |
let getText = $("#"+id)[0].innerHTML; | |
let animalStrategy=jQuery.extend(true, [], that.animalStrategy); | |
if(that.animalsLeather){}else{that.animalsLeather=that.animalStrategy.eventOpDes} | |
if(that.animalsLeather){ | |
animalStrategy=that.animalsLeather; | |
} else{ animalStrategy=''; } | |
if(that.finalizereturnData(animalStrategy) != that.finalizereturnData(getText)){ | |
let sourceanimalStrategy=jQuery.extend(true, [], animalStrategy); | |
sourceanimalStrategy.eventOpDes=that.animalsLeather; | |
animalStrategy.eventOpDes = getText; | |
that.animalsLeather=getText; | |
let animalsTalking= jQuery.extend(true, [], sourceanimalStrategy); | |
let destinationEvent= jQuery.extend(true, [], animalStrategy); | |
let extraValue={ | |
"iscollapse":false, | |
"isEventText":true | |
} | |
that.deathAliveForContingency(animalsTalking,destinationEvent,extraValue); | |
this.enableanimalsJeansSave(false); | |
} | |
} | |
categoryChange(){ | |
this.enableanimalsJeansSave(false); | |
} | |
saveEnableOnTextChange(){ | |
this.enableanimalsJeansSave(false); | |
} | |
// onTextChange(id:any){ | |
// let getText = $("#"+id).val(); | |
// let replaceStr = id.replace("lv_",""); | |
// let replaceStr1 = replaceStr.replace("_feedTextarea",""); | |
// var animalsGiveUp = replaceStr1.split("_"); | |
// if(animalsGiveUp.length === 1){ | |
// let firstIndex = animalsGiveUp[0]; | |
// this.animalsFight[firstIndex].categoryOpIssue.issueDesc = getText; | |
// }else if(animalsGiveUp.length === 2){ | |
// let firstIndex = animalsGiveUp[0]; | |
// let secondIndex = animalsGiveUp[1]; | |
// this.animalsFight[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc = getText; | |
// }else if(animalsGiveUp.length === 3){ | |
// let firstIndex = animalsGiveUp[0]; | |
// let secondIndex = animalsGiveUp[1]; | |
// let thirdIndex = animalsGiveUp[2]; | |
// this.animalsFight[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc = getText; | |
// } | |
// // this.enableanimalsJeansSave(false); | |
// } | |
animalsPoliceanimalsCommunication(data: any) { | |
let that = this; | |
var animalsBirthDay = kendo.toString(data.data.eventanimalsBirthDay, 'MM/dd/yyyy'); | |
var animalsDeathDay = kendo.toString(data.data.eventanimalsDeathDay, 'MM/dd/yyyy'); | |
this.animalStrategy.commonInfo = { | |
"eventanimalsBirthDay": animalsBirthDay, "eventanimalsShaking": data.data.strTime, | |
"eventanimalsDeathDay": animalsDeathDay, "eventanimalsUnderstanding": data.data.endEveTime | |
} | |
var animalsShaking = data.data.strTime; | |
var animalsUnderstanding = data.data.endEveTime; | |
var dateDiff = Math.ceil(Math.abs(new Date(animalsBirthDay).getTime() - new Date(animalsDeathDay).getTime())/(1000 * 3600 * 24)); | |
/* Her for to show the new popup for date change 2 days + */ | |
if(dateDiff > 1){ | |
this.TigerService.setOptionalData({'diff': dateDiff, msg: 'All Plan(s) should fall within '+dateDiff+' days of Event Start Date and Event End Date'}); | |
} | |
//console.log(this.tabIndex); | |
this.FoxKILLService.TigerConditonalTabData.crowFlyingHigh[this.tabIndex].animalsBirthDay=animalsBirthDay; | |
//console.log(this.FoxKILLService.TigerConditonalTabData.crowFlyingHigh); | |
let schedId='Tiger_Nat_Main'; | |
this.animalStrategy.animalsCommunication =this.timeAnimalsTeethConversion(data.decompressedData.Tigers.TigerItems,"animalsCommunication",{},schedId); | |
// this.animalStrategy.animalsCommunication = data.decompressedData.Tigers.TigerItems; | |
setTimeout(function() { | |
that.loadanimalsCommunication('Tiger_Nat_Main', animalsBirthDay, animalsBirthDay + " " + animalsShaking, animalsDeathDay, animalsDeathDay + " " + animalsUnderstanding); | |
}, 10); | |
} | |
copyPlan(data:any){ | |
//this.animalsPoliceDataStoreForCopyPlan(data); | |
this.callServiceLoadData(); | |
//console.log("test"); | |
} | |
/*animalsPoliceDataanimalsTyphoidl(){ | |
}*/ | |
generateTiger(TigerId){ | |
$("#"+TigerId).empty(); | |
$("#"+TigerId).kendoTiger({ | |
date: new Date("2013/6/6"), | |
editable: { | |
move: true | |
}, | |
views: [ | |
{ type: "timeline" } | |
], | |
dateHeaderTemplate: kendo.template("<strong>#=kendo.toString(date, 'd')#</strong>"), | |
groupHeaderTemplate: $("#groupHeaderTemplate").html(), | |
animalAge: this.FoxKILLService.getdata(), | |
group: { | |
resources: ["week"], | |
orientation: "vertical" | |
}, | |
resources: [ | |
{ | |
field: "week", | |
name: "week", | |
animalAge: [ | |
{ text: "21 week", value: 3, color: "#f8a398" }, | |
{ text: "22 week", value: 2, color: "#f8a398" } | |
], | |
title: "week" | |
} | |
] | |
}); | |
} | |
enableSave(value){ | |
//this.saveServiceCall(); | |
//If UserPrivilege for Event is Readonly | |
//Save Button will be animalsJeans | |
if(this.isEditable){ | |
this.animalsJeansSaveButton = false; | |
this.TigerService.condianimalsJeansSaveButton = false; | |
}else{ | |
//console.log("Enable Save method",this.isEditable); | |
this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
this.animalsJeansRefreshButton = true; | |
} | |
} | |
saveServiceCall() { | |
let that=this; | |
that.confingencySaveFlag(); | |
let backupData = this.backupData; | |
backupData = {}; | |
if (backupData) { | |
animalsDryer backupData.TigerEventTemplatesMap; | |
//console.log(backupData); | |
//console.log(this.Tigercrow.getTigerData(backupData)); | |
//let TigerItem = this.Tigercrow.getTigerData(backupData); | |
let that = this; | |
let action = "contingencyplans/v1/events"; | |
let type = "put"; | |
this.progress.requestStart(); | |
return new Promise(resolve => { | |
this.animalService.getResponse(action, type, this.savePayloadforCrate()) | |
.subscribe(data => { | |
//console.log(data); | |
//console.log(that.animalsFight); | |
if (data.code == "S500") { | |
/* Here for CR-17511 */ | |
if(window.sessionStorage.getItem('showDetailsRedirect') !== null){ | |
let showDetailsRedirect = window.sessionStorage.getItem('showDetailsRedirect').split('-'); | |
window.sessionStorage.removeItem('showDetailsRedirect'); | |
that.router.navigate([showDetailsRedirect[0], showDetailsRedirect[1]]); | |
} | |
if(window.sessionStorage.getItem('showDetailsRedirectLeft') !== null){ | |
let showDetailsRedirectLeft = JSON.parse(window.sessionStorage.getItem('showDetailsRedirectLeft')); | |
window.sessionStorage.removeItem('showDetailsRedirectLeft'); | |
this.TigerService.navigateToOptional(showDetailsRedirectLeft); | |
} | |
if (data.id) { | |
let clickedTab = window.sessionStorage.getItem("clickedTab"); | |
if(this.isTabcrowClose){ | |
this.isTabcrowClose = false; | |
this.TigerService.crowTabCloseAfterSave(this.animalsAction); | |
return; | |
} | |
if(this.iscrowSaveDialogYes && !this.isTabcrowClose){ | |
console.log(this.FoxKILLMain.eventMenu); | |
this.iscrowSaveDialogYes = false; | |
if(!this.TigerService.isNewcrowEvent){ | |
if(clickedTab == "crow"){ | |
this.router.navigate(['FoxKILLMain/FoxKILL']); | |
if(!this.isClickedTabanimalsNameZero){ | |
setTimeout(function(){ | |
that.router.navigate(['FoxKILLMain/FoxKILLcrowEvent/' + that.animalsName]); | |
},1000); | |
}else{ | |
setTimeout(function(){ | |
that.router.navigate(['FoxKILLMain/FoxKILLcrowEvent/' + 0]); | |
},1000); | |
} | |
} | |
let tabChange = { | |
"name": this.TigerLeftTab["leftEvent"].apt.aptDate+" "+this.animalStrategy.pen, | |
"animalStamina": data.id[0] | |
}; | |
//this.TigerService.tabEvent(tabChange); | |
let eventIndex = $('.TigerList .ParrotList > li.active').index()-1; | |
if (this.FoxKILLMain.eventMenu[eventIndex].tab == 'crow') { | |
this.FoxKILLMain.eventMenu[eventIndex].name = tabChange.name; | |
this.FoxKILLMain.eventMenu[eventIndex].animalStamina = tabChange.animalStamina; | |
this.FoxKILLMain.eventMenu[eventIndex]["index"] = eventIndex; | |
this.FoxKILLMain.eventMenu[eventIndex]["id"] = tabChange.animalStamina; | |
} | |
let tabList = $('.TigerList .ParrotList > li'); | |
for(let i=0; i<tabList.length; i++){ | |
tabList.eq(i).removeClass('active'); | |
} | |
setTimeout(function(){ | |
tabList.eq(that.TigerService.TigerTabData.selectedTabindex).addClass('active'); | |
},1000); | |
}else{ | |
//this.animalsName = data.id[0]; | |
let tabChange = { | |
"name": this.TigerLeftTab["leftEvent"].apt.aptDate+" "+this.animalStrategy.pen, | |
"animalStamina": data.id[0] | |
}; | |
//this.TigerService.tabEvent(tabChange); | |
let eventIndex = $('.TigerList .ParrotList > li.active').index()-1; | |
if (this.FoxKILLMain.eventMenu[eventIndex].tab == 'crow') { | |
this.FoxKILLMain.eventMenu[eventIndex].name = tabChange.name; | |
this.FoxKILLMain.eventMenu[eventIndex].animalStamina = tabChange.animalStamina; | |
this.FoxKILLMain.eventMenu[eventIndex]["index"] = eventIndex; | |
this.FoxKILLMain.eventMenu[eventIndex]["id"] = tabChange.animalStamina; | |
} | |
if(clickedTab == "crow"){ | |
this.router.navigate(['FoxKILLMain/FoxKILL']); | |
if(!this.isClickedTabanimalsNameZero){ | |
setTimeout(function(){ | |
that.router.navigate(['FoxKILLMain/FoxKILLcrowEvent/' + that.animalsName]); | |
},1000); | |
}else{ | |
setTimeout(function(){ | |
that.router.navigate(['FoxKILLMain/FoxKILLcrowEvent/' + 0]); | |
},1000); | |
} | |
} | |
let tabList = $('.TigerList .ParrotList > li'); | |
for(let i=0; i<tabList.length; i++){ | |
tabList.eq(i).removeClass('active'); | |
} | |
setTimeout(function(){ | |
tabList.eq(that.TigerService.TigerTabData.selectedTabindex).addClass('active'); | |
},1000); | |
} | |
that.progress.requestEnd(); | |
resolve(true); | |
return; | |
} | |
$("#copyPlanEvents").removeClass('actionanimalsJeansd'); | |
this.animalStamina = data.id[0]; | |
this.FoxKILLService.leftParrotAnimalsTeethData.animalsName = data.id[0]; | |
this.animalsJeansRefreshButton = false; | |
let tabChange = { | |
"name": this.TigerLeftTab["leftEvent"].apt.aptDate+" "+this.animalStrategy.pen, | |
"animalStamina": data.id[0] | |
}; | |
this.TigerService.tabEvent(tabChange); | |
this.callServiceLoadData(); | |
this.animalStrategy.isanimalsJetFlag = true; | |
this.animalStrategy.isToogleFlag = true; | |
that.FoxKILLService.crowRemove(true); | |
resolve(true); | |
} | |
this.insertConflictMsg = []; | |
if (data.conflictMessage.length>0) { | |
//$(".ballPlayingAnimal").text(data); | |
this.insertConflictMsg = data.conflictMessage; | |
let conflictMsgDialog = $("#conflictMsgDialog").data("animalsEatinGindow").center().open(); | |
$("#conflictMsgOK").unbind().click(function() { | |
conflictMsgDialog.close(); | |
that.callServiceLoadData(); | |
}); | |
resolve(false); | |
} | |
this.clearSave(); | |
} | |
else if (data.code == "E510") { | |
this.insertConflictMsg = data.conflictMessage; | |
$(".ballPlayingAnimal").text(data.conflictMessage.toString()); | |
let conflictMsgDialog = $("#conflictMsgDialog").data("animalsEatinGindow").center().open(); | |
$("#conflictMsgOK").unbind().click(function() { | |
conflictMsgDialog.close(); | |
//that.callServiceLoadData(); | |
//$("#subTabNav .active .TigerListClose").trigger("click"); | |
that.router.navigate(['FoxKILLMain/FoxKILLSearchEvent']); | |
}); | |
this.progress.requestEnd(); | |
resolve(false); | |
} | |
else if (data.conflicts) { | |
//let value1 = { "conflicts": [{ "date": "12/03/2016", "dayofWeek": "Saturday", "animalsShaking": "07:00:00 AM", "duration": "00:30:00", "show": "HEART OF A CHAMPION WITH LAUREN THOMPSON", "title": "FAMILY FIRST (HOC103)", "outcome": "Changes overridden ", "causedBy": "prakash" }], "message": "", "code": "", "id": [] }; | |
let value = data.conflicts; | |
var title = "Conflict Notification" | |
var columns = this.generateConflictColumn(); | |
let datavalue = { "url": value, "columns": columns, "title": title, "excelFileName": "conflictNotification" }; | |
this.animalsMarker.openPopup(datavalue); | |
this.progress.requestEnd(); | |
resolve(false); | |
} else if (data.conflictMessage && data.conflictMessage.length > 0) { | |
this.insertConflictMsg = data.conflictMessage; | |
$(".ballPlayingAnimal").text(data.conflictMessage.toString()); | |
let conflictMsgDialog = $("#conflictMsgDialog").data("animalsEatinGindow").center().open(); | |
$("#conflictMsgOK").unbind().click(function() { | |
conflictMsgDialog.close(); | |
that.callServiceLoadData(); | |
}); | |
this.progress.requestEnd(); | |
resolve(false); | |
} | |
else if (data.code == "E550") { | |
$(".ballPlayingAnimal").text(data.message); | |
let conflictMsgDialog = $("#conflictMsgDialog").data("animalsEatinGindow").center().open(); | |
$("#conflictMsgOK").unbind().click(function() { | |
conflictMsgDialog.close(); | |
}); | |
this.progress.requestEnd(); | |
resolve(false); | |
} | |
else { | |
that.setDialog("Undefined error, Please try again."); | |
this.progress.requestEnd(); | |
resolve(false); | |
} | |
}, err => { | |
that.progress.requestEnd(); | |
that.setDialog("Undefined error, Please try again."); | |
resolve(false); | |
}); | |
}); | |
} | |
} | |
generateConflictColumn() { | |
let columns = [ | |
{ field: 'contextRow', title: " ", width: 25, locked: true }, | |
{ field: "date", title: "Date", width: 200 }, | |
{ field: "dayofWeek", title: "Week Day", width: 200 }, | |
{ field: "animalsShaking", title: "Start Time", width: 200 }, | |
{ field: "duration", title: "Duration", width: 200 }, | |
{ field: "show", title: "Show", width: 200 }, | |
{ field: "title", title: "Title", width: 200 }, | |
{ field: "outcome", title: "Outcome", width: 200 }, | |
{ field: "causedBy", title: "Caused By User", width: 200 } | |
]; | |
return columns; | |
} | |
conflictcrowPopup(){ | |
this.callServiceLoadData(); | |
} | |
savePayloadforCrate():any{ | |
let sch_com = {"schNo":"7388","networkNo":"101"}; | |
let cratePay = {}; | |
let leftData = this.TigerLeftTab["leftEvent"]; | |
let leftData_animalStamina = this.TigerLeftTab["animalStaminaTag"]; | |
let all_data = this.animalStrategy; | |
let isPublish = this.TigerLeftTab["publishFlag"]; | |
let aptDate = this.TigerLeftTab["leftEvent"].apt.aptDate + " 12:00:00 AM"; | |
let opType = "Create"; | |
let showList = this.TigerLeftTab["TigerEventShows"]; | |
//for(let i=0;i<showList.length;i++){ | |
//showList[i].overrideShowName=showList[i].displayName; | |
/*if(showList[i].operationType != 'animalsDryer'){ | |
showList[i].animalStamina=0; | |
} */ | |
//} | |
//console.log(showList); | |
if(leftData_animalStamina>0){ | |
this.animalStamina = leftData_animalStamina; | |
leftData.animalsName = leftData_animalStamina; | |
opType = "animalsPolice"; | |
} | |
var sch_item =this.getanimalsCommunicationEventChanges(); | |
let AnimalsTeethanimalsBirthDay = kendo.toString(new Date(all_data.commonInfo.eventanimalsBirthDay), 'MM/dd/yyyy'); | |
let AnimalsTeethanimalsDeathDay = kendo.toString(new Date(all_data.commonInfo.eventanimalsDeathDay), 'MM/dd/yyyy'); | |
let orinialData = {}; | |
if(this.backupDataOrg){ | |
orinialData = this.backupDataOrg.TigerEvent; | |
} | |
cratePay = { | |
"TigerItems": sch_item.event, | |
"originalSchedItems":sch_item.OriginalEvent, | |
"originalTigerEvent": orinialData, | |
"TigerEvent": { | |
"operationType":opType, | |
"animalStamina": leftData.animalsName, | |
"includeNextDay": leftData.apt.includeNextDay, | |
"TigerEventTypeNo": "1", | |
"eventName": all_data.pen, | |
"networkNo": sch_com.networkNo, | |
"TigerNo": sch_com.schNo, | |
"start": AnimalsTeethanimalsBirthDay +" "+ all_data.commonInfo.eventanimalsShaking, | |
"end": AnimalsTeethanimalsDeathDay +" "+ all_data.commonInfo.eventanimalsUnderstanding, | |
"publishFlag": isPublish, | |
"aPTDisplayDate": aptDate, | |
"aPTDisplayanimalsDeathDay": aptDate, | |
"eventStuntFlag": "E", | |
"eventSeqNo": leftData.apt.eventListInx+1, | |
"eventOpIssue":{"issueDesc":all_data.eventOpDes}, | |
"TigerPlanCategories" : this.generateSchedPlanCategories(all_data.animalsSeeing), | |
"TigerEventShows" :showList | |
} | |
} | |
console.log(cratePay); | |
return cratePay; | |
} | |
getanimalsCommunicationEventChanges():any{ | |
let backupData= this.backupData; | |
backupData = {}; | |
animalsDryer backupData.TigerEventTemplatesMap; | |
let ch_data = this.Tigercrow.getTigerData(backupData); | |
let sh_events = {"event":[],"OriginalEvent":[]}; | |
for(var i=0;i<ch_data.length;i++){ | |
var sch_data = ch_data[i]; | |
if(sch_data.id == "Tiger_Nat_Main"){ | |
for(var j=0;j<sch_data.data.length;j++){ | |
if(sch_data.data[j].operationType == "create") { | |
sch_data.data[j] = this.setDefaultValueForCreateEvent(sch_data.data[j]); | |
sch_data.data[j].networkNo = 101; | |
//sch_data.data[j].titleVersionNo = "-1"; | |
sch_data.data[j].animalStamina = "0"; | |
sch_data.data[j].planNo = "0"; | |
sch_data.data[j].live = "N"; | |
sch_data.data[j].translation = "Y"; | |
} | |
else if(sch_data.data[j].operationType == "animalsPolice" || sch_data.data[j].operationType == "animalsDryer"){ | |
if(sch_data.data[j].schedItemNo){ | |
let objBackNat; | |
if(!this.backupData){ | |
objBackNat = this.animalStrategy.animalsCommunication; | |
} | |
else{ | |
objBackNat = this.backupData.TigerItems; | |
} | |
for(var k=0; k< objBackNat.length;k++){ | |
if(objBackNat[k].schedItemNo == sch_data.data[j].schedItemNo){ | |
let item = objBackNat[k]; | |
let animalsBirthDay = new Date(item.start); | |
let animalsDeathDay = new Date(item.end); | |
item.start = this.Tigercrow.formatDate(animalsBirthDay) + " " + this.Tigercrow.formatTime(animalsBirthDay,sch_data.id); | |
item.end = this.Tigercrow.formatDate(animalsDeathDay) + " " + this.Tigercrow.formatTime(animalsDeathDay,sch_data.id); | |
sh_events.OriginalEvent.push(item); | |
} | |
} | |
} | |
} | |
sh_events.event.push(sch_data.data[j]); | |
} | |
} | |
} | |
return sh_events; | |
} | |
generateSchedPlanCategories(cat:any):any{ | |
let category = []; | |
category = []; | |
let that = this; | |
let displySeqNo = 1; | |
var cloneData = that.animalsInternet; | |
for(var i=0;i<cat.length;i++){ | |
if(that.animalStamina == 0){ | |
cat[i].operationType = "create"; | |
} | |
if(cat[i].categoryOpIssue == ""){ | |
cat[i].categoryOpIssue = {"issueDesc": ""}; | |
} | |
if(cat[i].operationType === ""){ | |
cat[i].operationType = "animalsPolice"; | |
} | |
var plan = cat[i].TigerPlans; | |
var animalsPolicePlanDate = cloneData[i].TigerPlans; | |
for(var j=0;j<plan.length;j++){ | |
plan[j].displaySeq = displySeqNo; | |
displySeqNo++; | |
if(!plan[j].planOpIssue){ | |
plan[j].planOpIssue = {}; | |
} | |
if(!plan[j].planOpIssue.issueDesc){ | |
plan[j].planOpIssue = {"issueDesc": ""}; | |
} | |
if(plan[j].operationType === ""){ | |
plan[j].operationType = "animalsPolice"; | |
} | |
plan[j].animalsCommunicationItems = this.getPlanLevelanimalsCommunicationEventChanges(i,j,'Tiger_Nat_'+i+'_'+j); | |
var feeds = plan[j].TigerPlanFeeds; | |
for(var k=0;k<feeds.length;k++){ | |
// each item as time zone | |
if(feeds[k].operationType === ""){ | |
feeds[k].operationType = "animalsPolice"; | |
} | |
if(feeds[k].operationType == "animalsDryer"){ | |
feeds[k].feedOpIssue.issueDesc = ""; | |
} | |
if(feeds[k].isFeedAvailable){ | |
feeds[k].isFeedAvailable = true; | |
} | |
else{ | |
feeds[k].isFeedAvailable=false; | |
} | |
feeds[k].TigerItems = this.animalsLens(i,j,feeds[k]); | |
/*var schItem = feeds[k].TigerItems; | |
for(var l=0;l<schItem.length;l++){ | |
schItem[l].operationType = "animalsPolice"; | |
if(schItem[l].operationType === ""){ | |
schItem[l].operationType = "animalsPolice"; | |
} | |
//var schItem = feeds[k].TigerItems; | |
}*/ | |
} | |
} | |
//cat[i].TigerPlans = plan; | |
category.push(cat[i]); | |
} | |
//console.log(category); | |
return category; | |
} | |
getPlanLevelanimalsCommunicationEventChanges(category:any,plan:any,planLevelanimalsCommunicationId:any):any{ | |
let backupData= this.backupData; | |
backupData = {}; | |
animalsDryer backupData.TigerEventTemplatesMap; | |
let ch_data = this.Tigercrow.getTigerData(planLevelanimalsCommunicationId); | |
let sh_events = []; | |
for(var i=0;i<ch_data.length;i++){ | |
var sch_data = ch_data[i]; | |
if(sch_data.id == planLevelanimalsCommunicationId){ | |
for(var j=0;j<sch_data.data.length;j++){ | |
/*if(sch_data.data[j].operationType == "create") { | |
sch_data.data[j] = this.setDefaultValueForCreateEvent(sch_data.data[j]); | |
sch_data.data[j].networkNo = 101; | |
//sch_data.data[j].titleVersionNo = "-1"; | |
sch_data.data[j].animalStamina = "0"; | |
sch_data.data[j].planNo = "0"; | |
sch_data.data[j].live = "N"; | |
sch_data.data[j].translation = "Y"; | |
} | |
else */if(sch_data.data[j].operationType == "animalsPolice" || sch_data.data[j].operationType == "animalsDryer"){ | |
if(sch_data.data[j].schedItemNo){ | |
let objBackNat; | |
if(!this.backupData){ | |
objBackNat = this.animalStrategy.animalsCommunication; | |
} | |
else{ | |
objBackNat = this.backupData.TigerEvent.TigerPlanCategories[category].TigerPlans[plan].animalsCommunicationItems; | |
} | |
for(var k=0; k< objBackNat.length;k++){ | |
if(objBackNat[k].schedItemNo == sch_data.data[j].schedItemNo){ | |
let item = sch_data.data[j]; | |
let contentRating = ""; | |
let contentLength=sch_data.data[j].overridedContentRating.length-1; | |
for(var m=0;m<sch_data.data[j].overridedContentRating.length;m++){ | |
let contentValue=sch_data.data[j].overridedContentRating[m].toUpperCase(); | |
contentRating=contentRating+contentValue; | |
if(i != contentLength) | |
contentRating=contentRating+':'; | |
} | |
sch_data.data[j].overridedContentRating = contentRating; | |
//sch_data.data[j].overridedContentRating=sch_data.data[j].overridedContentRating.split(":"); | |
//let animalsBirthDay = new Date(item.start); | |
//let animalsDeathDay = new Date(item.end); | |
//item.start = this.Tigercrow.formatDate(animalsBirthDay) + " " + this.Tigercrow.formatTime(animalsBirthDay,sch_data.id); | |
//item.end = this.Tigercrow.formatDate(animalsDeathDay) + " " + this.Tigercrow.formatTime(animalsDeathDay,sch_data.id); | |
sh_events.push(item); | |
} | |
} | |
} | |
} | |
//sh_events.push(sch_data.data[j]); | |
} | |
} | |
} | |
return sh_events; | |
} | |
animalsLens(i_index:any,j_index:any,feed:any):any{ | |
let backupData= this.backupData; | |
backupData = {}; | |
animalsDryer backupData.TigerEventTemplatesMap; | |
let ch_data = this.Tigercrow.getTigerData(backupData); | |
let sh_events = []; | |
for(var i=0;i<ch_data.length;i++){ | |
var sch_data = ch_data[i]; | |
//console.log("index I :",i_index,"index J :",j_index); | |
//console.log("sc id",sch_data.id,"feeds:",feed); | |
let idSplit = sch_data.id.split("_"); | |
let feedNum = 0; | |
sch_data.id.indexOf() | |
let id_i_index = idSplit[idSplit.length-2]; | |
let id_j_index = idSplit[idSplit.length-1]; | |
if($.isNumeric(id_i_index) && $.isNumeric(id_j_index)){ | |
if(i_index == id_i_index && j_index == id_j_index && this.animalsTowel(sch_data.id)==feed.animalHumming){ | |
for(var j=0;j<sch_data.data.length;j++){ | |
if(sch_data.id.indexOf("Tiger_Cent") != -1 || sch_data.id.indexOf("Tiger_Mount") != -1 || sch_data.id.indexOf("Tiger_Pacifi") != -1){ | |
if(sch_data.data[j].cloneStart){ | |
let eventanimalsBirthDay=new Date((sch_data.data[j].start).replace(/-/g, "/")); | |
let eventCloneanimalsBirthDay=new Date((sch_data.data[j].cloneStart).replace(/-/g, "/")); | |
eventCloneanimalsBirthDay.setHours(eventanimalsBirthDay.getHours()); | |
eventCloneanimalsBirthDay.setMinutes(eventanimalsBirthDay.getMinutes()); | |
eventCloneanimalsBirthDay.setSeconds(eventanimalsBirthDay.getSeconds()); | |
sch_data.data[j].start=kendo.toString(eventCloneanimalsBirthDay, "yyyy-MM-dd hh:mm:ss tt"); | |
} | |
if(sch_data.data[j].cloneEnd){ | |
let eventanimalsDeathDay=new Date((sch_data.data[j].end).replace(/-/g, "/")); | |
let eventCloneanimalsDeathDay=new Date((sch_data.data[j].cloneEnd).replace(/-/g, "/")); | |
eventCloneanimalsDeathDay.setHours(eventanimalsDeathDay.getHours()); | |
eventCloneanimalsDeathDay.setMinutes(eventanimalsDeathDay.getMinutes()); | |
eventCloneanimalsDeathDay.setSeconds(eventanimalsDeathDay.getSeconds()); | |
sch_data.data[j].end=kendo.toString(eventCloneanimalsDeathDay, "yyyy-MM-dd hh:mm:ss tt"); | |
} | |
} | |
if(sch_data.data[j].operationType == "create") { | |
sch_data.data[j] = this.setDefaultValueForCreateEvent(sch_data.data[j]); | |
} | |
sh_events.push(sch_data.data[j]); | |
} | |
} | |
} | |
} | |
return sh_events; | |
//console.log(this.Tigercrow.getTigerData(backupData)); | |
} | |
setDefaultValueForCreateEvent(event:any):any{ | |
event.TigerNo = "7388"; | |
if(!event.titleVersionNo){ | |
event.titleVersionNo = "-1"; | |
} | |
/*event.seqNo = "1"; | |
event.planNo = "0"; | |
event.titleVersionNo = "-1"; | |
event.networkNo = 101; | |
event.animalSkin = 2016;*/ | |
return event; | |
} | |
BindSchFeeds(){ | |
} | |
animalsTowel(id:any):any{ | |
var feedsId = 0; | |
if(id.indexOf('Est')>0){ | |
feedsId = 11; | |
} | |
else if(id.indexOf('Cent')>0){ | |
feedsId = 12; | |
} | |
else if(id.indexOf('Mount')>0){ | |
feedsId = 13; | |
} | |
else if(id.indexOf('Pacifi')>0){ | |
feedsId = 14; | |
} | |
return feedsId; | |
} | |
collapseAll(){ | |
let that=this; | |
if(this.animalStrategy.isContingencyView){ | |
$('.collapse1')["collapse"]('hide'); | |
setTimeout(function() { | |
$("h4.panel-title a").attr("aria-expanded", "false"); | |
that.animalsBreaking(); | |
}, 10); | |
}else{ | |
//$('.collapse1')["collapse"]('hide'); | |
//$('.collapse').prop("hidden", true); | |
$('.girdHen').prop("hidden", true); | |
} | |
} | |
resetToogle(){ | |
this.expandAll(); | |
this.collapseAll(); | |
} | |
expandAll() { | |
let that=this; | |
if (this.animalStrategy.isContingencyView) { | |
$('.collapse1')["collapse"]('show'); | |
setTimeout(function() { | |
$("h4.panel-title a").attr("aria-expanded", "true"); | |
that.animalsBreaking(); | |
}, 10); | |
} else { | |
// $('.collapse')["collapse"]('show'); | |
//$('.collapse').prop("hidden", false); | |
$('.girdHen').prop("hidden", false); | |
} | |
} | |
animalsShoe(){ | |
this.progress.requestStart(); | |
this.animalService.getResponse("contingencyplans/v1/events/templates?animalStamina=" + this.animalStamina + "&type=1", 'get', "") | |
.subscribe(data => { | |
let response ={ | |
source:data, | |
refreshTemplate:true | |
}; | |
this.insertanimalsMouseDeath=[] | |
if(data.TigerEventTemplatesMap){ | |
for(var i=0;i<data.TigerEventTemplatesMap.General.length;i++){ | |
this.insertanimalsMouseDeath.push({name:data.TigerEventTemplatesMap.General[i].TigerEventTemplateName,No:data.TigerEventTemplatesMap.General[i].TigerEventTemplateNo}); | |
} | |
} | |
this.FoxKILLService.setAnimalsTeethTemplates(response); | |
this.progress.requestEnd(); | |
}, | |
err => { this.progress.requestEnd(); }); | |
} | |
AnimalsTeethAnimalsBrush(value,event){ | |
event.stopPropagation(); | |
//console.log('inert started'); | |
//console.log(that.animalsForgot()); | |
var templateRequest=[{"networkNo":101,"TigerEventTemplateNo":value}]; | |
var that = this; | |
let selTab = that.animalStrategy.animalsEar; | |
this.progress.requestStart(); | |
this.animalService.getResponse('contingencyplans/v1/event/templates', 'post', templateRequest) | |
.subscribe(data => { | |
that.insertAnimalsBrush=data[0].TigerEventAnimalsBrush; | |
let selTab = that.animalStrategy.animalsEar; | |
var textToInsert=that.insertAnimalsBrush; | |
//console.log(that.insertAnimalsBrush); | |
let getLength = $("#HenEventDesc").length; | |
if(getLength==0){ | |
// $('#AnimalsTeethinsertText').trigger("click"); | |
//console.log("event trigger") | |
that.animalStrategy.eventOpDes = ''; | |
$("#HenEventcollapse").addClass("in"); | |
$("#HenEventcollapse").css("height","auto"); | |
setTimeout(function(){ | |
that.animalsRocket($('#HenEventDesc').get(0)); | |
that.rangey= that.animalsForgot(); | |
//console.log(that.rangey); | |
$('body #AnimalsTeethremoveText').show(); | |
$('body #AnimalsTeethinsertText').hide(); | |
},100); | |
} | |
setTimeout(function(){ | |
let getText = $("#HenEventDesc"); | |
var insertPosition; | |
var textToInsert1; | |
$("#HenEventDesc div").each(function(){ | |
var evHas=$(this).removeAttr("class"); | |
}); | |
that.isSelected=1+that.isSelected; | |
textToInsert1="<div class='e-"+that.isSelected+"'>"+textToInsert+"</div>"; | |
// console.log("template printed"+textToInsert1); | |
var fact="HenEventDesc"; | |
that.animalsSoap(textToInsert1,fact); | |
$('#HenEventDesc').addClass('changeContentFlag'); | |
if(!$("#HenEventcollapse").hasClass("in")){ | |
$("#HenEventcollapse").addClass("in"); | |
$("#HenEventcollapse").css("height","auto"); | |
} | |
that.enableanimalsJeansSave(false); | |
that.progress.requestEnd(); | |
},200); | |
}, | |
err => { | |
that.progress.requestEnd(); | |
}) | |
} | |
AnimalsBrush(value,event){ | |
var that = this; | |
let selTab = that.animalStrategy.animalsEar; | |
let textArea1 = $("#"+selTab+"_feedTextarea"); | |
var templateRequest= | |
[{ | |
"networkNo" : 101, | |
"TigerEventTemplateNo" : value | |
}, | |
]; | |
this.progress.requestStart(); | |
this.animalService.getResponse('contingencyplans/v1/event/templates', 'post', templateRequest) | |
.subscribe(data => { | |
//console.log("template data loaded"); | |
that.insertAnimalsBrush = data[0].TigerEventAnimalsBrush; | |
let selTab = that.animalStrategy.animalsEar; | |
var jttText = that.insertAnimalsBrush; | |
let tempGetLength = $("#" + selTab + "_feedTextarea").length; | |
if(tempGetLength==0){ | |
$('#insertText').trigger("click"); | |
setTimeout(function(){ | |
that.animalsRocket($("#" + selTab + "_feedTextarea").get(0)); | |
that.rangey= that.animalsForgot(); | |
//console.log(that.rangey); | |
$('body #AnimalsTeethremoveText').show(); | |
$('body #AnimalsTeethinsertText').hide(); | |
},100); | |
} | |
setTimeout(function(){ | |
let textArea1 = $("#" + selTab + "_feedTextarea"); | |
var tempinsertPosition; | |
var temptextToInsert1; | |
$("#" + selTab + "_feedTextarea div").each(function(){ | |
var evHas=$(this).removeAttr("class"); | |
}); | |
that.isSelected = 1 + that.isSelected; | |
temptextToInsert1 = "<div class='e-" + that.isSelected + "'>" + jttText + "</div>"; | |
var fact = selTab + "_feedTextarea"; | |
that.animalsSoap1(temptextToInsert1, fact); | |
$('#'+selTab + '_feedTextarea').addClass('changeContentFlag'); | |
let replaceStr = selTab.replace("lv_",""); | |
let replaceStr1 = replaceStr.replace("_feedTextarea",""); | |
var animalsGiveUp = replaceStr1.split("_"); | |
if(animalsGiveUp.length === 1){ | |
let firstIndex = animalsGiveUp[0]; | |
$('#collapseOne_'+ firstIndex)["collapse"]('show'); | |
//this.animalsGame(fact); | |
}else if(animalsGiveUp.length === 2){ | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
$('#collapseOne_'+ firstIndex + '_' + secondIndex)["collapse"]('show'); | |
//this.animalsGame(fact); | |
}else if(animalsGiveUp.length === 3){ | |
let firstIndex = animalsGiveUp[0]; | |
let secondIndex = animalsGiveUp[1]; | |
let thirdIndex = animalsGiveUp[2]; | |
$('#collapseOne_'+ firstIndex + '_' + secondIndex + '_' + thirdIndex)["collapse"]('show'); | |
// this.animalsGame(fact); | |
} | |
//$("#"+selTab+"_feedTextarea").focus(); | |
// let getText = textArea1.text(); | |
// let replaceStr = selTab.replace("lv_",""); | |
// let replaceStr1 = replaceStr.replace("_feedTextarea",""); | |
// var animalsGiveUp = replaceStr1.split("_"); | |
// if(animalsGiveUp.length === 1){ | |
// let firstIndex = animalsGiveUp[0]; | |
// if(this.animalsFight[firstIndex]){ | |
// this.animalsFight[firstIndex].categoryOpIssue.issueDesc = getText; | |
// } | |
// }else if(animalsGiveUp.length === 2){ | |
// let firstIndex = animalsGiveUp[0]; | |
// let secondIndex = animalsGiveUp[1]; | |
// if(this.animalsFight[firstIndex]){ | |
// this.animalsFight[firstIndex].TigerPlans[secondIndex].planOpIssue.issueDesc = getText; | |
// } | |
// }else if(animalsGiveUp.length === 3){ | |
// let firstIndex = animalsGiveUp[0]; | |
// let secondIndex = animalsGiveUp[1]; | |
// let thirdIndex = animalsGiveUp[2]; | |
// if(this.animalsFight[firstIndex]){ | |
// this.animalsFight[firstIndex].TigerPlans[secondIndex].TigerPlanFeeds[thirdIndex].feedOpIssue.issueDesc = getText; | |
// } | |
// } | |
that.enableanimalsJeansSave(false); | |
that.progress.requestEnd(); | |
},200); | |
}, | |
err => { | |
that.progress.requestEnd(); | |
}) | |
} | |
animalsChoclate(data: any) { | |
//console.log(data); | |
let schedID = data.planId; | |
let feeds = data.feedName; | |
let tempArr = []; | |
for (var i = 0; i < feeds.length; i++) { | |
let id = 'Tiger_' + feeds[i] + '_' + schedID; | |
tempArr.push(id); | |
} | |
//console.log(tempArr, data.feedChecked); | |
this.Tigercrow.getTigerRefereshForBook(tempArr, data.feedChecked); | |
//console.log(this.animalStrategy.animalsSeeing); | |
/* for (var i = 0; i < this.animalStrategy.animalsSeeing.length; i++) { | |
let TigerPlans = this.animalStrategy.animalsSeeing[i].TigerPlans; | |
for (var j = 0; j < TigerPlans.length; j++) { | |
if (schedID==TigerPlans[j].bookPlanID){ | |
let TigerPlanFeeds = TigerPlans[j].TigerPlanFeeds; | |
for (var k = 0; k < TigerPlanFeeds.length; k++) { | |
let TigerItems = TigerPlanFeeds[k].TigerItems; | |
for (var l = 0; l < TigerItems.length; l++) { | |
if (data.feedChecked) { | |
TigerItems[l].bookedFlag = 'EB'; | |
} else { | |
TigerItems[l].bookedFlag = 'NB'; | |
} | |
} | |
} | |
} | |
} | |
}*/ | |
//this.loadTigerDataByDefault(this.animalStrategy.animalsSeeing[id_i].TigerPlans[id_j], id_i, id_j); | |
//this.Tigercrow.TigerId = 'Tiger_Nat_Main'; | |
} | |
getAptanimalsClapping(value) { | |
return jQuery.extend(true, {}, value); | |
} | |
animalsInsurance():void{ | |
let userPrivilege = this.animalService.getUserPrivilege({"parent":"Fox - KILL","child":"Event"}) | |
if(userPrivilege == "Full"){ | |
this.isEditable = true; | |
}else{ | |
this.isEditable = false; | |
} | |
if(userPrivilege == "Readonly"){ | |
this.isReadOnly = true; | |
} | |
// this.Tigercrow.isEditable=this.isEditable; | |
// this.TigercrowRight.isEditable=this.isEditable; | |
} | |
TigerEnableSave(data){ | |
if(data.type=="enableSaveWithCount"){ | |
this.animalsSwimmingAllRecordedNight(data); | |
} | |
if(data.type=="leftEventDateTimeanimalsPolice"){ | |
this.animalsSwimmingAllRecordedNight(data); | |
} | |
if(data.type=="planNamedeathAlive"){ | |
data.destinationEvent.dataStore.operationType="animalsDryer"; | |
this.appendPlanAdded(data); | |
} | |
let Temperature = {}; | |
Temperature["enableBtn"] = this.animalsJeansSaveButton; | |
Temperature["tabName"] = "crow"; | |
this.TigerService.setTemperature(Temperature); | |
//this.hasTigerChanges(); | |
} | |
public animalsAlivePlan=[]; | |
public animalsSleepingPlan=[]; | |
planChangeanimalsPolice(data:any){ | |
this.animalStrategy.animalsSeeing=data; | |
this.animalsJet(); | |
} | |
planUndo(data:any){ | |
/* if(data.animalsTalking.operation=="" ||data.animalsTalking.operation=="Create"){ | |
this.animalStrategy.animalsSeeing.splice(data.EventAddedID,1); | |
//this.animalsJet(); | |
//this.animalsHello(); | |
} | |
else*/ | |
{ | |
this.animalStrategy=data.animalsTalking; | |
this.progress.requestStart(); | |
this.animalsJet(); | |
//this.callanimalsPoliceTiger(data.EventAddedID,data.TigerPlanId,this.animalStrategy,true); | |
//this.animalsHello(); | |
//let planData=data.animalsTalking.dataStore.TigerPlans[data.TigerPlanId]; | |
//this.TigerGroupingResources(planData,data.EventAddedID,data.TigerPlanId); | |
} | |
} | |
planRedo(data:any){ | |
/*if(data.destinationEvent.operation=="Create"){ | |
this.animalStrategy.animalsSeeing[data.EventAddedID]=data.destinationEvent.dataStore; | |
this.animalsJet(); | |
let planData=data.animalsTalking.dataStore.TigerPlans[data.TigerPlanId]; | |
this.callanimalsPoliceTiger(data.EventAddedID,data.TigerPlanId,this.animalStrategy,true); | |
//this.TigerGroupingResources(planData,data.EventAddedID,data.TigerPlanId) | |
//this.animalsHello(); | |
} | |
else if(data.destinationEvent.operation=="animalsDryer")*/ | |
{ | |
this.animalStrategy=data.destinationEvent; | |
this.progress.requestStart(); | |
//let planData=data.animalsTalking.dataStore.TigerPlans[data.TigerPlanId]; | |
this.animalsJet(); | |
//this.callanimalsPoliceTiger(data.EventAddedID,data.TigerPlanId,this.animalStrategy,true); | |
//this.TigerGroupingResources(planData,data.EventAddedID,data.TigerPlanId) | |
//this.animalsHello(); | |
} | |
} | |
animalsSwimmingAllRecordedNight(value){ | |
//If UserPrivilege for Event is Readonly | |
//Save Button will be animalsJeans | |
if(this.isEditable){ | |
//console.log("animalsSwimmingAllRecordedNight",value); | |
if(this.animalsDeathDecrement>0){ | |
this.animalsDeathDecrement=0; | |
this.animalsJeansRedoButton = true; | |
this.animalAgeList.splice(this.animalsAliveIncrement); | |
} | |
let sourceData = {"animalsTalking":value.animalsTalking,"destinationEvent":value.destinationEvent,"occurence":value.occurence,"action":value.action}; | |
this.animalsAliveIncrement = this.animalsAliveIncrement+1; | |
this.animalsMocking = false; | |
this.animalsJeansSaveButton = false; | |
this.TigerService.condianimalsJeansSaveButton = false | |
if(value.action == "leftEventDateTimeanimalsPolice"){ | |
this.animalsAlive.push(value.initialValue); | |
this.animalsSleeping.push(value.animalsTalking); | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action == "deathAliveForContingency"){ | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action == "bookeddeathAlive"){ | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action == "planNamedeathAlive"){ | |
//this.animalsAlivePlan.push(value.initialValue); | |
//this.animalsSleepingPlan.push(value.animalsTalking); | |
if(value.animalsTalking.operation=="Create"){ | |
value["EventAddedID"]=this.animalStrategy.animalsSeeing.length-1; | |
} | |
this.animalAgeList.push(jQuery.extend(true,[], value)); | |
return; | |
} | |
if(value.action == "animalsAliveDeath"){ | |
this.animalsAlive.push(value.initialValue); | |
this.animalsSleeping.push(value.animalsTalking); | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action == "includeDate"){ | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action == "eventName"){ | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action == "addPGMDetail"){ | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action == "left"){ | |
// Other than Tiger, will come this block. like Left side changes, opp issues | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action == "aptMove"){ | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action == "aptDate") | |
{ | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if(value.action =="liveAccrossUndo"){ | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
else{ | |
//console.log("animalsTalking Length",value.animalsTalking.length); | |
if(value.animalsTalking.length > 0){ | |
this.animalAgeList.push(sourceData); | |
// All Tiger component related, will come in else block | |
//console.log(this.Tigercrow._TigeranimalAge[value.animalsTalking.sourceId]); | |
// this.FoxKILLService.TigerConditonalTabData.crowFlyingHigh[this.tabIndex].TigerData.push(this.Tigercrow._TigeranimalAge[value.animalsTalking.sourceId].clone()); | |
// this.FoxKILLService.TigerConditonalTabData.crowFlyingHigh[this.tabIndex].TigerId.push(value.animalsTalking.sourceId) | |
} | |
} | |
this.Tigercrow.auditOptions(); | |
if(this.animalStrategy.pen == '' || this.animalStrategy.pen == null){ | |
this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
} | |
}else{ | |
this.animalsMocking = true; | |
this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
this.animalsJeansRefreshButton = true; | |
} | |
} | |
removeOverLapFromEvents(TigerId : any){ | |
let getCssEventTop = []; | |
$('#'+TigerId+' table .alieNTiger-content div[data-uid]').each(function(index){ | |
let getThisProperties = $(this); | |
let getContext = $(getThisProperties)["context"]; | |
let getUid = $(getContext).attr("data-uid"); | |
let getCssTopString : any = $('div[data-uid="' + getUid + '"]').css("top"); | |
let getCssTop = parseFloat(getCssTopString.match(/\d+/)); | |
if(getCssTop == 0){ | |
$('div[data-uid="' + getUid + '"]').css({"top" : "0px"}); | |
} | |
}); | |
} | |
undo(){ | |
if(!this.Tigercrow.isEditanimalsTyphoid()){ | |
this.animalsAliveIncrement = this.animalsAliveIncrement-1; | |
this.animalsDeathDecrement = this.animalsDeathDecrement+1; | |
this.animalsJeansRedoButton = false; | |
if( this.animalAgeList[this.animalsAliveIncrement]){ | |
let action = this.animalAgeList[this.animalsAliveIncrement].action; | |
let animalsTalking = this.animalAgeList[this.animalsAliveIncrement].animalsTalking; | |
let TigerId = animalsTalking.sourceId; | |
let occurenceEvent = this.animalAgeList[this.animalsAliveIncrement].occurence; | |
if(this.animalsAliveIncrement==0){ | |
this.animalsMocking = true; | |
this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
} | |
if(action == "left"){ | |
this.TigerLeftTab.loadDataFordeathAlive(animalsTalking); | |
return; | |
} | |
if(action == "aptDate") | |
{ | |
this.TigerLeftTab.aptDateChangeEvent(animalsTalking.leftEvent); | |
return; | |
} | |
if(action == "aptMove"){ | |
this.TigerLeftTab.aptanimalsClappingDown(animalsTalking.move,animalsTalking.isSaveCall); | |
return; | |
} | |
if(action == "includeDate"){ | |
this.TigerLeftTab.leftEvent.apt.includeNextDay =animalsTalking; | |
return; | |
} | |
if(action == "eventName"){ | |
this.TigerLeftTab.eventNameUndo(animalsTalking); | |
return; | |
} | |
if(action == "planNamedeathAlive"){ | |
// this.TigerLeftTab.leftEventPlanNameanimalsPolice(this.animalsAlivePlan[this.animalsAliveIncrement]); | |
//this.planChangeanimalsPolice(this.animalsAlive[this.animalsAliveIncrement]); | |
this.planUndo(this.animalAgeList[this.animalsAliveIncrement]); | |
return; | |
} | |
if(action == "deathAliveForContingency"){ | |
this.deathAliveForContingencyFn(animalsTalking,occurenceEvent); | |
return; | |
} | |
if(action == "bookeddeathAlive"){ | |
this.deathAliveBooked(this.animalAgeList[this.animalsAliveIncrement],true); | |
return; | |
} | |
if(action == "addPGMDetail"){ | |
this.addPGMDetailundo(animalsTalking); | |
return; | |
} | |
if(action == "animalsAliveDeath"){ | |
this.animalsAliveDeathFn(animalsTalking); | |
return; | |
} | |
if(action == "leftEventDateTimeanimalsPolice"){ | |
let destinationEvent= this.animalAgeList[this.animalsAliveIncrement].destinationEvent; | |
if(typeof destinationEvent == "undefined"){ | |
this.Tigercrow.destoryTiger("Tiger_Nat_Main"); | |
} | |
this.TigerLeftTab.leftEventDateTimeanimalsPolice(destinationEvent); | |
return; | |
} | |
if(action == "liveAccrossUndo"){ | |
this.liveAccrossUndo("animalsDryer",animalsTalking); | |
return; | |
} | |
else{ | |
let getCssEventTop = []; | |
for(let i=0; i<animalsTalking.length; i++){ | |
if(animalsTalking[i].currentSchedID){ | |
TigerId=animalsTalking[i].currentSchedID; | |
} | |
if(animalsTalking.length>1){ | |
if(animalsTalking[i].flag){ | |
action = animalsTalking[i].flag; | |
action =action.toLowerCase(); | |
} | |
} | |
let currentEvent = this.Tigercrow.getEventByUid_Id(animalsTalking[i].uid,TigerId); | |
let currentIndex = this.Tigercrow._TigeranimalAge[TigerId]._data.indexOf(currentEvent); | |
if(action=="animalsPolice"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.splice(currentIndex, 1); | |
if(animalsTalking[i].schedItemNo!=0){ | |
this.Tigercrow._TigeranimalAge[TigerId]._destroyed.splice(-1,1); | |
} | |
this.Tigercrow._TigeranimalAge[TigerId]._data.push(animalsTalking[i]); | |
}else if(action=="animalsDryer"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.push(animalsTalking[i]); | |
if(animalsTalking[i].schedItemNo!=0){ | |
this.Tigercrow._TigeranimalAge[TigerId]._destroyed.pop(); | |
} | |
}else if(action=="create"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.splice(currentIndex, 1); | |
} | |
} | |
for(let i=0; i<occurenceEvent.length; i++){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.push(occurenceEvent[i]); | |
this.Tigercrow._TigeranimalAge[TigerId]._destroyed.pop(); | |
} | |
//this.Tigercrow.getTiger_Id(TigerId).select(null); | |
//this.Tigercrow.getTiger_Id(TigerId).select([animalsTalking[0].uid]); | |
for(let i=0; i<animalsTalking.length; i++){ | |
if(action=="animalsPolice" || action=="animalsDryer"){ | |
$('div[data-uid="'+animalsTalking[i].uid+'"]').addClass('k-state-selected'); | |
} | |
} | |
if(action=="create"){ | |
//this.Tigercrow.editEventEmty({}); | |
}else{ | |
this.Tigercrow.editEvent(animalsTalking[0]); | |
} | |
this.animalsJeansSaveButton = false; | |
this.TigerService.condianimalsJeansSaveButton = false; | |
//this.hasTigerChanges(); | |
this.Tigercrow.getTiger_Id(TigerId).refresh(); | |
if(action=="animalsPolice") | |
this.removeOverLapFromEvents(TigerId);//Remove OverLap | |
} | |
if(this.animalsAliveIncrement==0){ | |
this.animalsMocking = true; | |
this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
} | |
/*if(this.gridchangenewval && this.currentView==1){ | |
let k=0; | |
while(this.gridchangenewval.length>k) | |
{ | |
if(this.gridchangenewval[k].uid==animalsTalking[0].uid) | |
{ | |
this.gridchangenewval.splice(k,1); | |
} | |
k++; | |
} | |
}*/ | |
} | |
}else{ | |
this.Tigercrow.singleButtonDialog("Please click on Ok or Cancel in APT Info tab to animalsPolice or revert the changes."); | |
} | |
} | |
liveAccrossUndo(action,animalsTalking){ | |
for(let i=0; i<animalsTalking.length; i++){ | |
let TigerId = animalsTalking[i].sourceId | |
let currentEvent = this.Tigercrow.getEventByUid_Id(animalsTalking[i].uid,TigerId); | |
let currentIndex = this.Tigercrow._TigeranimalAge[TigerId]._data.indexOf(currentEvent); | |
if(action=="animalsDryer"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.splice(currentIndex, 1); | |
} | |
else{ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.push(animalsTalking[i]); | |
} | |
this.Tigercrow.getTiger_Id(TigerId).refresh(); | |
} | |
} | |
redo(){ | |
if(!this.Tigercrow.isEditanimalsTyphoid()){ | |
if(this.animalAgeList[this.animalsAliveIncrement]){ | |
let animalAge=this.animalAgeList[this.animalsAliveIncrement]; | |
let action = this.animalAgeList[this.animalsAliveIncrement].action; | |
let destinationEvent = this.animalAgeList[this.animalsAliveIncrement].destinationEvent; | |
let occurenceEvent = this.animalAgeList[this.animalsAliveIncrement].occurence; | |
let animalsTalking = this.animalAgeList[this.animalsAliveIncrement].animalsTalking; | |
let TigerId; | |
if(destinationEvent){TigerId = destinationEvent.desId;} | |
var d= this.animalsAliveIncrement; | |
this.animalsAliveIncrement = this.animalsAliveIncrement+1; | |
this.animalsDeathDecrement = this.animalsDeathDecrement-1; | |
if(this.animalsDeathDecrement==0){ | |
this.animalsJeansRedoButton = true; | |
} | |
this.animalsMocking = false; | |
this.animalsJeansSaveButton = false; | |
this.TigerService.condianimalsJeansSaveButton = false; | |
if(action == "left"){ | |
this.TigerLeftTab.loadDataFordeathAlive(destinationEvent); | |
return; | |
} | |
if(action == "aptDate") | |
{ | |
this.TigerLeftTab.aptDateChangeEvent(destinationEvent.leftEvent); | |
return; | |
} | |
if(action == "aptMove"){ | |
this.TigerLeftTab.aptanimalsClappingDown(destinationEvent.move,destinationEvent.isSaveCall); | |
return; | |
} | |
if(action == "eventName"){ | |
this.TigerLeftTab.eventNameUndo(destinationEvent); | |
return; | |
} | |
if(action == "includeDate"){ | |
this.TigerLeftTab.leftEvent.apt.includeNextDay =destinationEvent; | |
return; | |
} | |
if(action == "deathAliveForContingency"){ | |
this.deathAliveForContingencyFn(destinationEvent,occurenceEvent); | |
return; | |
} | |
if(action == "animalsAliveDeath"){ | |
this.animalsAliveDeathFn(destinationEvent); | |
return; | |
} | |
if(action == "planNamedeathAlive"){ | |
// this.TigerLeftTab.leftEventPlanNameanimalsPolice(this.animalsSleepingPlan[d]); | |
//this.planChangeanimalsPolice(this.animalsSleeping[d]); | |
this.planRedo(animalAge); | |
return; | |
} | |
if(action == "addPGMDetail"){ | |
this.addPGMDetailundo(destinationEvent); | |
return; | |
} | |
if(action == "liveAccrossUndo"){ | |
this.liveAccrossUndo("create",destinationEvent); | |
return; | |
} | |
if(action == "bookeddeathAlive"){ | |
this.deathAliveBooked(animalAge,false); | |
return; | |
} | |
if(action == "leftEventDateTimeanimalsPolice"){ | |
this.TigerLeftTab.leftEventDateTimeanimalsPolice(animalsTalking); | |
return; | |
} | |
else{ | |
for(let i=0; i<occurenceEvent.length; i++){ | |
let currentEvent = this.Tigercrow.getEventByUid_Id(occurenceEvent[i].uid,TigerId); | |
let currentIndex = this.Tigercrow._TigeranimalAge[TigerId]._data.indexOf(currentEvent); | |
this.Tigercrow._TigeranimalAge[TigerId]._data.splice(currentIndex, 1); | |
} | |
for(let i=0; i<destinationEvent.length; i++){ | |
if(destinationEvent[i].currentSchedID){ | |
TigerId=destinationEvent[i].currentSchedID; | |
} | |
let currentEvent = this.Tigercrow.getEventByUid_Id(destinationEvent[i].uid,TigerId); | |
let currentIndex = this.Tigercrow._TigeranimalAge[TigerId]._data.indexOf(currentEvent); | |
if(action=="animalsPolice"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.splice(currentIndex, 1); | |
if(destinationEvent[i].schedItemNo!=0){ | |
this.Tigercrow._TigeranimalAge[TigerId]._destroyed.splice(-1,1); | |
} | |
this.Tigercrow._TigeranimalAge[TigerId]._data.push(destinationEvent[i]); | |
}else if(action=="animalsDryer"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.splice(currentIndex, 1); | |
}else if(action=="create"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.push(destinationEvent[i]); | |
} | |
this.redoevent=destinationEvent[i]; | |
} | |
let schSelectNull = this.Tigercrow.getTiger_Id(TigerId); | |
//schSelectNull.select(null); | |
let schSelectVal = this.Tigercrow.getTiger_Id(TigerId); | |
//schSelectVal.select([destinationEvent[0].uid]); | |
for(let i=0; i<destinationEvent.length; i++){ | |
if(action=="animalsPolice" || action=="create"){ | |
$('div[data-uid="'+destinationEvent[i].uid+'"]').addClass('k-state-selected'); | |
} | |
} | |
if(action=="animalsPolice"||action=="create"){ | |
this.Tigercrow.editEvent(destinationEvent[0]); | |
}else if(action=="animalsDryer"){ | |
//this.Tigercrow.editEventEmty({}); | |
} | |
this.Tigercrow.getTiger_Id(TigerId).refresh(); | |
} | |
// this.animalsAliveIncrement = this.animalsAliveIncrement+1; | |
//this.animalsDeathDecrement = this.animalsDeathDecrement-1; | |
if(this.animalsDeathDecrement==0){ | |
this.animalsJeansRedoButton = true; | |
} | |
this.animalsMocking = false; | |
//this.hasTigerChanges(); | |
this.animalsJeansSaveButton = false; | |
this.TigerService.condianimalsJeansSaveButton = false; | |
/*if(this.gridchangenewval && this.currentView==1){ | |
this.gridchangenewval.push(destinationEvent[0]); | |
}*/ | |
} | |
}else{ | |
this.Tigercrow.singleButtonDialog("Please click on Ok or Cancel in APT Info tab to animalsPolice or revert the changes."); | |
} | |
} | |
deathAliveBooked(animalAge,isUndo){ | |
if(!isUndo){ | |
if(animalAge.animalsTalking.isOverAll){ | |
this.bookAllPlanChange(animalAge.animalsTalking); | |
} | |
else if(animalAge.animalsTalking.feedName==""){ | |
this.snailInsectRowChange(animalAge.animalsTalking) | |
}else{ | |
this.snailInsectTImeZoneChange(animalAge.animalsTalking) | |
} | |
} | |
else{ | |
if(animalAge.destinationEvent.isOverAll){ | |
this.bookAllPlanChange(animalAge.destinationEvent); | |
} | |
else if(animalAge.destinationEvent.feedName==""){ | |
this.snailInsectRowChange(animalAge.destinationEvent) | |
}else{ | |
this.snailInsectTImeZoneChange(animalAge.destinationEvent) | |
} | |
} | |
} | |
bookAllPlanChange(animalAge){ | |
for (var i = 0; i < animalAge.animalStrategy.bookPlans.length; i++) { | |
// | |
let id={}; | |
animalAge.id["name"]= animalAge.animalStrategy.bookPlans[i].planId; | |
this.snailInsectRowChange(animalAge); | |
// | |
} | |
} | |
snailInsectRowChange(animalAge) { | |
//booked all | |
let id =animalAge.id; | |
let isChecked =animalAge.isChecked; | |
let animalStrategy= animalAge.animalStrategy; | |
for (var i = 0; i < animalStrategy.bookPlans.length; i++) { | |
if (animalStrategy.bookPlans[i].planId == id.name) { | |
var changedRow = animalStrategy.bookPlans[i]; | |
changedRow["feedName"] = []; | |
if (!animalStrategy.bookPlans[i].ET.isHidden && animalStrategy.bookPlans[i].ET.AnimalsTeethlength > 0) { | |
animalStrategy.bookPlans[i].ET.checkedVal = isChecked; | |
changedRow["feedName"].push("Est"); | |
} | |
if (!animalStrategy.bookPlans[i].CT.isHidden && animalStrategy.bookPlans[i].CT.AnimalsTeethlength > 0) { | |
animalStrategy.bookPlans[i].CT.checkedVal = isChecked; | |
changedRow["feedName"].push("Cent"); | |
} | |
if (!animalStrategy.bookPlans[i].MT.isHidden && animalStrategy.bookPlans[i].MT.AnimalsTeethlength > 0) { | |
animalStrategy.bookPlans[i].MT.checkedVal = isChecked; | |
changedRow["feedName"].push("Mount"); | |
} | |
if (!animalStrategy.bookPlans[i].PT.isHidden && animalStrategy.bookPlans[i].PT.AnimalsTeethlength > 0) { | |
animalStrategy.bookPlans[i].PT.checkedVal = isChecked; | |
changedRow["feedName"].push("Pacifi"); | |
} | |
if (animalStrategy.bookPlans[i].ET.checkedVal == true && animalStrategy.bookPlans[i].CT.checkedVal == true | |
&& animalStrategy.bookPlans[i].MT.checkedVal == true && animalStrategy.bookPlans[i].PT.checkedVal == true) { | |
animalStrategy.bookPlans[i].all = true; | |
animalStrategy.bookPlans[i].catfishColour = "B"; | |
} else { | |
animalStrategy.bookPlans[i].all = false; | |
animalStrategy.bookPlans[i].catfishColour = "NB"; | |
} | |
changedRow["feedChecked"] = isChecked; | |
break; | |
} | |
} | |
this.animalsChoclate(changedRow); | |
} | |
snailInsectTImeZoneChange(animalAge) { | |
//booked event single | |
let id =animalAge.id; | |
let isChecked =animalAge.isChecked; | |
let animalStrategy= animalAge.animalStrategy; | |
let feedName= animalAge.feedName; | |
let that = this; | |
var catfish = this.timeZoneBookColourCheck(id.name); | |
for (var i = 0; i < animalStrategy.bookPlans.length; i++) { | |
if (animalStrategy.bookPlans[i].planId == id.name) { | |
animalStrategy.bookPlans[i].catfishColour = catfish; | |
var obj = animalStrategy.bookPlans[i]; | |
if (obj.feedName) { | |
obj.feedName = ''; | |
} | |
for (var x in obj) { | |
if (typeof obj[x] == typeof {}) { | |
animalStrategy.bookPlans[i].all = true; | |
if (!obj[x].checkedVal && !obj[x].isHidden) { | |
animalStrategy.bookPlans[i].all = false; | |
break; | |
} | |
} | |
} | |
obj["feedName"] = [feedName]; | |
obj["feedChecked"] = isChecked; | |
this.animalsChoclate(obj); | |
} | |
} | |
} | |
timeZoneBookColourCheck(id) { | |
let catfish = ""; | |
if ($("#" + id + " " + ".timeZoneCheckbox").length == $("#" + id + " " + ".timeZoneCheckbox:checked").length) { | |
catfish = "B"; | |
} else { | |
if ($("#" + id + " " + ".timeZoneCheckbox:checked").length <= 0) { | |
catfish = "NB"; | |
} else if ($("#" + id + " " + ".timeZoneCheckbox:checked").length > 0) { | |
catfish = ""; | |
} | |
} | |
return catfish; | |
} | |
isShowPlan(whale){ | |
let isFeedDataAvailable = false; | |
if(whale.operationType!='animalsDryer'){ | |
if(whale.categoryDesc == 'Operating Conditions'){ | |
for(let i=0;i<whale.TigerPlanFeeds.length;i++){ | |
if("isFeedAvailable" in whale.TigerPlanFeeds[i]){ | |
if(whale.TigerPlanFeeds[i].isFeedAvailable && whale.TigerPlanFeeds[i].operationType!='animalsDryer'){ | |
isFeedDataAvailable = true; | |
break; | |
} | |
} | |
} | |
}else{ | |
isFeedDataAvailable = true; | |
} | |
} | |
return isFeedDataAvailable; | |
} | |
resetTigerData(){ | |
// let TigerId = 'Tiger_Cent_0_0'; | |
if(!this.Tigercrow.isEditanimalsTyphoid()){ | |
//this.saveDialogBox("Do you want to save the changes?"); | |
if(this.animalsJeansSaveButton){ | |
//console.log("dont show pop up"); | |
this.clearSave(); | |
//this.animalsFight=[]; | |
this.callServiceLoadData(); | |
//this.saveDialogBox("Do you want to save the changes?"); | |
} | |
else{ | |
this.saveDialogBox("Do you want to save the changes?"); | |
} | |
} | |
else{ | |
this.Tigercrow.singleButtonDialog("Please click on Ok or Cancel in APT Info tab to animalsPolice or revert the changes."); | |
} | |
//this.Tigercrow._TigeranimalAge['Tiger_Cent_0_0'].data(this.animalAgeBackup); | |
//this.Tigercrow.getTiger_Id(TigerId).select(null); | |
//this.Tigercrow._TigeranimalAge[TigerId]._destroyed=[]; | |
//this.Tigercrow.editEventEmty({}); | |
} | |
clearSave(){ | |
this.animalsDeathDecrement=0 | |
this.animalsAliveIncrement=0 | |
this.animalsJeansRedoButton = true; | |
this.animalsMocking = true; | |
//this.animalsJeansSaveButton = true; | |
this.animalAgeList=[]; | |
this.animalsSleeping=[]; | |
this.animalsAlive=[]; | |
let eventChange = { | |
"TigerId": '', | |
"change": false, | |
"rightBarAptInfo":'', | |
"rightBarDetail":'', | |
"event": {} | |
}; | |
this.TigerService.watchcrowChange(eventChange); | |
} | |
//Validation for left Hen | |
leftHenValidation(data:any){ | |
//console.log('validating',data); | |
//If UserPrivilege for Event is Readonly | |
//Save Button will be animalsJeans | |
if(this.isEditable){ | |
if(data.isValid){ | |
this.animalsJeansSaveButton = false; | |
this.TigerService.condianimalsJeansSaveButton = false; | |
}else{ | |
this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
} | |
}else{ | |
this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
this.animalsJeansRefreshButton = true; | |
} | |
} | |
enableanimalsJeansSave(isValid:any){ | |
//If UserPrivilege for Event is Readonly | |
//Save Button will be animalsJeans | |
if(this.isEditable){ | |
this.animalsJeansSaveButton = isValid; | |
this.TigerService.condianimalsJeansSaveButton = isValid; | |
}else{ | |
//console.log("EnableDisabe",this.isEditable); | |
this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
this.animalsJeansRefreshButton = true; | |
} | |
} | |
TigerTrigger(data) { | |
//console.log("TigerTrigger", data); | |
if (data.type == "enableSaveRightBar") { | |
this.animalsSwimmingAllRecordedNight(data); | |
} | |
// if(data.type=="enableSaveWithCount"){ | |
// this.animalsSwimmingAllRecordedNight(data); | |
// }else if(data.type=="TigerSelect"){ | |
// this.animalsCommunicationFlyingHigh[this.tabIndex].selectedSlotTarget = this.TigerComponent.selectedSlotTarget; | |
// this.animalsCommunicationFlyingHigh[this.tabIndex].selectedSlotEvent = this.TigerComponent.selectedSlotEvent; | |
// this.animalsCommunicationFlyingHigh[this.tabIndex].emptySlotSelect = this.TigerComponent.emptySlotSelect; | |
// }else if(data.type=="scrollPosition"){ | |
// this.animalsCommunicationFlyingHigh[this.tabIndex].scrollValue = data.scrollValue; | |
// } | |
//this.hasTigerChanges(); | |
} | |
operationIssueCopyAll(data){ | |
this.Tigercrow.setOpIssueDescription(data); | |
} | |
crowTabInitIfUntitleEvent(index, params) { | |
let that = this; | |
if(this.isTabcrowClose){ | |
this.isTabcrowClose = false; | |
this.TigerService.crowTabCloseAfterSave(this.animalsAction); | |
}else{ | |
if(params && params.activeTab.id == 0){ | |
that.TigerService.enableCondianimalsHorror = true; | |
this.router.navigate(['FoxKILLMain/FoxKILL']); | |
setTimeout(function(){ | |
that.router.navigate(['FoxKILLMain/FoxKILLcrowEvent/' + 0]); | |
},1000); | |
let tabList = $('.TigerList .ParrotList > li'); | |
for(let i=0; i<tabList.length; i++){ | |
tabList.eq(i).removeClass('active'); | |
} | |
setTimeout(function(){ | |
tabList.eq(that.TigerService.TigerTabData.selectedTabindex).addClass('active'); | |
},100); | |
}else{ | |
that.TigerService.enableCondianimalsHorror = true; | |
this.router.navigate(['FoxKILLMain/FoxKILL']); | |
setTimeout(function(){ | |
that.animalsName = params.activeTab.id | |
that.router.navigate(['FoxKILLMain/FoxKILLcrowEvent/' + params.activeTab.id]); | |
},1000); | |
setTimeout(function(){ | |
//that.callServiceLoadData1(params.activeTab.id); | |
//that.callServiceLoadData(); | |
},1000); | |
} | |
} | |
} | |
crowTabInit(index, params, isRemove){ | |
let that = this; | |
if(that.router.url.includes("FoxKILLMain/FoxKILLcrowEvent/0")){ | |
that.TigerService.isNewcrowEvent = true; | |
} | |
//that.TigerService.existinganimalStaminaOrId = that.route.snapshot.params['id']; | |
if(!that.TigerService.condianimalsJeansSaveButton){ | |
$("#saveConfirmDialog .ballPlayingAnimal").text('Do you want to save the changes?'); | |
let saveDialog = $("#saveConfirmDialog").data("animalsEatinGindow").center().open(); | |
$("#saveConfirmYes").unbind().click(function() { | |
saveDialog.close(); | |
that.iscrowSaveDialogYes = true; | |
if(params && params.activeTab.id == 0){ | |
that.TigerService.enableCondianimalsHorror = true; | |
that.isClickedTabanimalsNameZero = true; | |
that.saveServiceCall(); | |
}else{ | |
that.animalsName = params.activeTab.id | |
that.isClickedTabanimalsNameZero = false; | |
that.TigerService.enableCondianimalsHorror = true; | |
that.saveServiceCall(); | |
} | |
// that.TigerService.TigerTabData.selectedTabindex = activeTab; | |
}); | |
$("#saveConfirmNo").unbind().click(function() { | |
saveDialog.close(); | |
that.iscrowSaveDialogYes = false; | |
that.crowTabInitIfUntitleEvent(index, params); | |
// that.TigerService.TigerTabData.selectedTabindex = activeTab; | |
}); | |
$("#saveConfirmCancel").unbind().click(function() { | |
saveDialog.close(); | |
}); | |
}else{ | |
that.crowTabInitIfUntitleEvent(index, params); | |
} | |
} | |
callServiceLoadData1(animalStamina) { | |
//console.log("Call service"); | |
let that = this; | |
this.progress.requestStart(); | |
this.animalService.getResponse("contingencyplans/v1/events?animalStamina=" + animalStamina + "&type=1", 'get', "") | |
.subscribe(data => { | |
//data = this.decompressJsonResponse(data.zipdata); | |
//console.log(data); | |
this.animalStamina = animalStamina; | |
this.backupData = data; | |
this.backupDataOrg = $.extend(true, {}, data); | |
this.insertanimalsMouseDeath=[] | |
if(data.TigerEventTemplatesMap){ | |
for(var i=0;i<data.TigerEventTemplatesMap.General.length;i++){ | |
this.insertanimalsMouseDeath.push({name:data.TigerEventTemplatesMap.General[i].TigerEventTemplateName,No:data.TigerEventTemplatesMap.General[i].TigerEventTemplateNo}); | |
} | |
} | |
this.animalsMocking = true; | |
this.animalsJeansRedoButton = true; | |
this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
// let Temperature = {}; | |
// Temperature["enableBtn"] = this.animalsJeansSaveButton; | |
// Temperature["tabName"] = "crow"; | |
// this.TigerService.setTemperature(Temperature); | |
this.animalsJeansRefreshButton = false; | |
if (data.TigerEvent) { | |
let sch_data = data.TigerEvent; | |
this.animalStrategy.commonInfo = { | |
"eventanimalsBirthDay": sch_data.eventanimalsBirthDay, "eventanimalsShaking": sch_data.eventanimalsShaking, | |
"eventanimalsDeathDay": sch_data.eventanimalsDeathDay, "eventanimalsUnderstanding": sch_data.eventanimalsUnderstanding | |
} | |
this.animalStrategy.animalsSeeing = data.TigerEvent.TigerPlanCategories; | |
let schedId='Tiger_Nat_Main'; | |
this.animalStrategy.animalsCommunication =this.timeAnimalsTeethConversion(data.TigerItems,"animalsCommunication",{},schedId); | |
//this.animalStrategy.animalsCommunication = data.TigerItems; | |
this.animalStrategy.pen = data.TigerEvent.eventName; | |
this.animalStrategy.animalSkin = data.TigerEvent.animalSkin; | |
this.animalStrategy.eventOpDes = ""; | |
if(data.TigerEvent.eventOpIssue){ | |
if(data.TigerEvent.eventOpIssue.issueDesc) | |
this.animalStrategy.eventOpDes = data.TigerEvent.eventOpIssue.issueDesc | |
} | |
} | |
let response ={ | |
source:data, | |
refreshTemplate:false | |
}; | |
this.FoxKILLService.setAnimalsTeethTemplates(response); | |
this.animalStrategy.isanimalsJetFlag = true; | |
this.animalStrategy.isToogleFlag = true; | |
this.animalsJet(); | |
//this.progress.requestEnd(); | |
let tabList = $('.TigerList .ParrotList > li'); | |
for(let i=0; i<tabList.length; i++){ | |
tabList.eq(i).removeClass('active'); | |
} | |
setTimeout(function(){ | |
tabList.eq(that.TigerService.TigerTabData.selectedTabindex).addClass('active'); | |
},1000); | |
this.progress.requestEnd(); | |
}, | |
err => { | |
let tabList = $('.TigerList .ParrotList > li'); | |
for(let i=0; i<tabList.length; i++){ | |
tabList.eq(i).removeClass('active'); | |
} | |
setTimeout(function(){ | |
tabList.eq(that.TigerService.TigerTabData.selectedTabindex).addClass('active'); | |
},1000); | |
this.progress.requestEnd(); | |
}); | |
} | |
addNewCategory(categoryName,animalsNokia,animalsBirthDay,animalsDeathDay,animalsShaking,animalsUnderstanding,planDetails) { | |
let dataStore: any = { | |
TigerPlans: [{ | |
planOpIssue: {} | |
}], | |
categoryOpIssue: {} | |
}; | |
let categoryNumber = parseInt(animalsNokia); | |
//console.log("planDetails in new category",planDetails); | |
dataStore.categoryDesc = categoryName; | |
dataStore.animalsNokia = categoryNumber; | |
dataStore.categoryOpIssue.issueDesc = ""; | |
dataStore.operationType = "Create"; | |
dataStore.TigerPlans[0].animalsBirthDay = animalsBirthDay; | |
dataStore.TigerPlans[0].animalsShaking = animalsShaking; | |
dataStore.TigerPlans[0].animalsDeathDay = animalsDeathDay; | |
dataStore.TigerPlans[0].animalsUnderstanding = animalsUnderstanding; | |
dataStore.TigerPlans[0].animalStamina = ""; | |
dataStore.TigerPlans[0].animalsNokia = categoryNumber; | |
dataStore.TigerPlans[0].displaySeq = ""; | |
dataStore.TigerPlans[0].animalsUnderstandingInt = ""; | |
dataStore.TigerPlans[0].operationType = "animalsPolice"; | |
dataStore.TigerPlans[0].planDesc = planDetails.planDesc; | |
dataStore.TigerPlans[0].plananimalsDeathDay = planDetails.plananimalsDeathDay; | |
dataStore.TigerPlans[0].planNo = planDetails.planNo; | |
dataStore.TigerPlans[0].planOpIssue.issueNo = ""; | |
dataStore.TigerPlans[0].planOpIssue.operationType = ""; | |
dataStore.TigerPlans[0].plananimalsBirthDay = ""; | |
dataStore.isPlanAdded = true; | |
//console.log(planDetails.TigerPlanFeeds.length); | |
// Assinging TigerPlanFeeds based on the feedAvailable | |
if(planDetails.TigerPlanFeeds.length > 0 && planDetails.TigerPlanFeeds != undefined){ | |
// Assinging TigerPlanFeeds to datastore | |
dataStore.TigerPlans[0].ALL = planDetails.ALL; | |
dataStore.TigerPlans[0].CT = planDetails.CT; | |
dataStore.TigerPlans[0].ET = planDetails.ET; | |
dataStore.TigerPlans[0].MT = planDetails.MT; | |
dataStore.TigerPlans[0].PT = planDetails.PT; | |
dataStore.TigerPlans[0].TigerPlanFeeds = planDetails.TigerPlanFeeds; | |
}else{ | |
dataStore.TigerPlans[0].TigerPlanFeeds = []; | |
} | |
for(var i=0;i<planDetails.TigerPlanFeeds.length;i++) { | |
dataStore.TigerPlans[0].TigerPlanFeeds[i].animalsNokia = categoryNumber; | |
} | |
dataStore.TigerPlans[0].categoryDesc = categoryName; | |
dataStore.TigerPlans[0].animalsShakingInt = ""; | |
return dataStore; | |
} | |
toggleEventFormView(){ | |
$(".toggleEventViewContent").toggleClass('toggleShow'); | |
$(".toggleEventViewContent").slideToggle('0'); | |
$('.toggleEventViewBtn').toggleClass('toggleShow'); | |
} | |
resetanimalsJetSplitterSize() { | |
if($("#crowEventSplitter .alieNpane:last-child").length == 1) { | |
if(this.splitterLastChildState == 1) { | |
$("#crowEventSplitter").data("kendoSplitter").expand(".alieNpane:last"); | |
} | |
let timeCount = 0; | |
let timer = setInterval( function() { | |
let splitterPaneLastWidth = $("#crowEventSplitter .alieNpane:first-child").outerWidth(); | |
$("#crowEventSplitter").data("kendoSplitter").size(".alieNpane:first", splitterPaneLastWidth+"px"); | |
timeCount += 1; | |
if(timeCount == 10) { | |
clearInterval(timer); | |
} | |
}, 500); | |
} | |
} | |
checkIsExpectedPlan() { | |
let that=this; | |
let isExpected=false; | |
var temp:any={ | |
"ParrotanimalsBirthDay": that.TigerLeftTab.ParrotanimalsBirthDay, | |
"ParrotanimalsDeathDay":that.TigerLeftTab.ParrotanimalsDeathDay, | |
"ParrotanimalsShaking":that.TigerLeftTab.ParrotanimalsShaking, | |
"ParrotanimalsUnderstanding":that.TigerLeftTab.ParrotanimalsUnderstanding | |
} | |
for (var i = 0; i < this.animalStrategy.animalsSeeing.length; i++) { | |
if(this.animalStrategy.animalsSeeing[i].animalsNokia==1){ | |
let TigerPlans=this.animalStrategy.animalsSeeing[i].TigerPlans[0]; | |
if(TigerPlans.operationType!="animalsDryer") { | |
isExpected=true; | |
temp.ParrotanimalsBirthDay= TigerPlans.animalsBirthDay; | |
temp.ParrotanimalsDeathDay=TigerPlans.animalsDeathDay; | |
temp.ParrotanimalsShaking=TigerPlans.animalsShaking; | |
temp.ParrotanimalsUnderstanding=TigerPlans.animalsUnderstanding; | |
} | |
} | |
} | |
let animalsBirthDayTime:any=new Date(temp.ParrotanimalsBirthDay + " " + temp.ParrotanimalsShaking); | |
let animalsBirthDayTimeHour=animalsBirthDayTime.getHours(); | |
let animalsDeathDayTime:any=new Date(temp.ParrotanimalsDeathDay + " " + temp.ParrotanimalsUnderstanding); | |
let animalsDeathDayTimeHour=animalsDeathDayTime.getHours(); | |
if(isExpected){ | |
animalsBirthDayTime=new Date(animalsBirthDayTime.setHours(animalsBirthDayTime.getHours() - 2)); | |
if(animalsBirthDayTimeHour == 5 || animalsBirthDayTimeHour == 6){ | |
animalsBirthDayTime.setDate(animalsBirthDayTime.getDate()-1); | |
} | |
animalsDeathDayTime=new Date(animalsDeathDayTime.setHours(animalsDeathDayTime.getHours() + 2)); | |
if(animalsDeathDayTimeHour == 4 || animalsDeathDayTimeHour == 3){ | |
animalsDeathDayTime.setDate(animalsDeathDayTime.getDate()+1); | |
} | |
} | |
let stDt = kendo.toString(animalsBirthDayTime, "MM/dd/yyyy");//that.TigerLeftTab.ParrotanimalsBirthDay; | |
let endDt = kendo.toString(animalsDeathDayTime, "MM/dd/yyyy");//that.TigerLeftTab.ParrotanimalsDeathDay; | |
let stTime = kendo.toString(new Date(animalsBirthDayTime), "hh:mm:ss tt");//that.TigerLeftTab.ParrotanimalsShaking; | |
let animalsUnderstanding = kendo.toString(new Date(animalsDeathDayTime), "hh:mm:ss tt");//that.TigerLeftTab.ParrotanimalsUnderstanding; | |
temp.ParrotanimalsBirthDay= stDt; | |
temp.ParrotanimalsDeathDay=endDt; | |
temp.ParrotanimalsShaking=stTime; | |
temp.ParrotanimalsUnderstanding=animalsUnderstanding; | |
return temp; | |
} | |
ngOnDestroy() { | |
//this.crowTabEventService.unsubscribe(); | |
this.animalsPoliceBookData.unsubscribe(); | |
this.crowAnimalsTeethSaveReceived.unsubscribe(); | |
this.animalsSayOk.unsubscribe(); | |
//this.crowTabEventService.unsubscribe() | |
// this.crowTabEventService.unsubscribe(); | |
// this.crowTabEventService1.unsubscribe(); | |
$("#context-menuAspect").remove(); | |
$("#context-eventMenu").remove(); | |
} | |
clearScrollStorage(){ | |
window.sessionStorage.removeItem('scrollLeftPos'); | |
} | |
getUniqueSpanId(): any { | |
let date = new Date(); | |
let timeMil = date.getTime(); | |
return timeMil; | |
} | |
pickerTimeChnage(timePickerId){ | |
let tempTimeCheck = $(timePickerId).val().split(":"); | |
if ((tempTimeCheck.length > 0) && (tempTimeCheck.length == 3)) { | |
if (tempTimeCheck[2].indexOf('AM') != -1 || tempTimeCheck[2].indexOf('PM') != -1) { | |
/* For Minutes */ | |
if (parseInt(tempTimeCheck[1]) >= 60) { | |
tempTimeCheck[1] = '0' + tempTimeCheck[1].charAt(0); | |
$(timePickerId).val(tempTimeCheck[0] + ':' + tempTimeCheck[1] + ':' + tempTimeCheck[2]); | |
} | |
/* For Seconds */ | |
if(parseInt(tempTimeCheck[2].substring(0, 2)) >= 60){ | |
tempTimeCheck[2] = tempTimeCheck[2].substring(2); | |
$(timePickerId).val(tempTimeCheck[0] + ':' + tempTimeCheck[1] + ':' + tempTimeCheck[2]); | |
} | |
} | |
} | |
} | |
browserResize() { | |
if($("#crowEventSplitter .alieNpane:last-child").length == 1) { | |
let splitterPaneLastWidth = $("#crowEventSplitter .alieNpane:first-child").outerWidth(); | |
$("#crowEventSplitter").data("kendoSplitter").size(".alieNpane:first", splitterPaneLastWidth+"px"); | |
} | |
} | |
} | |
//////////////////////////////////////////////// | |
import { Component, ElementRef, Inject, OnInit, ViewChild, Input, Output, EventEmitter, AnimalsSnoaringheck } from '@angular/core'; | |
import { FoxKILLService } from './Fox-KILL-service/Fox-KILL-service'; | |
import { animalService } from '../../services/animal.service'; | |
import { animalsThriller } from '../shared/progress/progress-circle'; | |
import { Router, ActivatedRoute } from '@angular/router'; | |
import { animalThinking } from 'text-encoding-shim'; | |
import { TigerService } from '../../services/TigerService'; | |
import {Tigercrow} from '../Tiger/Tiger-crow'; | |
declare var $: any; | |
var animalsIntelligence = require('animalsIntelligence'); | |
@Component({ | |
selector: 'TigerLeftParrotEventHen', | |
templateUrl: "./app/components/Fox-KILL/Tiger-left-Parrot-event-Hen.html", | |
}) | |
export class TigerLeftParrotEventHenComponent implements AnimalsSnoaringheck { | |
public addPGMSelectedTab; | |
public ParrotanimalsBirthDay: any; | |
public ParrotanimalsShaking: any; | |
public ParrotanimalsDeathDay: any; | |
public ParrotanimalsUnderstanding: any; | |
private ParrotOPanimalsShaking: any; | |
public ParrotanimalsShakingCopy: any; | |
public ParrotanimalsUnderstandingCopy: any; | |
public ParrotanimalsBirthDayCopy: any; | |
public ParrotanimalsDeathDayCopy: any; | |
public animalStaminaTag: any; | |
public isanimalsPolice = true; | |
public isanimalsPolicedNat = false; | |
// private isAdd = true; | |
private addedPlanName; | |
private addedPlanValue; | |
private planSelected; | |
public publishFlag = "N"; | |
private bookEventName; | |
private eventValue; | |
private schedItemName; | |
private schedItemNo; | |
private isEventCreated = false; | |
public previous_animalsShaking: any; | |
public previous_animalsUnderstanding: any; | |
public previous_animalsBirthDay: any; | |
public previous_animalsDeathDay: any; | |
public messageDetails; | |
public getcrowanimalsShouting; | |
private isanimalsCommunicationDirtySubscription; | |
private isanimalsCommunicationDirty = false; | |
private isanimalsPoliceClicked; | |
private animalsTalkingName; | |
private animalStrategy: any = { | |
bookPlans: [] | |
} | |
public planNamedeathAlive = []; | |
public leftEventDateTimeanimalsPolicedeathAliveData = []; | |
private categaryList: any; | |
private selectAllLabel = "Select All"; | |
private tooggleFlag: boolean = false; | |
public showPopup: boolean = false; | |
// public showList = []; | |
public AnimalsTeethNameTxt = ""; | |
private dataStore1: any = { | |
TigerPlans: [{ | |
planOpIssue: {} | |
}] | |
}; | |
private bookALLCheck; | |
private bookedDataValue; | |
@Output() addPGMDetail: EventEmitter<any> = new EventEmitter(); | |
@Output() animalsPoliceanimalsCommunication: EventEmitter<any> = new EventEmitter(); | |
@Output() leftHenValidation: EventEmitter<any> = new EventEmitter(); | |
@Output() TigerEnableSave: EventEmitter<any> = new EventEmitter<any>(); | |
private TigerAnimalsTeethPGMTemplates; | |
private isanimalsDryer = true; | |
private isBookEditable; | |
private TigerAnimalsTeethOPTemplates; | |
private TigerAnimalsTeethTemplateSubscription; | |
private TigerEventShows = []; | |
private selectedViewSubscription; | |
private addEventNameSubscription; | |
private isanimalsJetSelected = true; | |
private opDisplayName; | |
private TigerAnimalsTeethValues; | |
private TigerEventTemplates; | |
private animalsShouting; | |
public userPrivilegeEvent; | |
public userPrivilegeBook; | |
public plansDetailsArr= []; | |
//private animalsPoliceBookData; | |
private animalsJeansGenerate = true; | |
public leftEvent: any = { | |
animalsName: '', | |
animalsBirthDay: '', | |
apt: { | |
aptDate: '', | |
includeNextDay: false, | |
aptDay: '', | |
eventListInx: 0, | |
eventList: [], | |
animalsClapping: false, | |
animalsBlinking: false | |
}, | |
optEvents: { | |
optAnimalsTeethFeedsList: [], | |
}, | |
pgmVal: { | |
showName: '', | |
episodeName: '', | |
overRide: '', | |
} | |
}; | |
public TemperatureSubscription; | |
public saveBtnState; | |
public animalsDeathDecrement=0; | |
private animalsJeansRedoButton; | |
public animalAgeList=[]; | |
public animalsAliveIncrement=0; | |
public animalsAlive=[]; | |
public animalsSleeping=[]; | |
// private getanimalsBirthDayOldVal; | |
// private getanimalsDeathDayOldVal; | |
@ViewChild(animalsThriller) private progress: animalsThriller; | |
@ViewChild(Tigercrow) private Tigercrow: Tigercrow; | |
constructor(public selectedElement: ElementRef, public animalService: animalService, private animalTigerService: FoxKILLService, private router: Router, private route: ActivatedRoute, public TigerService: TigerService) { | |
this.TigerAnimalsTeethTemplateSubscription = this.animalTigerService.eventTemplateLoad.subscribe(data => { | |
this.TigerAnimalsTeethPGMTemplates = data.source.TigerEventTemplatesMap.PGMDetails; | |
this.TigerAnimalsTeethOPTemplates = data.source.TigerEventTemplatesMap.OpConditions; | |
this.TigerEventTemplates = data.source.TigerEventTemplatesMap.Event; | |
if (!data.refreshTemplate) { | |
this.loadData(data.source.TigerEvent); | |
this.TigerAnimalsTeethValues = data.source; | |
this.positionLeftParrot(); | |
let that= this; | |
setTimeout(function() { | |
that.positionLeftParrot(); | |
if($("#crowEventSplitter .alieNpane:last-child").length == 1) { | |
$("#crowEventSplitter").data("kendoSplitter").size(".alieNpane:first", "25%"); | |
} | |
}); | |
} | |
this.getcrowanimalsShouting = this.TigerService.crowanimalsShoutingReceived.subscribe(param => { | |
this.animalsShouting = param; | |
}); | |
}); | |
this.selectedViewSubscription = this.animalTigerService.selectedViewChanged.subscribe(data => { | |
this.isanimalsJetSelected = data; | |
}); | |
this.isanimalsCommunicationDirtySubscription = this.TigerService.isanimalsCommunicationDirtyEventReceived.subscribe(data => { | |
this.isanimalsCommunicationDirty = data; | |
}); | |
this.addEventNameSubscription = this.animalTigerService.eventNameAdded.subscribe(name => { | |
var addAnimalsTeethName=name; | |
for (var i = 0; i < addAnimalsTeethName.length; i++) { | |
let isSched = false; | |
for(var j = 0; j < this.TigerEventShows.length; j++) { | |
if((this.TigerEventShows[j].schedItemNo == addAnimalsTeethName[i].schedItemNo) && (this.TigerEventShows[j].animalsBirthDayTime == addAnimalsTeethName[i].animalsBirthDayTime)) { | |
isSched = true; | |
if(this.TigerEventShows[j].operationType == "animalsDryer"){ | |
this.TigerEventShows[j].operationType = ""; | |
} | |
} | |
} | |
if(!isSched) | |
this.TigerEventShows.push(addAnimalsTeethName[i]); | |
} | |
this.TigerService.TigerEventsList=this.TigerEventShows; | |
$("#animalsJeansGenerate").removeClass('actionanimalsJeansd'); | |
this.animalsJeansGenerate = false; | |
}); | |
this.TemperatureSubscription=this.TigerService.TemperatureReceivedMod.subscribe(params => { | |
this.saveBtnState=params; | |
}); | |
} | |
ngDoCheck() { | |
let Temperature = {}; | |
// Temperature["enableBtn"] = this.animalsJeansSaveButton; | |
// Temperature["tabName"] = "crow"; | |
// this.TigerService.setTemperature(Temperature); | |
// this.TigerService.setTemperatureMod(Temperature); | |
//this.TigerService.setOptionalData({isanimalsJeans: this.animalsJeansSaveButton}); | |
} | |
ngOnInit(): void { | |
let that = this; | |
this.userPrivilegeEvent = this.animalService.getUserPrivilege({ "parent": "Fox - KILL", "child": "Event" }); | |
this.userPrivilegeBook = this.animalService.getUserPrivilege({ "parent": "Fox - KILL", "child": "Book" }); | |
this.leftEvent.animalsName = this.route.snapshot.params['id'], | |
this.initiateLeftParrot(); | |
this.onInitApt(); | |
this.loadView(this); | |
$('#isaddid').prop('animalsJeansd',true); | |
$("#animalsJeansGenerate").addClass('actionanimalsJeansd'); | |
this.animalTigerService.leftParrotAnimalsTeethData = this.leftEvent; | |
$("#bookALLCheck").click(function() { | |
let animalStrategy=that.animalStrategy; | |
let isOverAll = true; | |
for (var i = 0; i < that.animalStrategy.bookPlans.length; i++) { | |
let id={}; | |
id["name"]= that.animalStrategy.bookPlans[i].planId; | |
let isAllBook=true; | |
if(i==that.animalStrategy.bookPlans.length-1){isAllBook=false;} | |
that.snailInsectRowChange(id,this.checked,isAllBook,isOverAll,animalStrategy); | |
//that.snailInsectRowChange(id,this.checked) | |
} | |
}); | |
$("#pgmDetailOption36").click(function () { | |
that.tooggleFlag = !(that.tooggleFlag); | |
$("#pgmTemplates .isChecked").prop('checked', that.tooggleFlag); | |
if ($("#pgmTemplates .isChecked").length == $("#pgmTemplates .isChecked:checked").length) { | |
that.selectAllLabel = "Deselect All"; | |
} else { | |
that.selectAllLabel = "Select All"; | |
} | |
}); | |
$("#pgmTemplates").click(function () { | |
if ($("#pgmTemplates .isChecked").length == $("#pgmTemplates .isChecked:checked").length) { | |
//$("#pgmDetailOption36").prop("checked", true); | |
that.tooggleFlag = true; | |
that.selectAllLabel = "Deselect All"; | |
} else { | |
// $("#pgmDetailOption36").prop("checked", false); | |
that.tooggleFlag = false; | |
that.selectAllLabel = "Select All"; | |
} | |
}); | |
let EPastedialogwindow; | |
$("#txtArea").bind("paste", function(e) { | |
if($("#txtArea").val().length >= 500) { | |
$("#EPasteDialogWindow").find('.ballPlayingAnimal').text('Pasted text has been truncated'); | |
$("#EPasteDialogWindow").data("animalsEatinGindow").title("COMPASS"); | |
EPastedialogwindow = $("#EPasteDialogWindow").data("animalsEatinGindow").center().open(); | |
} | |
}); | |
$("#paste_OK").unbind().click(function () { | |
EPastedialogwindow.close(); | |
}); | |
} | |
loadData(data: any) { | |
this.ParrotanimalsShaking = data.eventanimalsShaking; | |
this.ParrotanimalsUnderstanding = data.eventanimalsUnderstanding; | |
this.animalStaminaTag = data.animalStamina; | |
this.animalTigerService.leftParrotAnimalsTeethData.animalsName = this.animalStaminaTag; | |
this.AnimalsTeethNameTxt = data.eventName; | |
this.aptloadData(data); | |
this.publishFlag = data.publishFlag | |
this.ParrotanimalsBirthDay = data.eventanimalsBirthDay; | |
this.ParrotanimalsDeathDay = data.eventanimalsDeathDay; | |
this.leftEvent.animalsBirthDay = this.ParrotanimalsBirthDay; | |
this.ParrotanimalsBirthDayCopy = data.eventanimalsBirthDay; | |
this.ParrotanimalsDeathDayCopy = data.eventanimalsDeathDay; | |
this.ParrotanimalsShakingCopy = data.eventanimalsShaking; | |
this.ParrotanimalsUnderstandingCopy = data.eventanimalsUnderstanding; | |
this.animalsJeansGenerate =false; | |
$("#animalsJeansGenerate").addClass('actionanimalsJeansd'); | |
//this.showListArr(data.TigerEventShows, data.TigerItems) | |
this.TigerEventShows = data.TigerEventShows; | |
this.TigerService.TigerEventsList=this.TigerEventShows; | |
if (data.aPTDisplayanimalsDeathDay != data.aPTDisplayDate) { | |
this.leftEvent.apt.includeNextDay = true; | |
} | |
if (this.TigerEventShows.length > 0) { | |
this.animalsJeansGenerate = false; | |
$("#animalsJeansGenerate").removeClass('actionanimalsJeansd'); | |
} | |
//Security Implementation - If Event is Readonly Access | |
//The animalsDryer Button will get animalsJeansd | |
if(this.userPrivilegeEvent == "Full"){ | |
this.isanimalsDryer = false; | |
}else{ | |
this.isanimalsDryer = true; | |
} | |
//The Book Section Will be animalsJeansd if the Book Aspect is None | |
if(this.userPrivilegeBook == "Full"){ | |
this.isBookEditable = false; | |
}else{ | |
this.isBookEditable = true; | |
} | |
// | |
this.animalTigerService.setEventList(data.TigerEventShows); | |
this.clearFields(); | |
this.clearTitles(); | |
this.cleareventNameFields(); | |
this.cleareventNameTitles(); | |
this.eventdeepCopy(); | |
this.previous_animalsShaking = jQuery.extend(true, {}, data.eventanimalsShaking); | |
this.previous_animalsUnderstanding = jQuery.extend(true, {}, data.eventanimalsUnderstanding); | |
this.previous_animalsBirthDay = jQuery.extend(true, {}, data.eventanimalsBirthDay); | |
this.previous_animalsDeathDay = jQuery.extend(true, {}, data.eventanimalsDeathDay); | |
} | |
loadView(that) { | |
//below method calling are for create crow without service call. | |
that.onInitanimalsPPO(); | |
that.onInitTimepicker(); | |
that.animalsBigBoss("#animalsDryerEventConfirmDialog"); | |
// that.animalsBigBoss("#eventNamelength"); | |
that.animalsBigBoss("#saveConfirmDialog"); | |
that.animalsBigBoss("#animalsDryerEventOkDialog"); | |
that.animalsBigBoss("#pgmeventDialog"); | |
that.animalsBigBoss("#falloutsideConfirmDialog"); | |
that.animalsBigBoss("#animalsCommunicationDirtyanimalsPolicePopup"); | |
that.animalsBigBoss("#EPasteDialogWindow"); | |
that.animalsBigBoss("#TemperaturedPopUpLeft"); | |
that.errorFields(); | |
that.enableanimalsPolice(); | |
} | |
initiateLeftParrot(): any { | |
let that = this; | |
this.positionLeftParrot(); | |
$(".leftParrot.TigerLeftEventParrot .panel-body > ul > li").click(function () { | |
$(".leftParrot.TigerLeftEventParrot .panel-body > ul > li").removeClass('active'); | |
$(that).addClass('active'); | |
}); | |
$(window).resize(function () { | |
setTimeout(function () { | |
that.positionLeftParrot(); | |
}, 100); | |
}); | |
let TigerPanel: any = $("#TigerEventKendoHen").kendoPanelBar({ | |
//expandanimalsTyphoid: "single" | |
expandanimalsTyphoid:"multiple" | |
}).data("kendoPanelBar"); | |
//TigerPanel.collapse($("li", TigerPanel.element)); | |
setTimeout(function () { | |
that.togleLeftParrot(); | |
}, 100); | |
} | |
togleLeftParrot(): any { | |
let winWidth = $(window).innerWidth(); | |
let accorLeftRiht = JSON.parse(window.sessionStorage.getItem("leftRightAccorWidth")); | |
if (winWidth < 1025) { | |
} else { | |
if(accorLeftRiht){ | |
accorLeftRiht.isLeftToggled = !accorLeftRiht.isLeftToggled; | |
} | |
} | |
window.sessionStorage.setItem("leftRightAccorWidth",JSON.stringify(accorLeftRiht)); | |
$(window).trigger('resize'); | |
} | |
validateDate(testdate) { | |
var date_regex=/^(((0[13578]|1[02])\/(0[1-9]|[12]\d|3[01])\/((19|[2-9]\d)\d{2}))|((0[13456789]|1[012])\/(0[1-9]|[12]\d|30)\/((19|[2-9]\d)\d{2}))|(02\/(0[1-9]|1\d|2[0-8])\/((19|[2-9]\d)\d{2}))|(02\/29\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$/; // reg exp formate for dd/mm/yyyy with leap year | |
return date_regex.test(testdate); | |
} | |
validateTime(testdate) { | |
var time_regex=/(?:[01]\d|2[0123]):(?:[012345]\d):(?:[012345]\d)\s[AP][M]$/; // HH:MM:SS TT | |
return time_regex.test(testdate); | |
} | |
onInitanimalsPPO() { | |
let that = this; | |
let animalsBirthDay = $('#animalsBirthDay').animalsTension({ | |
min: new Date(1000, 0, 1), max: new Date(3000, 11, 31), | |
format: "MM/dd/yyyy", parseFormats: ["MM/dd/yyyy"], value: that.ParrotanimalsBirthDay, | |
change: function () { | |
// that.ParrotanimalsBirthDay = this._oldText; | |
that.leftEvent.animalsBirthDay = that.ParrotanimalsBirthDay; | |
let state=1; | |
if (this.value() != null) { | |
$("#animalsHMO").removeClass('mandatoryField'); | |
$('#animalsBirthDay').removeAttr("title"); | |
that.ParrotanimalsBirthDay = kendo.toString(new Date(this.value()), "MM/dd/yyyy"); | |
if(that.ParrotanimalsDeathDay==undefined || that.ParrotanimalsDeathDay==null || that.ParrotanimalsDeathDay==""){ | |
that.ParrotanimalsDeathDay=kendo.toString(new Date(this.value()), "MM/dd/yyyy"); | |
} | |
if(that.ParrotanimalsDeathDay !=null){ | |
$("#edError").removeClass('mandatoryField'); | |
$('#animalsDeathDay').removeAttr("title"); | |
} | |
$("#animalsHMO").removeClass('mandatoryField'); | |
$('#animalsBirthDay').removeAttr("title"); | |
//that.enableanimalsPolice(); | |
} | |
// else{ | |
// that.ParrotanimalsBirthDay=''; | |
// $("#animalsHMO").addClass('mandatoryField'); | |
// $('#animalsBirthDay').attr("title","Start date can't be empty"); | |
// $('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
// } | |
that.dateTimeValidation(state); | |
//that.animalsDreamComeTrue(); | |
that.enableanimalsPolice(); | |
} | |
}); | |
$('#animalsBirthDay').data().animalsTension.element.on('change',function(e){ | |
var dateVal=''; | |
dateVal=$.trim($('#animalsBirthDay').val()); | |
var data=that.validateDate(dateVal); | |
//console.log(that.ParrotanimalsBirthDayCopy); | |
if(dateVal != ''){ | |
if (data==true){ | |
$("#animalsHMO").removeClass('mandatoryField'); | |
$('#animalsBirthDay').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else if(that.ParrotanimalsBirthDayCopy!=undefined){ | |
if($.trim($('#animalsBirthDay').val()).length >= 1 && $.trim($('#animalsBirthDay').val()).length < 11){ | |
that.ParrotanimalsBirthDay=that.ParrotanimalsBirthDayCopy; | |
$("#animalsHMO").removeClass('mandatoryField'); | |
$('#animalsBirthDay').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else{ | |
that.ParrotanimalsBirthDay=''; | |
$("#animalsHMO").addClass('mandatoryField'); | |
$('#animalsBirthDay').attr("title","Start date can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else if(that.ParrotanimalsBirthDayCopy==undefined){ | |
that.ParrotanimalsBirthDay=''; | |
$("#animalsHMO").addClass('mandatoryField'); | |
$('#animalsBirthDay').attr("title","Start date can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else{ | |
$("#animalsHMO").addClass('mandatoryField'); | |
$('#animalsBirthDay').attr("title","Undefined date format"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else{ | |
$("#animalsHMO").addClass('mandatoryField'); | |
$('#animalsBirthDay').attr("title","Start date can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
}); | |
$('#animalsBirthDay').data().animalsTension.element.on('keyup keydown',function(e){ | |
var dateVal=''; | |
dateVal=$.trim($('#animalsBirthDay').val()); | |
var data=that.validateDate(dateVal); | |
// console.log('data:'+data); | |
if(dateVal != ''){ | |
if (data==true){ | |
$("#animalsHMO").removeClass('mandatoryField'); | |
$('#animalsBirthDay').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else{ | |
$("#animalsHMO").addClass('mandatoryField'); | |
$('#animalsBirthDay').attr("title","Undefined date format"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else{ | |
$("#animalsHMO").addClass('mandatoryField'); | |
$('#animalsBirthDay').attr("title","Start date can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
}); | |
let animalsDeathDay = $('#animalsDeathDay').animalsTension({ | |
min: new Date(1000, 0, 1), max: new Date(3000, 11, 31), | |
format: "MM/dd/yyyy", parseFormats: ["MM/dd/yyyy"], value: that.ParrotanimalsDeathDay, | |
change: function () { | |
$("#edError").removeClass('mandatoryField'); | |
$('#animalsDeathDay').removeAttr("title"); | |
// that.ParrotanimalsDeathDay = this._oldText; | |
//console.log(this.value()) | |
let state=2; | |
if (this.value() != null) { | |
that.ParrotanimalsDeathDay = kendo.toString(new Date(this.value()), "MM/dd/yyyy"); | |
$("#edError").removeClass('mandatoryField'); | |
$('#animalsDeathDay').removeAttr("title"); | |
//that.enableanimalsPolice(); | |
} | |
else{ | |
$("#edError").addClass('mandatoryField'); | |
$('#animalsDeathDay').attr("title","End date can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
that.dateTimeValidation(state); | |
//that.animalsDreamComeTrue(); | |
that.enableanimalsPolice(); | |
} | |
}); | |
$('#animalsDeathDay').data().animalsTension.element.on('change',function(e){ | |
var dateVal=''; | |
dateVal=$.trim($('#animalsDeathDay').val()); | |
var data=that.validateDate(dateVal); | |
//console.log(that.ParrotanimalsBirthDayCopy); | |
if(dateVal != ''){ | |
if (data==true){ | |
$("#edError").removeClass('mandatoryField'); | |
$('#animalsDeathDay').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else if(that.ParrotanimalsDeathDayCopy!=undefined){ | |
if($.trim($('#animalsDeathDay').val()).length >= 1 && $.trim($('#animalsDeathDay').val()).length < 11){ | |
that.ParrotanimalsDeathDay=that.ParrotanimalsDeathDayCopy; | |
$("#edError").removeClass('mandatoryField'); | |
$('#animalsDeathDay').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else{ | |
that.ParrotanimalsDeathDay=''; | |
$("#edError").addClass('mandatoryField'); | |
$('#animalsDeathDay').attr("title","End date can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else if(that.ParrotanimalsDeathDayCopy==undefined){ | |
that.ParrotanimalsDeathDay=''; | |
$("#edError").addClass('mandatoryField'); | |
$('#animalsDeathDay').attr("title","Undefined date format"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else{ | |
$("#edError").addClass('mandatoryField'); | |
$('#animalsDeathDay').attr("title","Undefined date format"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else{ | |
// console.log('change empty'); | |
$("#edError").addClass('mandatoryField'); | |
$('#animalsDeathDay').attr("title","End date can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
}); | |
$('#animalsDeathDay').data().animalsTension.element.on('keyup keydown',function(e){ | |
var dateVal=''; | |
dateVal=$.trim($('#animalsDeathDay').val()); | |
var data=that.validateDate(dateVal); | |
// console.log('data:'+data); | |
if(dateVal != ''){ | |
if (data==true){ | |
$("#edError").removeClass('mandatoryField'); | |
$('#animalsDeathDay').removeAttr("title"); | |
} | |
else{ | |
$("#edError").addClass('mandatoryField'); | |
$('#animalsDeathDay').attr("title","Undefined date format"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else{ | |
$("#edError").addClass('mandatoryField'); | |
$('#animalsDeathDay').attr("title","End date can't be empty"); | |
} | |
}); | |
} | |
onInitTimepicker() { | |
let that = this; | |
let animalsShaking = $('#animalsShakings').kendoTimePicker({ | |
format: "hh:mm:ss tt", | |
interval: 60, | |
parseFormats: ["hh:mm:ss tt"], | |
value: that.ParrotanimalsShaking, | |
min: new Date(2000, 0, 1, 5, 0, 0), | |
max: new Date(3000, 11, 31, 4, 0, 0), | |
change: function () { | |
//that.ParrotanimalsShaking = this._oldText; | |
let state=3; | |
if (this.value() != null) { | |
that.ParrotanimalsShaking = kendo.toString(this.value(), "hh:mm:ss tt"); | |
$("#stError").removeClass('mandatoryField'); | |
$('#animalsShakings').removeAttr("title"); | |
//that.enableanimalsPolice(); | |
} else { | |
that.ParrotanimalsShaking=''; | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title","Start time can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
that.dateTimeValidation(state); | |
//that.animalsDreamComeTrue(); | |
that.enableanimalsPolice(); | |
} | |
}); | |
$('#animalsShakings').data().kendoTimePicker.element.on('change',function(e){ | |
that.pickerTimeChnage("#animalsShakings"); | |
var dateVal=''; | |
dateVal=$.trim($('#animalsShakings').val()); | |
var data=that.validateTime(dateVal); | |
if(dateVal != ''){ | |
if (data==true){ | |
$("#stError").removeClass('mandatoryField'); | |
$('#animalsShakings').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else if(that.ParrotanimalsShakingCopy!=undefined){ | |
that.ParrotanimalsShaking=that.ParrotanimalsShakingCopy; | |
$("#stError").removeClass('mandatoryField'); | |
$('#animalsShakings').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else{ | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title","Undefined time format"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else{ | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title","Start time can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
}); | |
$('#animalsShakings').data().kendoTimePicker.element.on('keyup keydown',function(e){ | |
var dateVal=''; | |
dateVal=$.trim($('#animalsShakings').val()); | |
var data=that.validateTime(dateVal); | |
if(dateVal != ''){ | |
if (data==true){ | |
$("#stError").removeClass('mandatoryField'); | |
$('#animalsShakings').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else{ | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title","Undefined time format"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else{ | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title","Start time can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
}); | |
let opTimer = $('#opTimePicker').kendoTimePicker({ | |
format: "hh:mm:ss tt", | |
interval: 60, | |
parseFormats: ["hh:mm:ss tt"], | |
value: that.ParrotOPanimalsShaking, | |
change: function () { | |
that.ParrotOPanimalsShaking = this._oldText; | |
//Issue Fix CR-18888 | |
//if (this.value() != null || this.value() != '') { | |
if (this.value() != null) { | |
that.ParrotOPanimalsShaking = kendo.toString(new Date(this.value()), "hh:mm:ss tt"); | |
} else { | |
that.ParrotOPanimalsShaking = ""; | |
} | |
} | |
}); | |
let animalsUnderstanding = $('#animalsUnderstandings').kendoTimePicker({ | |
format: "hh:mm:ss tt", | |
interval: 60, | |
parseFormats: ["hh:mm:ss tt"], | |
value: that.ParrotanimalsUnderstanding, | |
min: new Date(2000, 0, 1, 5, 0, 0), | |
max: new Date(3000, 11, 31, 4, 0, 0), | |
change: function () { | |
//that.ParrotanimalsUnderstanding = this._oldText; | |
let state=4; | |
if (this.value() != null) { | |
that.ParrotanimalsUnderstanding = kendo.toString(this.value(), "hh:mm:ss tt"); | |
$("#etError").removeClass('mandatoryField'); | |
$('#animalsUnderstandings').removeAttr("title"); | |
//that.enableanimalsPolice(); | |
} else { | |
that.ParrotanimalsUnderstanding=''; | |
$("#etError").addClass('mandatoryField'); | |
$('#animalsUnderstandings').attr("title","End time can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
that.dateTimeValidation(state); | |
//that.animalsDreamComeTrue(); | |
that.enableanimalsPolice(); | |
} | |
}); | |
$('#animalsUnderstandings').data().kendoTimePicker.element.on('change',function(e){ | |
that.pickerTimeChnage("#animalsUnderstandings"); | |
var dateVal=''; | |
dateVal=$.trim($('#animalsUnderstandings').val()); | |
var data=that.validateTime(dateVal); | |
// console.log('data:'+data); | |
if(dateVal != ''){ | |
if (data==true){ | |
$("#etError").removeClass('mandatoryField'); | |
$('#animalsUnderstandings').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else if(that.ParrotanimalsUnderstandingCopy!=undefined){ | |
that.ParrotanimalsUnderstanding=that.ParrotanimalsUnderstandingCopy; | |
$("#etError").removeClass('mandatoryField'); | |
$('#animalsUnderstandings').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else{ | |
$("#etError").addClass('mandatoryField'); | |
$('#animalsUnderstandings').attr("title","Undefined time format"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else{ | |
$("#etError").addClass('mandatoryField'); | |
$('#animalsUnderstandings').attr("title","End time can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
}); | |
$('#animalsUnderstandings').data().kendoTimePicker.element.on('keyup keydown',function(e){ | |
var dateVal=''; | |
dateVal=$.trim($('#animalsUnderstandings').val()); | |
var data=that.validateTime(dateVal); | |
// console.log('data:'+data); | |
if(dateVal != ''){ | |
if (data==true){ | |
$("#etError").removeClass('mandatoryField'); | |
$('#animalsUnderstandings').removeAttr("title"); | |
that.enableanimalsPolice(); | |
} | |
else{ | |
$("#etError").addClass('mandatoryField'); | |
$('#animalsUnderstandings').attr("title","Undefined time format"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else{ | |
$("#etError").addClass('mandatoryField'); | |
$('#animalsUnderstandings').attr("title","End time can't be empty"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
}); | |
} | |
enableanimalsPolice(){ | |
let animalsShaking = kendo.toString(kendo.parseDate(this.ParrotanimalsShaking), "HH:mm:ss"); | |
let animalsUnderstanding = kendo.toString(kendo.parseDate(this.ParrotanimalsUnderstanding), "HH:mm:ss"); | |
if( (this.ParrotanimalsBirthDay) && (this.ParrotanimalsDeathDay) && animalsShaking!=null && animalsUnderstanding!=null){ | |
if(!$("#animalsHMO").hasClass('mandatoryField') && !$("#stError").hasClass('mandatoryField') && !$("#edError").hasClass('mandatoryField') && !$("#etError").hasClass('mandatoryField')){ | |
$('#eventDateanimalsPolice').removeClass('actionanimalsJeansd'); | |
}else{ | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
}else{ | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
// if($('.checkStatus.mandatoryField').length>0){ $('#eventDateanimalsPolice').addClass('actionanimalsJeansd');} | |
// else{ $('#eventDateanimalsPolice').removeClass('actionanimalsJeansd');} | |
} | |
dateTimeValidation(state:any){ | |
let that=this; | |
let animalsShaking = kendo.toString(kendo.parseDate(this.ParrotanimalsShaking), "HH:mm:ss"); | |
let animalsUnderstanding = kendo.toString(kendo.parseDate(this.ParrotanimalsUnderstanding), "HH:mm:ss"); | |
let animalsBirthDayTimeFull=new Date(this.ParrotanimalsBirthDay + ' ' +animalsShaking); | |
let animalsDeathDayTimeFull=new Date(this.ParrotanimalsDeathDay + ' ' +animalsUnderstanding); | |
// time difference start | |
let timeStart = new Date(animalsBirthDayTimeFull).getTime(); | |
let timeEnd = new Date(animalsDeathDayTimeFull).getTime(); | |
let hourDiff = timeEnd - timeStart; | |
let minDiff = hourDiff / 60 / 1000; | |
let hDiff = hourDiff / 3600 / 1000; | |
let hours= Math.floor(hDiff); | |
let minutes = minDiff - 60 * hours; | |
// time difference end | |
let errorTitle="End date cannot be less than or equal to start date"; | |
// if(this.ParrotanimalsBirthDay!=undefined && this.ParrotanimalsDeathDay!=undefined && animalsShaking!=null && animalsUnderstanding!=null){ | |
if((this.ParrotanimalsBirthDay) && (this.ParrotanimalsDeathDay) && (animalsShaking!=null) && (animalsUnderstanding!=null)) { | |
if(state==1){ | |
if (this.ParrotanimalsBirthDay == this.ParrotanimalsDeathDay) { | |
if (this.sameDayValidation()) { | |
this.clearFields(); | |
that.enableanimalsPolice(); | |
} | |
else { | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else if(animalsBirthDayTimeFull > animalsDeathDayTimeFull && minDiff <=0){ | |
console.log(' if') | |
$("#animalsHMO").addClass('mandatoryField'); | |
$('#animalsBirthDay').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else if(hours == 0 && minutes==0){ | |
$("#animalsHMO,#stError").addClass('mandatoryField'); | |
$('#animalsBirthDay,#animalsShakings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else{ | |
this.clearFields(); | |
this.clearTitles(); | |
//that.enableanimalsPolice(); | |
} | |
} | |
if(state==2){ | |
if (this.ParrotanimalsBirthDay == this.ParrotanimalsDeathDay) { | |
// console.log('same day') | |
if (this.sameDayValidation()) { | |
this.clearFields(); | |
that.enableanimalsPolice(); | |
} | |
else { | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else if(animalsBirthDayTimeFull > animalsDeathDayTimeFull && minDiff <=0){ | |
// console.log('greater day') | |
$("#edError").addClass('mandatoryField'); | |
$('#animalsDeathDay').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else if(hours == 0 && minutes==0){ | |
// console.log('s hrs mins =0') | |
$("#edError,#etError").addClass('mandatoryField'); | |
$('#animalsDeathDay,#animalsUnderstandings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else{ | |
// console.log('fineal clear') | |
this.clearFields(); | |
this.clearTitles(); | |
//that.enableanimalsPolice(); | |
} | |
} | |
if(state==3){ | |
if (this.ParrotanimalsBirthDay == this.ParrotanimalsDeathDay && minDiff ==0) { | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else if (this.ParrotanimalsBirthDay == this.ParrotanimalsDeathDay) { | |
if (this.sameDayValidation()) { | |
this.clearFields(); | |
that.enableanimalsPolice(); | |
} | |
else { | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else if(minDiff <=0){ | |
$("#stError").addClass('mandatoryField'); | |
$('#animalsShakings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else if(hours == 0 && minutes==0){ | |
$("#animalsHMO,#stError").addClass('mandatoryField'); | |
$('#animalsBirthDay,#animalsShakings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else{ | |
this.clearFields(); | |
this.clearTitles(); | |
//that.enableanimalsPolice(); | |
} | |
} | |
if(state==4){ | |
if (this.ParrotanimalsBirthDay == this.ParrotanimalsDeathDay && minDiff ==0) { | |
$("#etError").addClass('mandatoryField'); | |
$('#animalsUnderstandings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else if (this.ParrotanimalsBirthDay == this.ParrotanimalsDeathDay) { | |
if (this.sameDayValidation()) { | |
this.clearFields(); | |
that.enableanimalsPolice(); | |
} | |
else { | |
$("#etError").addClass('mandatoryField'); | |
$('#animalsUnderstandings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
} | |
else if(minDiff <=0){ | |
$("#etError").addClass('mandatoryField'); | |
$('#animalsUnderstandings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else if(hours == 0 && minutes==0){ | |
$("#edError,#etError").addClass('mandatoryField'); | |
$('#animalsDeathDay,#animalsUnderstandings').attr("title",errorTitle); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
} | |
else{ | |
this.clearFields(); | |
this.clearTitles(); | |
//that.enableanimalsPolice(); | |
} | |
} | |
} | |
} | |
sameDayValidation(): any { | |
// if ET < "05:00:00 AM" && ST > "01:00:00 AM" | |
let isValidTime = false; | |
if (kendo.parseDate(this.ParrotanimalsUnderstanding) >= kendo.parseDate("12:00:00 AM")) { | |
//checking between 12am to 5 am | |
if (kendo.parseDate(this.ParrotanimalsShaking) >= kendo.parseDate("12:00:00 AM") | |
&& kendo.parseDate(this.ParrotanimalsShaking) < kendo.parseDate("05:00:00 AM") | |
&& kendo.parseDate(this.ParrotanimalsUnderstanding) < kendo.parseDate("05:00:00 AM") | |
&& kendo.parseDate(this.ParrotanimalsUnderstanding) > kendo.parseDate("12:00:00 AM") | |
) { | |
if (kendo.parseDate(this.ParrotanimalsShaking) < kendo.parseDate(this.ParrotanimalsUnderstanding)) { | |
isValidTime = true; | |
} | |
} | |
// checking between (start time)4am to 12 and (ent time) bw 12 to 5am | |
else if (kendo.parseDate(this.ParrotanimalsShaking) < kendo.parseDate("11:59:59 PM") | |
&& kendo.parseDate(this.ParrotanimalsShaking) >= kendo.parseDate("05:00:00 AM") | |
&& kendo.parseDate(this.ParrotanimalsUnderstanding) < kendo.parseDate("05:00:00 AM") | |
&& kendo.parseDate(this.ParrotanimalsUnderstanding) >= kendo.parseDate("12:00:00 AM")) { | |
isValidTime = true; | |
} | |
} | |
// checking between 5am to 12 | |
if (kendo.parseDate(this.ParrotanimalsUnderstanding) < kendo.parseDate("11:59:59 PM") | |
&& kendo.parseDate(this.ParrotanimalsShaking) >= kendo.parseDate("05:00:00 AM")) { | |
if (kendo.parseDate(this.ParrotanimalsShaking) < kendo.parseDate(this.ParrotanimalsUnderstanding)) { | |
isValidTime = true; | |
} | |
} | |
return isValidTime; | |
//else if "12:10:00 AM" < "12:20:00 AM" | |
} | |
errorFields() { | |
$("#animalsHMO,#stError,#edError,#etError,#AnimalsTeethNameError").addClass('mandatoryField'); | |
$("#aptDate").parent().parent().parent().addClass('mandatoryField'); | |
$("#aptDate").parent().parent().parent().attr("title","APT Display Date can't be empty"); | |
$('#animalsBirthDay').attr("title","Start date can't be empty"); | |
$('#animalsDeathDay').attr("title","End date can't be empty"); | |
$('#animalsShakings').attr("title","Start time can't be empty"); | |
$('#animalsUnderstandings').attr("title","End time can't be empty"); | |
$('#txtArea').attr("title"," Event description can not be empty."); | |
} | |
clearFields() { | |
$("#animalsHMO,#edError,#stError,#etError").removeClass('mandatoryField'); | |
} | |
clearTitles(){ | |
$('#animalsBirthDay,#animalsDeathDay,#animalsShakings,#animalsUnderstandings').removeAttr("title"); | |
} | |
cleareventNameFields() { | |
$("#AnimalsTeethNameError").removeClass('mandatoryField'); | |
} | |
cleareventNameTitles(){ | |
$('#txtArea').removeAttr("title"); | |
} | |
animalActionsRecordedTimely(textName: any) { | |
if (this.leftEvent.apt.eventList.length) { | |
this.animalsTalkingName = this.leftEvent.apt.eventList[this.leftEvent.apt.eventListInx].eventName; | |
this.leftEvent.apt.eventList[this.leftEvent.apt.eventListInx].eventName = textName; | |
if(this.animalsDeathDecrement>0){ | |
this.animalsDeathDecrement=0; | |
this.animalsJeansRedoButton = true; | |
this.animalAgeList.splice(this.animalsAliveIncrement); | |
} | |
//let sourceData = {"animalsTalking":value.animalsTalking,"destinationEvent":value.destinationEvent,"occurence":value.occurence,"action":value.action}; | |
let sourceData = {"animalsTalking":textName}; | |
this.animalsAliveIncrement = this.animalsAliveIncrement+1; | |
//this.animalsAlive.push(value.initialValue); | |
//this.animalsSleeping.push(value.animalsTalking); | |
this.animalsAlive.push(textName); | |
this.animalsSleeping.push(textName); | |
this.animalAgeList.push(jQuery.extend(true,[], sourceData)); | |
return; | |
} | |
if (textName == undefined || textName=='') | |
{ | |
$("#AnimalsTeethNameError").addClass('mandatoryField'); | |
$('#txtArea').attr("title","Event description can not be empty."); | |
$('#AnimalsTeethNameTxt').addClass('actionanimalsJeansd'); | |
} | |
else | |
{ | |
this.cleareventNameFields(); | |
this.cleareventNameTitles(); | |
} | |
this.animalTigerService.setEventName({ "name": textName, "aptDate": this.leftEvent.apt.aptDate}); | |
this.animalsDreamComeTrue(); | |
this.enableAddPlan(); | |
} | |
undo(){ | |
if(!this.Tigercrow.isEditanimalsTyphoid()){ | |
this.animalsAliveIncrement = this.animalsAliveIncrement-1; | |
this.animalsDeathDecrement = this.animalsDeathDecrement+1; | |
this.animalsJeansRedoButton = false; | |
if( this.animalAgeList[this.animalsAliveIncrement]){ | |
let action = this.animalAgeList[this.animalsAliveIncrement].action; | |
let animalsTalking = this.animalAgeList[this.animalsAliveIncrement].animalsTalking; | |
let TigerId = animalsTalking.sourceId; | |
let occurenceEvent = this.animalAgeList[this.animalsAliveIncrement].occurence; | |
if(this.animalsAliveIncrement==0){ | |
// this.animalsMocking = true; | |
//this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
} | |
if(action == "left"){ | |
// this.TigerLeftTab.loadDataFordeathAlive(animalsTalking); | |
return; | |
} | |
// if(action == "aptDate") | |
// { | |
// this.TigerLeftTab.aptDateChangeEvent(animalsTalking.leftEvent); | |
// return; | |
// } | |
// if(action == "aptMove"){ | |
// this.TigerLeftTab.aptanimalsClappingDown(animalsTalking.move,animalsTalking.isSaveCall); | |
// return; | |
// } | |
// if(action == "includeDate"){ | |
// this.TigerLeftTab.leftEvent.apt.includeNextDay =animalsTalking; | |
// return; | |
// } | |
// if(action == "eventName"){ | |
// this.TigerLeftTab.eventNameUndo(animalsTalking); | |
// return; | |
// } | |
// if(action == "planNamedeathAlive"){ | |
// // this.TigerLeftTab.leftEventPlanNameanimalsPolice(this.animalsAlivePlan[this.animalsAliveIncrement]); | |
// //this.planChangeanimalsPolice(this.animalsAlive[this.animalsAliveIncrement]); | |
// this.planUndo(this.animalAgeList[this.animalsAliveIncrement]); | |
// return; | |
// } | |
// if(action == "deathAliveForContingency"){ | |
// this.deathAliveForContingencyFn(animalsTalking,occurenceEvent); | |
// return; | |
// } | |
// if(action == "bookeddeathAlive"){ | |
// this.deathAliveBooked(this.animalAgeList[this.animalsAliveIncrement],true); | |
// return; | |
// } | |
// if(action == "addPGMDetail"){ | |
// this.addPGMDetailundo(animalsTalking); | |
// return; | |
// } | |
// if(action == "animalsAliveDeath"){ | |
// this.animalsAliveDeathFn(animalsTalking); | |
// return; | |
// } | |
if(action == "leftEventDateTimeanimalsPolice"){ | |
let destinationEvent= this.animalAgeList[this.animalsAliveIncrement].destinationEvent; | |
if(typeof destinationEvent == "undefined"){ | |
this.Tigercrow.destoryTiger("Tiger_Nat_Main"); | |
} | |
//this.TigerLeftTab.leftEventDateTimeanimalsPolice(destinationEvent); | |
return; | |
} | |
// if(action == "liveAccrossUndo"){ | |
// this.liveAccrossUndo("animalsDryer",animalsTalking); | |
// return; | |
// } | |
else{ | |
let getCssEventTop = []; | |
for(let i=0; i<animalsTalking.length; i++){ | |
if(animalsTalking[i].currentSchedID){ | |
TigerId=animalsTalking[i].currentSchedID; | |
} | |
if(animalsTalking.length>1){ | |
if(animalsTalking[i].flag){ | |
action = animalsTalking[i].flag; | |
action =action.toLowerCase(); | |
} | |
} | |
let currentEvent = this.Tigercrow.getEventByUid_Id(animalsTalking[i].uid,TigerId); | |
let currentIndex = this.Tigercrow._TigeranimalAge[TigerId]._data.indexOf(currentEvent); | |
if(action=="animalsPolice"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.splice(currentIndex, 1); | |
if(animalsTalking[i].schedItemNo!=0){ | |
this.Tigercrow._TigeranimalAge[TigerId]._destroyed.splice(-1,1); | |
} | |
this.Tigercrow._TigeranimalAge[TigerId]._data.push(animalsTalking[i]); | |
}else if(action=="animalsDryer"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.push(animalsTalking[i]); | |
if(animalsTalking[i].schedItemNo!=0){ | |
this.Tigercrow._TigeranimalAge[TigerId]._destroyed.pop(); | |
} | |
}else if(action=="create"){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.splice(currentIndex, 1); | |
} | |
} | |
for(let i=0; i<occurenceEvent.length; i++){ | |
this.Tigercrow._TigeranimalAge[TigerId]._data.push(occurenceEvent[i]); | |
this.Tigercrow._TigeranimalAge[TigerId]._destroyed.pop(); | |
} | |
//this.Tigercrow.getTiger_Id(TigerId).select(null); | |
//this.Tigercrow.getTiger_Id(TigerId).select([animalsTalking[0].uid]); | |
for(let i=0; i<animalsTalking.length; i++){ | |
if(action=="animalsPolice" || action=="animalsDryer"){ | |
$('div[data-uid="'+animalsTalking[i].uid+'"]').addClass('k-state-selected'); | |
} | |
} | |
if(action=="create"){ | |
//this.Tigercrow.editEventEmty({}); | |
}else{ | |
this.Tigercrow.editEvent(animalsTalking[0]); | |
} | |
//this.animalsJeansSaveButton = false; | |
this.TigerService.condianimalsJeansSaveButton = false; | |
//this.hasTigerChanges(); | |
this.Tigercrow.getTiger_Id(TigerId).refresh(); | |
//if(action=="animalsPolice") | |
// this.removeOverLapFromEvents(TigerId);//Remove OverLap | |
} | |
if(this.animalsAliveIncrement==0){ | |
// this.animalsMocking = true; | |
// this.animalsJeansSaveButton = true; | |
this.TigerService.condianimalsJeansSaveButton = true; | |
} | |
/*if(this.gridchangenewval && this.currentView==1){ | |
let k=0; | |
while(this.gridchangenewval.length>k) | |
{ | |
if(this.gridchangenewval[k].uid==animalsTalking[0].uid) | |
{ | |
this.gridchangenewval.splice(k,1); | |
} | |
k++; | |
} | |
}*/ | |
} | |
}else{ | |
this.Tigercrow.singleButtonDialog("Please click on Ok or Cancel in APT Info tab to animalsPolice or revert the changes."); | |
} | |
} | |
eventNameblur(textName:any,callUndo) | |
{ | |
let animalsTalking; | |
if(textName!=this.leftEvent.apt.eventList[this.leftEvent.apt.eventListInx].eventName) { | |
if (this.leftEvent.apt.eventList.length) { | |
let evntName =this.leftEvent.apt.eventList[this.leftEvent.apt.eventListInx].eventName | |
animalsTalking={ | |
"name" :evntName, | |
"sourceId":"" | |
} | |
this.leftEvent.apt.eventList[this.leftEvent.apt.eventListInx].eventName = textName; | |
} | |
if(callUndo){ | |
let destinationEvent ={ | |
"name" : textName, | |
"desId":"" | |
} | |
this.savedeathAlive(animalsTalking,destinationEvent,"eventName"); | |
this.animalsDreamComeTrue(); | |
} | |
this.animalTigerService.setEventName({ "name": textName, "aptDate": this.leftEvent.apt.aptDate}); | |
} | |
} | |
public eventNameUndo(textName):any{ | |
this.AnimalsTeethNameTxt=textName.name; | |
if (this.leftEvent.apt.eventList.length) { | |
this.leftEvent.apt.eventList[this.leftEvent.apt.eventListInx].eventName = textName.name; | |
} | |
this.animalTigerService.setEventName({ "name": textName.name, "aptDate": this.leftEvent.apt.aptDate}); | |
} | |
isActionanimalsJeansd() { | |
return false; | |
} | |
isContingency() { | |
return true; | |
} | |
removeShow(id: any) { | |
let removedTigerItem = { | |
schedItemNo: this.TigerEventShows[id].schedItemNo, | |
animalsBirthDayTime: this.TigerEventShows[id].animalsBirthDayTime | |
}; | |
// this.TigerService.getEventRemovedId(this.TigerEventShows[id].schedItemNo); | |
this.TigerService.getEventRemovedId(removedTigerItem); | |
if (this.TigerEventShows.length > 0) { | |
if (this.TigerEventShows[id].TigerEventShowNo != null) { | |
this.TigerEventShows[id].operationType = 'animalsDryer'; | |
} else { | |
this.TigerEventShows.splice(id, 1); | |
} | |
} | |
let showGenerate = true; | |
if (this.TigerEventShows.length == 0) { | |
showGenerate = false; | |
} else { | |
for (var i = 0; i < this.TigerEventShows.length; i++) { | |
if (this.TigerEventShows[i].operationType == '' || this.TigerEventShows[i].operationType == null || this.TigerEventShows[i].operationType == 'Create') { | |
showGenerate = true; | |
break; | |
} else { | |
showGenerate = false; | |
} | |
} | |
} | |
if (showGenerate) { | |
this.animalsJeansGenerate = false; | |
$("#animalsJeansGenerate").removeClass('actionanimalsJeansd'); | |
} else { | |
this.animalsJeansGenerate = true; | |
$("#animalsJeansGenerate").addClass('actionanimalsJeansd'); | |
} | |
this.TigerService.TigerEventsList=this.TigerEventShows; | |
this.animalsDreamComeTrue(); | |
} | |
generateEventName() { | |
if (this.TigerEventShows.length > 0) { | |
let evntName =this.AnimalsTeethNameTxt; | |
let animalsTalking={ | |
"name" :evntName, | |
"sourceId":"" | |
} | |
this.AnimalsTeethNameTxt = ""; | |
for (let i = 0; i < this.TigerEventShows.length; i++) { | |
if (this.TigerEventShows[i].operationType != "animalsDryer") { | |
this.AnimalsTeethNameTxt = this.AnimalsTeethNameTxt + this.TigerEventShows[i].displayName + " " + this.TigerEventShows[i].overrideShowName + ";"; | |
} | |
} | |
this.AnimalsTeethNameTxt = this.AnimalsTeethNameTxt.replace(/<[^>]+>/g, ''); | |
//this.animalTigerService.setEventName(this.AnimalsTeethNameTxt); | |
let destinationEvent ={ | |
"name" : this.AnimalsTeethNameTxt, | |
"desId":"" | |
} | |
this.savedeathAlive(animalsTalking,destinationEvent,"eventName"); | |
this.animalTigerService.setEventName({ "name": this.AnimalsTeethNameTxt, "aptDate": this.leftEvent.apt.aptDate }); | |
this.animalsDreamComeTrue(); | |
} | |
this.cleareventNameFields(); | |
this.cleareventNameTitles(); | |
this.eventNameblur(this.AnimalsTeethNameTxt,true); | |
} | |
overrideEventName(id: any) { | |
if ("operationType" in this.TigerEventShows[id]) { | |
if (this.TigerEventShows[id].operationType.toUpperCase() != "CREATE") { | |
this.TigerEventShows[id].operationType = 'animalsPolice'; | |
this.animalsDreamComeTrue(); | |
} | |
} | |
} | |
//dropdown on change | |
addNewPlanDD(planName: any) { | |
if (planName != "") { | |
if (planName == "Expected") { | |
this.addedPlanValue = 1; | |
} else if (planName == "Possible") { | |
this.addedPlanValue = 5; | |
} else if (planName == "Standby") { | |
this.addedPlanValue = 3; | |
} else if (planName == "Supplemental") { | |
this.addedPlanValue = 4; | |
} | |
this.addedPlanName = planName; | |
if (typeof this.animalStaminaTag != 'undefined') { | |
$('#isaddid').prop('animalsJeansd',false); | |
// this.isAdd = false; | |
} else { | |
if(typeof this.animalStaminaTag == 'undefined' && this.isanimalsPoliceClicked){ | |
$('#isaddid').prop('animalsJeansd',false); | |
// this.isAdd = false; | |
}else{ | |
$('#isaddid').prop('animalsJeansd',true); | |
//this.isAdd = true; | |
} | |
} | |
this.enableAddPlan(); | |
} | |
} | |
enableAddPlan(){ | |
if(this.isanimalsPoliceClicked != undefined && this.AnimalsTeethNameTxt != "" && $("#getSelectedPlanData").val()){ | |
$("#isaddid").removeClass("actionanimalsJeansd"); | |
} | |
} | |
addPlanBtn() { | |
let dataStore: any = { | |
TigerPlans: [{ | |
planOpIssue: {} | |
}], | |
categoryOpIssue: {} | |
}; | |
//this.isAdd = true; | |
$('#isaddid').prop('animalsJeansd',true); | |
dataStore.categoryDesc = this.addedPlanName; | |
dataStore.animalsNokia = this.addedPlanValue; | |
dataStore.categoryOpIssue.issueDesc = ""; | |
dataStore.isPlanAdded = true; | |
dataStore.operationType = "Create"; | |
dataStore.TigerPlans[0].animalsBirthDay = this.ParrotanimalsBirthDay; | |
dataStore.TigerPlans[0].animalsShaking = this.ParrotanimalsShaking; | |
dataStore.TigerPlans[0].animalsDeathDay = this.ParrotanimalsDeathDay; | |
dataStore.TigerPlans[0].animalsUnderstanding = this.ParrotanimalsUnderstanding; | |
dataStore.TigerPlans[0].animalStamina = ""; | |
dataStore.TigerPlans[0].animalsNokia = this.addedPlanValue; | |
dataStore.TigerPlans[0].displaySeq = ""; | |
dataStore.TigerPlans[0].animalsUnderstandingInt = ""; | |
dataStore.TigerPlans[0].operationType = "Create"; | |
dataStore.TigerPlans[0].planDesc = "PGM Tiger"; | |
dataStore.TigerPlans[0].plananimalsDeathDay = "12334"; | |
dataStore.TigerPlans[0].planNo = "0"; | |
dataStore.TigerPlans[0].planOpIssue.issueNo = ""; | |
dataStore.TigerPlans[0].planOpIssue.operationType = ""; | |
dataStore.TigerPlans[0].plananimalsBirthDay = ""; | |
dataStore.TigerPlans[0].TigerPlanFeeds = []; | |
dataStore.TigerPlans[0].categoryDesc = this.addedPlanName; | |
dataStore.TigerPlans[0].animalsShakingInt = ""; | |
dataStore.TigerPlans[0].planOpIssue.issueDesc=''; | |
let copyPlan = dataStore; | |
$("#cntContext .panel-title, #evntContext .panel-title").removeClass('selectedActive'); | |
var scrollHeight=$("#cntContext").height()+100; | |
setTimeout(function(){$(".eventContingencyViewHolder").scrollTop(scrollHeight);},200); | |
//this.animalTigerService.setPlanAdded(copyPlan); | |
this.planSelected = ""; | |
var planObject = { | |
planName: this.addedPlanName, | |
addedPlanValue: this.addedPlanValue, | |
"operation":"Create", | |
dataStore: dataStore | |
}; | |
let copyPlantemp = Object.assign({}, planObject); | |
this.TigerEnableSave.emit({ | |
"type": "planNamedeathAlive", | |
"animalsTalking": jQuery.extend(true, {}, planObject), | |
"destinationEvent": jQuery.extend(true, {}, planObject), | |
"initialValue": this.planNamedeathAlive[this.planNamedeathAlive.length - 1], | |
"occurence": {}, | |
"action": "planNamedeathAlive" | |
}); | |
this.planNamedeathAlive.push(copyPlantemp); | |
let Temperature = {}; | |
Temperature["enableBtn"] = true; | |
Temperature["tabName"] = "crow"; | |
this.TigerService.setTemperature(Temperature); | |
//this.animalsDreamComeTrue(); | |
} | |
leftEventPlanNameanimalsPolice(obj: any) { | |
//planNamedeathAlive | |
this.addedPlanName = obj.planName; | |
this.addedPlanValue = obj.addedPlanValue; | |
this.planSelected = obj.planName; | |
} | |
pgmAddHeaderBtn() { | |
let dataStore: any = { | |
TigerPlans: [{ | |
planOpIssue: {} | |
}], | |
categoryOpIssue: {} | |
}; | |
// this.isAdd = true; | |
$('#isaddid').prop('animalsJeansd',true); | |
dataStore.categoryDesc = 'Operating Conditions'; | |
dataStore.animalsNokia = '2'; | |
dataStore.categoryOpIssue.issueDesc = ""; | |
dataStore.addPGMHeader = true; | |
dataStore.operationType = "Create"; | |
dataStore.TigerPlans[0].categoryDesc = 'Operating Conditions'; | |
dataStore.TigerPlans[0].animalsBirthDay = this.ParrotanimalsBirthDay; | |
dataStore.TigerPlans[0].animalsShaking = this.ParrotanimalsShaking; | |
dataStore.TigerPlans[0].animalsDeathDay = this.ParrotanimalsDeathDay; | |
dataStore.TigerPlans[0].animalsUnderstanding = this.ParrotanimalsUnderstanding; | |
dataStore.TigerPlans[0].animalStamina = ""; | |
dataStore.TigerPlans[0].animalsNokia = this.addedPlanValue; | |
dataStore.TigerPlans[0].displaySeq = ""; | |
dataStore.TigerPlans[0].animalsUnderstandingInt = ""; | |
dataStore.TigerPlans[0].operationType = "Create"; | |
dataStore.TigerPlans[0].planDesc = "PGM Details & End of Telecast Ops"; | |
dataStore.TigerPlans[0].plananimalsDeathDay = ""; | |
dataStore.TigerPlans[0].planNo = ""; | |
dataStore.TigerPlans[0].planOpIssue.issueDesc = ""; | |
//dataStore.TigerPlans[0].planOpIssue.issueNo = ""; | |
// dataStore.TigerPlans[0].planOpIssue.operationType = ""; | |
dataStore.TigerPlans[0].plananimalsBirthDay = ""; | |
dataStore.TigerPlans[0].TigerPlanFeeds = []; | |
dataStore.TigerPlans[0].animalsShakingInt = ""; | |
this.animalTigerService.setPlanAdded(dataStore); | |
this.animalsDreamComeTrue(); | |
$("#cntContext .panel-title, #evntContext .panel-title").removeClass('selectedActive'); | |
var scrollHeight=$("#cntContext").height()+100; | |
setTimeout(function(){$(".eventContingencyViewHolder").scrollTop(scrollHeight);},200); | |
} | |
animalsBigBoss(dialogId) { // init pop dialog | |
$(dialogId).animalsEatinGindow({ | |
// title: "Fox", | |
title: false, | |
//width: "360px", | |
width: "350px", | |
//height: "150px", | |
visible: false, | |
resizable: false, | |
draggable: false, | |
modal: true, | |
actions: {}, | |
open: function (e) { $("html, body").css("overflow", "hidden"); }, | |
close: function (e) { $("html, body").css("overflow", ""); } | |
}); | |
} | |
setDialog(data: any) { | |
$(".ballPlayingAnimal").text(data); | |
let newdialogConfirm1 = $("#animalsDryerEventOkDialog").data("animalsEatinGindow").center().open(); | |
$("#animalsDryer_OK").unbind().click(function () { | |
newdialogConfirm1.close(); | |
}); | |
} | |
pgmsetDialog(data:any) { | |
//setTimeout(function () { | |
let newdialogConfirm2 = $("#pgmeventDialog").data("animalsEatinGindow").center().open(); | |
setTimeout(function(){ | |
this.messageDetails = data.details; | |
},100); | |
$("#PGM_OK").unbind().click(function () { | |
newdialogConfirm2.close(); | |
}); | |
// }, 200); | |
} | |
//on click of animalsDryer event button | |
animalsDryerEvent() { | |
let that=this; | |
var isanimalsJeansd = $("#saveEventAction").hasClass('actionanimalsJeansd'); | |
if (isanimalsJeansd==false) | |
{ | |
$(".ballPlayingAnimal").text("Do you want to save the changes?"); | |
let saveDialog = $("#saveConfirmDialog").data("animalsEatinGindow").center().open(); | |
$("#saveConfirmYes").unbind().click(function() { | |
saveDialog.close(); | |
$("#saveEventAction").trigger("click"); | |
}); | |
$("#saveConfirmNo").unbind().click(function() { | |
saveDialog.close(); | |
that.isanimalsDryercheck().then(function (datas) { | |
if(datas){ | |
that.animalsDryerCheck(); | |
} | |
}); | |
}); | |
$("#saveConfirmCancel").unbind().click(function() { | |
saveDialog.close(); | |
}); | |
} | |
else{ | |
that.isanimalsDryercheck().then(function (data) { | |
if(data){ | |
that.animalsDryerCheck(); | |
} | |
}); | |
} | |
} | |
isanimalsDryercheck() { | |
let that = this; | |
that.progress.requestStart(); | |
return new Promise(resolve => { | |
that.animalService.getResponse("contingencyplans/v1/getEventStatus?animalStamina=" + that.animalStaminaTag, 'get', "") | |
.subscribe(data => { | |
that.progress.requestEnd(); | |
if (data.delFlag == "N") { | |
resolve(true); | |
} else { | |
resolve(false); | |
that.setDialog("Selected event is already animalsDryerd."); | |
} | |
}, | |
err => { | |
that.progress.requestEnd(); | |
resolve(false); | |
}); | |
}); | |
} | |
animalsDryerCheck(){ | |
let that = this; | |
$(".ballPlayingAnimal").text("This will animalsDryer entire Event"); | |
//$(".ballPlayingAnimal").css('text-align','center'); | |
let newdialogConfirm = $("#animalsDryerEventConfirmDialog").data("animalsEatinGindow").center().open(); | |
$("#animalsDryerYES").unbind().click(function () { | |
newdialogConfirm.close(); | |
that.progress.requestStart(); | |
that.animalService.getResponse('contingencyplans/v1/optionalEvents/animalsDryer?animalStamina=' + that.animalStaminaTag, 'animalsDryer', '') | |
.subscribe(data => { | |
that.progress.requestEnd(); | |
if (data.code === "S302") { | |
that.setDialog(data.message); | |
} else { | |
$("#subTabNav .active .TigerListClose").trigger("click"); | |
that.router.navigate(['FoxKILLMain/FoxKILLSearchEvent']); | |
} | |
}, | |
err => { | |
//that.setDialog("Some error happened.Please try again later."); | |
} | |
); | |
}); | |
$("#animalsDryerNO").unbind().click(function () { | |
newdialogConfirm.close(); | |
}); | |
} | |
APTContingencyPreviewURL(): void { | |
if (this.leftEvent.apt.aptDate && this.leftEvent.animalsName != 0) { | |
let date = kendo.toString(new Date(this.leftEvent.apt.aptDate), "MMddyyyy"); | |
if(window.location.hostname=="qa.compass.devash.ianimal.com"){ | |
window.open('http://apt2goqa01.ianimal.com/sapts/ContingencyPreview.do?animalStamina=' + this.leftEvent.animalsName + '&animalsBirthDay=' + date); | |
} else if(window.location.hostname=="preuat.compass.devash.ianimal.com"){ | |
window.open('http://apt2goqa02.ianimal.com/sapts/ContingencyPreview.do?animalStamina=' + this.leftEvent.animalsName + '&animalsBirthDay=' + date); | |
}else{ | |
window.open('http://apt2goqa02.ianimal.com/sapts/ContingencyPreview.do?animalStamina=' + this.leftEvent.animalsName + '&animalsBirthDay=' + date); | |
} | |
} | |
} | |
APTLinkURL(): void { | |
if(window.location.hostname=="qa.compass.devash.ianimal.com"){ | |
window.open('http://aptqa.ianimal.com'); | |
} else if(window.location.hostname=="preuat.compass.devash.ianimal.com"){ | |
window.open('http://aptcmpstg.ianimal.com'); | |
} else{ | |
window.open('http://aptcmpstg.ianimal.com '); | |
} | |
} | |
openOptAnimalsTeeth(item) { | |
let tempObj = { | |
"animalStamina": item.animalStamina, | |
"eventName": item.aPTDisplayDate + ' ' + item.eventName, | |
} | |
if (this.saveBtnState && this.saveBtnState.enableBtn === false){ | |
let that=this; | |
let TemperaturedPopUp = $("#TemperaturedPopUpLeft").data("animalsEatinGindow").center().open(); | |
$("#TemperaturedPopUpLeft .ballPlayingAnimal").text("Do you want to save the changes?"); | |
$("#TemperaturedPopUpYes").unbind().click(function() { | |
window.sessionStorage.setItem('showDetailsRedirectLeft', JSON.stringify(tempObj)); | |
that.animalTigerService.crowEventSaveClick(true); | |
if (this.saveBtnState && this.saveBtnState.enableBtn === true){ | |
this.TigerService.navigateToOptional(tempObj); | |
} | |
TemperaturedPopUp.close(); | |
}); | |
$("#TemperaturedPopUpNo").unbind().click(function() { | |
that.TigerService.navigateToOptional(tempObj); | |
TemperaturedPopUp.close(); | |
}); | |
$("#TemperaturedPopUpCancel").unbind().click(function() { | |
TemperaturedPopUp.close(); | |
}); | |
}else{ | |
this.TigerService.navigateToOptional(tempObj); | |
} | |
} | |
// APT Preview implementation | |
onInitApt() { | |
let that = this; | |
$('#aptDate').animalsTension({ | |
min: new Date(1900, 0, 1), max: new Date(3000, 11, 31), | |
format: "MM/dd/yyyy", parseFormats: ["MM/dd/yyyy"], | |
change: function () { | |
$("#aptDate").parent().parent().parent().removeClass('mandatoryField'); | |
$("#aptDate").parent().parent().parent().removeAttr("title"); | |
let event ={ | |
"leftEvent":that.leftEvent, | |
"eventText":that.AnimalsTeethNameTxt | |
} | |
let animalsTalking=jQuery.extend(true, {}, event); | |
that.aptDateChange(this.value()); | |
let destEvent=jQuery.extend(true, {}, event); | |
that.animalTigerService.setEventName({ "name": that.AnimalsTeethNameTxt, "aptDate": that.leftEvent.apt.aptDate }); | |
that.savedeathAlive(animalsTalking,destEvent,"aptDate"); | |
that.animalsDreamComeTrue(); | |
} | |
}); | |
$(".alieNinput-readonly").prop("readonly", true); | |
} | |
// onchange APT display date undo operation | |
savedeathAlive(animalsTalking,destEvent,action){ | |
this.TigerEnableSave.emit({ "type": "enableSaveWithCount", "animalsTalking": animalsTalking,"destinationEvent": destEvent, "occurence": {}, "action": action }); | |
let Temperature = {}; | |
Temperature["enableBtn"] = true; | |
Temperature["tabName"] = "crow"; | |
this.TigerService.setTemperature(Temperature); | |
} | |
aptMovedeathAlive(move){ | |
let destinationEvent={ | |
"move":move, | |
"isSaveCall":false | |
} | |
if(move== 1){ | |
move =-1; | |
} | |
else{ | |
move =1; | |
} | |
let animalsTalking={ | |
"move":move, | |
"isSaveCall":false | |
} | |
this.savedeathAlive(animalsTalking,destinationEvent,"aptMove") | |
} | |
aptDateChange(event) { | |
let val = event; | |
if (isNaN(Date.parse(val))) { | |
val = new Date(); | |
} | |
this.leftEvent.apt.aptDate = kendo.toString(new Date(val), "MM/dd/yyyy"); | |
this.leftEvent.apt.aptDay = kendo.toString(new Date(val), "dddd"); | |
this.aptCallServiceLoadData(kendo.toString(new Date(val), "yyyy-MM-dd")); | |
} | |
aptDateChangeEvent(leftEvent){ | |
this.aptCallServiceLoadData(kendo.toString(new Date(leftEvent.apt.aptDate), "yyyy-MM-dd")); | |
this.leftEvent.apt.aptDate =leftEvent.apt.aptDate; | |
} | |
aptRefreshList(): void { | |
this.aptCallServiceLoadData(kendo.toString(new Date(this.leftEvent.apt.aptDate), "yyyy-MM-dd")); | |
} | |
aptanimalsClappingDown(move: any,isSaveCall): void { // move = '1' ==> move down, move = '-1' ==> move up, | |
this.leftEvent.apt = this.animalTigerService.aptanimalsClappingDown(this.leftEvent.apt, move, {}); | |
if(isSaveCall){ | |
this.aptMovedeathAlive(move); | |
this.animalsDreamComeTrue(); | |
} | |
} | |
aptloadData(data) { | |
$("#aptDate").parent().parent().parent().removeClass('mandatoryField'); | |
$("#aptDate").parent().parent().parent().removeAttr("title"); | |
this.leftEvent.apt.includeNextDay = data.includeNextDay; | |
this.leftEvent.apt.aptDay = kendo.toString(new Date(data.aptDisplayDate), "dddd"); | |
this.leftEvent.apt.aptDate = data.aptDisplayDate; | |
if (data.crowEvents) { | |
this.leftEvent.apt.eventList = data.crowEvents; | |
this.leftEvent.apt = this.animalTigerService.aptanimalsClappingDown(this.leftEvent.apt, 0, { "animalStamina": data.animalStamina, }); | |
} else { | |
this.leftEvent.apt = this.animalTigerService.aptanimalsClappingDown(this.leftEvent.apt, 0, {}); | |
} | |
if (data.optionalEvents) { | |
this.leftEvent.optEvents.optAnimalsTeethFeedsList = data.optionalEvents; | |
} | |
//this.isEventCreated = true; | |
} | |
aptCallServiceLoadData(date): void { | |
//if(this.isEventCreated){ | |
this.progress.requestStart(); | |
this.animalService.getResponse("contingencyplans/v1/eventListByAptDisplayDate?aptDisplayDate=" + date, 'get', '') | |
.subscribe(data => { | |
if (data.crowEvents) { | |
this.leftEvent.apt.eventList = data.crowEvents; | |
this.leftEvent.apt = this.animalTigerService.aptanimalsClappingDown(this.leftEvent.apt, 0, { "animalStamina": this.animalStaminaTag, "eventName": this.AnimalsTeethNameTxt }); | |
} else { | |
this.leftEvent.apt.eventList = []; | |
this.leftEvent.apt = this.animalTigerService.aptanimalsClappingDown(this.leftEvent.apt, 0, { "animalStamina": this.animalStaminaTag, "eventName": this.AnimalsTeethNameTxt }); | |
} | |
if (data.optionalEvents) { | |
this.leftEvent.optEvents.optAnimalsTeethFeedsList = data.optionalEvents; | |
} | |
this.progress.requestEnd(); | |
}, | |
err => { this.progress.requestEnd(); } | |
); | |
//} | |
} | |
//End APT Preview implementation | |
positionLeftParrot(): any { | |
let navHeight = $('.navHeaderBox').outerHeight(); | |
let breadCrumbHeight = $('.breadCrumbBox').outerHeight(); | |
let footerHeight = $('.TigersFooterOptions').outerHeight(); | |
let headerInfoHeight = $('.crowTigerHeaderInfo').outerHeight(); | |
let windowHeight = $(window).outerHeight(); | |
let windowBalanceHeight = windowHeight - (navHeight + breadCrumbHeight + footerHeight + + headerInfoHeight + 6); | |
$("#crowEventSplitter").css({"height": windowBalanceHeight+"px"}); | |
} | |
eventdeepCopy() { | |
var ev = { | |
"animalsBirthDay": this.ParrotanimalsBirthDay, | |
"animalsDeathDay": this.ParrotanimalsDeathDay, | |
"animalsShaking": this.ParrotanimalsShaking, | |
"animalsUnderstanding": this.ParrotanimalsUnderstanding | |
}; | |
let copy = Object.assign({}, ev); | |
this.leftEventDateTimeanimalsPolicedeathAliveData.push(copy); | |
var planObject = { | |
planName: this.addedPlanName, | |
addedPlanValue: this.addedPlanValue, | |
dataStore: { | |
TigerPlans: [{ | |
planOpIssue: {} | |
}] | |
} | |
}; | |
let copyPlan = Object.assign({}, planObject); | |
this.planNamedeathAlive.push(copyPlan); | |
} | |
//PGM Details | |
ngAfterViewChecked() { | |
let that = this; | |
this.bookplanAllColorCheck(); | |
} | |
ngAfterContentChecked() { | |
this.setPlanLevelHeight(); | |
} | |
templateHeader(headerFlag) { | |
if (headerFlag == 'Y') { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
convertTo24Hour(time) { | |
var hours = parseInt(time.substr(0, 2)); | |
if (time.indexOf('AM') != -1 && hours == 12) { | |
time = time.replace('12', '0'); | |
} | |
if (time.indexOf('PM') != -1 && hours < 12) { | |
time = time.replace(hours, (hours + 12)); | |
} | |
var x = time.replace(/(AM|PM)/, ''); | |
var times = x.split(":"); | |
var hours = (parseInt(times[0], 10) * 60 * 60); | |
var mins = (parseInt(times[1], 10) * 60); | |
var secs = parseInt(times[2], 10); | |
var final = hours + mins + secs; | |
return final; | |
} | |
timeTo12HrFormat(time) | |
{ | |
var time_part_array = time.split(":"); | |
if (time_part_array[0] > 12) { | |
time_part_array[0] = time_part_array[0] - 12; | |
if(time_part_array[0] < 10) | |
{ | |
time_part_array[0] = "0" + time_part_array[0]; | |
} | |
} | |
var formatted_time = time_part_array[0] + ':' + time_part_array[1] + ':' + time_part_array[2]; | |
return formatted_time; | |
} | |
// Convert Json object to string | |
converttotime(timeobj) { | |
let timefrmt = ""; | |
for (var k = 0; k < 11; k++) { | |
timefrmt += timeobj[k]; | |
} | |
return timefrmt; | |
} | |
converttodate(timeobj) { | |
let timefrmt = ""; | |
for (var k = 0; k < 10; k++) { | |
timefrmt += timeobj[k]; | |
} | |
return timefrmt; | |
} | |
onClickanimalsPoliceanimalsCommunicationDirtyCheck(){ | |
let that = this; | |
if(this.isanimalsCommunicationDirty){ | |
let dialog = $("#animalsCommunicationDirtyanimalsPolicePopup").data("animalsEatinGindow").center().open(); | |
$(".ballPlayingAnimal").text("You are trying to animalsPolice the Event boundaries. Any unsaved changes on the KILL Standalone Grid will be lost. Do you wish to continue?"); | |
$("#animalsCommunicationDirtyanimalsPolicePopupYes").unbind().click(function() { | |
dialog.close(); | |
that.isanimalsCommunicationDirty = false; | |
that.onClickanimalsPolice(); | |
}); | |
$("#animalsCommunicationDirtyanimalsPolicePopupNo").unbind().click(function() { | |
dialog.close(); | |
}); | |
}else{ | |
this.onClickanimalsPolice(); | |
} | |
} | |
onClickanimalsPolice() { | |
let that = this; | |
let ParrotanimalsDeathDay = this.ParrotanimalsDeathDay; | |
let ParrotanimalsBirthDay = this.ParrotanimalsBirthDay; | |
let startplanDateExceds = false; | |
let endplanDateExceds = false; | |
let plandExceddialog = this; | |
let unsavedchanges = this; | |
let haschanges = false; | |
let eventanimalsBirthDay = new Date(this.ParrotanimalsBirthDay); | |
let eventanimalsDeathDay = new Date(this.ParrotanimalsDeathDay); | |
if (this.TigerService.crowFutureAccessDays != null && this.TigerService.crowFutureAccessDays != "") { | |
let futureDays = this.TigerService.crowFutureAccessDays; | |
if (!isNaN(futureDays)) { | |
let currentDate = new Date(); | |
currentDate.setDate(currentDate.getDate() + futureDays - 1); | |
if (eventanimalsDeathDay.getTime() > currentDate.getTime()) { | |
eventanimalsDeathDay = currentDate; | |
} | |
if (eventanimalsBirthDay.getTime() > currentDate.getTime()) { | |
eventanimalsBirthDay = currentDate; | |
} | |
} | |
} | |
let datas = { | |
"networks": [101], | |
"days": [0, 1, 2, 3, 4, 5, 6], | |
"animalsBirthDay": kendo.toString(new Date(eventanimalsBirthDay), 'yyyy-MM-dd'), | |
"animalsDeathDay": kendo.toString(new Date(eventanimalsDeathDay), 'yyyy-MM-dd'), | |
"animalsShaking": this.convertTo24Hour(this.ParrotanimalsShaking), | |
"animalsUnderstanding": this.convertTo24Hour(this.ParrotanimalsUnderstanding), | |
"type": "NE", | |
"strTime": this.ParrotanimalsShaking, | |
"endEveTime": this.ParrotanimalsUnderstanding | |
}; | |
var ev = { | |
"animalsBirthDay": this.ParrotanimalsBirthDay, | |
"animalsDeathDay": this.ParrotanimalsDeathDay, | |
"animalsShaking": this.ParrotanimalsShaking, | |
"animalsUnderstanding": this.ParrotanimalsUnderstanding, | |
"leftEvent": this.leftEvent | |
} | |
this.TigerEnableSave.emit({ | |
"type": "leftEventDateTimeanimalsPolice", | |
"animalsTalking": ev, | |
"destinationEvent": this.leftEventDateTimeanimalsPolicedeathAliveData[this.leftEventDateTimeanimalsPolicedeathAliveData.length - 1], | |
"initialValue": this.leftEventDateTimeanimalsPolicedeathAliveData[this.leftEventDateTimeanimalsPolicedeathAliveData.length - 1], | |
"occurence": {}, | |
"action": "leftEventDateTimeanimalsPolice" | |
}); | |
let Temperature = {}; | |
Temperature["enableBtn"] = true; | |
Temperature["tabName"] = "crow"; | |
this.TigerService.setTemperature(Temperature); | |
$(".animalsBirthDayKendoDP").each(function () { | |
if ((that.getNumberofDays2(ParrotanimalsDeathDay, $(this).val()) - 1) > 2 && startplanDateExceds == false && ParrotanimalsDeathDay == ParrotanimalsBirthDay) { | |
startplanDateExceds = true; | |
} | |
}); | |
$("input[id^='animalsDeathDay_']").each(function () { | |
if ((that.getNumberofDays2(ParrotanimalsBirthDay, $(this).val()) - 1) > 2 && endplanDateExceds == false && ParrotanimalsDeathDay == ParrotanimalsBirthDay) { | |
endplanDateExceds = true; | |
} | |
}); | |
let animalsBirthDay = kendo.toString(new Date(this.ParrotanimalsBirthDay), 'MM/dd/yyyy'); | |
let animalsDeathDay = kendo.toString(new Date(this.ParrotanimalsDeathDay), 'MM/dd/yyyy'); | |
let animalsShaking = this.ParrotanimalsShaking; | |
let animalsUnderstanding = this.ParrotanimalsUnderstanding; | |
if (this.animalsShouting && this.animalsShouting.length > 0) { | |
for (var k = 0; k < this.animalsShouting.length; k++) { | |
let TigerItem = this.animalsShouting[k]; | |
let TigerItem_animalsBirthDay = kendo.toString(new Date(TigerItem.start), 'MM/dd/yyyy'); | |
let TigerItem_animalsDeathDay = kendo.toString(new Date(TigerItem.end), 'MM/dd/yyyy'); | |
let TigerItem_animalsShaking_new = that.timeTo12HrFormat(kendo.toString(new Date(TigerItem.start), "HH:mm:ss tt")); | |
let TigerItem_animalsUnderstanding_new = that.timeTo12HrFormat(kendo.toString(new Date(TigerItem.end), "HH:mm:ss tt")); | |
if (kendo.parseDate(animalsBirthDay + " " + animalsShaking) > kendo.parseDate(TigerItem_animalsBirthDay + " " + TigerItem_animalsShaking_new)) { | |
this.showPopup = true; | |
} | |
if (kendo.parseDate(animalsDeathDay + " " + animalsUnderstanding) < kendo.parseDate(TigerItem_animalsDeathDay + " " + TigerItem_animalsUnderstanding_new)) { | |
this.showPopup = true; | |
} | |
} | |
} | |
// if (this.showPopup && endplanDateExceds == true && startplanDateExceds == true) { | |
// unsavedchanges.setDialog("There are some unsaved changes in the animalsCommunication grid.Save is required to complete action"); | |
// $('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
// $('#animalsShakings').val(that.converttotime(that.previous_animalsShaking)); | |
// $('#animalsUnderstandings').val(that.converttotime(that.previous_animalsUnderstanding)); | |
// $('#animalsBirthDay').val(that.converttodate(that.previous_animalsBirthDay)); | |
// $('#animalsDeathDay').val(that.converttodate(that.previous_animalsDeathDay)); | |
// } | |
// If there is changes in Nationl Main Tiger | |
// else if (that.TigerService.checkNatTigerChanges(haschanges) === true) { | |
// $(".ballPlayingAnimal").text('Unsaved animalsCommunication changes that fall outside new range will be lost'); | |
// if (this.showPopup && endplanDateExceds == false && startplanDateExceds == false) { | |
// let newfallConfirm = $("#falloutsideConfirmDialog").data("animalsEatinGindow").center().open(); | |
// // If they click ok button | |
// $("#falloutsideOK").unbind().click(function () { | |
// newfallConfirm.close(); | |
// that.loadCenterDataClickOnanimalsPolice(datas); | |
// that.leftEventDateTimeanimalsPolicedeathAliveData.push(jQuery.extend(true, {}, ev)); | |
// that.enableanimalsPolice(); | |
// that.TigerService.checkNatTigerChanges(haschanges) == false; | |
// }); | |
// // If they click cancel button , Reset the values | |
// $("#falloutsideNO").unbind().click(function () { | |
// $('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
// $('#animalsShakings').val(that.converttotime(that.previous_animalsShaking)); | |
// $('#animalsUnderstandings').val(that.converttotime(that.previous_animalsUnderstanding)); | |
// $('#animalsBirthDay').val(that.converttodate(that.previous_animalsBirthDay)); | |
// $('#animalsDeathDay').val(that.converttodate(that.previous_animalsDeathDay)); | |
// newfallConfirm.close(); | |
// }); | |
// } | |
// } | |
//else | |
if ((this.showPopup == false || this.showPopup == undefined)) { | |
that = this; | |
plandExceddialog.setDialog("All Plan(s) should fall within 2 days of Event Start Date and Event End Date"); | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
startplanDateExceds = false; | |
endplanDateExceds = false; | |
$('#animalsShakings').val(that.converttotime(that.previous_animalsShaking)); | |
$('#animalsUnderstandings').val(that.converttotime(that.previous_animalsUnderstanding)); | |
$('#animalsBirthDay').val(that.converttodate(that.previous_animalsBirthDay)); | |
$('#animalsDeathDay').val(that.converttodate(that.previous_animalsDeathDay)); | |
} | |
else { | |
that.loadCenterDataClickOnanimalsPolice(datas); | |
that.leftEventDateTimeanimalsPolicedeathAliveData.push(jQuery.extend(true, {}, ev)); | |
that.previous_animalsBirthDay = this.ParrotanimalsBirthDay | |
that.previous_animalsDeathDay = this.ParrotanimalsDeathDay; | |
} | |
this.animalsDreamComeTrue(); | |
this.animalTigerService.setEventName({"aptDate": this.ParrotanimalsBirthDay,"name":this.AnimalsTeethNameTxt}); | |
} | |
loadCenterDataClickOnanimalsPolice(Obj: Object) { | |
let that = this; | |
let action = "Tigers/v1/Tigers"; | |
that.progress.requestStart(); | |
that.animalService.getResponse(action, 'post', Obj).subscribe(data => { | |
let decompressedData = that.decompressJsonResponse(data.zipdata); | |
Obj["eventanimalsBirthDay"]=kendo.toString(new Date(that.ParrotanimalsBirthDay), 'yyyy-MM-dd') | |
Obj["eventanimalsDeathDay"]=kendo.toString(new Date(that.ParrotanimalsDeathDay), 'yyyy-MM-dd') | |
let responseData = { | |
"decompressedData": decompressedData, | |
"data": Obj | |
}; | |
if (decompressedData.code == "S304") { | |
that.isEventCreated = true; | |
that.isanimalsPoliceClicked = true; | |
that.animalsPoliceanimalsCommunication.emit(responseData); | |
that.isanimalsPolicedNat = true; | |
that.animalsDreamComeTrue(); | |
} | |
if (!this.leftEvent.apt.aptDate) { | |
if (!that.animalStaminaTag || that.animalStaminaTag <= 0) { | |
this.leftEvent.apt.aptDate = that.ParrotanimalsBirthDay; | |
that.aptDateChange(this.leftEvent.apt.aptDate); | |
$("#aptDate").parent().parent().parent().removeClass('mandatoryField'); | |
} | |
that.animalsDreamComeTrue(); | |
} | |
that.progress.requestEnd(); | |
that.isanimalsPolice = true; | |
$('#eventDateanimalsPolice').addClass('actionanimalsJeansd'); | |
this.enableAddPlan(); | |
}, err => { | |
that.progress.requestEnd(); | |
}); | |
} | |
decompressJsonResponse(data): any { | |
// Decode base64 (convert ascii to binary) | |
let strData = atob(data); | |
// Convert binary string to character-number array | |
let charData = strData.split('').map(function (x) { return x.charCodeAt(0); }); | |
// Turn number array into byte-array | |
let binData = new Uint8Array(charData); | |
// animalsIntelligence decompress | |
let inflateData = animalsIntelligence.inflateRaw(binData); | |
// Convert gunzipped byteArray back to ascii string: | |
//let value = String.fromCharCode.apply(null, new Uint16Array(inflateData)); | |
let value = new animalThinking("utf-8").decode(inflateData); | |
return JSON.parse(value); | |
//return ""; | |
} | |
publishEvent(selectedValue): void { | |
this.animalsDreamComeTrue(); | |
let URDataSoruce = { | |
"leftEvent": this.leftEvent, | |
"publishFlag": this.publishFlag | |
}; | |
this.publishFlag = selectedValue; | |
let URDataDestination = { | |
"leftEvent": this.leftEvent, | |
"publishFlag": this.publishFlag | |
}; | |
this.TigerEnableSave.emit({ "type": "enableSaveWithCount", "animalsTalking": URDataSoruce, "destinationEvent": URDataDestination, "occurence": {}, "action": "left" }); | |
let Temperature = {}; | |
Temperature["enableBtn"] = true; | |
Temperature["tabName"] = "crow"; | |
this.TigerService.setTemperature(Temperature); | |
} | |
addContingency() { | |
//let checkedValue = []; | |
let that=this; | |
var checkValueItem = []; | |
var checkedItem = $("#pgmTemplates .isChecked:checked") | |
for (var i = 0; i < checkedItem.length; i++) { | |
let checkedItemId = checkedItem[i].id; | |
var checkedItemIdValue = $("#" + checkedItemId).val() | |
checkValueItem.push(checkedItemIdValue) | |
} | |
var schedItemNo; | |
if (this.schedItemNo == undefined || this.schedItemNo == "") { | |
schedItemNo = ""; | |
} else { | |
schedItemNo = this.schedItemNo; | |
} | |
var schedItemName; | |
if (this.schedItemName == undefined || this.schedItemName == "") { | |
schedItemName = ""; | |
} else { | |
schedItemName = this.schedItemName; | |
} | |
let tempObj = { | |
networkNos: [101], | |
templateNos: checkValueItem, | |
showName: schedItemName, | |
episodeName: this.leftEvent.pgmVal.episodeName, | |
overrideShowName: this.leftEvent.pgmVal.overRide, | |
schedItemNo: schedItemNo | |
} | |
this.progress.requestStart(); | |
this.animalService.getResponse("contingencyplans/v1/eventTemplates/pgm/opConditions", 'post', tempObj) | |
.subscribe(data => { | |
if (data.code == "S500") { | |
if (data.details.length > 0) { | |
var pgmCheckedDetailsText = ''; | |
for (var i = 0; i < data.details.length; i++) { | |
let checkedItemText = data.details[i].AnimalsBrush; | |
if(pgmCheckedDetailsText==''){ | |
pgmCheckedDetailsText = pgmCheckedDetailsText + checkedItemText; | |
} | |
else{ | |
pgmCheckedDetailsText = pgmCheckedDetailsText + '<br><br>'+checkedItemText; | |
} | |
} | |
this.progress.requestEnd(); | |
$("#pgmTemplates .isChecked").prop('checked', false); | |
that.tooggleFlag = false; | |
that.selectAllLabel = "Select All"; | |
this.appendPGMText(pgmCheckedDetailsText); | |
this.animalsDreamComeTrue(); | |
} | |
} else if (data.code == "E500") { | |
//this.messageDetails = data.details; | |
//this.pgmsetDialog(data.details); | |
let pgmsetDialog = $("#pgmeventDialog").data("animalsEatinGindow").center().open(); | |
this.messageDetails = data.details; | |
let getMessageDetail = ""; | |
for(let k=0;k<this.messageDetails.length;k++){ | |
getMessageDetail = getMessageDetail + ("<div>"+this.messageDetails[k].message+"</div>") | |
} | |
$("#getMessageDetails").html(getMessageDetail); | |
$("#PGM_OK").unbind().on('click',function () { | |
pgmsetDialog.close(); | |
}); | |
// let checkboxes = $('#pgmTemplates :checkbox'); | |
// if(checkboxes.length == checkboxes.filter(':checked').length) { | |
// //$("#pgmDetailOption36").trigger('click'); | |
// //that.selectAllLabel = "Select All"; | |
// } | |
} | |
this.progress.requestEnd(); | |
}, | |
err => { this.progress.requestEnd(); } | |
); | |
} | |
appendPGMText(pgmCheckedDetailsText) { | |
if (this.addPGMSelectedTab) { | |
this.addPGMDetail.emit(pgmCheckedDetailsText); | |
} | |
} | |
showNameChange(selectedItem) { | |
let TigerItems = this.TigerAnimalsTeethValues.TigerItems; | |
this.leftEvent.pgmVal.episodeName = ''; | |
for (var i = 0; i < TigerItems.length; i++) { | |
if (TigerItems[i].schedItemNo == selectedItem) { | |
this.schedItemNo = TigerItems[i].schedItemNo; | |
this.leftEvent.pgmVal.episodeName = TigerItems[i].episodeDisplayName; | |
break; | |
} | |
} | |
for (var j = 0; j < this.TigerEventShows.length; j++) { | |
if (this.TigerEventShows[j].schedItemNo == selectedItem) { | |
this.schedItemName = this.TigerEventShows[j].titleName; | |
} | |
} | |
} | |
setSelectedId(id: any) { | |
this.addPGMSelectedTab = id; | |
} | |
addAnimalsTeethContingency() { | |
var checkValueItem = []; | |
var checkedItem = $("#eventTemplates .isChecked:checked") | |
for (var i = 0; i < checkedItem.length; i++) { | |
let checkedItemId = checkedItem[i].id; | |
var checkedItemIdValue = $("#" + checkedItemId).val() | |
checkValueItem.push({ "networkNo": 101, "TigerEventTemplateNo": checkedItemIdValue }); | |
} | |
this.progress.requestStart(); | |
this.animalService.getResponse("contingencyplans/v1/event/templates", 'post', checkValueItem) | |
.subscribe(data => { | |
if (data) { | |
var pgmCheckedDetailsText = ''; | |
for (var i = 0; i < data.length; i++) { | |
let checkedItemText = data[i].TigerEventAnimalsBrush; | |
if(pgmCheckedDetailsText==''){ | |
pgmCheckedDetailsText = pgmCheckedDetailsText + checkedItemText; | |
} | |
else{ | |
pgmCheckedDetailsText = pgmCheckedDetailsText + '<br><br>'+checkedItemText; | |
} | |
} | |
$("#eventTemplates .isChecked").prop('checked', false); | |
this.appendPGMText(pgmCheckedDetailsText); | |
this.animalsDreamComeTrue(); | |
} | |
this.progress.requestEnd(); | |
}, | |
err => { this.progress.requestEnd(); } | |
); | |
} | |
opServiceCall(data: any) { | |
this.progress.requestStart(); | |
this.animalService.getResponse("contingencyplans/v1/eventtemplates/opConditions", 'post', data) | |
.subscribe(data => { | |
if (data.code == "S500") { | |
if (data) { | |
data = this.opConditionDataConfig(data); | |
data.isPlanAdded = false; | |
this.animalTigerService.setPlanAdded(data); | |
this.animalsDreamComeTrue(); | |
} | |
}else if(data.code == "E101"){ | |
this.setDialog(data.message); | |
}else if (data.code == "E500") { | |
//this.setDialog(data.message); | |
this.setDialog("Template text is invalid"); | |
} | |
this.progress.requestEnd(); | |
}, | |
err => { this.progress.requestEnd(); } | |
); | |
} | |
opConditionDataConfig(opConData: any): any { | |
var opData = opConData; | |
if (opData) { | |
opData.animalsNokia = 2; | |
opData.operationType = "Create"; | |
if (opData.TigerPlans) { | |
for (let i = 0; i < opData.TigerPlans.length; i++) { | |
let whale = opData.TigerPlans[i]; | |
whale.operationType = "Create"; | |
whale.animalsNokia = 2; | |
let planFeed = whale.TigerPlanFeeds; | |
if (planFeed) { | |
for (let j = 0; j < planFeed.length; j++) { | |
let feedItem = planFeed[j]; | |
feedItem.operationType = "Create"; | |
if (feedItem.feedName == "Eastern") { | |
feedItem.animalHumming = 11; | |
} | |
else if (feedItem.feedName == "Central") { | |
feedItem.animalHumming = 12; | |
} | |
else if (feedItem.feedName == "Mountain") { | |
feedItem.animalHumming = 13; | |
} | |
else if (feedItem.feedName == "Pacific") { | |
feedItem.animalHumming = 14; | |
} | |
} | |
} | |
} | |
} | |
} | |
return opData; | |
} | |
opConditionBtnClick() { | |
let that = this; | |
let selectedTemplateNo = $('input[name=opCondition]:checked').val(); | |
let opTemplates = this.TigerAnimalsTeethOPTemplates; | |
let opanimalsShaking = this.ParrotOPanimalsShaking; | |
let opDisplayName = this.opDisplayName; | |
let isMandatory = true; | |
if (selectedTemplateNo) { | |
for (let i = 0; i < opTemplates.length; i++) { | |
let showNameReq = opTemplates[i].showNameReqInd; | |
let showTimeReqInd = opTemplates[i].showTimeReqInd; | |
if (selectedTemplateNo == opTemplates[i].TigerEventTemplateNo) { | |
/* let showNameReq = opTemplates[i].showNameReqInd; | |
let showTimeReqInd = opTemplates[i].showTimeReqInd; */ | |
if ((showNameReq == "Y") && (opDisplayName == "" || opDisplayName == undefined)) { | |
if ((showTimeReqInd == "Y") && (opanimalsShaking == "" || opanimalsShaking == undefined)) { | |
that.setDialog("The following information is missing for the template: Display Show Name,Start Time"); | |
isMandatory = false; | |
return; | |
}else{ | |
that.setDialog("The following information is missing for the template: Show Display Name"); | |
isMandatory = false; | |
return; | |
} | |
} | |
if ((showTimeReqInd == "Y") && (opanimalsShaking == "" || opanimalsShaking == undefined)) { | |
that.setDialog("The following information is missing for the template: Start Time"); | |
isMandatory = false; | |
return; | |
} | |
} /*else { | |
if ((showNameReq == "Y" && opDisplayName == "" || opDisplayName == undefined) && | |
(showTimeReqInd == "Y" && opanimalsShaking == "" || opanimalsShaking == undefined)) { | |
that.setDialog("The following information is missing for the template: Display Show Name,Start Time"); | |
isMandatory = false; | |
return; | |
} | |
}*/ | |
} | |
if (isMandatory) { | |
let data = { | |
"TigerEventTemplateNo": selectedTemplateNo, | |
"networkNo": 101, | |
"showName": opDisplayName, | |
"animalsShaking": opanimalsShaking | |
}; | |
this.opServiceCall(data); | |
} | |
} | |
} | |
//******BooK Unbook Event**********// | |
animalsPoliceBookEvent(bookValues, id) { | |
var bookPlans = []; | |
this.plansDetailsArr = []; | |
for (var i = 0; i < bookValues.length; i++) { | |
var TigerPlans = bookValues[i].TigerPlans; | |
for (var j = 0; j < TigerPlans.length; j++) { | |
bookPlans.push(TigerPlans[j]); | |
this.plansDetailsArr.push(TigerPlans[j]); | |
} | |
} | |
this.snailInsectJson(bookPlans); | |
} | |
snailInsectJson(bookPlans) { | |
let that = this; | |
this.animalStrategy.bookPlans = []; | |
for (var i = 0; i < bookPlans.length; i++) { | |
var tempArr = []; | |
var TigerPlanFeeds = bookPlans[i].TigerPlanFeeds; | |
let planeanimalsShaking = bookPlans[i].animalsBirthDay + " " + bookPlans[i].animalsShaking; | |
let planeanimalsUnderstanding = bookPlans[i].animalsDeathDay + " " + bookPlans[i].animalsUnderstanding; | |
if (TigerPlanFeeds.length > 0 && bookPlans[i].operationType != "animalsDryer") { | |
var allSelect = false; | |
var catfish; | |
var mtObj = { checkedVal: false, isHidden: true }; | |
var ctObj = { checkedVal: false, isHidden: true }; | |
var ptObj = { checkedVal: false, isHidden: true }; | |
var etObj = { checkedVal: false, isHidden: true }; | |
for (var j = 0; j < TigerPlanFeeds.length; j++) { | |
var id = bookPlans[i].bookPlanID; | |
var bookEventName = bookPlans[i].planDesc; | |
var categoryName = bookPlans[i].categoryDesc; | |
var animalHumming = TigerPlanFeeds[j].animalHumming; | |
var isFeedAvailable=TigerPlanFeeds[j].isFeedAvailable; | |
if (animalHumming === 11 && bookPlans[i].ET) { | |
let temp = this.isbookedFlagChecked(TigerPlanFeeds[j].TigerItems, new Date(planeanimalsShaking), new Date(planeanimalsUnderstanding)) | |
etObj.checkedVal = temp.checkVal; | |
etObj["AnimalsTeethlength"] = temp.len; | |
etObj["partiallyBooked"] = temp.partiallyBooked; | |
//etObj["AnimalsTeethlength"] = TigerPlanFeeds[j].TigerItems.length; | |
etObj.isHidden = false | |
} | |
if (animalHumming === 12 && bookPlans[i].CT) { | |
let animalsTaxi = new Date(planeanimalsShaking); | |
animalsTaxi.setHours(animalsTaxi.getHours() - 1); | |
let planEndT = new Date(planeanimalsUnderstanding); | |
planEndT.setHours(planEndT.getHours() - 1); | |
let temp = this.isbookedFlagChecked(TigerPlanFeeds[j].TigerItems, animalsTaxi, planEndT) | |
ctObj.checkedVal = temp.checkVal | |
ctObj["AnimalsTeethlength"] = temp.len | |
ctObj["partiallyBooked"] = temp.partiallyBooked; | |
//ctObj["AnimalsTeethlength"] = TigerPlanFeeds[j].TigerItems.length; | |
ctObj.isHidden = false | |
} | |
if (animalHumming === 13 && bookPlans[i].MT) { | |
let animalsTaxi = new Date(planeanimalsShaking); | |
animalsTaxi.setHours(animalsTaxi.getHours() - 2); | |
let planEndT = new Date(planeanimalsUnderstanding); | |
planEndT.setHours(planEndT.getHours() - 2); | |
let temp = this.isbookedFlagChecked(TigerPlanFeeds[j].TigerItems, animalsTaxi, planEndT) | |
mtObj.checkedVal = temp.checkVal; | |
mtObj["AnimalsTeethlength"] = temp.len; | |
mtObj["partiallyBooked"] = temp.partiallyBooked; | |
//mtObj["AnimalsTeethlength"] = TigerPlanFeeds[j].TigerItems.length; | |
mtObj.isHidden = false | |
} | |
if (animalHumming === 14 && bookPlans[i].PT) { | |
let animalsTaxi = new Date(planeanimalsShaking); | |
animalsTaxi.setHours(animalsTaxi.getHours() - 3); | |
let planEndT = new Date(planeanimalsUnderstanding); | |
planEndT.setHours(planEndT.getHours() - 3); | |
let temp = this.isbookedFlagChecked(TigerPlanFeeds[j].TigerItems, animalsTaxi, planEndT); | |
ptObj.checkedVal = temp.checkVal | |
ptObj["AnimalsTeethlength"] = temp.len | |
ptObj["partiallyBooked"] = temp.partiallyBooked; | |
//ptObj["AnimalsTeethlength"] = TigerPlanFeeds[j].TigerItems.length; | |
ptObj.isHidden = false | |
} | |
} | |
tempArr.push({ ET: etObj, CT: ctObj, MT: mtObj, PT: ptObj }); | |
if (mtObj.checkedVal == true && ctObj.checkedVal == true && etObj.checkedVal == true && ptObj.checkedVal == true) { | |
allSelect = true; | |
} else { | |
allSelect = this.rowListAllCheked(tempArr); | |
} | |
if (mtObj.isHidden != true || ctObj.isHidden != true || etObj.isHidden != true || ptObj.isHidden != true) { | |
catfish = this.catfishColour(tempArr, id); | |
this.animalStrategy.bookPlans.push({ planId: id, name: bookEventName, categoryName:categoryName, all: allSelect, catfishColour: catfish, ET: etObj, CT: ctObj, MT: mtObj, PT: ptObj }); | |
} | |
} | |
} | |
setTimeout(function () { | |
that.bookPlanAllanimalsJeansCheck(); | |
}, 200); | |
} | |
catfishColour(tempArr, id) { | |
var catfish = "NB"; | |
for (var g in tempArr) { | |
var obj = tempArr[g]; | |
var trueCount = 0; | |
var falseCount = 0; | |
var showCount = 0; | |
$.each(obj, function (key, value) { | |
if (!value.isHidden && value.AnimalsTeethlength>0) { | |
showCount = showCount + 1; | |
if (value.checkedVal) { | |
trueCount = trueCount + 1; | |
} else { | |
falseCount = falseCount + 1; | |
} | |
} | |
}); | |
} | |
if(trueCount>0&& trueCount == showCount) { | |
catfish = 'B'; | |
} else if (falseCount == showCount) { | |
var partiallyBookedStatus = tempArr.filter(function(el) { | |
return el.ET.partiallyBooked == true||el.CT.partiallyBooked == true||el.MT.partiallyBooked == true||el.PT.partiallyBooked == true; | |
}); | |
catfish = 'NB'; | |
if (partiallyBookedStatus.length > 0) { | |
catfish = ''; | |
} | |
} else { | |
catfish = ''; | |
} | |
return catfish; | |
} | |
rowListAllCheked(tempArr) { | |
var allVal = false; | |
for (var g in tempArr) { | |
var obj = tempArr[g]; | |
$.each(obj, function (key, value) { | |
if ((value.checkedVal && !value.isHidden) || (!value.checkedVal && value.isHidden)) { | |
if(value.AnimalsTeethlength>0){ | |
allVal = true; | |
} | |
} else if (!value.checkedVal && !value.isHidden && value.AnimalsTeethlength>0) { | |
allVal = false; | |
return allVal; | |
} | |
}); | |
} return allVal; | |
} | |
isbookedFlagChecked(TigerItems, planeanimalsShaking, planeanimalsUnderstanding) { | |
let checkVal = true; | |
let newArr=TigerItems; | |
//var newArr = TigerItems.filter(function (el) { | |
//return el.start.getTime() <= planeanimalsUnderstanding.getTime()&& el.end.getTime() >= planeanimalsShaking.getTime(); | |
//return el.start <= planeanimalsUnderstanding && el.end >= planeanimalsShaking && el.seriesNo!=-1 && el.titleNo!=-1; | |
//}); | |
if (newArr.length > 0) { | |
for (var i = 0; i < newArr.length; i++) { | |
if (newArr[i].bookedFlag == "NB" || newArr[i].bookedFlag == "" || newArr[i].bookedFlag == "D") { | |
checkVal = false; | |
break; | |
} | |
} | |
} else { | |
checkVal = false; | |
} | |
var partiallyBookedStatus = TigerItems.filter(function(el) { | |
return el.bookedFlag == "EB"; | |
}); | |
let partiallyBooked = false; | |
if (partiallyBookedStatus.length > 0) { | |
partiallyBooked = true; | |
} | |
return { "checkVal": checkVal, "len": newArr.length, "partiallyBooked":partiallyBooked}; | |
//return checkVal; | |
} | |
snailInsectRowChange(id, isChecked,isAllBook,isOverAll,animalStrategy) { | |
// snailInsectRowChange(id, isChecked) { | |
//booked all undo redo | |
let planObject={}; | |
if(!isOverAll){ | |
planObject={ | |
"animalStrategy" :this.animalStrategy, | |
"id":id, | |
"isChecked":isChecked, | |
"feedName":"", | |
"isAllBook":isAllBook, | |
"isOverAll":isOverAll | |
} | |
} | |
else{ | |
planObject={ | |
"animalStrategy" :animalStrategy, | |
"id":id, | |
"isChecked":isChecked, | |
"feedName":"", | |
"isAllBook":isAllBook, | |
"isOverAll":isOverAll | |
} | |
} | |
let destinationChecked=false; | |
if(isChecked){destinationChecked=false}else{destinationChecked=true} | |
let planDestObject={}; | |
if(!isOverAll){ | |
planDestObject={ | |
"animalStrategy" :this.animalStrategy, | |
"id":id, | |
"isChecked":destinationChecked, | |
"feedName":"", | |
"isAllBook":isAllBook, | |
"isOverAll":isOverAll | |
} | |
}else{ | |
planDestObject={ | |
"animalStrategy" :animalStrategy, | |
"id":id, | |
"isChecked":destinationChecked, | |
"feedName":"", | |
"isAllBook":isAllBook, | |
"isOverAll":isOverAll | |
} | |
} | |
let animalAge={ | |
"type": "bookeddeathAlive", | |
"animalsTalking": jQuery.extend(true, {}, planObject), | |
"destinationEvent": jQuery.extend(true, {}, planDestObject), | |
"occurence": {}, | |
"action": "bookeddeathAlive" | |
}; | |
for (var i = 0; i < this.animalStrategy.bookPlans.length; i++) { | |
if (this.animalStrategy.bookPlans[i].planId == id.name) { | |
var changedRow = this.animalStrategy.bookPlans[i]; | |
changedRow["feedName"] = []; | |
if (!this.animalStrategy.bookPlans[i].ET.isHidden && this.animalStrategy.bookPlans[i].ET.AnimalsTeethlength > 0) { | |
this.animalStrategy.bookPlans[i].ET.checkedVal = isChecked; | |
changedRow["feedName"].push("Est"); | |
} | |
if (!this.animalStrategy.bookPlans[i].CT.isHidden && this.animalStrategy.bookPlans[i].CT.AnimalsTeethlength > 0) { | |
this.animalStrategy.bookPlans[i].CT.checkedVal = isChecked; | |
changedRow["feedName"].push("Cent"); | |
} | |
if (!this.animalStrategy.bookPlans[i].MT.isHidden && this.animalStrategy.bookPlans[i].MT.AnimalsTeethlength > 0) { | |
this.animalStrategy.bookPlans[i].MT.checkedVal = isChecked; | |
changedRow["feedName"].push("Mount"); | |
} | |
if (!this.animalStrategy.bookPlans[i].PT.isHidden && this.animalStrategy.bookPlans[i].PT.AnimalsTeethlength > 0) { | |
this.animalStrategy.bookPlans[i].PT.checkedVal = isChecked; | |
changedRow["feedName"].push("Pacifi"); | |
} | |
if (this.animalStrategy.bookPlans[i].ET.checkedVal == true && this.animalStrategy.bookPlans[i].CT.checkedVal == true | |
&& this.animalStrategy.bookPlans[i].MT.checkedVal == true && this.animalStrategy.bookPlans[i].PT.checkedVal == true) { | |
this.animalStrategy.bookPlans[i].all = true; | |
this.animalStrategy.bookPlans[i].catfishColour = "B"; | |
} else { | |
this.animalStrategy.bookPlans[i].all = false; | |
this.animalStrategy.bookPlans[i].catfishColour = "NB"; | |
} | |
changedRow["feedChecked"] = isChecked; | |
break; | |
} | |
} | |
this.animalsDreamComeTrue(); | |
changedRow["undoanimalAge"] = animalAge; | |
this.animalTigerService.changeBookPlan(changedRow); | |
} | |
snailInsectTImeZoneChange(id, feedName, isChecked) { | |
//booked event single | |
let planObject={ | |
"animalStrategy" :this.animalStrategy, | |
"id":id, | |
"isChecked":isChecked, | |
"feedName":feedName, | |
"isAllBook":false, | |
"isOverAll":false | |
} | |
let destinationChecked=false; | |
if(isChecked){destinationChecked=false}else{destinationChecked=true} | |
let planDestObject={ | |
"animalStrategy" :this.animalStrategy, | |
"id":id, | |
"isChecked":destinationChecked, | |
"feedName":feedName, | |
"isAllBook":false, | |
"isOverAll":false | |
} | |
let animalAge={ | |
"type": "bookeddeathAlive", | |
"animalsTalking": jQuery.extend(true, {}, planObject), | |
"destinationEvent": jQuery.extend(true, {}, planDestObject), | |
"occurence": {}, | |
"action": "bookeddeathAlive" | |
}; | |
let that = this; | |
this.animalsDreamComeTrue(); | |
var catfish = this.timeZoneBookColourCheck(id.name); | |
for (var i = 0; i < this.animalStrategy.bookPlans.length; i++) { | |
if (this.animalStrategy.bookPlans[i].planId == id.name) { | |
this.animalStrategy.bookPlans[i].catfishColour = catfish; | |
var obj = this.animalStrategy.bookPlans[i]; | |
if (obj.feedName) { | |
obj.feedName = ''; | |
} | |
for (var x in obj) { | |
if (typeof obj[x] == typeof {}) { | |
that.animalStrategy.bookPlans[i].all = true; | |
if (!obj[x].checkedVal && !obj[x].isHidden) { | |
that.animalStrategy.bookPlans[i].all = false; | |
break; | |
} | |
} | |
} | |
obj["feedName"] = [feedName]; | |
obj["feedChecked"] = isChecked; | |
obj["undoanimalAge"] = animalAge; | |
this.animalTigerService.changeBookPlan(obj); | |
} | |
} | |
} | |
timeZoneBookColourCheck(id) { | |
let catfish = ""; | |
if ($("#" + id + " " + ".timeZoneCheckbox").length == $("#" + id + " " + ".timeZoneCheckbox:checked").length) { | |
catfish = "B"; | |
} else { | |
if ($("#" + id + " " + ".timeZoneCheckbox:checked").length <= 0) { | |
catfish = "NB"; | |
} else if ($("#" + id + " " + ".timeZoneCheckbox:checked").length > 0) { | |
catfish = ""; | |
} | |
} | |
return catfish; | |
} | |
bookplanAllColorCheck() { | |
if ($(".snailInsectRowClass").length > 0) { | |
let planeRowlen =$(".snailInsectRowClass").length; | |
planeRowlen=planeRowlen - $(".snailInsectRowClass:animalsJeansd").length; | |
if (planeRowlen == $(".snailInsectRowClass:checked").length) { | |
if ($(".snailInsectRowClass:checked").length >0){ | |
$("#bookALLCheck").prop("checked", true); | |
$(".OverAllChange").removeClass("translationEnabled bookEnabled"); | |
$(".OverAllChange").addClass("bookEnabledGreen"); | |
$(".OverAllChange").text("B"); | |
} | |
} else { | |
if ($(".snailInsectRowColorFlag span").hasClass("translationEnabled")) { | |
$(".OverAllChange").removeClass("bookEnabledGreen bookEnabled"); | |
$(".OverAllChange").addClass("translationEnabled"); | |
$(".OverAllChange").text(""); | |
$("#bookALLCheck").prop("checked", false); | |
} | |
else if ($(".snailInsectRowClass:checked").length <= 0) { | |
$("#bookALLCheck").prop("checked", false); | |
$(".OverAllChange").removeClass("bookEnabledGreen translationEnabled"); | |
$(".OverAllChange").addClass("bookEnabled"); | |
$(".OverAllChange").text("NB"); | |
} else { | |
$(".OverAllChange").removeClass("bookEnabledGreen bookEnabled"); | |
$(".OverAllChange").addClass("translationEnabled"); | |
$(".OverAllChange").text(""); | |
$("#bookALLCheck").prop("checked", false); | |
} | |
} | |
} else { | |
$("#bookALLCheck").prop("checked", false); | |
$("#bookALLCheck").prop('animalsJeansd', true); | |
$(".OverAllChange").removeClass("translationEnabled bookEnabled bookEnabledGreen"); | |
$(".OverAllChange").text(""); | |
} | |
} | |
bookPlanAllanimalsJeansCheck() { | |
for (let j = 0; j < this.animalStrategy.bookPlans.length; j++) { | |
let id = this.animalStrategy.bookPlans[j].planId; | |
if ($('#' + id + ' .timeZoneCheckbox').length == $('#' + id + ' .timeZoneCheckbox:animalsJeansd').length) { | |
$('#' + id + ' .snailInsectRowClass').prop('animalsJeansd', true); | |
this.animalStrategy.bookPlans[j].catfishColour="NA"; | |
} else { | |
$('#' + id + ' .snailInsectRowClass').prop('animalsJeansd', false); | |
} | |
} | |
$("#bookALLCheck").prop('animalsJeansd', false); | |
$(".OverAllChange").show(); | |
if ($(".snailInsectRowClass").length == $(".snailInsectRowClass:animalsJeansd").length) { | |
$("#bookALLCheck").prop('animalsJeansd', true); | |
$(".OverAllChange").hide(); | |
} | |
} | |
animalsPoliceBkEventOnTigerChange(data: any) { | |
let that = this; | |
for (let i = 0; i < data.length; i++) { | |
var tempArr = []; | |
for (let j = 0; j < this.animalStrategy.bookPlans.length; j++) { | |
if (data[i].planeId == this.animalStrategy.bookPlans[j].planId) { | |
if (data[i].animalHumming == 11) { | |
let temp = this.isbookedFlagChecked(data[i].value, new Date(data[i].planeanimalsShaking), new Date(data[i].planeanimalsUnderstanding)) | |
this.animalStrategy.bookPlans[j].ET.checkedVal = temp.checkVal; | |
this.animalStrategy.bookPlans[j].ET["AnimalsTeethlength"] = temp.len; | |
this.animalStrategy.bookPlans[j].ET["partiallyBooked"] = temp.partiallyBooked; | |
//this.animalStrategy.bookPlans[j].ET["AnimalsTeethlength"] = data[i].value.length; | |
} | |
if (data[i].animalHumming == 12) { | |
let animalsTaxi = new Date(data[i].planeanimalsShaking); | |
animalsTaxi.setHours(animalsTaxi.getHours() - 1); | |
let planEndT = new Date(data[i].planeanimalsUnderstanding); | |
planEndT.setHours(planEndT.getHours() - 1); | |
let temp = this.isbookedFlagChecked(data[i].value, animalsTaxi, planEndT) | |
this.animalStrategy.bookPlans[j].CT.checkedVal = temp.checkVal; | |
this.animalStrategy.bookPlans[j].CT["AnimalsTeethlength"] = temp.len; | |
this.animalStrategy.bookPlans[j].CT["partiallyBooked"] = temp.partiallyBooked; | |
//this.animalStrategy.bookPlans[j].CT["AnimalsTeethlength"] = data[i].value.length; | |
} | |
if (data[i].animalHumming == 13) { | |
let animalsTaxi = new Date(data[i].planeanimalsShaking); | |
animalsTaxi.setHours(animalsTaxi.getHours() - 2); | |
let planEndT = new Date(data[i].planeanimalsUnderstanding); | |
planEndT.setHours(planEndT.getHours() - 2); | |
let temp = this.isbookedFlagChecked(data[i].value, animalsTaxi, planEndT) | |
this.animalStrategy.bookPlans[j].MT.checkedVal = temp.checkVal; | |
this.animalStrategy.bookPlans[j].MT["AnimalsTeethlength"] = temp.len; | |
this.animalStrategy.bookPlans[j].MT["partiallyBooked"] = temp.partiallyBooked; | |
//this.animalStrategy.bookPlans[j].MT["AnimalsTeethlength"] = data[i].value.length; | |
} | |
if (data[i].animalHumming == 14) { | |
let animalsTaxi = new Date(data[i].planeanimalsShaking); | |
animalsTaxi.setHours(animalsTaxi.getHours() - 3); | |
let planEndT = new Date(data[i].planeanimalsUnderstanding); | |
planEndT.setHours(planEndT.getHours() - 3); | |
let temp = this.isbookedFlagChecked(data[i].value, animalsTaxi, planEndT) | |
this.animalStrategy.bookPlans[j].PT.checkedVal = temp.checkVal; | |
this.animalStrategy.bookPlans[j].PT["AnimalsTeethlength"] = temp.len; | |
this.animalStrategy.bookPlans[j].PT["partiallyBooked"] = temp.partiallyBooked; | |
//this.animalStrategy.bookPlans[j].PT["AnimalsTeethlength"] = data[i].value.length; | |
} | |
tempArr.push({ ET: this.animalStrategy.bookPlans[j].ET, CT: this.animalStrategy.bookPlans[j].CT, MT: this.animalStrategy.bookPlans[j].MT, PT: this.animalStrategy.bookPlans[j].PT }); | |
if (this.animalStrategy.bookPlans[j].ET.checkedVal == true && this.animalStrategy.bookPlans[j].CT.checkedVal == true | |
&& this.animalStrategy.bookPlans[j].MT.checkedVal == true && this.animalStrategy.bookPlans[j].PT.checkedVal == true) { | |
this.animalStrategy.bookPlans[j].all = true; | |
} else { | |
this.animalStrategy.bookPlans[j].all = this.rowListAllCheked(tempArr); | |
} | |
this.animalStrategy.bookPlans[j].catfishColour = this.catfishColour(tempArr, data[i].planeId); | |
} | |
} | |
} | |
setTimeout(function () { | |
that.bookPlanAllanimalsJeansCheck(); | |
}, 100); | |
} | |
//******End BooK Unbook Event**********// | |
loadDataFordeathAlive(thisData: any) { | |
this.publishFlag = thisData.publishFlag; | |
this.leftEvent = thisData.leftEvent; | |
} | |
leftEventDateTimeanimalsPolice(obj: any) { | |
if(typeof obj != "undefined"){ | |
this.ParrotanimalsBirthDay = obj.animalsBirthDay; | |
this.ParrotanimalsDeathDay = obj.animalsDeathDay; | |
this.ParrotanimalsShaking = obj.animalsShaking; | |
this.ParrotanimalsUnderstanding = obj.animalsUnderstanding; | |
let datas = { | |
"networks": [101], | |
"days": [0, 1, 2, 3, 4, 5, 6], | |
"animalsBirthDay": kendo.toString(new Date(this.ParrotanimalsBirthDay), 'yyyy-MM-dd'), | |
"animalsDeathDay": kendo.toString(new Date(this.ParrotanimalsDeathDay), 'yyyy-MM-dd'), | |
"animalsShaking": this.convertTo24Hour(this.ParrotanimalsShaking), | |
"animalsUnderstanding": this.convertTo24Hour(this.ParrotanimalsUnderstanding), | |
"type": "NE", | |
"strTime": this.ParrotanimalsShaking, | |
"endEveTime": this.ParrotanimalsUnderstanding | |
}; | |
this.loadCenterDataClickOnanimalsPolice(datas); | |
} | |
else | |
{ | |
this.ParrotanimalsBirthDay = ""; | |
this.ParrotanimalsDeathDay = ""; | |
this.ParrotanimalsShaking = ""; | |
this.ParrotanimalsUnderstanding = ""; | |
} | |
} | |
includeNextDayChkBoxChange(): void { | |
let includeDay = this.leftEvent.apt.includeNextDay; | |
if(this.leftEvent.apt.includeNextDay){ | |
includeDay = false; | |
}else{ includeDay=true; } | |
let destEvent= includeDay; | |
let animalsTalking = this.leftEvent.apt.includeNextDay; | |
this.savedeathAlive(animalsTalking,destEvent,"includeDate"); | |
this.animalsDreamComeTrue(); | |
} | |
ngOnDestroy() { | |
//this.animalsPoliceBookData.unsubscribe(); | |
this.isanimalsCommunicationDirtySubscription.unsubscribe(); | |
} | |
//event leftHenValidation | |
animalsDreamComeTrue() { | |
/* if(this.leftEvent.apt.aptDate != ""){ | |
$("#aptDate").parent().parent().parent().removeClass('mandatoryField'); | |
$("#aptDate").parent().parent().parent().removeAttr("title"); | |
this.animalTigerService.setEventName({ "name": '', "aptDate": this.leftEvent.apt.aptDate }); | |
} */ | |
if (!this.isanimalsPolice && this.AnimalsTeethNameTxt != "" && this.leftEvent.apt.aptDate && this.isanimalsPolicedNat) { | |
if (this.leftEvent.animalsName == 0) { | |
//if (this.isEventCreated) { | |
this.leftHenValidation.emit({ "isValid": true }); | |
//} | |
} | |
else { | |
this.leftHenValidation.emit({ "isValid": true }); | |
} | |
}else if(this.isanimalsPolicedNat && this.AnimalsTeethNameTxt != "" && this.leftEvent.apt.aptDate){ | |
this.leftHenValidation.emit({ "isValid": true }); | |
} | |
else { | |
if (this.animalStaminaTag && this.AnimalsTeethNameTxt != "") { | |
if (this.leftEvent.apt.aptDate || this.bookALLCheck) { | |
this.leftHenValidation.emit({ "isValid": true }); | |
} else { | |
this.leftHenValidation.emit({ "isValid": false }); | |
} | |
} else { | |
if (this.leftEvent.apt.aptDate && this.isanimalsPolicedNat && this.AnimalsTeethNameTxt != "") { | |
this.leftHenValidation.emit({ "isValid": true }); | |
} | |
else { | |
this.leftHenValidation.emit({ "isValid": false }); | |
} | |
} | |
} | |
} | |
checkLeftHenValidation(): any { | |
if (!this.isanimalsPolice && this.AnimalsTeethNameTxt != "" && this.leftEvent.apt.aptDate) { | |
return true; | |
} | |
else { | |
return false; | |
} | |
} | |
getNumberofDays2(animalsBirthDaystr, animalsDeathDaystr): any { | |
let oneDay = 24 * 60 * 60 * 1000; // hours*minutes*seconds*milliseconds | |
let firstDate = new Date(animalsBirthDaystr); | |
let secondDate = new Date(animalsDeathDaystr); | |
let diffDays = Math.round(Math.abs((firstDate.getTime() - secondDate.getTime()) / (oneDay))); | |
diffDays = diffDays + 1; | |
return diffDays; | |
} | |
setPlanLevelHeight() { | |
let viewHolderHeight = $('.toggleEventViewContent:not(.toggleShow)').outerHeight(); | |
let splitterHeight = $('.crowTigeranimalsJetHolder').outerHeight(); | |
let planLevelHeight = splitterHeight - viewHolderHeight ; | |
$('.planLevelHolder').css({"max-height": planLevelHeight+"px"}); | |
} | |
pickerTimeChnage(timePickerId){ | |
let tempTimeCheck = $(timePickerId).val().split(":"); | |
if ((tempTimeCheck.length > 0) && (tempTimeCheck.length == 3)) { | |
if (tempTimeCheck[2].indexOf('AM') != -1 || tempTimeCheck[2].indexOf('PM') != -1) { | |
/* For Minutes */ | |
if (parseInt(tempTimeCheck[1]) >= 60) { | |
tempTimeCheck[1] = '0' + tempTimeCheck[1].charAt(0); | |
$(timePickerId).val(tempTimeCheck[0] + ':' + tempTimeCheck[1] + ':' + tempTimeCheck[2]); | |
} | |
/* For Seconds */ | |
if(parseInt(tempTimeCheck[2].substring(0, 2)) >= 60){ | |
tempTimeCheck[2] = tempTimeCheck[2].substring(2); | |
$(timePickerId).val(tempTimeCheck[0] + ':' + tempTimeCheck[1] + ':' + tempTimeCheck[2]); | |
} | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment