Skip to content

Commit

Permalink
changed logistics index to transport
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrodevog committed Oct 19, 2023
1 parent 644888d commit a781334
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 118 deletions.
59 changes: 0 additions & 59 deletions module/CommonBundle/Resources/views/common/admin/role/manage.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@
</div>
</div>

<div class="flashmessage success_message full_width members_removed_success hide">
<div class="title">Success</div>
<div class="content">
<p>The members were successfully removed!</p>
</div>
</div>
<div class="flashmessage error_message full_width members_removed_error hide">
<div class="title">Error</div>
<div class="content">
<p>An error occurred while trying to delete the members.</p>
</div>
</div>

<div id="controller_action">
<table class="manage">
<thead>
Expand Down Expand Up @@ -126,31 +113,12 @@
</div>
</aside>
{% endif %}

{% if hasAccess('common_admin_role', 'deleteAllMembers') %}
<aside>
<div class="sidebox">
<div class="title">Delete Members</div>
<div class="content">
<p>
<i>Please hit the link below to delete all members from the roles linked to units!</i>
</p>
<p>
<a href="#" class="delete-members">
&rarr; Delete Members
</a>
</p>
</div>
</div>
</aside>
{% endif %}
{% endblock %}

{% block content_script %}
<script type="text/javascript">
$(document).ready(function () {
$('.item .delete').click(openModal);
$('.delete-members').click(openDeleteMembersModal);
});
function openModal(e) {
Expand All @@ -177,37 +145,10 @@
removeRole.modal();
}
function openDeleteMembersModal(e) {
var $this = $(this);
e.preventDefault();
var removeMembers = $('#removeMembers');
removeMembers.find('.cancel').one('click', function () {
removeMembers.modal('hide');
});
removeMembers.find('.delete').unbind('click').click(function () {
$.post('{{ url('common_admin_role', {"action": "deleteAllMembers"})}}', function (data) {
if (data && 'success' == data.status) {
$('.flashmessage').addClass('hide');
$('.members_removed_success').removeClass('hide');
removeMembers.modal('hide');
} else {
errorRemoveMembers();
}
}, 'json').error(errorRemoveMembers);
});
removeMembers.modal();
}
function errorRemove() {
$('.flashmessage').addClass('hide');
$('.role_removed_error').removeClass('hide');
$('#removeRole').modal('hide');
}
function errorRemoveMembers() {
$('.flashmessage').addClass('hide');
$('.members_removed_error').removeClass('hide');
$('#removeMembers').modal('hide');
}
</script>
{% endblock %}
56 changes: 30 additions & 26 deletions module/CommonBundle/Resources/views/common/admin/role/members.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,41 @@
<h1>Role</h1>
<p>Name: <b>{{ role.getName() }}</b></p>

<h1>Direct members</h1>
{% if members %}
<h1>Direct members</h1>

<table class="full_width manage">
<tr>
<th>Name</th>
<th style="width: 90px">Actions</th>
</tr>
{% for member in members %}
<tr class="item item-{{ member.getId() }}">
<td>{{ member.getFullName() }}</td>
<td>
{% if hasAccess('common_admin_role', 'deleteMember') %}
<a href="#" data-id="{{ member.getId() }}" data-name="{{ member.getFullName() }}" class="delete">Delete</a>
{% endif %}
</td>
<table class="full_width manage">
<tr>
<th>Name</th>
<th style="width: 90px">Actions</th>
</tr>
{% endfor %}
</table>
{% for member in members %}
<tr class="item item-{{ member.getId() }}">
<td>{{ member.getFullName() }}</td>
<td>
{% if hasAccess('common_admin_role', 'deleteMember') %}
<a href="#" data-id="{{ member.getId() }}" data-name="{{ member.getFullName() }}" class="delete">Delete</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endif %}

<h1>Unit members</h1>
{% if unitMembers %}
<h1>Unit members</h1>

<table class="full_width manage">
<tr>
<th>Name</th>
</tr>
{% for member in unitMembers %}
<tr class="item item-{{ member.getId() }}">
<td>{{ member.getFullName() }}</td>
<table class="full_width manage">
<tr>
<th>Name</th>
</tr>
{% endfor %}
</table>
{% for member in unitMembers %}
<tr class="item item-{{ member.getId() }}">
<td>{{ member.getFullName() }}</td>
</tr>
{% endfor %}
</table>
{% endif %}
</div>

