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