Class for handling "related to" information

package org.openpsa.relatedto

 Methods

add_button ($toolbar, $guid, $mode)

Static

Parameters

$toolbar

$guid

$mode

add_header_files ()

Helper function that adds the necessary JS/CSS to HTML head
Static

add_journal_entry_button ($toolbar, $guid, $mode)

function to add the button for journal_entry to the toolbar
Static

Parameters

$toolbar

$guid

$mode

common_node_toolbar_buttons ($toolbar, $bind_object, $calling_component, $buttons)

Static

Parameters

$toolbar

$bind_object

$calling_component

$buttons

common_node_toolbar_buttons_sanitycheck ($data, $button_component, $bind_object, $calling_component)

Static

Parameters

$data

$button_component

$bind_object

$calling_component

common_toolbar_buttons_defaults ()

Static

create (object $from_obj, string $from_component, object $to_obj, string $to_component, int $status, array $extra)

Shorthand for creating a relatedto object.
Static

The from object is something that is related to the to object. For example, if a task is created under a sales project, that task is the from object, and the sales project the to object.

Parameters

$from_obj

object&$from_obj The from object

$from_component

stringThe from component name

$to_obj

object&$to_obj The to object

$to_component

stringThe to component name

$status

intThe status of the relation

$extra

arrayArray with the possible extra-properties

Returns

mixedThe newly-created relatedto object or false on failure

get2relatedto ()

Parses relatedto information from request, returning either existing matching relatedtos or prefilled new ones for creation
Static

get2session ()

Used to convert our GET parameters into session data

For use with DM2 or any other form that loses the GET parameters when POSTing

get2session_cleanup ()

Clean up after get2session() (in case we cancel or something)

To be used in case we do not get to call on_created_handle_relatedto() or some other method that reads and saves the data (and while at it cleans up after itself)

relatedto2get ($array)

serializes an array or relatedto objects into GET parameters
Static

NOTE: does not prefix the ? for the first parameter in case this needs to be used with some other GET parameters.

Parameters

$array