Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
deputies_functions.inc.php File Reference

Namespaces

namespace  studip_core

Functions

 getDeputies ($range_id, $name_format='full_rev')
 getDeputyBosses ($user_id, $name_format='full_rev')
 addDeputy ($user_id, $range_id)
 deleteDeputy ($user_id, $range_id)
 deleteAllDeputies ($range_id)
 isDeputy ($user_id, $range_id, $check_edit_about=false)
 setDeputyHomepageRights ($user_id, $range_id, $rights)
 getValidDeputyPerms ($min_perm_only=false)
 haveDeputyPerm ($user_id='')
 getMyDeputySeminarsQuery ($type, $sem_number_sql, $sem_number_end_sql, $add_fields, $add_query)
 isDefaultDeputyActivated ()
 isDeputyEditAboutActivated ()

Function Documentation

addDeputy (   $user_id,
  $range_id 
)

Adds a person as deputy of a course or another person.

Parameters
string$user_idperson to add as deputy
string$range_idID of a course or a person
Returns
int Number of affected rows in the database (hopefully 1).

Here is the call graph for this function:

deleteAllDeputies (   $range_id)

Remove all deputies of the given course or person at once.

Parameters
string$range_idcourse or person ID
Returns
int Number of affected database rows (>0 if successful).

Here is the call graph for this function:

Here is the caller graph for this function:

deleteDeputy (   $user_id,
  $range_id 
)

Removes a person as deputy in the given context (course or person).

Parameters
mixed$user_idwhich person(s) to remove, can be a single ID or an array of IDs
string$range_idwhere to remove as deputy (course or person ID)
Returns
int Number of affected rows in the database ("1" if successful).

Here is the call graph for this function:

Here is the caller graph for this function:

getDeputies (   $range_id,
  $name_format = 'full_rev' 
)

Fetches all deputies of the given course or person.

Parameters
string$range_idID of a course or person
string$name_formatdefines which format the full name of a deputy should have
Returns
array An array containing all deputies.

Here is the call graph for this function:

Here is the caller graph for this function:

getDeputyBosses (   $user_id,
  $name_format = 'full_rev' 
)

Fetches all persons of which the given person is default deputy.

Parameters
string$user_idthe user to check
string$name_formatwhat format should full name entries have?
Returns
array An array of the given person's bosses.

Here is the call graph for this function:

getMyDeputySeminarsQuery (   $type,
  $sem_number_sql,
  $sem_number_end_sql,
  $add_fields,
  $add_query 
)

Database query for retrieving all courses where the current user is deputy in.

Parameters
string$typeare we in the "My courses" list (='meine_seminare') or in grouping or notification view ('gruppe', 'notification') or outside Stud.IP in the notification cronjob (='notification_cli')?
string$sem_number_sqlSQL for specifying the semester for a course
string$sem_number_end_sqlSQL for specifying the last semester a course is in
string$add_fieldsoptionally necessary fields from database
string$add_queryadditional joins
Returns
string The SQL query for getting all courses where the current user is deputy in
getValidDeputyPerms (   $min_perm_only = false)

Shows which permission level a person must have in order to be available as deputy.

Parameters
boolean$min_perm_onlywhether to give only the minimum permission or a set of all valid permissions available for being deputy
Returns
mixed The minimum permission needed for being deputy or a set of all permissions between minimum and "admin"

Here is the caller graph for this function:

haveDeputyPerm (   $user_id = '')

Checks whether the given user has the necessary permission in order to be deputy.

Parameters
string$user_iduser ID to check
Returns
boolean My the given user be given as deputy?

Here is the call graph for this function:

isDefaultDeputyActivated ( )

Checks if persons may be assigned as default deputy of other persons.

Returns
activation status of the default deputy functionality.

Here is the call graph for this function:

Here is the caller graph for this function:

isDeputy (   $user_id,
  $range_id,
  $check_edit_about = false 
)

Checks whether the given person is a deputy in the given context (course or person).

Parameters
string$user_idperson ID to check
string$range_idcourse or person ID
boolean$check_edit_aboutcheck if the given person may edit the other person's profile
Returns
boolean Is the given person deputy in the given context?

Here is the call graph for this function:

Here is the caller graph for this function:

isDeputyEditAboutActivated ( )

Checks if default deputies may get the rights to edit their bosses profile page.

Returns
activation status of the deputy boss profile page editing functionality.

Here is the call graph for this function:

Here is the caller graph for this function:

setDeputyHomepageRights (   $user_id,
  $range_id,
  $rights 
)

Set whether the given person my edit the bosses profile page.

Parameters
string$user_idperson ID to grant or remove rights
string$range_idwhich person's profile are we talking about?
int$rightsediting allowed? 0 or 1
Returns
Number of affected database rows ("1" if successful).

Here is the call graph for this function: