Ejemplo n.º 1
0
    protected function _printSummaryRows()
    {
        parent::_printSummaryRows();
        // care is needed here, because we don't print empty fields
        // but we still want to (potentially) print their headings and dividers.
        $showDivider = TRUE;
        // always show before first field
        $showHeading = '';
        $dummyField = new Custom_Field();
        foreach ($this->getCustomFields() as $fieldid => $fieldDetails) {
            $dummyField->populate($fieldid, $fieldDetails);
            if ($fieldDetails['divider_before']) {
                $showDivider = TRUE;
            }
            if (strlen($fieldDetails['heading_before'])) {
                $showHeading = $fieldDetails['heading_before'];
            }
            if (isset($this->_custom_values[$fieldid])) {
                if ($showHeading) {
                    ?>
					<tr
						<?php 
                    if ($showDivider) {
                        echo 'class="divider-before"';
                    }
                    ?>
					>
						<th colspan="2" class="center">
							<h4><?php 
                    echo ents($showHeading);
                    ?>
</h4>
						</th>
					</tr>
					<?php 
                    $showDivider = FALSE;
                }
                ?>
				<tr
					<?php 
                if ($showDivider) {
                    echo 'class="divider-before"';
                }
                ?>
				>
					<th><?php 
                echo ents($fieldDetails['name']);
                ?>
</th>
					<td>
						<?php 
                foreach ($this->_custom_values[$fieldid] as $j => $val) {
                    if ($j > 0) {
                        echo '<br />';
                    }
                    echo ents($dummyField->formatValue($val));
                }
                ?>
					</td>
				</tr>
				<?php 
                $showDivider = FALSE;
                $showHeading = '';
            }
        }
    }
Ejemplo n.º 2
0
    protected function _printSummaryRows()
    {
        parent::_printSummaryRows();
        $divided = FALSE;
        $dummyField = new Custom_Field();
        foreach ($this->getCustomFields() as $fieldid => $fieldDetails) {
            $dummyField->populate($fieldid, $fieldDetails);
            if (isset($this->_custom_values[$fieldid])) {
                ?>
				<tr <?php 
                if (!$divided) {
                    echo 'class="divider-before"';
                    $divided = TRUE;
                }
                ?>
>
					<th><?php 
                echo ents($fieldDetails['name']);
                ?>
</th>
					<td>
						<?php 
                foreach ($this->_custom_values[$fieldid] as $j => $val) {
                    if ($j > 0) {
                        echo '<br />';
                    }
                    echo ents($dummyField->formatValue($val));
                }
                ?>
					</td>
				</tr>
				<?php 
            }
        }
    }