<div class="modal fade" id="removeMember" tabindex="-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function getAuthenticationHandler()
'action' => 'index',
'controller' => 'common_index',

'auth_route' => 'logistics_index',
'redirect_route' => 'logistics_index',
'auth_route' => 'logistics_catalog',
'redirect_route' => 'logistics_catalog',
);
}

Expand Down
4 changes: 2 additions & 2 deletions module/LogisticsBundle/Controller/LeaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private function getPersonEntity()
'No person was authenticated!'
);

$this->redirect()->toRoute('logistics_index');
$this->redirect()->toRoute('logistics_catalog');

return;
}
Expand Down Expand Up @@ -290,4 +290,4 @@ private function getItemEntity($id = null)

return $item;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* @author Niels Avonds <[email protected]>
*/
class IndexController extends \LogisticsBundle\Component\Controller\LogisticsController
class TransportController extends \LogisticsBundle\Component\Controller\LogisticsController
{
public function indexAction()
{
Expand Down
2 changes: 1 addition & 1 deletion module/LogisticsBundle/Resources/config/assetic.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
'@common_jqueryui_css',
'@common_jqueryui_datepicker_css',
),
'logistics_index' => array(
'logistics_transport' => array(
'@common_jquery',
'@common_jqueryui',
'@common_remote_typeahead',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'logistics_admin_inventory' => array(
'add', 'manage',
),
'logistics_index' => array(
'logistics_transport' => array(
'add', 'delete', 'edit', 'export', 'fetch', 'index', 'move',
),
'logistics_lease' => array(
Expand All @@ -45,4 +45,4 @@
'index', 'add', 'edit', 'reserve',
)
),
);
);
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'parents' => array(
),
'actions' => array(
'logistics_index' => array(
'logistics_transport' => array(
'fetch', 'index',
),
'logistics_auth' => array(
Expand Down
14 changes: 7 additions & 7 deletions module/LogisticsBundle/Resources/config/router.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,18 @@
),
),
),
'logistics_index' => array(
'logistics_transport' => array(
'type' => 'Laminas\Router\Http\Segment',
'options' => array(
'route' => '[/:language]/logistics[/:action][/date/:date][/:id][/]',
'route' => '[/:language]/logistics/transport[/:action][/date/:date][/:id][/]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'language' => '(en|nl)',
'date' => '[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}',
'id' => '[0-9]*',
),
'defaults' => array(
'controller' => 'logistics_index',
'controller' => 'logistics_transport',
'action' => 'index',
),
),
Expand Down Expand Up @@ -180,7 +180,7 @@
'token' => '[a-zA-Z0-9_-]*',
),
'defaults' => array(
'controller' => 'logistics_index',
'controller' => 'logistics_transport',
'action' => 'export',
),
),
Expand All @@ -194,7 +194,7 @@
'end' => '[0-9]*',
),
'defaults' => array(
'controller' => 'logistics_index',
'controller' => 'logistics_transport',
'action' => 'fetch',
),
),
Expand Down Expand Up @@ -251,7 +251,7 @@
'logistics_catalog_typeahead' => array(
'type' => 'Laminas\Router\Http\Segment',
'options' => array(
'route' => '[/:language]/logistics/catalog[/:order]/typeahead[/:string][/]',
'route' => '[/:language]/logistics[/:order]/typeahead[/:string][/]',
'constraints' => array(
'order' => '[0-9]*',
'language' => '(en|nl)',
Expand Down Expand Up @@ -291,7 +291,7 @@
'logistics_admin_lease' => 'LogisticsBundle\Controller\Admin\LeaseController',
'logistics_admin_inventory' => 'LogisticsBundle\Controller\Admin\InventoryController',

'logistics_index' => 'LogisticsBundle\Controller\IndexController',
'logistics_transport' => 'LogisticsBundle\Controller\TransportController',
'logistics_auth' => 'LogisticsBundle\Controller\AuthController',
'logistics_piano' => 'LogisticsBundle\Controller\PianoController',
'logistics_lease' => 'LogisticsBundle\Controller\LeaseController',
Expand Down
12 changes: 3 additions & 9 deletions module/LogisticsBundle/Resources/layouts/logistics/base.twig
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<a href="{{ url('logistics_inventory', {"language": language.getAbbrev()}) }}">{{ translate('Flesserke') }}</a>
</li>
{% endif %}
{% if hasAccess('logistics_index', 'index') %}
<li {% if 'logistics_index' == getParam('controller') %} class="active" {% endif %}>
<a href="{{ url("logistics_index", {"language": language.getAbbrev()}) }}">{{ translate('Transport') }}</a>
{% if hasAccess('logistics_transport', 'index') %}
<li {% if 'logistics_transport' == getParam('controller') %} class="active" {% endif %}>
<a href="{{ url("logistics_transport", {"language": language.getAbbrev()}) }}">{{ translate('Transport') }}</a>
</li>
{% endif %}
{% if hasAccess('logistics_piano', 'index') %}
Expand All @@ -46,12 +46,6 @@
{# <li {% if 'logistics_lease' == getParam('controller') %}class="active"{% endif %}>#}
{# <a href="{{ url('logistics_lease', {"language": language.getAbbrev()}) }}">{{ translate('Lease') }}</a>#}
{# </li>#}
{# {% endif %}#}

{# {% if hasAccess('logistics_inventory', 'add') %}#}
{# <li {% if 'logistics_inventory' == getParam('controller') %}class="active"{% endif %}>#}
{# <a href="{{ url('logistics_inventory', {"language": language.getAbbrev(), 'action': 'add'}) }}">{{ translate('Flesserke Form') }}</a>#}
{# </li>#}
{# {% endif %}#}
</ul>
<ul class="nav navbar-nav pull-right lang-nav hidden-sm hidden-xs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

<div>{{ translate('Please login to view car rides.') }}</div>
{% else %}
{% if hasAccess('logistics_index', 'export') %}
{% if hasAccess('logistics_transport', 'export') %}
<div class="pull-right" style="line-height: 50px">
<div class="btn-group">
<a class="btn btn-default" href="{{ url('logistics_export') }}"><span class="glyphicon glyphicon-arrow-down"></span> {{ translate('Download') }}</a>
Expand All @@ -76,7 +76,7 @@

<div id="calendar"></div>

{% if hasAccess('logistics_index', 'add') %}
{% if hasAccess('logistics_transport', 'add') %}
<div id="reservationForm" class="hide">
{% import 'site/partials/form.twig' as forms %}
{{ forms.renderForm(form) }}
Expand All @@ -94,13 +94,13 @@
$('#calendar').logisticsCalendar({
fetchUrl: '{{ url('logistics_reservation_fetch') }}',
moveUrl: '{{ url('logistics_index', {'action': 'move'}) }}',
addUrl: '{{ url('logistics_index', {'action': 'add'}) }}',
editUrl: '{{ url('logistics_index', {'action': 'edit'}) }}',
deleteUrl: '{{ url('logistics_index', {'action': 'delete'}) }}',
moveUrl: '{{ url('logistics_transport', {'action': 'move'}) }}',
addUrl: '{{ url('logistics_transport', {'action': 'add'}) }}',
editUrl: '{{ url('logistics_transport', {'action': 'edit'}) }}',
deleteUrl: '{{ url('logistics_transport', {'action': 'delete'}) }}',
passengerTypeaheadUrl: '{{ url("common_admin_academic_typeahead", {}) }}',
editable: {% if hasAccess('logistics_index', 'add') %}true{% else %}false {% endif %},
deletable: {% if hasAccess('logistics_index', 'delete') %}true{% else %}false {% endif %},
editable: {% if hasAccess('logistics_transport', 'add') %}true{% else %}false {% endif %},
deletable: {% if hasAccess('logistics_transport', 'delete') %}true{% else %}false {% endif %},
form: $('#reservationForm'),
monthNames: [
'{{ translate('January') }}',
Expand Down

0 comments on commit a781334

Please sign in to comment.