public function actionGetQueueAssignmentForm($id)
{
if (!($q = models\Queue::model()->findByPk($id))) {
throw new \CHttpException(404, 'Invalid queue id.');
}
$qs_svc = Yii::app()->service->getService(self::$QUEUESET_SERVICE);
$queueset = $qs_svc->getQueueSetForQueue($q->id);
if (!$this->checkQueueSetProcessAccess($queueset)) {
throw new \CHttpException(403, 'Not authorised to take ticket');
}
$template_vars = array('queue_id' => $id, 'patient_id' => null);
$p = new \CHtmlPurifier();
foreach (array('label_width' => 2, 'data_width' => 8) as $id => $default) {
$template_vars[$id] = @$_GET[$id] ? $p->purify($_GET[$id]) : $default;
}
// if this is for a ticket, then we pass the patient id through for any event creation links
if (@$_GET['ticket_id']) {
if (!($ticket = models\Ticket::model()->findByPk((int) $_GET['ticket_id']))) {
throw new \CHttpException(404, 'Invalid ticket id.');
}
$template_vars['patient_id'] = $ticket->patient_id;
}
$this->renderPartial('form_queueassign', $template_vars, false, false);
}