Skip to content

Commit

Permalink
Added trademark registration information as grant information in the …
Browse files Browse the repository at this point in the history
…matter lists
  • Loading branch information
jjdejong committed Feb 24, 2024
1 parent dc68d33 commit 6990a52
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
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
6 changes: 3 additions & 3 deletions resources/views/matter/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@
<button class="btn btn-outline-secondary sortable {{ Request::get('sortkey') == 'fil.event_date' ? 'active' : '' }}" type="button" data-sortkey="fil.event_date" data-sortdir="asc">&UpDownArrow;</button>
</div>
</td>
<td class="tab1 {{ $hideTab1 }}"><input class="form-control" name="FilNo" placeholder="Number" value="{{ Request::get('FilNo') }}"></td>
<td class="tab1 {{ $hideTab1 }}"><input class="form-control form-control-sm" name="FilNo" placeholder="Number" value="{{ Request::get('FilNo') }}"></td>
<td class="tab1 {{ $hideTab1 }}">
<div class="input-group input-group-sm">
<input class="form-control" name="Published" placeholder="Published" value="{{ Request::get('Published') }}">
<button class="btn btn-outline-secondary sortable {{ Request::get('sortkey') == 'pub.event_date' ? 'active' : '' }}" type="button" data-sortkey="pub.event_date" data-sortdir="asc">&UpDownArrow;</button>
</div>
</td>
<td class="tab1 {{ $hideTab1 }}"><input class="form-control" name="PubNo" placeholder="Number" value="{{ Request::get('PubNo') }}"></td>
<td class="tab1 {{ $hideTab1 }}"><input class="form-control form-control-sm" name="PubNo" placeholder="Number" value="{{ Request::get('PubNo') }}"></td>
<td class="tab1 {{ $hideTab1 }}">
<div class="input-group input-group-sm">
<input class="form-control" name="Granted" placeholder="Granted" value="{{ Request::get('Granted') }}">
<input class="form-control" name="Granted" placeholder="Granted/Reg'd" value="{{ Request::get('Granted') }}">
<button class="btn btn-outline-secondary sortable {{ Request::get('sortkey') == 'grt.event_date' ? 'active' : '' }}" type="button" data-sortkey="grt.event_date" data-sortdir="asc">&UpDownArrow;</button>
</div>
</td>
Expand Down

0 comments on commit 6990a52

Please sign in to comment.