$c = 0;
    $task_number = 0;
    foreach ($job_tasks as $task_id => $task_data) {
        $task_number++;
        if (module_security::is_page_editable() && module_job::can_i('edit', 'Job Tasks')) {
            ?>

                    <tbody id="task_edit_<?php 
            echo $task_id;
            ?>
" style="display:none;" class="task_edit"></tbody>
                <?php 
        } else {
            $task_editable = false;
        }
        echo module_job::generate_task_preview($job_id, $job, $task_id, $task_data, false, array('from_quote' => isset($_REQUEST['from_quote_id'])));
        ?>

                <input type="hidden" name="job_task[new<?php 
        echo $task_number;
        ?>
][description]" value="<?php 
        echo htmlspecialchars($task_data['description']);
        ?>
">
                <input type="hidden" name="job_task[new<?php 
        echo $task_number;
        ?>
][long_description]" value="<?php 
        echo htmlspecialchars($task_data['long_description']);
        ?>
    $show_hours_summary = false;
    foreach ($job_tasks as $task_id => $task_data) {
        if ($task_data['manual_task_type'] < 0) {
            $job_tasks[$task_id]['manual_task_type'] = $job['default_task_type'];
        }
        if ($job_tasks[$task_id]['manual_task_type'] == _TASK_TYPE_HOURS_AMOUNT) {
            $show_hours_summary = true;
        }
        $task_number++;
        //module_security::is_page_editable() &&
        if (module_job::can_i('edit', 'Job Tasks')) {
            $task_editable = true;
        } else {
            $task_editable = false;
        }
        echo module_job::generate_task_preview($job_id, $job, $task_id, $task_data, $task_editable);
    }
    ?>

                        </tbody>
                        </table>
                        <?php 
    if ((int) $job_id > 0) {
        ?>
 <div id="job_summary"> <?php 
        echo module_job::generate_job_summary($job_id, $job, $show_hours_summary);
        ?>
 </div> <?php 
    }
    ?>