Skip to content

Commit

Permalink
Merge branch 'master' into i18n2
Browse files Browse the repository at this point in the history
  • Loading branch information
Papoteur authored Feb 26, 2024
2 parents 598ad5c + 6990a52 commit 4ec4fdf
Show file tree
Hide file tree
Showing 12 changed files with 453 additions and 446 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ APP_LOCALE=fr
APP_TIMEZONE=Europe/Paris

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
Expand All @@ -22,10 +24,13 @@ OPS_SECRET="Your Consumer Secret Key"

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/EventNameController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public function index(Request $request)
$ename = $ename->where('name', 'like', $Name.'%');
}

$enameslist = $ename->get();
$enameslist = $ename->paginate(21);
$enameslist->appends($request->input())->links();

return view('eventname.index', compact('enameslist'));
}
Expand Down
31 changes: 18 additions & 13 deletions app/Matter.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function publication()
public function grant()
{
return $this->hasOne(\App\Event::class)
->whereCode('GRT')->withDefault();
->whereIn('code', ['GRT', 'REG'])->withDefault();
}

public function registration()
Expand Down Expand Up @@ -242,8 +242,8 @@ public static function filter($sortkey = 'id', $sortdir = 'desc', $multi_filter
'fil.detail AS FilNo',
'pub.event_date AS Published',
'pub.detail AS PubNo',
'grt.event_date AS Granted',
'grt.detail AS GrtNo',
DB::raw("COALESCE(grt.event_date, reg.event_date) AS Granted"),
DB::raw("COALESCE(grt.detail, reg.detail) AS GrtNo"),
'matter.id',
'matter.container_id',
'matter.parent_id',
Expand All @@ -256,21 +256,21 @@ public static function filter($sortkey = 'id', $sortdir = 'desc', $multi_filter
->join('matter_category', 'matter.category_code', 'matter_category.code')
->leftJoin(
DB::raw('matter_actor_lnk clilnk
JOIN actor cli ON cli.id = clilnk.actor_id'),
JOIN actor cli ON cli.id = clilnk.actor_id'),
function ($join) {
$join->on('matter.id', 'clilnk.matter_id')->where('clilnk.role', 'CLI');
}
)
->leftJoin(DB::raw('matter_actor_lnk cliclnk
JOIN actor clic ON clic.id = cliclnk.actor_id'), function ($join) {
JOIN actor clic ON clic.id = cliclnk.actor_id'), function ($join) {
$join->on('matter.container_id', 'cliclnk.matter_id')->where([
['cliclnk.role', 'CLI'],
['cliclnk.shared', 1],
]);
})
->leftJoin(
DB::raw('matter_actor_lnk agtlnk
JOIN actor agt ON agt.id = agtlnk.actor_id'),
JOIN actor agt ON agt.id = agtlnk.actor_id'),
function ($join) {
$join->on('matter.id', 'agtlnk.matter_id')->where([
['agtlnk.role', 'AGT'],
Expand All @@ -279,22 +279,22 @@ function ($join) {
}
)
->leftJoin(DB::raw('matter_actor_lnk agtclnk
JOIN actor agtc ON agtc.id = agtclnk.actor_id'), function ($join) {
JOIN actor agtc ON agtc.id = agtclnk.actor_id'), function ($join) {
$join->on('matter.container_id', 'agtclnk.matter_id')->where([
['agtclnk.role', 'AGT'],
['agtclnk.shared', 1],
]);
})
->leftJoin(
DB::raw('matter_actor_lnk applnk
JOIN actor app ON app.id = applnk.actor_id'),
JOIN actor app ON app.id = applnk.actor_id'),
function ($join) {
$join->on(DB::raw('ifnull(matter.container_id, matter.id)'), 'applnk.matter_id')->where('applnk.role', 'APP');
}
)
->leftJoin(
DB::raw('matter_actor_lnk dellnk
JOIN actor del ON del.id = dellnk.actor_id'),
JOIN actor del ON del.id = dellnk.actor_id'),
function ($join) {
$join->on(DB::raw('ifnull(matter.container_id, matter.id)'), 'dellnk.matter_id')->where('dellnk.role', 'DEL');
}
Expand All @@ -308,11 +308,14 @@ function ($join) {
->leftJoin('event AS grt', function ($join) {
$join->on('matter.id', 'grt.matter_id')->where('grt.code', 'GRT');
})
->leftJoin('event AS reg', function ($join) {
$join->on('matter.id', 'reg.matter_id')->where('reg.code', 'REG');
})
->leftJoin(DB::raw('event status
JOIN event_name ON event_name.code = status.code AND event_name.status_event = 1'), 'matter.id', 'status.matter_id')
JOIN event_name ON event_name.code = status.code AND event_name.status_event = 1'), 'matter.id', 'status.matter_id')
->leftJoin(
DB::raw('event e2
JOIN event_name en2 ON e2.code=en2.code AND en2.status_event = 1'),
JOIN event_name en2 ON e2.code = en2.code AND en2.status_event = 1'),
function ($join) {
$join->on('status.matter_id', 'e2.matter_id')->whereColumn('status.event_date', '<', 'e2.event_date');
}
Expand Down Expand Up @@ -423,10 +426,12 @@ function ($join) {
$query->where('pub.detail', 'LIKE', "$value%");
break;
case 'Granted':
$query->where('grt.event_date', 'LIKE', "$value%");
$query->where('grt.event_date', 'LIKE', "$value%")
->orWhere('reg.event_date', 'LIKE', "$value%");
break;
case 'GrtNo':
$query->where('grt.detail', 'LIKE', "$value%");
$query->where('grt.detail', 'LIKE', "$value%")
->orWhere('reg.detail', 'LIKE', "$value%");
break;
case 'responsible':
$query->whereRaw("'$value' IN (matter.responsible, del.login)");
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"laminas/laminas-escaper": "^2.7",
"laravel/framework": "^10.0",
"laravel/ui": "^4.2",
"phpoffice/phpword": "^0.18.0"
"phpoffice/phpword": "^1.2.0"
},
"require-dev": {
"laravel/tinker": "^2.5",
Expand Down
Loading

0 comments on commit 4ec4fdf

Please sign in to comment.