$html->set_loop('subdevices', $subdevices_loop); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate DeviceParts Table * *********************************************************************************/ if (!$fatal_error) { try { $device_parts = $device->get_parts(); // don't forget: $device_parts contains "DevicePart"-objects, not "Part"-objects!! $device_parts_loop = DevicePart::build_template_table_array($device_parts, 'device_parts'); $html->set_variable('device_parts_rowcount', count($device_parts), 'integer'); $html->set_variable('sum_price', $device->get_total_price(true, false), 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Set the rest of the HTML variables * *********************************************************************************/ $html->use_javascript(array('validatenumber', 'popup')); if (!$fatal_error) { // global stuff