Produced by Araxis Merge on 10/18/2017 8:22:14 AM Central Daylight 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.
# | Location | File | Last Modified |
---|---|---|---|
1 | RAMS.zip\RAMS\UI\js | GenerateAgendaReport.js | Wed Oct 18 12:48:38 2017 UTC |
2 | RAMS.zip\RAMS\UI\js | GenerateAgendaReport.js | Wed Oct 18 13:03:15 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 846 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
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 |
No regular expressions were active.
1 | <script sr c="/sites/ IRBApplica tions/Site Assets/js/ docxtempla ter.js"></ script> | |
2 | <script sr c="/sites/ IRBApplica tions/Site Assets/js/ FileSaver. min.js"></ script> | |
3 | <script sr c="/sites/ IRBApplica tions/Site Assets/js/ jszip-util s.js"></sc ript> | |
4 | // <script | |
5 | // src="ht tps://vaww .itst.ram. msp. DNS /SiteAsset s/js/dynam icGenerati on.js"></s cript> | |
6 | <script sr c="/sites/ IRBApplica tions/Site Assets/js/ jquery-1.8 .3.min.js" ></script> | |
7 | ||
8 | <script sr c="/sites/ IRBApplica tions/Site Assets/js/ spin.min.j s"></scrip t> | |
9 | // <script | |
10 | // src="/s ites/IRBAp plications /SiteAsset s/js/jshas htable-3.0 .js"></scr ipt> | |
11 | // <script | |
12 | // src="/s ites/IRBAp plications /SiteAsset s/js/rams- environmen t.js"></sc ript> | |
13 | ||
14 | // <script | |
15 | // src="/s ites/IRBAp plications /SiteAsset s/js/dynam icMembers. js"></scri pt> | |
16 | <script sr c="/sites/ IRBApplica tions/Site Assets/js/ MicrosoftA jax.js"></ script> | |
17 | <script sr c="/sites/ IRBApplica tions/Site Assets/js/ moment.js" ></script> | |
18 | // <script type="tex t/javascri pt" src="_ layouts/15 /sp.runtim e.js"></sc ript> | |
19 | // <script type="tex t/javascri pt" src="_ layouts/15 /sp.js"></ script> | |
20 | ||
21 | //Mandator y in IE 6, 7, 8 and 9. | |
22 | ||
23 | <!--[if IE ]> | |
24 | <script ty pe="text/j avascript" src="exam ples/vendo r/jszip-ut ils-ie.js" ></script> | |
25 | <![endif]- -> | |
26 | ||
27 | <div id="s pinnerdiv" > </div> | |
28 | <script> | |
29 | var loadFi le=functio n(url,call back){ | |
30 | JS ZipUtils.g etBinaryCo ntent(url, callback); | |
31 | } | |
32 | var opts = { | |
33 | line s: 12, // The number of lines to draw | |
34 | leng th: 7, // The length of each l ine | |
35 | widt h: 5, // T he line th ickness | |
36 | radi us: 10, // The radiu s of the i nner circl e | |
37 | colo r: '#fff', // #rbg o r #rrggbb | |
38 | spee d: 1, // R ounds per second | |
39 | trai l: 66, // Afterglow percentage | |
40 | shad ow: true / / Whether to render a shadow | |
41 | }; | |
42 | ||
43 | // checkSo urceParame ter(); | |
44 | var target = documen t.getEleme ntById('sp innerdiv') ; | |
45 | ||
46 | var spinne r = new Sp inner(opts ).spin(tar get); | |
47 | $(target). data('spin ner',spinn er); | |
48 | ||
49 | var itemIn fo; // dat a after JS ON is pars ed into di ctionary | |
50 | var curren tUrl = win dow.locati on.href; | |
51 | var studyA rray = []; | |
52 | var minute Array=[]; | |
53 | var agenda Columns = new Object ; | |
54 | var commit teeName="" ; | |
55 | var commit teeListUrl =""; | |
56 | var agenda MinutesTit le=""; | |
57 | var report Type=""; | |
58 | ||
59 | generateAg endaReport (currentUr l); | |
60 | ||
61 | function g enerateAge ndaReport( currUrl){ | |
62 | va r realUrl = currUrl. substring( 0, currUrl .indexOf(" SitePages" )-1); | |
63 | va r itemID = getQuery StringPara meter('Cus tomID');// currUrl.s ubstring(c urrUrl.ind exOf("ID=" )+3); | |
64 | va r listUrl= ""; | |
65 | co mmitteeNam e = getQue ryStringPa rameter('c ommitteeNa me'); | |
66 | re portType=g etQueryStr ingParamet er('report Type'); | |
67 | ag endaMinute sTitle=com mitteeName ; | |
68 | ||
69 | ||
70 | if (committe eName=="RD C") { | |
71 | comm itteeListU rl=realUrl + "/_api/ web/lists/ getbytitle ('RDC Cale ndar')/ite ms(" + ite mID + ")?$ select=Tit le,EventDa te,Committ eeAttendee s/ID,Commi tteeAttend ees/Title, Participan tsPicker/I D,Particip antsPicker /Title,App rovedRDCAp plicationL ookup/ID, Author/ID& $expand=Co mmitteeAtt endees,App rovedRDCAp plicationL ookup,Part icipantsPi cker, Auth or"; | |
72 | } else if (c ommitteeNa me=="IACUC ") { | |
73 | comm itteeListU rl=realUrl + "/_api/ web/lists/ getbytitle ('IACUC Ca lendar')/i tems(" + i temID + ") ?$select=T itle,Event Date,Commi tteeAttend ees/ID,Com mitteeAtte ndees/Titl e,Particip antsPicker /ID,Partic ipantsPick er/Title,S ubmittedAp plicationL ookup/ID,I ACUCCalend arMeetingM inuteLooku p/ID, Auth or/Title&$ expand=Com mitteeAtte ndees,Subm ittedAppli cationLook up,Partici pantsPicke r, IACUCCa lendarMeet ingMinuteL ookup, Aut hor"; | |
74 | } else if (c ommitteeNa me=="IRB") { | |
75 | comm itteeListU rl=realUrl + "/_api /web/lists /getbytitl e('Committ ee Calenda r')/items( " + itemID + ")?$sel ect=Title, EventDate, CommitteeA ttendees/I D,Committe eAttendees /Title,Par ticipantsP icker/ID,P articipant sPicker/Ti tle,Applic ationStudy Lookup/ID, MeetingMin utesLookup /ID,Author /Title&$ex pand=Commi tteeAttend ees,Applic ationStudy Lookup,Par ticipantsP icker,Meet ingMinutes Lookup, Au thor"; | |
76 | } else if (c ommitteeNa me=="SRS") { | |
77 | comm itteeListU rl=realUrl + "/_api/ web/lists/ getbytitle ('SRS Cale ndar')/ite ms(" + ite mID + ")?$ select=Tit le,EventDa te,EventCo mmitteeAtt endees/ID, EventCommi tteeAttend ees/Title, Participan tsPicker/I D,Particip antsPicker /Title,Sub mittedAppl icationLoo kup/ID, SR SCalendarM eetingMinu teLookup/I D,Author/T itle&$expa nd=EventCo mmitteeAtt endees,Sub mittedAppl icationLoo kup,Partic ipantsPick er,SRSCale ndarMeetin gMinuteLoo kup, Autho r"; | |
78 | } | |
79 | el se { | |
80 | cons ole.log('C ommittee W as Not Fig ured Corre ctly'); | |
81 | } | |
82 | ||
83 | ||
84 | ||
85 | $. ajax({ | |
86 | url: committee ListUrl, | |
87 | meth od: "GET", | |
88 | head ers: { "Ac cept": "ap plication/ json; odat a=verbose" }, | |
89 | succ ess: funct ion (data) { | |
90 | // map ping the r esults | |
91 | mapDat aObject(da ta); | |
92 | }, | |
93 | erro r: functio n (data) { | |
94 | alert( data.respo nseText); | |
95 | } | |
96 | }) ; | |
97 | ||
98 | // console.l og(agendaC olumns); | |
99 | // return ag endaColumn s; | |
100 | // return it emInfo; | |
101 | } | |
102 | ||
103 | ||
104 | function m apDataObje ct(inData) { | |
105 | it emInfo = inData; | |
106 | va r committe eAttendeeA rr = []; | |
107 | va r attendee Arr = []; | |
108 | ||
109 | va r committe eAttendeeC ount = 0; | |
110 | va r attendee Count = 0; | |
111 | ag endaColumn s["Title"] = itemInf o.d.Title; // can al so use | |
112 | // a gendaColum ns.Title t o add | |
113 | // p roperty to object | |
114 | // agendaCol umns["Loca tion"] = i temInfo[0] .Location; | |
115 | ag endaColumn s["EventDa te"] = mom ent(itemIn fo.d.Event Date).form at( "MMM D D YYYY"); // no | |
116 | ||
117 | // change to who create d and not modified | |
118 | ag endaColumn s["RDName" ] = itemIn fo.d.Autho r.Title; // ' StartDate' | |
119 | ||
120 | // f ound | |
121 | ag endaColumn s["EventTi me"] = mom ent(itemIn fo.d.Event Date).form at( "h:mm" ); | |
122 | // agendaCol umns["Desc ription"] = itemInfo [0].Descri ption; | |
123 | // agendaCol umns["Date Created"] = itemInf o[0].Creat ed; | |
124 | ||
125 | ||
126 | ||
127 | if (committe eName=="SR S") { | |
128 | if (it emInfo.d.E ventCommit teeAttende es.hasOwnP roperty('r esults')){ | |
129 | committe eAttendeeC ount = ite mInfo.d.Ev entCommitt eeAttendee s.results. length; | |
130 | for(coun t = 0; cou nt < commi tteeAttend eeCount; c ount++){ | |
131 | committeeA ttendeeArr .push({ | |
132 | "n ame": item Info.d.Eve ntCommitte eAttendees .results[c ount].Titl e, | |
133 | "r ole": "N/A ", | |
134 | "c oi": "No" | |
135 | }); | |
136 | ||
137 | } | |
138 | } | |
139 | } | |
140 | el se { | |
141 | if ( itemInfo.d .Committee Attendees. hasOwnProp erty('resu lts')){ | |
142 | committeeA ttendeeCou nt = itemI nfo.d.Comm itteeAtten dees.resul ts.length; | |
143 | for(count = 0; count < committ eeAttendee Count; cou nt++){ | |
144 | co mmitteeAtt endeeArr.p ush({ | |
145 | "nam e": itemIn fo.d.Commi tteeAttend ees.result s[count].T itle, | |
146 | "rol e": "N/A", | |
147 | "coi ": "No" | |
148 | }) ; | |
149 | ||
150 | } | |
151 | } | |
152 | } | |
153 | ||
154 | ||
155 | if (itemInfo .d.Partici pantsPicke r.hasOwnPr operty('re sults')){ | |
156 | atte ndeeCount = itemInfo .d.Partici pantsPicke r.results. length; | |
157 | for( count = 0; count < a ttendeeCou nt; count+ +){ | |
158 | attend eeArr.push ({ | |
159 | "name": itemInfo.d .Participa ntsPicker. results[co unt].Title , | |
160 | "role": "N/A", | |
161 | "coi": " No" | |
162 | }); | |
163 | ||
164 | } | |
165 | } | |
166 | ||
167 | ag endaColumn s["Attende es"] = att endeeArr ; // of typ e Collecti on | |
168 | ag endaColumn s["Committ eeAttendee s"] = comm itteeAtten deeArr; // of type C ollection | |
169 | ag endaColumn s["Committ eeAttendee Count"] = committeeA ttendeeCou nt; | |
170 | ag endaColumn s["Attende eCount"] = attendeeC ount; | |
171 | pr ocessMinut es(itemInf o); | |
172 | } | |
173 | ||
174 | function p rocessStud ies(itemIn fo){ | |
175 | va r studies= []; | |
176 | if (committe eName=="RD C") { | |
177 | stud ies = item Info.d.App rovedRDCAp plicationL ookup.resu lts; | |
178 | } else if ( (committee Name=="IAC UC") || (c ommitteeNa me=="SRS") ) { | |
179 | stud ies = item Info.d.Sub mittedAppl icationLoo kup.result s; | |
180 | } else if (c ommitteeNa me=="IRB") { | |
181 | stud ies = item Info.d.App licationSt udyLookup. results; | |
182 | } | |
183 | ||
184 | if (studies. length > 0 ){ | |
185 | for( count = 0; count < s tudies.len gth;count+ +){ | |
186 | ||
187 | var st udyID = st udies[coun t].ID; | |
188 | var st udyResult= getStudy( studyID); | |
189 | studyR esult.done (function( result) { | |
190 | // resul t is an SP .List beca use that i s what we passed to | |
191 | // resol ve()! | |
192 | var stud y = result ; | |
193 | var Assi gnedIRBAdm inistrator ; | |
194 | if (stud y.d.Assign edIRBAdmin istrator.h asOwnPrope rty('Title ')){ | |
195 | ||
196 | AssignedIR BAdministr ator = stu dy.d.Assig nedIRBAdmi nistrator. Title; | |
197 | } | |
198 | else{ | |
199 | ||
200 | AssignedIR BAdministr ator = "N/ A"; | |
201 | } | |
202 | var Prim aryReviewe r; | |
203 | if (stud y.d.Primar yReviewers .hasOwnPro perty('res ults')){ | |
204 | ||
205 | PrimaryRev iewer = st udy.d.Prim aryReviewe rs.results [0].Title; // Will | |
206 | // Modify | |
207 | // code | |
208 | // to | |
209 | // accomod ate | |
210 | // more | |
211 | // than | |
212 | // one | |
213 | // reviewe r | |
214 | } | |
215 | else{ | |
216 | ||
217 | AssignedIR BAdministr ator = "N/ A"; | |
218 | } | |
219 | studyArr ay.push({ | |
220 | "StudyTitl e": study. d.StudyTit le, | |
221 | "StudyID": study.d.S tudy_ID, | |
222 | "PI": stud y.d.Princi palInvesti gator.Titl e, | |
223 | "PrimaryRe viewer":Pr imaryRevie wer, | |
224 | "IRBAdmin" :AssignedI RBAdminist rator, | |
225 | "Deliberat ion":study .d.Deliber ation, | |
226 | "Decision" : study.d. Decision, | |
227 | "StudyType ":study.d. Applicatio nType | |
228 | }); | |
229 | ||
230 | if (comm itteeName= ="RDC") { | |
231 | if (studyA rray.lengt h == itemI nfo.d.Appr ovedRDCApp licationLo okup.resul ts.length ){ | |
232 | ag endaColumn s["Studies "]=studyAr ray; | |
233 | ||
234 | ge nerateDocx (agendaCol umns); | |
235 | ||
236 | } | |
237 | ||
238 | } else i f ( (commi tteeName== "IACUC") | | (committ eeName=="S RS") ) { | |
239 | if (studyA rray.lengt h == itemI nfo.d.Subm ittedAppli cationLook up.results .length ){ | |
240 | ag endaColumn s["Studies "]=studyAr ray; | |
241 | ||
242 | ge nerateDocx (agendaCol umns); | |
243 | ||
244 | } | |
245 | } | |
246 | else { | |
247 | console.lo g('Committ ee Was Not Figured C orrectly') ; | |
248 | } | |
249 | ||
250 | }); | |
251 | ||
252 | studyR esult.fail (function( result) { | |
253 | // resul t is a str ing becaus e that is what we pa ssed to | |
254 | // rejec t()! | |
255 | var erro r = result ; | |
256 | console. log(error) ; | |
257 | ||
258 | }); | |
259 | ||
260 | ||
261 | } | |
262 | } | |
263 | el se{ // no studies a ttached | |
264 | ||
265 | gene rateDocx(a gendaColum ns); | |
266 | } | |
267 | ||
268 | } | |
269 | function p rocessMinu tes(itemIn fo){ | |
270 | // 468161: F ix the iss ue of gene rate agend a report i n RDC Meet ings list | |
271 | // Uses Cale ndar as so urce inste ad of meet ing minut | |
272 | ||
273 | mi nuteArray. push({ | |
274 | "min uteTitle": itemInfo. Title, | |
275 | "dis cussion": itemInfo.D eliberatio n, | |
276 | "act ion": item Info.Decis ion | |
277 | }) ; | |
278 | ||
279 | ag endaColumn s["Minutes "]=minuteA rray; | |
280 | ||
281 | pr ocessStudi es(itemInf o); | |
282 | ||
283 | ||
284 | ||
285 | } | |
286 | function g enerateDoc x(dataSet) { | |
287 | ||
288 | va r Attendee Array = da taSet["Att endees"]; | |
289 | va r Committe eAttendeeA rray = dat aSet["Comm itteeAtten dees"]; | |
290 | va r agendaDa te = dataS et["EventD ate"]; | |
291 | va r agendaTi me = dataS et["EventT ime"]; | |
292 | va r agendaSt udies = da taSet["Stu dies"]; | |
293 | va r agendaMi nutes = da taSet["Min utes"]; | |
294 | va r committe eAttendeeC ount = dat aSet["Comm itteeAtten deeCount"] ; | |
295 | va r attendee Count = da taSet["Att endeeCount "]; | |
296 | va r rdName = dataSet[" RDName"]; | |
297 | va r template ReportFile =""; | |
298 | va r generate dFileName= ""; | |
299 | ||
300 | ||
301 | if (reportTy pe=="" || reportType ==undefine d) { | |
302 | temp lateReport File="/sit es/IRBAppl ications/S iteAssets/ js/Agenda- Template.d ocx"; | |
303 | gene ratedFileN ame=commit teeName + "-Agenda-" +agendaDat e+".docx"; | |
304 | } | |
305 | el se { | |
306 | temp lateReport File="/sit es/IRBAppl ications/S iteAssets/ js/Meeting -Minute-Te mplate.doc x"; | |
307 | gene ratedFileN ame=commit teeName + "Agenda-Mi nutes-"+ag endaDate+" .docx"; | |
308 | } | |
309 | ||
310 | // loadFile(" /sites/IRB Applicatio ns/SiteAss ets/js/Age nda-Templa te.docx",f unction(er r,content) { | |
311 | lo adFile(tem plateRepor tFile,func tion(err,c ontent){ | |
312 | doc= new Docxte mplater(co ntent) | |
313 | var clientArra y = [{"nam e":"John S mith", "ro le":"Devel oper", "co i":"Yes"}, {"name":"K ang Cho", "role":"Pr inciple", "coi":"No" }]; | |
314 | doc. setData({ | |
315 | "Agend aMinutesTi tle":agend aMinutesTi tle, | |
316 | "atten dee":Atten deeArray, | |
317 | "commi tteeattend ee":Commit teeAttende eArray, | |
318 | "Commi tteeAttend eeCount": committeeA ttendeeCou nt, | |
319 | "Atten deeCount": attendeeCo unt, | |
320 | "date" :agendaDat e, | |
321 | "time" :agendaTim e, | |
322 | "Studi es":agenda Studies, | |
323 | "Minut es":agenda Minutes, | |
324 | "RDNam e": rdName , | |
325 | "title " : genera tedFileNam e | |
326 | }); | |
327 | doc. render() / / apply th em | |
328 | outp ut=doc.get Zip().gene rate({type :"blob"}) // Output the docume nt using | |
329 | // Dat a-URI | |
330 | save As(output, generated FileName); | |
331 | $('# spinnerdiv ').data('s pinner').s top(); | |
332 | }) | |
333 | ||
334 | ||
335 | ||
336 | } | |
337 | ||
338 | function c heckSource Parameter( ){ | |
339 | va r sourcePa ram = getQ ueryString Parameter( 'Source'); | |
340 | if (sourcePa ram == nul l || sourc eParam == '' ){ | |
341 | var thisUrl = window.loc ation.href ; | |
342 | var siteUrl = thisUrl.su bstring(0, thisUrl.i ndexOf("Li sts")-1); | |
343 | wind ow.locatio n.href = U RL_add_par ameter(thi sUrl, 'Sou rce', site Url); | |
344 | } | |
345 | } | |
346 | function g etStudy(in StudyID){ | |
347 | va r d = $.De ferred(); | |
348 | va r realUrl = currentU rl.substri ng(0, curr entUrl.ind exOf("Site Pages")-1) ; | |
349 | $. ajax({ | |
350 | url: realUrl + "/_api/we b/lists/ge tbytitle(' Committee Topics')/i tems(" + i nStudyID + ")?$selec t=StudyTit le,Applica tionType,S tudy_ID,De liberation , Principa lInvestiga tor/ID, Pr incipalInv estigator/ Title,Prim aryReviewe rs/ID, Pri maryReview ers/Title, Reviewers /ID, Revie wers/Title , Assigned IRBAdminis trator/ID, AssignedI RBAdminist rator/Titl e&$expand= PrincipalI nvestigato r, Primary Reviewers, Reviewers , Assigned IRBAdminis trator", | |
351 | meth od: "GET", | |
352 | head ers: { "Ac cept": "ap plication/ json; odat a=verbose" }, | |
353 | succ ess: funct ion (data) { | |
354 | ||
355 | d.reso lve(data); | |
356 | }, | |
357 | erro r: functio n (data) { | |
358 | // ale rt(data); | |
359 | d.reje ct("getStu dyFailed") ; | |
360 | } | |
361 | }) ; | |
362 | re turn d.pro mise(); | |
363 | } | |
364 | ||
365 | function g etMinute(i nMinutesID ){ | |
366 | va r d = $.De ferred(); | |
367 | va r realUrl = currentU rl.substri ng(0, curr entUrl.ind exOf("Site Pages")-1) ; | |
368 | $. ajax({ | |
369 | url: realUrl + "/_api/we b/lists/ge tbytitle(' CommitteeM inutes')/i tems(" + i nMinutesID + ")?$sel ect=Title, Deliberati on, Decisi on", | |
370 | meth od: "GET", | |
371 | head ers: { "Ac cept": "ap plication/ json; odat a=verbose" }, | |
372 | succ ess: funct ion (data) { | |
373 | ||
374 | d.reso lve(data); | |
375 | }, | |
376 | erro r: functio n (data) { | |
377 | // ale rt(data); | |
378 | d.reje ct("getMin utesFailed "); | |
379 | } | |
380 | }) ; | |
381 | re turn d.pro mise(); | |
382 | } | |
383 | function g etQueryStr ingParamet er(urlPara meterKey) { | |
384 | ||
385 | va r params = document. URL.split( '?')[1].sp lit('&'); | |
386 | va r strParam s = ''; | |
387 | ||
388 | fo r (var i = 0; i < pa rams.lengt h; i = i + 1) { | |
389 | var singlePara m = params [i].split( '='); | |
390 | if ( singlePara m[0] == ur lParameter Key) | |
391 | return decodeURI Component( singlePara m[1]); | |
392 | ||
393 | } | |
394 | ||
395 | } | |
396 | ||
397 | function U RL_add_par ameter(url , param, v alue){ | |
398 | va r hash = {}; | |
399 | va r parser = docum ent.create Element('a '); | |
400 | ||
401 | pa rser.href = url; | |
402 | ||
403 | va r paramete rs = parse r.search.s plit(/\?|& /); | |
404 | ||
405 | fo r(var i=0; i < param eters.leng th; i++) { | |
406 | if(! parameters [i]) | |
407 | contin ue; | |
408 | ||
409 | var ary = parameter s[i].split ('='); | |
410 | hash [ary[0]] = ary[1]; | |
411 | } | |
412 | ||
413 | ha sh[param] = value; | |
414 | ||
415 | va r list = [ ]; | |
416 | Ob ject.keys( hash).forE ach(functi on (key) { | |
417 | list .push(key + '=' + ha sh[key]); | |
418 | }) ; | |
419 | ||
420 | pa rser.searc h = '?' + list.join( '&'); | |
421 | re turn parse r.href; | |
422 | } | |
423 | ||
424 | </script> |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.