Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
Resources_BookingController Class Reference
Inheritance diagram for Resources_BookingController:
AuthenticatedController StudipController

Public Member Functions

 before_filter (&$action, &$args)
 
 index_action ($booking_id=null)
 
 add_from_request_action ($resource_id=null, $request_id=null)
 
 addEditHandler ($mode= 'edit')
 
 add_action ($resource_id=null, $booking_type=null)
 
 edit_action ($booking_id=null)
 
 duplicate_action ($booking_id=null)
 
 copy_action ($booking_id=null)
 
 move_action ($booking_id=null)
 
 copy_to_semester_action ($booking_id=null)
 
 delete_action ($booking_id=null)
 
 transform_action ($booking_id=null)
 
- Public Member Functions inherited from AuthenticatedController
 before_filter (&$action, &$args)
 
- Public Member Functions inherited from StudipController
 before_filter (&$action, &$args)
 
 erase_response ()
 
 perform ($unconsumed_path)
 
 after_filter ($action, $args)
 
 validate_args (&$args, $types=null)
 
 url_for ($to= '')
 
 link_for ($to= '')
 
 redirect ($to)
 
 relocate ($to)
 
 rescue ($exception)
 
 render_json ($data)
 
 render_csv ($data, $filename=null, $delimiter= ';', $enclosure= '"')
 
 render_file ($file, $filename=null, $content_type=null, $content_disposition= 'attachment', Closure $callback=null, $chunk_size=262144)
 
 render_temporary_file ($file, $filename=null, $content_type=null, $content_disposition= 'attachment', Closure $callback=null, $chunk_size=262144)
 
 relay ($to_uri)
 
 relayWithRedirect (...$args)
 
 perform_relayed ($unconsumed)
 
 render_template_as_string ($template, $layout=null)
 
 __call ($method, $arguments)
 
 has_action ($action)
 
 action_url ($action)
 
 action_link ($action)
 
 validate_datetime ($datetime, $format= 'H:i')
 

Protected Member Functions

 sendLockBookingMail (ResourceBooking $booking)
 
 assignResourceAndCollectResults ($booking, Resource $resource, User $user, DateTime $begin, DateTime $end, DateTime $repetition_end, $preparation_time=0, $description= '', $comment= '', $booking_type= '0', $assigned_user=null, $repetition_interval=null, $notification_enabled=false, $included_room_parts=[], $overwrite_bookings=false)
 
 displayAssignResultMessages ($booking_type=0, $booking_count=0, $errors=[], $room_part_errors=[])
 
- Protected Member Functions inherited from AuthenticatedController
 keepRequest ()
 
- Protected Member Functions inherited from StudipController
 render_pdf (TCPDF $pdf, $filename, $inline=false)
 
 controller_path ()
 
 getBodyElementIdForControllerAndAction ($unconsumed_path)
 

Additional Inherited Members

- Protected Attributes inherited from AuthenticatedController
 $with_session = true
 
 $allow_nobody = false
 
- Protected Attributes inherited from StudipController
 $with_session = false
 
 $allow_nobody = true
 
 $_autobind = false
 

Detailed Description

Resources_BookingController contains functionality for resource bookings.

Member Function Documentation

add_action (   $resource_id = null,
  $booking_type = null 
)
add_from_request_action (   $resource_id = null,
  $request_id = null 
)

This action handles the creation of an booking by specifying a resource and a resource request.

addEditHandler (   $mode = 'edit')

This action handles assigning, reserving and locking a resource without having to create a resource request before (direct booking).

assignResourceAndCollectResults (   $booking,
Resource  $resource,
User  $user,
DateTime  $begin,
DateTime  $end,
DateTime  $repetition_end,
  $preparation_time = 0,
  $description = '',
  $comment = '',
  $booking_type = '0',
  $assigned_user = null,
  $repetition_interval = null,
  $notification_enabled = false,
  $included_room_parts = [],
  $overwrite_bookings = false 
)
protected

An internal helper method for assigning resources and collecting the results.

Parameters
ResourceBooking | null$bookingEither a ResourceBooking object or null. If a ResourceBooking object is specified its content will be updated. Otherwise a new object will be created.
Returns
array An associative array with the following structure: [ 'errors' => Error messages related to booking the resource. 'room_part_errors' => Error messages related to the booking of other resource parts. 'bookings' => The created bookings. ]
before_filter ( $action,
$args 
)
copy_action (   $booking_id = null)

This action can copy a booking to another resource of the same resource class.

copy_to_semester_action (   $booking_id = null)

This action can copy an booking in another semester.

delete_action (   $booking_id = null)

This action is responsible for deleting a resource booking.

displayAssignResultMessages (   $booking_type = 0,
  $booking_count = 0,
  $errors = [],
  $room_part_errors = [] 
)
protected
duplicate_action (   $booking_id = null)
edit_action (   $booking_id = null)
index_action (   $booking_id = null)
move_action (   $booking_id = null)

This action can move a booking to another resource of the same resource class.

sendLockBookingMail ( ResourceBooking  $booking)
protected
transform_action (   $booking_id = null)

Transforms a reservation to a booking and vice versa.


The documentation for this class was generated from the following file: