function showTimeSheetBlock($lTSTID, $clsRpt, $tst, $lLabelWidth)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    openBlock('Time Sheet Template', strLinkEdit_TimeSheetTemplate($lTSTID, 'Edit time sheet template', true));
    echoT($clsRpt->openReport());
    // template ID
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Template ID:', $lLabelWidth) . $clsRpt->writeCell(str_pad($lTSTID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
    // Name
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Name:', $lLabelWidth) . $clsRpt->writeCell(htmlspecialchars($tst->strTSName)) . $clsRpt->closeRow());
    // Reporting Period
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Reporting Period:', $lLabelWidth) . $clsRpt->writeCell($tst->enumRptPeriod) . $clsRpt->closeRow());
    // First day of week
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('First Day of Week:', $lLabelWidth) . $clsRpt->writeCell(ts_util\strXlateDayofWeek($tst->lFirstDayOfWeek)) . $clsRpt->closeRow());
    // Time Granularity
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Time Granularity:', $lLabelWidth) . $clsRpt->writeCell($tst->enumGranularity . ' minutes') . $clsRpt->closeRow());
    // Time Format
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Time Format:', $lLabelWidth) . $clsRpt->writeCell(($tst->b24HrTime ? '24' : '12') . ' Hr. ') . $clsRpt->closeRow());
    // Visibility
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Visibility:', $lLabelWidth) . $clsRpt->writeCell($tst->bHidden ? 'Hidden' : 'Normal') . $clsRpt->closeRow());
    // Notes
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Notes:', $lLabelWidth) . $clsRpt->writeCell(nl2br(htmlspecialchars($tst->strNotes))) . $clsRpt->closeRow());
    echoT($clsRpt->closeReport());
    closeBlock();
}
$clsForm->strID = 'addEditEntry';
echoT($clsForm->strGenericTextEntry('Template Name', 'txtTemplateName', true, $formData->txtTemplateName, 30, 80));
if ($bNew) {
    // Time Period
    $clsForm->strExtraFieldText = form_error('ddlTP');
    echoT($clsForm->strLabelRow('Time Period', $formData->strTimePeriodDDL, 1));
    // Start of Week
    $clsForm->strExtraFieldText = '<i>Applies to weekly time periods</i><br>' . form_error('ddlStart');
    echoT($clsForm->strLabelRow('Start of Week', $formData->strStartSOWDDL, 1));
} else {
    // Time Period
    $clsForm->strStyleExtraLabel = 'padding-top: 3px;';
    echoT($clsForm->strLabelRow('Time Period', $tst->enumRptPeriod, 1));
    // Start of Week
    $clsForm->strExtraFieldText = '<br><i>(applies to weekly time periods)</i><br>';
    echoT($clsForm->strLabelRow('Start of Week', ts_util\strXlateDayofWeek($tst->lFirstDayOfWeek), 1));
    $clsForm->strStyleExtraLabel = 'padding-top: 6px;';
}
//------------------------
// Time Granularity
//------------------------
$clsForm->strExtraFieldText = form_error('ddlTimeGrain');
echoT($clsForm->strLabelRow('Time Granularity', $formData->strTimeGrainDDL, 1));
//------------------------
// 24 Hour Timeclock
//------------------------
$clsForm->strStyleExtraLabel = 'padding-top: 4px;';
$clsForm->strExtraFieldText = '&nbsp;<i>If checked, 4:42 PM will be displayed as 16:42.</i>';
echoT($clsForm->strGenericCheckEntry('24-Hour Time Display', 'chk24Hour', 'true', false, $formData->b24HrTime));
//------------------------
// Hidden?
function writeTSTTable($tst)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $lTSTID = $tst->lKeyID;
    if ($tst->strNotes != '') {
        $tst->strNotes = '<br>' . nl2br(htmlspecialchars($tst->strNotes));
    }
    if ($tst->bHidden) {
        $strHideStyle = 'color: #aaa;';
    } else {
        $strHideStyle = '';
    }
    $strProperties = '<table cellpadding="0" style="width: 100%;">
            <tr>
               <td style="width: 80pt;">
                  Reporting Period: 
               </td>
               <td style="">' . $tst->enumRptPeriod . '
               </td>
            </tr>
               <td style="width: 80pt;">
                  First day of Week: 
               </td>
               <td style="">' . ts_util\strXlateDayofWeek($tst->lFirstDayOfWeek) . '
               </td>
            </tr>
            <tr>
               <td >
                  Time Granularity: 
               </td>
               <td>' . $tst->enumGranularity . ' minutes
               </td>
            </tr>
            <tr>
               <td >
                  Time Format: 
               </td>
               <td>' . ($tst->b24HrTime ? '24' : '12') . ' Hr. 
               </td>
            </tr>
            <tr>
               <td >
                  Visibility: 
               </td>
               <td>' . ($tst->bHidden ? 'Hidden' : 'Normal') . '
               </td>
            </tr>
         </table>';
    echoT('
         <tr class="makeStripe">
            <td class="enpRpt" style="width: 50pt; text-align: center; ' . $strHideStyle . '">' . strLinkView_TimeSheetTemplateRecord($lTSTID, 'View time sheet template record', true) . '&nbsp;' . str_pad($lTSTID, 5, '0', STR_PAD_LEFT) . '
            </td>
            <td class="enpRpt" style="width: 20pt; ' . $strHideStyle . '">
               &nbsp;
            </td>
            <td class="enpRpt" style="width: 20pt; ' . $strHideStyle . '">
               &nbsp;
            </td>
            <td class="enpRpt" style="width: 200pt; ' . $strHideStyle . '"><b>' . htmlspecialchars($tst->strTSName) . '</b>' . $tst->strNotes . '
            </td>
            <td class="enpRpt" style="width: 150pt; ' . $strHideStyle . '">' . $strProperties . '
            </td>
         </tr>');
}