Produced by Araxis Merge on 4/18/2017 7:43:53 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 | RDCApplicationListFragment.js | Mon Apr 17 17:57:52 2017 UTC |
2 | RAMS-Integration_CIF.zip | RDCApplicationListFragment.js | Tue Apr 18 12:33:07 2017 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 438 |
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 | //Please i nsert as a fragment on the RDC Page on t he bottom of the scr een. | |
2 | <script | |
3 | src="/ /ajax.aspn etcdn.com/ ajax/4.0/1 /Microsoft Ajax.js" | |
4 | type=" text/javas cript"> | |
5 | </script> | |
6 | <script ty pe="text/j avascript" src="/_l ayouts/15/ sp.runtime .js"> | |
7 | </script> | |
8 | <script ty pe="text/j avascript" src="/_l ayouts/15/ sp.js"> | |
9 | </script> | |
10 | <script ty pe="text/j avascript" src="/Si teAssets/j s/jquery.j s"></scrip t> | |
11 | ||
12 | ||
13 | ||
14 | ||
15 | <link rel= "styleshee t" type="t ext/css" h ref="//cdn .datatable s.net/1.10 .12/css/jq uery.dataT ables.css" > | |
16 | ||
17 | ||
18 | ||
19 | <script ty pe="text/j avascript" charset=" utf8" src= "//cdn.dat atables.ne t/1.10.12/ js/jquery. dataTables .js"></scr ipt> | |
20 | <script ty pe="text/j avascript" > | |
21 | ||
22 | var h ostweburl= "/"; | |
23 | var a pplication List = new Array(); | |
24 | var isMember = false; | |
25 | ||
26 | ||
27 | // Loa d the requ ired Share Point libr aries. | |
28 | $(docu ment).read y(function () { | |
29 | // G et the URI decoded U RLs. | |
30 | //h ostweburl = decodeUR IComponent (getQueryS tringParam eter("SPHo stUrl")); | |
31 | ||
32 | // The js fi les are in a URL in the form: | |
33 | // web_url/_ layouts/15 /resource_ file | |
34 | va r scriptba se = hostw eburl + "/ _layouts/1 5/"; | |
35 | ||
36 | // Load the js files a nd continu e to | |
37 | // the execO peration f unction. | |
38 | $. getScript( scriptbase + "SP.Run time.js", | |
39 | function () { | |
40 | $.ge tScript(sc riptbase + "SP.js", execOperat ion); | |
41 | } | |
42 | ); | |
43 | Chec kCurrentUs erMembersh ip(); | |
44 | //re trieveAppl icationLis tItems(hos tweburl); | |
45 | ||
46 | ||
47 | ||
48 | }); | |
49 | ||
50 | ||
51 | ||
52 | ||
53 | function C heckCurren tUserMembe rship() { | |
54 | ||
55 | var cl ientContex t = new SP .ClientCon text.get_c urrent(); | |
56 | this.c urrentUser = clientC ontext.get _web().get _currentUs er(); | |
57 | client Context.lo ad(this.cu rrentUser) ; | |
58 | ||
59 | this.u serGroups = this.cur rentUser.g et_groups( ); | |
60 | client Context.lo ad(this.us erGroups); | |
61 | client Context.ex ecuteQuery Async(onCh eckCurrent UserMember shipQueryS ucceeded); | |
62 | } | |
63 | ||
64 | function o nCheckCurr entUserMem bershipQue rySucceede d() { | |
65 | v ar groupsE numerator = userGrou ps.getEnum erator(); | |
66 | while (gro upsEnumera tor.moveNe xt()) { | |
67 | var gro up= groups Enumerator .get_curre nt(); | |
68 | ||
69 | if(grou p.get_titl e() == "RD C Group") { | |
70 | isM ember = tr ue; | |
71 | bre ak; | |
72 | } | |
73 | ||
74 | } | |
75 | ||
76 | ||
77 | if ( isMember) { | |
78 | retrie veApplicat ionListIte ms(hostweb url); | |
79 | } | |
80 | ||
81 | } | |
82 | ||
83 | ||
84 | // Funct ion to ret rieve a qu ery string value. | |
85 | // For productio n purposes you may w ant to use | |
86 | // a l ibrary to handle the query str ing. | |
87 | functi on getQuer yStringPar ameter(par amToRetrie ve) { | |
88 | va r params = | |
89 | document .URL.split ("?")[1].s plit("&"); | |
90 | va r strParam s = ""; | |
91 | fo r (var i = 0; i < pa rams.lengt h; i = i + 1) { | |
92 | var sing leParam = params[i]. split("=") ; | |
93 | if (sing leParam[0] == paramT oRetrieve) | |
94 | retu rn singleP aram[1]; | |
95 | } | |
96 | } | |
97 | ||
98 | ||
99 | function r etrieveApp licationLi stItems(si teurl) { | |
100 | var cl ientContex t = new SP .ClientCon text(siteu rl); | |
101 | var aL ist = clie ntContext. get_web(). get_lists( ).getByTit le('Applic ation'); | |
102 | ||
103 | var ca mlQuery = new SP.Cam lQuery(); | |
104 | ||
105 | camlQuery. set_viewXm l('<View>< Query><Whe re><Contai ns><FieldR ef Name="A pplication Status"/>< Value Type ="Text">Ap proved</Va lue></Cont ains><Or>< Or><Member ship Type= \CurrentUs erGroups\> <FieldRef Name=\Visi bleToGroup \/></Membe rship><Eq> <FieldRef Name=\Visi bleToGroup \/><Value Type=\Inte ger\><User ID/></Valu e></Eq></O r><Eq><Fie ldRef Name =\Author\/ ><Value Ty pe=\Intege r\><UserID /></Value ></Eq></Or ></Where>< /Query></V iew>'); | |
106 | ||
107 | ||
108 | this.c ollListIte m = aList. getItems(c amlQuery); | |
109 | ||
110 | client Context.lo ad(collLis tItem); | |
111 | client Context.ex ecuteQuery Async( | |
112 | Fu nction.cre ateDelegat e(this, th is.onQuery Succeeded) , | |
113 | Fu nction.cre ateDelegat e(this, th is.onQuery Failed) | |
114 | ); | |
115 | } | |
116 | ||
117 | function A pplication (studyIdL ink, study Title, pri ncipalInve stigator, applicatio nType, app licationSt atus, rene walDate) { | |
118 | ||
119 | this. studyIdLin k=studyIdL ink; | |
120 | this. studyTitle =studyTitl e; | |
121 | this. principalI nvestigato r=principa lInvestiga tor; | |
122 | this. applicatio nType= app licationTy pe; | |
123 | this. applicatio nStatus=ap plicationS tatus; | |
124 | this. renewalDat e=renewalD ate; | |
125 | ||
126 | } | |
127 | ||
128 | ||
129 | ||
130 | ||
131 | function o nQuerySucc eeded(send er, args) { | |
132 | var li stItemEnum erator = t his.collLi stItem.get Enumerator (); | |
133 | ||
134 | while (listItemE numerator. moveNext() ) { | |
135 | var a ListItem = listItemE numerator. get_curren t(); | |
136 | ||
137 | va r studyIdL ink=aListI tem.get_it em("StudyI DLink"); | |
138 | va r studyTit le =aListI tem.get_it em("StudyT itle"); | |
139 | va r principa lInvestiga tor = aLis tItem.get_ item("Prin cipalInves tigator"); | |
140 | va r principa lInvestiga torName="" ; | |
141 | ||
142 | if (p rincipalIn vestigator !=null) { | |
143 | prin cipalInves tigatorNam e=principa lInvestiga tor.get_lo okupValue( ); | |
144 | } | |
145 | ||
146 | var princi palInvesti gatorNameL ink="<a hr ef=http:// vaww.mysit es.itst.ra m.msp. DNS /"; | |
147 | if (prin cipalInves tigatorNam e.indexOf( 'Ren') >= 0) { | |
148 | princip alInvestig atorNameLi nk+='RenSh an'; | |
149 | } else i f (princip alInvestig atorName.i ndexOf('Ne etu')>= 0) { | |
150 | principalI nvestigato rNameLink+ ='NeetuGar za'; | |
151 | } else i f (princip alInvestig atorName.i ndexOf('Ge orge')>= 0 ) { | |
152 | principalI nvestigato rNameLink+ ='GeorgeBa ker'; | |
153 | } | |
154 | else if (principal Investigat orName.ind exOf('Jame s')>= 0) { | |
155 | principalI nvestigato rNameLink+ ='JamesStr obak'; | |
156 | } | |
157 | else if (principal Investigat orName.ind exOf('Mich ael')>= 0) { | |
158 | principalI nvestigato rNameLink+ ='MichaelH ussey'; | |
159 | } | |
160 | ||
161 | prin cipalInves tigatorNam eLink+= "> " + princi palInvesti gatorName + "</a>"; | |
162 | ||
163 | ||
164 | var applicatio nType =aLi stItem.get _item("App licationTy pe"); | |
165 | var applicatio nStatus= a ListItem.g et_item("A pplication Status"); | |
166 | var renewalDat e=aListIte m.get_item ("RenewalD ate"); | |
167 | var iacucOvers ightRequir ed=aListIt em.get_ite m("IACUCRe quired"); | |
168 | var newApplic ation=new Applicatio n(studyIdL ink, study Title, pri ncipalInve stigatorNa meLink, ap plicationT ype, appli cationStat us, renewa lDate); | |
169 | ||
170 | appl icationLis t.push(new Applicatio n); | |
171 | ||
172 | ||
173 | } | |
174 | ||
175 | ||
176 | $('#applic ationList' ).DataTabl e( { | |
177 | ||
178 | data: applicatio nList, | |
179 | ||
180 | column s: [ | |
181 | { data: 'st udyIdLink' }, | |
182 | { da ta: 'study Title' }, | |
183 | { da ta: 'princ ipalInvest igator' }, | |
184 | { da ta: 'appli cationType ' }, | |
185 | { da ta: 'appli cationStat us' }, | |
186 | { da ta: 'renew alDate' } | |
187 | ||
188 | ||
189 | ||
190 | ||
191 | ||
192 | ||
193 | ] | |
194 | ||
195 | } ); | |
196 | ||
197 | ||
198 | } | |
199 | ||
200 | ||
201 | function o nQueryFail ed(sender, args) { | |
202 | alert( 'Request f ailed. ' + args.get_ message() + | |
203 | '\ n' + args. get_stackT race()); | |
204 | } | |
205 | ||
206 | </script> | |
207 | ||
208 | <table id= "applicati onList" cl ass="displ ay"> | |
209 | <thead> | |
210 | <tr> | |
211 | <th>StudyI DLink</th> | |
212 | <th>Study Title</th> | |
213 | <th>Princi pal Invest igator</th > | |
214 | <th>Applic ation Type </th> | |
215 | <th>Applic ation Stat us</th> | |
216 | <th>Renewa l Date</th > | |
217 | ||
218 | </tr> | |
219 | </the ad> | |
220 | </table> |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.