Support #67
General Functions
| Status: | New | Start: | 09/27/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | - | Spent time: | - | |
| Target version: | - | |||
| Resolution: |
Description
I have been working on the "Categories" features, and as I go, I am creating generalized functions for many of the tasks that we currently have a function for each field (i.e. formatting the <option> tags for Locations, Businesses, Categories, etc.) This will allow us to much more easily implement the "general inventory" features that we have been discussing.
For example, I made a function in lib/display.lib.php called get_options:
@/**
* get_options is used for formatting the <option>s of a <select> box.
*
* @param $tableName is the table from which to retrieve the values.
* @param $valueColumn value that will be <option value="here"> for each <option>
* @param $displayColumn value that will be <option>displayed here</option>
*
* @return formatted list of <option> tags.
**/
function get_options($tableName, $valueColumn, $displayColumn)@
This will allow us to generate these <select> boxes independent of the types of fields being stored.
History
Updated by Colin Sullivan 305 days ago
The "inline code" text formatting tool does nothing apparently...
Updated by Colin Sullivan 305 days ago
/** * get_options is used for formatting the <option>s of a <select> box. * * @param $tableName is the table from which to retrieve the values. * @param $valueColumn value that will be <option value="here"> for each <option> * @param $displayColumn value that will be <option>displayed here</option> * * @return formatted list of <option> tags. **/ function get_options($tableName, $valueColumn, $displayColumn)