Profile::displayLifeCycleMatrix PHP Method

displayLifeCycleMatrix() public method

Display the matrix of the elements lifecycle of the elements
public displayLifeCycleMatrix ( $title, $html_field, $db_field, $statuses, $canedit ) : nothing
$title the kind of lifecycle
$html_field field that is sent to _POST
$db_field field inside the DB (to get current state)
$statuses all available statuses for the given cycle (obj::getAllStatusArray())
$canedit can we edit the elements ?
return nothing
    function displayLifeCycleMatrix($title, $html_field, $db_field, $statuses, $canedit)
    {
        $columns = array();
        $rows = array();
        foreach ($statuses as $index_1 => $status_1) {
            $columns[$index_1] = $status_1;
            $row = array('label' => $status_1, 'columns' => array());
            foreach ($statuses as $index_2 => $status_2) {
                $content = array('checked' => true);
                if (isset($this->fields[$db_field][$index_1][$index_2])) {
                    $content['checked'] = $this->fields[$db_field][$index_1][$index_2];
                }
                if ($index_1 == $index_2 || !$canedit) {
                    $content['readonly'] = true;
                }
                $row['columns'][$index_2] = $content;
            }
            $rows[$html_field . "[{$index_1}]"] = $row;
        }
        Html::showCheckboxMatrix($columns, $rows, array('title' => $title, 'row_check_all' => true, 'col_check_all' => true, 'first_cell' => '<b>' . __("From \\ To") . '</b>'));
    }