function analyze_ass($rawass) { $cr = array("\r\n", "\r"); $ass_struct = array(); $current_section = ""; $rawass = delete_bom($rawass); $rawass = str_replace($cr, "\n", $rawass); $ass_lines = explode("\n", $rawass); foreach ($ass_lines as $line) { // print 'Check line: '.mb_convert_encoding($line, "SJIS-win","UTF-8" )."\r\n"; if ($section_name = is_section($line)) { $current_section = $section_name; } else { if (empty($current_section)) { $ass_struct[] = $line; } else { if (preg_match("/Styles/i", $current_section)) { $ass_struct[$current_section][] = analyze_ass_line_style($line); } else { if (preg_match("/Events/i", $current_section)) { $ass_struct[$current_section][] = analyze_ass_line_event($line); } else { $ass_struct[$current_section][] = $line; } } } } } return $ass_struct; }
if (!is_component_already_on_bom($_POST['component'], $_POST['workcentre_added'], $_POST['loc_code'], $selected_parent)) { add_bom($selected_parent, $_POST['component'], $_POST['workcentre_added'], $_POST['loc_code'], input_num('quantity')); display_notification(_("A new component part has been added to the bill of material for this item.")); $Mode = 'RESET'; } else { /*The component must already be on the bom */ display_error(_("The selected component is already on this bom. You can modify it's quantity but it cannot appear more than once on the same bom.")); } } else { display_error(_("The selected component is a parent of the current item. Recursive BOMs are not allowed.")); } } } //-------------------------------------------------------------------------------------------------- if ($Mode == 'Delete') { delete_bom($selected_id); display_notification(_("The component item has been deleted from this bom")); $Mode = 'RESET'; } if ($Mode == 'RESET') { $selected_id = -1; unset($_POST['quantity']); } //-------------------------------------------------------------------------------------------------- start_form(); start_form(false, true); start_table(TABLESTYLE_NOBORDER); start_row(); stock_manufactured_items_list_cells(_("Select a manufacturable item:"), 'stock_id', null, false, true); end_row(); if (list_updated('stock_id')) {