Produced by Araxis Merge on 4/18/2017 7:43:52 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-Integration_CIF.zip | GenerateAgendaReport.js | Mon Apr 17 17:57:50 2017 UTC |
2 | RAMS-Integration_CIF.zip | GenerateAgendaReport.js | Tue Apr 18 12:33:05 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 7 | 640 |
Changed | 7 | 24 |
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="http:// vaww.itst. ram.msp. DNS /SiteAsset s/js/docxt emplater.j s"></scrip t> | |
2 | <script sr c="http:// vaww.itst. ram.msp. DNS /SiteAsset s/js/FileS aver.min.j s"></scrip t> | |
3 | <script sr c="http:// vaww.itst. ram.msp. DNS /SiteAsset s/js/jszip -utils.js" ></script> | |
4 | // <script | |
5 | // src="ht tps://vaww .itst.ram. msp. DNS /SiteAsset s/js/dynam icGenerati on.js"></s cript> | |
6 | <script sr c="http:// vaww.itst. ram.msp. DNS /SiteAsset s/js/jquer y-1.8.3.mi n.js"></sc ript> | |
7 | ||
8 | <script sr c="http:// vaww.itst. ram.msp. DNS /SiteAsset s/js/spin. min.js"></ script> | |
9 | // <script | |
10 | // src="ht tp://vaww. itst.ram.m sp. DNS /SiteAsset s/js/jshas htable-3.0 .js"></scr ipt> | |
11 | // <script | |
12 | // src="ht tp://vaww. itst.ram.m sp. DNS /SiteAsset s/js/rams- environmen t.js"></sc ript> | |
13 | ||
14 | // <script | |
15 | // src="ht tp://vaww. itst.ram.m sp. DNS /SiteAsset s/js/dynam icMembers. js"></scri pt> | |
16 | <script sr c="http:// vaww.itst. ram.msp. DNS /SiteAsset s/js/Micro softAjax.j s"></scrip t> | |
17 | <script sr c="http:// vaww.itst. ram.msp. DNS /SiteAsset s/js/momen t.js"></sc ript> | |
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 | ||
55 | generateAg endaReport (currentUr l); | |
56 | ||
57 | function g enerateAge ndaReport( currUrl){ | |
58 | ||
59 | va r realUrl = currUrl. substring( 0, currUrl .indexOf(" SitePages" )-1); | |
60 | va r itemID = getQuery StringPara meter('Cus tomID');// currUrl.s ubstring(c urrUrl.ind exOf("ID=" )+3); | |
61 | ||
62 | $. ajax({ | |
63 | url: realUrl + "/_api/we b/lists/ge tbytitle(' Committee Calendar') /items(" + itemID + ")?$select =Title,Eve ntDate,Att endees/ID, Attendees/ Title,Part icipantsPi cker/ID,Pa rticipants Picker/Tit le,Applica tionStudyL ookup/ID,M eetingMinu tesLookup/ ID&$expand =Attendees ,Applicati onStudyLoo kup,Partic ipantsPick er", | |
64 | meth od: "GET", | |
65 | head ers: { "Ac cept": "ap plication/ json; odat a=verbose" }, | |
66 | succ ess: funct ion (data) { | |
67 | // map ping the r esults | |
68 | mapDat aObject(da ta); | |
69 | }, | |
70 | erro r: functio n (data) { | |
71 | alert( data.respo nseText); | |
72 | } | |
73 | }) ; | |
74 | ||
75 | // console.l og(agendaC olumns); | |
76 | // return ag endaColumn s; | |
77 | // return it emInfo; | |
78 | } | |
79 | ||
80 | function m apDataObje ct(inData) { | |
81 | it emInfo = inData; | |
82 | va r arr = [] ; | |
83 | ||
84 | ||
85 | va r committe eAttendeeC ount = 0; | |
86 | va r attendee Count = 0; | |
87 | ag endaColumn s["Title"] = itemInf o.d.Title; // can al so use | |
88 | // a gendaColum ns.Title t o add | |
89 | // p roperty to object | |
90 | // agendaCol umns["Loca tion"] = i temInfo[0] .Location; | |
91 | ag endaColumn s["EventDa te"] = mom ent(itemIn fo.d.Event Date).form at( "MMM D D YYYY"); // no | |
92 | // ' StartDate' | |
93 | // v alue | |
94 | // f ound | |
95 | ag endaColumn s["EventTi me"] = mom ent(itemIn fo.d.Event Date).form at( "h:mm" ); | |
96 | // agendaCol umns["Desc ription"] = itemInfo [0].Descri ption; | |
97 | // agendaCol umns["Date Created"] = itemInf o[0].Creat ed; | |
98 | if (itemInfo .d.Committ eeAttendee s.hasOwnPr operty('re sults')){ | |
99 | comm itteeAtten deeCount = itemInfo. d.Committe eAttendees .results.l ength; | |
100 | for( count = 0; count < c ommitteeAt tendeeCoun t; count++ ){ | |
101 | arr.pu sh({ | |
102 | "name": itemInfo.d .Committee Attendees. results[co unt].Title , | |
103 | "role": "N/A", | |
104 | "coi": " No" | |
105 | }); | |
106 | ||
107 | } | |
108 | } | |
109 | if (itemInfo .d.Partici pantsPicke r.hasOwnPr operty('re sults')){ | |
110 | atte ndeeCount = itemInfo .d.Partici pantsPicke r.results. length; | |
111 | for( count = 0; count < a ttendeeCou nt; count+ +){ | |
112 | arr.pu sh({ | |
113 | "name": itemInfo.d .Participa ntsPicker. results[co unt].Title , | |
114 | "role": "N/A", | |
115 | "coi": " No" | |
116 | }); | |
117 | ||
118 | } | |
119 | } | |
120 | ag endaColumn s["Attende es"] = arr ; // of ty pe Collect ion | |
121 | ag endaColumn s["Committ eeAttendee Count"] = committeeA ttendeeCou nt; | |
122 | ag endaColumn s["Attende eCount"] = attendeeC ount | |
123 | pr ocessMinut es(itemInf o); | |
124 | } | |
125 | ||
126 | function p rocessStud ies(itemIn fo){ | |
127 | st udies = it emInfo.d.A pplication StudyLooku p.results; | |
128 | if (studies. length > 0 ){ | |
129 | for( count = 0; count < s tudies.len gth;count+ +){ | |
130 | ||
131 | var st udyID = st udies[coun t].ID; | |
132 | var st udyResult= getStudy( studyID); | |
133 | studyR esult.done (function( result) { | |
134 | // resul t is an SP .List beca use that i s what we passed to | |
135 | // resol ve()! | |
136 | var stud y = result ; | |
137 | var Assi gnedIRBAdm inistrator ; | |
138 | if (stud y.d.Assign edIRBAdmin istrator.h asOwnPrope rty('Title ')){ | |
139 | ||
140 | AssignedIR BAdministr ator = stu dy.d.Assig nedIRBAdmi nistrator. Title; | |
141 | } | |
142 | else{ | |
143 | ||
144 | AssignedIR BAdministr ator = "N/ A"; | |
145 | } | |
146 | var Prim aryReviewe r; | |
147 | if (stud y.d.Primar yReviewers .hasOwnPro perty('res ults')){ | |
148 | ||
149 | PrimaryRev iewer = st udy.d.Prim aryReviewe rs.results [0].Title; // Will | |
150 | // Modify | |
151 | // code | |
152 | // to | |
153 | // accomod ate | |
154 | // more | |
155 | // than | |
156 | // one | |
157 | // reviewe r | |
158 | } | |
159 | else{ | |
160 | ||
161 | AssignedIR BAdministr ator = "N/ A"; | |
162 | } | |
163 | studyArr ay.push({ | |
164 | "StudyTitl e": study. d.StudyTit le, | |
165 | "StudyID": study.d.S tudy_ID, | |
166 | "PI": stud y.d.Princi palInvesti gator.Titl e, | |
167 | "PrimaryRe viewer":Pr imaryRevie wer, | |
168 | "IRBAdmin" :AssignedI RBAdminist rator, | |
169 | "Deliberat ion":study .d.Deliber ation, | |
170 | "Decision" : study.d. Decision, | |
171 | "StudyType ":study.d. Applicatio nType | |
172 | }); | |
173 | if (stud yArray.len gth == ite mInfo.d.Ap plicationS tudyLookup .results.l ength ){ | |
174 | agendaColu mns["Studi es"]=study Array; | |
175 | ||
176 | generateDo cx(agendaC olumns); | |
177 | ||
178 | } | |
179 | }); | |
180 | ||
181 | studyR esult.fail (function( result) { | |
182 | // resul t is a str ing becaus e that is what we pa ssed to | |
183 | // rejec t()! | |
184 | var erro r = result ; | |
185 | console. log(error) ; | |
186 | ||
187 | }); | |
188 | ||
189 | ||
190 | } | |
191 | } | |
192 | el se{ // no studies a ttached | |
193 | ||
194 | gene rateDocx(a gendaColum ns); | |
195 | } | |
196 | ||
197 | } | |
198 | function p rocessMinu tes(itemIn fo){ | |
199 | // 468161: F ix the iss ue of gene rate agend a report i n RDC Meet ings list | |
200 | // Uses Cale ndar as so urce inste ad of meet ing minut | |
201 | mi nuteArray. push({ | |
202 | "min uteTitle": itemInfo. Title, | |
203 | "dis cussion": itemInfo.D eliberatio n, | |
204 | "act ion": item Info.Decis ion | |
205 | }) ; | |
206 | ag endaColumn s["Minutes "]=minuteA rray; | |
207 | ||
208 | pr ocessStudi es(itemInf o); | |
209 | ||
210 | ||
211 | ||
212 | } | |
213 | function g enerateDoc x(dataSet) { | |
214 | ||
215 | va r Attendee Array = da taSet["Att endees"]; | |
216 | va r agendaDa te = dataS et["EventD ate"]; | |
217 | va r agendaTi me = dataS et["EventT ime"]; | |
218 | va r agendaSt udies = da taSet["Stu dies"]; | |
219 | va r agendaMi nutes = da taSet["Min utes"]; | |
220 | va r committe eAttendeeC ount = dat aSet["Comm itteeAtten deeCount"] ; | |
221 | va r attendee Count = da taSet["Att endeeCount "]; | |
222 | ||
223 | lo adFile("ht tp://vaww. itst.ram.m sp. DNS /SiteAsset s/js/Agend a-Minutes- Template.d ocx",funct ion(err,co ntent){ | |
224 | doc= new Docxte mplater(co ntent) | |
225 | var clientArra y = [{"nam e":"John S mith", "ro le":"Devel oper", "co i":"Yes"}, {"name":"K ang Cho", "role":"Pr inciple", "coi":"No" }]; | |
226 | doc. setData({ | |
227 | "atten dee":Atten deeArray, | |
228 | "Commi tteeAttend eeCount": committeeA ttendeeCou nt, | |
229 | "Atten deeCount": attendeeCo unt, | |
230 | "date" :agendaDat e, | |
231 | "time" :agendaTim e, | |
232 | "Studi es":agenda Studies, | |
233 | "Minut es":agenda Minutes | |
234 | }); | |
235 | doc. render() / / apply th em | |
236 | outp ut=doc.get Zip().gene rate({type :"blob"}) // Output the docume nt using | |
237 | // Dat a-URI | |
238 | save As(output, "Agenda-Mi nutes-"+ag endaDate+" .docx"); | |
239 | $('# spinnerdiv ').data('s pinner').s top(); | |
240 | }) | |
241 | ||
242 | ||
243 | ||
244 | } | |
245 | ||
246 | function c heckSource Parameter( ){ | |
247 | va r sourcePa ram = getQ ueryString Parameter( 'Source'); | |
248 | if (sourcePa ram == nul l || sourc eParam == '' ){ | |
249 | var thisUrl = window.loc ation.href ; | |
250 | var siteUrl = thisUrl.su bstring(0, thisUrl.i ndexOf("Li sts")-1); | |
251 | wind ow.locatio n.href = U RL_add_par ameter(thi sUrl, 'Sou rce', site Url); | |
252 | } | |
253 | } | |
254 | function g etStudy(in StudyID){ | |
255 | va r d = $.De ferred(); | |
256 | va r realUrl = currentU rl.substri ng(0, curr entUrl.ind exOf("Site Pages")-1) ; | |
257 | $. ajax({ | |
258 | 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", | |
259 | meth od: "GET", | |
260 | head ers: { "Ac cept": "ap plication/ json; odat a=verbose" }, | |
261 | succ ess: funct ion (data) { | |
262 | ||
263 | d.reso lve(data); | |
264 | }, | |
265 | erro r: functio n (data) { | |
266 | // ale rt(data); | |
267 | d.reje ct("getStu dyFailed") ; | |
268 | } | |
269 | }) ; | |
270 | re turn d.pro mise(); | |
271 | } | |
272 | ||
273 | function g etMinute(i nMinutesID ){ | |
274 | va r d = $.De ferred(); | |
275 | va r realUrl = currentU rl.substri ng(0, curr entUrl.ind exOf("Site Pages")-1) ; | |
276 | $. ajax({ | |
277 | url: realUrl + "/_api/we b/lists/ge tbytitle(' CommitteeM inutes')/i tems(" + i nMinutesID + ")?$sel ect=Title, Deliberati on, Decisi on", | |
278 | meth od: "GET", | |
279 | head ers: { "Ac cept": "ap plication/ json; odat a=verbose" }, | |
280 | succ ess: funct ion (data) { | |
281 | ||
282 | d.reso lve(data); | |
283 | }, | |
284 | erro r: functio n (data) { | |
285 | // ale rt(data); | |
286 | d.reje ct("getMin utesFailed "); | |
287 | } | |
288 | }) ; | |
289 | re turn d.pro mise(); | |
290 | } | |
291 | function g etQueryStr ingParamet er(urlPara meterKey) { | |
292 | ||
293 | va r params = document. URL.split( '?')[1].sp lit('&'); | |
294 | va r strParam s = ''; | |
295 | ||
296 | fo r (var i = 0; i < pa rams.lengt h; i = i + 1) { | |
297 | var singlePara m = params [i].split( '='); | |
298 | if ( singlePara m[0] == ur lParameter Key) | |
299 | return decodeURI Component( singlePara m[1]); | |
300 | ||
301 | } | |
302 | ||
303 | } | |
304 | ||
305 | function U RL_add_par ameter(url , param, v alue){ | |
306 | va r hash = {}; | |
307 | va r parser = docum ent.create Element('a '); | |
308 | ||
309 | pa rser.href = url; | |
310 | ||
311 | va r paramete rs = parse r.search.s plit(/\?|& /); | |
312 | ||
313 | fo r(var i=0; i < param eters.leng th; i++) { | |
314 | if(! parameters [i]) | |
315 | contin ue; | |
316 | ||
317 | var ary = parameter s[i].split ('='); | |
318 | hash [ary[0]] = ary[1]; | |
319 | } | |
320 | ||
321 | ha sh[param] = value; | |
322 | ||
323 | va r list = [ ]; | |
324 | Ob ject.keys( hash).forE ach(functi on (key) { | |
325 | list .push(key + '=' + ha sh[key]); | |
326 | }) ; | |
327 | ||
328 | pa rser.searc h = '?' + list.join( '&'); | |
329 | re turn parse r.href; | |
330 | } | |
331 | ||
332 | </script> |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.