Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -42,28 +42,22 @@ class Table extends TableHelper
|
||||
public function getRows( array $advancedSearchValues=NULL ): array
|
||||
{
|
||||
$this->sortBy = in_array( $this->sortBy, $this->sortOptions ) ? $this->sortBy : 'assign_date';
|
||||
$sortBy = $this->sortBy . ' ' . ( $this->sortDirection and strtolower( $this->sortDirection ) == 'asc' ? 'asc' : 'desc' );
|
||||
$sortBy = $this->sortBy . ' ' . ( ( $this->sortDirection and strtolower( $this->sortDirection ) == 'asc' ) ? 'asc' : 'desc' );
|
||||
|
||||
/* If we can assign content, we can see all assignments.
|
||||
Otherwise, find anything assigned to the logged in member */
|
||||
$where = [];
|
||||
if( !Assignment::canAssignOnAny() or ( isset( Request::i()->filter ) and Request::i()->filter == 'assign_mine' ) )
|
||||
if( !Assignment::canAssignOnAny() or ( isset( Request::i()->filter ) and Request::i()->filter == 'assign_mine' ) or isset( Request::i()->overview ) and Request::i()->overview )
|
||||
{
|
||||
$clause = [
|
||||
"(assign_type=? and assign_to=?)"
|
||||
];
|
||||
$binds = [
|
||||
Assignment::ASSIGNMENT_MEMBER,
|
||||
Member::loggedIn()->member_id
|
||||
];
|
||||
|
||||
if( $teams = Member::loggedIn()->teams() )
|
||||
{
|
||||
$clause[] = "(assign_type=? and " . Db::i()->in( 'assign_to', array_keys( $teams ) ) . ")";
|
||||
$binds[] = Assignment::ASSIGNMENT_TEAM;
|
||||
$where[] = [ '( (assign_type=? and assign_to=?) or (assign_type=? and assign_to in (' . implode( ",", array_keys( Member::loggedIn()->teams() ) ) . ') ) )', Assignment::ASSIGNMENT_MEMBER, Member::loggedIn()->member_id, Assignment::ASSIGNMENT_TEAM ];
|
||||
}
|
||||
else
|
||||
{
|
||||
$where[] = [ 'assign_type=?', Assignment::ASSIGNMENT_MEMBER ];
|
||||
$where[] = [ 'assign_to=?', Member::loggedIn()->member_id ];
|
||||
}
|
||||
|
||||
$where = array_merge( array( implode( " OR ", $clause ) ), $binds );
|
||||
}
|
||||
|
||||
if( isset( Request::i()->filter ) )
|
||||
|
||||
Reference in new issue
Block a user