Диплом: Автоматизация учета и обработки заявок пользователей на ТО и ремонт оргтехники (Help Desk) в ГБОУ Школа № 937

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
107
<link rel="shortcut icon" type="image/x-icon" href="{{
asset('favicon.ico') }}" />
<link rel="stylesheet" type="text/css" href="{{
asset('css/bootstrap.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{
asset('css/gentelella.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{
asset('css/admin.css') }}" />
<link rel="stylesheet" type="text/css" href="{{
asset('css/bootstrap-datepicker.min.css') }}" />
{% endblock %}
{% block head_script %}
<script type="text/javascript" src="{{ asset('js/jquery-
2.1.1.min.js') }}"></script>
<script type="text/javascript" src="{{
asset('js/bootstrap.min.js') }}"></script>
<script type="text/javascript" src="{{
asset('js/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript" src="{{
asset('js/bootstrap-datepicker.ru.min.js') }}"></script>
{% endblock %}
<style>{% block head_style %}{% endblock %}</style>
{% block head_additions %}{% endblock %}
</head>
<body>
<div class="container body">
<div class="main_container">
<div class="col-sm-3 col-md-3 col-xs-12 col-lg-2 left_col"
style="top:0">{% include 'AppBundle::sidebar.html.twig' %}</div>
<div class="col-sm-9 col-md-9 col-xs-12 col-lg-9
right_col" style="min-height: 1100px;">{% block body_content %}{%
endblock %}</div>
</div>
</div>
<div class="notices" style="right:175px;">{% include
'AppBundle::notices.html.twig' %}</div>
{% block body_additions %}{% endblock %}
<script>
function switchpanel(){
$('.left_col').fideLeft(250);
$('.left_col').fideRight(250);
}
</script>
</body>
</html>
<div class="left_col scroll-view" >
{% if not app.user %}
<div id="sidebar-menu" class="main_menu_side hidden-print
main_menu">
<div class="menu_section">
<h3>Управление</h3>
<ul class="nav side-menu" style="">
108
<li {% if navigation.active == 'login' %}
class="current-page"{% endif %}>
<a href="{{ url('site_security_login') }}"
target="_top">Авторизация</a>
</li>
</ul>
</div>
</div>
{% else %}
<div class="profile">
<div class="profile_pic">
<a href="{{ url('site_security_profile') }}"
target="_top">
{% if
is_granted(constant('AppBundle\\Entity\\Role::ADMIN')) %}
<img src="{{ asset('images/admin.jpg') }}"
alt="" class="img-circle profile_img">
{% else %}
<img src="{{ asset('images/user.png') }}"
alt="" class="img-circle profile_img">
{% endif %}
</a>
<div id="ctl00_AuthPanel" class="profile_info">
<span>Добро пожаловать,</span>
<h2><a href="{{ url('site_security_profile') }}"
target="_top">{{ app.user.userfio|e }}</a></h2>
<a href="{{ url('site_security_logout') }}"
target="_top" class="logout" >выход</a>
</div>
</div>
<div class="clearfix">
</div>
<div id="sidebar-menu" class="main_menu_side hidden-print
main_menu">
<div class="menu_section">
<h3>Управление заявками</h3>
<ul class="nav side-menu" style="">
<li {% if navigation.active == 'tickets' %}
class="current-page"{% endif %}>
<a href="{{ url('site_tickets_index') }}"
target="_top"><span class="glyphicon glyphicon-new-window" aria-
hidden="true"></span> Список заявок</a>
</li>
{% if
is_granted(constant('AppBundle\\Entity\\Role::TEHNIC')) %}
<li {% if navigation.active == 'reports' %}
class="current-page"{% endif %}>
<a href="{{ url('reports') }}"
target="_top"><span class="glyphicon glyphicon-glass" aria-
hidden="true"></span> Отчет</a>
</li>
109
{% endif %}
</ul>
{% if
is_granted(constant('AppBundle\\Entity\\Role::ADMIN')) %}
<h3>Администрирование</h3>
<ul class="nav side-menu" >
<li{% if navigation.active == 'users' %}
class="current-page"{% endif %}>
<a href="{{ url('site_users_index')
}}"><span class="glyphicon glyphicon-user" aria-
hidden="true"></span> Пользователи</a></li>
<li{% if navigation.active == 'statuses' %}
class="current-page"{% endif %}>
<a href="{{ url('site_statuses_index')
}}"><span class="glyphicon glyphicon-star" aria-
hidden="true"></span> Статусы заявок</a>
</li>
<li {% if navigation.active == 'departments'
%} class="current-page"{% endif %}>
<a href="{{ url('site_departments_index')
}}" target="_top"><span class="glyphicon glyphicon-globe" aria-
hidden="true"></span> Отделения</a>
</li>
<li {% if navigation.active == 'typetickets'
%} class="current-page"{% endif %}>
<a href="{{ url('site_typetickets_index')
}}" target="_top"><span class="glyphicon glyphicon-plus" aria-
hidden="true"></span> Типы неисправностей</a>
</li>
</ul>
{% endif %}
</div>
</div>
{% endif %}
</div>
{% extends 'AppBundle::layout.html.twig' %}
{% block head_title %}Заявка № {{ view.ticket.id|e }}{% endblock
%}
{% block head_additions %}
<style>
.roles { border: 1px solid #eee; border-radius: 4px;
padding: 0 5px; }
.page {max-width: 700px;}
</style>
{% endblock %}
{% block body_content %}
<div class="container-fluid">
<div class="page-header"><h1>Заявка № {{ view.ticket.id|e
}}</h1></div>
<div class="row">
<div class="col-lg-6">
110
<p><strong>Дата и время подачи заявки:</strong>{{
view.ticket.createdat|date("d-m-Y h:m:s") }}</p>
<p><strong>Коментарий:</strong>{{
view.ticket.description|e }}</p>
<p><strong>Статус:</strong>{{
view.ticket.status.caption|e }}</p>
{% if view.ticket.status.id>1 %}
<p><strong>Техник:</strong>{{
view.ticket.user.userdio|e }}</p>
{% endif %}
</div>
</div>

