Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_user_requests()

Description

Fetch a list of all requests for a user

Parameters

ColumnTypeDefaultDescription
$excludecompleted bool false Exclude requests that have already been completed
$returnsql bool false Return the SQL for the execution rather than the results

Return

mixed

Location

include/request_functions.php lines 36 to 50

Definition

 
function get_user_requests($excludecompleted=false,$returnsql=false)
    {
    global 
$userref;
    if (!
is_numeric($userref)){ return false; }

    
$query_spec = new PreparedStatementQuery();
    
$query_spec->parameters=array("i",$userref);
    
$query_spec->sql="select u.username,u.fullname,r.*,if(collection.ref is null,'0',collection.ref) collection_id, 
            (select count(*) from collection_resource cr where cr.collection=r.collection) c 
        from request r 
        left outer join user u on r.user=u.ref 
        left join collection on r.collection = collection.ref 
        where r.user = ?" 
. ($excludecompleted?" AND status<>2":"") . " order by ref desc";
    return 
$returnsql $query_spec ps_query($query_spec->sql$query_spec->parameters);
    }

This article was last updated 4th December 2024 08:35 Europe/London time based on the source file dated 18th November 2024 16:40 Europe/London time.