Fix the user-manage-organisations modal (column name & search)

This commit is contained in:
2022-02-22 13:48:20 +00:00
parent be8404c9a5
commit 0d5551f927
3 changed files with 30 additions and 0 deletions

View File

@@ -143,4 +143,6 @@ return [
'LEAVE' => 'Leave', 'LEAVE' => 'Leave',
'ACTION_CANNOT_UNDONE' => 'This action cannot be undone!', 'ACTION_CANNOT_UNDONE' => 'This action cannot be undone!',
'IS_ADMINISTRATOR' => 'Administrator?',
]; ];

View File

@@ -41,6 +41,11 @@ class OrganisationSprunje extends Sprunje
'member_count', 'member_count',
'admin_count', 'admin_count',
'status', 'status',
'info',
];
protected $excludeForAll = [
'info',
]; ];
/** /**
@@ -109,4 +114,26 @@ class OrganisationSprunje extends Sprunje
return $this; return $this;
} }
/**
* Filter LIKE name OR description. (for user organisations modal)
*
* @param Builder $query
* @param mixed $value
*
* @return self
*/
protected function filterInfo($query, $value)
{
// Split value on separator for OR queries
$values = explode($this->orSeparator, $value);
$query->where(function ($query) use ($values) {
foreach ($values as $value) {
$query->orLike('name', $value)
->orLike('description', $value);
}
});
return $this;
}
} }

View File

@@ -13,6 +13,7 @@
<tr> <tr>
<th>{{translate("NAME")}}</th> <th>{{translate("NAME")}}</th>
<th>{{translate("DESCRIPTION")}}</th> <th>{{translate("DESCRIPTION")}}</th>
<th>{{translate("IS_ADMINISTRATOR")}}</th>
<th>{{translate("REMOVE")}}</th> <th>{{translate("REMOVE")}}</th>
</tr> </tr>
</thead> </thead>