2>Комментарии к заявке</h2>
<div class="row chat">
<div class="col-lg-12 messages">
{% for comment in view.ticket.comments %}
<div class="{% if comment.author == app.user
%}mymessage{% else %}message{% endif %}">
<p><span class="glyphicon glyphicon-user"
aria-hidden="true"></span><b>{{ comment.author.userfio|e }}</b>
({{ comment.createdat|date('d-m-Y h:m:s') }}):</p>
<p class="messagetext" style="padding-
left:20px;">
{% if comment.text is not empty %}<span
class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
{{ comment.text|e }} {% endif %}
{% if comment.image is not empty %}<span
class="glyphicon glyphicon-file" aria-hidden="true"></span>
Приложен файл <a href="/tickets/{{ comment.image|e
}}">Скачать</a>{% endif %}
</p>
</div>
{% else %}
Нет ни одного комментария
{% endfor %}
</div>
<hr>
<div class="col-lg-12">
<h3>Оставить комментарий</h3>
{% set form = forms.comment %}
{{ form_start(form, {'attr': {'class': 'form',
'style':'overflow:none;'}}) }}
<div class="form-group-lg">
<table class="table table-striped">
<tr>
<td>
{{ form_widget(form.text,
{'attr': {'class': 'form-control'}}) }}
</td>
<td width="200px">
111
{{ form_widget(form.file,
{'attr': {'class': 'form-control'}}) }}
</td>
<td width="200px">
<button type="submit" class="btn
btn-success" style="min-width: 170px;">
<span class="glyphicon
glyphicon-check" aria-hidden="true"></span> Отправить комментарий
</button>
</td>
</tr>
</table>
</div>
</div>
{{ form_end(form) }}
</div>
<hr>
<div class="row">
<a href="{{ url('site_tickets_index') }}" class="btn
btn-default">
<span class="glyphicon glyphicon-backward" aria-
hidden="true"></span> Назад
</a>
<a href="{{ url('site_tickets_change',
{'ticket':view.ticket.id, 'status':4}) }}" class="btn btn-
danger">
<span class="glyphicon glyphicon-stop" aria-
hidden="true"></span> Закрыть заявку
</a>
{% if
is_granted(constant('AppBundle\\Entity\\Role::TEHNIC')) %}
<a href="{{ url('site_tickets_change',
{'ticket':view.ticket.id, 'status':4}) }}" class="btn btn-info">
<span class="glyphicon glyphicon-arrow-up"
aria-hidden="true"></span> На модернизацию
</a>
{% endif %}
</div>
</div>
{% endblock %}
{% extends 'AppBundle::layout.html.twig' %}
{% block head_title %}Заявки{% endblock %}
{% block head_additions %}
<style>
.td-actions { width: 60px; }
.actions { display: none; }
</style>
{% endblock %}
{% block body_content %}
<div class="page">
<div class="page-header"><h1>Заявки</h1></div>
112
<div>
{% if not (
is_granted(constant('AppBundle\\Entity\\Role::ADMIN'))
and
is_granted(constant('AppBundle\\Entity\\Role::TEHNIC'))
and
is_granted(constant('AppBundle\\Entity\\Role::PROGER'))) %}
<a href="{{ url('site_tickets_add') }}" class="btn
btn-success" title="Добавить нвую заявку">
<span class="glyphicon glyphicon-plus" aria-
hidden="true"></span>
</a>
{% endif %}
<a href="javascript:void(0);" class="btn btn-info"
title="Открыть поиск" onclick="swithfilter();">
<span class="glyphicon glyphicon-search" aria-
hidden="true"></span>
</a>
<a href="javascript:window.location.reload();"
class="btn btn-default" title="Обновить">
<span class="glyphicon glyphicon-refresh" aria-
hidden="true"></span>
</a>
</div>
{% set form = view.form %}
<div id="formfilter" {% if app.request.get('form_filter')
is empty %}style="display: none;" {% endif %}>
{{ form_start(form, {'attr': {'class': 'form-full'}}) }}
<table class="table table-striped">
<tr>
<td>
{{ form_label(form.id, null, {'label_attr':
{'class': 'control-label'}}) }}
{{ form_widget(form.id, {'attr': {'class':
'form-control', 'autofocus': true}}) }}
</td>
<td>
{{ form_label(form.status, null,
{'label_attr': {'class': 'control-label'}}) }}
{{ form_widget(form.status, {'attr':
{'class': 'form-control', 'autofocus': true}}) }}
</td>
{% if
is_granted(constant('AppBundle\\Entity\\Role::TEHNIC'))
and
is_granted(constant('AppBundle\\Entity\\Role::PROGER')) %}
<td>
{{ form_label(form.my, null, {'label_attr':
{'class': 'control-label'}}) }}
{{ form_widget(form.my, {'attr': {'class':
'form-control', 'autofocus': true}}) }}
</td>
113
{% endif %}
<td width="200px">
<button type="submit" class="btn btn-success"
style="min-width: 170px;">
<span class="glyphicon glyphicon-search"
aria-hidden="true"></span> Поиск
</button>
<a href="{{ url('site_tickets_index') }}"
class="btn btn-default" style="margin-top:5px;width: 170px;">
<span class="glyphicon glyphicon-remove"
aria-hidden="true"></span> Сбросить
</a>
</td>
</tr>
</table>
{{ form_end(form) }}
</div>
<table class="table table-striped">
<thead>
<tr>
<th>№</th>
<th>Дата создания</th>
<th>Тип неисправности</th>
<th>Статус</th>
<th>Сотрудник</th>
</tr>
</thead>
<tbody>
{% for ticket in view.tickets %}
<tr>
<td><a class="btn btn-warning" href="{{
url('site_tickets_edit', {'ticket': ticket.id}) }}">
<span class="glyphicon glyphicon-
pencil" title="Редактировать №{{ ticket.id|e }}" aria-
hidden="true"></span>
</a>
{{ ticket.id|e }}</td>
<td>
{{ ticket.createdat|date("d-m-Y h:m:s")
}}
</td>
<td>
{{ ticket.type.caption|e }}
</td>
<td>
{{ ticket.status.caption|e }}
</td>
<td>
{% if ticket.user is not empty %}
{{ ticket.user.userfio|e }}
{% endif %}
</td>
114
</tr>
{% else %}
<tr>
<td colspan="5">Заявок нет</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
{% block body_additions %}
<script>
function swithfilter(){
if ( $('#formfilter').attr('style')=='display:
none;') {
$('#formfilter').slideDown(250);
}
else {
$('#formfilter').slideUp(250);
}
}
</script>
{% endblock %}
<?php
namespace AppBundle\Controller;
use AppBundle\Entity\Comment;
use AppBundle\Entity\Ticket;
use AppBundle\Entity\TicketStatus;
use AppBundle\Form\Type\MyTicketFilterFormType;
use AppBundle\Entity\Role;
use AppBundle\Form\Type\TicketCommentFormType;
use AppBundle\Form\Type\TicketFilterFormType;
use AppBundle\Form\Type\TicketFormType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration as Config;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
class TicketController extends InitializableController
{
/**
* @return RedirectResponse|Response
* @Config\Route("/ticketes", name = "site_tickets_index")
*/
public function indexAction()
{
if (($this->authChecker->isGranted(Role::TEHNIC)) ||
($this->authChecker->isGranted(Role::PROGER))) {
$form=$this->createForm(new
MyTicketFilterFormType());
$id = null;
$status=null;
$my = null;
115
$form->handleRequest($this->request);
$tickets = $this->getRepository('Ticket')-
>createQueryBuilder('t')
->leftJoin('t.status', 's')
->leftJoin('t.user', 'u')
->where('1=1');
if ($form->isSubmitted() && $form->isValid()) {
$id = $form->get('id')->getData();
$status = $form->get('status')->getData();
$my = $form->get('my')->getData();
}
if (!empty($id)) {
$tickets->andWhere('t.id = :id ')-
>setParameter('id', $id);
}
if (!empty($status)) {
$tickets->andWhere('s.id = :status ')-
>setParameter('status', $status);
}
if (!empty($my)) {
$tickets->andWhere('u.id = :user ')-
>setParameter('user', $this->user->getId());
}
}
else {
$form=$this->createForm(new TicketFilterFormType());
$id = null;
$status=null;
$form->handleRequest($this->request);
$tickets = $this->getRepository('Ticket')-
>createQueryBuilder('t')
->leftJoin('t.status', 's')
->leftJoin('t.author', 'u')
->where('1=1');
if ($form->isSubmitted() && $form->isValid()) {
$id = $form->get('id')->getData();
$status = $form->get('status')->getData();
}
if (!empty($id)) {
$tickets->andWhere('t.id = :id ')-
>setParameter('id', $id);
}
if (!empty($status)) {
$tickets->andWhere('s.id = :status ')-
>setParameter('status', $status);
}
$tickets->andWhere('u.id = :user ')-
>setParameter('user', $this->user->getId());
}
$tickets=$tickets->getQuery()->getResult();
$this->view['tickets'] = $tickets;
$this->view['form'] = $form->createView();
116
$this->navigation = array('active' => 'tickets');
return $this-
>render('AppBundle:Tickets:index.html.twig');
}
/**
* @return RedirectResponse|Response
* @Config\Route("/tickets/add", name = "site_tickets_add")
*/
public function addAction()
{
$ticket = new Ticket();
$form = $this->createForm(new TicketFormType(), $ticket);
$form->handleRequest($this->request);
if ($form->isSubmitted() && $form->isValid()) {
$ticket->setAuthor($this->user);
/* @var TicketStatus $status*/
$status=$this->getRepository('TicketStatus')-
>findOneBy(array('id'=>1));
$ticket->setStatus($status);
$this->manager->persist($ticket);
$this->manager->flush();
$this->addNotice('success',
'tickets.html.twig',
array('notice' => 'added', 'id' => $ticket-
>getId())
);
return $this-
>redirectToRoute('site_tickets_index');
}
$this->forms['ticket'] = $form->createView();
$this->navigation = array('active' => 'tickets');
$this->view['ticket']=null;
return $this->render('AppBundle:Tickets:add.html.twig');
}
/**
* @param Ticket $ticket
* @return RedirectResponse|Response
* @Config\Route("/tickets/{ticket}/edit", name =
"site_tickets_edit")
* @Config\ParamConverter("ticket", options = {"mapping":
{"ticket": "id"}})
*/
public function editAction(Ticket $ticket)
{
$comment= new Comment();
$form = $this->createForm(new TicketCommentFormType(),
$comment);
$form->handleRequest($this->request);
if ($form->isSubmitted() && $form->isValid()) {
$comment->setTicket($ticket);
$comment->setAuthor($this->user);

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)