55. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 11/9/2018 12:16:39 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

55.1 Files compared

# Location File Last Modified
1 RAMS-2.3.0.zip\RAMS-2.3.0\SitePages SiteConfig.html Mon Jun 4 06:44:22 2018 UTC
2 RAMS-2.3.0.zip\RAMS-2.3.0\SitePages SiteConfig.html Fri Nov 9 14:54:12 2018 UTC

55.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 2316
Changed 2 4
Inserted 0 0
Removed 0 0

55.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

55.4 Active regular expressions

No regular expressions were active.

55.5 Comparison detail

  1   <!--
  2   E1.1.0 RAM  Increment  1 Patch C ode
  3   January 20 15
  4   Department  of Vetera n's Affair s/Booz All en Hamilto n
  5   irb-applic ations-gen eral.html
  6   -->
  7   <!DOCTYPE  html>
  8   <html lang ="en" xmln s:mso="urn :schemas-m icrosoft-c om:office: office"
  9     xmlns:ms dt="uuid:C 2F41010-65 B3-11d1-A2 9F-00AA00C 14882">
  10   <head>
  11   <meta http -equiv="co ntent-type " content= "text/html ; charset= UTF-8">
  12   <meta char set="utf-8 ">
  13   <meta http -equiv="X- UA-Compati ble" conte nt="IE=edg e">
  14   <meta name ="descript ion" conte nt="">
  15   <meta name ="author"  content="V eterans Af fairs Rese arch Admin istrative  Management  System">
  16   <meta http -equiv="Pr agma" cont ent="no-ca che">
  17   <meta http -equiv="Ex pires" con tent="-1">
  18   <!-- Note  there is n o responsi ve meta ta g here -->
  19   <title>VA  RAMS</titl e>
  20   <!-- Boots trap core  CSS -->
  21   <link rel= "styleshee t" href=". ./SiteAsse ts/css/boo tstrap.min .css">
  22   <link href ="../SiteA ssets/css/ pace-theme -loading-b ar.css" re l="stylesh eet">
  23   <!-- Custo m styles f or this te mplate -->
  24   <link rel= "styleshee t" href=". ./SiteAsse ts/css/sty les.css">
  25   <link rel= "styleshee t" href=". ./SiteAsse ts/css/dat epicker.cs s">
  26   <link rel= "styleshee t" type="t ext/css" h ref="../Si teAssets/c ss/jquery. dataTables .css">
  27   <link rel= "styleshee t" type="t ext/css" h ref="../Si teAssets/c ss/jquery- ui.css">
  28   <!-- Must  go at top  or documen t.ready wi ll not wor k. The res t should b e at botto m -->
  29   <script ty pe="text/j avascript"  src="../S iteAssets/ js/jquery. js"></scri pt>
  30   <script ty pe="text/j avascript"  src="../S iteAssets/ js/jquery. dataTables .js" chars et="utf8"> </script>
  31   <script ty pe="text/j avascript"  src="../S iteAssets/ js/jquery- ui.js"></s cript>
  32   <script ty pe="text/j avascript"  src="../S iteAssets/ js/Microso ftAjax.js" ></script>
  33   <script ty pe="text/j avascript"  src="../S iteAssets/ js/rams-en vironment. js"></scri pt>
  34   <script ty pe="text/j avascript"  src="/sit es/IRBAppl ications/_ layouts/15 /sp.runtim e.js"></sc ript>
  35   <script ty pe="text/j avascript"  src="/sit es/IRBAppl ications/_ layouts/15 /sp.js"></ script>
  36   <script da ta-pace-op tions='{ " elements":  { "select ors": [".p ull-right" ] }, "star tOnPageLoa d": true } '
  37     src="../ SiteAssets /js/pace.j s"></scrip t>
  38   <!-- Just  for debugg ing purpos es. Don't  actually c opy these  2 lines! - ->
  39   <!--[if lt  IE 9]><sc ript src=" ../../asse ts/js/ie8- responsive -file-warn ing.js"></ script><![ endif]-->
  40   <script sr c="../Site Assets/js/ ie-emulati on-modes-w arning.js"  type="tex t/javascri pt"></scri pt>
  41   <!-- HTML5  shim and  Respond.js  IE8 suppo rt of HTML 5 elements  and media  queries - ->
  42   <!--[if lt  IE 9]>
  43         <scr ipt src=". ./SiteAsse ts/js/html 5shiv.min. js"></scri pt>
  44         <scr ipt src=". ./SiteAsse ts/js/resp ond.min.js "></script >
  45       <![end if]-->
  46   <!--[if gt e mso 9]>< xml>
  47   <mso:Custo mDocumentP roperties>
  48   <mso:ItemR etentionFo rmula msdt :dt="strin g"></mso:I temRetenti onFormula>
  49   <mso:_dlc_ policyId m sdt:dt="st ring"></ms o:_dlc_pol icyId>
  50   <mso:TaxKe ywordTaxHT Field msdt :dt="strin g"></mso:T axKeywordT axHTField>
  51   <mso:TaxKe yword msdt :dt="strin g"></mso:T axKeyword>
  52   <mso:Targe t_x0020_Au diences ms dt:dt="str ing"></mso :Target_x0 020_Audien ces>
  53   <mso:TaxCa tchAll msd t:dt="stri ng"></mso: TaxCatchAl l>
  54   </mso:Cust omDocument Properties >
  55   </xml><![e ndif]-->
  56   </head>
  57   <body>
  58     <a href= "#MainCont ent" class ="sr-only" >Skip to m ain conten t </a>
  59     <!-- Ski p to main  content -- >
  60     <!-- Fix ed navbar  -->
  61     <div cla ss="navbar  navbar-de fault navb ar-static- top" role= "navigatio n">
  62       <div c lass="cont ainer">
  63         <div  class="na vbar-heade r">
  64           <h 1 title="D epartment  of Veteran s Affairs  Seal.Veter ans Affair s Research  Administr ative Mana gement Sys tem">
  65              <a class=" navbar-bra nd" href=" #">Departm ent of Vet erans Affa irs Seal.V eterans Af fairs Rese arch
  66                Administ rative Man agement Sy stem</a>
  67           </ h1>
  68         </di v>
  69         <div  class="na vbar-colla pse collap se">
  70           <u l class="n av navbar- nav navbar -right mai n-nav">
  71              <li><a tit le="Home"  href="/sit es/IRBAppl ications/S itePages/H ome.aspx"> Home</a></ li>
  72              <li class= "active">< a title="R esearch St udy Applic ations"
  73                href="/s ites/IRBAp plications /SitePages /irb%20app lications. aspx">Rese arch Study  Applicati on</a></li >
  74              <li><a id= "investiga torActivit ies" title ="Investig ator Activ ities"
  75                href=".. /SiteAsset s/committe e_redirect .html?comm itteeActio n=investig atorActivi ties">Inve stigator
  76                  Activi ties</a></ li>
  77              <li><a tit le="Commit tee Activi ties"
  78                href=".. /SiteAsset s/committe e_redirect .html?comm itteeActio n=committe eActivitie s">Committ ee Activit ies</a></l i>
  79              <li><a id= "profile"  title="Per sonal Prof ile" href= "">Persona l Profile< /a></li>
  80           </ ul>
  81         </di v>
  82         <!-- /.nav-coll apse -->
  83       </div>
  84     </div>
  85     <!-- /.n avbar-stat ic-top -->
  86     <div cla ss="contai ner" id="M ainContent ">
  87       <div c lass="row" >
  88         <div  class="co l-xs-12">
  89           <h 1 id="page Header" cl ass="text- center" ta bindex="1" ></h1>
  90           <b r> <br>
  91         </di v>
  92       </div>
  93       <table  id="facil ityDetails Table">
  94         <cap tion class ="hidden"> Facility D etails Tab le</captio n>
  95         <the ad>
  96           <t r></tr>
  97         </th ead>
  98         <tbo dy>
  99           <t r>
  100              <td><label  for="faci lityName"  tabindex=" 2">Facilit y Name</la bel></td>
  101              <td><input  id="facil ityName" t ype="text"  name="fac ilityName"  size="55"  readonly= "readonly"  tabindex= "3"></td>
  102              <td>&nbsp; &nbsp;&nbs p;&nbsp;&n bsp;<label  for="admi nistrative Officers"  tabindex=" 10">Admini strative
  103                  Office rs</label> </td>
  104              <td><input  id="admin istrativeO fficers" t ype="text"  name="adm inistrativ eOfficers"  size="55"
  105                readonly ="readonly " tabindex ="11"></td >
  106           </ tr>
  107           <t r>
  108              <td><label  for="site Code" tabi ndex="4">S ite Code</ label></td >
  109              <td><input  id="siteC ode" type= "text" nam e="siteCod e" size="5 5" readonl y="readonl y" tabinde x="5"></td >
  110              <td>&nbsp; &nbsp;&nbs p;&nbsp;&n bsp;<label  for="anim alFacility Managers"  tabindex=" 12">Animal
  111                  Facili ty Manager s</label>< /td>
  112              <td><input  id="anima lFacilityM anagers" t ype="text"  name="ani malFacilit yManagers"  size="55"
  113                readonly ="readonly " tabindex ="13"></td >
  114           </ tr>
  115           <t r>
  116              <td><label  for="faci lityLocati on" tabind ex="6">Fac ility Loca tion</labe l></td>
  117              <td><input  id="facil ityLocatio n" type="t ext" name= "facilityL ocation" s ize="55" r eadonly="r eadonly"
  118                tabindex ="7"></td>
  119              <td>&nbsp; &nbsp;&nbs p;&nbsp;&n bsp;<label  for="liai son" tabin dex="14">L iaison</la bel></td>
  120              <td><input  id="liais on" type=" text" name ="liason"  size="55"  readonly=" readonly"  tabindex=" 15"></td>
  121           </ tr>
  122           <t r>
  123              <td><label  for="faci litySubsit e" tabinde x="8">Faci lity Subsi te</label> </td>
  124              <td><input  id="facil itySubsite " type="te xt" name=" facilitySu bsite" siz e="55" rea donly="rea donly"
  125                tabindex ="9"></td>
  126              <td>&nbsp; &nbsp;&nbs p;&nbsp;&n bsp;<label  for="loca lSiteAdmin istrators"  tabindex= "16">Local  Site
  127                  Admini strators</ label></td >
  128              <td><input  id="local SiteAdmini strators"  type="text " name="lo calSiteAdm inistrator s" size="5 5"
  129                readonly ="readonly " tabindex ="17"></td >
  130           </ tr>
  131           <t r>
  132              <td></td>
  133              <td></td>
  134              <td>&nbsp; &nbsp;&nbs p;&nbsp;&n bsp;<label  for="rese archCompli anceOffice rs" tabind ex="18">Re search
  135                  Compli ance Offic ers</label ></td>
  136              <td><input  id="resea rchComplia nceOfficer s" type="t ext" name= "researchC omplianceO fficers" s ize="55"
  137                readonly ="readonly " tabindex ="19"></td >
  138           </ tr>
  139           <t r>
  140              <td></td>
  141              <td><butto n tabindex ="22" id=" editFacili tyButton"  onclick="J avaScript: editFacili ty()" type ="button"> Edit</butt on></td>
  142              <td>&nbsp; &nbsp;&nbs p;&nbsp;&n bsp;<label  for="user s" tabinde x="20">Use rs</label> </td>
  143              <td><input  id="users " type="te xt" name=" users" siz e="55" rea donly="rea donly" tab index="21" ></td>
  144           </ tr>
  145         </tb ody>
  146       </tabl e>
  147       <br>
  148       <table  id="commi tteeDetail sTable" cl ass="displ ay">
  149         <cap tion class ="hidden"> Committee  Details Ta ble</capti on>
  150         <the ad>
  151           <t r>
  152              <th>Commit tee</th>
  153              <th>Displa y Name</th >
  154              <th>Displa y Acroynm< /th>
  155              <th>Delega ted</th>
  156              <th>Hidden </th>
  157              <th>Admini strators</ th>
  158              <th>Commit tee Coordi nators</th >
  159              <th>Commit tee Member s</th>
  160              <th style= "width: 25 0px">Actio n</th>
  161           </ tr>
  162         </th ead>
  163         <tbo dy>
  164         </tb ody>
  165       </tabl e>
  166     </div>
  167     <div id= "delegateD ialog" tit le="Select  A Site">< /div>
  168     <div id= "resetDial og" title= "Reset Com mittee"></ div>
  169     <div id= "hideDialo g" title=" Hide Commi ttee"></di v>
  170     <div id= "editCommi tteeDialog " title="E dit Commit tee"></div >
  171     <script  type="text /javascrip t">
  172            / **
  173              * holds th e ContextI nfo json.d .GetContex tWebInform ation.Form DigestValu e for use  during RES T calls
  174             
  175              * @type {O bject}
  176              */
  177            v ar request Digest = n ull;
  178  
  179            v ar hostnam e = window .location. hostname;
  180  
  181            v ar siteUrl  = window. location.h ref;
  182            v ar facilit yName = ge tParamValu e('facilit yName');
  183            v ar facilit yTitle = g etParamVal ue('facili tyTitle');
  184            f acilityTit le = facil ityTitle.r eplace(/_/ g, ' ');
  185            f acilityTit le = facil ityTitle.r eplace(/%2 0/g, ' ')
  186            v ar groupPa rt = getPa ramValue(' groupPart' );
  187            g roupPart =  groupPart .replace(/ _/g, ' ');
  188            g roupPart =  groupPart .replace(/ %20/g, ' ' )
  189  
  190            v ar pageTit le = facil ityTitle +  " Site Co nfiguratio n";
  191  
  192            / / get the  list libra ry name an d replace  the holder s in the a nchor href  and the R EST API Ur i
  193            / / change t he siteUri  and restU ri
  194            / / siteColl ection is  defined in  rams-envi ronment as  /sites/IR BApplicati ons/
  195              // https:/ / DNS . URL /sites/IRB Applicatio ns/Miami/_ api/web/li sts/getbyt itle('RDC  Calendar') /items(25)
  196            / /var siteU ri = siteC ollection  + facility Name + "/" ;
  197            / /var restU ri = "";
  198            / /var reque stUri = si teUri + re stUri;
  199  
  200            / / add the  list item  fields tha t should b e displaye d to the o nSuccess m ethod, for  loop, res ults varia ble - add
  201            / / as many  site colum ns as need ed
  202            / / and adju st the num ber of col umns in th e textarea  box accor dingly
  203            v ar members hip;
  204  
  205            v ar committ eeList = [ ];
  206            v ar facilit yItem = ge tFacilityI tem(facili tyTitle)[0 ];
  207            / / var comm itteeItem  = getCommi tteeItem(f acilityTit le);
  208  
  209            / **
  210              * holds ar ray of com mittees fr om _api/we b/lists/ge tbytitle(' Committees ')/items
  211             
  212              * @type {c ommittee[] }
  213              */
  214            / /var deleg atedCommit tees = [];
  215            / /var hidde nCommittee s = [];
  216            v ar committ ees = [];
  217            v ar current Committees  = [];
  218            c urrentComm ittees = g etCommitte eItems(fac ilityTitle );
  219  
  220            / **
  221              * holds ar ray of com mittees fr om _api/we b/lists/ge tbytitle(' Committees ')/items
  222             
  223              * @type {c ommittee[] }
  224              */
  225  
  226            v ar allComm ittees = [ ];
  227            a llCommitte es = getAl lCommittee Items();
  228  
  229            f or (var c  = 0; c < a llCommitte es.length;  c++) {
  230                var curr entCommitt ee = allCo mmittees[c ];
  231  
  232                // Addin g three re cords to t he associa tive array  
  233                if (type of current Committee. Delegated  === "undef ined") {
  234                   // Th is is prot ective cod e to indic ate that t he data is  missing a nd it shou ld not be  missing.
  235                   alert (currentCo mmittee.Co mmitteesLo okup.Commi tteesName
  236                      +  "Delegated  column is  undefined . Please c ontact the  System Ad ministrato r");
  237                } else {
  238                   if (c urrentComm ittee.Dele gated.Titl e != null)  {
  239                      co mmittees[c urrentComm ittee.Faci litiesLook up.Title +  " "
  240                          + current Committee. Committees Lookup.Com mitteesNam e] = curre ntCommitte e;
  241                   }
  242                }
  243  
  244                if (type of current Committee. Hidden ===  "undefine d") {
  245                   // Th is is prot ective cod e to indic ate that t he data is  missing a nd it shou ld not be  missing.
  246                   alert (currentCo mmittee.Co mmitteesLo okup.Commi tteesName
  247                      +  "Hidden co lumn is un defined. P lease cont act the Sy stem Admin istrator") ;
  248                } else {
  249                   if (c urrentComm ittee.Hidd en === tru e) {
  250                      co mmittees[" Hidden " +  currentCo mmittee.Fa cilitiesLo okup.Title  + " "
  251                          + current Committee. Committees Lookup.Com mitteesNam e] = curre ntCommitte e;
  252                   }
  253                }
  254  
  255                committe es[allComm ittees[c]. Id] = allC ommittees[ c];
  256                committe es[allComm ittees[c]. Facilities Lookup.Tit le] = allC ommittees[ c];
  257  
  258            }
  259  
  260            / **
  261              * holds ar ray of fac ility from  _api/web/ lists/getb ytitle('Fa cilities') /items
  262             
  263              * @type {f acility[]}
  264              */
  265            v ar facilit ies = [];
  266            v ar current Facilities  = [];
  267  
  268            $ (document) .ready(fun ction() {
  269                process( );
  270                $("#RAMS Copyright" ).append(R AMSCopyrig ht);
  271  
  272                $('#faci lityName') .val(facil ityItem.Ti tle)
  273                $('#site Code').val (facilityI tem.facili tySiteCode )
  274                $('#faci lityLocati on').val(f acilityIte m.Facility Location)
  275                $('#faci litySubsit e').val(fa cilityItem .FacilityS ubsite.Des cription)
  276                $('#admi nistrative Officers') .val(facil ityItem.Ad ministrati veOfficers .Name)
  277                $('#anim alFacility Managers') .val(facil ityItem.An imalFacili tyManagers .Name)
  278                $('#liai son').val( facilityIt em.Facilit yLiaison.T itle)
  279                $('#loca lSiteAdmin istrators' ).val(faci lityItem.L ocalSiteAd ministrato rs.Name)
  280                $('#rese archCompli anceOffice rs').val(f acilityIte m.Research Compliance Officers.N ame)
  281                $('#user s').val(fa cilityItem .Users.Nam e)
  282  
  283                //reques tUri = sit eUri + res tUri;
  284  
  285                membersh ip = membe rCheck();
  286  
  287                var page Header = " ";
  288  
  289                pageHead er = facil ityTitle +  " Site Co nfiguratio n";
  290  
  291                $('#page Header').a ppend(page Header);
  292  
  293                $(docume nt).prop(' title', pa geTitle);
  294  
  295                committe eList = ge tCommittee ListData() ;
  296  
  297                if (!mem bership.LS AMember) {
  298                   $("#e ditFacilit yButton"). hide();
  299                }
  300  
  301                $('#comm itteeDetai lsTable'). DataTable( {
  302                   data  : committe eList,
  303                   colum ns : [ {
  304                      da ta : 'comm ittee'
  305                   }, {
  306                      da ta : 'disp layName'
  307                   }, {
  308                      da ta : 'disp layAcronym '
  309                   }, {
  310                      da ta : 'dele gated'
  311                   }, {
  312                      da ta : 'hidd en'
  313                   }, {
  314                      da ta : 'admi nistrators '
  315                   }, {
  316                      da ta : 'comm itteeCoord inators'
  317                   }, {
  318                      da ta : 'comm itteeMembe rs'
  319                   }, {
  320                      da ta : 'acti on'
  321                   }
  322                   ]
  323                });
  324            } );
  325  
  326            f unction ge tParamValu e(param) {
  327                var urlP aramString  = locatio n.search.s plit(param  + "=");
  328                if (urlP aramString .length <=  1) {
  329                   retur n "";
  330                } else {
  331                   var t mp = urlPa ramString[ 1].split(" &");
  332                   retur n tmp[0];
  333                }
  334            }
  335  
  336            f unction on Error(erro r) {
  337                alert("T his is a w ork in pro gress and  will be de livered in  a future  release");
  338            }
  339  
  340            f unction me mberCheck( ) {
  341                var curr entUrl = w indow.loca tion.href;
  342                var spli tUrl = cur rentUrl.sp lit(".html ")[0];
  343                var faci lityUrl =  "";
  344                var user ;
  345                membersh ip = {};
  346                membersh ip.RDCMemb er = false ;
  347                membersh ip.IRBMemb er = false ;
  348                membersh ip.SRSMemb er = false ;
  349                membersh ip.IACUCMe mber = fal se;
  350                membersh ip.SC1Memb er = false ;
  351                membersh ip.SC2Memb er = false ;
  352                membersh ip.SC3Memb er = false ;
  353                membersh ip.AOMembe r = false;
  354                membersh ip.LSAMemb er = false ;
  355                membersh ip.committ eeMember =  false;
  356                membersh ip.committ eeCoordina torMember  = false;
  357                membersh ip.adminis tratorsMem ber = fals e;
  358                membersh ip.Users =  false;
  359  
  360                if (spli tUrl != "" ) {
  361                   if (s plitUrl.in dexOf(site Collection ) != -1) {
  362                      sp litUrl = s plitUrl.sp lit(siteCo llection)[ 1];
  363                      if  (splitUrl .indexOf(" /SitePages /") != -1)  {
  364                          facilityU rl = split Url.split( "/SitePage s/")[0];
  365                      }
  366                   }
  367                }
  368                var curr entUserGro upsURL = s iteCollect ion + "_ap i/Web/Curr entUser/Gr oups";
  369                $.ajax({
  370                   async  : false,
  371                   type  : 'GET',
  372                   url :  currentUs erGroupsUR L,
  373                   heade rs : {
  374                      "a ccept" : " applicatio n/json;oda ta=verbose "
  375                   },
  376                   dataT ype : 'jso n',
  377                   succe ss : funct ion(json)  {
  378                      us er = json. d.results;
  379                      fo r (var i =  0; i < us er.length;  i++) {
  380                          if (user[ i].Title.i ndexOf(gro upPart + "  " + "RDC" ) > -1) {
  381                             member ship.RDCMe mber = tru e;
  382                          }
  383                          if (user[ i].Title.i ndexOf(gro upPart + "  " + "IRB" ) > -1) {
  384                             member ship.IRBMe mber = tru e;
  385                          }
  386                          if (user[ i].Title.i ndexOf(gro upPart + "  " + "SRS" ) > -1) {
  387                             member ship.SRSMe mber = tru e;
  388                          }
  389                          if (user[ i].Title.i ndexOf(gro upPart + "  " + "IACU C") > -1)  {
  390                             member ship.IACUC Member = t rue;
  391                          }
  392                          if (user[ i].Title.i ndexOf(gro upPart + "  " + "SC1" ) > -1) {
  393                             member ship.SRSMe mber = tru e;
  394                          }
  395                          if (user[ i].Title.i ndexOf(gro upPart + "  " + "SC2" ) > -1) {
  396                             member ship.SRSMe mber = tru e;
  397                          }
  398                          if (user[ i].Title.i ndexOf(gro upPart + "  " + "SC3" ) > -1) {
  399                             member ship.SRSMe mber = tru e;
  400                          }
  401                          if (user[ i].Title.i ndexOf(gro upPart + "  " + "Admi nistrative  Officers" ) > -1) {
  402                             member ship.AOMem ber = true ;
  403                          }
  404                          if (user[ i].Title.i ndexOf(gro upPart + "  " + "Loca l Site Adm inistrator s") > -1)  {
  405                             member ship.LSAMe mber = tru e;
  406                          }
  407                          if (user[ i].Title.i ndexOf(gro upPart + "  Users") >  -1) {
  408                             member ship.Users  = true;
  409                          }
  410                      }
  411                   }
  412                });
  413                return m embership;
  414            }
  415  
  416            / **
  417              * retrieve  the list  of facilit ies ordere d by the f acility ti tle
  418             
  419              * @returns  facilityJ son {json}  collectio n of facil ities
  420              */
  421            f unction ge tFacilityI tem(title)  {
  422                var faci lityJson;
  423                var faci lityItemUR L = "/site s/IRBAppli cations/_a pi/Web/lis ts/getbyti tle('Facil ities')/it ems?&$sele ct=Id,Titl e,Facility Location,F acilityLia ison/ID,Fa cilityLiai son/Name,F acilityLia ison/Title ,"
  424                   + "Fa cilitySubs ite,Admini strativeOf ficers/ID, Administra tiveOffice rs/Name,"
  425                   + "An imalFacili tyManagers /ID,Animal FacilityMa nagers/Nam e,"
  426                   + "Lo calSiteAdm inistrator s/ID,Local SiteAdmini strators/N ame,"
  427                   + "Lo calSiteLia isons/ID,L ocalSiteLi aisons/Nam e,Research Compliance Officers/I D,Research Compliance Officers/N ame,Users/ ID,Users/N ame"
  428                   + "&$ expand=Fac ilityLiais on,Adminis trativeOff icers,"
  429                   + "An imalFacili tyManagers ,"
  430                   + "Lo calSiteAdm inistrator s,LocalSit eLiaisons, ResearchCo mplianceOf ficers,Use rs"
  431                   + "&$ filter=Tit le eq "
  432                   + "'"  + title +  "'";
  433  
  434                $.ajax({
  435                   async  : false,
  436                   type  : 'GET',
  437                   url :  facilityI temURL,
  438                   heade rs : {
  439                      "a ccept" : " applicatio n/json;oda ta=verbose "
  440                   },
  441                   dataT ype : 'jso n',
  442                   succe ss : funct ion(json)  {
  443                      fa cilityJson  = json.d. results;
  444                   },
  445                   error  : functio n(XMLHttpR equest, te xtStatus,  errorThrow n) {
  446                      if  (consoleL oggingEnab led) {
  447                          console.l og("Unable  to read F acilities  list. "
  448                             + JSON .stringify (XMLHttpRe quest.resp onseJSON.e rror.messa ge));
  449                      }
  450                      th row "Unabl e to read  Facilities  list. " +  JSON.stri ngify(XMLH ttpRequest .responseJ SON.error. message);
  451                   }
  452                });
  453                // JSHIN T NOTE: fa cilityJson  may be un initialize d, but it  is used in  For loops  that go t hrough the  
  454                // colle ction and  the loop s hould alre ady be pro tected for  undefined  variables  (the leng th should  be 0).
  455                return f acilityJso n;
  456            }
  457  
  458            / **
  459              * retrieve  the list  of facilit ies ordere d by the c ommittee t itle
  460             
  461              * @returns  committee Json {json } collecti on of faci lities
  462              */
  463            f unction ge tCommittee Items(titl e) {
  464                var comm itteeJson;
  465                var comm itteeItemU RL = siteC ollection  + "_api/we b/lists/ge tbytitle(' Committees ')/items"
  466                   + "?$ filter=Fac ilitiesLoo kup/Title  eq " + "'"  + title +  "'"
  467                   + "&$ select=Id, Title,Faci litiesLook up/ID,Faci litiesLook up/Title,C ommitteesL ookup/ID,"
  468                   + "Co mmitteesLo okup/Commi tteesName, Acronym,Ad ministrato rs/ID,Admi nistrators /Name,"
  469                   + "Co mmitteeCoo rdinators/ ID,Committ eeCoordina tors/Name, CommitteeM embers/ID, CommitteeM embers/Nam e,"
  470                   + "De legated/ID ,Delegated /Title,Hid den"
  471                   + "&$ expand=Fac ilitiesLoo kup,Commit teesLookup , Administ rators,Com mitteeCoor dinators,"
  472                   + "Co mmitteeMem bers,Deleg ated" + "& $orderby=T itle,Commi tteesLooku p/Committe esName";
  473  
  474                $.ajax({
  475                   async  : false,
  476                   type  : 'GET',
  477                   url :  committee ItemURL,
  478                   heade rs : {
  479                      "a ccept" : " applicatio n/json;oda ta=verbose "
  480                   },
  481                   dataT ype : 'jso n',
  482                   succe ss : funct ion(json)  {
  483                      co mmitteeJso n = json.d .results;
  484                   },
  485  
  486                   error  : functio n(XMLHttpR equest, te xtStatus,  errorThrow n) {
  487                      if  (consoleL oggingEnab led) {
  488                          console.l og("Unable  to read C ommittees  list. " +  JSON.strin gify(error Thrown));
  489                      }
  490                      th row "Unabl e to read  Committees  list. ";
  491                   }
  492                });
  493                // JSHIN T NOTE: fa cilityJson  may be un initialize d, but it  is used in  For loops  that go t hrough the  collectio n and
  494                // the
  495                // loop
  496                // shoul d already  be protect ed for und efined var iables (th e length s hould be 0 ).
  497                return c ommitteeJs on;
  498  
  499            }
  500  
  501            / **
  502              * retrieve  the list  of facilit ies ordere d by the c ommittee t itle
  503             
  504              * @returns  committee Json {json } collecti on of faci lities
  505              */
  506            f unction ge tAllCommit teeItems()  {
  507                var comm itteeJson;
  508                var comm itteeItemU RL = siteC ollection  + "_api/we b/lists/ge tbytitle(' Committees ')/items"
  509                   + "?$ filter=Hid den ne 0 o r Delegate d/ID ge 0"
  510                   + "&$ select=Id, Title, Fac ilitiesLoo kup/ID,Fac ilitiesLoo kup/Title, Committees Lookup/ID, "
  511                   + "Co mmitteesLo okup/Commi tteesName, Acronym,Ad ministrato rs/ID,Admi nistrators /Name,"
  512                   + "Co mmitteeCoo rdinators/ ID, Commit teeCoordin ators/Name ,Committee Members/ID ,Committee Members/Na me,"
  513                   + "De legated/ID , Delegate d/Title,Hi dden"
  514                   + "&$ expand=Fac ilitiesLoo kup,Commit teesLookup , Administ rators,Com mitteeCoor dinators,"
  515                   + "Co mmitteeMem bers,Deleg ated" + "& $orderby=T itle,Commi tteesLooku p/Committe esName";
  516  
  517                $.ajax({
  518                   async  : false,
  519                   type  : 'GET',
  520                   url :  committee ItemURL,
  521                   heade rs : {
  522                      "a ccept" : " applicatio n/json;oda ta=verbose "
  523                   },
  524                   dataT ype : 'jso n',
  525                   succe ss : funct ion(json)  {
  526                      co mmitteeJso n = json.d .results;
  527                   },
  528  
  529                   error  : functio n(XMLHttpR equest, te xtStatus,  errorThrow n) {
  530                      if  (consoleL oggingEnab led) {
  531                          console.l og("Unable  to read C ommittees  list. " +  JSON.strin gify(error Thrown));
  532                      }
  533                      th row "Unabl e to read  Committees  list. ";
  534                   }
  535                });
  536                // JSHIN T NOTE: fa cilityJson  may be un initialize d, but it  is used in  For loops  that go t hrough the  collectio n and
  537                // the
  538                // loop
  539                // shoul d already  be protect ed for und efined var iables (th e length s hould be 0 ).
  540                return c ommitteeJs on;
  541  
  542            }
  543  
  544            f unction Co mmitteeIte m(id, comm ittee, dis playName,  displayAcr onym, dele gated, hid den, admin istrators,
  545                committe eCoordinat ors, commi tteeMember s, action)  {
  546                this.id  = id;
  547                this.com mittee = c ommittee;
  548                this.dis playName =  displayNa me;
  549                this.dis playAcrony m = displa yAcronym;
  550                this.del egated = d elegated;
  551                this.hid den = hidd en;
  552                this.adm inistrator s = admini strators;
  553                this.com mitteeCoor dinators =  committee Coordinato rs;
  554                this.com mitteeMemb ers = comm itteeMembe rs;
  555                this.act ion = acti on;
  556            }
  557  
  558            / **
  559              * retrieve  the list  of facilit ies ordere d by the f acility na me
  560             
  561              * @returns  facilityJ son {json}  collectio n of facil ities
  562              */
  563            f unction ge tFacilityI tems() {
  564                var faci lityJson;
  565                $.ajax({
  566                   async  : false,
  567                   type  : 'GET',
  568                   url :  "/sites/I RBApplicat ions/_api/ Web/lists/ getbytitle ('Faciliti es')/items ?" + "$ord erby=Title ",
  569                   heade rs : {
  570                      "a ccept" : " applicatio n/json;oda ta=verbose "
  571                   },
  572                   dataT ype : 'jso n',
  573                   succe ss : funct ion(json)  {
  574                      fa cilityJson  = json.d. results;
  575                   },
  576                   error  : functio n(XMLHttpR equest, te xtStatus,  errorThrow n) {
  577                      if  (consoleL oggingEnab led) {
  578                          console.l og("Unable  to read F acilities  list. " +  JSON.strin gify(error Thrown));
  579                      }
  580                      th row "Unabl e to read  Facilities  list. ";
  581                   }
  582                });
  583                // JSHIN T NOTE: co mmitteeJso n may be u ninitializ ed, but it  is used i n For loop s that go  through th e collecti on and
  584                // the
  585                // loop
  586                // shoul d already  be protect ed for und efined var iables (th e length s hould be 0 ).
  587                return f acilityJso n;
  588            }
  589  
  590            f unction de legateComm ittee(comm itteeId) {
  591                committe eList = ge tCommittee ListData() ;
  592                var filt eredDelega teList = [ ];
  593                var comm mitteeDeta ils = [];
  594                for (var  c = 0; c  < currentC ommittees. length; c+ +) {
  595                   // Ad ding three  records t o the asso ciative
  596                   commi ttees[curr entCommitt ees[c].Id]  = current Committees [c];
  597                   commi ttees[curr entCommitt ees[c].Fac ilitiesLoo kup.Title]  = current Committees [c];
  598                   if (c urrentComm ittees[c]. Delegated. Title !==  null
  599                      &&  typeof cu rrentCommi ttees[c].D elegated.T itle !== " undefined" ) {
  600                      co mmittees[c urrentComm ittees[c]. Facilities Lookup.Tit le + " "
  601                          + current Committees [c].Commit teesLookup .Committee sName] = c urrentComm ittees[c];
  602                   }
  603  
  604                }
  605  
  606                currentF acilities  = getFacil ityItems() ;
  607                for (var  f = 0; f  < currentF acilities. length; f+ +) {
  608                   var c urrentFaci lity = cur rentFacili ties[f];
  609                   var c urrentFaci lityName =  currentFa cility.Tit le;
  610                   if (c urrentFaci lityName ! = facility Name && cu rrentFacil ityName !=  "Central  IRB") {
  611                      fi lteredDele gateList.p ush(curren tFacility)
  612                   }
  613                }
  614  
  615                committe eData = {
  616                   "__me tadata" :  {
  617                      "t ype" : "SP .Data.Comm itteesList Item"
  618                   },
  619                   "ID"  : committe eId,
  620                };
  621  
  622                committe eDetails =  committee s[committe eId];
  623  
  624                var titl e = commit teeDetails .Delegated .Title;
  625  
  626                var sele ctMessage  = "<p>Sele ct a facil ity to del egate the  " + commit tees[commi tteeId].Ac ronym + "  to</p>";
  627                var drop down = $(' <select id =\"delegat eDropdown\ " />');
  628                var save Delegate =  "<button  onclick=\" JavaScript :saveCommi ttee(commi tteeData,  'delegate' )\">Save</ button>";
  629                var canc elDelegate  = "<butto n onclick= \"JavaScri pt:cancel( 'delegateD ialog')\"> Cancel</bu tton>";
  630  
  631                for ( va r val in f ilteredDel egateList)  {
  632                   $('<o ption />',  {
  633                      va lue : filt eredDelega teList[val ].ID,
  634                      te xt : filte redDelegat eList[val] .Title
  635                   }).ap pendTo(dro pdown);
  636                }
  637  
  638                $("#dele gateDialog ").html("" );
  639                $("#dele gateDialog ").append( selectMess age);
  640                $("#dele gateDialog ").append( dropdown);
  641                $("#dele gateDialog ").append( "<br>");
  642                $("#dele gateDialog ").append( saveDelega te);
  643                $("#dele gateDialog ").append( cancelDele gate);
  644                $("#dele gateDialog ").dialog( );
  645  
  646            }
  647  
  648            f unction ca ncel(type)  {
  649  
  650                if (type  == "deleg ateDialog" ) {
  651                   $('#d elegateDia log').dial og('close' );
  652                } else i f (type ==  "resetDia log") {
  653                   $('#r esetDialog ').dialog( 'close');
  654                } else i f (type ==  "hideDial og") {
  655                   $('#h ideDialog' ).dialog(' close');
  656                } else i f (type =  "editCommi tteeDialog ") {
  657                   $('#e ditCommitt eeDialog') .dialog('c lose');
  658                }
  659  
  660            }
  661  
  662            f unction re setCommitt ee(committ eeId) {
  663                var admi nistrators Id;
  664                var coor dinatorsId ;
  665                var memb ersId;
  666                var admi nistrators Name;
  667                var comm itteeCoord inatorsNam e;
  668                var comm itteeMembe rsName;
  669  
  670                for (var  c = 0; c  < currentC ommittees. length; c+ +) {
  671                   // Ad ding three  records t o the asso ciative
  672                   commi ttees[curr entCommitt ees[c].Id]  = current Committees [c];
  673                   commi ttees[curr entCommitt ees[c].Fac ilitiesLoo kup.Title]  = current Committees [c];
  674                   if (c urrentComm ittees[c]. Delegated. Title !==  null
  675                      &&  typeof cu rrentCommi ttees[c].D elegated.T itle !== " undefined" ) {
  676                      // committees [currentCo mmittees[c ].Delegate d.Title +  " " + curr entCommitt ees[c].Acr onym] = cu rrentCommi ttees[c];
  677                      co mmittees[c urrentComm ittees[c]. Facilities Lookup.Tit le + " "
  678                          + current Committees [c].Commit teesLookup .Committee sName] = c urrentComm ittees[c];
  679  
  680                   }
  681  
  682                }
  683  
  684                var comm itteeDetai ls = commi ttees[comm itteeId];
  685                administ ratorsName  = facilit yTitle + "  " + commi tteeDetail s.Committe esLookup.C ommitteesN ame
  686                   + " A dministrat ors";
  687                committe eCoordinat orsName =  facilityTi tle + " "  + committe eDetails.C ommitteesL ookup.Comm itteesName
  688                   + " C ommittee C oordinator s";
  689                committe eMembersNa me = facil ityTitle +  " " + com mitteeDeta ils.Commit teesLookup .Committee sName
  690                   + " C ommittee M embers";
  691  
  692                var site Groups = g etSiteGrou pItems();
  693  
  694                for (var  g = 0; g  < siteGrou ps.length;  g++) {
  695                   var c urrentSite Group = si teGroups[g ];
  696                   var c urrentSite GroupId =  currentSit eGroup.Id;
  697                   var c urrentSite GroupTitle  = current SiteGroup. Title;
  698  
  699                   if (c urrentSite GroupTitle .indexOf(a dministrat orsName) >  -1) {
  700                      ad ministrato rsId = cur rentSiteGr oupId;
  701                   }
  702                   if (c urrentSite GroupTitle .indexOf(c ommitteeCo ordinators Name) > -1 ) {
  703                      co ordinators Id = curre ntSiteGrou pId;
  704                   }
  705                   if (c urrentSite GroupTitle .indexOf(c ommitteeMe mbersName)  > -1) {
  706                      me mbersId =  currentSit eGroupId;
  707                   }
  708  
  709                }
  710  
  711                committe eData = {
  712                   "__me tadata" :  {
  713                      "t ype" : "SP .Data.Comm itteesList Item"
  714                   },
  715                   "ID"  : committe eId,
  716                   "Hidd en" : "fal se",
  717                   "Admi nistrators Id" : admi nistrators Id,
  718                   "Comm itteeCoord inatorsId"  : coordin atorsId,
  719                   "Comm itteeMembe rsId" : me mbersId,
  720                   "Dele gatedId" :  -1
  721  
  722                };
  723  
  724                var rese tMessage =  "<p>Would  you like  to reset t he delegat e? This wi ll delete  your given  committee  data. Do  you wish t o proceed? </p>";
  725                var save Reset = "< button onc lick=\"Jav aScript:sa veCommitte e(committe eData, 're set')\">Sa ve</button >";
  726                var canc elReset =  "<button o nclick=\"J avaScript: cancel('re setDialog' )\">Cancel </button>" ;
  727                $("#rese tDialog"). html("");
  728                $("#rese tDialog"). append(res etMessage) ;
  729                $("#rese tDialog"). append("<b r>");
  730                $("#rese tDialog"). append(sav eReset);
  731                $("#rese tDialog"). append(can celReset);
  732                $("#rese tDialog"). dialog();
  733  
  734            }
  735  
  736            f unction ed itCommitte e(committe eId) {
  737                var edit Message =  "<p>Would  you like t o Edit the  committee ? This wil l Edit you r given co mmittee da ta.</p>";
  738                var save Edit = "<b utton oncl ick=\"Java Script:sav eCommittee (committee Data, 'edi t')\">Save </button>" ;
  739                var canc elEdit = " <button on click=\"Ja vaScript:c ancel('edi tCommittee Dialog')\" >Cancel</b utton>";
  740  
  741                var comm itteeDetai ls = commi ttees[comm itteeId];
  742                var comm itteeName  = "<label  for=\"disp layName\"> Name</labe l><input i d=\"displa yName\" ty pe=\"text\ " name=\"d isplayName \"" + "val ue=" + "'"  + committ eeDetails. Title + "' " +"><br>" ;
  743                var acro nym = "<la bel for=\" acronym\"> Acronym</l abel><inpu t id=\"acr onym\" typ e=\"text\"  name=\"ac ronym\"" +  "value="  + "'" + co mmitteeDet ails.Acron ym + "'" + "><br>";
  744  
  745                committe eData = {
  746                   "__me tadata" :  {
  747                      "t ype" : "SP .Data.Comm itteesList Item"
  748                   },
  749                   "ID"  : committe eId,
  750                };
  751  
  752                //Popula te with cu rrent valu es
  753                $("#edit CommitteeD ialog").ht ml("");
  754                $("#edit CommitteeD ialog").ap pend(editM essage);
  755                $("#edit CommitteeD ialog").ap pend(commi tteeName);
  756                $("#edit CommitteeD ialog").ap pend(acron ym);
  757                $("#edit CommitteeD ialog").ap pend("<br> ");
  758                $("#edit CommitteeD ialog").ap pend(saveE dit);
  759                $("#edit CommitteeD ialog").ap pend(cance lEdit);
  760  
  761                $("#edit CommitteeD ialog").di alog();
  762            }
  763  
  764            f unction ed itFacility () {
  765                if (memb ership.LSA Member) {
  766                   var e ditFacilit yLink = "/ sites/IRBA pplication s/Lists/Fa cilities/F acilitiesE dit.aspx?F ilterField 1=ID&Filte rValue1="
  767                      +  facilityIt em.ID + "& Source=" +  encodeURI Component( window.loc ation.href );
  768                   windo w.location (editFacil ityLink);
  769                }
  770            }
  771  
  772            f unction sa veCommitte e(data, sa veType) {
  773                this.all Committees  = getAllC ommitteeIt ems();
  774                for (var  c = 0; c  < allCommi ttees.leng th; c++) {
  775                   var c urrentComm ittee = al lCommittee s[c];
  776  
  777                   // Ad ding three  records t o the asso ciative
  778                   commi ttees[allC ommittees[ c].Id] = a llCommitte es[c];
  779                   commi ttees[allC ommittees[ c].Facilit iesLookup. Title] = a llCommitte es[c];
  780  
  781                   if (t ypeof curr entCommitt ee.Delegat ed === "un defined")  {
  782                      al ert(curren tCommittee .Committee sLookup.Co mmitteesNa me
  783                          + "Delega ted column  is undefi ned. Pleas e contact  the System  Administr ator");
  784                   } els e {
  785                      if  (currentC ommittee.D elegated.T itle != nu ll) {
  786                          committee s[currentC ommittee.F acilitiesL ookup.Titl e + " "
  787                             + curr entCommitt ee.Committ eesLookup. Committees Name] = cu rrentCommi ttee;
  788                      }
  789                   }
  790  
  791                   if (t ypeof curr entCommitt ee.Hidden  === "undef ined") {
  792                      al ert(curren tCommittee .Committee sLookup.Co mmitteesNa me
  793                          + "Delega ted column  is undefi ned. Pleas e contact  the System  Administr ator");
  794                   } els e {
  795                      if  (currentC ommittee.H idden ===  true) {
  796                          committee s["Hidden  " + curren tCommittee .Facilitie sLookup.Ti tle + " "
  797                             + curr entCommitt ee.Committ eesLookup. Committees Name] = cu rrentCommi ttee;
  798                      }
  799                   }
  800                }
  801  
  802                var comm itteesUrl  = "";
  803                var Id =  data["ID" ];
  804                var comm itteeDetai ls = commi ttees[Id];
  805                var save  = true;
  806  
  807                if (save Type == "d elegate")  {
  808                   if ($ ("#delegat eDropdown" ).length)  {
  809                      va r delegate  = $('#del egateDropd own').val( );
  810                      va r delegate Name = $(' #delegateD ropdown op tion:selec ted').text ();
  811                      da ta["Delega tedId"] =  delegate;
  812  
  813                      va r administ ratorsId;
  814                      va r coordina torsId;
  815                      va r membersI d;
  816                      va r administ ratorsName ;
  817                      va r committe eCoordinat orsName;
  818                      va r committe eMembersNa me;
  819  
  820                      ad ministrato rsName = d elegateNam e + " " +  committeeD etails.Com mitteesLoo kup.Commit teesName
  821                          + " Admin istrators" ;
  822                      co mmitteeCoo rdinatorsN ame = dele gateName +  " " + com mitteeDeta ils.Commit teesLookup .Committee sName
  823                          + " Commi ttee Coord inators";
  824                      co mmitteeMem bersName =  delegateN ame + " "  + committe eDetails.C ommitteesL ookup.Comm itteesName
  825                          + " Commi ttee Membe rs";
  826  
  827                      va r siteGrou ps = getSi teGroupIte ms(delegat eName);
  828  
  829                      fo r (var g =  0; g < si teGroups.l ength; g++ ) {
  830                          var curre ntSiteGrou p = siteGr oups[g];
  831                          var curre ntSiteGrou pId = curr entSiteGro up.Id;
  832                          var curre ntSiteGrou pTitle = c urrentSite Group.Titl e;
  833  
  834                          if (curre ntSiteGrou pTitle.ind exOf(admin istratorsN ame) > -1)  {
  835                             admini stratorsId  = current SiteGroupI d;
  836                          }
  837                          if (curre ntSiteGrou pTitle.ind exOf(commi tteeCoordi natorsName ) > -1) {
  838                             coordi natorsId =  currentSi teGroupId;
  839                          }
  840                          if (curre ntSiteGrou pTitle.ind exOf(commi tteeMember sName) > - 1) {
  841                             member sId = curr entSiteGro upId;
  842                          }
  843  
  844                      }
  845                   }
  846                   var c ommitteeNa me = deleg ateName +  " " + comm itteeDetai ls.Committ eesLookup. Committees Name;
  847                   var h idden = fa lse;
  848                   if (( typeof com mittees["H idden " +  committeeN ame] !== " undefined"
  849                      &&  (committe es["Hidden  " + commi tteeName]. hasOwnProp erty("Hidd en"))) {
  850                      hi dden = com mittees["H idden " +  committeeN ame].Hidde n;
  851                   }
  852                   var d elegated =  "";
  853                   if (t ypeof comm ittees[com mitteeName ] !== "und efined") {
  854                      de legated =  committees [committee Name].Dele gated;
  855                      if  (typeof d elegated ! == "undefi ned") {
  856                          save = fa lse;
  857                          if (deleg ated.Title  != null)  {
  858                             delega ted = dele gated.Titl e;
  859                             if (de legated ==  null) {
  860                                del egated = " ";
  861                             }
  862                          }
  863                      }
  864                   }
  865  
  866                   if (( typeof hid den !== un defined) & & (hidden  == true))  {
  867                      sa ve = false ;
  868                   }
  869  
  870                   //if  (typeof de legated != = undefine d && deleg ated != nu ll && dele gated != " ") {
  871                   //    save = tru e;
  872                  // }
  873  
  874                   data[ "Hidden"]  = "false";
  875                   data[ "Administr atorsId"]  = administ ratorsId;
  876                   data[ "Committee Coordinato rsId"] = c oordinator sId;
  877                   data[ "Committee MembersId" ] = member sId;
  878  
  879                } else i f (saveTyp e == "edit ") {
  880                   var c ommitteeNa me = $('#d isplayName ').val();
  881                   var a cronym = $ ('#acronym ').val();
  882                   var c ommitteeTy pe = commi tteeDetail s.Committe esLookup.C ommitteesN ame;
  883  
  884                   if (c ommitteeTy pe == "SC1 " || commi tteeType = = "SC2" ||  committee Type == "S C3") {
  885                      da ta["Title" ] = commit teeName;
  886                      da ta["Acrony m"] = acro nym;
  887                   }
  888  
  889                }
  890  
  891                committe esUrl = "/ sites/IRBA pplication s/_api/Web /Lists/Get ByTitle('C ommittees' )/Items("  + Id + ")" ;
  892  
  893                if (save  == true)  {
  894                   $.aja x({
  895                      ty pe : 'POST ',
  896                      ur l : commit teesUrl,
  897                      da ta : JSON. stringify( data),
  898                      da taType : " json",
  899                      he aders : {
  900                          "X-Reques tDigest" :  requestDi gest,
  901                          "Content- Type" : "a pplication /json;odat a=verbose" ,
  902                          "IF-MATCH " : "*",
  903                          "X-HTTP-M ethod" : " MERGE"
  904                      },
  905                      su ccess : fu nction() {
  906                          var table  = $("#com mitteeDeta ilsTable") .DataTable (); // Val id initial ized DataT able
  907                          committee List = get CommitteeL istData();
  908                          table.cle ar().rows. add(commit teeList).d raw();
  909  
  910                      },
  911                      er ror : func tion(XMLHt tpRequest,  textStatu s, errorTh rown) {
  912                          if (conso leLoggingE nabled) {
  913                             consol e.log("Una ble to rea d Committe es list. "  + JSON.st ringify(er rorThrown) );
  914                          }
  915                          throw "Un able to re ad Committ ees list.  ";
  916                      }
  917                   });
  918                } else {
  919                   alert ("Unable t o save del egate beca use the co mmittee is  hidden or  already d elegated." );
  920                }
  921  
  922                if (save Type == "d elegate")  {
  923                   $("#d elegateDia log").dial og('close' );
  924  
  925                } else i f (saveTyp e == "rese t") {
  926                   $("#r esetDialog ").dialog( 'close');
  927                } else i f (saveTyp e == "hide ") {
  928                   $("#h ideDialog" ).dialog(' close');
  929  
  930                } else i f (saveTyp e == "edit ") {
  931                   $("#e ditCommitt eeDialog") .dialog('c lose');
  932  
  933                }
  934  
  935            }
  936  
  937            f unction hi deCommitte e(committe eId) {
  938                committe eData = {
  939                   "__me tadata" :  {
  940                      "t ype" : "SP .Data.Comm itteesList Item"
  941                   },
  942                   "ID"  : committe eId,
  943                   "Hidd en" : "tru e",
  944                   "Admi nistrators Id" : -1,
  945                   "Comm itteeCoord inatorsId"  : -1,
  946                   "Comm itteeMembe rsId" : -1 ,
  947                   "Dele gatedId" :  -1
  948                };
  949  
  950                var rese tMessage =  "<p>Would  you like  to hide th e committe e? This wi ll delete  your given  committee  data.</p> ";
  951                var save Reset = "< button onc lick=\"Jav aScript:sa veCommitte e(committe eData, 'hi de')\">Sav e</button> ";
  952                var canc elReset =  "<button o nclick=\"J avaScript: cancel('hi deDialog') \">Cancel< /button>";
  953  
  954                $("#hide Dialog").h tml("");
  955                $("#hide Dialog").a ppend(rese tMessage);
  956                $("#hide Dialog").a ppend("<br >");
  957                $("#hide Dialog").a ppend(save Reset);
  958                $("#hide Dialog").a ppend(canc elReset);
  959                $("#hide Dialog").d ialog();
  960  
  961            }
  962  
  963            / **
  964              * retrieve  the list  of site gr oups order ed by the  title
  965             
  966              * @returns  facilityJ son {json}  collectio n of facil ities
  967              */
  968            f unction ge tSiteGroup Items(filt er) {
  969                var dyna micUrl = " ";
  970                dynamicU rl = "/sit es/IRBAppl ications/_ api/Web/si tegroups?$ filter=sta rtswith(Ti tle,'" + f acilityTit le
  971                   + "')  eq true";
  972  
  973                if (type of filter  !== "undef ined") {
  974                   dynam icUrl = "/ sites/IRBA pplication s/_api/Web /sitegroup s?$filter= startswith (Title,'"  + filter
  975                      +  "') eq tru e";
  976                }
  977  
  978                var site GroupsJson ;
  979                $.ajax({
  980                   async  : false,
  981                   type  : 'GET',
  982  
  983                   url :  dynamicUr l,
  984                   heade rs : {
  985                      "a ccept" : " applicatio n/json;oda ta=verbose "
  986                   },
  987                   dataT ype : 'jso n',
  988                   succe ss : funct ion(json)  {
  989                      si teGroupsJs on = json. d.results;
  990                   },
  991                   error  : functio n(XMLHttpR equest, te xtStatus,  errorThrow n) {
  992                      if  (consoleL oggingEnab led) {
  993                          console.l og("Unable  to read s itegroups  beginning  with Title  '" + faci lityTitle  + "'. "
  994                             + JSON .stringify (errorThro wn));
  995                      }
  996                      th row "Unabl e to read  sitegroups ";
  997                   }
  998                });
  999                // JSHIN T NOTE: si teGroupsJs onmay be u ninitializ ed, but it  is used i n For loop s that go  through th e collecti on and
  1000                // the
  1001                // loop
  1002                // shoul d already  be protect ed for und efined var iables (th e length s hould be 0 ).
  1003                return s iteGroupsJ son;
  1004            }
  1005  
  1006            / **
  1007              * retrieve  the list  of site gr oups order ed by the  title
  1008             
  1009              * @returns  facilityJ son {json}  collectio n of facil ities
  1010              */
  1011            f unction pr ocess() {
  1012                var json ;
  1013                $.ajax({
  1014                   async  : false,
  1015                   type  : 'POST',
  1016  
  1017                   url :  "/sites/I RBApplicat ions/_api/ contextinf o",
  1018                   heade rs : {
  1019                      "a ccept" : " applicatio n/json;oda ta=verbose "
  1020                   },
  1021                   dataT ype : 'jso n',
  1022                   succe ss : funct ion(json)  {
  1023                      re questDiges t = json.d .GetContex tWebInform ation.Form DigestValu e;
  1024                   },
  1025                   error  : functio n(XMLHttpR equest, te xtStatus,  errorThrow n) {
  1026                      if  (consoleL oggingEnab led) {
  1027                          console.l og("Unable  to update  contextin fo" + JSON .stringify (errorThro wn));
  1028                      }
  1029                      th row "Unabl e to updat e contexti nfo";
  1030                   }
  1031                });
  1032                // JSHIN T NOTE: si teGroupsJs onmay be u ninitializ ed, but it  is used i n For loop s that go  through th e collecti on and
  1033                // the
  1034                // loop
  1035                // shoul d already  be protect ed for und efined var iables (th e length s hould be 0 ).
  1036            }
  1037  
  1038            f unction ge tCommittee ListData()  {
  1039                var comm itteeList  = [];
  1040                committe es = [];
  1041                currentC ommittees  = getCommi tteeItems( facilityTi tle);
  1042                for (var  c = 0; c  < currentC ommittees. length; c+ +) {
  1043                   var c urrentComm ittee = cu rrentCommi ttees[c];
  1044  
  1045                   // Ad ding three  records t o the asso ciative
  1046                   commi ttees[curr entCommitt ees[c].Id]  = current Committees [c];
  1047                   commi ttees[curr entCommitt ees[c].Fac ilitiesLoo kup.Title]  = current Committees [c];
  1048  
  1049                   if (c urrentComm ittees[c]. Delegated. Title !==  null
  1050                      &&  typeof cu rrentCommi ttees[c].D elegated.T itle !== " undefined" ) {
  1051                      co mmittees[c urrentComm ittees[c]. Facilities Lookup.Tit le + " "
  1052                          + current Committees [c].Commit teesLookup .Committee sName] = c urrentComm ittees[c];
  1053  
  1054                   }
  1055  
  1056                }
  1057  
  1058                for (var  c = 0; c  < currentC ommittees. length; c+ +) {
  1059                   var c urrentComm ittee = cu rrentCommi ttees[c];
  1060                   var c ommitteeID  = current Committee. ID;
  1061                   var c ommittee =  currentCo mmittee.Co mmitteesLo okup.Commi tteesName;
  1062                   var d isplayName  = current Committee. Title;
  1063                   var d isplayAcro nym = curr entCommitt ee.Acronym ;
  1064                   var d elegated =  currentCo mmittee.De legated.Ti tle;
  1065  
  1066                   var h idden = cu rrentCommi ttee.Hidde n;
  1067                   var a dministrat ors = curr entCommitt ee.Adminis trators.Na me;
  1068                   var c oordinator s = curren tCommittee .Committee Coordinato rs.Name;
  1069                   var m embers = c urrentComm ittee.Comm itteeMembe rs.Name;
  1070  
  1071                   if (t ypeof dele gated ===  "undefined ") {
  1072                      de legated =  "";
  1073                   }
  1074  
  1075                   var c ommmitteeD etails = c ommittees[ committeeI D];
  1076                   var d elegatedCo mmitteeFac ilityKey =  "";
  1077                   var d elegatedTi tle = comm mitteeDeta ils.Delega ted.Title;
  1078  
  1079                   var a cronym = c ommmitteeD etails.Acr onym;
  1080  
  1081                   var d elegateEna bled = tru e;
  1082  
  1083                   deleg atedCommit teeFacilit yKey = fac ilityItem. Title + "  " + acrony m;
  1084  
  1085                   var d elegateAct ion = "";
  1086                   var c ommitteeKe yDetails =  committee s[delegate dCommittee FacilityKe y];
  1087  
  1088                   if (t ypeof comm itteeKeyDe tails ===  "undefined ") {
  1089                      de legateActi on = "<but ton onclic k=\"JavaSc ript:deleg ateCommitt ee(" + com mitteeID
  1090                          + ")\">De legate</bu tton>";
  1091                   }
  1092  
  1093                   var e ditAction  = "";
  1094  
  1095                   if (c ommittee = = "SC1" ||  committee  == "SC2"  || committ ee == "SC3 ") {
  1096                      if  (membersh ip.LSAMemb er) {
  1097  
  1098                          displayNa me = displ ayName + "  (" + comm ittee + ") ";
  1099  
  1100                          displayAc ronym = di splayAcron ym + " " +  "(" + com mittee + " )";
  1101  
  1102                          editActio n = "<butt on onclick =\"JavaScr ipt:editCo mmittee("  + committe eID + ")\" >Edit</but ton>";
  1103                      }
  1104  
  1105                   }
  1106                   var h ideAction  = "<button  onclick=\ "JavaScrip t:hideComm ittee(" +  committeeI D + ")\">H ide</butto n>";
  1107  
  1108                   var r esetAction  = "<butto n onclick= \"JavaScri pt:resetCo mmittee("  + committe eID + ")\" >Reset</bu tton>";
  1109  
  1110                   var a ctionButto ns = "";
  1111                   if (m embership. LSAMember)  {
  1112                      ac tionButton s = editAc tion + del egateActio n + hideAc tion + res etAction;
  1113                   } els e {
  1114                      ac tionButton s = "";
  1115                   }
  1116  
  1117                   //var  actionBut tons = edi tAction +  delegateAc tion + hid eAction +  resetActio n;
  1118                   var n ewCommitte eItem = ne w Committe eItem(comm itteeID, c ommittee,  displayNam e, display Acronym, d elegated,
  1119                      hi dden, admi nistrators , coordina tors, memb ers, actio nButtons);
  1120  
  1121                   commi tteeList.p ush(newCom mitteeItem );
  1122                }
  1123  
  1124                return c ommitteeLi st;
  1125  
  1126            }
  1127         </sc ript>
  1128     <div cla ss="footer ">
  1129       <div c lass="cont ainer">
  1130         <ul  class="foo ter-nav">
  1131           <l i><a title ="About" h ref="/site s/IRBAppli cations/Si tePages/Ab out.aspx"> About</a>< /li>
  1132           <l i><a title ="Training " href="/s ites/IRBAp plications /SitePages /RAMS%20On line%20Hel p.aspx">Tr aining</a> </li>
  1133           <l i><a title ="Help" hr ef="/sites /IRBApplic ations/Sit ePages/RAM S%20Online %20Help.as px">Help</ a></li>
  1134           <l i><a title ="FAQs" hr ef="/sites /IRBApplic ations/Sit ePages/FAQ .aspx">FAQ s</a></li>
  1135           <l i><a title ="Contact  Us" href=" /sites/IRB Applicatio ns/SitePag es/Contact %20Us.aspx ">Contact  Us</a></li >
  1136           <l i><a title ="Site Map " href="/s ites/IRBAp plications /SitePages /Site%20Ma p.aspx">Si te Map</a> </li>
  1137           <l i><a title ="Disclaim er" href=" /sites/IRB Applicatio ns/SitePag es/Disclai mer.aspx"> Disclaimer </a></li>
  1138           <l i><a title ="Privacy/ Accessibil ity" href= "/sites/IR BApplicati ons/SitePa ges/Access ibility.as px">Privac y
  1139                / Access ibility</a ></li>
  1140           <l i><a oncli ck="displa yVersion() ;return fa lse;" titl e="Version " href="#" >Version</ a></li>
  1141           <l i><a title ="Descript ion" href= "/sites/IR BApplicati ons/SitePa ges/Descri ption.aspx ">Descript ion</a></l i>
  1142             <li><a tit le="VA Hom e" href="h ttp:// DNS . URL ">VA Home< /a></li>
  1143           <l i><a title ="Facility  Info" hre f="/sites/ IRBApplica tions/Site Assets/js/ facilityIn foTest.htm l">Facilit y
  1144                Info</a> </li>
  1145         </ul >
  1146         <p i d="RAMSCop yright" cl ass="pull- right stro ng"></p>
  1147       </div>
  1148     </div>
  1149     <!-- Boo tstrap cor e JavaScri pt
  1150       ====== ========== ========== ========== ========== ==== -->
  1151     <!-- Pla ced at the  end of th e document  so the pa ges load f aster -->
  1152     <script  src="../Si teAssets/j s/bootstra p.min.js"  type="text /javascrip t"></scrip t>
  1153     <script  src="../Si teAssets/j s/tooltip. js" type=" text/javas cript"></s cript>
  1154     <!-- IE1 0 viewport  hack for  Surface/de sktop Wind ows 8 bug  -->
  1155     <script  src="../Si teAssets/j s/ie10-vie wport-bug- workaround .js" type= "text/java script"></ script>
  1156     <script  type="text /javascrip t">
  1157            d ocument.ge tElementBy Id("profil e").href =  mySitesSe rverName;
  1158         </sc ript>
  1159   </body>
  1160   </html>