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