Class MatukioHelperUtilsEvents

todo cleanup this mess.. All left overs from Seminar, not much of use
since 1.0.0
package MatukioEvents

 Methods

Calculates how many places (booked, certificated etc.) an event has and more! (->booked, ->certificated, ->paid, ->total) sem_f020

calculateBookedPlaces(object $row, integer $status = 1) : \stdClass
Static

Parameters

$row

object
  • The event

$status

integer
  • The status (opt)

Returns

\stdClass

Calculates how many places (booked, certificated etc.) an event has and more! (->booked, ->certificated, ->paid, ->total) sem_f020

calculateBookedPlacesRecurring(object $event) : \stdClass
Static

Parameters

$event

object

The event

Returns

\stdClass

checkRequiredFieldValues()

checkRequiredFieldValues($text, $art = 'leer'
Static

Parameters

$text

$art

Creates a new event number depending on the given year sem_f064

createNewEventNumber(integer $year) : string
Static

Parameters

$year

integer
  • Year e.g. 2013

Exceptions

\exception - if the database queries fail

Returns

string

Duplicate an event (NOT Recurring)

duplicateEvent(integer $eventId) : integer
Static
since 7.0.0

Parameters

$eventId

integer

Event Id (Not Recurring)

Returns

integer

Generatesa a csv file

generateCSVFile(boolean $backend, integer $cid = 0, array $bookings = null, object $event = null) : mixed | string
Static

Parameters

$backend

boolean
  • Are we in the backend

$cid

integer
  • The event id

$bookings

array
  • The bookings (opt)

$event

object
  • THe event (opt)

Exceptions

\Exception - on DB error

Returns

mixedstring- CSV code

Get the access level name

getAccessLevelName(integer $id) : mixed
Static
since __DEPLOY_VERSION__

Parameters

$id

integer

Id of the access level

Returns

mixed

Gets the calendar button

getCalendarButton(object $event, string $template = "modern") : string
Static

Parameters

$event

object
  • THe event

$template

string
  • The template

Returns

string

getCleanedMailText()

getCleanedMailText($text) 
Static

Parameters

$text

getEmailBody()

getEmailBody($event, $booking, $user, $closeHtml = true
Static

Parameters

$event

$booking

$user

$closeHtml

Generates an event template with all the "normal" default values

getEventEditTemplate(integer $event_id = 0, $beginDate = true, $save = true) : object
Static

Parameters

$event_id

integer
  • The event id (optional - if 0 we create a new one)

$beginDate

$save

Returns

object- The event

Get an event id for an UUID

getEventIdForUuid(string $uuid) : mixed
Static

Parameters

$uuid

string

The unique event id

Returns

mixed

Loads an event with recurring out of the database.

getEventRecurring(integer|array $id, $isEventId = false, $isArray = false, $published = false, $access = false, $orderBy = null) : mixed
Static

.

Parameters

$id

integerarray
  • The event id

TODO Update for access and published -> map to model

$isEventId

$isArray

$published

$access

$orderBy

Returns

mixed

Loads the events for the given real event id

getEventsRecurringOnEventId(integer $eventId) : mixed
Static

Parameters

$eventId

integer
  • The event id

Returns

mixed

Formats the given money value for the regional output sem_f044

getFormatedCurrency(double $value, object $event, $spans = false) : string
Static

Parameters

$value

double
  • The value to format

$event

object
  • The Event

$spans

Returns

string

Simple helper method to get the ids from an event

getIdArrayFromEvents(array $events) : array
Static
since 7.0.0

Parameters

$events

array

Array of recurring Events

Returns

array

Gets the location Object

getLocation(integer $id, integer $published = 1) : mixed
Static

Parameters

$id

integer
  • The id

$published

integer
  • only published locations

Returns

mixed

Gets the locations out of the database

getLocations(integer $published = 1, string $order_by = "title ASC") : mixed
Static

Parameters

$published

integer
  • Published events?

$order_by

string
  • Order by - default title ASC

Returns

mixed

Get a list of organizers

getOrganizerList(integer $userId, integer $frontend) : mixed
Static
since 7.0.0

Parameters

$userId

integer

User selected

$frontend

integer

Are we in the frontend

Returns

mixed

Get's the parse level depending on bookings and user

getParseLevel(array $bookings, \JUser $user) : string
Static

Parameters

$bookings

array
  • The bookings

$user

\JUser
  • The user

Returns

string

Gets the place selector

getPlaceSelect($freeplaces, object $event, integer $nr, integer $selected = 0, $class = "", $zero = true) : mixed
Static

Parameters

$freeplaces

$event

object
  • The event

$nr

integer
  • The count

$selected

integer
  • The selected element

$class

$zero

Returns

mixed

getTemplateListSelect()

getTemplateListSelect($vorlage, $art) 
Static

Parameters

$vorlage

$art

Increase event hit count

increaseEventHitCounter(integer $event_id) 
Static

Parameters

$event_id

integer
  • The event

Exceptions

\Exception

Is the event fully booked? True if yes

isFullyBooked(integer $maxPupil, integer $bookedPupil) : boolean
Static
since 7.0.0

Parameters

$maxPupil

integer

Max number of pupil

$bookedPupil

integer

Booked pupil

Returns

boolean

Check if we show the participants view for this user

isViewTeilnehmer(\JUser $user, Object $event, boolean $isBooked) : boolean
Static

Parameters

$user

\JUser
  • The JUser Obj

$event

Object
  • The event Obj

$isBooked

boolean
  • Is the user booked for the event

Returns

boolean- Can the user view the participants?

Publish / Unpublish an event

publishEvent(integer $eventId, integer $publish = 1) : void
Static
since 7.0.0

Parameters

$eventId

integer

The Event Id (NOT recurring)

$publish

integer

Publish the even (1 = yes / 0 = no)

Delete an event and all dates / files!

removeEvent(integer $eventId) : void
Static
since 7.0.0

Parameters

$eventId

integer

Event Id (NOT Recurring)

Saves an event (if no problems occur)

saveEvent(boolean $frontend = false) : boolean | \JTable
Static
since 7.0.0

Parameters

$frontend

boolean
  • Are we in the frontend (validation turned on etc.)

Exceptions

\Exception on store errors

Returns

boolean\JTableThe created Event

Sends E-Mails to participants, organizers etc.

sendBookingConfirmationMail(object $event, integer $uid, integer $art, boolean $cancel = false, object $booking = null, boolean $sendInvoice = true, $activeOnly = false, $isNew = true) : void
Static

$art: 1: booking confirmation 2: cancel confirmation (user) 3: cancel confirmation (admin) 4: deleted 5: published 6: certificated 7: certificate revoked 8: max number reached 9: republished event 10: canceld 11: updated 12: confirmation 13: confirmation to organizer with CSV file 14: info to organizer 15: invoice email

todo update, rewrite and optimize.. Biggest mess

Parameters

$event

object
  • The event object

$uid

integer
  • The user id?

$art

integer
  • The Task

$cancel

boolean
  • Should we cancel

$booking

object
  • The booking

$sendInvoice

boolean
  • Should the invoice send?

$activeOnly

$isNew

Exceptions

\Exception

Send new Event mail

sendNewEventMail(object $event) 
Static
since 6.0.7

Parameters

$event

object

The event

 Constants

 

Unlimited bookings

UNLIMITED = 99999 : integer