Class ecdStd

Description

Provide standard display functions.

This class provides a static interface to generate various strings in a standardized way. Whenever you think of some string that should always be output in some particular way, add a function to generate it here.

Located in /ecdStd.inc.php (line 43)


	
			
Method Summary
string build_query_str (array $params)
string customer_listbox ([mixed $customer = null], [mixed $values = null], [mixed $name = 'customer'], string $fieldname)
void extract_phone (mixed $phone)
a first_page (mixed &$it, mixed $url, mixed $args, mixed $text)
void last_page (mixed &$it, mixed $url, mixed $args, mixed $text)
null link (mixed &$it, mixed $next, [mixed $offset = null], [mixed $count = null])
void method_listbox ([mixed $values = null], [mixed $onchange = null])
a navigation_bar (mixed &$it, mixed $url, mixed $args, [mixed $lang = 'en'])
void next_link (mixed &$it, [mixed $offset = null], [mixed $count = null])
a next_page (mixed &$it, mixed $url, mixed $args, mixed $text)
a numeric_links (mixed &$it, mixed $url, mixed $args, mixed $max_num_link)
void phone (mixed $region, mixed $main_1, mixed $main_2, [mixed $ext = null])
void prev_link (mixed &$it, [mixed $offset = null], [mixed $count = null])
a prev_page (mixed &$it, mixed $url, mixed $args, mixed $text)
the price (mixed $price, [mixed $UofM = null], [mixed $currency = null], [mixed $acronym = NULL])
void project_facture (mixed $proj, mixed $depth, [mixed $bounds = null])
void project_list (mixed $proj, mixed $depth)
string project_listbox ([mixed $customer = null], [mixed $values = null], [string $fieldname = 'parent'], [bool $empty_parent = false], [mixed $favorites_only = true])
void project_method ([mixed $method = 'a'], mixed $proj, mixed $depth)
void project_method_a (mixed $proj, mixed $depth)
void project_method_b (mixed $proj, mixed $depth)
void project_pref (mixed $proj, mixed $depth)
void project_punch (mixed $proj, mixed $depth)
void time_entry_table (mixed $bounds, [mixed $user = null])
void user_listbox (mixed $customer, [mixed $name = 'user'], [mixed $values = null])
Methods
build_query_str (line 126)

build a valid query string from an array

values that are arrays will be handled properly: their correpsonding keys are expected to be of the form array[]

  • return: a encoded query string
  • todo: allow empty values (without an equal sign)
string build_query_str (array $params)
  • array $params: a array of $key => value parameters
current_customer (line 640)
void current_customer ()
customer_listbox (line 614)

create a SELECT listbox to choose a customer in the ones allowed

  • return: a SELECT input field, with the project ids as values and the project name properly indented to create a tree as name. The customers are top-level objects with their names as values. To distinguish between the two, an underscore is prepended to the customer.
  • uses: form_select()
string customer_listbox ([mixed $customer = null], [mixed $values = null], [mixed $name = 'customer'], string $fieldname)
  • mixed $customer:

    if given, the list of customers to create the tree for. defaults to User::allowed_customers_arr().

    If not given or null, all the customers accessible to the currently logged-in user will be listed. If no user is currently logged in, the whole list is returned.

  • string $fieldname: the name of the SELECT tag
  • mixed $values: @see form_select(). defaults to $_POST
extract_phone (line 79)

extract the parts of a phone number formatted as in phone()

void extract_phone (mixed $phone)
first_page (line 176)
  • return: link to the first page.
  • static:
a first_page (mixed &$it, mixed $url, mixed $args, mixed $text)
last_page (line 189)
void last_page (mixed &$it, mixed $url, mixed $args, mixed $text)
link (line 262)

ease navigation through multiple pages

this returns the next offset based on the given offset and count, and based on wether we're looking for the next or previous link

next: new offset = offset + count prev: new offset = max(offset - count, 0)

  • return: if there's an overflow vs count() or 0
null link (mixed &$it, mixed $next, [mixed $offset = null], [mixed $count = null])
method_listbox (line 666)
void method_listbox ([mixed $values = null], [mixed $onchange = null])
navigation_bar (line 151)

Create a navigation bar from the given iterator

  • return:

    navigation bar for an ecdIterator that looks like this:

    Prev page | 1 | 2 | 3 | 4 | ... | 10 | Next Page >>

  • static:
a navigation_bar (mixed &$it, mixed $url, mixed $args, [mixed $lang = 'en'])
next_link (line 280)
  • see: link(true, ...)
void next_link (mixed &$it, [mixed $offset = null], [mixed $count = null])
next_page (line 215)
  • return: link to the next page.
  • static:
a next_page (mixed &$it, mixed $url, mixed $args, mixed $text)
numeric_links (line 229)
  • return: list of numeric links for an ecdIterator that looks like this:
    1. | 2 | 3 | 4 | 5 | ... | $max_num_link
  • static:
a numeric_links (mixed &$it, mixed $url, mixed $args, mixed $max_num_link)
phone (line 52)

Generate a phone number

Static function. Generates a phone number in a standard format: (rrr) nnn-nnnn [eee] The function makes no verification on the arguments it is fed.

void phone (mixed $region, mixed $main_1, mixed $main_2, [mixed $ext = null])
prev_link (line 287)
  • see: link(false, ...)
void prev_link (mixed &$it, [mixed $offset = null], [mixed $count = null])
prev_page (line 202)
  • return: link to the previous page.
  • static:
a prev_page (mixed &$it, mixed $url, mixed $args, mixed $text)
price (line 96)
  • return: price in a standard format: $ 111.11 [UofM]
  • static:
the price (mixed $price, [mixed $UofM = null], [mixed $currency = null], [mixed $acronym = NULL])
project_facture (line 423)
void project_facture (mixed $proj, mixed $depth, [mixed $bounds = null])
project_list (line 451)
void project_list (mixed $proj, mixed $depth)
project_listbox (line 324)

create a SELECT listbox for all the projects in the given customer

  • return: a SELECT input field, with the project ids as values and the project name properly indented to create a tree as name. The customers are top-level objects with their names as values. To distinguish between the two, an underscore is prepended to the customer.
  • uses: form_select()
  • uses: User::allowed_customers_arr()
string project_listbox ([mixed $customer = null], [mixed $values = null], [string $fieldname = 'parent'], [bool $empty_parent = false], [mixed $favorites_only = true])
  • mixed $customer:

    if given, the list of customers to create the tree for.

    Can be a string, in which case it is taken as a single customer, and the customer itself is not printed within the list.

    If not given or null, all the customers accessible to the currently logged-in user will be listed. If no user is currently logged in, the whole list is returned.

  • mixed $values: @see form_select()
  • string $fieldname: the name of the SELECT tag
  • bool $empty_parent: if the an empty parent tag must be created, false by default. if set to true, it will be set to the $customer. only appliable when $customer is not an array.
project_method (line 391)
void project_method ([mixed $method = 'a'], mixed $proj, mixed $depth)
project_method_a (line 415)
void project_method_a (mixed $proj, mixed $depth)
project_method_b (line 419)
void project_method_b (mixed $proj, mixed $depth)
project_pref (line 482)
void project_pref (mixed $proj, mixed $depth)
project_punch (line 361)
void project_punch (mixed $proj, mixed $depth)
time_entry_table (line 515)
void time_entry_table (mixed $bounds, [mixed $user = null])
user_listbox (line 655)
void user_listbox (mixed $customer, [mixed $name = 'user'], [mixed $values = null])

Documentation generated on Tue, 11 Jan 2005 01:38:23 -0500 by phpDocumentor 1.3.0RC3