//javascript Global Variables Declaration-Start// //Added By : Swapan Mohan //Purpose : Task #125 3.5x Issues var IsDocumentInNewMode; var ActionSignedByAuthor = false; var PreviousDocumentId; var PreviousScreenId; var NextDocumentId; var NextScreenId; var DocumentId; var DocumentStatus; var DocumentStatusId; var DocumentVersion; var DocumentLatestVersion; var AuthorId; var AuthorName = ""; var LoggedInUserId; var SignedByAuthor; var IsDirty = false; //To varify document save operation has performed or not before any other operation. var WorkingMode = "new"; //new=Creating new document,update=updating existing document. var RequiresSignature = ""; var ProxyId = 0; var ActionSignOrComplete = false; //Set varible ActionSignOrComplete=true when sign/complete button click. var DocumentShare; var DocumentToSign; var AuthorChanged = 'N'; var DocumentMode = 'edit'; //edit = Document will open for update, view = document will open in view mode i.e. RDL will open var DocumentType = ''; var DocumentVersionId = -1; var PageTitle = ""; var LoggedInUserName = ""; var EffectiveDate = ""; var DocumentNavigationName = ""; var DocumentNavigationId = 0; var SignerID = 0 var SignerType = ''; var SignatureId = 0; var SignerName = ''; var DocumentContainerDirty = "False"; //To varify document save operation has performed or not before any other operation. var ServiceId = 0; var IsServiceNote = false; var KeyFieldId = 0; var KeyFieldValue = 0; var KeyScreenId = 0; var NoteType = 0; var RegenratePdf = ''; //Modified by Sweety kamboj on 30April,2010 var IsDocumentExistInProxyTracking = ""; var XMLString = ""; var newAuhorId = 0; var newAuthorName = ""; //Added By priya var newAuhorType = ""; //End var associatedNoteScreenId = 0; var SignerIds = ''; var SignedPersonIds = ''; var OpenEMCodingPopup = false; var CallBackAction = ''; //var _ScreenType = '11827' //for documents in database //Javascript Global Variables Declaration-End var Span_DocumentInformation_AcknowledgementComments = null; //Global Objects declaration for document controller elements-Start. var ButtonNew = null; var ButtonUpdate = null; var ButtonValidate = null; //Added By Jagdeep Hundal Ref:task No:4 in THRESHOLDSOFF2. To Add 'Validate' button to the toolbar var ButtonDelete = null; var Span_DocumentInformation_PreviousDocumentDate = null; var Span_DocumentInformation_PreviousDocumentSeprator = null; var Span_DocumentInformation_PreviousDocumentName = null; var Button_DocumentInformation_PreviousDocument = null; var Button_DocumentInformation_NextDocument = null; var Span_DocumentInformation_NextDocumentDate = null; var Span_DocumentInformation_NextDocumentSeprator = null; var Span_DocumentInformation_NextDocumentName = null; var Span_DocumentInformation_GoToDocumentList = null; var Button_DocumentInformation_Sign = null; var Button_DocumentInformation_ToSign = null; var Button_DocumentInformation_Complete = null; var Button_DocumentInformation_View = null; var Button_DocumentInformation_ShareDocument = null; var Span_DocumentInformation_Status = null; var TextBox_DocumentInformation_EffectiveDate = null; var img_DocumentInformation_EffectiveDate = null; var Span_DocumentInformation_AuthorList = null; var Span_DocumentInformation_AuthorName = null; var DropDownList_DocumentInformation_AuthorList = null; var img_DocumentInformation_Author = null; var Button_DocumentInformation_ShowSignature = null; var Table_DocumentInformation_Signature = null; var Span_DocumentInformation_VersionList = null; var Div_DocumentInformation_SignedBy = null; var DropDownList_DocumentInformation_SignerList = null; var Button_DocumentInformation_Signer = null; var Button_DocumentInformation_Decline = null; var Span_DocumentInformation_SignerList = null; var Span_DocumentInformation_AcknowledgementComments = null; //Global Objects declaration for document controller elements-Start. //Image Document variables var ImageDocumentIndex = null; var ImageDocumentCount = null; var ImageDocumentSource = null; var Button_ImageDocument_PreviousDocument = null; var Button_ImageDocument_NextDocument = null; var Span_ImageDocument_PagingInformation = null; var Span_ImageDocument_ErrorMessage = null; var ConfirmationMessageCaption = 'Confirmation Message'; var _AssociatedScreenTabUcPath = null; //Created By Mahesh var Radtabobject = null; //Global Objects declaration for Image document container element-End var documentAction = ''; //Added by Loveena in ref to CM/PA Unsave Changes var _SaveDocumentCallBackFunction = ""; var _documentNavigationName = ""; var _screenAssociatedScreenId = null; var ClientLifeEventId = null; //Added By Daman ref: task#117 DocumentsAcknowledgement var EnableDocumentsAcknowledgementsTools = "false"; var XmlDoc; //Added By Sonia Ref #116 //Next and Previous Associated Screen Id's must be set //Along with other information of previous and Next Documents var NextScreenAssociatedScreenId = null; var PreviousScreenAssociatedScreenId = null; //Changes end here //Added by Shifali in ref to task# 11 - To Be Reviewed(Harbor Development) var DocumentAuthorId = ''; var DocumentCodeId = ''; var ReviewerId = ''; var Button_DocumentInformation_MetaData = null; var ReviewerName = ''; //Author Action Save For To Be Reviwed var AuthorActionSign_ToBeReviewedStatus = false; var CurrentVersionStatusId = ""; var CurrentVersionStatusName = ""; var InProgressDocumentVersionId = 0; //Changes ends here //Added By Jagdeep Hundal Ref:task No:4 in THRESHOLDSOFF2. To Add 'Validate' button to the toolbar var ActionValidateDocumentPageData = false; //Set varible ActionValidateDocumentPageData=true when Validate button click. var IsLatestVersionSelected = true; var openedDocumentVersionId = -1; //Added by sourabh to reatin ifrmaeId var iFrameId; //end here // Added by Karan Garg // Ref task #12 Threshold Dev. Phase II // Purpose : To store the Usercode of the clinician who has currently locked the document var lockedbyUserName = ''; var MultipleCredentials = ''; var StaffCredentialString = ''; var Credentialdelimeter = '*'; var pagefrom = ''; // Added by Shifali // Ref task #14 Threshold Dev. Phase III // Purpose : To pass the Signer Type to diagnose if Client/Staff/Other user signed the document (As we need to update pdf in DB when SignerType = 'C') var SignatureType = ''; //Changes by Shifali Ends here // Added By Shifali // Purpose : To disable the "Shared" checkbox when SystemConfigurations.ShareDocumentOnSave = 'Y' else leave it as its working // Dated : 3Sept2012 // Ref task #1825 Thresholds - Bugs/Features (Offshore) var ShareDocumentOnSave = ''; //Ends here //Author - Sanjay Bhardwaj //Merged from 2.x to 3.5xMerge //Purpose - With Ref. to Task#259 SC Web Phase II - Bugs/Features Document Version Views: Refresh repository PDF var RefreshDocumentViewsFlag = ''; var ShowInViewMode = false; var ServiveNoteTabLoadInitiated = false; var editClick = false; var VersionAuthorToSign = ""; var CallSetScreenSpecificValues = false; var checkAllowEditingByNonAuthors = null; //Task#259 function ManageDocumentToolbarItems() { ShowToolbarItems('Save'); ShowToolbarItems('New'); ShowToolbarItems('Close'); ShowToolbarItems('Delete'); ShowToolbarItems('Move'); ShowToolbarItems('Help'); ShowToolbarItems('Upload File'); ShowToolbarItems('Validate'); HideToolbarItems('CopyService'); //Added by Akwinass(21-JULY-2014) with ref to task #3 in System Improvements project HideToolbarItems('ScheduleFollowup'); HideToolbarItems('NumberOfTimesRescheduled'); ShowToolbarItems('FavoritePhrases'); ShowToolbarItems('AddPhrases'); HideToolbarItems('ServiceDetail'); HideToolbarItems("OpenPopUpUseNote"); HideToolbarItems('OrginalDocument'); // Code Added By Karan ***** // Purpose : Show hide the KeyPhrases icon on basis of pageresponse // Dated : 24 Nov 2011 if (objectPageResponse.UseKeyPhrases) { ShowToolbarItems('AddPhrases'); ShowToolbarItems('FavoritePhrases'); } else { HideToolbarItems('AddPhrases'); HideToolbarItems('FavoritePhrases'); } //Added By Rahul Aneja for Help URL functionality if (objectPageResponse.HelpURL != null && objectPageResponse.HelpURL != "") { ShowToolbarItems('HelpURL'); // ShowToolbarItems('FavoritePhrases'); } else { HideToolbarItems('HelpURL'); // HideToolbarItems('FavoritePhrases'); } HideToolbarItems('Lock'); HideToolbarItems('UnLock'); var MCG = $('[id$=HiddenFieldThirdPartyAuthForDocument]').val(); if (MCG == "Y") { ShowToolbarItems('MCG'); } else { HideToolbarItems('MCG'); } if (objectPageResponse.ObjectDocumentInformation != null) { var metaDataId = $('[id$=HiddenFieldMetaDataId]').val(); if (objectPageResponse.ObjectDocumentInformation.DocumentId == 0 || parseInt(metaDataId) == 0) { HideToolbarItems("MetaData"); // var ctrlMetadata = $('#Button_DocumentInformation_MetaData'); // if (ctrlMetadata.length > 0) { // ctrlMetadata.hide(); // } } else { // var ctrlMetadata = $('#Button_DocumentInformation_MetaData'); // if (ctrlMetadata.length > 0) { if (parseInt(metaDataId) > 0) { //ctrlMetadata.show(); ShowToolbarItems('MetaData'); } else { HideToolbarItems("MetaData"); } // } } } if (typeof ManageToolbarItems == 'function') { ManageToolbarItems(); } //Adde by Rahul Aneja ref Task#2125 in Threshold Bugs And Features On 18-Oct -2012, Why : after complete service note Service Details Icon get Hide ,To show that add this code if (objectPageResponse.ObjectDocumentInformation != null && objectPageResponse.ObjectDocumentInformation.NoteType == '-1') { ShowToolbarItems('ServiceDetail'); ShowToolbarItems("OpenPopUpUseNote"); if ($('input[id$=hiddenClinicalSummaryEnable]').val() == "Y") ShowToolbarItems('PrintCLinicalSummary'); } if ($('input[id$=hiddenAmendmentRequestEnable]').val() == "Y") { ShowToolbarItems('PrintAmendmentRequests'); } if (objectPageResponse.ObjectDocumentInformation != null && objectPageResponse.ObjectDocumentInformation.DocumentCodeId == '300' && $('input[id$=hiddenClinicalSummaryEnable]').val() == "Y") { ShowToolbarItems('PrintCLinicalSummary'); } // Function to show/hide Authorship tool if (objectPageResponse.Action != pageActionEnum.CustomAjaxCall) { DocumentAuthorShipTool(); } if ($('[id$=hiddenFavouritesToolBar]').length > 0 && $('[id$=hiddenFieldCurrentScreenId]').length > 0) { if ($('[id$=hiddenFieldCurrentScreenId]').val() && $('[id$=hiddenFavouritesToolBar]').val()) { if ($('[id$=hiddenFavouritesToolBar]').val().indexOf("," + $('[id$=hiddenFieldCurrentScreenId]').val() + ",") > -1) { ShowToolbarItems('NewFavourites'); ShowToolbarItems('ApplyFavourites'); } else { HideToolbarItems("NewFavourites"); HideToolbarItems("ApplyFavourites"); } } } if (objectPageResponse.ObjectDocumentInformation != null && objectPageResponse.ObjectDocumentInformation.DocumentCodeId == '1506') { ShowToolbarItems('DownloadRequisition'); } } /**************************************************************************************/ //Author - Devinder Pal Singh //Purpose This function is used to populate documentcontroller information. //Jquery document's ready function to initialize the page.- Start //Author Devinder Pal Singh //This function will be resize the contents in document container function ResizeDocuments() { var hiddenContainerControlToResize = $('input[id$=hiddenContainerControlToResize]'); var ContainerControlToResize = hiddenContainerControlToResize.val(); if (hiddenContainerControlToResize.val() == "") { ContainerControlToResize = "DivShowDetailHTML"; } ResizeContainer(ContainerControlToResize); } function OpenAmendmentRequest() { if ($('input[id$=hiddenAmendmentRequestEnable]').val() == "Y") { window.open(GetRelativePath() + "ShowReport.aspx?FunctionName=LoadRdlAmendmentRequest&DocumentCodeId=" + objectPageResponse.ObjectDocumentInformation.DocumentCodeId + "&ClientId=" + objectPageResponse.ClientId, "", "Height=695,Width=1024,left=0,top=0"); } } function DocumentAuthorShipTool() { if (objectPageResponse.ObjectDocumentInformation) { if (objectPageResponse.ObjectDocumentInformation.AllowEditingByNonAuthors && objectPageResponse.ObjectDocumentInformation.DocumentStatusId != 22 && objectPageResponse.ObjectDocumentInformation.CurrentVersionStatusId != 22 && $('input[id$=Button_DocumentInformation_View]').attr("mode") == "edit" && objectPageResponse.ObjectDocumentInformation.AuthorId != objectPageResponse.ObjectDocumentInformation.LoggedInUserId) { $('#BtnAuthorship').attr('disabled', false); } else { $('#BtnAuthorship').attr('disabled', true); } } } //Jquery document's ready function to initialize the page.-End function SetDocumentNextPreviousInformation(ObjectDocumentInformation) { //EI#564 - Implement Verbose Mode Logging in SmartCare Application EventTrap("Documents", "SetDocumentNextPreviousInformation", ""); //Set Next Prevoius Document Information var previousDocumentName = jQuery.trim(ObjectDocumentInformation.PreviousDocumentName); if (previousDocumentName != "") { // Old_Pattern Span_DocumentInformation_PreviousDocumentSeprator.html("|"); // New Pattern Date | Document name should be changed to Date – Document Name (date + space(1) + ‘-‘ + space(1) + DocumentName) // Commented on March 31,2010 MKS Span_DocumentInformation_PreviousDocumentSeprator.html(" - "); //( - )Removed   and padding in left and right TD of navigation contols if (previousDocumentName.length > 17) { Span_DocumentInformation_PreviousDocumentDate.html(ObjectDocumentInformation.PreviousDocumentEffectiveDate) Span_DocumentInformation_PreviousDocumentName.html(previousDocumentName.substring(0, 13) + "..."); Span_DocumentInformation_PreviousDocumentName.attr("title", previousDocumentName); } else { Span_DocumentInformation_PreviousDocumentDate.html(ObjectDocumentInformation.PreviousDocumentEffectiveDate) Span_DocumentInformation_PreviousDocumentName.html(previousDocumentName); Span_DocumentInformation_PreviousDocumentName.attr("title", ""); } } else { Span_DocumentInformation_PreviousDocumentName.html(""); Span_DocumentInformation_PreviousDocumentDate.html(""); Span_DocumentInformation_PreviousDocumentSeprator.html(""); } var nextDocumentName = jQuery.trim(ObjectDocumentInformation.NextDocumentName); if (nextDocumentName != "") { // Old_Pattern Span_DocumentInformation_NextDocumentSeprator.html("|"); // New Pattern Date | Document name should be changed to Date – Document Name (date + space(1) + ‘-‘ + space(1) + DocumentName) // Commented on March 31,2010 MKS Span_DocumentInformation_NextDocumentSeprator.html(" - "); //( - )Removed   and padding in left and right TD of navigation contols if (nextDocumentName.length > 17) { Span_DocumentInformation_NextDocumentDate.html(ObjectDocumentInformation.NextDocumentEffectiveDate) Span_DocumentInformation_NextDocumentName.html(nextDocumentName.substring(0, 13) + "..."); Span_DocumentInformation_NextDocumentName.attr("title", nextDocumentName); } else { Span_DocumentInformation_NextDocumentDate.html(ObjectDocumentInformation.NextDocumentEffectiveDate) Span_DocumentInformation_NextDocumentName.html(nextDocumentName); Span_DocumentInformation_NextDocumentName.attr("title", ""); } } else { Span_DocumentInformation_NextDocumentName.html(""); Span_DocumentInformation_NextDocumentDate.html(""); Span_DocumentInformation_NextDocumentSeprator.html(""); } PreviousDocumentId = ObjectDocumentInformation.PreviousDocumentId; PreviousScreenId = ObjectDocumentInformation.PreviousScreenId; NextDocumentId = ObjectDocumentInformation.NextDocumentId; NextScreenId = ObjectDocumentInformation.NextScreenId; //Ref 116 PreviousScreenAssociatedScreenId = ObjectDocumentInformation.PreviousScreenAssociatedScreenId; NextScreenAssociatedScreenId = ObjectDocumentInformation.NextScreenAssociatedScreenId; //Changes end here if (parseInt(objectPageResponse.ObjectDocumentInformation.DocumentType) == 17) { if (PreviousScreenId == "") PreviousScreenId = "102"; if (NextScreenId == "") NextScreenId = "102"; if (!PreviousScreenAssociatedScreenId > 0) PreviousScreenAssociatedScreenId = CurrentScreenId; if (!NextScreenAssociatedScreenId > 0) NextScreenAssociatedScreenId = CurrentScreenId; } if (Button_DocumentInformation_PreviousDocument.length > 0) { //Enable/Disable Next/Prev Document buttons-Start if (ObjectDocumentInformation.PreviousDocumentId == "0") { Button_DocumentInformation_PreviousDocument[0].className = "previousbuttondisable"; } else { Button_DocumentInformation_PreviousDocument[0].className = "previousbuttonenable"; } } if (Button_DocumentInformation_NextDocument.length > 0) { if (ObjectDocumentInformation.NextDocumentId == "0") { Button_DocumentInformation_NextDocument[0].className = "nextbuttondisable"; } else { Button_DocumentInformation_NextDocument[0].className = "nextbuttonenable"; } } //Enable/Disable Next/Prev Document buttons-End } //Commented By Devender Kumar 09-05-2011 To Show The Meta Data in The Popup On Clcik on View Detail Button function ShowMetadata() { var screenId = GetCurrentScreenID(); OpenPage(5761, 174, 'screenId=' + screenId, 2, GetRelativePath(), "T", "dialogHeight:400px; dialogWidth: 850px;dialogTitle:Metadata"); } function SetGoToDocumentInformation(ObjectDocumentInformation) { if (ObjectDocumentInformation.DocumentNavigationHtml == "") { Span_DocumentInformation_GoToDocumentList.html(""); $("#category2").mcDropdown("#categorymenu"); var dd = $("#category2").mcDropdown("#categorymenu"); //Added with ref to ticket _documentNavigationName = ObjectDocumentInformation.DocumentNavigationName; //changes end here if (dd.length > 0) { dd.setText(ObjectDocumentInformation.DocumentNavigationName); } } else { Span_DocumentInformation_GoToDocumentList.html("" + ObjectDocumentInformation.DocumentNavigationHtml); $("#category").mcDropdown("#categorymenu"); var dd = $("#category").mcDropdown("#categorymenu"); //Added with ref to ticket _documentNavigationName = ObjectDocumentInformation.DocumentNavigationName; //changes end here if (dd.length > 0) { dd.setText(ObjectDocumentInformation.DocumentNavigationName); } } } function SetDocumentGlobalVaribales(ObjectDocumentInformation) { /*Modified By Sumanta- No need to Update History Node inside Framed(Custom) Pages*/ var newFilterString = ""; //Added By : Shifali on 7Jan2013 (Ref task# 2471 (Thresholds Bugs/Features) // What: History node xml should not be updated if document/service note/event is not saved yet. //Why : Because when we do new/copy service/document/event etc. then, we do not create history point, so we should not update the history node as wellby fn 'UpdateScreenHistoryNode' var primaryKey = ''; if (ObjectDocumentInformation.NoteType == 0) { newFilterString = "DocumentNavigationName=" + ObjectDocumentInformation.DocumentNavigationName + "^clientId=" + objectPageResponse.ClientId + "^clientName=" + objectPageResponse.ClientName + "^DocumentId=" + ObjectDocumentInformation.DocumentId; primaryKey = ObjectDocumentInformation.DocumentId; } else if (ObjectDocumentInformation.NoteType == -1) { newFilterString = "IsServiceNote=true^TabId=2^serviceId=" + ObjectDocumentInformation.KeyFieldValue + "^documentId=" + ObjectDocumentInformation.DocumentId + "^keyscreenid=29^^keyfieldvalue=" + ObjectDocumentInformation.KeyFieldValue + "^DocumentNavigationId=" + ObjectDocumentInformation.DocumentNavigationId + "^DocumentNavigationName=" + ObjectDocumentInformation.DocumentNavigationName + "^clientId=" + objectPageResponse.ClientId + "^clientName=" + objectPageResponse.ClientName; primaryKey = ObjectDocumentInformation.KeyFieldValue; } else if (ObjectDocumentInformation.NoteType == -2) { newFilterString = "IsServiceNote=true^TabId=2^EventId=" + ObjectDocumentInformation.KeyFieldValue + "^documentId=" + ObjectDocumentInformation.DocumentId + "^keyscreenid=29^keyfieldvalue=" + ObjectDocumentInformation.KeyFieldValue + "^DocumentNavigationId=" + ObjectDocumentInformation.DocumentNavigationId + "^DocumentNavigationName=" + ObjectDocumentInformation.DocumentNavigationName + "^clientId=" + objectPageResponse.ClientId + "^clientName=" + objectPageResponse.ClientName; primaryKey = ObjectDocumentInformation.KeyFieldValue; } //If condition Added By : Shifali on 7Jan2013 (Ref task# 2471 (Thresholds Bugs/Features) // What: History node xml should not be updated if document/service note/event is not saved yet. //Why : Because when we do new/copy service/document/event etc. then, we do not create history point, so we should not update the history node as wellby fn 'UpdateScreenHistoryNode' if (primaryKey != '' && parseInt(primaryKey) > 0) { UpdateScreenHistoryNode(CurrentHistoryId, CurrentScreenId, "FiltersData", newFilterString); //Added by jagdeep //What:To clear screen action when document is allready saved. //Why: When saving a new document screen action remained new . UpdateScreenHistoryNode(CurrentHistoryId, CurrentScreenId, "ScreenAction", ""); } DocumentId = ObjectDocumentInformation.DocumentId; DocumentStatus = ObjectDocumentInformation.DocumentStatus; DocumentVersion = ObjectDocumentInformation.DocumentVersion; AuthorId = ObjectDocumentInformation.AuthorId; LoggedInUserId = ObjectDocumentInformation.LoggedInUserId; LoggedInUserName = ObjectDocumentInformation.LoggedInUserName; EffectiveDate = ObjectDocumentInformation.DocumentEffectiveDate; SignedByAuthor = ObjectDocumentInformation.SignedByAuthor; DocumentStatusId = ObjectDocumentInformation.DocumentStatusId; DocumentLatestVersion = ObjectDocumentInformation.DocumentLatestVersion; ProxyId = ObjectDocumentInformation.ProxyId; DocumentVersionId = ObjectDocumentInformation.DocumentVersionId; AuthorName = ObjectDocumentInformation.Author; DocumentNavigationName = ObjectDocumentInformation.DocumentNavigationName; DocumentNavigationId = ObjectDocumentInformation.DocumentNavigationId; DocumentShare = ObjectDocumentInformation.DocumentShare.toUpperCase(); DocumentToSign = ObjectDocumentInformation.ToSign; RequiresSignature = ObjectDocumentInformation.RequiresSignature; ServiceId = ObjectDocumentInformation.ServiceId; IsServiceNote = ObjectDocumentInformation.IsServiceNote; KeyFieldId = ObjectDocumentInformation.KeyFieldId; KeyFieldValue = ObjectDocumentInformation.KeyFieldValue; KeyScreenId = ObjectDocumentInformation.KeyScreenId; NoteType = ObjectDocumentInformation.NoteType; associatedNoteScreenId = ObjectDocumentInformation.AssociatedNoteScreenId; //MOdified by Sweety Kamboj // alert('setinfo'+ObjectDocumentInformation.IsDocumentExistInProxyTracking); IsDocumentExistInProxyTracking = ObjectDocumentInformation.IsDocumentExistInProxyTracking; newAuhorId = ObjectDocumentInformation.AuthorId; newAuthorName = ObjectDocumentInformation.Author; SignerIds = ObjectDocumentInformation.SignerIds; SignedPersonIds = ObjectDocumentInformation.SignedPersonIds; DocumentType = ObjectDocumentInformation.DocumentType; //added by Shifali in ref to task# 11(To Be Reviewed) ReviewerId = ObjectDocumentInformation.ReviewerId; ReviewerName = ObjectDocumentInformation.ReviewerName; CurrentVersionStatusId = ObjectDocumentInformation.CurrentVersionStatusId; CurrentVersionStatusName = ObjectDocumentInformation.CurrentVersionStatusName; InProgressDocumentVersionId = ObjectDocumentInformation.InProgressDocumentVersionId; //Changes ends here //added by shifali in ref to task# 11(TO be Reviewed Document Status) //purpose - DocumentAuthorId,DocumentCodeId vars set as we need it when user is signing/adding the reviewer for document DocumentAuthorId = objectPageResponse.ObjectDocumentInformation.AuthorId; DocumentCodeId = objectPageResponse.ObjectDocumentInformation.DocumentCodeId; // Added By Karan // Purpose : To check wether a document code has multiple credentials // Dated : 01/feb/2012 // Ref task #24 Threshold Dev Phase II MultipleCredentials = objectPageResponse.ObjectDocumentInformation.MultipleCredentials; // Added By Shifali // Purpose : To disable the "Shared" checkbox when SystemConfigurations.ShareDocumentOnSave = 'Y' else leave it as its working // Dated : 3Sept2012 // Ref task #1825 Thresholds - Bugs/Features (Offshore) ShareDocumentOnSave = objectPageResponse.ObjectDocumentInformation.ShareDocumentOnSave; VersionAuthorToSign = ObjectDocumentInformation.VersionAuthorToSign; // Added By Sachin checkAllowEditingByNonAuthors = ObjectDocumentInformation.AllowEditingByNonAuthors; } function SetDocumentPermission(ObjectDocumentInformation) { var IsMoveButton = ObjectDocumentInformation.IsMoveButton; if (IsMoveButton == '0') { //$("#ImgButtonMove").hide(); HideToolbarItems("Move"); } else { //var ImgButtonMove = $("#ImgButtonMove"); //ImgButtonMove.show(); //ImgButtonMove.attr("disabled", ""); EnableToolbarItem("Move"); ShowToolbarItems("Move"); } } function CreateNewGoToDocumentDropDown(CreateDropDownNewHTML) { var $spanGoToDocument = $('#span_GoToDocumentNewList'); if ($spanGoToDocument.length > 0) { if (GetCurrentScreenID() == 29) { $spanGoToDocument.hide(); return false; } if (GetCurrentScreenID() == 32) { $spanGoToDocument.hide(); return false; } $spanGoToDocument.show(); if (CreateDropDownNewHTML == '') { return false; } GoToDocumentNewList = CreateDropDownNewHTML; $spanGoToDocument.html(CreateDropDownNewHTML); var objectGoToDropDown1; if ($("#category1").length == 0) { $("#category2").mcDropdown("#categorymenu"); objectGoToDropDown1 = $("#category2").mcDropdown("#categorymenu"); objectGoToDropDown1.setText("Create Document..."); } else { $("#category1").mcDropdown("#categorymenu"); objectGoToDropDown1 = $("#category1").mcDropdown("#categorymenu"); objectGoToDropDown1.setText("Create Document..."); } } } function SetTextNewGoToDocumentDropDown() { var objectGoToDropDown1; $('#span_GoToDocumentNewList').html(GoToDocumentNewList); if ($("#category1").length == 0) { $("#category2").mcDropdown("#categorymenu"); objectGoToDropDown1 = $("#category2").mcDropdown("#categorymenu"); objectGoToDropDown1.setText("Create Document..."); } else { $("#category1").mcDropdown("#categorymenu"); objectGoToDropDown1 = $("#category1").mcDropdown("#categorymenu"); objectGoToDropDown1.setText("Create Document..."); } } /************************************************************************************** //Author - Vikas Monga //Purpose This function is used to populate documentcontroller information. //Modification Details : 1) Modify by Purpose : Mahesh Disabled SendButton except when documentstatusID is 22 */ function SetDocumentInformation(ObjectDocumentInformation) { //EI#564 - Implement Verbose Mode Logging in SmartCare Application EventTrap("Documents", "SetDocumentInformation", ""); $("td[toolbaritem=Print] img").attr("disabled", "disabled"); //ref task# 11(Documents.Status == To Be Reviwed) //if (ObjectDocumentInformation.DocumentStatusId == 0 && ObjectDocumentInformation.DocumentId == 0) { if (ObjectDocumentInformation.CurrentVersionStatusId == 0 && ObjectDocumentInformation.DocumentId == 0) { //$('#ButtonUpload')[0].disabled = false; } else { //$('#ButtonUpload')[0].disabled = true; } //Below if condition added by Rakesh w.r.f to task 265 Supervisor mode:- Create Document Drop Down. if (!objectPageResponse.SupervisorMode) CreateNewGoToDocumentDropDown(ObjectDocumentInformation.CreateDropDownNewHTML); ReSetDocumentFrameworkControls(); SetDocumentPermission(ObjectDocumentInformation); SetDocumentGlobalVaribales(ObjectDocumentInformation); SetDocumentNextPreviousInformation(ObjectDocumentInformation); SetGoToDocumentInformation(ObjectDocumentInformation); //ref task# 11(Documents.Status == To Be Reviwed) //Span_DocumentInformation_Status.html(ObjectDocumentInformation.DocumentStatus); Span_DocumentInformation_Status.html(ObjectDocumentInformation.CurrentVersionStatusName); Span_DocumentInformation_VersionList.html(ObjectDocumentInformation.VersionList); //Populate VersionList Div_DocumentInformation_SignedBy.html(ObjectDocumentInformation.SignedBy); Span_DocumentInformation_SignerList.html(ObjectDocumentInformation.SignerList); //Populate SignerList Span_DocumentInformation_AcknowledgementComments.html(ObjectDocumentInformation.AcknowledgementCommentsList); TextBox_DocumentInformation_EffectiveDate.val(ObjectDocumentInformation.DocumentEffectiveDate); //Show author List //ref task# 11(Documents.Status == To Be Reviwed) // if (ObjectDocumentInformation.DocumentStatusId != 22 && ObjectDocumentInformation.DocumentStatusId != 20) { if (ObjectDocumentInformation.CurrentVersionStatusId != 22 && ObjectDocumentInformation.CurrentVersionStatusId != 20) { Span_DocumentInformation_AuthorList.html(ObjectDocumentInformation.AuthorList); //Populate AuthorList $('select[id$=DropDownList_DocumentInformation_AuthorList]').val(ObjectDocumentInformation.AuthorId); //Select Document Author // comment belwo line by Rahul Aneja on 11Mar13 to make browser generic // img_DocumentInformation_Author.css("display", "none"); // Span_DocumentInformation_AuthorName.css("display", "none"); // Span_DocumentInformation_AuthorList.css("display", "block"); img_DocumentInformation_Author.hide(); Span_DocumentInformation_AuthorName.hide(); Span_DocumentInformation_AuthorList.show(); } //ref task# 11(Documents.Status == To Be Reviwed) //if (ObjectDocumentInformation.DocumentStatusId == 20) { if (ObjectDocumentInformation.CurrentVersionStatusId == 20) { Span_DocumentInformation_AuthorName.html(" " + ObjectDocumentInformation.AuthorList); //Populate AuthorList // comment belwo line by Rahul Aneja on 11Mar13 to make browser generic // img_DocumentInformation_Author.css("display", "block"); // Span_DocumentInformation_AuthorList.css("display", "none"); // Span_DocumentInformation_AuthorName.css("display", "block"); img_DocumentInformation_Author.show(); Span_DocumentInformation_AuthorList.hide(); Span_DocumentInformation_AuthorName.show(); } //Show author name //ref task# 11(Documents.Status == To Be Reviwed) // if (ObjectDocumentInformation.DocumentStatusId == 22) { if (ObjectDocumentInformation.CurrentVersionStatusId == 22) { Span_DocumentInformation_AuthorName.html(" " + ObjectDocumentInformation.AuthorList); //Populate AuthorList // comment belwo line by Rahul Aneja on 11Mar13 to make browser generic // img_DocumentInformation_Author.css("display", "block"); // Span_DocumentInformation_AuthorList.css("display", "none"); // Span_DocumentInformation_AuthorName.css("display", "block"); img_DocumentInformation_Author.show(); Span_DocumentInformation_AuthorList.hide(); Span_DocumentInformation_AuthorName.show(); //commented by Shifali on 7Nov2011 in ref to task# 11 //purpose - as per SHS team, Send button will be enabled when DocumentShare = 'y' // if ($('#ButtonSend').length > 0) { // $('#ButtonSend').removeAttr("disabled"); //Enable the send button if document is signed // } // HideToolbarItems("Help"); } //Open New S.note fom calender. if (ObjectDocumentInformation.ClinicianId > 0 && ObjectDocumentInformation.KeyScreenId == 29) { Span_DocumentInformation_AuthorName.html(" " + ObjectDocumentInformation.ClinicianName); // comment belwo line by Rahul Aneja on 11Mar13 to make browser generic // img_DocumentInformation_Author.css("display", "block"); //Span_DocumentInformation_AuthorList.css("display", "none"); //Span_DocumentInformation_AuthorName.css("display", "block"); img_DocumentInformation_Author.show(); Span_DocumentInformation_AuthorList.hide(); Span_DocumentInformation_AuthorName.show(); } // AddCheck ObjectDocumentInformation.CurrentVersionStatusId != 22 w.rf to task Javed mail Send button on Documents and Ref to task 182 in 3.5x Issues if ($('#ButtonSend').length > 0 && ObjectDocumentInformation.CurrentVersionStatusId != 22) { $('#ButtonSend').attr("disabled", "true"); //Set the disable prop to button if document status id is not 22 Added by Mahesh S } //Checked/Unchecked Document share button-Start if (ObjectDocumentInformation.DocumentShare.toUpperCase() == "Y") { if ($('#Button_DocumentInformation_ShareDocument').length > 0) { $('#Button_DocumentInformation_ShareDocument')[0].className = "sharechecked_btn"; } //Added by Shifali on 7Nov2011 in ref to task# 11 //purpose - as per SHS team, Send button will be enabled when DocumentShare = 'y' if ($('#ButtonSend').length > 0) { $('#ButtonSend').removeAttr("disabled"); //Enable the send button if document is signed } //Changes by Shifali ends here } else { if ($('#Button_DocumentInformation_ShareDocument').length > 0) { $('#Button_DocumentInformation_ShareDocument')[0].className = "shareunchecked_btn"; } } if (ObjectDocumentInformation.DocumentType == documentTypeEnum.Image) { SetControllerStatus(ObjectDocumentInformation, 'ImageDocument'); return; } if (ObjectDocumentInformation.DocumentType == documentTypeEnum.View) { SetControllerStatus(ObjectDocumentInformation, 'ViewDocument'); return; } /* Philhaven Development task no 233*/ /* Added by Anto to show hide the documentcomments tool icon based on hidden field values*/ if ($("input[id$=hidden_ShowDocumentVersionComments]").val() == 'true') { if (ObjectDocumentInformation.DocumentStatus == "Signed" && ObjectDocumentInformation.CurrentVersionStatusId != 22) { ShowToolbarItems('DocumentComments'); } else { HideToolbarItems('DocumentComments'); } } else { HideToolbarItems('DocumentComments'); } /* Ends Here Philhaven Development task no 233 */ /*Move if condition on top of scan document check to disable the error icon once document marked as error - Core Bugs, 4488*/ // debugger; if (ObjectDocumentInformation.DocumentStatusId != "22") { //Pranay HideToolbarItems("ToDisclosure"); document.getElementById('ErrorDoc').disabled = true; document.getElementById('ErrorDoc').className = "DisabledImageCrossBrowser"; if (ObjectDocumentInformation.DocumentStatusId == "26") { document.getElementById('Button_DocumentInformation_ShowSignature').disabled = true; document.getElementById('Button_DocumentInformation_ShowSignature').className = "less_detail_btn element DisabledButtonCrossBrowser"; document.getElementById('Button_DocumentInformation_View').disabled = true; document.getElementById('Button_DocumentInformation_View').className = "less_detail_btn element DisabledButtonCrossBrowser"; } } else { ShowToolbarItems("ToDisclosure"); document.getElementById('ErrorDoc').disabled = false; document.getElementById('ErrorDoc').classList.remove("DisabledImageCrossBrowser"); } if (ObjectDocumentInformation.DocumentType == documentTypeEnum.ScannedMedicalRecord) { SetControllerStatus(ObjectDocumentInformation, 'ScannedMedicalRecord'); //return; //Added following condition to allow sign of ScannedDocuments if (ObjectDocumentInformation.DocumentType == 17 && ObjectDocumentInformation.ReviewFormId > 0) { if (DocumentId > 0 || ObjectDocumentInformation.KeyFieldValue > 0) { //Set Controls state incase of update WorkingMode.-Start WorkingMode = "update"; //ButtonDelete.attr("disabled", ""); //Set Controls state incase of update WorkingMode.-End } } else { return; } //Ends } //ref task# 11(Documents.Status == To Be Reviwed) // if (ObjectDocumentInformation.DocumentStatusId == 20) { if (ObjectDocumentInformation.CurrentVersionStatusId == 20) { SetControllerStatus(ObjectDocumentInformation, 'ToDo'); if (ObjectDocumentInformation.NoteType != 0) { ShowToolbarItems('CopyService'); //Added by Akwinass(21-JULY-2014) with ref to task #3 in System Improvements project ShowToolbarItems('ScheduleFollowup'); ShowToolbarItems('NumberOfTimesRescheduled'); } //Function OpenURL called by Rakesh here with ref to task 542 in Sc web other billable. As when We open TODO document fron navigation if previously document was signed then in that case divShowHTMLDetail was none. So TODO document details not shown. //OpenURL(DocumentVersionId, false); //Added by Shifali on 21Nov2011 in ref task# 11 (Document Status - To Be Reviewed) //commented by Shifali on 18Jan2012 in ref to not open To-Do Documents in Edit Mode, To-Do Docs will open in View/RDL MOde. //OpenURL(InProgressDocumentVersionId, false); //ShowToolbarItems('CopyService'); checkClientViewingStatus(); //checkPrivateWindow(); //Added By Arjun K R Task #476.01- CEI Support Go Live //return;//commented : Task#1988 in Harbor Go Live } //ref task# 11(Documents.Status == To Be Reviwed) //if (ObjectDocumentInformation.DocumentStatusId == 23) { if (ObjectDocumentInformation.CurrentVersionStatusId == 23) { SetControllerStatus(ObjectDocumentInformation, 'Cancel'); checkClientViewingStatus(); //checkPrivateWindow(); //Added By Arjun K R Task #476.01- CEI Support Go Live } //Condition Added By Vikas Vyas in ref to Implement Service Note Architecture if (ObjectDocumentInformation.IsServiceNote == "true") { TextBox_DocumentInformation_EffectiveDate.attr("disabled", "true"); } else { TextBox_DocumentInformation_EffectiveDate.attr("disabled", false); } //Checked/Unchecked Document share button-End //Checked/Unchecked To Sign Checkbox-Start if (ObjectDocumentInformation.ToSign == "Y") { if ($('#Button_DocumentInformation_ToSign').length > 0) { $('#Button_DocumentInformation_ToSign')[0].className = "tosignchecked_btn"; } //Modified by : Sweety Kamboj on 28 April 2010 //To disable ToSign button for proxy users Button_DocumentInformation_ToSign.attr("disabled", "true"); } else { if ($('#Button_DocumentInformation_ToSign').length > 0) { $('#Button_DocumentInformation_ToSign')[0].className = "tosignunchecked_btn"; } } //Checked/Unchecked To Sign Checkbox-End //Hide or Show Signature box based on the "RequiresSignature" coulmn value.-Start if (ObjectDocumentInformation.RequiresSignature == "Y") { Button_DocumentInformation_Sign.show(); //Below If condition added by Rakesh for To do documents Signature controls are disabled. But EnableSignatureControls function makes it enabled if (CurrentVersionStatusId != "20") EnableSignatureControls(); Button_DocumentInformation_ShowSignature.show(); Button_DocumentInformation_Complete.hide(); //Modified by:Vikas Kashyap //Date:06 Nov 2012 //Discription: What:Added one more condition For proxy staff show To sign Button, w.r.t. Task#2103 Threshold Bugs/Features // Why:When Select Proxy user through Calander then show two button at a time(Tosign & Sign) if (LoggedInUserId == ProxyId) { Button_DocumentInformation_Sign.hide(); } } else { Button_DocumentInformation_Sign.hide(); Button_DocumentInformation_Complete.show(); } //Hide or Show Signature box based on the "RequiresSignature" coulmn value.-End //commented & modified by shifali in ref to task# 11(To Be Reviewed status) //Enable/Diable Sign button-Start // if (ObjectDocumentInformation.SignedByAuthor == "Y") { // //Disable the sign button if document already signer bu author // Button_DocumentInformation_Sign.attr("disabled", "true"); // } // else { // Button_DocumentInformation_Sign.attr("disabled", ""); // } if (CurrentVersionStatusId == "22" || CurrentVersionStatusId == "20" || CurrentVersionStatusId == "26") { //Disable the sign button if document already signer bu author Button_DocumentInformation_Sign.attr("disabled", "true"); } else { Button_DocumentInformation_Sign.attr("disabled", false); } if (ObjectDocumentInformation.MoreDetail == 'Y') { ToggleSignatureBox(); var objRadioSigner = $("input[name$=Radio_SignerList][SignerID=" + ObjectDocumentInformation.LoggedInUserId + "]"); if (objRadioSigner.length > 0 && CurrentVersionStatusId == "22") { objRadioSigner.attr("checked", true) } } try { // if (DocumentId <= 0) { // if (DocumentId <= 0 && ObjectDocumentInformation.ServiceId == 0) { if (DocumentId <= 0 && ObjectDocumentInformation.KeyFieldValue == 0) { //Added by Vikas Vyas //Set Controls state incase of new WorkingMode.-Start WorkingMode = "new"; Span_DocumentInformation_Status.html("New"); ButtonDelete.attr("disabled", "true"); Button_DocumentInformation_ShareDocument.addClass('disableunchecked_btn'); //Set Controls state incase of new WorkingMode.-End } else { //Set Controls state incase of update WorkingMode.-Start WorkingMode = "update"; ButtonDelete.attr("disabled", false); //Set Controls state incase of update WorkingMode.-End } if (WorkingMode == "new") { Button_DocumentInformation_View.attr("disabled", "true"); Button_DocumentInformation_View.val('View'); HideToolbarItems("Help"); } // Code Added by Karan// Condition for To do Document // Ref task #12 Threshold Dev Phase II // Dated 14 Dec 2011 else if (CurrentVersionStatusId == 20) { if (LoggedInUserId == AuthorId || ProxyId == LoggedInUserId) { } else { // Enable / Disable Button // Code Added by Karan // Purpose : Check from db to enable disable the edit button // Ref task #12 Threshold Dev Phase II if (ObjectDocumentInformation.PreventNewVersion == 0) Button_DocumentInformation_View.attr("disabled", "true"); else if (ObjectDocumentInformation.PreventNewVersion == 1) { // Below If condtion is added by Rakesh to disable Edit button in case of Supervisor mode is on Ref to task 939 in SCwebphaseII bugs/Features if (objectPageResponse.SupervisorMode) Button_DocumentInformation_View.attr("disabled", "true"); else Button_DocumentInformation_View.attr("disabled", false); } } // Code Added by Karan // Purpose : Check from db to enable disable the edit button // Ref task #12 Threshold Dev Phase II if (objectPageResponse.ObjectDocumentInformation != null && objectPageResponse.ObjectDocumentInformation.DocumentMode == 'view') { Button_DocumentInformation_View.attr("mode", "edit"); Button_DocumentInformation_View.val('Edit'); } else if (objectPageResponse.ObjectDocumentInformation != null && objectPageResponse.ObjectDocumentInformation.DocumentMode == 'edit') { Button_DocumentInformation_View.attr("mode", "view"); Button_DocumentInformation_View.val('View'); } // Code Added By Karan till here } else if (CurrentVersionStatusId == 21) { if (LoggedInUserId == AuthorId || ProxyId == LoggedInUserId) { Button_DocumentInformation_View.attr("disabled", false); Button_DocumentInformation_View.attr("mode", "view"); Button_DocumentInformation_View.val('View'); } else { Button_DocumentInformation_View.attr("disabled", "true"); Button_DocumentInformation_View.val('Edit'); // Enable / Disable Button // Code Added by Karan // Purpose : Check from db to enable disable the edit button // Ref task #12 Threshold Dev Phase II if (ObjectDocumentInformation.PreventNewVersion == 0) Button_DocumentInformation_View.attr("disabled", "true"); else if (ObjectDocumentInformation.PreventNewVersion == 1) { // Below If condtion is added by Rakesh to disable Edit button in case of Supervisor mode is on Ref to task 939 in SCwebphaseII bugs/Features if (objectPageResponse.SupervisorMode) Button_DocumentInformation_View.attr("disabled", "true"); else Button_DocumentInformation_View.attr("disabled", false); } } // Code Added by Karan // Purpose : Check from db to enable disable the edit button // Ref task #12 Threshold Dev Phase II if (objectPageResponse.ObjectDocumentInformation != null && objectPageResponse.ObjectDocumentInformation.DocumentMode == 'view') { Button_DocumentInformation_View.attr("mode", "edit"); Button_DocumentInformation_View.val('Edit'); } else if (objectPageResponse.ObjectDocumentInformation != null && objectPageResponse.ObjectDocumentInformation.DocumentMode == 'edit') { Button_DocumentInformation_View.attr("mode", "view"); Button_DocumentInformation_View.val('View'); } // Code Added By Karan till here //Condtion Added by Vikas Vyas in ref to implement Service Note Architecture if (DocumentId <= 0 && ObjectDocumentInformation.KeyFieldValue > 0) { // Button_DocumentInformation_View.attr("disabled", "true"); // Button_DocumentInformation_View.val('View'); Span_DocumentInformation_AuthorName.html(" " + ObjectDocumentInformation.AuthorList); //Populate AuthorList img_DocumentInformation_Author.css("display", "block"); Span_DocumentInformation_AuthorList.css("display", "none"); Span_DocumentInformation_AuthorName.css("display", "block"); } //End } //ref task# 11(Documents.Status == To Be Reviwed) // else if (DocumentStatusId == 22) //22-Signed/complete document else if (CurrentVersionStatusId == 22 || CurrentVersionStatusId == 26) //22-Signed/complete documen ///Pranay { $('#Button_DocumentInformation_ShareDocument').addClass('disablechecked_btn'); //Below Code commented By Rakesh With ref to task 137 in SC web phase II bugs TO support button edit/View - enable & disable based on sp scsp_SCDocumentPreventNewVersion as we are setting value in ObjectDocumentInformation.PreventNewVersion . To support multi staff edit functionality. // if (RequiresSignature != 'Y') { // Button_DocumentInformation_View.attr("disabled", "true"); // Button_DocumentInformation_View.attr("mode", "edit"); // Button_DocumentInformation_View.val('Edit'); // } // else if (DocumentLatestVersion == DocumentVersion && (LoggedInUserId == AuthorId || ProxyId == LoggedInUserId)) { // Button_DocumentInformation_View.attr("disabled", ""); // Button_DocumentInformation_View.attr("mode", "edit"); // Button_DocumentInformation_View.val('Edit'); // } // else { // Button_DocumentInformation_View.attr("disabled", "true"); // Button_DocumentInformation_View.val('Edit'); // } Button_DocumentInformation_View.attr("mode", "edit"); Button_DocumentInformation_View.val('Edit'); //Below code Commented by Rakesh wrf to task 137 to support completed events // if (RequiresSignature != 'Y') { // Button_DocumentInformation_View.attr("disabled", "true"); // Button_DocumentInformation_View.attr("mode", "edit"); // Button_DocumentInformation_View.val('Edit'); // } //else if (DocumentLatestVersion == DocumentVersion && (LoggedInUserId == AuthorId || ProxyId == LoggedInUserId)) { Button_DocumentInformation_View.attr("disabled", false); Button_DocumentInformation_View.attr("mode", "edit"); Button_DocumentInformation_View.val('Edit'); } else { //Below if condition added By Rakesh With ref to task 137 in SC web phase II bugs TO support button edit/View - enable & disable based on sp scsp_SCDocumentPreventNewVersion as we are setting value in ObjectDocumentInformation.PreventNewVersion . To support multi staff edit functionality. if (ObjectDocumentInformation.PreventNewVersion == 0) Button_DocumentInformation_View.attr("disabled", "true"); else if (ObjectDocumentInformation.PreventNewVersion == 1) { // Below If condtion is added by Rakesh to disable Edit button in case of Supervisor mode is on Ref to task 939 in SCwebphaseII bugs/Features if (objectPageResponse.SupervisorMode) Button_DocumentInformation_View.attr("disabled", "true"); else Button_DocumentInformation_View.attr("disabled", ""); } Button_DocumentInformation_View.val('Edit'); } //Code changed end here } //Handle ToSign,Sign,complete button functionality if (WorkingMode == "new") { Button_DocumentInformation_ToSign.hide(); if (ObjectDocumentInformation.RequiresSignature == "Y") { Button_DocumentInformation_Sign.show(); //$('#Table_DocumentInformation_Signature').show(); EnableSignatureControls(); Button_DocumentInformation_ShowSignature.show(); Button_DocumentInformation_Complete.hide(); } else { Button_DocumentInformation_Complete.show(); Button_DocumentInformation_Sign.hide(); Button_DocumentInformation_Complete.attr("disabled", false) // $('#Table_DocumentInformation_Signature').hide(); DisableSignatureControls(); // $('#Button_DocumentInformation_ShowSignature').hide(); } } //ref task# 11(Documents.Status == To Be Reviwed) // else if (DocumentStatusId == "21")//Inprogress mode else if (CurrentVersionStatusId == "21")//Inprogress mode { if (LoggedInUserId == AuthorId) { //Inprogress mode- Author =Logged in user //Disable To sign //Enable Sign button if RequiresSignature == "Y" //Enable Complete button if RequiresSignature == "N" Button_DocumentInformation_ToSign.hide(); $('#ButtonDelete').attr("disabled", false); if (ObjectDocumentInformation.RequiresSignature == "Y") { Button_DocumentInformation_Sign.show(); Button_DocumentInformation_Sign.attr("disabled", false); //$('#Table_DocumentInformation_Signature').show(); //Condtion Added by Vikas Vyas in ref to implement Service Note Architecture // if (DocumentId <= 0 && ObjectDocumentInformation.ServiceId > 0) { if (DocumentId <= 0 && ObjectDocumentInformation.KeyFieldValue == 0) { DisableSignatureControls(); } //End else { EnableSignatureControls(); } Button_DocumentInformation_ShowSignature.show(); Button_DocumentInformation_Complete.hide(); } else { Button_DocumentInformation_Complete.show(); Button_DocumentInformation_Complete.attr("disabled", ""); Button_DocumentInformation_Sign.hide(); // $('#Table_DocumentInformation_Signature').hide(); DisableSignatureControls(); // $('#Button_DocumentInformation_ShowSignature').hide(); } } else if (LoggedInUserId == ProxyId) { //Inprogress mode- Logged in user =Proxy user od the document //Enable "Tosign" button //Hide Sign button //Hide Complete //Open document in view mode. if (ObjectDocumentInformation.ToSign == "Y") { Button_DocumentInformation_View.attr("mode", "edit"); Button_DocumentInformation_View.val('Edit'); } $('#ButtonDelete').attr("disabled", "true"); Button_DocumentInformation_ToSign.show(); //Modified by Sweety Kamboj on 30April 2010 if (ObjectDocumentInformation.ToSign == "Y") { $('#Button_DocumentInformation_ToSign')[0].className = "tosignchecked_btn"; Button_DocumentInformation_ToSign.attr("disabled", "true"); } else { $('#Button_DocumentInformation_ToSign')[0].className = "tosignunchecked_btn"; Button_DocumentInformation_ToSign.attr("disabled", false); } Button_DocumentInformation_Complete.hide(); Button_DocumentInformation_Sign.hide(); if (ObjectDocumentInformation.RequiresSignature == "Y") { //$('#Table_DocumentInformation_Signature').show(); //$('#Button_DocumentInformation_ShowSignature').show(); //By Vikas Vyas in ref to Implement Service Note Architecture //if (DocumentId <= 0 && ObjectDocumentInformation.ServiceId > 0) { if (DocumentId <= 0 && ObjectDocumentInformation.KeyFieldValue == 0) { DisableSignatureControls(); } else { EnableSignatureControls(); } } else { // $('#Table_DocumentInformation_Signature').hide(); DisableSignatureControls(); // $('#Button_DocumentInformation_ShowSignature').hide(); } } else { //Inprogress mode- Logged in user =Staff user of the document //Hide "Tosign" button //show Disabled Sign button if RequiresSignature == "Y" //show Disabled complete button if RequiresSignature == "N" Button_DocumentInformation_ToSign.hide(); $('#ButtonDelete').attr("disabled", "true"); if (ObjectDocumentInformation.RequiresSignature == "Y") { Button_DocumentInformation_Sign.show(); Button_DocumentInformation_Sign.attr("disabled", "true"); Button_DocumentInformation_Complete.hide(); //$('#Table_DocumentInformation_Signature').show(); EnableSignatureControls(); Button_DocumentInformation_ShowSignature.show(); } else { Button_DocumentInformation_Complete.show(); Button_DocumentInformation_Complete.attr("disabled", "true"); Button_DocumentInformation_Sign.hide(); // $('#Table_DocumentInformation_Signature').hide(); DisableSignatureControls(); // $('#Button_DocumentInformation_ShowSignature').hide(); } } } //ref task# 11(Documents.Status == To Be Reviwed) // else if (DocumentStatusId == "22") //signed or completed document else if (CurrentVersionStatusId == "22" || CurrentVersionStatusId == "26") //signed or completed document //Pranay { $('#ButtonDelete').attr("disabled", "true"); if (LoggedInUserId == AuthorId) { //signed or completed mode-Logged in user =auhor of the document //Hide "Tosign" button //Show disabled Sign button if RequiresSignature == "Y" //show disabled complete button if RequiresSignature == "N" Button_DocumentInformation_ToSign.hide(); if (ObjectDocumentInformation.RequiresSignature == "Y") { Button_DocumentInformation_Sign.show(); Button_DocumentInformation_Sign.attr("disabled", "true"); Button_DocumentInformation_Complete.hide(); //$('#Table_DocumentInformation_Signature').show(); Button_DocumentInformation_ShowSignature.show(); } else { Button_DocumentInformation_Complete.show(); Button_DocumentInformation_Complete.attr("disabled", "true"); Button_DocumentInformation_Sign.hide(); //$('#Table_DocumentInformation_Signature').hide(); DisableSignatureControls(); // $('#Button_DocumentInformation_ShowSignature').hide(); } } else if (LoggedInUserId == ProxyId) { //signed or completed mode-Logged in user =proxy of the document //show disabled "Tosign" button. //Hide Sign and complete Button_DocumentInformation_ToSign.show(); Button_DocumentInformation_ToSign.attr("disabled", "true"); Button_DocumentInformation_Complete.hide(); Button_DocumentInformation_Sign.hide(); if (ObjectDocumentInformation.RequiresSignature == "Y") { // $('#Table_DocumentInformation_Signature').show(); //$('#Button_DocumentInformation_ShowSignature').show(); } else { // $('#Table_DocumentInformation_Signature').hide(); DisableSignatureControls(); // $('#Button_DocumentInformation_ShowSignature').hide(); } } else { //signed or completed mode- Logged in user =Staff user of the document //Hide "Tosign" button //show Disabled Sign button if RequiresSignature == "Y" //show Disabled complete button if RequiresSignature == "N" Button_DocumentInformation_ToSign.hide(); if (ObjectDocumentInformation.RequiresSignature == "Y") { Button_DocumentInformation_Sign.show(); Button_DocumentInformation_Sign.attr("disabled", "true"); Button_DocumentInformation_Complete.hide(); // $('#Table_DocumentInformation_Signature').show(); //$('#Button_DocumentInformation_ShowSignature').show(); } else { Button_DocumentInformation_Complete.show(); Button_DocumentInformation_Complete.attr("disabled", "true"); Button_DocumentInformation_Sign.hide(); //$('#Table_DocumentInformation_Signature').hide(); DisableSignatureControls(); // $('#Button_DocumentInformation_ShowSignature').hide(); } } } //added by shifali in ref to task# 11(To Be Reviewed - documents.currentversionstatus) //purpose - Setting document controller buttons when == 25 else if (CurrentVersionStatusId == 25) //25-To Be Reviewed document { Button_DocumentInformation_ShareDocument.addClass('disablechecked_btn'); Button_DocumentInformation_ShareDocument.attr("disabled", "true"); if (RequiresSignature != 'Y') { Button_DocumentInformation_View.attr("disabled", "true"); Button_DocumentInformation_View.attr("mode", "edit"); Button_DocumentInformation_View.val('Edit'); } else if (LoggedInUserId == AuthorId || ProxyId == LoggedInUserId) { Button_DocumentInformation_View.attr("disabled", ""); Button_DocumentInformation_View.attr("mode", "view"); Button_DocumentInformation_View.val('View'); ButtonDelete.removeAttr("disabled"); } else { Button_DocumentInformation_View.attr("disabled", "true"); Button_DocumentInformation_View.val('Edit'); ButtonDelete.attr("disabled", "true"); } Span_DocumentInformation_AuthorName.html(" " + ObjectDocumentInformation.AuthorList); //Populate AuthorList img_DocumentInformation_Author.css("display", "block"); Span_DocumentInformation_AuthorList.css("display", "none"); Span_DocumentInformation_AuthorName.css("display", "block"); } //If document open from unsaved changes with new status.Start if (ObjectDocumentInformation.InProgressDocumentVersionId <= 0 && ObjectDocumentInformation.AuthorId != ObjectDocumentInformation.LoggedInUserId) { SetAuthorToolbarButtonsForNewInstance(ObjectDocumentInformation.RequiresSignature); } if (ObjectDocumentInformation.KeyFieldValue == 0 && (ObjectDocumentInformation.NoteType == -1 || ObjectDocumentInformation.NoteType == -2) && ObjectDocumentInformation.AuthorId != ObjectDocumentInformation.LoggedInUserId) { SetAuthorToolbarButtonsForNewInstance(ObjectDocumentInformation.RequiresSignature); } //-End //if (ObjectDocumentInformation.IsServiceNote == "true") { if (ObjectDocumentInformation.NoteType == -1) { img_DocumentInformation_EffectiveDate.attr("disabled", "true"); ShowToolbarItems('CopyService'); //Added by Akwinass(21-JULY-2014) with ref to task #3 in System Improvements project ShowToolbarItems('ScheduleFollowup'); ShowToolbarItems('NumberOfTimesRescheduled'); } //Modified by Sweety Kamboj on 12 April 2010 else if (ObjectDocumentInformation.NoteType == -2) { img_DocumentInformation_EffectiveDate.attr("disabled", "true"); ShowToolbarItems('CopyService'); //Added by Akwinass(21-JULY-2014) with ref to task #3 in System Improvements project ShowToolbarItems('ScheduleFollowup'); ShowToolbarItems('NumberOfTimesRescheduled'); } else { HideToolbarItems('CopyService'); //Added by Akwinass(21-JULY-2014) with ref to task #3 in System Improvements project HideToolbarItems('ScheduleFollowup'); HideToolbarItems('NumberOfTimesRescheduled'); } EnableDisableAuthorList(); SetSummaryofCareToolbar(ObjectDocumentInformation) //Disable edit/view button for scanned documents:Maninder if (ObjectDocumentInformation.DocumentType == 17 && ObjectDocumentInformation.ReviewFormId > 0) { Button_DocumentInformation_View.attr('disabled', true); } //ends //Added by Pranay on 07/03 in ref Harbor857# (ObjectDocumentInformation.CurrentVersionStatusId=="26" && Action=="") if (ObjectDocumentInformation.DocumentMode == "view" || (ObjectDocumentInformation.CurrentVersionStatusId == "26" && (objectPageResponse.Action == "" || objectPageResponse.Action == pageActionEnum.NextDocument || objectPageResponse.Action == pageActionEnum.PreviousDocument))) { RegenratePdf = 'yes'; //OpenURL(DocumentVersionId, true); //Added by Shifali on 21Nov2011 in ref task# 11 (Document Status - To Be Reviewed) OpenURL(InProgressDocumentVersionId, true); //if (ObjectDocumentInformation.DocumentStatusId == 22) { if (ObjectDocumentInformation.CurrentVersionStatusId == 22) { // if (ObjectDocumentInformation.DocumentStatusId == 22 && objectPageResponse.Action=="update") { //Commented By : Swapan Mohan //Purpose : As per Task #125 3.5x Issues to avoid multiple request to ReportViewer.aspx.cs and avoid multiple times ssp execution. //gereratepdfaftersign(); // var myDate = new Date();j // $.post(GetRelativePath() + "ReportViewer.aspx?ReportType=gereratepdfaftersign&DocumentVersionId=" + objectPageResponse.ObjectDocumentInformation.DocumentVersionId, 'time=' + myDate.getMinutes() + myDate.getSeconds()); } } else { // OpenURL(DocumentVersionId, false); //Added by Shifali on 21Nov2011 in ref task# 11 (Document Status - To Be Reviewed) //OpenURL(InProgressDocumentVersionId, false); //Added condition : Maninder if (ObjectDocumentInformation.DocumentType == 17 && ObjectDocumentInformation.ReviewFormId > 0) { OpenURL(InProgressDocumentVersionId, true); } else if (ObjectDocumentInformation.KeyScreenId == 29 && (objectPageResponse.Action == pageActionEnum.NextDocument || objectPageResponse.Action == pageActionEnum.PreviousDocument)) { openedDocumentVersionId = InProgressDocumentVersionId; OpenURL(openedDocumentVersionId, false); } else { if (CurrentVersionStatusId != "20") OpenURL(InProgressDocumentVersionId, false); else { openedDocumentVersionId = InProgressDocumentVersionId; } } } //if (ObjectDocumentInformation.IsServiceNote == "true") { if (ObjectDocumentInformation.NoteType == -1 || ObjectDocumentInformation.NoteType == -2) { TextBox_DocumentInformation_EffectiveDate.attr("disabled", "true"); } //Check if document code status is 'N' Disable all the action. //And open the document in View Mode //Vikas Monga if (ObjectDocumentInformation.DocumentCodeActive == 'N') { SetControllerStatus(ObjectDocumentInformation, 'DcoumentCodeInactive'); } //Check Client Status. If Active='Y' Disable the new button if (ObjectDocumentInformation.ClientStatus == 'N') { // ButtonNew.attr("disabled", "true"); // } //Changes to Implement general functionality for Services and Events if (NoteType == -1) { EnableDisableCopyService(objectPageResponse, "Services", "ServiceId", -1); } if (NoteType == -2) { EnableDisableCopyService(objectPageResponse, "Events", "EventId", -2); } checkClientViewingStatus(); checkPrivateWindow(); //Added By Arjun K R Task #476.01- CEI Support Go Live //Check SuperVisorMode if its on open the document in view mode var SMServiceId = GetColumnValueInXMLNodeByKeyValue('Documents', 'DocumentId', DocumentId, 'ServiceId', AutoSaveXMLDom); var SupervisorModeServiceId = GetColumnValueInXMLNodeByKeyValue('Services', 'ServiceId', SMServiceId, 'Status', AutoSaveXMLDom) if (SuperVisorModeOn && SupervisorModeServiceId != 72 && SupervisorModeServiceId != 73) { //OpenURL(DocumentVersionId, true); //Added by Shifali on 21Nov2011 in ref task# 11 (Document Status - To Be Reviewed) OpenURL(InProgressDocumentVersionId, true); } // //ref task# 11(Documents.Status == To Be Reviwed) //purpose - added one new parameter 'ReviewerId' //DisableFrameWorkControlBasedonDocumentStatus(DocumentStatusId, AuthorId, LoggedInUserId, ProxyId,ReviewerId); DisableFrameWorkControlBasedonDocumentStatus(CurrentVersionStatusId, AuthorId, LoggedInUserId, ProxyId, ReviewerId); //Following condition added to PreventNewVersion ba //Modified by Sweety Kamboj on 20 May 2010 //Change DocumentStatus to DocumentStatusId //if (ObjectDocumentInformation.DocumentStatusId == 20 || ObjectDocumentInformation.DocumentStatusId == 21 || ObjectDocumentInformation.DocumentStatusId == 22) { if (ObjectDocumentInformation.CurrentVersionStatusId == 20 || ObjectDocumentInformation.CurrentVersionStatusId == 21 || ObjectDocumentInformation.CurrentVersionStatusId == 22 || ObjectDocumentInformation.CurrentVersionStatusId == 26) { if (ObjectDocumentInformation.PreventNewVersion == 0) Button_DocumentInformation_View.attr("disabled", "true"); } else if (ObjectDocumentInformation.DocumentStatusId == 21)//this condition is imposed by Pradeep tas per task#263(Sc Web Phase II Bugs and Feature) to enable view mode for in progress documents { if (LoggedInUserId == AuthorId || ProxyId == LoggedInUserId) { Button_DocumentInformation_View.attr("disabled", ""); Button_DocumentInformation_View.attr("mode", "view"); Button_DocumentInformation_View.val('View'); } else { Button_DocumentInformation_View.attr("disabled", "true"); Button_DocumentInformation_View.val('Edit'); } } //Added by Maninder: to disable delete button if Signed if (ObjectDocumentInformation.DocumentStatusId == "22" || ObjectDocumentInformation.DocumentStatusId == "26") { $('#ButtonDelete').attr("disabled", true); if (objectPageResponse.EnableDeleteButtonAfterSign == 'Y') { $('#ButtonDelete').removeAttr("disabled"); } } if (ObjectDocumentInformation.DocumentStatusId != "22" && ObjectDocumentInformation.OnlyAvailableOnline == 'N') { $("#ButtonUpload").removeAttr("disabled"); } //Maninder: Commented below lines for task#842 in Threshold Bugs/Feature // else { // $('#ButtonDelete').attr("disabled", false); // } $('#Button_DocumentInformation_View').attr("ViewMode", "N"); // Created function to disable the button for the View only permission DisableButtonforViewMode(); //Logic For Enabling 'O' Icon var ServiceIDMovedFrom = $('input[id$=HiddenFieldServiceIDMovedFrom]').val(); var DocuementIdMovedFrom = $('input[id$=HiddenFieldDocumentIdMovedFrom]').val(); var ScreenIdMovedFrom = $('input[id$=HiddenFieldScreenIdMovedFrom]').val(); if (ServiceIDMovedFrom > 0) { $("#ImgOrginalNote").removeAttr("disabled"); $("#ImgOrginalNote").attr('onClick', 'OpenOldNote(' + ServiceIDMovedFrom + ',' + DocuementIdMovedFrom + ',' + ScreenIdMovedFrom + ')'); } // Added By Sachin if (AutoSaveXMLDom[0] != "" && AutoSaveXMLDom[0] != undefined && AutoSaveXMLDom[0].childNodes[0].selectNodes("DocumentVersions").length > 0) { if (AutoSaveXMLDom[0].childNodes[0].selectNodes("DocumentVersions")[0].selectSingleNode("DocumentVersionId") != null) { if (ObjectDocumentInformation.VersionAuthorToSign == 'Y' && editClick == true && AutoSaveXMLDom[0].childNodes[0].selectNodes("DocumentVersions")[0].selectSingleNode("Version").text >= 1 && CurrentVersionStatusId == '21') { Button_DocumentInformation_Sign.attr("disabled", false); } } } // END } catch (ex) { alert(ex); } } function OpenOldNote(serviceId, DocumentId, DocumentScreenId) { try { if (serviceId > 0) { //If screen id is not found OpenPage(5763, 29, "keyscreenid=29^TabId=2^keyfieldvalue=" + DocumentScreenId + "^DocumentId=" + DocumentId + "^MoreDetail=N", 2, GetRelativePath()); } else {//If scren id is found OpenPage(5763, DocumentScreenId, "DocumentId=" + DocumentId + "^MoreDetail=N", 2, GetRelativePath()); } } catch (err) { } } ///Author : Mahesh S ///Created On 13, July,2010 ///Description : This fuction is used to call the setClientViewingControl from application common fucuntion's js /// for setting the controls according to client viewing mode. function checkClientViewingStatus() { try { if (IsNotClientViewingMode) { // setClientViewingControl("F") No need to call this function if client viwing is off } else { setClientViewingControl("Y") } } catch (err) { } } //end of Call function set Cliet Viwing function ReSetDocumentFrameworkControls() { ButtonNew = $('#ButtonNew'); ButtonUpdate = $('#ButtonUpdate'); ButtonValidate = $('#ButtonValidate'); //Added By Jagdeep Hundal Ref:task No:4 in THRESHOLDSOFF2. To Add 'Validate' button to the toolbar ButtonDelete = $('#ButtonDelete'); Span_DocumentInformation_PreviousDocumentDate = $('#Span_DocumentInformation_PreviousDocumentDate'); Span_DocumentInformation_PreviousDocumentSeprator = $('#Span_DocumentInformation_PreviousDocumentSeprator'); Span_DocumentInformation_PreviousDocumentName = $('#Span_DocumentInformation_PreviousDocumentName'); Button_DocumentInformation_PreviousDocument = $('#Button_DocumentInformation_PreviousDocument'); Button_DocumentInformation_NextDocument = $('#Button_DocumentInformation_NextDocument'); Span_DocumentInformation_NextDocumentDate = $('#Span_DocumentInformation_NextDocumentDate'); Span_DocumentInformation_NextDocumentSeprator = $('#Span_DocumentInformation_NextDocumentSeprator'); Span_DocumentInformation_NextDocumentName = $('#Span_DocumentInformation_NextDocumentName'); Span_DocumentInformation_GoToDocumentList = $('#Span_DocumentInformation_GoToDocumentList'); Button_DocumentInformation_Sign = $('#Button_DocumentInformation_Sign'); Button_DocumentInformation_ToSign = $('#Button_DocumentInformation_ToSign'); Button_DocumentInformation_Complete = $('#Button_DocumentInformation_Complete'); Button_DocumentInformation_View = $('#Button_DocumentInformation_View'); Button_DocumentInformation_ShareDocument = $('#Button_DocumentInformation_ShareDocument'); Span_DocumentInformation_Status = $('#Span_DocumentInformation_Status'); TextBox_DocumentInformation_EffectiveDate = $('#TextBox_DocumentInformation_EffectiveDate'); img_DocumentInformation_EffectiveDate = $('#img_DocumentInformation_EffectiveDate'); Span_DocumentInformation_AuthorList = $('#Span_DocumentInformation_AuthorList'); Span_DocumentInformation_AuthorName = $('#Span_DocumentInformation_AuthorName'); img_DocumentInformation_Author = $('#img_DocumentInformation_Author'); Button_DocumentInformation_ShowSignature = $('#Button_DocumentInformation_ShowSignature'); Table_DocumentInformation_Signature = $('#Table_DocumentInformation_Signature'); Span_DocumentInformation_VersionList = $('#Span_DocumentInformation_VersionList'); Div_DocumentInformation_SignedBy = $('#Div_DocumentInformation_SignedBy'); DropDownList_DocumentInformation_SignerList = $("select[id$=DropDownList_DocumentInformation_SignerList]"); Button_DocumentInformation_Signer = $('#Button_DocumentInformation_Signer'); Button_DocumentInformation_Decline = $('#Button_DocumentInformation_Decline'); Span_DocumentInformation_SignerList = $('#Span_DocumentInformation_SignerList'); Span_DocumentInformation_AcknowledgementComments = $('#Span_DocumentInformation_AcknowledgementComments'); DropDownList_DocumentInformation_AuthorList = $('select[id$=DropDownList_DocumentInformation_AuthorList]'); //added by Shifali to initialize controls(in ref to task# 11 To be Reviewed) Button_DocumentInformation_MetaData = $("#Button_DocumentInformation_MetaData"); // ButtonNew.attr("disabled", false); Modified by SuryaBalan wrf 491 Corebugs Bug-Employment LIfe Event on 3-Mar-2014 // ButtonUpdate.attr("disabled", false); ButtonValidate.attr("disabled", false); //Added By Jagdeep Hundal Ref:task No:4 in THRESHOLDSOFF2. To Add 'Validate' button to the toolbar ButtonDelete.attr("disabled", false); Span_DocumentInformation_PreviousDocumentDate.html(""); Span_DocumentInformation_PreviousDocumentSeprator.html(""); Span_DocumentInformation_PreviousDocumentName.html(""); Button_DocumentInformation_PreviousDocument.attr("disabled", false) Button_DocumentInformation_NextDocument.attr("disabled", false) Span_DocumentInformation_NextDocumentDate.html(""); Span_DocumentInformation_NextDocumentSeprator.html(""); Span_DocumentInformation_NextDocumentName.html(""); Span_DocumentInformation_GoToDocumentList.html(""); Button_DocumentInformation_Sign.hide(); Button_DocumentInformation_ToSign.hide(); Button_DocumentInformation_Complete.hide(); Button_DocumentInformation_View.show(); Button_DocumentInformation_ShareDocument.show(); Button_DocumentInformation_ShareDocument.attr("disabled", false); Span_DocumentInformation_Status.html(""); TextBox_DocumentInformation_EffectiveDate.val(""); img_DocumentInformation_EffectiveDate.attr("disabled", false); TextBox_DocumentInformation_EffectiveDate.attr("disabled", false) Span_DocumentInformation_AuthorList.html(""); Span_DocumentInformation_AuthorList.attr("disabled", false) Span_DocumentInformation_AuthorName.html(""); //img_DocumentInformation_Author // Button_DocumentInformation_ShowSignature // Table_DocumentInformation_Signature Span_DocumentInformation_VersionList.html(""); Div_DocumentInformation_SignedBy.html(""); // DropDownList_DocumentInformation_SignerList Button_DocumentInformation_Signer.attr("disabled", false); Button_DocumentInformation_Decline.attr("disabled", false); Button_DocumentInformation_Sign.attr("disabled", false); Button_DocumentInformation_ToSign.attr("disabled", false); DropDownList_DocumentInformation_SignerList.attr("disabled", false); Button_DocumentInformation_Decline.attr("disabled", false); Button_DocumentInformation_ShowSignature.attr("disabled", false); Span_DocumentInformation_SignerList.html(""); Span_DocumentInformation_AcknowledgementComments.html(""); // EnableSignatureControls(); //Added by Daman //Enable/Disable Acknowledgements Tool Buttons XmlDoc = $.xmlDOM(objectPageResponse.ScreenDataSetXml); if ($('#CommentsUpdate').length > 0 && $('#AcknowledgmentUdpate').length > 0) { if (XmlDoc[0].childNodes[0].selectNodes("DocumentVersions").length > 0 && XmlDoc[0].childNodes[0].selectNodes("DocumentVersions")[0].selectNodes("DocumentAcknowledgementRequired").length > 0) EnableDocumentsAcknowledgementsTools = XmlDoc[0].childNodes[0].selectNodes("DocumentVersions")[0].selectNodes("DocumentAcknowledgementRequired")[0].text.trim(); else EnableDocumentsAcknowledgementsTools = "false"; if (EnableDocumentsAcknowledgementsTools == "true") { $('#CommentsUpdate').attr('disabled', false); $('#AcknowledgmentUdpate').attr('disabled', false); } else { $('#CommentsUpdate').attr('disabled', true); $('#AcknowledgmentUdpate').attr('disabled', true); } } // Code Added By Karan ***** // Purpose : Show hide the KeyPhrases icon on basis of pageresponse // Dated : 24 Nov 2011 // if (objectPageResponse.UseKeyPhrases) { // ShowToolbarItems('AddPhrases'); // ShowToolbarItems('FavoritePhrases'); // } // else { // HideToolbarItems('AddPhrases'); // HideToolbarItems('FavoritePhrases'); // } // //Added By Rahul Aneja for Help URL functionality // if (objectPageResponse.HelpURL != null && objectPageResponse.HelpURL != "") { // ShowToolbarItems('HelpURL'); // // ShowToolbarItems('FavoritePhrases'); // } // else { // HideToolbarItems('HelpURL'); // // HideToolbarItems('FavoritePhrases'); // } //********************** ManageDocumentToolbarItems(); } function SetControllerStatus(ObjectDocumentInformation, Status) { //EI#564 - Implement Verbose Mode Logging in SmartCare Application EventTrap("Documents", "SetControllerStatus", "Status - " + isNullORUndefined(Status) + ""); //Common Disable controls ButtonUpdate.attr("disabled", "true"); ButtonValidate.attr("disabled", "true"); //Added By Jagdeep Hundal Ref:task No:4 in THRESHOLDSOFF2. To Add 'Validate' button to the toolbar ButtonDelete.attr("disabled", "true"); //Added by Maninder if (ObjectDocumentInformation.DocumentStatusId == 21 && ObjectDocumentInformation.DocumentType == 17 && ObjectDocumentInformation.ReviewFormId > 0) { enableUpdateButton(); } else { ButtonUpdate.attr("disabled", "true"); } //Ends Button_DocumentInformation_ToSign.hide(); Button_DocumentInformation_Sign.hide(); Button_DocumentInformation_Complete.show(); Button_DocumentInformation_Complete.attr("disabled", "true"); //Added by Maninder if (ObjectDocumentInformation.DocumentStatusId == 21 && ObjectDocumentInformation.DocumentType == 17 && ObjectDocumentInformation.ReviewFormId > 0) { Button_DocumentInformation_Complete.attr("disabled", "true"); } else { Button_DocumentInformation_Complete.attr("disabled", "true"); } //ends Button_DocumentInformation_View.attr("disabled", "true"); img_DocumentInformation_EffectiveDate.attr("disabled", "true"); TextBox_DocumentInformation_EffectiveDate.attr("disabled", "true"); Button_DocumentInformation_ShareDocument.attr("disabled", "true"); //Show author List //if (ObjectDocumentInformation.DocumentStatusId != 22) { if (ObjectDocumentInformation.CurrentVersionStatusId != 22) { Span_DocumentInformation_AuthorList.attr("disabled", "true"); } if (LoggedInUserId == ProxyId) //Show ToSign button in disable mode { Button_DocumentInformation_ToSign.show(); Button_DocumentInformation_ToSign.attr("disabled", "true"); Button_DocumentInformation_Complete.hide(); Button_DocumentInformation_Sign.hide(); } else { //Show Sign/Complete button in disable mode Button_DocumentInformation_ToSign.hide(); if (ObjectDocumentInformation.RequiresSignature == "Y") { Button_DocumentInformation_Sign.show(); Button_DocumentInformation_Sign.attr("disabled", "true"); Button_DocumentInformation_Complete.hide(); //Added by Maninder if (ObjectDocumentInformation.DocumentStatusId == 21 && ObjectDocumentInformation.DocumentType == 17 && ObjectDocumentInformation.ReviewFormId > 0) { Button_DocumentInformation_Sign.attr("disabled", false); } else { Button_DocumentInformation_Sign.attr("disabled", "true"); } } else { Button_DocumentInformation_Complete.show(); Button_DocumentInformation_Complete.attr("disabled", "true"); Button_DocumentInformation_Sign.hide(); //Added by Maninder if (ObjectDocumentInformation.DocumentStatusId == 21 && ObjectDocumentInformation.DocumentType == 17 && ObjectDocumentInformation.ReviewFormId > 0) { Button_DocumentInformation_Complete.attr("disabled", false); } else { Button_DocumentInformation_Complete.attr("disabled", "true"); } //Ends } //Below If statement added by Rakesh w.rf. to task 344 in SC web phase II bugs/Features 9.8 - Allow Document Signatures for DocumentType = 12 if (ObjectDocumentInformation.AuthorId == LoggedInUserId && ObjectDocumentInformation.DocumentStatusId == 21 && ObjectDocumentInformation.DocumentType == 12) { Button_DocumentInformation_Sign.attr("disabled", false); } //Changes end here } //DisableSignatureControls(); switch (Status) { case "ImageDocument": DisableSignatureControls(); ButtonNew.attr("disabled", "true"); ImageDocumentIndex = ObjectDocumentInformation.ImageDocumentIndex; ImageDocumentCount = ObjectDocumentInformation.ImageDocumentCount; Button_ImageDocument_PreviousDocument = $('#Button_ImageDocument_PreviousDocument'); Button_ImageDocument_NextDocument = $('#Button_ImageDocument_NextDocument'); Span_ImageDocument_PagingInformation = $('#Span_ImageDocument_PagingInformation'); Span_ImageDocument_ErrorMessage = $('#Span_ImageDocument_ErrorMessage'); SetImageDocumentNavigationImages(); break; case "ScannedMedicalRecord": DisableSignatureControls(); ButtonNew.attr("disabled", "true"); //OpenScannedMedicalRecord(DocumentVersionId); //Added by Maninder if (ObjectDocumentInformation.DocumentStatusId == 21 && ObjectDocumentInformation.DocumentType == 17 && ObjectDocumentInformation.ReviewFormId > 0) { Button_DocumentInformation_Sign.attr('disabled', false); EnableSignatureControls(); } else Button_DocumentInformation_Sign.attr('disabled', true); //Ends //OpenURL(DocumentVersionId, true); //Added by Shifali on 21Nov2011 in ref task# 11 (Document Status - To Be Reviewed) if ((ObjectDocumentInformation.DocumentStatusId == 21 && ObjectDocumentInformation.DocumentType == 17 && ObjectDocumentInformation.ReviewFormId > 0) == false) { OpenURL(InProgressDocumentVersionId, true); } break; case "ToDo": DisableSignatureControls(); Span_DocumentInformation_AuthorName.html(" " + ObjectDocumentInformation.Author); //Populate AuthorList img_DocumentInformation_Author.css("display", "block"); Span_DocumentInformation_AuthorList.css("display", "none"); Span_DocumentInformation_AuthorName.css("display", "block"); //Condition Added By Vikas Vyas in ref to Implement #Task #879 if (ObjectDocumentInformation.NoteType == -1 || ObjectDocumentInformation.NoteType == -2) { enableUpdateButton(); ButtonValidate.attr("disabled", false); //Added By Jagdeep Hundal Ref:task No:4 in THRESHOLDSOFF2. To Add 'Validate' button to the toolbar ButtonDelete.attr("disabled", false); } if (ObjectDocumentInformation.KeyScreenId != 29 && ObjectDocumentInformation.KeyScreenId != 32) { //OpenURL(DocumentVersionId, true); //Added by Shifali on 21Nov2011 in ref task# 11 (Document Status - To Be Reviewed) OpenURL(InProgressDocumentVersionId, true); } break; case "Cancel": DisableSignatureControls(); Span_DocumentInformation_AuthorName.html(" " + ObjectDocumentInformation.Author); //Populate AuthorList img_DocumentInformation_Author.css("display", "block"); Span_DocumentInformation_AuthorList.css("display", "none"); Span_DocumentInformation_AuthorName.css("display", "block"); break; case "DcoumentCodeInactive": DisableSignatureControls(); ButtonNew.attr("disabled", "true"); //OpenURL(DocumentVersionId, true); //Added by Shifali on 21Nov2011 in ref task# 11 (Document Status - To Be Reviewed) OpenURL(InProgressDocumentVersionId, true); //$('#ImgButtonMove').attr("disabled", "true"); DisableToolbarItem("Move"); break; case "ViewDocument": // Added by Daman ref: #Task #816 Document Cosigning - Not brought to the signature if (ObjectDocumentInformation.MoreDetail == 'Y') { ToggleSignatureBox(); var objRadioSigner = $("input[name$=Radio_SignerList][SignerID=" + ObjectDocumentInformation.LoggedInUserId + "]"); if (objRadioSigner.length > 0) { objRadioSigner.attr("checked", true) } } WorkingMode = "update"; ButtonNew.attr("disabled", "true"); //OpenURL(DocumentVersionId, true); //Added by Shifali on 21Nov2011 in ref task# 11 (Document Status - To Be Reviewed) OpenURL(InProgressDocumentVersionId, true); gereratepdfaftersign(); //$('#ImgButtonMove').attr("disabled", "true"); DisableToolbarItem("Move"); //changes by shifali in ref to task# To Be Reviewed Status - Replace Status with CurrentVersionStatus //DisableFrameWorkControlBasedonDocumentStatus(DocumentStatusId, AuthorId, LoggedInUserId, ProxyId); DisableFrameWorkControlBasedonDocumentStatus(CurrentVersionStatusId, AuthorId, LoggedInUserId, ProxyId); break; } } /**************************************************************************************/ //Author - Devinder Pal Singh //Purpose Handle signature box state(Show/Hide). function ToggleSignatureBox() { //var mode = $("[id='" + 'Button_DocumentInformation_View' + "']")[0].value; var mode = $("#Button_DocumentInformation_View").val(); var table_DocumentInformation_Signature = $('#Table_DocumentInformation_Signature'); var table_DocumentInformation_Acknowledgement = $('#Table_DocumentInformation_Acknowledgement'); var button_DocumentInformation_ShowSignature = $('#Button_DocumentInformation_ShowSignature'); var frameHeightToResize = 0; //if ($('#Table_DocumentInformation_Signature')[0].style.display == 'block') { // if (table_DocumentInformation_Signature.css('display') == 'block' || table_DocumentInformation_Acknowledgement.css('display') == 'block') { if (table_DocumentInformation_Signature.is(':visible') == true || table_DocumentInformation_Acknowledgement.is(':visible') == true) { // table_DocumentInformation_Signature.css('display', 'none'); // table_DocumentInformation_Acknowledgement.css('display', 'none'); table_DocumentInformation_Signature.hide(); table_DocumentInformation_Acknowledgement.hide(); button_DocumentInformation_ShowSignature.val("More Detail"); // $('#DocumentContents_ContentPlaceHolder_Middle')[0].style.height = '290px'; if (mode.toLowerCase() == 'edit') { var frameHeight = (($(document).height() * 50) / 100); $('#iFrameOpenURL').css('height', frameHeight); frameHeightToResize = frameHeight; // var i = 0 // for (i = 0; i <= document.frames.length - 1; i++) { // if (document.frames[i].name == "iFrameOpenURL") { // if (document.frames[i].document.getElementById("divReportViewer") != null) // document.frames[i].document.getElementById("divReportViewer").style.height = '275px' // } // } } } else { button_DocumentInformation_ShowSignature.val("Less Detail"); // $('#DocumentContents_ContentPlaceHolder_Middle')[0].style.height = '250px'; // table_DocumentInformation_Signature.css('display', 'block'); table_DocumentInformation_Signature.show(); //if ($('#DivAcknowledgementComments')[0].innerText == "") { if ($('#DivAcknowledgementComments')[0].innerText.trim() == "") { //table_DocumentInformation_Acknowledgement.css('display', 'none'); table_DocumentInformation_Acknowledgement.hide(); } else { //table_DocumentInformation_Acknowledgement.css('display', 'block'); table_DocumentInformation_Acknowledgement.show(); } if (mode.toLowerCase() == 'edit') { var frameHeight = (($(document).height() * 42) / 100); $('#iFrameOpenURL').css('height', frameHeight); frameHeightToResize = frameHeight; // var i = 0 // for (i = 0; i <= document.frames.length - 1; i++) { // if (document.frames[i].name == "iFrameOpenURL") { // if (document.frames[i].document.getElementById("divReportViewer") != null) // document.frames[i].document.getElementById("divReportViewer").style.height = '235px' // } // } } } //Added by sourabh with ref to task#223(SCWeb PhaseII): to reatin iFrameId if ($('input[id$=hiddenContainerControlToResize]').val() != "") { iFrameId = $('input[id$=hiddenContainerControlToResize]').val(); } else { $('input[id$=hiddenContainerControlToResize]').val(iFrameId); } //end here if (NoteType == -1) { if (KeyScreenTabIndex == 1) { if ($('input[id$=hiddenContainerControlToResize]').val() == "") { ResizeContainer('ServiceNoteTabPage_C1'); } else { ResizeContainer($('input[id$=hiddenContainerControlToResize]').val()); } } else { ResizeContainer($('input[id$=hiddenContainerControlToResize]').val()); } } else { ResizeContainer($('input[id$=hiddenContainerControlToResize]').val()); } //--------StartCode Written by Pradeep to resize pdf viewer to avoid unwanted vertical scrool bar wrf to task 223 in Scweb phase II bugs/Features var DivOpenURLheight = $('#DivOpenURL').height(); if (button_DocumentInformation_ShowSignature.val() == "Less Detail") { if ($('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').contents().find('span#pdfViewerControl').length > 0 && $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').contents().find('span#pdfViewerControl > object').length > 0 && frameHeightToResize != 0) { $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').contents().find('span#pdfViewerControl').css('height', $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').height()); $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').contents().find('span#pdfViewerControl > object').css('height', $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').height()); $('#DivOpenURL').height($('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').height() + 2); } } else { if ($('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').contents().find('span#pdfViewerControl').length > 0 && $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').contents().find('span#pdfViewerControl > object').length > 0) { $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').contents().find('span#pdfViewerControl').css('height', $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').height()); $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').contents().find('span#pdfViewerControl > object').css('height', $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').height()); $('#DivOpenURL').height($('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').height() + 2); } } //--------End Code Written by Pradeep to resize pdf viewer to avoid unwanted vertical scrool bar //Added by sourabh to resize report viewer to avoid unwanted vertical scrool bar var ReportViewer = $('div#DivOpenURL').find('iframe[name=iFrameOpenURL]').contents().find('#divReportViewer'); if (button_DocumentInformation_ShowSignature.val() == "Less Detail") { if (ReportViewer != null && ReportViewer.length > 0 && ReportViewer.find('#ReportViewer1').length > 0 && frameHeightToResize != 0) { ReportViewer.css('height', frameHeightToResize); ReportViewer.find('#ReportViewer1').css('height', frameHeightToResize - 4); } } else { if (ReportViewer != null && ReportViewer.length > 0 && ReportViewer.find('#ReportViewer1').length > 0) { ReportViewer.css('height', $('#iFrameOpenURL').height() - 4); ReportViewer.find('#ReportViewer1').css('height', $('#iFrameOpenURL').height() - 40); } } //end here // Calling funcion to handle View Only Permission functionality DisableButtonforViewMode(); } /**************************************************************************************/ //Author - Vikas Monga //Purpose show signature box. function HideSignatureBox() { $('#Table_DocumentInformation_Signature').css('display', 'none'); $('#Table_DocumentInformation_Acknowledgement').css('display', 'none'); $('#Button_DocumentInformation_ShowSignature').val("More Detail"); // $('#DocumentContents_ContentPlaceHolder_Middle')[0].style.height = '330px'; } function LoadDocumentInGroupService(screenId, filterData, hid, UcName) { //added by shifali in ref to not load document if status=cancel and disableCancelNote='Y' //check for document and related service status, if saved service status = 73 and disableCancel Notes='Y', then we //wont load Document in Note tab. if (DocumentToShowInGroupService(filterData) && screenId && UcName) { //Added in ref to task #2282 for not saving the history for note tab AddHistoryPoint = false; try { var grpServiceCount = AutoSaveXMLDom.find('GroupServices').length; if (grpServiceCount > 1) { var methodName = arguments.callee.caller.toString(); methodName = methodName.substr('function '.length); methodName = methodName.substr(0, methodName.indexOf('(')); var dgError = new Error("Duplicate Group Service found: Method:" + methodName); LogClientSideException(dgError, 'LoadDocumentInGroupService', 3); } } catch (e) { } PopupProcessing(); // $.post("../BasePages/Documents.aspx?scId=" + screenId, 'ajaxRequest=true' + '&UCName'+UcName+'&action=LoadDocInGroupService&requestParametersValues=' + filterData + '&historyId=' + hid + '&hiddenFieldApplicationHistoryXML=' + "", LoadDocumentCallBack); //$.post("../BasePages/Documents.aspx?scId=" + screenId, 'ajaxRequest=true&xmlString=' + encodeText(AutoSaveXMLDom[0].xml) + '&UCName' + UcName + '&action=LoadDocInGroupService&requestParametersValues=' + filterData + '&isExternalURL=' + isExternalURL + '&historyId=' + hid + '&hiddenFieldApplicationHistoryXML=' + "", LoadDocumentCallBack); $.ajax({ type: "POST", url: "../BasePages/Documents.aspx?scId=" + screenId, data: 'ajaxRequest=true&xmlString=' + encodeText(AutoSaveXMLDom[0].xml) + '&UCName' + UcName + '&action=LoadDocInGroupService&requestParametersValues=' + filterData + '&isExternalURL=' + isExternalURL + '&historyId=' + hid + '&hiddenFieldApplicationHistoryXML=' + "", success: LoadDocumentCallBack, error: function (result, status, err) { ShowHideErrorMessage('Error occured while loading document in group service. Please contact the sytem administrator', 'true'); var methodName = arguments.callee.caller.toString(); methodName = methodName.substr('function '.length); methodName = methodName.substr(0, methodName.indexOf('(')); var logInformation = new Error("Error occured in LoadDocumentInGroupService - " + isNullORUndefined(AutoSaveXMLDom[0].xml) + "callerMethodName- " + isNullORUndefined(methodName)); LogClientSideException(result, 'Documents.js', 2, logInformation); } }); } } function LoadDocumentInGroupTemplate(screenId, filterData, hid, UcName) { try { var grpServiceCount = AutoSaveXMLDom.find('GroupServices').length; if (grpServiceCount > 1) { var methodName = arguments.callee.caller.toString(); methodName = methodName.substr('function '.length); methodName = methodName.substr(0, methodName.indexOf('(')); var dgError = new Error("Duplicate Group Service found: Method:" + methodName); LogClientSideException(dgError, 'LoadDocumentInGroupTemplate', 3); } } catch (e) { } AddHistoryPoint = false; PopupProcessing(); // $.post("../BasePages/Documents.aspx?scId=" + screenId, 'ajaxRequest=true&xmlString=' + encodeText(AutoSaveXMLDom[0].xml) + '&UCName' + UcName + '&action=LoadDocInGroupTemplate&requestParametersValues=' + filterData + '&isExternalURL=' + isExternalURL + '&historyId=' + hid + '&hiddenFieldApplicationHistoryXML=' + "", LoadDocumentCallBack); $.ajax({ type: "POST", url: "../BasePages/Documents.aspx?scId=" + screenId, data: 'ajaxRequest=true&xmlString=' + encodeText(AutoSaveXMLDom[0].xml) + '&UCName' + UcName + '&action=LoadDocInGroupTemplate&requestParametersValues=' + filterData + '&isExternalURL=' + isExternalURL + '&historyId=' + hid + '&hiddenFieldApplicationHistoryXML=' + "", success: LoadDocumentCallBack, error: function (result, status, err) { ShowHideErrorMessage('Error occured while loading document in group Template. Please contact the sytem administrator', 'true'); var methodName = arguments.callee.caller.toString(); methodName = methodName.substr('function '.length); methodName = methodName.substr(0, methodName.indexOf('(')); var logInformation = new Error("Error occured in LoadDocumentInGroupTemplate - " + isNullORUndefined(AutoSaveXMLDom[0].xml) + "callerMethodName- " + isNullORUndefined(methodName)); LogClientSideException(result, 'Documents.js', 2, logInformation); } }); } function LoadDocumentInBedCensus(screenId, filterData, hid, UcName) { filterData += '^UnsavedChangeId=' + UnsavedChangeId; if (CallBackAction != '') { filterData += '^CallBackAction=' + CallBackAction; } CallBackAction = ''; // $.post("../BasePages/Documents.aspx?scId=" + screenId, 'ajaxRequest=true&xmlString=' + encodeText(AutoSaveXMLDom[0].xml) + '&UCName=' + UcName + '&action=LoadDocInBedCensus&requestParametersValues=' + filterData + '&isExternalURL=' + isExternalURL + '&historyId=' + hid + '&hiddenFieldApplicationHistoryXML=' + "", LoadDocumentCallBack); $.ajax({ type: "POST", url: "../BasePages/Documents.aspx?scId=" + screenId, data: 'ajaxRequest=true&xmlString=' + encodeText(AutoSaveXMLDom[0].xml) + '&UCName=' + UcName + '&action=LoadDocInBedCensus&requestParametersValues=' + filterData + '&isExternalURL=' + isExternalURL + '&historyId=' + hid + '&hiddenFieldApplicationHistoryXML=' + "", success: LoadDocumentCallBack, error: function (result, status, err) { ShowHideErrorMessage('Error occured while loading document in Bed Census. Please contact the sytem administrator', 'true'); var methodName = arguments.callee.caller.toString(); methodName = methodName.substr('function '.length); methodName = methodName.substr(0, methodName.indexOf('(')); var logInformation = new Error("Error occured in LoadDocumentInBedCensus - " + isNullORUndefined(AutoSaveXMLDom[0].xml) + "callerMethodName- " + isNullORUndefined(methodName)); LogClientSideException(result, 'Documents.js', 2, logInformation); } }); } /**************************************************************************************/ //Author - Vikas Monga //Purpose Get Document information. //Changes By Sonia to add parameters related to relativePath and Page action function LoadDocument(screenId, controltype, filterData, hid, relativePath, pageAction, pageData, containerChanged, screenTabIndex, checkForScreenHitCount) { //EI#564 - Implement Verbose Mode Logging in SmartCare Application EventTrap("Documents", "LoadDocument", "screenId - " + isNullORUndefined(screenId) + "^" + "controltype - " + isNullORUndefined(controltype) + "filterData - " + isNullORUndefined(filterData) + "^" + "hid - " + isNullORUndefined(hid) + "^" + "relativePath - " + isNullORUndefined(relativePath) + "^" + "pageAction - " + isNullORUndefined(pageAction) + "^" + "pageData - " + isNullORUndefined(pageData) + "^" + "containerChanged - " + isNullORUndefined(containerChanged) + "^" + "screenTabIndex - " + isNullORUndefined(screenTabIndex) + "^" + "checkForScreenHitCount - " + isNullORUndefined(checkForScreenHitCount) + ""); try { if (relativePath == undefined || relativePath == '') relativePath = GetRelativePath(); if (pageAction == undefined) pageAction = pageActionEnum.None; var historyXml = ""; if (AddHistoryPoint == true) historyXml = $('input[id$=hiddenFieldHistoryXML]').val(); if (screenId == 755 && historyXml == "") { historyXml = $('input[id$=hiddenFieldHistoryXML]').val(); } //Below Code Add by Rakesh to handle & empersend charater in filter data w.rf. to task 301 filterData = filterData.replace(/&/g, "%26"); filterData = filterData.replace(/%26/g, ''); //Below Code Add by Rakesh to handle & empersend charater in filter data & history w.rf. to task 114 in SC web phase II bugs/Features historyXml = historyXml.replace(/&/g, "%26"); try { var grpServiceCount = AutoSaveXMLDom.find('GroupServices').length; if (grpServiceCount > 1) { var methodName = arguments.callee.caller.toString(); methodName = methodName.substr('function '.length); methodName = methodName.substr(0, methodName.indexOf('(')); var dgError = new Error("Duplicate Group Service found: Method:" + methodName); LogClientSideException(dgError, 'LoadDocument', 3); } } catch (e) { } if (checkForScreenHitCount == true && ScreenHitCount > GetScreenHitCountConfigurableValue() && pageAction != pageActionEnum.CustomAjaxCall) { //What - Instead of calling new summary page have used a common method to Update History in session //Code which was being used before that has been removed //Why - To fix Dashboard jumping issue UpdateHistoryInSessionForPostBack(); } else { //Modified by sourabh to resolve special character issue with ref to task#512(SC Web PhaseII) // $.post(relativePath + "BasePages/Documents.aspx?scId=" + screenId + '&isExternalURL=' + isExternalURL, //'ajaxRequest=true' + '&action=' + pageAction + '&TabIndex=' + screenTabIndex + '&requestParametersValues=' + filterData + '&historyId=' + hid + '&hiddenFieldApplicationHistoryXML=' + encodeText(historyXml) + "&containerChanged=" + containerChanged + "&CurrentBannerTabIndex=" + globalBannerTabIndex, //function (result) { LoadDocumentCallBack(result, containerChanged); }); $.ajax({ type: "POST", url: relativePath + "BasePages/Documents.aspx?scId=" + screenId + '&isExternalURL=' + isExternalURL, data: 'ajaxRequest=true' + '&action=' + pageAction + '&TabIndex=' + screenTabIndex + '&requestParametersValues=' + filterData + '&historyId=' + hid + '&hiddenFieldApplicationHistoryXML=' + encodeText(historyXml) + "&containerChanged=" + containerChanged + "&CurrentBannerTabIndex=" + globalBannerTabIndex + "&DFATabIndex=" + dfaTabIndex, success: function (result) { LoadDocumentCallBack(result, containerChanged); }, error: function (result, status, err) { ShowHideErrorMessage('Error occured while loading document. Please contact the sytem administrator', 'true'); var methodName = arguments.callee.caller.toString(); methodName = methodName.substr('function '.length); methodName = methodName.substr(0, methodName.indexOf('(')); var logInformation = new Error("Error occured in LoadDocument - " + isNullORUndefined(AutoSaveXMLDom[0].xml) + "callerMethodName- " + isNullORUndefined(methodName)); LogClientSideException(result, 'Documents.js', 2, logInformation); } }); //end here PopupProcessing(); } } catch (Ex) { alert(Ex); } } /**************************************************************************************/ //Author - Vikas Monga //Purpose CallBack function for LoadDocument. function LoadDocumentCallBack(result, containerChanged) { //EI#564 - Implement Verbose Mode Logging in SmartCare Application EventTrap("Documents", "LoadDocumentCallBack", "containerChanged - " + isNullORUndefined(containerChanged) + ""); SaveInProgress = "False"; CallSetScreenSpecificValues = false; if (typeof ServiceSaveInProgress != 'undefined') ServiceSaveInProgress = false; try { if (DeserailizePageResponse(result) == true) { //By Vikas Vyas In ref to Implement Service Note Architecture //EI#571 check whether logged in staff has the permission to access the tab, if permission denied then display a message tabUCPathInContext = objectPageResponse.LoadedUcPath; // if (CheckTabAuthorization() == false) { return false; } ClientName = objectPageResponse.ClientName; //End if (objectPageResponse.ObjectDocumentInformation) { DocumentInfo.DocumentCodeId = objectPageResponse.ObjectDocumentInformation.DocumentCodeId; DocumentInfo.DocumentNavigationName = objectPageResponse.ObjectDocumentInformation.DocumentNavigationName; DocumentInfo.DocumentViewMode = objectPageResponse.ObjectDocumentInformation.DocumentViewMode; DFATableNamesUsedInDocuments = objectPageResponse.ObjectDocumentInformation.DFATableNames; } // Function to store the outerContainer Html in PDFJsContainer div GetPDFOuterContainerHTML(); if ($("#DivOpenURL") != null && $("#DivOpenURL").length > 0) { $("#DivOpenURL")[0].innerHTML = ''; $("#DivOpenURL").html(''); $("#DivOpenUrlContainer").hide(); // Added by Maninder } var bindAutoSave = false; if (objectPageResponse.CallBackAction == pageActionEnum.New) { Dirty = "False"; if (ApplicationId != undefined && ApplicationId == 2) { window.external.AfterUpdateProcess(UnsavedChangeId); } UnsavedChangeId = 0; SetAutoSaveInformation(); AutoSaveTimerInitialization(); // Author : Karan garg // Purpose : Initialize the Document Unlock process timer // Dated : 12 Dec 2011 // Ref. task #12 Threshold Dev Phase II DocumentLockTimerInitialization(); ReSetautoSaveVariables(); CreateNewDocumentPage(); CallBackAction = ''; return; } if (objectPageResponse.CallBackAction == 'MoveDocument') { Dirty = "False"; UnsavedChangeId = 0; SetAutoSaveInformation(); AutoSaveTimerInitialization(); // Author : Karan garg // Purpose : Initialize the Document Unlock process timer // Dated : 12 Dec 2011 // Ref. task #12 Threshold Dev Phase II DocumentLockTimerInitialization(); ReSetautoSaveVariables(); OpenMoveDiv(); $('#ImgButtonMoveDummy').click(); CallBackAction = ''; HidePopupProcessing(); return; } if (objectPageResponse.CallBackAction == 'closescreen') { //Added by Sonia with reference to CM Unsaved changes if (ApplicationId != undefined && ApplicationId == 2) { window.external.AfterUpdateProcess(UnsavedChangeId); } //Changes end here //added by shifali on 18th july,2010 to reset left div unsaved html ResetUnsavedChangesList(objectPageResponse.UnsavedChangesHTML, objectPageResponse.SupervisorMode); CallBackAction = ''; //Check if user click cloase button //if (objectPageResponse.ObjectDocumentInformation.DocumentStatusId == 22) { closeScreen = null; var RelativePath = GetRelativePath(); //Changed by Sonia as on close screen previous page should get opened //OpenPage(5764, 19, '', 2, RelativePath); OpenPreviousPageFromHistory(); return; // } // } //Code added by Loveena in ref to Handle Unsave Changes of CM/PA Events if (objectPageResponse.CallBackAction == "previous" || objectPageResponse.CallBackAction == "next") { Dirty = "False"; if (ApplicationId != undefined && ApplicationId == 2) { window.external.AfterUpdateProcess(UnsavedChangeId); } UnsavedChangeId = 0; SetAutoSaveInformation(); AutoSaveTimerInitialization(); // Author : Karan garg // Purpose : Initialize the Document Unlock process timer // Dated : 12 Dec 2011 // Ref. task #12 Threshold Dev Phase II DocumentLockTimerInitialization(); ReSetautoSaveVariables(); DocumentNavigation(objectPageResponse.CallBackAction); CallBackAction = ''; return; } if (objectPageResponse.CallBackAction == pageActionEnum.GoToDocument) { Dirty = "False"; if (ApplicationId != undefined && ApplicationId == 2) { window.external.AfterUpdateProcess(UnsavedChangeId); } UnsavedChangeId = 0; SetAutoSaveInformation(); AutoSaveTimerInitialization(); // Author : Karan garg // Purpose : Initialize the Document Unlock process timer // Dated : 12 Dec 2011 // Ref. task #12 Threshold Dev Phase II DocumentLockTimerInitialization(); ReSetautoSaveVariables(); //DocumentNavigation(objectPageResponse.CallBackAction); eval(_SaveDocumentCallBackFunction); CallBackAction = ''; return; } ManageDocumentToolbarItems(); //Handle Action Specfic code switch (objectPageResponse.Action) { case pageActionEnum.ToMove: if (objectPageResponse.UnsavedChangesDeleted == "Y") { //$("div[id$=UnSavedChangesLeftPaneGrid]").html(objectPageResponse.UnsavedChangesHTML); ResetUnsavedChangesList(objectPageResponse.UnsavedChangesHTML, objectPageResponse.SupervisorMode); } //Open Previous document if available if (PreviousDocumentId != 0) { DocumentNavigation("previous"); } //Open Next document if available else if (NextDocumentId != 0) { DocumentNavigation("next"); } //Temp code to move on client summary screen//Pending-If previous document is not available. else { var RelativePath = GetRelativePath(); //OpenPage(5764, 19, '', 2, RelativePath); OpenPreviousPageFromHistory(); } break; case pageActionEnum.LoadDocInGroupService: //screenid hardcoded for group services //added by shifali in ref to task for maintaining tabindex on save //as tabindex was being rest in framework fn 'Deserializ' TabIndex = customTabIndex; CurrentScreenId = 46; $('input[id$=hiddenFieldCurrentScreenId]').val(46); ScreenType = 5761; var documentTables = ""; var pageResponse = objectPageResponse.ObjectDocumentInformation; if (pageResponse != null) { SetDocumentGlobalVaribales(pageResponse); } var DomTemp = $.xmlDOM(objectPageResponse.PageDataSetXml); //DocumentsNodes = DomTemp[0].childNodes[0].selectNodes("Documents"); //Below line commented by Maninder w.r.t task#2724 in Thresholds Bugs/Feature //var AuthorId = GetColumnValueInXMLNodeByKeyValue('Documents', 'DocumentId', pageResponse.DocumentId, 'AuthorId', DomTemp[0]); var Status = GetColumnValueInXMLNodeByKeyValue('Documents', 'DocumentId', pageResponse.DocumentId, 'Status', DomTemp[0]); var ServiceId = GetColumnValueInXMLNodeByKeyValue('Documents', 'DocumentId', pageResponse.DocumentId, 'ServiceId', DomTemp[0]); var savedServiceStatus = GetColumnValueInXMLNodeByKeyValue('Services', 'ServiceId', ServiceId, 'SavedServiceStatus', DomTemp[0]); //Added by Maninder: To retrive AuthorId from Services.ClinicianId var AuthorId = GetColumnValueInXMLNodeByKeyValue('Services', 'ServiceId', ServiceId, 'ClinicianId', DomTemp[0]); var documentVersionId = GetColumnValueInXMLNodeByKeyValue('DocumentVersions', 'DocumentId', pageResponse.DocumentId, 'DocumentVersionId', DomTemp[0]); $("#Hidden_SelectedNoteDocumentVersionID").val(documentVersionId); var ServiceStatus = ""; var CustomTableHasRows = ""; if (objectPageResponse.ScreenProperties.CustomTableHasRows != undefined) { CustomTableHasRows = objectPageResponse.ScreenProperties.CustomTableHasRows; } if (objectPageResponse.ScreenProperties.ServiceStatus != undefined) { ServiceStatus = objectPageResponse.ScreenProperties.ServiceStatus; } if (Status == 22 && pageResponse.UnsavedChangeId == 0) { //Do Nothing } //code commented by shifali ends here else if (Status == 22 && ServiceId != '') { //OpenURL(pageResponse.DocumentVersionId, true); var myDate = new Date(); var time = myDate + myDate.getMinutes() + myDate.getSeconds(); //Following commneted by Sonia for History Management // $('#iFrameOpenURL')[0].src = "../ReportViewer.aspx?DocumentVersionId=" + argDocumentVersionId + "&time=" + time; //added by shifali in ref to task# 336(PDF on Sign Service Note)-Group Services/Notes. var DivOpenURL = $("#DivOpenURL"); //Modified by RaghuM on 29Nov2012 under Task#2318 PDF- Issues. //What-reportViewerHeight modified to correct RDL's layout //Why-as report's layout was disturbing and showing additional scrollbar. var reportViewerHeight = "370"; var reprotViewerWidth = DivOpenURL.width(); //DivOpenURL.css({'overflow-y', 'none'}); var _reportUrl = "../ReportViewer.aspx?DocumentVersionId=" + pageResponse.DocumentVersionId + "&time=" + time + "&rpheight=" + reportViewerHeight + "&rpwidth=" + reprotViewerWidth; var iframeReports = '"; if (_divExport.length > 0) { _divExport[0].innerHtml = ''; _divExport.html(iFrameExport); } setTimeout("HidePopupProcessing()", 3000); } } //Author Kaushal Pandey Purpose to open OCR popup for associated documents #4088 Engineering Improvement Initiatives- NBL(I) - OCR Development function OCRClick() { var OCRDocumentVersionId = AutoSaveXMLDom.find("DocumentVersions:first DocumentVersionId").text(); window.open(GetRelativePath() + 'ActivityPages/Office/Custom/OCRImageRecordDetailPopup.aspx?FunctionName=OCRImageToPDF&DocumentVersionId=' + OCRDocumentVersionId + '', 'name_your_window', 'menubar=no,toolbar=no,directories=no,titlebar=no,location=no,status=1,scrollbars=1,resizable=yes,width=1000,height=600'); } function OpenMCGPopUp() { var entityType = ''; var entityId = ''; var documentId = ''; if (UnsavedChangeId > 0) { ShowHideErrorMessage("Please save this before redirecting to MCG page", 'true'); return false; } if (AutoSaveXMLDom[0] != "" && AutoSaveXMLDom[0] != undefined && AutoSaveXMLDom[0].childNodes[0].selectNodes("Documents").length > 0) { if (AutoSaveXMLDom[0].childNodes[0].selectNodes("Documents")[0].selectSingleNode("DocumentId") != null) { entityId = AutoSaveXMLDom[0].childNodes[0].selectNodes("Documents")[0].selectSingleNode("DocumentId").text; entityType = 'D'; documentId = entityId; } } if (AutoSaveXMLDom[0] != "" && AutoSaveXMLDom[0] != undefined && AutoSaveXMLDom[0].childNodes[0].selectNodes("Events").length > 0) { if (AutoSaveXMLDom[0].childNodes[0].selectNodes("Events")[0].selectSingleNode("EventId") != null) { entityId = AutoSaveXMLDom[0].childNodes[0].selectNodes("Events")[0].selectSingleNode("EventId").text; entityType = 'E'; } if (AutoSaveXMLDom[0].childNodes[0].selectNodes("Documents")[0].selectSingleNode("DocumentId") != null) { documentId = AutoSaveXMLDom[0].childNodes[0].selectNodes("Documents")[0].selectSingleNode("DocumentId").text; } } if (AutoSaveXMLDom[0] != "" && AutoSaveXMLDom[0] != undefined && AutoSaveXMLDom[0].childNodes[0].selectNodes("Services").length > 0) { if (AutoSaveXMLDom[0].childNodes[0].selectNodes("Services")[0].selectSingleNode("ServiceId") != null) { entityId = AutoSaveXMLDom[0].childNodes[0].selectNodes("Services")[0].selectSingleNode("ServiceId").text; entityType = 'S'; } if (AutoSaveXMLDom[0].childNodes[0].selectNodes("Documents")[0].selectSingleNode("DocumentId") != null) { documentId = AutoSaveXMLDom[0].childNodes[0].selectNodes("Documents")[0].selectSingleNode("DocumentId").text; } } if (entityId == 0 && entityType == 'D') { ShowHideErrorMessage("Please save this before redirecting to MCG page", 'true'); return false; } window.open(GetRelativePath() + 'Modules/MCGIndicia/WebPages/MCG.aspx?entityType=' + entityType + '&entityID=' + entityId + '&documentId=' + documentId + '', "", "Height=695,Width=1024,left=0,top=0"); } function OpenUseNotePopUpOnToolbar() { var _currentServiceId = AutoSaveXMLDom.find("Services:first ServiceId").text(); var _useNoteFromServiceId = AutoSaveXMLDom.find("Services:first UseNoteFromServiceId").text(); OpenPage(5765, "", "UseNoteFromServiceId=" + _useNoteFromServiceId + "^CurrentServiceId=" + _currentServiceId + "^PopUpType=" + "ToolBarPopup", 2, GetRelativePath(), 'T', 'dialogHeight: 300px; dialogWidth: 600px;dialogTitle:SmartCare; helpbutton:hide;', undefined, undefined, undefined, undefined, undefined, undefined, '62A5F580-208F-4E63-AA09-1B2F4CF45016'); } function LoadIFrameForDocumentReports() { var _PDFError = $('#iFrameOpenURL').contents().find('body').html().indexOf('PDFError'); if (_PDFError != -1) EnableDisableCoSigners(true); else EnableDisableCoSigners(false); } function EnableDisableCoSigners(EnableDisable) { $('#Button_DocumentInformation_Signer').attr("disabled", EnableDisable); $('#Button_DocumentInformation_Decline').attr("disabled", EnableDisable); $("select[id$=DropDownList_DocumentInformation_SignerList]").attr("disabled", EnableDisable); $("input[name$=Radio_SignerList]").each(function () { $(this).attr("disabled", EnableDisable); }); $("[name$=A_SignerList]").each(function () { $(this).attr("disabled", EnableDisable); }); }