Source for file view.php
Documentation is available at view.php
* View a list of instruments that are available
* @author Stuart Prescott
* @copyright Copyright Stuart Prescott
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* path (bumblebee root)/inc/actions/view.php
/** Load ancillary functions */
require_once 'inc/typeinfo.php';
/** list of choices object */
require_once 'inc/formslib/anchortablelist.php';
/** translated string type */
require_once 'inc/formslib/bbstring.php';
require_once 'inc/actions/viewbase.php';
require_once 'inc/actions/bookinglist.php';
* View a list of instruments so the user can view and make bookings
* @param BumblebeeAuth $auth Authorisation object
* @param array $pdata extra state data from the call path
* Select which instrument for which the calendar should be displayed
$instrselect =
new AnchorTableList('Instrument', T_('Select which instrument to view'), 3);
$headings =
array(new bbString('name', T_('name')),
$instrselect->setTableHeadings($headings);
$instrselect->sortByHeadings(true, $this->PD);
$instrselect->sortByHref =
makeUrl('view', array($instrselect->sortbyKey =>
'__sortby__'));
$instrselect->connectDB('instruments',
array('id', 'name', 'longname', 'location')
$instrselect->connectDB('instruments',
array('id', 'name', 'longname', 'location'),
'userid='.
qw($this->auth->getEUID()),
array('permissions'=>
'instrid=id'));
$instrselect->hrefbase =
makeURL('calendar', array('instrid'=>
'__id__'));
$instrselect->setFormat('id', '%s', array('name'), ' %50.50s', array('longname'), ' %20.20s', array('location'));
echo
'<h2>' .
T_('Please select an instrument to view') .
'</h2>';
echo
$instrselect->display();
$list->tableCaption =
'<h2>' .
T_('My bookings') .
'</h2>';
$list->noneFoundNotice =
T_('You have no bookings between %s and %s.');
$list->user =
$this->auth->getEUID();
$list->tableCaption =
'<h2>' .
T_('My group\'s bookings') .
'</h2>';
$list->noneFoundNotice =
T_('Your group has no bookings between %s and %s.');
$userid =
$this->auth->getEUID();
$q =
"SELECT userprojects.projectid as projectid "
.
"FROM {$TABLEPREFIX}projectgroups AS projectgroups "
.
"LEFT JOIN {$TABLEPREFIX}userprojects AS userprojects "
.
"ON userprojects.projectid=projectgroups.projectid "
.
"WHERE userprojects.userid=".
qw($userid);
$projects[] =
$g['projectid'];
$list->projects =
$projects;
$list->tableCaption =
'<h2>' .
T_('My project\'s bookings') .
'</h2>';
$list->noneFoundNotice =
T_('Your project has no bookings between %s and %s.');
$userid =
$this->auth->getEUID();
$q =
"SELECT projectid FROM {$TABLEPREFIX}userprojects WHERE userid=".
qw($userid);
$projects[] =
$g['projectid'];
$list->projects =
$projects;
Documentation generated on Tue, 06 Mar 2007 10:02:11 +0000 by phpDocumentor 1.3.0