{"version":3,"sources":["../js/ApprovalFiles.js"],"names":["g_oApprovalFiles","g_oControlIndex","Setup","iComboControl","g_Docs","g_iCurrentDocIndex","oCompareFiles","g_oaComboControls","documents","CurrentDocument","selectedDocumentIndex","greenlightApprovalId","i","length","greenlightDocumentId","push","Render","UpdateApprovalIcons","$","remove","readOnly","backBtnImg","nextBtnImg","szHTML","c_szPrevious","c_szNext","append","position","top","css","iNumberofDocs","document","Approval3DViewId","html","g_oApproval","c_szApprovalApproveAllDocuments","c_szApprovalConditionalApproveAllDocuments","c_szApprovalRejectAllDocuments","c_szApproveButtonApprove","c_szConditionalApproveButtonApprove","c_szRejectButtonReject","Next","oComboFiles","iControlBoxIndex","comboControl_SelectOption","Previous"],"mappings":"AAiBA,IAAIA,iBAAmB,CAGtBC,gBAAiB,GAMjBC,MAAO,SAAUC,eAEhBH,iBAAiBC,gBAAgBE,eAAiB,GAClDH,iBAAiBC,gBAAgBE,eAAeC,OAAS,GACzDJ,iBAAiBC,gBAAgBE,eAAeE,mBAAqB,EAGrE,IAAIC,cAAgBC,kBAAkBJ,eAAeK,UAGjDC,gBAAkBF,kBAAkBJ,eAAeK,UAAUD,kBAAkBJ,eAAeO,uBAElG,QAAiC,IAAtB,iBAA4E,EAAvCD,gBAAgBE,qBAG/D,IAAK,IAAIC,EAAI,EAAGA,EAAIN,cAAcO,OAAQD,IAErCN,cAAcM,GAAGD,uBAAyBF,gBAAgBE,uBAEzDF,gBAAgBK,uBAAyBR,cAAcM,GAAGE,uBAC7Dd,iBAAiBC,gBAAgBE,eAAeE,mBAAqBL,iBAAiBC,gBAAgBE,eAAeC,OAAOS,QAE7Hb,iBAAiBC,gBAAgBE,eAAeC,OAAOW,KAAKT,cAAcM,KAM7EZ,iBAAiBgB,OAAOb,eACF,IAAlBA,eACHH,iBAAiBiB,oBAAoBd,gBASvCa,OAAQ,SAAUb,eAMjB,GAHAe,EAAE,uBAAyBf,eAAegB,SAG0B,EAAhEnB,iBAAiBC,gBAAgBE,eAA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C,iBAAmB,EACd/B,EAAI,EAAGA,EAAI8B,YAAY7B,OAAQD,IACvC,GAAI8B,YAAY9B,GAAGE,uBAAyBd,iBAAiBC,gBAAgBE,eAAeC,OAAOJ,iBAAiBC,gBAAgBE,eAAeE,oBAAoBS,qBAAsB,CAC5L6B,iBAAmB/B,EACnB,MAIFgC,0BAA0BzC,cAAewC,kBAAmB,GAAG","file":"ApprovalFiles-e9565ee9ec.js","sourcesContent":["/*\r\n * Copyright (c) 2018 SGS Europe. All rights reserved.\r\n *\r\n * This program is the CONFIDENTIAL and PROPRIETARY property of 2018 SGS Europe.\r\n * Any unauthorised use, reproduction, or transfer of this program is strictly\r\n * prohibited.\r\n *\r\n * File Name: ApprovalFiles.js\r\n *\r\n * Description:\tAllows support for multiple files across a single approval and renders the navigation icon.\r\n *\t\t\t\tThis is dependant on the combo control navigation and essentially is just a helper control for the user.\r\n *\r\n * History:\t\t27-JUL-18\tJ Jackson\t\tInitial implementation.\r\n * 07-NOV-18 S Norman Exclude 3D View documents from count when updating the approval icons.\r\n *\r\n **/\r\n\r\nvar g_oApprovalFiles = {\r\n\r\n\t// Data held about the relevant combo control.\r\n\tg_oControlIndex: [],\r\n\r\n\t/**\r\n\t* Sets up the file select icon and class specific information.\r\n\t* @param {number} iComboControl - The index of the combo control we are using.\r\n\t*/\r\n\tSetup: function (iComboControl) {\r\n\t\t// Set the current ApprovalId.\r\n\t\tg_oApprovalFiles.g_oControlIndex[iComboControl] = {};\r\n\t\tg_oApprovalFiles.g_oControlIndex[iComboControl].g_Docs = [];\r\n\t\tg_oApprovalFiles.g_oControlIndex[iComboControl].g_iCurrentDocIndex = 0;\r\n\r\n\t\t// Get the files from the combo control.\r\n\t\tvar oCompareFiles = g_oaComboControls[iComboControl].documents;\r\n\r\n\t\t// Get the selected document from the control.\r\n\t\tvar CurrentDocument = g_oaComboControls[iComboControl].documents[g_oaComboControls[iComboControl].selectedDocumentIndex];\r\n\r\n\t\tif (typeof (CurrentDocument) !== \"undefined\" && CurrentDocument.greenlightApprovalId > 0) {\r\n\r\n\t\t\t// Calculate the list of documents on this approval using all the compare documents.\r\n\t\t\tfor (var i = 0; i < oCompareFiles.length; i++) {\r\n\r\n\t\t\t\tif (oCompareFiles[i].greenlightApprovalId === CurrentDocument.greenlightApprovalId) {\r\n\t\t\t\t\t// If the doc id matches, the one we are about to add is the current indexed value.\r\n\t\t\t\t\tif (CurrentDocument.greenlightDocumentId === oCompareFiles[i].greenlightDocumentId) {\r\n\t\t\t\t\t\tg_oApprovalFiles.g_oControlIndex[iComboControl].g_iCurrentDocIndex = g_oApprovalFiles.g_oControlIndex[iComboControl].g_Docs.length;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tg_oApprovalFiles.g_oControlIndex[iComboControl].g_Docs.push(oCompareFiles[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Render / Update.\r\n\t\tg_oApprovalFiles.Render(iComboControl);\r\n\t\tif (iComboControl === 0) {\r\n\t\t\tg_oApprovalFiles.UpdateApprovalIcons(iComboControl);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t/**\r\n\t* Renders the navigation control.\r\n\t* @param {number} iComboControl - The index of the combo control we are using.\r\n\t*/\r\n\tRender: function (iComboControl) {\r\n\r\n\t\t// Remove any existing control.\r\n\t\t$(\"#ApprovalFileSelect_\" + iComboControl).remove();\r\n\r\n\t\t// If there is more then one doc & the control is usable, render the control.\r\n\t\tif (g_oApprovalFiles.g_oControlIndex[iComboControl].g_Docs.length > 1 && !g_oaComboControls[iComboControl].readOnly) {\r\n\t\t\tvar backBtnImg = \"\";\r\n\t\t\tvar nextBtnImg = \"\";\r\n\t\t\t// If we are at the first file...\r\n\t\t\tif (g_oApprovalFiles.g_oControlIndex[iComboControl].g_iCurrentDocIndex === 0) {\r\n\t\t\t\tbackBtnImg = \"img/Last-Page_disabled_48.png\";\r\n\t\t\t\tnextBtnImg = \"img/Next-Page_blue_48.png\";\r\n\t\t\t}\r\n\t\t\t// If we are at the last file...\r\n\t\t\telse if (g_oApprovalFiles.g_oControlIndex[iComboControl].g_iCurrentDocIndex === (g_oApprovalFiles.g_oControlIndex[iComboControl].g_Docs.length - 1)) {\r\n\t\t\t\tbackBtnImg = \"img/Last-Page_blue_48.png\";\r\n\t\t\t\tnextBtnImg = \"img/Next-Page_disabled_48.png\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbackBtnImg = \"img/Last-Page_blue_48.png\";\r\n\t\t\t\tnextBtnImg = \"img/Next-Page_blue_48.png\";\r\n\t\t\t}\r\n\r\n\t\t\t// Build the document navigation for the document control.\r\n\t\t\tvar szHTML = \"\";\r\n\t\t\tszHTML += \"