{"version":3,"sources":["../js/Approvals.js"],"names":["Approval","approval","constants","g_oEvents","docChangeEvent","oDoc","g_oApproval","g_bDocNotChanged","g_oCompare","g_bManualAlignmentSet","g_oViewer","g_bReadOnly","g_oTextCompare","g_bDifferenceAnnotations","$","isEmptyObject","oComboControl","comboControl_GetControlById","documents","selectedDocumentIndex","greenlightApprovalId","document","documentStatus","g_oArchive","g_ArchivedDocumentStatus","getApproval","approvalId","documentId","oJSON","SessionId","g_szSessionId","ApprovalId","DocumentId","post","url","data","JSON","stringify","contentType","dataType","cache","success","oResponse","Status","jqXHR","Success","Errors","length","setApproval","parse","Contents","g_oGreenlightMessages","displayErrorBubble","displayErrorContentHTML","greenlightDocumentId","setAvailableCompareModes","eCompareMode","NoCompare","documentType","getApprovalUser","oApprover","oaApprovers","approvers","i","userId","g_oUserDetails","UserId","thirdPartyApproverId","ThirdParyMemberId","approverStatus","eApproverStatus","Pending","approverStatusDateTime","isReadOnly","bReadOnly","g_oMultiView","bMultiViewReadOnly","approvalStatus","oUser","updateApprovalButtonStates","ApprovalConditionsMet","removeClass","addClass","RejectionConditionsMet","renderApprovalBar","oBar","attr","szClass","g_bApprovalInformationHidden","Approved","ApprovedChanges","Rejected","renderApprovalIcons","c_bApproveWithCompare","hide","undefined","g_oCompareMode","g_bTextCompareInProgress","isSheriff","oApproval","szDate","convertUTCDateToLocal","approvalStatusDateTime","show","hasClass","tooltipster","is","off","c_szApprovalIconApprove","click","g_oAnnotations","checkForUnsavedAnnotation","onClickApprove","event","thisParent","parent","highlightSelectedButton","find","clearHighlightSelectedButton","slideToggle","this","c_szApprovalIconReject","onClickReject","renderApproverInfoList","remove","oApprovers","szHTML","approverType","eApproverType","Hidden","szImage","szStatusMouseOver","Group","c_szGroupApprovalPending","c_szApprovalPending","renderApproverDisplayName","hasChecklist","approvalUserId","c_szSheriffPrompt","append","szDisplayName","userDetails","EmailAddress","displayName","role","newApproval","validateReadOnly","g_iDefaultApprovalId","g_oReadOnlyApprovals","indexOf","renderChecklist","renderChecklistIconList","approverHasChecklistInApproval","g_oChecklist","publish","oApprovalUser","removeChecklist","user","initialiseChecklist","setApproverStatusServerCall","iStatus","szThirdPartyApproverId","ThirdPartyMemberId","parseInt","setApproverStatus_CH","always","status","Date","now","displaySuccessBubble","c_szSucessfullySavedApproverStatus","windowParent","g_oArtworkViewer","g_oAnnotationViewer","setTimeout","postMessage","ReadOnly","UserIsSheriffInApproval","userIsSheriffInApproval","bReturn","forEach","RegisterEvents","registerEvents","oEventService","subscribe","SetApproval","SetApproverStatus","setApproverStatus","bShowSheriffWarning","szPrompt","c_szSheriffWarningPrompt","oConfirmAction","oOutstandingUsers","grep","approver","oRejectedUsers","oNonApprovedTextClassificationAnnotations","g_oAnnotationsMade","annotation","g_iAnnotationType","eAnnotationTypes","TextClassification","g_oStatuses","annotationStatus","g_iAnnotationStatus","eAnnotationStatuses","Query","ToDo","c_szSheriffWarningRejectedApprovers","c_szSheriffWarningOutstandingApprovers","c_szSheriffWarningUnapprovedTextClassifications","displayConfirmBubble","SetBatchApproverStatus","setBatchApproverStatus","bBypassStatusWarning","BypassStatusWarnings","oResponseObject","Warning","WarningMessage","ViewIds","g_oViews","displayWarningBubble","c_szMissingAnnotationsWarning","c_szIncompleteChecklistWarning","TempViews","ViewId","push","g_iIndex","Load","bMoveAfterStatusSet","SetConstant","setConstant","constantName","value","hasOwnProperty","call","SetReadOnly","setReadOnly","readOnly","CreateAnnotationsReport","createAnnotationsReport","bUseCompareApproval","bShowPreviousApprovals","liDocuments","lockScreen","iApprovalId","iDateTimeZone","getTimezoneOffset","g_oCompareDocument","oApprovalIds","primaryApprovalId","secondaryApprovalIds","timeZone","dateFormat","g_oSettings","c_szDateFormat","hideApprovalInformation","window","open","error","c_szPrintAnnotationsFailed","unlockScreen","DocChangeEvent","HideApprovalInformation","html","RenderApproverDisplayName","approvalConditionsMet","displayWarnings","eDocumentTypes","ThreeD","oChecklist","ChecklistState","g_eChecklistItemState","Pass","makeChecklistTabVisible","rej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AYC,eACxBC,wBAAyB1P,YAAYkF,8BAItC1E,EAAEmB,KAAK,CACNC,IAAK,6CACLC,KAAMC,KAAKC,UAAUT,OACrBU,YAAa,kCACbC,SAAU,OACVC,OAAO,EACPC,QAAS,SAAUC,WACdA,UAAUG,QACboN,OAAOC,KAAK9N,KAAKa,MAAMP,UAAUQ,UAAW,UAG5CC,sBAAsBC,mBAAmBC,wBAAwBX,UAAUI,UAG7EqN,MAAO,WACNhN,sBAAsBC,mBAAmB0D,eAAesJ,+BAGzD/F,OAAO,WACPgG,kBAk/BDC,eAAgBlQ,eAChBmQ,wBA1BD,SAASP,2BACHtP,UAAUC,aAAeL,YAAYkF,8BACzC1E,EAAE,qBAAqB0P,KAAK,IAE7B1P,EAAE,uBAAuB0P,KAAK,IAC9B1P,EAAE,iBAAiB0P,KAAK,IACpBlQ,YAAYkF,8BACf1E,EAAE,gBAAgBgF,QAoBnB2K,0BAA2BlI,0BAC3BvD,sBA3xBD,SAAS0L,sBAAsBC,iBAO9B,OAJWhN,kBAIF6E,cAAgBvI,SAASoB,SAASqC,cAAgBkN,eAAeC,QAAUpH,aAAaqH,WAAWC,gBAAkBtH,aAAauH,sBAAsBC,OAG5JN,kBAGHlH,aAAayH,0BAGb/N,sBAAsB0K,qBAAqBE,kCAIrC,IAwwBR5I,uBA7vBD,SAASgM,uBAAuBR,iBAM/B,OAAmC,EAHdS,iBAAiBC,gBAAgBpQ,4BAA4B,4BAA4B,IAG3FqQ,OAAOvO,WAKrB+D,eAAeyK,oCAGfZ,iBACHxN,sBAAsB0K,qBAAqBC,gCAIrC,KA2uBR0D,2BAA4BzM,4BAhmCf","file":"Approvals-28c734ddb9.js","sourcesContent":["/*\r\n * Copyright (c) 2017 SGS Europe. All rights reserved.\r\n *\r\n * This program is the CONFIDENTIAL and PROPRIETARY property of 2017 SGS Europe.\r\n * Any unauthorised use, reproduction, or transfer of this program is strictly\r\n * prohibited.\r\n *\r\n * File Name:\tApprovals.js\r\n *\r\n * Description:\tEncapsulates the code for the approvals logic.\r\n * \r\n */\r\n\r\nvar Approval = (function () {\r\n\r\n\t\"use strict\";\r\n\r\n\t/**\r\n\t* Holds the approval that is currently loaded into the viewer.\r\n\t*/\r\n\tvar approval = {};\r\n\r\n\t/**\r\n\t* Holds the constants declared against the object.\r\n\t*/\r\n\tvar constants = {};\r\n\r\n\t/**\r\n\t* The original read only from the server.\r\n\t* This will hide/show the tools, but there is plenty of server side validation if they try to bypass this.\r\n\t*/\r\n\tvar g_bReadOnly = true;\r\n\r\n\t/**\r\n\t* This will hide any approval status information.\r\n\t*/\r\n\tvar g_bApprovalInformationHidden = true;\r\n\r\n\t/**\r\n\t * Set when doc change event called and the document has not been changed.\r\n\t * May not have full coverage as it was used for a specific purpose.\r\n\t */\r\n\tvar g_bDocNotChanged = false;\r\n\r\n\t/**\r\n\t* Object to subscribe and publish custom events\r\n\t*/\r\n\r\n\tvar g_oEvents = {};\r\n\r\n\t/**\r\n\t * Get the parameters and query the server for a annotation report.\r\n\t * @param {bool} bUseCompareApproval - Whether to use comparison approvals.\r\n\t * @param {bool} bShowPreviousApprovals - Whether to show previous approvals.\r\n\t * @param {array} liDocuments - Documents to make the report from.\r\n\t */\r\n\tfunction createAnnotationsReport(bUseCompareApproval, bShowPreviousApprovals, liDocuments) {\r\n\r\n\t\t// Lock the screen.\r\n\t\tlockScreen();\r\n\r\n\t\t// Get the information for the current approval.\r\n\t\tvar iApprovalId = (approval == null ? 0 : approval.approvalId);\r\n\t\tvar iDateTimeZone = (new Date).getTimezoneOffset();\r\n\r\n\t\t// If we are using the compare approval, use the information for the compare approval.\r\n\t\tif (bUseCompareApproval) {\r\n\t\t\tfor (var i = 0; i < liDocuments.length; i++) {\r\n\t\t\t\tif (liDocuments[i].greenlightDocumentId == g_oCompare.g_oCompareDocument.greenlightDocumentId) {\r\n\t\t\t\t\tiApprovalId = liDocuments[i].greenlightApprovalId;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If a user wants all approvals we need to loop around the comparable documents from the\r\n\t\t// viewer and add the IDs which can then be used to get the PDF.\r\n\t\tvar oApprovalIds = [];\r\n\t\toApprovalIds.push(0);\r\n\t\tif (bShowPreviousApprovals) {\r\n\t\t\tfor (var i = 0; i < liDocuments.length; i++) {\r\n\t\t\t\t// Double check the document id is not the same as the current approval, isn't 0 and that the approval id is smaller than the current approval.\r\n\t\t\t\t// This is to stop future versions of a report appearing on the proof report.\r\n\t\t\t\tif ((liDocuments[i].greenlightApprovalId != iApprovalId) && liDocuments[i].greenlightApprovalId > 0 && (liDocuments[i].greenlightApprovalId < iApprovalId)) {\r\n\t\t\t\t\toApprovalIds.push(liDocuments[i].greenlightApprovalId);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Create Server Call for the data.\r\n\t\tvar oJSON = {\r\n\t\t\tprimaryApprovalId: iApprovalId,\r\n\t\t\tsecondaryApprovalIds: oApprovalIds,\r\n\t\t\ttimeZone: iDateTimeZone,\r\n\t\t\tdateFormat: g_oSettings.c_szDateFormat,\r\n\t\t\thideApprovalInformation: g_oApproval.g_bApprovalInformationHidden\r\n\t\t};\r\n\r\n\t\t// Call the server to create the annotations report.\r\n\t\t$.post({\r\n\t\t\turl: \"GreenlightApproval/createAnnotationsReport\",\r\n\t\t\tdata: JSON.stringify(oJSON),\r\n\t\t\tcontentType: \"application/json; charset=utf-8\",\r\n\t\t\tdataType: \"json\",\r\n\t\t\tcache: false,\r\n\t\t\tsuccess: function (oResponse) {\r\n\t\t\t\tif (oResponse.Success) {\r\n\t\t\t\t\twindow.open(JSON.parse(oResponse.Contents), \"_blank\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tg_oGreenlightMessages.displayErrorBubble(displayErrorContentHTML(oResponse.Errors));\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\terror: function () {\r\n\t\t\t\tg_oGreenlightMessages.displayErrorBubble(g_oAnnotations.c_szPrintAnnotationsFailed);\r\n\t\t\t}\r\n\t\t})\r\n\t\t.always(function () {\r\n\t\t\tunlockScreen();\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Called when the document has been changed.\r\n\t * @param {Document Object} oDoc- The value of the selected document.\r\n\t */\r\n\tfunction docChangeEvent(oDoc) {\r\n\t\t\r\n\t\t// If we have changed the document reset the manual alignment to auto-align trim boxes\r\n\t\tif (!g_oApproval.g_bDocNotChanged) {\r\n\t\t\tg_oCompare.g_bManualAlignmentSet = false;\r\n\t\t}\r\n\r\n\t\t// Reset flags.\r\n\t\tg_oViewer.g_bReadOnly = false;\r\n\t\tg_oApproval.g_bDocNotChanged = false;\r\n\t\tg_oTextCompare.g_bDifferenceAnnotations = false;\r\n\r\n\t\t// Ensure we have a document.\r\n\t\tif ($.isEmptyObject(oDoc) || oDoc === null) {\r\n\t\t\tvar oComboControl = comboControl_GetControlById(\"approvalNameComboControl\", false);\r\n\t\t\toDoc = oComboControl.documents[oComboControl.selectedDocumentIndex];\r\n\t\t}\r\n\t\t\r\n\t\t// If this document has an approval id, and is not archived.\r\n\t\tif (oDoc.greenlightApprovalId > 0 && oDoc.document.documentStatus != g_oArchive.g_ArchivedDocumentStatus) {\r\n\r\n\t\t\t// Get the approval for the selected document.\r\n\t\t\tgetApproval(oDoc.greenlightApprovalId, oDoc.greenlightDocumentId);\r\n\t\t}\r\n\t\t// If this document does not have an approval id.\r\n\t\telse {\r\n\r\n\t\t\t// Reset the list of available compare types.\r\n\t\t\tg_oCompare.setAvailableCompareModes(eCompareMode.NoCompare, oDoc.document.documentType, oDoc.document.documentType);\r\n\r\n\t\t\t// Set the approval.\r\n\t\t\tsetApproval(null);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the approval from the database.\r\n\t * @param {int} approvalId - Id of the approval we are getting.\r\n\t * @param {int} documentId - Id of the document relating to the approval.\r\n\t */\r\n\tfunction getApproval(approvalId, documentId) {\r\n\t\tvar oJSON = {\r\n\t\t\tSessionId: g_szSessionId,\r\n\t\t\tApprovalId: approvalId,\r\n\t\t\tDocumentId: documentId\r\n\t\t};\r\n\t\t\r\n\t\t$.post({\r\n\t\t\turl: \"GreenlightApproval/getApproval\",\r\n\t\t\tdata: JSON.stringify(oJSON),\r\n\t\t\tcontentType: \"application/json; charset=utf-8\",\r\n\t\t\tdataType: \"json\",\r\n\t\t\tcache: false,\r\n\t\t\tsuccess: function (oResponse, Status, jqXHR) {\r\n\t\t\t\tif (oResponse.Success && oResponse.Errors.length === 0) {\r\n\t\t\t\t\t// Reset ReadOnly flag.\r\n\t\t\t\t\tg_oViewer.g_bReadOnly = false;\r\n\t\t\t\t\tsetApproval(JSON.parse(oResponse.Contents));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tg_oGreenlightMessages.displayErrorBubble(displayErrorContentHTML(oResponse.Errors));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the approval details for this user.\r\n\t * @returns {object} - the approval user details.\r\n\t */\r\n\tfunction getApprovalUser() {\r\n\r\n\t\t// Create the approver to be returned.\r\n\t\tvar oApprover = null;\r\n\r\n\t\t// Extract the approvers.\r\n\t\tvar oaApprovers = approval.approvers;\r\n\r\n\t\t// Get the user.\r\n\t\tfor (var i = 0; i < oaApprovers.length; i++) {\r\n\t\t\tif (oaApprovers[i].userId === g_oUserDetails.UserId && oaApprovers[i].thirdPartyApproverId === g_oUserDetails.ThirdParyMemberId) {\r\n\t\t\t\toApprover = oaApprovers[i];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If there not on the approval create a dummy account.\r\n\t\tif (oApprover === null) {\r\n\t\t\toApprover = {\r\n\t\t\t\tapproverStatus: eApproverStatus.Pending,\r\n\t\t\t\tapproverStatusDateTime: \"\",\r\n\t\t\t\tthirdPartyApproverId: null\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\t// Return the result.\r\n\t\treturn oApprover;\r\n\t}\r\n\r\n\t/**\r\n\t * Determines if the approval is read only.\r\n\t * @returns {bool} - Determines if the approval should be set read only.\r\n\t */\r\n\tfunction isReadOnly() {\r\n\t\tvar bReadOnly = false;\r\n\r\n\t\t// If we have set the approval as read only from the server.\r\n\t\t// Or we have set the view as read only from the multi view logic.\r\n\t\t// Then it is always going to be read only.\r\n\t\tif (g_oViewer.g_bReadOnly || (typeof (g_oMultiView) != \"undefined\" && g_oMultiView.bMultiViewReadOnly)) {\r\n\t\t\tbReadOnly = true;\r\n\t\t}\r\n\t\telse {\r\n\r\n\t\t\t// If there is no approval then it is read only.\r\n\t\t\tif (approval == null) {\r\n\t\t\t\tbReadOnly = true;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// If the approval is not pending then it is read only.\r\n\t\t\t\tif (approval.approvalStatus !== eApproverStatus.Pending) {\r\n\t\t\t\t\tbReadOnly = true;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\r\n\t\t\t\t\tvar oUser = getApprovalUser();\r\n\r\n\t\t\t\t\tif (oUser === null || oUser.thirdPartyApproverId === null || oUser.approverStatus !== eApproverStatus.Pending) {\r\n\r\n\t\t\t\t\t\tbReadOnly = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bReadOnly;\r\n\t}\r\n\r\n\t/**\r\n\t * The on click action for the approve icon.\r\n\t * @param {event} event - Reference to the onclick event.\r\n\t */\r\n\tfunction onClickApprove(event) {\r\n\r\n\t\t// Grab the parent div.\r\n\t\tvar thisParent = $(event).parent();\r\n\r\n\t\t// Highlight the button.\r\n\t\thighlightSelectedButton(thisParent, true);\r\n\r\n\t\t// Update the approval button states.\r\n\t\tupdateApprovalButtonStates();\r\n\r\n\t\t// If the dropdown is not open.\r\n\t\tif (!thisParent.find(\".dropdown-content\").is(\":visible\")) {\r\n\r\n\t\t\t// Toggle the dropdown.\r\n\t\t\t$(\"#divApprovalDropDown\").slideToggle(200);\r\n\t\t}\r\n\t\t// If the dropdown is already open.\r\n\t\telse {\r\n\r\n\t\t\t// Clear the highlight on the button.\r\n\t\t\tclearHighlightSelectedButton(thisParent);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * The on click action for the reject icon.\r\n\t * @param {event} event - Reference to the onclick event.\r\n\t */\r\n\tfunction onClickReject(event) {\r\n\r\n\t\t// Grab the parent div.\r\n\t\tvar thisParent = $(event).parent();\r\n\r\n\t\t// Highlight the button.\r\n\t\thighlightSelectedButton(thisParent, true);\r\n\r\n\t\t// Update the approval button states.\r\n\t\tupdateApprovalButtonStates();\r\n\r\n\t\t// If the dropdown is not open.\r\n\t\tif (!thisParent.find(\".dropdown-content\").is(\":visible\")) {\r\n\r\n\t\t\t// Toggle the dropdown.\r\n\t\t\t$(\"#divRejectionDropDown\").slideToggle(200);\r\n\t\t}\r\n\t\t// If the dropdown is already open.\r\n\t\telse {\r\n\r\n\t\t\t// Clear the highlight on the button.\r\n\t\t\tclearHighlightSelectedButton(thisParent);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the approval button states.\r\n\t */\r\n\tfunction updateApprovalButtonStates() {\r\n\r\n\t\t// Update the button states.\r\n\t\tg_oApproval.ApprovalConditionsMet(false) ? $(\"#btnConfirmApprove\").removeClass(\"approveRejectButton--disabled\") : $(\"#btnConfirmApprove\").addClass(\"approveRejectButton--disabled\");\r\n\t\tg_oApproval.ApprovalConditionsMet(false) ? $(\"#btnConfirmConditionalApprove\").removeClass(\"approveRejectButton--disabled\") : $(\"#btnConfirmConditionalApprove\").addClass(\"approveRejectButton--disabled\");\r\n\t\tg_oApproval.RejectionConditionsMet(false) ? $(\"#btnConfirmReject\").removeClass(\"approveRejectButton--disabled\") : $(\"#btnConfirmReject\").addClass(\"approveRejectButton--disabled\");\r\n\t}\r\n\r\n\t/**\r\n\t * Determines if the approval conditions have been met.\r\n\t * @param {bool} displayWarnings - If warnings should be displaid.\r\n\t */\r\n\tfunction approvalConditionsMet(displayWarnings) {\r\n\r\n\t\t// Get the current approval user.\r\n\t\tvar user = getApprovalUser();\r\n\r\n\t\t// Validate the users checklist.\r\n\t\t// If the user has a checklist and it is not in the correct state. (3D file checklists are not yet supported)\r\n\t\tif (user.hasChecklist && approval.document.documentType != eDocumentTypes.ThreeD && g_oChecklist.oChecklist.ChecklistState != g_oChecklist.g_eChecklistItemState.Pass) {\r\n\r\n\t\t\t// If we are displaying warnings.\r\n\t\t\tif (displayWarnings) {\r\n\r\n\t\t\t\t// Make the checklist visible.\r\n\t\t\t\tg_oChecklist.makeChecklistTabVisible();\r\n\r\n\t\t\t\t// Show that the checklist is incomplete.\r\n\t\t\t\tg_oGreenlightMessages.displayWarningBubble(c_szIncompleteChecklistWarning);\r\n\t\t\t}\r\n\r\n\t\t\t// Approval conditions not met.\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Approval conditions have been met.\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Determines if the rejection conditions have been made.\r\n\t * @param {bool} displayWarnings - If warnings should be displaid.\r\n\t */\r\n\tfunction rejectionConditionsMet(displayWarnings) {\r\n\r\n\t\t// Get the documents for the approval.\r\n\t\tvar oApprovalFiles = g_oApprovalFiles.g_oControlIndex[comboControl_GetControlById(\"approvalNameComboControl\", true)];\r\n\r\n\t\t// If the current approval has more than one document, we may have annotations on other documents, so we allow them to try and reject.\r\n\t\tif (oApprovalFiles.g_Docs.length > 1) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// In a single document approval, we need at least one annotation.\r\n\t\tif (!g_oAnnotations.checkAnnotationsExistOnDocument()) {\r\n\r\n\t\t\t// If we are displaying warnings, show we are missing annotations.\r\n\t\t\tif (displayWarnings) {\r\n\t\t\t\tg_oGreenlightMessages.displayWarningBubble(c_szMissingAnnotationsWarning);\r\n\t\t\t}\r\n\r\n\t\t\t// Rejection conditions not met.\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Rejection conditions met.\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * Registers the approvals events.\r\n\t * @param {object} oEventService - The event service we are registering the events to.\r\n\t */\r\n\tfunction registerEvents(oEventService) {\r\n\t\tg_oEvents = oEventService;\r\n\t\tg_oEvents.subscribe(\"changeDoc\", docChangeEvent);\r\n\t}\r\n\r\n\t/**\r\n\t * Renders the approval bar based upon the approval.\r\n\t */\r\n\tfunction renderApprovalBar() {\r\n\r\n\t\t// Reset the approval status bar.\r\n\t\tvar oBar = $(\"#divApprovalStatusBar\");\r\n\t\toBar.attr('class', 'approvalStatusBar');\r\n\r\n\t\tvar szClass = \"\";\r\n\r\n\t\t// If we have an approval and the viewer is not open in read only.\r\n\t\tif ((approval != null || !isReadOnly()) && !g_oApproval.g_bApprovalInformationHidden) {\r\n\r\n\t\t\t// Determine the approval bar status to be used.\r\n\t\t\tswitch (approval.approvalStatus) {\r\n\t\t\t\tcase eApproverStatus.Approved:\r\n\t\t\t\t\tszClass = \"approvalStatusBarApproved\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase eApproverStatus.ApprovedChanges:\r\n\t\t\t\t\tszClass = \"approvalStatusBarApprovedWithChanges\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase eApproverStatus.Pending:\r\n\t\t\t\t\tszClass = \"approvalStatusBarPending\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase eApproverStatus.Rejected:\r\n\t\t\t\t\tszClass = \"approvalStatusBarRejected\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Otherwise default to the pending status bar.\r\n\t\telse {\r\n\t\t\tszClass = \"approvalStatusBarPending\";\r\n\t\t}\r\n\r\n\t\t// Apply the class to the status bar.\r\n\t\toBar.addClass(szClass);\r\n\t}\r\n\r\n\t/**\r\n\t * Renders the correct approval icons.\r\n\t */\r\n\tfunction renderApprovalIcons() {\r\n\t\t\r\n\t\t// Nuke any existing icons (or highlights).\r\n\t\tif (!g_oApproval.c_bApproveWithCompare || isReadOnly()) {\r\n\t\t\t$(\".ApprovalIcon\").hide();\r\n\t\t}\r\n\r\n\t\t// Reset options.\r\n\t\t$(\".selectedButton\").removeClass(\"selectedButton\");\r\n\t\t$(\".dropdown-content\").hide();\r\n\t\t$(\"#tblBatchApprovalTools\").hide();\r\n\t\t$(\"#btnPendingApproval\").hide();\r\n\r\n\t\t// Show no icons if we have no approval or we are in a compare / text compare.\r\n\t\tif (approval === null || (g_oViewer.g_oCompareMode != undefined && g_oViewer.g_oCompareMode != eCompareMode.NoCompare && !g_oTextCompare.g_bTextCompareInProgress)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Get the approval user.\r\n\t\tvar oApprover = getApprovalUser();\r\n\r\n\t\t// If the user is a Sheriff on the current approval, hide the conditional approve icon.\r\n\t\tif (oApprover.isSheriff) {\r\n\t\t\t$(\"#divConfirmConditionalApproval\").hide();\r\n\t\t}\r\n\r\n\t\t// Get the approval and read only status.\r\n\t\tvar oApproval = approval;\r\n\t\tvar bReadOnly = isReadOnly();\r\n\r\n\t\t// If we are in text compare, and we are not in read only, set that we can leave difference annotations on the text compare.\r\n\t\tif (g_oTextCompare.g_bTextCompareInProgress) {\r\n\t\t\tif (!bReadOnly) {\r\n\t\t\t\tg_oTextCompare.g_bDifferenceAnnotations = true;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// If the viewer is read-only, remove the clickable icons.\r\n\t\tif (bReadOnly && !g_oApproval.g_bApprovalInformationHidden) {\r\n\t\t\tvar szDate = \"\";\r\n\t\t\tif (oApproval.approvalStatus != eApproverStatus.Pending) {\r\n\t\t\t\tszDate = convertUTCDateToLocal(oApproval.approvalStatusDateTime);\r\n\t\t\t}\r\n\r\n\t\t\tswitch (oApproval.approvalStatus) {\r\n\t\t\t\tcase eApproverStatus.Approved:\r\n\t\t\t\t\t$(\"#btnApprove\").show();\r\n\t\t\t\t\tif ($(\"#btnApprove\").hasClass(\"tooltipstered\")) {\r\n\t\t\t\t\t\t// The control has already been hovered over by the mouse and Tooltipster has created the custom tooltip and removed the 'title' attribute.\r\n\t\t\t\t\t\t$(\"#btnApprove\").tooltipster('content', szDate);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$(\"#btnApprove\").attr(\"title\", szDate);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase eApproverStatus.ApprovedChanges:\r\n\t\t\t\t\t$(\"#btnConditionallyApproved\").show();\r\n\t\t\t\t\tif ($(\"#btnConditionallyApproved\").hasClass(\"tooltipstered\")) {\r\n\t\t\t\t\t\t// The control has already been hovered over by the mouse and Tooltipster has created the custom tooltip and removed the 'title' attribute.\r\n\t\t\t\t\t\t$(\"#btnConditionallyApproved\").tooltipster('content', szDate);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$(\"#btnConditionallyApproved\").attr(\"title\", szDate);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase eApproverStatus.Pending:\r\n\t\t\t\t\t$(\"#btnPendingApproval\").show();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase eApproverStatus.Rejected:\r\n\t\t\t\t\t$(\"#btnReject\").show();\r\n\t\t\t\t\tif ($(\"#btnReject\").hasClass(\"tooltipstered\")) {\r\n\t\t\t\t\t\t// The control has already been hovered over by the mouse and Tooltipster has created the custom tooltip and removed the 'title' attribute.\r\n\t\t\t\t\t\t$(\"#btnReject\").tooltipster('content', szDate);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$(\"#btnReject\").attr(\"title\", szDate);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// Check the user has requested for the approval menu to vanish\r\n\t\t\tif (!g_oApproval.c_bApproveWithCompare) {\r\n\t\t\t\t// Remove the drop downs if they are visible.\r\n\t\t\t\tif ($(\"#divRejectionDropDown\").is(\":visible\")) {\r\n\t\t\t\t\t$(\"#divRejectionDropDown\").hide();\r\n\t\t\t\t}\r\n\t\t\t\tif ($(\"#divApprovalDropDown\").is(\":visible\")) {\r\n\t\t\t\t\t$(\"#divApprovalDropDown\").hide();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (!bReadOnly && !g_oApproval.g_bApprovalInformationHidden) {\r\n\t\t\t$(\".ApprovalIcon\").off(\"click\"); // Make sure the click Events do not exist before re-binding them.\r\n\r\n\t\t\t$(\"#tblBatchApprovalTools\").show();\r\n\r\n\t\t\tif ($(\"#btnApprove\").hasClass(\"tooltipstered\")) {\r\n\t\t\t\t$(\"#btnApprove\").tooltipster('content', g_oApproval.c_szApprovalIconApprove);\r\n\t\t\t}\r\n\r\n\t\t\t$(\"#btnApprove\").show();\r\n\t\t\t$(\"#btnApprove\").click(function () {\r\n\t\t\t\tif (!isReadOnly() && !g_oAnnotations.checkForUnsavedAnnotation()) {\r\n\t\t\t\t\tonClickApprove(this);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif ($(\"#btnReject\").hasClass(\"tooltipstered\")) {\r\n\t\t\t\t$(\"#btnReject\").tooltipster('content', g_oApproval.c_szApprovalIconReject);\r\n\t\t\t}\r\n\r\n\t\t\t$(\"#btnReject\").show();\r\n\t\t\t$(\"#btnReject\").click(function () {\r\n\t\t\t\tif (!isReadOnly() && !g_oAnnotations.checkForUnsavedAnnotation()) {\r\n\t\t\t\t\tonClickReject(this);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Renders the Approvers in the info list.\r\n\t */\r\n\tfunction renderApproverInfoList() {\r\n\t\t\r\n\t\t// Remove the existing content from the approver list.\r\n\t\t$(\"#tblApproverInfoList\").remove();\r\n\r\n\t\t// If we have no approval, or we are we are in a compare mode and we do not want to approve with Compare\r\n\t\tif (approval === null || ((g_oViewer.g_oCompareMode != undefined && g_oViewer.g_oCompareMode != eCompareMode.NoCompare) && !g_oApproval.c_bApproveWithCompare)) {\r\n\r\n\t\t\t// Hide the approval tools.\r\n\t\t\t$(\"#tblInfoTools\").hide();\r\n\t\t}\r\n\t\t// If we have an approval and we are not in a compare mode.\r\n\t\telse {\r\n\r\n\t\t\t// Show the approval tools when not hidden.\r\n\t\t\tif (!g_oApproval.g_bApprovalInformationHidden) {\r\n\t\t\t\t$(\"#tblInfoTools\").show();\r\n\t\t\t}\r\n\r\n\t\t\t// Get a list of the approvers.\r\n\t\t\tvar oApprovers = approval.approvers;\r\n\r\n\t\t\t// Create a table to hold the approvers list.\r\n\t\t\tvar szHTML = \"
\" + renderApproverDisplayName(oApprovers[i]) + \" | \";\r\n\r\n\t\t\t\t// Add the approvers HasChecklist badge if appropriate. \r\n\t\t\t\tszHTML += \"\";\r\n\t\t\t\tif (oApprovers[i].hasChecklist) {\r\n\t\t\t\t\tszHTML += \" | \";\r\n\r\n\t\t\t\t// Add the approvers sheriff badge if appropriate.\r\n\t\t\t\tszHTML += \"\";\r\n\t\t\t\tif (oApprovers[i].isSheriff) {\r\n\t\t\t\t\tszHTML += \"![]() | \";\r\n\r\n\r\n\t\t\t\t// Add the approvers status image.\r\n\t\t\t\tszHTML += \"\";\r\n\t\t\t\tszHTML += \" | \";\r\n\r\n\t\t\t\t// Close the approver row.\r\n\t\t\t\tszHTML += \"