/** * The QA stuff */ function raptor_form_get_postexam_info($form, &$form_state, $disabled, $myvalues, $supportEditMode = TRUE) { // information. $root = array('#type' => 'fieldset', '#title' => t('Post-Examination Notes'), '#attributes' => array('class' => array('data-entry2-area'))); //Show all the existing notes $q = db_select('raptor_form_qa', 'a'); $q->addField('a', 'rf_id'); $q->addField('a', 'user_id'); $q->addField('a', 'qa1_fl'); $q->addField('a', 'qa2_fl'); $q->addField('a', 'qa3_fl'); $q->addField('a', 'qa4_fl'); $q->addField('a', 'qa5_fl'); $q->addField('a', 'qa_notes_tx'); $q->addField('a', 'created_dt'); $q->condition('rf_id', $myvalues['guid']); $rf = $q->execute(); $myvalues = array(); if ($rf->rowCount() > 0) { $sHTML = "<table id='qa-notes'>"; $sHTML .= "<tr>"; $sHTML .= "<th width='20%'>Datetime</th>"; $sHTML .= "<th width='20%'>Author</th>"; $sHTML .= "<th>QA1</th>"; $sHTML .= "<th>QA2</th>"; $sHTML .= "<th>QA3</th>"; $sHTML .= "<th>QA4</th>"; $sHTML .= "<th>QA5</th>"; $sHTML .= "<th width='35%'>Notes</th>"; $sHTML .= "</tr>"; $nROW = 0; foreach ($rf as $row) { $nUID = $row->user_id; //$oOtherUser=UserInfo::lookupUserByUID( $nUID ); $theName = UserInfo::lookupUserNameByUID($nUID); $nROW += 1; $sHTML .= "<tr>"; $sHTML .= "<td width='20%'>" . $row->created_dt . "</td>"; $sHTML .= "<td width='20%'>" . $theName . "</td>"; //$sHTML.="<td>".$oOtherUser->name."<td>"; $sHTML .= "<td>" . ($row->qa1_fl == 1 ? '<b>Yes</b>' : 'No') . "</td>"; $sHTML .= "<td>" . ($row->qa2_fl == 1 ? '<b>Yes</b>' : 'No') . "</td>"; $sHTML .= "<td>" . ($row->qa3_fl == 1 ? '<b>Yes</b>' : 'No') . "</td>"; $sHTML .= "<td>" . ($row->qa4_fl == 1 ? '<b>Yes</b>' : 'No') . "</td>"; $sHTML .= "<td>" . ($row->qa5_fl == 1 ? '<b>Yes</b>' : 'No') . "</td>"; $sHTML .= "<td width='35%'>" . $row->qa_notes_tx . "</td>"; $sHTML .= "</tr>"; } $sHTML .= "</table>"; $root['qa_notes' . $nROW] = array('#markup' => $sHTML); } $oGrp1 = $root['postexam_fieldset_col1'] = array('#type' => 'fieldset'); $root['postexam_fieldset_col1']['postexam_qa_fieldset'] = array('#type' => 'fieldset', '#title' => t('QA Issues')); $root['postexam_fieldset_col1']['postexam_qa_fieldset']['postexam_qa_fl'] = array('#type' => 'checkboxes', '#options' => array('QA1' => t('QA1'), 'QA2' => t('QA2'), 'QA3' => t('QA3'), 'QA4' => t('QA4'), 'QA5' => t('QA5'))); $oGrp2 = $root['postexam_fieldset_col2'] = array('#type' => 'fieldset'); $root['postexam_fieldset_col2']['qa_notes_tx'] = array('#type' => 'textarea', '#title' => t('Post-Examination Notes'), '#disabled' => $disabled); $form['main_fieldset_bottom']['postexam_fieldset'] =& $root; return $form; }