Created
March 15, 2017 13:37
-
-
Save ianrodrigues/450486e5718d27af3232e89863261cec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.master') | |
@section('content') | |
<nav class="navbar navbar-default" role="navigation"> | |
<div class="navbar-header"> | |
<a class="navbar-brand" href="{{ url('job') }}" id="btn-list">{{ Lang::get('job.jobs') }} <span class="badge"></span></a> | |
</div> | |
<span class="label label-primary pull-right" style="margin:15px 15px 0px 0px; padding:5px 10px" data-toggle="tooltip" data-placement="top" title="Seu perfil neste projeto é {{ $roles->user()->getProfileConfig('text') }}.">{{ $roles->user()->getProfileConfig('text') }}</span> | |
@if ($roles->user()->isAdmin()) | |
<span class="label label-danger pull-right" style="margin:15px 15px 0px 0px; padding:5px 10px" data-toggle="tooltip" data-placement="top" title="Você é administrador do sistema.">ADMIN</span> | |
@endif | |
</nav> | |
<div class="row" style="padding:0px"> | |
<div class="col-md-8 col-sm-12 col-xs-12" style="padding-right:0px"> | |
<?php | |
$module = new Fluent\Node(); | |
echo $module->setup([ | |
'childs'=>[ | |
[ | |
'type' => 'JobPanelWidget', | |
'data'=> [ | |
'job' => $reg, | |
'roles' => $roles | |
] | |
], | |
[ | |
'type' => 'ServicePanelWidget', | |
'data'=> [ | |
'list' => $services, | |
'statistics' => $statistics | |
] | |
], | |
/*[ | |
'type' => 'SprintModalCreateWidget', | |
'data'=> [ | |
'job' => $reg | |
] | |
],*/ | |
] | |
])->build(); | |
?> | |
</div> | |
<div class="col-md-4 col-sm-12 col-xs-12"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
{{ Lang::get('job.statistics') }} | |
</div> | |
<div class="panel-body" style="padding:0px 0px 10px 0px; max-height: 400px; overflow-y: none; overflow-x: hidden;"> | |
<h4 style="text-align: center; color: #666; font-size: 14px; text-transform: uppercase;">{{ Lang::get('task.tasks') }} <span class="badge" style="font-size: 12px">{{ $statistics['tasks']['total'] }}</span></h4> | |
<div class="row"> | |
<div class="col-md-6" style="padding: 0px;"> | |
<div class="row"> | |
<small> | |
<div class="col-md-7" style="padding: 0px 0px 0px 20px; text-align: right"> | |
<span class="label label-default">{{ Task::getStatusParamByKey('todo', 'text') }}</span> | |
</div> | |
<div class="col-md-2" style="padding: 1px 0px; text-align: right"> | |
{{ $statistics['tasks']['todo'] }} | |
</div> | |
<div class="col-md-3" style="padding: 1px 0px; text-align: right"> | |
{{ $statistics['tasks']['todo_perc'] }}% | |
</div> | |
</small> | |
</div> | |
<div class="row"> | |
<small> | |
<div class="col-md-7" style="padding: 1px 0px 0px 20px; text-align: right"> | |
<span class="label label-primary">{{ Task::getStatusParamByKey('doing', 'text') }}</span> | |
</div> | |
<div class="col-md-2" style="padding: 1px 0px; text-align: right"> | |
{{ $statistics['tasks']['doing'] }} | |
</div> | |
<div class="col-md-3" style="padding: 1px 0px; text-align: right"> | |
{{ $statistics['tasks']['doing_perc'] }}% | |
</div> | |
</small> | |
</div> | |
<div class="row"> | |
<small> | |
<div class="col-md-7" style="padding: 1px 0px 0px 20px; text-align: right"> | |
<span class="label label-info">{{ Task::getStatusParamByKey('paused', 'text') }}</span> | |
</div> | |
<div class="col-md-2" style="padding: 1px 0px; text-align: right;"> | |
{{ $statistics['tasks']['paused'] }} | |
</div> | |
<div class="col-md-3" style="padding: 1px 0px; text-align: right;"> | |
{{ $statistics['tasks']['paused_perc'] }}% | |
</div> | |
</small> | |
</div> | |
<div class="row"> | |
<small> | |
<div class="col-md-7" style="padding: 1px 0px 0px 20px; text-align: right"> | |
<span class="label label-danger">{{ Task::getStatusParamByKey('impediment', 'text') }}</span> | |
</div> | |
<div class="col-md-2" style="padding: 1px 0px; text-align: right;"> | |
{{ $statistics['tasks']['impediment'] }} | |
</div> | |
<div class="col-md-3" style="padding: 1px 0px; text-align: right"> | |
{{ $statistics['tasks']['impediment_perc'] }}% | |
</div> | |
</small> | |
</div> | |
<div class="row"> | |
<small> | |
<div class="col-md-7" style="padding: 1px 0px 0px 20px; text-align: right"> | |
<span class="label label-warning">{{ Task::getStatusParamByKey('testing', 'text') }}</span> | |
</div> | |
<div class="col-md-2" style="padding: 1px 0px; text-align: right"> | |
{{ $statistics['tasks']['testing'] }} | |
</div> | |
<div class="col-md-3" style="padding: 1px 0px; text-align: right"> | |
{{ $statistics['tasks']['testing_perc'] }}% | |
</div> | |
</small> | |
</div> | |
<div class="row"> | |
<small> | |
<div class="col-md-7" style="padding: 1px 0px 0px 20px; text-align: right"> | |
<span class="label label-success">{{ Task::getStatusParamByKey('done', 'text') }}</span> | |
</div> | |
<div class="col-md-2" style="padding: 1px 0px; text-align: right"> | |
{{ $statistics['tasks']['done'] }} | |
</div> | |
<div class="col-md-3" style="padding: 1px 0px; text-align: right"> | |
{{ $statistics['tasks']['done_perc'] }}% | |
</div> | |
</small> | |
</div> | |
</div> | |
<div class="col-md-6" style="padding: 0px 20px;"> | |
<canvas id="chart-tasks" width="120" height="120"></canvas> | |
</div> | |
</div> | |
<h4 style="text-align: center; color: #666; font-size: 14px; text-transform: uppercase;">{{ Lang::get('system.activity') }}</span></h4> | |
<div class="row"> | |
<div class="col-md-12" style="padding-left:20px"> | |
<canvas id="chart-activity" height="150" width="280"></canvas> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-12" style="padding-left:20px; text-align: center"> | |
<div class="btn-group btn-group-xs" data-toggle="buttons"> | |
<label id="activity_30" class="btn btn-default active"> | |
<input type="radio" name="access" autocomplete="off">30 dias | |
</label> | |
<label id="activity_30" class="btn btn-default"> | |
<input type="radio" name="access" autocomplete="off">60 dias | |
</label> | |
<label id="activity_30" class="btn btn-default"> | |
<input type="radio" name="access" autocomplete="off">90 dias | |
</label> | |
<label id="activity_30" class="btn btn-default"> | |
<input type="radio" name="access" autocomplete="off">Tudo | |
</label> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
@if($roles->canViewFeed()) | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
Histórico | |
<button type="button" class="btn btn-xs btn-primary pull-right" data-toggle="modal" data-target="#modal-comment"><span class="glyphicon glyphicon-plus"></span> {{ Lang::get('system.comment') }}</button> | |
</div> | |
<div class="panel-body" style="padding:0px; max-height: 350px; overflow-y: scroll; overflow-x: hidden;"> | |
<table class="table table-striped"> | |
@foreach($streaming as $_streaming) | |
<tr> | |
<td style="padding: 2px 5px 5px 5px"> | |
<div class="row"> | |
<div class="col-md-2 col-sm-3 col-xs-4" align="right"> | |
@if(is_file(public_path().$_streaming->user->photo)) | |
<img src="{{ url($_streaming->user->photo) }}" style="height:30px; margin-top:4px" class="img-circle"> | |
@endif | |
</div> | |
<div class="col-md-10 col-sm-9 col-xs-8"> | |
<div class="row"> | |
<div class="col-md-12" style="padding-left: 0px"> | |
<small><a href="{{ url('user/'.$_streaming->user->id) }}">{{ $_streaming->user->name }}</a> {{ $_streaming->action }} | |
@if($_streaming->description) | |
{{ $_streaming->description }} | |
@endif | |
</small> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-12"> | |
<small style="font-size:10px; color:gray" class="pull-right">{{ date('d/m/Y H:i:s', strtotime($_streaming->created_at)) }}</small> | |
</div> | |
</div> | |
</div> | |
</div> | |
</td> | |
</tr> | |
@endforeach | |
</table> | |
</div> | |
</div> | |
@endif | |
</div> | |
</div> | |
<div class="modal fade" id="modal-service-create" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content" style="width: 650px"> | |
<div class="modal-header"> | |
<button type="button" class="close closeModal" aria-hidden="true">×</button> | |
<h4 class="modal-title" id="myModalLabel">{{ Lang::get('service.add_service') }}</h4> | |
</div> | |
<div class="modal-body"> | |
<form id="form-service" class="form-horizontal" role="form" onsubmit="return false;"> | |
<div class="form-group"> | |
<label for="service_name" class="col-lg-2 control-label" style="padding-right: 0px">{{ Lang::get('service.name') }}:</label> | |
<div class="col-lg-10"> | |
<input type="text" class="form-control" id="service_name" name="name" /> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="date_prompt" class="col-lg-2 control-label" style="padding-right: 0px">{{ Lang::get('job.planning') }}:</label> | |
<div class="col-lg-5"> | |
<div class='input-group date' id='datetimepicker_begin'> | |
<input type='text' class="form-control input-group-addon" data-format="DD/MM/YYYY" placeholder="{{ Lang::get('service.service_begin') }}" name="date_begin_planned" id="date_begin_planned"/> | |
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span> | |
</div> | |
</div> | |
<div class="col-lg-5"> | |
<div class='input-group date' id='datetimepicker_end'> | |
<input type='text' class="form-control input-group-addon" data-format="DD/MM/YYYY"placeholder="{{ Lang::get('service.service_end') }}" name="date_end_planned" id="date_end_planned"/> | |
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span> | |
</div> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="service_description" class="col-lg-2 control-label" style="padding-right: 0px">{{ Lang::get('service.description') }}:</label> | |
<div class="col-lg-10"> | |
<textarea id="service_description" class="textarea col-lg-12" style="height: 100px;" name="description"></textarea> | |
</div> | |
</div> | |
</form> | |
</div> | |
<div class="modal-footer"> | |
<button id="btn-cancel-div" type="button" class="btn btn-default pull-left closeModal">{{ Lang::get('system.cancel') }}</button> | |
<button id="btn-save-service" type="button" class="btn btn-primary pull-right">{{ Lang::get('system.save') }}</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="modal fade" id="modal-comment" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h4 class="modal-title" id="myModalLabel">{{ Lang::get('system.comment') }}</h4> | |
</div> | |
<div class="modal-body"> | |
<form id="form-job" class="form-horizontal" role="form" onsubmit="return false;"> | |
<div class="form-group"> | |
<div class="col-lg-12"> | |
<textarea id="comment" class="col-lg-12 custom-textarea" style="height: 100px;" name="comment"></textarea> | |
</div> | |
</div> | |
</form> | |
</div> | |
<div class="modal-footer"> | |
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ Lang::get('system.cancel') }}</button> | |
<button id="btn-comment" type="button" class="btn btn-primary pull-right">{{ Lang::get('system.save') }}</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="modal fade" id="modal-member" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h4 class="modal-title" id="myModalLabel">{{ Lang::get('job.add_team_member') }}</h4> | |
</div> | |
<div class="modal-body" style="padding-bottom: 1px"> | |
<form id="form-member" class="form-horizontal" role="form" onsubmit="return false;"> | |
<div class="form-group"> | |
<label for="name" class="col-lg-2 control-label">{{ Lang::get('system.user') }}:</label> | |
<div class="col-lg-10" style="padding-left: 0px"> | |
<select class="selectpicker" id="member" name="member" data-live-search="true" style="width: 200px; margin-top: 5px"> | |
<option value="0"> Selecione </option> | |
@foreach ($users as $responsible) | |
<option value="{{ $responsible->id }}">{{ $responsible->name}} </option> | |
@endforeach | |
</select> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="name" class="col-lg-2 control-label">{{ Lang::get('system.access') }}:</label> | |
<div class="btn-group" data-toggle="buttons"> | |
@foreach ($job_access as $access) | |
<label id="access_{{ $access['value'] }}" class="btn btn-default @if($access['value']==1) active @endif"> | |
<input type="radio" name="access" autocomplete="off"> {{ $access['text'] }} | |
</label> | |
@endforeach | |
</div> | |
</div> | |
</form> | |
</div> | |
<div class="modal-footer"> | |
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ Lang::get('system.cancel') }}</button> | |
<button id="btn-save-member" type="button" class="btn btn-primary pull-right">{{ Lang::get('system.save') }}</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="modal fade" id="modal-status-description" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h4 class="modal-title" id="myModalLabel">{{ Lang::get('system.whats-problem') }}</h4> | |
</div> | |
<div class="modal-body"> | |
<form id="form-job" class="form-horizontal" role="form" onsubmit="return false;"> | |
<div class="form-group"> | |
<div class="col-lg-12"> | |
<textarea id="status_description" class="col-lg-12 custom-textarea" style="height: 100px;" name="status_description"></textarea> | |
</div> | |
</div> | |
</form> | |
</div> | |
<div class="modal-footer"> | |
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ Lang::get('system.cancel') }}</button> | |
<button id="btn-save-decription" type="button" class="btn btn-primary pull-right">{{ Lang::get('system.save') }}</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="modal fade" id="modal-attach" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h4 class="modal-title" id="myModalLabel">{{ Lang::get('system.attach') }}</h4> | |
</div> | |
<div class="modal-body"> | |
<form id="form-service" class="form-horizontal" role="form" onsubmit="return false;"> | |
<input type="hidden" name="attach_id" id="attach_id"> | |
<div class="form-group"> | |
<label for="name" class="col-lg-2 control-label">{{ Lang::get('system.attach_name') }}:</label> | |
<div class="col-lg-10"> | |
<input type="text" class="form-control" id="name_attach" name="name_attach"> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="attachType_id" class="col-lg-2 control-label">{{ Lang::get('system.attach_type') }}:</label> | |
<div class="col-lg-6"> | |
<select id="attachType_id" name="attachType_id" class="form-control select-width"> | |
<option></option> | |
@foreach ($attachtypes as $attachtype) | |
<option value="{{ $attachtype->id }}">{{ $attachtype->name }}</option> | |
@endforeach | |
</select> | |
</div> | |
</div> | |
</form> | |
</div> | |
<div class="modal-footer"> | |
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ Lang::get('system.cancel') }}</button> | |
<button id="btn-save-attach-information" type="button" class="btn btn-primary pull-right">{{ Lang::get('system.save') }}</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="modal fade" id="modal-prompt" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
<h4 class="modal-title" id="myModalLabel">Alterar prazo</h4> | |
</div> | |
<div class="modal-body"> | |
<form id="form-service" class="form-horizontal" role="form" onsubmit="return false;"> | |
<div class="form-group"> | |
<div class="form-group"> | |
<label for="date_prompt" class="col-lg-2 control-label">Prazo:</label> | |
<div class="col-lg-5"> | |
<div class='input-group date' id='change-date-datetimepicker'> | |
<input type='text' class="form-control" data-format="DD/MM/YYYY HH:mm" name="date_prompt" id="date_prompt"/> | |
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span> | |
</div> | |
</div> | |
<div class="col-lg-5" style="padding: 8px 0px 0px 0px"> | |
<a class="quicklink" id="1" href="#"><span>+1h</span></a> | |
<a class="quicklink" id="2" href="#"><span>+2h</span></a> | |
<a class="quicklink" id="3" href="#"><span>+4h</span></a> | |
<a class="quicklink" id="4" href="#"><span>12h</span></a> | |
<a class="quicklink" id="5" href="#"><span>18h</span></a> | |
<a class="quicklink" id="6" href="#"><span>>12h</span></a> | |
<a class="quicklink" id="7" href="#"><span>>18h</span></a> | |
</div> | |
</div> | |
</div> | |
</form> | |
</div> | |
<div class="modal-footer"> | |
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ Lang::get('system.cancel') }}</button> | |
<button id="btn-save-date-prompt" type="button" class="btn btn-primary pull-right">{{ Lang::get('system.save') }}</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="modal fade" id="modal-requeriment-create" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content" style="width: 680px"> | |
<div class="modal-header"> | |
<button id="btn-cancel-div" type="button" class="close closeModal" aria-hidden="true">×</button> | |
<h4 class="modal-title" id="myModalLabel">{{ Lang::get('requeriment.add_requeriment') }}</h4> | |
</div> | |
<div class="modal-body"> | |
<form id="form-requeriment" class="form-horizontal" role="form" onsubmit="return false;"> | |
<div class="form-group"> | |
<label for="requeriment-name" class="col-lg-2 control-label" style="padding-right: 0px">{{ Lang::get('requeriment.name') }}:</label> | |
<div class="col-lg-10"> | |
<input type="text" class="form-control" id="requeriment-name" name="name"/> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="requeriment-requerimenttype_id" class="col-lg-2 control-label" style="padding-right: 0px">{{ Lang::get('requeriment.type') }}:</label> | |
<div class="col-lg-6"> | |
<select id="requeriment-type" name="requeriment-type" class="form-control"> | |
@foreach($requeriments_types as $type_key=>$type_cfg) | |
<option value="{{ $type_cfg['value'] }}">{{ Lang::get('requeriment.' . $type_key); }}</option> | |
@endforeach | |
</select> | |
</div> | |
</div> | |
<div class="row" style="padding:0px 0px 15px"> | |
<div class="col-md-2 col-sm-2 col-xs-2" align="right" style="padding-right: 0px"> | |
<label class="control-label">{{ Lang::get('requeriment.points') }}:</label> | |
</div> | |
<div class="col-md-10"> | |
<div class="input select rating-aaa"> | |
<select id="requeriment-points" name="points"> | |
<option value="1" selected="selected"></option> | |
<option value="2"></option> | |
<option value="3"></option> | |
<option value="4"></option> | |
<option value="5"></option> | |
</select> | |
</div> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="requeriment-description" class="col-lg-2 control-label" style="padding-right: 0px">{{ Lang::get('requeriment.description') }}:</label> | |
<div class="col-lg-10"> | |
<textarea id="requeriment-description" name="description" class="textarea col-lg-12" style="height: 100px"></textarea> | |
</div> | |
</div> | |
</form> | |
</div> | |
<div class="modal-footer"> | |
<button id="btn-cancel-requeriment" type="button" class="btn btn-default closeModal pull-left" data-dismiss="modal">{{ Lang::get('system.cancel') }}</button> | |
<button id="btn-save-requeriment" type="button" class="btn btn-primary">{{ Lang::get('system.save') }}</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
@stop | |
@section('javascript') | |
<script type="text/javascript"> | |
function activityGraph() { | |
var ctx = $("#chart-activity").get(0).getContext("2d"); | |
var data = { | |
labels: [ | |
@foreach($activity as $key=>$value) | |
@if (array_search($key, array_keys($activity)) == 0 || array_search($key, array_keys($activity)) == sizeof($activity)-1) | |
"{{ $key }}", | |
@elseif (sizeof($activity) > 30 && substr($key, -2) == '01') | |
"{{ substr($key, 0, 7) }}", | |
@elseif (substr($key, -2) == '01' || substr($key, -2) == '10' || substr($key, -2) == '20' ) | |
"{{ $key }}", | |
@else | |
"", | |
@endif | |
@endforeach | |
], | |
datasets: [ | |
{ | |
label: "Atividade", | |
fillColor: "rgba(151,187,205,0.2)", | |
strokeColor: "rgba(151,187,205,1)", | |
pointColor: "rgba(151,187,205,1)", | |
pointStrokeColor: "#fff", | |
pointHighlightFill: "#fff", | |
pointHighlightStroke: "rgba(151,187,205,1)", | |
data: [ | |
@foreach($activity as $key=>$value) | |
{{ $value }}, | |
@endforeach | |
] | |
}] | |
}; | |
var options = { | |
scaleShowGridLines : true, | |
scaleGridLineColor : "rgba(0,0,0,.05)", | |
scaleGridLineWidth : 1, | |
scaleShowHorizontalLines: true, | |
scaleShowVerticalLines: true, | |
bezierCurve : true, | |
bezierCurveTension : 0.3, | |
pointDot : false, | |
scaleFontSize: 8, | |
pointDotRadius : 1, | |
pointDotStrokeWidth : 1, | |
pointHitDetectionRadius : 1, | |
datasetStroke : true, | |
datasetStrokeWidth : 2, | |
datasetFill : true, | |
legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>" | |
}; | |
var myDoughnutChart = new Chart(ctx).Line(data,options); | |
} | |
function tasksGraph() { | |
var ctx = $("#chart-tasks").get(0).getContext("2d"); | |
var data = [ | |
{ | |
value: {{ $statistics['tasks']['todo'] }}, | |
color:"#999", | |
highlight: "#999", | |
label: "{{ Task::getStatusParamByKey('todo', 'text') }}" | |
}, | |
{ | |
value: {{ $statistics['tasks']['doing'] }}, | |
color: "#428bca", | |
highlight: "#428bca", | |
label: "{{ Task::getStatusParamByKey('doing', 'text') }}" | |
}, | |
{ | |
value: {{ $statistics['tasks']['paused'] }}, | |
color: "#5bc0de", | |
highlight: "#5bc0de", | |
label: "{{ Task::getStatusParamByKey('paused', 'text') }}" | |
}, | |
{ | |
value: {{ $statistics['tasks']['impediment'] }}, | |
color: "#d9534f", | |
highlight: "#d9534f", | |
label: "{{ Task::getStatusParamByKey('impediment', 'text') }}" | |
}, | |
{ | |
value: {{ $statistics['tasks']['testing'] }}, | |
color: "#f0ad4e", | |
highlight: "#f0ad4e", | |
label: "{{ Task::getStatusParamByKey('testing', 'text') }}" | |
}, | |
{ | |
value: {{ $statistics['tasks']['done'] }}, | |
color: "#5cb85c", | |
highlight: "#5cb85c", | |
label: "{{ Task::getStatusParamByKey('done', 'text') }}" | |
}, | |
]; | |
var options = { | |
segmentShowStroke : true, | |
segmentStrokeColor : "#fff", | |
segmentStrokeWidth : 2, | |
percentageInnerCutout : 50, | |
animationSteps : 50, | |
animationEasing : "easeOutBounce", | |
animateRotate : true, | |
animateScale : false, | |
legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>" | |
}; | |
var myDoughnutChart = new Chart(ctx).Doughnut(data,options); | |
} | |
jQuery(document).ready(function($) { | |
$("#search").focus(); | |
activityGraph(); | |
tasksGraph(); | |
$(function () { | |
$('[data-toggle="tooltip"]').tooltip() | |
}); | |
$('.textarea').summernote({ | |
height: 150 | |
}); | |
$('#datetimepicker_begin, #datetimepicker_end, #change-date-datetimepicker').datetimepicker({}); | |
$("#btn-back").click(function() { | |
location.href="{{ url('job') }}"; | |
}); | |
$("#btn-create").click(function() { | |
location.href="{{ url('job') }}/create"; | |
}); | |
$("#btn-search").click(function() { | |
location.href='{{ url("job/".$reg->id."") }}?search='+$("#search").val(); | |
}); | |
$("#search").bind("keypress", function (e) { | |
if (e.keyCode == 13) { | |
location.href='{{ url("job/".$reg->id) }}?search='+$("#search").val(); | |
return false; | |
} | |
}); | |
$("#btn-search-undo").click(function() { | |
location.href="{{ url('job/'.$reg->id) }}"; | |
}); | |
$("#btn-edit").click(function() { | |
location.href="{{ url('job/'.$reg->id.'/edit') }}" | |
}); | |
$("#btn-manage-requeriments").click(function() { | |
location.href="{{ url('requeriment?job='.$reg->id) }}" | |
}); | |
$('#requeriment-points').barrating('show', {}); | |
$("#btn-save-requeriment").click(function() { | |
$.ajax({ | |
url: "{{ url('requeriment') }}", | |
type: "POST", | |
data: { | |
name: $("#requeriment-name").val(), | |
job_id: {{ $reg->id }}, | |
type: $("#requeriment-type").val(), | |
description: $("#requeriment-description").code(), | |
points: $("#requeriment-points")[0].value, | |
}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
$('#modal-requeriment-create').modal('hide'); | |
setTimeout(function() { | |
window.location = "{{ url('job/'.$reg->id ) }}"; | |
}, 200); | |
} else { | |
alert(json.message); | |
} | |
} | |
}); | |
}); | |
$("#btn-manage-supports").click(function() { | |
location.href="{{ url('support?job='.$reg->id) }}" | |
}); | |
$("#btn-delete").click(function() { | |
if (confirm('Deseja realmente deletar o registro?')) { | |
$.ajax({ | |
url: "{{ url('job/'.$reg->id) }}", | |
type: "DELETE", | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
window.location = "{{ url('job') }}"; | |
} else { | |
alert(json.message); | |
} | |
} | |
}); | |
} | |
}); | |
$("#btn-save-attach-information").click(function() { | |
var attach_id = $('#attach_id').val(); | |
$.ajax({ | |
url: "{{ url('attach') }}"+"/"+attach_id, | |
type: "PUT", | |
data: { name: $("#name_attach").val(), | |
attachtype_id: $("#attachType_id").val() | |
}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
$('#modal-attach').modal('hide'); | |
setTimeout(function() { | |
window.location = "{{ url('job/'.$reg->id) }}"; | |
}, 200); | |
} else { | |
alert(json.message); | |
} | |
} | |
}); | |
}); | |
$("#btn-save-service").click(function() { | |
$.ajax({ | |
url: "{{ url('service') }}", | |
type: "POST", | |
data: { | |
name: $("#service_name").val(), | |
job_id: {{ $reg->id }}, | |
description: $("#service_description").code(), | |
date_begin_planned: $("#date_begin_planned").val(), | |
date_end_planned: $("#date_end_planned").val() | |
}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
window.location = "{{ url('job/'.$reg->id) }}"; | |
} else { | |
alert(json.message); | |
} | |
}, | |
error: function(json, status, xhr) { | |
alert('Oops! Erro no servidor.'); | |
} | |
}); | |
}); | |
$('.rating-aaa > .rater').barrating({ | |
readonly:true | |
}); | |
$(".btn-change-status").click(function(){ | |
var task_id = {{$reg->id}}; | |
var status; | |
switch($(this).attr('data-status')) { | |
case 'todo': | |
status_id = Job.STATUS.TODO; | |
break; | |
case 'doing': | |
status_id = Job.STATUS.DOING; | |
break; | |
case 'paused': | |
status_id = Job.STATUS.PAUSED; | |
break; | |
case 'testing': | |
status_id = Job.STATUS.TESTING; | |
break; | |
case 'discarded': | |
status_id = Job.STATUS.DISCARDED; | |
break; | |
case 'done': | |
status_id = Job.STATUS.DONE; | |
break; | |
} | |
if(status_id == Job.STATUS.IMPEDIMENT || status_id == Job.STATUS.DISCARDED){ | |
$('#modal-status-description').modal(); | |
$("#btn-save-decription").click(function() { | |
var description = $("#status_description")[0].value; | |
$.ajax({ | |
url: "{{ url('job/updateStatus') }}"+'/'+task_id, | |
type: "POST", | |
data: { status: status_id, | |
status_description: description | |
}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
$('#modal-status-description').modal('hide'); | |
setTimeout(function() { | |
window.location = "{{ url('job/' . $reg->id) }}"; | |
}, 200); | |
} else { | |
alert(json.message); | |
} | |
} | |
}); | |
}); | |
} else if(status_id == Job.STATUS.DONE) { | |
if (confirm("{{ Lang::get('job.confirm_done') }}")) { | |
$.ajax({ | |
url: "{{ url('job/updateStatus') }}"+'/'+task_id, | |
type: "POST", | |
data: { status: status_id}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
window.location = "{{ url('job/' . $reg->id) }}"; | |
} else { | |
alert(json.message); | |
} | |
} | |
}); | |
} | |
} else { | |
$.ajax({ | |
url: "{{ url('job/updateStatus') }}"+'/'+task_id, | |
type: "POST", | |
data: { status: status_id}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
window.location = "{{ url('job/' . $reg->id) }}"; | |
} else { | |
alert(json.message); | |
} | |
} | |
}); | |
} | |
}); | |
$(".btn-group").click(function(){ | |
$(".btn-group").toggleClass(".btn-group open"); | |
}); | |
$(".fileinput").on('change.bs.fileinput', function(evt) { | |
var data = new FormData(); | |
data.append('file', evt.target.files[0]); | |
var interval = setInterval(function() { | |
try { | |
$.ajax({ | |
url: "{{ url('job/'.$reg->id.'/upload') }}", | |
type: 'POST', | |
contentType: false, | |
processData: false, | |
cache: false, | |
data: data, | |
complete: function() { | |
}, | |
success: function(json, status, xhr) { | |
if (json.success=="YES") { | |
$('#modal-attach').modal(); | |
$('#attach_id').val(json.data.reg.attach_id); | |
} else { | |
$(target).show(); | |
alert(json.message); | |
} | |
}, | |
error: function() { | |
} | |
}); | |
clearInterval(interval); | |
} catch (e) { | |
} | |
}, 100); | |
}); | |
$(".modalPopulate").click(function(){ | |
$('#date_prompt').val("{{ date('d/m/Y H:i' ,strtotime($reg->date_prompt)) }}"); | |
}); | |
$("#btn-save-date-prompt").click(function(){ | |
$.ajax({ | |
url: "{{ url('job/updateDatePrompt/'.$reg->id) }}", | |
type: "POST", | |
data: { date_prompt: $("#date_prompt").val() }, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
$('#modal-prompt').modal('hide'); | |
window.location = "{{ url('job/'.$reg->id) }}"; | |
} else { | |
alert(json.message); | |
} | |
} | |
}); | |
}); | |
$(".quicklink").click(function(){ | |
if(this.id==1) | |
$('#date_prompt').val("{{ date('d/m/Y H:i', strtotime('+ 1 hours')) }}"); | |
else if(this.id==2) | |
$('#date_prompt').val("{{ date('d/m/Y H:i', strtotime('+ 2 hours')) }}"); | |
else if(this.id==3) | |
$('#date_prompt').val("{{ date('d/m/Y H:i', strtotime('+ 4 hours')) }}"); | |
else if(this.id==4) | |
$('#date_prompt').val("{{ date('d/m/Y 12:00') }}"); | |
else if(this.id==5) | |
$('#date_prompt').val("{{ date('d/m/Y 18:00') }}"); | |
else if(this.id==6) | |
$('#date_prompt').val("{{ date('d/m/Y 12:00', strtotime('+ 1 day')) }}"); | |
else | |
$('#date_prompt').val("{{ date('d/m/Y 18:00', strtotime('+ 1 day')) }}"); | |
}); | |
$(".delete-user").click(function(evt) { | |
var user_id = this.name; | |
if (confirm("{{ Lang::get('job.confirm_remove_user')}}")) { | |
$.ajax({ | |
url: "{{ url('job/'.$reg->id.'/removeUser') }}", | |
type: "POST", | |
data: {user_id: user_id}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
window.location = "{{ url('job/'.$reg->id) }}"; | |
} else { | |
alert(json.message); | |
} | |
}, | |
error: function(xhr, status, error) { | |
var err = eval("(" + xhr.responseText + ")"); | |
if(err.error && err.error.message) | |
alert("Erro no servidor: ".err.error.message); | |
else | |
alert("Erro no servidor: ".err.statusText); | |
} | |
}); | |
} | |
}); | |
$(".edit-user").click(function(evt) { | |
var user_id = this.name; | |
$.ajax({ | |
url: "{{ url('job/'.$reg->id.'/removeUser') }}", | |
type: "POST", | |
data: {user_id: user_id}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
window.location = "{{ url('job/'.$reg->id) }}"; | |
} else { | |
alert(json.message); | |
} | |
}, | |
error: function(xhr, status, error) { | |
var err = eval("(" + xhr.responseText + ")"); | |
if(err.error && err.error.message) | |
alert("Erro no servidor: ".err.error.message); | |
else | |
alert("Erro no servidor: ".err.statusText); | |
} | |
}); | |
}); | |
$(".delete-image").click(function(evt) { | |
var attach_id = this.name; | |
if (confirm("{{ Lang::get('system.delete_file_confirm')}}")) { | |
$.ajax({ | |
url: "{{ url('job/'.$reg->id.'/deletefile') }}", | |
type: "POST", | |
data: {id: attach_id}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
window.location = "{{ url('job/'.$reg->id) }}"; | |
} else { | |
alert(json.message); | |
} | |
}, | |
error: function(xhr, status, error) { | |
var err = eval("(" + xhr.responseText + ")"); | |
if(err.error && err.error.message) | |
alert("Erro no servidor: ".err.error.message); | |
else | |
alert("Erro no servidor: ".err.statusText); | |
} | |
}); | |
} | |
}); | |
$("#btn-destroy-all-attachs").click(function() { | |
if (confirm("{{ Lang::get('system.delete_attachs_confirm')}}")) { | |
$.ajax({ | |
url: "{{ url('job/deleteAllAttachs/'.$reg->id) }}", | |
type: "POST", | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
window.location = "{{ url('job/'.$reg->id) }}"; | |
} else { | |
alert(json.message); | |
} | |
} | |
}); | |
} | |
}); | |
$("#btn-comment").click(function() { | |
$.ajax({ | |
url: "{{ url('job/'.$reg->id.'/comment') }}", | |
type: "POST", | |
data: { | |
text: $("#comment").val() | |
}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
$('#modal-comment').modal('hide'); | |
setTimeout(function() { | |
window.location = "{{ url('job/'.$reg->id) }}"; | |
}, 200); | |
} else { | |
alert(json.message); | |
} | |
}, | |
}); | |
}); | |
$(".closeModal").click(function() { | |
var name = $("#service_name").val(); | |
if(name != ''){ | |
if (confirm('Deseja realmente cancelar?')) { | |
$('#service_name').val(''); | |
$('#service_description').code(''); | |
//$('.approval_combo').hide(); | |
$('.modal').modal('hide'); | |
} | |
}else | |
$('.modal').modal('hide'); | |
}); | |
$("#btn-save-member").click(function() { | |
var access; | |
if($("#access_1").hasClass("active")) | |
access = 1; | |
else if ($("#access_2").hasClass("active")) | |
access = 2; | |
else if ($("#access_3").hasClass("active")) | |
access = 3; | |
else if ($("#access_4").hasClass("active")) | |
access = 4; | |
else if ($("#access_5").hasClass("active")) | |
access = 5; | |
$.ajax({ | |
url: "{{ url('job/'.$reg->id.'/addUser') }}", | |
type: "POST", | |
data: { | |
user_id : $('#member').val(), | |
access: access | |
}, | |
context: document.body, | |
success: function(json, status, xhr) { | |
var message; | |
if (json.success=="YES") { | |
$('#modal-member').modal('hide'); | |
setTimeout(function() { | |
window.location = "{{ url('job/'.$reg->id) }}"; | |
}, 200); | |
} else { | |
alert(json.message); | |
} | |
}, | |
}); | |
}); | |
}); | |
</script> | |
<script type="application/javascript" src="{{ url('js/Labe/Modules/Job.js') }}"></script> | |
<script type="application/javascript" src="{{ url('js/Labe/Modules/Task.js') }}"></script> | |
<script type="application/javascript" src="{{ url('js/Labe/Modules/Requeriment.js') }}"></script> | |
<script type="application/javascript" src="{{ url('js/Labe/Modules/Sprint.js') }}"></script> | |
@stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment