Produced by Araxis Merge on 10/18/2017 8:22:15 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\R2.1\siteAssets\JS | GenerateAgendaReport.js | Wed Oct 18 12:48:34 2017 UTC |
2 | RAMS.zip\RAMS\UI\R2.1\siteAssets\JS | GenerateAgendaReport.js | Wed Oct 18 13:02:23 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 770 |
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 | ||
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 = getQueryS tringParam eter('repo rtType'); | |
67 | ||
68 | if (reportTy pe==undefi ned) { | |
69 | repo rtType=""; | |
70 | } | |
71 | ||
72 | ||
73 | if (committe eName=="RD C") { | |
74 | 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,A uthor/Titl e&$expand= CommitteeA ttendees,A pprovedRDC Applicatio nLookup,Pa rticipants Picker, Au thor"; | |
75 | agen daMinutesT itle="RDC" ; | |
76 | } else if (c ommitteeNa me=="IACUC ") { | |
77 | comm itteeListU rl=realUrl + "/_api/ web/lists/ getbytitle ('IACUC Ca lendar')/i tems(" + i temID + ") ?$select=T itle,Event Date,Parti cipantsPic ker/ID,Par ticipantsP icker/Titl e,Committe eAttendees /ID,Commit teeAttende es/Title,I ACUCApplic ationLooku p/ID,IACUC MinuteLook up/ID, Aut hor/Title& $expand=Pa rticipants Picker,IAC UCApplicat ionLookup, CommitteeA ttendees,I ACUCMinute Lookup, Au thor"; | |
78 | agen daMinutesT itle="IACU C"; | |
79 | } else if (c ommitteeNa me=="IRB") { | |
80 | comm itteeListU rl=realUrl + "/_api/ web/lists/ getbytitle ('Committe e Calendar ')/items(" + itemID + ")?$sele ct=Title,E ventDate,C ommitteeAt tendees/ID ,Committee Attendees/ Title,Part icipantsPi cker/ID,Pa rticipants Picker/Tit le,Applica tionStudyL ookup/ID,M eetingMinu tesLookup/ ID, Author /Title&$ex pand=Commi tteeAttend ees,Applic ationStudy Lookup,Par ticipantsP icker,Meet ingMinutes Lookup, Au thor"; | |
81 | agen daMinutesT itle="IRB" ; | |
82 | } | |
83 | el se { | |
84 | cons ole.log('C ommittee W as Not Fig ured Corre ctly'); | |
85 | } | |
86 | $. ajax({ | |
87 | //ur l: realUrl + "/_api/ web/lists/ getbytitle ('IACUC Ca lendar')/i tems(" + i temID + ") ?$select=T itle,Event Date,Parti cipantsPic ker/ID,Par ticipantsP icker/Titl e,Committe eAttendees /ID,Commit teeAttende es/Title,I ACUCApplic ationLooku p/ID,IACUC MinuteLook up/ID&$exp and=Partic ipantsPick er,IACUCAp plicationL ookup,Comm itteeAtten dees,IACUC MinuteLook up", | |
88 | url: committee ListUrl, | |
89 | meth od: "GET", | |
90 | head ers: { "Ac cept": "ap plication/ json; odat a=verbose" }, | |
91 | succ ess: funct ion (data) { | |
92 | // map ping the r esults | |
93 | mapDat aObject(da ta); | |
94 | }, | |
95 | erro r: functio n (data) { | |
96 | alert( data.respo nseText); | |
97 | } | |
98 | }) ; | |
99 | ||
100 | // console.l og(agendaC olumns); | |
101 | // return ag endaColumn s; | |
102 | // return it emInfo; | |
103 | } | |
104 | ||
105 | ||
106 | function m apDataObje ct(inData) { | |
107 | it emInfo = inData; | |
108 | va r committe eAttendeeA rr = []; | |
109 | va r attendee Arr = []; | |
110 | ||
111 | ||
112 | va r committe eAttendeeC ount = 0; | |
113 | va r attendee Count = 0; | |
114 | ag endaColumn s["Title"] = itemInf o.d.Title; // can al so use | |
115 | // a gendaColum ns.Title t o add | |
116 | // p roperty to object | |
117 | // agendaCol umns["Loca tion"] = i temInfo[0] .Location; | |
118 | ag endaColumn s["EventDa te"] = mom ent(itemIn fo.d.Event Date).form at( "MMM D D YYYY"); // no | |
119 | // ' StartDate' | |
120 | // change to who create d and not modified | |
121 | ag endaColumn s["RDName" ] = itemIn fo.d.Autho r.Title; // ' StartDate' | |
122 | // value // found | |
123 | ag endaColumn s["EventTi me"] = mom ent(itemIn fo.d.Event Date).form at( "h:mm" ); | |
124 | // agendaCol umns["Desc ription"] = itemInfo [0].Descri ption; | |
125 | // agendaCol umns["Date Created"] = itemInf o[0].Creat ed; | |
126 | if (itemInfo .d.Committ eeAttendee s.hasOwnPr operty('re sults')){ | |
127 | comm itteeAtten deeCount = itemInfo. d.Committe eAttendees .results.l ength; | |
128 | for( count = 0; count < c ommitteeAt tendeeCoun t; count++ ){ | |
129 | commit teeAttende eArr.push( { | |
130 | "name": itemInfo.d .Committee Attendees. results[co unt].Title , | |
131 | "role": "N/A", | |
132 | "coi": " No" | |
133 | }); | |
134 | ||
135 | } | |
136 | } | |
137 | if (itemInfo .d.Partici pantsPicke r.hasOwnPr operty('re sults')){ | |
138 | atte ndeeCount = itemInfo .d.Partici pantsPicke r.results. length; | |
139 | for( count = 0; count < a ttendeeCou nt; count+ +){ | |
140 | attend eeArr.push ({ | |
141 | "name": itemInfo.d .Participa ntsPicker. results[co unt].Title , | |
142 | "role": "N/A", | |
143 | "coi": " No" | |
144 | }); | |
145 | ||
146 | } | |
147 | } | |
148 | ag endaColumn s["Attende es"] = att endeeArr ; // of typ e Collecti on | |
149 | ag endaColumn s["Committ eeAttendee s"] = comm itteeAtten deeArr; // of type C ollection | |
150 | ag endaColumn s["Committ eeAttendee Count"] = committeeA ttendeeCou nt; | |
151 | ag endaColumn s["Attende eCount"] = attendeeC ount; | |
152 | pr ocessMinut es(itemInf o); | |
153 | } | |
154 | ||
155 | function p rocessStud ies(itemIn fo){ | |
156 | ||
157 | if (committe eName=="IR B") { | |
158 | stud ies = item Info.d.App licationSt udyLookup. results; | |
159 | } else if (c ommitteeNa me=="RDC") { | |
160 | studie s = itemIn fo.d.Appro vedRDCAppl icationLoo kup.result s; | |
161 | } else if (c ommitteeNa me=="IACUC ") { | |
162 | stud ies = item Info.d.IAC UCApplicat ionLookup. results; | |
163 | } | |
164 | el se { | |
165 | cons ole.log('C ommittee W as Not Fig ured Corre ctly'); | |
166 | } | |
167 | /* The looku p issue ne eds to be resolved a nd code be low rewrit ten once t he lookup problem is resolved. | |
168 | if (studies. length > 0 ){ | |
169 | for( count = 0; count < s tudies.len gth;count+ +){ | |
170 | ||
171 | var st udyID = st udies[coun t].ID; | |
172 | var st udyResult= getStudy( studyID); | |
173 | ||
174 | studyR esult.done (function( result) { | |
175 | // resul t is an SP .List beca use that i s what we passed to | |
176 | // resol ve()! | |
177 | var stud y = result ; | |
178 | var Assi gnedIRBAdm inistrator ; | |
179 | if (stud y.d.Assign edIRBAdmin istrator.h asOwnPrope rty('Title ')){ | |
180 | ||
181 | AssignedIR BAdministr ator = stu dy.d.Assig nedIRBAdmi nistrator. Title; | |
182 | } | |
183 | else{ | |
184 | ||
185 | AssignedIR BAdministr ator = "N/ A"; | |
186 | } | |
187 | var Prim aryReviewe r; | |
188 | if (stud y.d.Primar yReviewers .hasOwnPro perty('res ults')){ | |
189 | ||
190 | PrimaryRev iewer = st udy.d.Prim aryReviewe rs.results [0].Title; // Will | |
191 | // Modify | |
192 | // code | |
193 | // to | |
194 | // accomod ate | |
195 | // more | |
196 | // than | |
197 | // one | |
198 | // reviewe r | |
199 | } | |
200 | else{ | |
201 | ||
202 | AssignedIR BAdministr ator = "N/ A"; | |
203 | } | |
204 | studyArr ay.push({ | |
205 | "StudyTitl e": study. d.StudyTit le, | |
206 | "StudyID": study.d.S tudy_ID, | |
207 | "PI": stud y.d.Princi palInvesti gator.Titl e, | |
208 | "PrimaryRe viewer":Pr imaryRevie wer, | |
209 | "IRBAdmin" :AssignedI RBAdminist rator, | |
210 | "Deliberat ion":study .d.Deliber ation, | |
211 | "Decision" : study.d. Decision, | |
212 | "StudyType ":study.d. Applicatio nType | |
213 | }); | |
214 | ||
215 | if (comm itteeName= ="IRB") { | |
216 | if (studyA rray.lengt h == itemI nfo.d.Appl icationStu dyLookup.r esults.len gth ){ | |
217 | ag endaColumn s["Studies "]=studyAr ray; | |
218 | ||
219 | ge nerateDocx (agendaCol umns); | |
220 | ||
221 | } | |
222 | } | |
223 | ||
224 | if (comm itteeName= ="RDC") { | |
225 | if (studyA rray.lengt h == itemI nfo.d.Appr ovedRDCApp licationLo okup.resul ts.length ){ | |
226 | ag endaColumn s["Studies "]=studyAr ray; | |
227 | ||
228 | ge nerateDocx (agendaCol umns); | |
229 | ||
230 | } | |
231 | ||
232 | } else i f (committ eeName=="I ACUC") { | |
233 | if (studyA rray.lengt h == itemI nfo.d.IACU CApplicati onLookup.r esults.len gth ){ | |
234 | ag endaColumn s["Studies "]=studyAr ray; | |
235 | ||
236 | ge nerateDocx (agendaCol umns); | |
237 | ||
238 | } | |
239 | } | |
240 | else { | |
241 | console.lo g('Committ ee Was Not Figured C orrectly') ; | |
242 | } | |
243 | ||
244 | }); | |
245 | ||
246 | studyR esult.fail (function( result) { | |
247 | // resul t is a str ing becaus e that is what we pa ssed to | |
248 | // rejec t()! | |
249 | var erro r = result ; | |
250 | console. log(error) ; | |
251 | ||
252 | }); | |
253 | ||
254 | ||
255 | } | |
256 | ||
257 | } | |
258 | el se{ // no studies a ttached | |
259 | ||
260 | gene rateDocx(a gendaColum ns); | |
261 | }* / | |
262 | ||
263 | ge nerateDocx (agendaCol umns); | |
264 | ||
265 | ||
266 | } | |
267 | function p rocessMinu tes(itemIn fo){ | |
268 | // 468161: F ix the iss ue of gene rate agend a report i n RDC Meet ings list | |
269 | // Uses Cale ndar as so urce inste ad of meet ing minut | |
270 | mi nuteArray. push({ | |
271 | "min uteTitle": itemInfo. Title, | |
272 | "dis cussion": itemInfo.D eliberatio n, | |
273 | "act ion": item Info.Decis ion | |
274 | }) ; | |
275 | ag endaColumn s["Minutes "]=minuteA rray; | |
276 | ||
277 | pr ocessStudi es(itemInf o); | |
278 | ||
279 | ||
280 | ||
281 | } | |
282 | function g enerateDoc x(dataSet) { | |
283 | ||
284 | va r Attendee Array = da taSet["Att endees"]; | |
285 | va r Committe eAttendeeA rray = dat aSet["Comm itteeAtten dees"]; | |
286 | va r agendaDa te = dataS et["EventD ate"]; | |
287 | va r agendaTi me = dataS et["EventT ime"]; | |
288 | va r agendaSt udies = da taSet["Stu dies"]; | |
289 | va r agendaMi nutes = da taSet["Min utes"]; | |
290 | va r committe eAttendeeC ount = dat aSet["Comm itteeAtten deeCount"] ; | |
291 | va r attendee Count = da taSet["Att endeeCount "]; | |
292 | va r rdName = dataSet[" RDName"]; | |
293 | va r template ReportFile =""; | |
294 | va r generate dFileName= ""; | |
295 | ||
296 | ||
297 | if (reportTy pe=="" || reportType ==undefine d) { | |
298 | temp lateReport File="/sit es/IRBAppl ications/S iteAssets/ js/Agenda- Template.d ocx"; | |
299 | gene ratedFileN ame=commit teeName + "-Agenda-" +agendaDat e+".docx"; | |
300 | } | |
301 | el se { | |
302 | temp lateReport File="/sit es/IRBAppl ications/S iteAssets/ js/Meeting -Minute-Te mplate.doc x"; | |
303 | gene ratedFileN ame=commit teeName + "Agenda-Mi nutes-"+ag endaDate+" .docx"; | |
304 | } | |
305 | ||
306 | // loadFile(" /sites/IRB Applicatio ns/SiteAss ets/js/Age nda-Templa te.docx",f unction(er r,content) { | |
307 | lo adFile(tem plateRepor tFile,func tion(err,c ontent){ | |
308 | doc= new Docxte mplater(co ntent) | |
309 | var clientArra y = [{"nam e":"John S mith", "ro le":"Devel oper", "co i":"Yes"}, {"name":"K ang Cho", "role":"Pr inciple", "coi":"No" }]; | |
310 | doc. setData({ | |
311 | "Agend aMinutesTi tle":agend aMinutesTi tle, | |
312 | "atten dee":Atten deeArray, | |
313 | "commi tteeattend ee":Commit teeAttende eArray, | |
314 | "Commi tteeAttend eeCount": committeeA ttendeeCou nt, | |
315 | "Atten deeCount": attendeeCo unt, | |
316 | "date" :agendaDat e, | |
317 | "time" :agendaTim e, | |
318 | "Studi es":agenda Studies, | |
319 | "Minut es":agenda Minutes, | |
320 | "RDNam e": rdName | |
321 | }); | |
322 | doc. render() / / apply th em | |
323 | outp ut=doc.get Zip().gene rate({type :"blob"}) // Output the docume nt using | |
324 | // Dat a-URI | |
325 | save As(output, generated FileName); | |
326 | $('# spinnerdiv ').data('s pinner').s top(); | |
327 | }) | |
328 | ||
329 | ||
330 | ||
331 | } | |
332 | ||
333 | ||
334 | function g etStudy(in StudyID){ | |
335 | // Fix once l ookup issu e is resol ved. | |
336 | va r d = $.De ferred(); | |
337 | va r realUrl = currentU rl.substri ng(0, curr entUrl.ind exOf("Site Pages")-1) ; | |
338 | $. ajax({ | |
339 | 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", | |
340 | meth od: "GET", | |
341 | head ers: { "Ac cept": "ap plication/ json; odat a=verbose" }, | |
342 | succ ess: funct ion (data) { | |
343 | ||
344 | d.reso lve(data); | |
345 | }, | |
346 | erro r: functio n (data) { | |
347 | alert( data); | |
348 | d.reje ct("getStu dyFailed") ; | |
349 | } | |
350 | }) ; | |
351 | re turn d.pro mise(); | |
352 | } | |
353 | ||
354 | function g etMinute(i nMinutesID ){ | |
355 | va r d = $.De ferred(); | |
356 | va r realUrl = currentU rl.substri ng(0, curr entUrl.ind exOf("Site Pages")-1) ; | |
357 | $. ajax({ | |
358 | url: realUrl + "/_api/we b/lists/ge tbytitle(' CommitteeM inutes')/i tems(" + i nMinutesID + ")?$sel ect=Title, Deliberati on, Decisi on", | |
359 | meth od: "GET", | |
360 | head ers: { "Ac cept": "ap plication/ json; odat a=verbose" }, | |
361 | succ ess: funct ion (data) { | |
362 | ||
363 | d.reso lve(data); | |
364 | }, | |
365 | erro r: functio n (data) { | |
366 | // ale rt(data); | |
367 | d.reje ct("getMin utesFailed "); | |
368 | } | |
369 | }) ; | |
370 | re turn d.pro mise(); | |
371 | } | |
372 | function g etQueryStr ingParamet er(urlPara meterKey) { | |
373 | ||
374 | va r params = document. URL.split( '?')[1].sp lit('&'); | |
375 | va r strParam s = ''; | |
376 | ||
377 | fo r (var i = 0; i < pa rams.lengt h; i = i + 1) { | |
378 | var singlePara m = params [i].split( '='); | |
379 | if ( singlePara m[0] == ur lParameter Key) | |
380 | return decodeURI Component( singlePara m[1]); | |
381 | ||
382 | } | |
383 | ||
384 | } | |
385 | ||
386 | </script> |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.