Диплом: Автоматизация приема заявок на ремонт и модернизацию ПК в АО "Старт"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
106
/**
* @throws NotFoundHttpException
* @Config\Route("/login-check", name =
"site_security_login_check")
*/
public function loginCheckAction()
{
throw $this->createNotFoundException();
}
/**
* @throws NotFoundHttpException
* @Config\Route("/logout", name = "site_security_logout")
*/
public function logoutAction()
{
throw $this->createNotFoundException();
}
/**
* @return RedirectResponse|Response
* @Config\Route("/profile", name =
"site_security_profile")
*/
public function profileAction()
{
$form = $this->createForm(new ProfileFormType(), $this-
>user);
$form->handleRequest($this->request);
if ($form->isSubmitted() && $form->isValid()) {
if (!is_null($form->get('password')->getData())) {
/** @var UserPasswordEncoder $encoder */
$encoder = $this-
>get('security.password_encoder');
$this->user->setSalt(User::generateSalt())
->setPassword($encoder-
>encodePassword($this->user, $this->user->getPassword()));
$this->manager->persist($this->user);
$this->manager->flush();
}
$this->addNotice('success',
'security_profile.html.twig',
array('notice' => 'user_changed')
);
return $this->redirectToRoute('homepage');
}
$this->forms['profile'] = $form->createView();
$this->navigation = array('active' => 'homepage');
return $this-
>render('AppBundle:Security:profile.html.twig');
}
}
107
<!DOCTYPE html>
<html>
<head>
<title>{% block head_title %}Главная{% endblock %} |
Технический отдел </title>
{% block head_meta %}
<meta http-equiv="content-type" content="text/html;
charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,
initial-scale=1">
{% endblock %}
{% block head_link %}
<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 %}
108
<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="">
<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>
<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">
109
<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>
{% 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>
110
{% 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">
<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>
111
</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">
{{ 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')) %}
112
<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>
<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'}}) }}
113
<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>
{% 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>
<thead>
<tr>
<th>№</th>
<th>Дата создания</th>
<th>Тип неисправности</th>
<th>Статус</th>
<th>Сотрудник</th>
</tr>
</thead>
114
<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>
</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;
115
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;
$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 {

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

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