Merge remote-tracking branch 'origin/ticket775' into develop
This commit is contained in:
commit
a4d3c09c5d
4 changed files with 71 additions and 41 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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