Several fixes

- views updated
- menues updated
- fixed attribute search
pull/762/head
Iglocska 2015-04-19 10:44:24 +02:00
parent 51ea9c090d
commit 63fd8a51d9
7 changed files with 163 additions and 89 deletions

View File

@ -1252,15 +1252,15 @@ class AttributesController extends AppController {
$saveWord = trim($orgArrayElement);
if (empty($saveWord)) continue;
if ($saveWord[0] == '!') {
$org_names = $this->Organisation->find('first', array(
$org_names = $this->Organisation->find('all', array(
'fields' => array('id', 'name'),
'conditions' => array('name LIKE' => '%' . substr($saveWord, 1) . '%'),
'conditions' => array('lower(name) LIKE' => '%' . strtolower(substr($saveWord, 1)) . '%'),
));
foreach ($org_names as $org_name) $temp['AND'][] = array('Event.orgc_id !=' => $org_name['Organisation']['id']);
} else {
$org_names = $this->Organisation->find('first', array(
$org_names = $this->Organisation->find('all', array(
'fields' => array('id', 'name'),
'conditions' => array('name LIKE' => '%' . $saveWord . '%'),
'conditions' => array('lower(name) LIKE' => '%' . strtolower($saveWord) . '%'),
));
foreach ($org_names as $org_name) $temp['OR'][] = array('Event.orgc_id' => $org_name['Organisation']['id']);
}

View File

@ -76,6 +76,7 @@ class OrganisationsController extends AppController {
$this->Organisation->read(null, $id);
$this->set('orgId', $id);
$this->request->data = $this->Organisation->data;
$this->set('id', $id);
}
public function admin_delete($id) {

View File

@ -156,12 +156,17 @@ class SharingGroupsController extends AppController {
public function view($id) {
if (!$this->SharingGroup->checkIfAuthorised($this->Auth->user(), $id)) throw new MethodNotAllowedException('Sharing group doesn\'t exist or you do not have permission to access it.');
$this->SharingGroup->id = $id;
$this->SharingGroup->contain(array('SharingGroupOrg' => array('Organisation'), 'Organisation'));
$this->SharingGroup->contain(array('SharingGroupOrg' => array('Organisation'), 'Organisation', 'SharingGroupServer' => array('Server')));
$this->SharingGroup->read();
debug($this->SharingGroup->data);
$sg = $this->SharingGroup->data;
if (isset($sg['SharingGroupServer'])) {
foreach ($sg['SharingGroupServer'] as &$sgs) {
if ($sgs['server_id'] == 0) $sgs['Server'] = array('name' => 'Local instance', 'url' => Configure::read('MISP.baseurl'));
}
}
$this->set('mayModify', $this->SharingGroup->checkIfAuthorisedExtend($this->Auth->user(), $id));
$this->set('id', $id);
$this->set('sg', $this->SharingGroup->data);
$this->set('sg', $sg);
}
public function access1() {

View File

@ -1,6 +1,6 @@
<div class="actions <?php echo $debugMode;?> sideMenu">
<ul class="nav nav-list">
<?php
<?php
switch ($menuList) {
case 'event':
if ($menuItem === 'addAttribute' ||
@ -14,23 +14,23 @@
if ($isAclPublish) $mayPublish = true;
}
?>
<li <?php if ($menuItem === 'viewEvent') echo 'class="active"';?>><a href="/events/view/<?php echo $event['Event']['id'];?>">View Event</a></li>
<li <?php if ($menuItem === 'eventLog') echo 'class="active"';?>><a href="/logs/event_index/<?php echo $event['Event']['id'];?>">View Event History</a></li>
<li id='liviewEvent'><a href="/events/view/<?php echo $event['Event']['id'];?>">View Event</a></li>
<li id='lieventLog'><a href="/logs/event_index/<?php echo $event['Event']['id'];?>">View Event History</a></li>
<li class="divider"></li>
<?php if ($isSiteAdmin || (isset($mayModify) && $mayModify)): ?>
<li <?php if ($menuItem === 'editEvent') echo 'class="active"';?>><a href="/events/edit/<?php echo $event['Event']['id'];?>">Edit Event</a></li>
<li id='lieditEvent'><a href="/events/edit/<?php echo $event['Event']['id'];?>">Edit Event</a></li>
<li><?php echo $this->Form->postLink('Delete Event', array('action' => 'delete', $event['Event']['id']), null, __('Are you sure you want to delete # %s?', $event['Event']['id'])); ?></li>
<li <?php if ($menuItem === 'addAttribute') echo 'class="active"';?>><a href="/attributes/add/<?php echo $event['Event']['id'];?>">Add Attribute</a></li>
<li <?php if ($menuItem === 'addAttachment') echo 'class="active"';;?>><a href="/attributes/add_attachment/<?php echo $event['Event']['id'];?>">Add Attachment</a></li>
<li <?php if ($menuItem === 'addIOC') echo 'class="active"';?>><a href="/events/addIOC/<?php echo $event['Event']['id'];?>">Populate from OpenIOC</a></li>
<li <?php if ($menuItem === 'addThreatConnect') echo 'class="active"';?>><a href="/attributes/add_threatconnect/<?php echo $event['Event']['id']; ?>">Populate from ThreatConnect</a></li>
<?php if ($menuItem === 'populateFromtemplate'): ?>
<li id='liaddAttribute'><a href="/attributes/add/<?php echo $event['Event']['id'];?>">Add Attribute</a></li>
<li id='liaddAttachment'><a href="/attributes/add_attachment/<?php echo $event['Event']['id'];?>">Add Attachment</a></li>
<li id='liaddIOC'><a href="/events/addIOC/<?php echo $event['Event']['id'];?>">Populate from OpenIOC</a></li>
<li id='liaddThreatConnect'><a href="/attributes/add_threatconnect/<?php echo $event['Event']['id']; ?>">Populate from ThreatConnect</a></li>
<?php if ($menuItem === 'populateFromtemplate'): ?>
<li class="active"><a href="/templates/populateEventFromTemplate/<?php echo $template_id . '/' . $event['Event']['id']; ?>">Populate From Template</a></li>
<?php endif; ?>
<?php endif; ?>
<?php if (($isSiteAdmin && (!isset($mayModify) || !$mayModify)) || (!isset($mayModify) || !$mayModify)): ?>
<li <?php if ($menuItem === 'proposeAttribute') echo 'class="active"';?>><a href="/shadow_attributes/add/<?php echo $event['Event']['id'];?>">Propose Attribute</a></li>
<li <?php if ($menuItem === 'proposeAttachment') echo 'class="active"';?>><a href="/shadow_attributes/add_attachment/<?php echo $event['Event']['id'];?>">Propose Attachment</a></li>
<li id='liproposeAttribute'><a href="/shadow_attributes/add/<?php echo $event['Event']['id'];?>">Propose Attribute</a></li>
<li id='liproposeAttachment'><a href="/shadow_attributes/add_attachment/<?php echo $event['Event']['id'];?>">Propose Attachment</a></li>
<?php endif; ?>
<li class="divider"></li>
<?php
@ -42,7 +42,7 @@
<li<?php echo $publishButtons; ?> class="publishButtons"><a href="#" onClick="publishPopup('<?php echo $event['Event']['id']; ?>', 'alert')">Publish Event</a></li>
<li<?php echo $publishButtons; ?> class="publishButtons"><a href="#" onClick="publishPopup('<?php echo $event['Event']['id']; ?>', 'publish')">Publish (no email)</a></li>
<li <?php if ($menuItem === 'contact') echo 'class="active"';?>><a href="/events/contact/<?php echo $event['Event']['id'];?>">Contact Reporter</a></li>
<li id='licontact'><a href="/events/contact/<?php echo $event['Event']['id'];?>">Contact Reporter</a></li>
<li><a onClick="getPopup('<?php echo $event['Event']['id']; ?>', 'events', 'exportChoice');" style="cursor:pointer;">Download as...</a></li>
<li class="divider"></li>
<li><a href="/events/index">List Events</a></li>
@ -52,33 +52,33 @@
break;
case 'event-collection': ?>
<li <?php if ($menuItem === 'index') echo 'class="active"';?>><a href="/events/index">List Events</a></li>
<li id='liindex'><a href="/events/index">List Events</a></li>
<?php if ($isAclAdd): ?>
<li <?php if ($menuItem === 'add') echo 'class="active"';?>><a href="/events/add">Add Event</a></li>
<li <?php if ($menuItem === 'addXML') echo 'class="active"';?>><a href="/events/add_xml">Add MISP XML</a></li>
<li id='liadd'><a href="/events/add">Add Event</a></li>
<li id='liaddXML'><a href="/events/add_xml">Add MISP XML</a></li>
<?php endif; ?>
<li class="divider"></li>
<li <?php if ($menuItem === 'listAttributes') echo 'class="active"';?>><a href="/attributes/index">List Attributes</a></li>
<li <?php if ($menuItem === 'searchAttributes' || $menuItem === 'searchAttributes2') echo 'class="active"';?>><a href="/attributes/search">Search Attributes</a></li>
<li id='lilistAttributes'><a href="/attributes/index">List Attributes</a></li>
<li id='lisearchAttributes' || $menuItem === 'searchAttributes2'><a href="/attributes/search">Search Attributes</a></li>
<?php if ($menuItem == 'searchAttributes2'): ?>
<li class="divider"></li>
<li><a href="/events/downloadSearchResult">Download results as XML</a></li>
<li><a href="/events/csv/download/search">Download results as CSV</a></li>
<?php endif; ?>
<li class="divider"></li>
<li <?php if ($menuItem === 'viewProposals') echo 'class="active"';?>><a href="/shadow_attributes/index">View Proposals</a></li>
<li <?php if ($menuItem === 'viewProposalIndex') echo 'class="active"';?>><a href="/events/proposalEventIndex">Events with proposals</a></li>
<li id='liviewProposals'><a href="/shadow_attributes/index">View Proposals</a></li>
<li id='liviewProposalIndex'><a href="/events/proposalEventIndex">Events with proposals</a></li>
<li class="divider"></li>
<li <?php if ($menuItem === 'export') echo 'class="active"';?>><a href="/events/export">Export</a></li>
<li id='liexport'><a href="/events/export">Export</a></li>
<?php if ($isAclAuth): ?>
<li <?php if ($menuItem === 'automation') echo 'class="active"';?>><a href="/events/automation">Automation</a></li>
<li id='liautomation'><a href="/events/automation">Automation</a></li>
<?php endif;
break;
case 'regexp': ?>
<li <?php if ($menuItem === 'index') echo 'class="active"';?>><?php echo $this->Html->link('List Regexp', array('admin' => $isSiteAdmin, 'action' => 'index'));?></li>
<li id='liindex'><?php echo $this->Html->link('List Regexp', array('admin' => $isSiteAdmin, 'action' => 'index'));?></li>
<?php if ($isSiteAdmin): ?>
<li <?php if ($menuItem === 'add') echo 'class="active"';?>><?php echo $this->Html->link('New Regexp', array('admin' => true, 'action' => 'add'));?></li>
<li id='liadd'><?php echo $this->Html->link('New Regexp', array('admin' => true, 'action' => 'add'));?></li>
<li><?php echo $this->Html->link('Perform on existing', array('admin' => true, 'action' => 'clean'));?></li>
<?php endif;
if ($menuItem == 'edit'):?>
@ -90,9 +90,9 @@
break;
case 'whitelist':?>
<li <?php if ($menuItem === 'index') echo 'class="active"';?>><?php echo $this->Html->link('List Whitelist', array('admin' => $isSiteAdmin, 'action' => 'index'));?></li>
<li id='liindex'><?php echo $this->Html->link('List Whitelist', array('admin' => $isSiteAdmin, 'action' => 'index'));?></li>
<?php if ($isSiteAdmin): ?>
<li <?php if ($menuItem === 'add') echo 'class="active"';?>><?php echo $this->Html->link('New Whitelist', array('admin' => true, 'action' => 'add'));?></li>
<li id='liadd'><?php echo $this->Html->link('New Whitelist', array('admin' => true, 'action' => 'add'));?></li>
<?php endif;
if ($menuItem == 'edit'):?>
<li class="divider"></li>
@ -104,28 +104,28 @@
case 'globalActions':
if ($menuItem === 'edit' || $menuItem === 'view'): ?>
<li <?php if ($menuItem === 'edit') echo 'class="active"';?>><?php echo $this->Html->link(__('Edit User', true), array('action' => 'edit', $user['User']['id'])); ?></li>
<li id='liedit'><?php echo $this->Html->link(__('Edit User', true), array('action' => 'edit', $user['User']['id'])); ?></li>
<li class="divider"></li>
<?php endif; ?>
<li <?php if ($menuItem === 'news') echo 'class="active"';?>><a href="/users/news">News</a></li>
<li <?php if ($menuItem === 'view') echo 'class="active"';?>><a href="/users/view/me">My Profile</a></li>
<li <?php if ($menuItem === 'members') echo 'class="active"';?>><a href="/users/memberslist">Members List</a></li>
<li <?php if ($menuItem === 'indexOrg') echo 'class="active"';?>><a href="/organisations/index">List Organisations</a></li>
<li id='linews'><a href="/users/news">News</a></li>
<li id='liview'><a href="/users/view/me">My Profile</a></li>
<li id='limembers'><a href="/users/memberslist">Members List</a></li>
<li id='liindexOrg'><a href="/organisations/index">List Organisations</a></li>
<?php if ($menuItem === 'viewOrg'): ?>
<li class="active"><a href="/organisations/view/<?php echo $orgId;?>">View Organisation</a></li>
<?php endif;?>
<li <?php if ($menuItem === 'roles') echo 'class="active"';?>><a href="/roles/index">Role Permissions</a></li>
<li id='liroles'><a href="/roles/index">Role Permissions</a></li>
<li class="divider"></li>
<?php if ($menuItem === 'editSG' || ($menuItem == 'viewSG' && $mayModify)): ?>
<li <?php if ($menuItem === 'editSG') echo 'class="active"';?>><a href="/sharing_groups/edit/<?php echo $id; ?>">Edit Sharing Group</a></li>
<li <?php if ($menuItem === 'viewSG') echo 'class="active"';?>><a href="/sharing_groups/view/<?php echo $id;?>">View Sharing Group</a></li>
<li id='lieditSG'><a href="/sharing_groups/edit/<?php echo $id; ?>">Edit Sharing Group</a></li>
<li id='liviewSG'><a href="/sharing_groups/view/<?php echo $id;?>">View Sharing Group</a></li>
<?php endif; ?>
<li <?php if ($menuItem === 'indexSG') echo 'class="active"';?>><a href="/sharing_groups/index">List Sharing Groups</a></li>
<li <?php if ($menuItem === 'addSG') echo 'class="active"';?>><a href="/sharing_groups/add">Add Sharing Group</a></li>
<li id='liindexSG'><a href="/sharing_groups/index">List Sharing Groups</a></li>
<li id='liaddSG'><a href="/sharing_groups/add">Add Sharing Group</a></li>
<li class="divider"></li>
<li <?php if ($menuItem === 'userGuide') echo 'class="active"';?>><a href="/pages/display/doc/general">User Guide</a></li>
<li <?php if ($menuItem === 'terms') echo 'class="active"';?>><a href="/users/terms">Terms &amp; Conditions</a></li>
<li <?php if ($menuItem === 'statistics') echo 'class="active"';?>><a href="/users/statistics">Statistics</a></li>
<li id='liuserGuide'><a href="/pages/display/doc/general">User Guide</a></li>
<li id='literms'><a href="/users/terms">Terms &amp; Conditions</a></li>
<li id='listatistics'><a href="/users/statistics">Statistics</a></li>
<?php
break;
@ -135,15 +135,15 @@
<li><?php echo $this->Form->postLink('Delete', array('action' => 'delete', $this->Form->value('Server.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Server.id'))); ?></li>
<li class="divider"></li>
<?php endif; ?>
<li <?php if ($menuItem === 'index') echo 'class="active"';?>><?php echo $this->Html->link('List Servers', array('controller' => 'servers', 'action' => 'index'));?></li>
<li <?php if ($menuItem === 'add') echo 'class="active"';?>><?php echo $this->Html->link(__('New Server'), array('controller' => 'servers', 'action' => 'add')); ?></li>
<li id='liindex'><?php echo $this->Html->link('List Servers', array('controller' => 'servers', 'action' => 'index'));?></li>
<li id='liadd'><?php echo $this->Html->link(__('New Server'), array('controller' => 'servers', 'action' => 'add')); ?></li>
<?php
break;
case 'admin':
if ($menuItem === 'editUser' || $menuItem === 'viewUser'): ?>
<li <?php if ($menuItem === 'viewUser') echo 'class="active"';?>><?php echo $this->Html->link('View User', array('controller' => 'users', 'action' => 'view', 'admin' => true, $id)); ?> </li>
<li <?php if ($menuItem === 'editUser') echo 'class="active"';?>><?php echo $this->Html->link('Edit User', array('controller' => 'users', 'action' => 'edit', 'admin' => true, $id)); ?> </li>
<li id='liviewUser'><?php echo $this->Html->link('View User', array('controller' => 'users', 'action' => 'view', 'admin' => true, $id)); ?> </li>
<li id='lieditUser'><?php echo $this->Html->link('Edit User', array('controller' => 'users', 'action' => 'edit', 'admin' => true, $id)); ?> </li>
<li><?php echo $this->Form->postLink('Delete User', array('admin' => true, 'action' => 'delete', $id), null, __('Are you sure you want to delete # %s?', $id));?></li>
<li class="divider"></li>
<?php endif;
@ -153,38 +153,38 @@
<li class="divider"></li>
<?php endif;
if ($isSiteAdmin): ?>
<li <?php if ($menuItem === 'addUser') echo 'class="active"';?>><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li <?php if ($menuItem === 'indexUser') echo 'class="active"';?>><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li <?php if ($menuItem === 'contact') echo 'class="active"';?>><?php echo $this->Html->link('Contact Users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<li id='liaddUser'><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
<li id='liindexUser'><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
<li id='licontact'><?php echo $this->Html->link('Contact Users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
<li class="divider"></li>
<li <?php if ($menuItem === 'addOrg') echo 'class="active"';?>><a href="/admin/organisations/add">New Organisation</a></li>
<?php if ($menuItem === 'editOrg'): ?>
<li class="active"><a href="/organisations/edit/<?php echo $orgId;?>">Edit Organisation</a></li>
<li id='liaddOrg'><a href="/admin/organisations/add">New Organisation</a></li>
<?php if ($menuItem === 'editOrg' || $menuItem === 'viewOrg'): ?>
<li id='lieditOrg'><a href="/admin/organisations/edit/<?php echo $id;?>">Edit Organisation</a></li>
<?php endif;?>
<?php if ($menuItem === 'viewOrg'): ?>
<li class="active"><a href="/organisations/view/<?php echo $orgId;?>">View Organisation</a></li>
<?php if ($menuItem === 'editOrg' || $menuItem === 'viewOrg'): ?>
<li id='liviewOrg'><a href="/organisations/view/<?php echo $id;?>">View Organisation</a></li>
<?php endif;?>
<li <?php if ($menuItem === 'indexOrg') echo 'class="active"';?>><a href="/organisations/index">List Organisations</a></li>
<li id='liindexOrg'><a href="/organisations/index">List Organisations</a></li>
<li class="divider"></li>
<li <?php if ($menuItem === 'addRole') echo 'class="active"';?>><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<li id='liaddRole'><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
<?php endif; ?>
<li <?php if ($menuItem === 'indexRole') echo 'class="active"';?>><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<li id='liindexRole'><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
<?php if ($isSiteAdmin): ?>
<li class="divider"></li>
<li <?php if ($menuItem === 'adminTools') echo 'class="active"';?>><a href="/pages/display/administration">Administrative Tools</a></li>
<li <?php if ($menuItem === 'serverSettings') echo 'class="active"';?>><a href="/servers/serverSettings">Server Settings</a></li>
<li id='liadminTools'><a href="/pages/display/administration">Administrative Tools</a></li>
<li id='liserverSettings'><a href="/servers/serverSettings">Server Settings</a></li>
<li class="divider"></li>
<?php if (Configure::read('MISP.background_jobs')): ?>
<li <?php if ($menuItem === 'jobs') echo 'class="active"';?>><a href="/jobs/index">Jobs</a></li>
<li id='lijobs'><a href="/jobs/index">Jobs</a></li>
<li class="divider"></li>
<li <?php if ($menuItem === 'tasks') echo 'class="active"';?>><a href="/tasks">Scheduled Tasks</a></li>
<li id='litasks'><a href="/tasks">Scheduled Tasks</a></li>
<?php endif;
endif;
break;
case 'logs': ?>
<li <?php if ($menuItem === 'index') echo 'class="active"';?>><?php echo $this->Html->link('List Logs', array('admin' => true, 'action' => 'index'));?></li>
<li <?php if ($menuItem === 'search') echo 'class="active"';?>><?php echo $this->Html->link('Search Logs', array('admin' => true, 'action' => 'search'));?></li>
<li id='liindex'><?php echo $this->Html->link('List Logs', array('admin' => true, 'action' => 'index'));?></li>
<li id='lisearch'><?php echo $this->Html->link('Search Logs', array('admin' => true, 'action' => 'search'));?></li>
<?php
break;
@ -192,8 +192,8 @@
if ($menuItem === 'add' || $menuItem === 'view') {
if (!(empty($thread_id) && empty($target_type))) { ?>
<li <?php if ($menuItem === 'view') echo 'class="active"';?>><?php echo $this->Html->link('View Thread', array('controller' => 'threads', 'action' => 'view', $thread_id));?></li>
<li <?php if ($menuItem === 'add') echo 'class="active"';?>><?php echo $this->Html->link('Add Post', array('controller' => 'posts', 'action' => 'add', 'thread', $thread_id));?></li>
<li id='view'><?php echo $this->Html->link('View Thread', array('controller' => 'threads', 'action' => 'view', $thread_id));?></li>
<li id='add'><?php echo $this->Html->link('Add Post', array('controller' => 'posts', 'action' => 'add', 'thread', $thread_id));?></li>
<li class="divider"></li>
<?php
}
@ -205,15 +205,15 @@
<?php
}
?>
<li <?php if ($menuItem === 'index') echo 'class="active"';?>><?php echo $this->Html->link('List Threads', array('controller' => 'threads', 'action' => 'index'));?></li>
<li <?php if ($menuItem === 'add' && !isset($thread_id)) echo 'class="active"';?>><a href = "<?php echo Configure::read('MISP.baseurl');?>/posts/add">New Thread</a></li>
<li id='liindex'><?php echo $this->Html->link('List Threads', array('controller' => 'threads', 'action' => 'index'));?></li>
<li id='liadd' && !isset($thread_id)) echo 'class="active"';?>><a href = "<?php echo Configure::read('MISP.baseurl');?>/posts/add">New Thread</a></li>
<?php
break;
case 'tags': ?>
<li <?php if ($menuItem === 'index') echo 'class="active"';?>><?php echo $this->Html->link('List Tags', array('action' => 'index'));?></li>
<li id='liindex'><?php echo $this->Html->link('List Tags', array('action' => 'index'));?></li>
<?php if ($isAclTagger): ?>
<li <?php if ($menuItem === 'add') echo 'class="active"';?>><?php echo $this->Html->link('Add Tag', array('action' => 'add'));?></li>
<li id='liadd'><?php echo $this->Html->link('Add Tag', array('action' => 'add'));?></li>
<?php
endif;
if ($menuItem === 'edit'):
@ -224,16 +224,16 @@
break;
case 'templates': ?>
<li <?php if ($menuItem === 'index') echo 'class="active"';?>><a href="/templates/index">List Templates</a></li>
<li id='liindex'><a href="/templates/index">List Templates</a></li>
<?php if ($isSiteAdmin || $isAclTemplate): ?>
<li <?php if ($menuItem === 'add') echo 'class="active"';?>><a href="/templates/add">Add Template</a></li>
<li id='liadd'><a href="/templates/add">Add Template</a></li>
<?php
endif;
if (($menuItem === 'view' || $menuItem === 'edit')):
?>
<li <?php if ($menuItem === 'view') echo 'class="active"';?>><a href="/templates/view/<?php echo $id; ?>">View Template</a></li>
<li id='liview'><a href="/templates/view/<?php echo $id; ?>">View Template</a></li>
<?php if ($mayModify): ?>
<li <?php if ($menuItem === 'edit') echo 'class="active"';?>><a href="/templates/edit/<?php echo $id; ?>">Edit Template</a></li>
<li id='liedit'><a href="/templates/edit/<?php echo $id; ?>">Edit Template</a></li>
<?php
endif;
endif;
@ -242,3 +242,8 @@
?>
</ul>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#li<?php echo h($menuItem); ?>').addClass("active");
});
</script>

View File

@ -25,7 +25,9 @@ echo $this->Paginator->next(__('next') . ' &raquo;', array('tag' => 'li', 'escap
<th><?php echo $this->Paginator->sort('id');?></th>
<th>Logo</th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th><?php echo $this->Paginator->sort('uuid');?></th>
<?php if ($isSiteAdmin): ?>
<th><?php echo $this->Paginator->sort('uuid');?></th>
<?php endif; ?>
<th><?php echo $this->Paginator->sort('description');?></th>
<th><?php echo $this->Paginator->sort('nationality');?></th>
<th><?php echo $this->Paginator->sort('sector');?></th>
@ -39,8 +41,8 @@ echo $this->Paginator->next(__('next') . ' &raquo;', array('tag' => 'li', 'escap
<?php
foreach ($orgs as $org): ?>
<tr>
<td class="short"><?php echo h($org['Organisation']['id']); ?></td>
<td class="short">
<td class="short" ondblclick="document.location.href ='/organisations/view/<?php echo $org['Organisation']['id'];?>'"><?php echo h($org['Organisation']['id']); ?></td>
<td class="short" ondblclick="document.location.href ='/organisations/view/<?php echo $org['Organisation']['id'];?>'">
<?php
$imgRelativePath = 'orgs' . DS . h($org['Organisation']['name']) . '.png';
$imgAbsolutePath = APP . WEBROOT_DIR . DS . 'img' . DS . $imgRelativePath;
@ -48,15 +50,15 @@ foreach ($orgs as $org): ?>
else echo $this->Html->tag('span', h($org['Organisation']['name']), array('class' => 'welcome', 'style' => 'float:left;'));
?>
</td>
<td class="short"><?php echo h($org['Organisation']['name']); ?></td>
<td class="short"><?php echo h($org['Organisation']['uuid']); ?></td>
<td class="short" ondblclick="document.location.href ='/organisations/view/<?php echo $org['Organisation']['id'];?>'"><?php echo h($org['Organisation']['name']); ?></td>
<td class="short" ondblclick="document.location.href ='/organisations/view/<?php echo $org['Organisation']['id'];?>'"><?php echo h($org['Organisation']['uuid']); ?></td>
<td><?php echo h($org['Organisation']['description']); ?></td>
<td class="short"><?php echo h($org['Organisation']['nationality']); ?></td>
<td class="short"><?php echo h($org['Organisation']['sector']); ?></td>
<td class="short"><?php echo h($org['Organisation']['type']); ?></td>
<td class="short" ondblclick="document.location.href ='/organisations/view/<?php echo $org['Organisation']['id'];?>'"><?php echo h($org['Organisation']['nationality']); ?></td>
<td class="short" ondblclick="document.location.href ='/organisations/view/<?php echo $org['Organisation']['id'];?>'"><?php echo h($org['Organisation']['sector']); ?></td>
<td class="short" ondblclick="document.location.href ='/organisations/view/<?php echo $org['Organisation']['id'];?>'"><?php echo h($org['Organisation']['type']); ?></td>
<td><?php echo h($org['Organisation']['contacts']); ?></td>
<?php if ($isSiteAdmin): ?>
<td class="short"><?php echo h($org_creator_ids[$org['Organisation']['created_by']]); ?></td>
<td class="short" ondblclick="document.location.href ='/organisations/view/<?php echo $org['Organisation']['id'];?>'"><?php echo h($org_creator_ids[$org['Organisation']['created_by']]); ?></td>
<?php endif; ?>
<td class="short action-links">
<?php if ($isSiteAdmin): ?>

View File

@ -60,7 +60,7 @@
<div id="ajaxContent" style="width:100%;"></div>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'viewOrganisation'));
echo $this->element('side_menu', array('menuList' => 'admin', 'menuItem' => 'viewOrg'));
?>
<script type="text/javascript">
$(document).ready(function () {

View File

@ -7,14 +7,75 @@
<?php
foreach ($fields as $f):
?>
<dt><?php echo ucfirst($f); ?></dt>
<dd><?php echo h($sg['SharingGroup'][$f]); ?></dd>
<dt><?php
if ($f != 'active') echo ucfirst($f);
else echo 'Selectable';
?></dt>
<dd>
<?php
if ($f !== 'active') echo h($sg['SharingGroup'][$f]);
else echo '<span class="' . ($sg['SharingGroup'][$f] ? 'icon-ok' : 'icon-remove') . '"></span>';
?>&nbsp;
</dd>
<?php
endforeach;
?>
<dt>Created by</dt>
<dd><a href="/organisation/view/<?php echo $sg['Organisation']['id']; ?>"><?php echo h($sg['Organisation']['name']); ?></a></dd>
</dl>
</dl><br />
<div class="row" style="width:100%;">
<?php
if (isset($sg['SharingGroupOrg'])):
?>
<div class="span6">
<b>Organisations</b>
<table class="table table-striped table-hover table-condensed">
<tr>
<th>Name</th>
<th>Local</th>
<th>Extend</th>
</tr>
<?php
foreach ($sg['SharingGroupOrg'] as $sgo):
?>
<tr>
<td><a href="/organisations/view/<?php echo h($sgo['Organisation']['id']); ?>"><?php echo h($sgo['Organisation']['name']); ?></a></td>
<td><span class="<?php echo ($sgo['Organisation']['local'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
<td><span class="<?php echo ($sgo['extend'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
</tr>
<?php
endforeach;
?>
</table>
</div>
<?php
endif;
if (isset($sg['SharingGroupServer'])):
?>
<div class="span6">
<b>Instances</b>
<table class="table table-striped table-hover table-condensed">
<tr>
<th>Name</th>
<th>Url</th>
<th>All orgs</th>
</tr>
<?php
foreach ($sg['SharingGroupServer'] as $sgs): ?>
<tr>
<td><?php echo h($sgs['Server']['name']); ?></td>
<td><?php echo h($sgs['Server']['url']); ?></td>
<td><span class="<?php echo ($sgs['all_orgs'] ? 'icon-ok' : 'icon-remove'); ?>"></span></td>
</tr>
<?php
endforeach;
?>
</table>
</div>
<?php
endif;
?>
</div>
</div>
<?php
echo $this->element('side_menu', array('menuList' => 'globalActions', 'menuItem' => 'viewSG'));