-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathorgDetail.php
More file actions
342 lines (293 loc) · 17.1 KB
/
orgDetail.php
File metadata and controls
342 lines (293 loc) · 17.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<?php
/*
**************************************************************************************************************************
** CORAL Organizations Module
**
** Copyright (c) 2010 University of Notre Dame
**
** This file is part of CORAL.
**
** CORAL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
**
** CORAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License along with CORAL. If not, see <http://www.gnu.org/licenses/>.
**
**************************************************************************************************************************
*/
session_start();
include_once 'directory.php';
//if system number's passed in, it's a new request
$organizationID = $_GET['organizationID'];
$organization = new Organization(new NamedArguments(array('primaryKey' => $organizationID)));
//set this to turn off displaying the title header in header.php
$pageTitle=$organization->name;
include 'templates/header.php';
//set referring page
if ((isset($_GET['ref'])) && ($_GET['ref'] == 'new')){
$_SESSION['ref_script']="new";
}else{
$_SESSION['ref_script']=$currentPage;
}
//as long as organization is valid...
if ($organization->name){
//if the licensing module is installed display licensing tab
$config = new Configuration;
$showLicensing='N';
if ($config->settings->licensingModule == 'Y'){
$showLicensing = 'Y';
$numLicenses = count($organization->getLicenses());
}
?>
<table class="headerTable" style="background-image:url('images/header.gif');background-repeat:no-repeat;">
<tr><td align='left'>
<table style='width:100%;'>
<tr style='vertical-align:top'>
<td><span class="headerText" id='span_orgName'><?php echo $organization->name; ?></span><br />
<br />
</td>
<td style='text-align:right;width:50px;'>
<div id="search_box">
<input type="text" id="search_organization" name="search_organization" value="<?php if (isset($_GET['search_organization'])) { echo $_GET['search_organization']; } else { echo _('Organization Search'); } ?>" class='swap_value' />
<input type='hidden' id='search_organizationID' name='search_organizationID' value='' />
</div>
</td>
</tr>
</table>
<input type='hidden' name='organizationID' id='organizationID' value='<?php echo $organizationID; ?>'>
<input type='hidden' name='numLicenses' id='numLicenses' value='<?php echo $numLicenses; ?>'>
<?php
if ($config->settings->resourcesModule == 'Y'){ ?>
<div style="width: 303px; float:right; border: 1px solid #DAD5C9; padding:5px;">
<h3><?php echo _("Helpful Links");?></h3>
<div class='rightPanelLink' style='padding-left:10px;'><a href='summary.php?organizationID=<?php echo $organizationID; ?>' target='_blank' class='helpfulLink'><?php echo _("Print View");?></a></div>
<?php
//get all possible roles, sort by name, get associated resources
$org_role_obj = new OrganizationRole();
$org_roles = $org_role_obj->allAsArray();
usort($org_roles, function ($a, $b) { return strcmp($a["shortName"], $b["shortName"]); });
foreach ($org_roles as $role) {
$resources = $organization->getResources($role["organizationRoleID"]);
if (count($resources) > 0) {
?>
<h4 style="margin-top:8px"><?php echo $role["shortName"]. _(" of:");?></h4>
<div style="padding-left:10px;">
<?php
foreach ($resources as $resource) {
$temp_style = "";
if ($resource['archived']) {
echo "<span style='color:grey; font-size:80%;'>"._("(archived)")." </span>";
$temp_style = "style='color:#888888'";
}
echo "<a href='" . $util->getResourceRecordURL() . $resource['resourceID'] . "' target='_BLANK' $temp_style>" . $resource['titleText'] . " <img src='images/arrow-up-right.gif' alt='"._("view resource")."' title='"._("View ") . $resource['titleText'] . "' style='vertical-align:top;'></a><br />";
}
?>
</div>
<?php
}
}
?>
</div>
<?php } ?>
<?php if (!isset($_GET['showTab'])){ ?>
<div style="width: 577px;" id ='div_organization'>
<?php } else { ?>
<div style="display:none;width: 577px;" id ='div_organization'>
<?php } ?>
<table cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed;">
<tr>
<td class="sidemenu">
<div class="sidemenuselected" style='position: relative; width: 99px'><span class='link'><?php echo _("Organization");?></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAliases'><?php echo _("Aliases");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showContacts'><?php echo _("Contacts");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAccount'><?php echo _("Accounts");?></a></span></div>
<?php
if ($config->settings->resourcesIssues == "Y") {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showResourceIssues'>"._("Issues")."</a></span></div>";
} else {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showIssues'>"._("Issues")."</a></span></div>";
}
?>
<?php if ($showLicensing == "Y") { ?><div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showLicenses'><?php echo _("Licenses");?></a></span><br /><span class='smallGreyText' style='clear:right; margin-left:8px;'> (<?php if ($numLicenses == "1") { echo $numLicenses . _(" record"); }else{ echo $numLicenses . _(" records"); } ?>)</span></div><?php } ?>
</td>
<td class='mainContent'>
<div id='div_organizationDetails'>
</div>
</td>
</tr>
</table>
</div>
<?php if ((isset($_GET['showTab'])) && ($_GET['showTab'] == 'alias')){ ?>
<div style="width: 577px;" id ='div_aliases'>
<?php } else { ?>
<div style="display:none;width: 577px;" id ='div_aliases'>
<?php } ?>
<table cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed;">
<tr>
<td class="sidemenu">
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showOrganization'><?php echo _("Organization");?></a></span></div>
<div class="sidemenuselected" style='position: relative; width: 99px'><span class='link'><?php echo _("Aliases");?></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showContacts'><?php echo _("Contacts");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAccount'><?php echo _("Accounts");?></a></span></div>
<?php
if ($config->settings->resourcesIssues == "Y") {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showResourceIssues'>"._("Issues")."</a></span></div>";
} else {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showIssues'>"._("Issues")."</a></span></div>";
}
?>
<?php if ($showLicensing == "Y") { ?><div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showLicenses'><?php echo _("Licenses");?></a></span><br /><span class='smallGreyText' style='clear:right; margin-left:8px;'> (<?php if ($numLicenses == "1") { echo $numLicenses . _(" record"); }else{ echo $numLicenses . _(" records"); } ?>)</span></div><?php } ?>
</td>
<td class='mainContent'>
<div id='div_aliasDetails'>
</div>
</td>
</tr>
</table>
</div>
<?php if ((isset($_GET['showTab'])) && ($_GET['showTab'] == 'contacts')){ ?>
<div style="width: 577px;" id ='div_contacts'>
<?php } else { ?>
<div style="display:none;width: 577px;" id ='div_contacts'>
<?php } ?>
<table cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed;">
<tr>
<td class="sidemenu">
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showOrganization'><?php echo _("Organization");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAliases'><?php echo _("Aliases");?></a></span></div>
<div class="sidemenuselected" style='position: relative; width: 99px'><span class='link'><?php echo _("Contacts");?></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAccount'><?php echo _("Accounts");?></a></span></div>
<?php
if ($config->settings->resourcesIssues == "Y") {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showResourceIssues'>"._("Issues")."</a></span></div>";
} else {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showIssues'>"._("Issues")."</a></span></div>";
}
?>
<?php if ($showLicensing == "Y") { ?><div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showLicenses'><?php echo _("Licenses");?></a></span><br /><span class='smallGreyText' style='clear:right; margin-left:8px;'> (<?php if ($numLicenses == "1") { echo $numLicenses . _(" record"); }else{ echo $numLicenses . _(" records"); } ?>)</span></div><?php } ?>
</td>
<td class='mainContent'>
<div id='div_contactDetails'></div>
<div id='div_archivedContactDetails'></div>
<?php if ($user->canEdit()){ ?>
<br />
<a href='ajax_forms.php?action=getContactForm&height=463&width=345&modal=true&type=named&organizationID=<?php echo $organizationID; ?>' class='thickbox'><?php echo _("add contact");?></a><br />
<?php } ?>
</td>
</tr>
</table>
</div>
<?php if ((isset($_GET['showTab'])) && ($_GET['showTab'] == 'accounts')){ ?>
<div style="width: 577px;" id ='div_account'>
<?php } else { ?>
<div style="display:none;width: 577px;" id ='div_account'>
<?php } ?>
<table cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed;">
<tr>
<td class="sidemenu">
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showOrganization'><?php echo _("Organization");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAliases'><?php echo _("Aliases");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showContacts'><?php echo _("Contacts");?></a></span></div>
<div class="sidemenuselected" style='position: relative; width: 99px'><span class='link'><?php echo _("Accounts");?></span></div>
<?php
if ($config->settings->resourcesIssues == "Y") {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showResourceIssues'>"._("Issues")."</a></span></div>";
} else {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showIssues'>"._("Issues")."</a></span></div>";
}
?>
<?php if ($showLicensing == "Y") { ?><div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showLicenses'><?php echo _("Licenses");?></a></span><br /><span class='smallGreyText' style='clear:right; margin-left:8px;'> (<?php if ($numLicenses == "1") { echo $numLicenses . _(" record"); }else{ echo $numLicenses . _(" records"); } ?>)</span></div><?php } ?>
</td>
<td class='mainContent'>
<div id='div_accountDetails'>
</div>
</td>
</tr>
</table>
</div>
<?php
if ($config->settings->resourcesIssues == "Y") {
?>
<div style="display:none;width: 577px;" id ='div_resourceissues'>
<table cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed;">
<tr>
<td class="sidemenu">
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showOrganization'>Organization</a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAliases'>Aliases</a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showContacts'>Contacts</a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAccount'>Accounts</a></span></div>
<div class='sidemenuselected' style='position: relative; width: 99px'><span class='link'><?php echo _("Issues");?></span></div>
<?php if ($showLicensing == "Y") { ?><div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showLicenses'>Licenses</a></span><br /><span class='smallGreyText' style='clear:right; margin-left:8px;'> (<?php if ($numLicenses == "1") { echo $numLicenses . " record"; }else{ echo $numLicenses . " records"; } ?>)</span></div><?php } ?>
</td>
<td class='mainContent'>
<div id='div_resourceissueDetails'>
</div>
</td>
</tr>
</table>
</div>
<?php
} else {
?>
<div style="display:none;width: 577px;" id ='div_issues'>
<table cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed;">
<tr>
<td class="sidemenu">
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showOrganization'><?php echo _("Organization");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAliases'><?php echo _("Aliases");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showContacts'><?php echo _("Contacts");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAccount'><?php echo _("Accounts");?></a></span></div>
<div class="sidemenuselected" style='position: relative; width: 99px'><span class='link'><?php echo _("Issues");?></span></div>
<?php if ($showLicensing == "Y") { ?><div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showLicenses'><?php echo _("Licenses");?></a></span><br /><span class='smallGreyText' style='clear:right; margin-left:8px;'> (<?php if ($numLicenses == "1") { echo $numLicenses . _(" record"); }else{ echo $numLicenses . _(" records"); } ?>)</span></div><?php } ?>
</td>
<td class='mainContent'>
<div id='div_issueDetails'>
</div>
</td>
</tr>
</table>
</div>
<?php
}
?>
<?php
if ($showLicensing == "Y") {
?>
<div style="display:none;width: 577px;" id ='div_licenses'>
<table cellpadding="0" cellspacing="0" style="width: 100%; table-layout: fixed;">
<tr>
<td class="sidemenu">
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showOrganization'><?php echo _("Organization");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAliases'><?php echo _("Aliases");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showContacts'><?php echo _("Contacts");?></a></span></div>
<div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showAccount'><?php echo _("Accounts");?></a></span></div>
<?php
if ($config->settings->resourcesIssues == "Y") {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showResourceIssues'>"._("Issues")."</a></span></div>";
} else {
echo " <div class='sidemenuunselected'><span class='link'><a href='javascript:void(0)' class='showIssues'>"._("Issues")."</a></span></div>";
}
?>
<div class="sidemenuselected" style='position: relative; width: 99px'><span class='link'><?php echo _("Licenses");?></span><br /><span class='smallGreyText' style='clear:right; margin-left:8px;'> (<?php if ($numLicenses == "1") { echo $numLicenses . _(" record"); }else{ echo $numLicenses . _(" records"); } ?>)</span></div>
</td>
<td class='mainContent'>
<div id='div_licenseDetails'>
</div>
</td>
</tr>
</table>
</div>
<?php
}
?>
</td></tr>
</table>
<script type="text/javascript" src="js/orgDetail.js"></script>
<?php
//end if organization valid
}else{
echo _("invalid organization");
}
//print footer
include 'templates/footer.php';
?>