Source for file consumables.php
Documentation is available at consumables.php
* Edit/create/delete consumables
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* path (bumblebee root)/inc/actions/consumables.php
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
require_once 'inc/bb/consumable.php';
require_once 'inc/formslib/anchortablelist.php';
require_once 'inc/actions/actionaction.php';
* Edit/create/delete consumables
* @param BumblebeeAuth $auth Authorisation object
* @param array $pdata extra state data from the call path
if (! isset
($this->PD['id'])) {
} elseif (isset
($this->PD['delete'])) {
echo
"<br /><br /><a href='".
makeURL('consumables').
"'>"
.
T_('Return to consumables list').
"</a>";
function select($deleted=
false) {
$select->deleted =
$deleted;
$select->connectDB('consumables', array('id', 'name', 'longname'));
$select->list->prepend(array('-1', T_('Create new consumable')));
$select->list->append(array('showdeleted', T_('Show deleted consumables')));
$select->hrefbase =
makeURL('consumables', array('id'=>
'__id__'));
$select->setFormat('id', '%s', array('name'), ' %50.50s', array('longname'));
$consumable->update($this->PD);
$consumable->checkValid();
?
T_('Consumable created') :
T_('Consumable updated')),
STATUS_ERR =>
T_('Consumable could not be changed:').
' '.
$consumable->errorMessage
echo
$consumable->display();
if ($consumable->id <
0) {
$submit =
T_('Create new consumable');
$submit =
T_('Update entry');
$delete =
$consumable->isDeleted ?
T_('Undelete entry') :
T_('Delete entry');
echo
"<input type='submit' name='submit' value='$submit' />";
if ($delete) echo
"<input type='submit' name='delete' value='$delete' />";
echo
'<p>'.
sprintf(T_('<a href="%s">View listing</a> for selected consumable'),
makeURL('consume', array('consumableid'=>
$consumable->id, 'list'=>
1))).
"</p>\n";
STATUS_OK =>
$consumable->isDeleted ?
T_('Consumable undeleted')
:
T_('Consumable deleted'),
.
'<br/><br/>'.
$consumable->errorMessage
Documentation generated on Tue, 06 Mar 2007 10:01:07 +0000 by phpDocumentor 1.3.0