Source for file costs.php
Documentation is available at costs.php
* Edit and create costs for using instruments
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* path (bumblebee root)/inc/actions/costs.php
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
require_once 'inc/bb/costs.php';
require_once 'inc/formslib/anchortablelist.php';
require_once 'inc/actions/actionaction.php';
* Edit and create costs for using instruments
* Costs for instrument usage are calculated using a matrix of the instrument class
* and the user class. See { @link http://bumblebeeman.sf.net/ } for further details.
* @param BumblebeeAuth $auth Authorisation object
* @param array $pdata extra state data from the call path
if (! isset
($this->PD['userclass'])) {
echo
"<br /><br /><a href='".
makeURL('costs').
"'>"
.
T_('Return to costs list') .
"</a><br /><br />";
echo
"<a href='".
makeURL('specialcosts').
"'>"
.
T_('Edit special costs') .
"</a><br />";
echo
"<a href='".
makeURL('instrumentclass').
"'>"
.
T_('Edit instrument classes') .
"</a><br />";
echo
"<a href='".
makeURL('userclass').
"'>"
.
T_('Edit user classes') .
"</a><br />";
// function mungeInputData() {
// foreach ($_POST as $k => $v) {
// if (isset($this->PDATA[1]) && ! empty($this->PDATA[1])) {
// $this->PD['userclass'] = $this->PDATA[1];
// echoData($this->PD, 0);
* Generate an HTML form for the user to select which class of user to edit costs
* - do DB look-ups on what instruments exist
* - construct a table of links to allow the user to select which userclass to edit
$select =
new AnchorTableList(T_('Cost'), T_('Select which user class to view usage costs'), 1);
$select->connectDB('userclass', array('id', 'name'));
//$select->list->prepend(array("-1","Create new user class"));
$select->hrefbase =
makeURL('costs', array('userclass'=>
'__id__'));
$select->setFormat('id', '%s', array('name'));
//echo $select->list->text_dump();
* Sync the user's changes with the db and provide feedback
$classCost->update($this->PD);
$classCost->checkValid();
?
T_('Cost schedule created')
:
T_('Cost schedule updated')),
STATUS_ERR =>
T_('Cost schedule could not be changed:').
' '.
$classCost->errorMessage
echo
$classCost->display();
echo
'<input type="submit" name="submit" value="'.
T_('Update entry').
'" />';
Documentation generated on Tue, 06 Mar 2007 10:01:09 +0000 by phpDocumentor 1.3.0