Merge branch 'develop' into trunk
This commit is contained in:
commit
3d060e2e7f
6 changed files with 74 additions and 43 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -5,6 +5,7 @@
|
|||
/public/*
|
||||
/storage/*.key
|
||||
/vendor
|
||||
.vscode
|
||||
.env
|
||||
.env.backup
|
||||
.env.dev
|
||||
|
|
@ -16,4 +17,4 @@ npm-debug.log
|
|||
yarn-error.log
|
||||
package-lock.json
|
||||
composer.lock
|
||||
.idea/
|
||||
.idea/
|
||||
|
|
|
|||
|
|
@ -19,45 +19,49 @@ class Controller extends BaseController
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
$ignore = [
|
||||
9,
|
||||
// Support Web
|
||||
15,
|
||||
// Gen-Game- Web
|
||||
19,
|
||||
// Store LDC
|
||||
27,
|
||||
// CRM
|
||||
55,
|
||||
// LDC - WEB
|
||||
];
|
||||
|
||||
$ticketsNew = Ticket::where('status', TicketStatus::new());
|
||||
$ticketsWaiting = Ticket::where('status', TicketStatus::waiting());
|
||||
$ticketsInProgress = Ticket::whereNotIn(
|
||||
'status',
|
||||
[
|
||||
TicketStatus::new(),
|
||||
TicketStatus::estimateTodo(),
|
||||
TicketStatus::estimateValidated(),
|
||||
TicketStatus::toPlan(),
|
||||
TicketStatus::planned(),
|
||||
TicketStatus::waiting(),
|
||||
TicketStatus::production(),
|
||||
TicketStatus::archived()
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$user = Auth::user();
|
||||
if (!is_null($user) && !$user->isAdmin()) {
|
||||
$ticketsNew = $ticketsNew->where('is_internal', 0)->whereNotIn('site_id', $ignore);
|
||||
$ticketsWaiting = $ticketsWaiting->where('is_internal', 0)->whereNotIn('site_id', $ignore);
|
||||
$ticketsInProgress = $ticketsInProgress->where('is_internal', 0)->whereNotIn('site_id', $ignore);
|
||||
}
|
||||
|
||||
View::share('ticketsNew', $ticketsNew->count());
|
||||
View::share('ticketsWaiting', $ticketsWaiting->count());
|
||||
View::share('ticketsInProgress', $ticketsInProgress->count());
|
||||
$this->middleware(function($request, $next) {
|
||||
$ignore = [
|
||||
// Support Web
|
||||
9,
|
||||
// Gen-Game- Web
|
||||
15,
|
||||
// Store LDC
|
||||
19,
|
||||
// CRM
|
||||
27,
|
||||
// LDC - WEB
|
||||
55,
|
||||
];
|
||||
|
||||
$ticketsNew = Ticket::where('status', TicketStatus::new());
|
||||
$ticketsWaiting = Ticket::where('status', TicketStatus::waiting());
|
||||
$ticketsInProgress = Ticket::whereNotIn(
|
||||
'status',
|
||||
[
|
||||
TicketStatus::new(),
|
||||
TicketStatus::estimateTodo(),
|
||||
TicketStatus::estimateValidated(),
|
||||
TicketStatus::toPlan(),
|
||||
TicketStatus::planned(),
|
||||
TicketStatus::waiting(),
|
||||
TicketStatus::production(),
|
||||
TicketStatus::archived()
|
||||
]
|
||||
);
|
||||
|
||||
/** @var \App\Models\User|null $user */
|
||||
$user = Auth::user();
|
||||
if (!is_null($user) and !$user->isAdmin()) {
|
||||
$ticketsNew = $ticketsNew->where('is_internal', 0)->whereNotIn('site_id', $ignore);
|
||||
$ticketsWaiting = $ticketsWaiting->where('is_internal', 0)->whereNotIn('site_id', $ignore);
|
||||
$ticketsInProgress = $ticketsInProgress->where('is_internal', 0)->whereNotIn('site_id', $ignore);
|
||||
}
|
||||
|
||||
View::share('ticketsNew', $ticketsNew->count());
|
||||
View::share('ticketsWaiting', $ticketsWaiting->count());
|
||||
View::share('ticketsInProgress', $ticketsInProgress->count());
|
||||
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,11 +10,20 @@ use Kwaadpepper\CrudPolicies\Traits\CrudController;
|
|||
|
||||
class ProjectController extends Controller
|
||||
{
|
||||
|
||||
use CrudController {
|
||||
__construct as __CrudConstructor;
|
||||
index as crudIndex;
|
||||
show as crudShow;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->__CrudConstructor();
|
||||
$this->authorizeResource(Project::class, 'project');
|
||||
}
|
||||
|
||||
/** @var Project */
|
||||
public static $modelClass = Project::class;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,17 @@ use Kwaadpepper\CrudPolicies\Traits\CrudController;
|
|||
class SiteController extends Controller
|
||||
{
|
||||
use CrudController {
|
||||
__construct as __CrudConstructor;
|
||||
index as crudIndex;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->__CrudConstructor();
|
||||
$this->authorizeResource(Site::class, 'site');
|
||||
}
|
||||
|
||||
/** @var Site */
|
||||
public static $modelClass = Site::class;
|
||||
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ class TicketController extends Controller
|
|||
$ticket->status = TicketStatus::inprogress();
|
||||
$ticket->saveQuietly();
|
||||
event(new TicketStatusChanged($ticket, $oldStatus, null, $message));
|
||||
event(new NotifySubscriptions($ticket, $message, collect($ticket->user)));
|
||||
event(new NotifySubscriptions($ticket, $message, collect([$ticket->user])));
|
||||
User::find(Auth::user()->id)->subscriptions()->toggle($ticket->id);
|
||||
return back()->with('warning', trans('Votre ticket à été réouvert.'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,16 @@ use Kwaadpepper\CrudPolicies\Traits\CrudController;
|
|||
|
||||
class UserController extends Controller
|
||||
{
|
||||
use CrudController;
|
||||
use CrudController {
|
||||
__construct as __CrudConstructor;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->__CrudConstructor();
|
||||
$this->authorizeResource(User::class, 'user');
|
||||
}
|
||||
|
||||
/** @var User */
|
||||
public static $modelClass = User::class;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue