Esempio n. 1
0
     $manufacturer_id = $new_manufacturer_id;
 }
 if (isset($searched_element) && get_class($searched_element) == 'Category') {
     $category_id = $searched_element->get_id();
 }
 if (isset($searched_element) && get_class($searched_element) == 'Footprint') {
     $footprint_id = $searched_element->get_id();
 }
 if (isset($searched_element) && get_class($searched_element) == 'Storelocation') {
     $storelocation_id = $searched_element->get_id();
 }
 if (isset($searched_element) && get_class($searched_element) == 'Manufacturer') {
     $manufacturer_id = $searched_element->get_id();
 }
 // dropdown lists -> generate lists
 $manufacturer_list = $root_manufacturer->build_html_tree($manufacturer_id, true, false);
 $category_list = $root_category->build_html_tree($category_id, true, false);
 $storelocation_list = $root_storelocation->build_html_tree($storelocation_id, true, false);
 $footprint_list = $root_footprint->build_html_tree($footprint_id, true, false);
 // the category ID is used for creating a new part (in *.tmpl file the latest DIV element)
 $html->set_variable('category_id', $category_id, 'integer');
 // dropdown lists -> set html variables
 $html->set_variable('manufacturer_list', $manufacturer_list, 'string');
 $html->set_variable('category_list', $category_list, 'string');
 $html->set_variable('storelocation_list', $storelocation_list, 'string');
 $html->set_variable('footprint_list', $footprint_list, 'string');
 // global/category stuff
 $category = new Category($database, $current_user, $log, $category_id);
 $html->set_variable('disable_footprints', $config['footprints']['disable'] || $category->get_disable_footprints(true), 'boolean');
 $html->set_variable('disable_manufacturers', $config['manufacturers']['disable'] || $category->get_disable_manufacturers(true), 'boolean');
 $html->set_variable('max_upload_filesize', ini_get('upload_max_filesize'), 'string');
Esempio n. 2
0
        if (is_object($selected_manufacturer)) {
            $parent_id = $selected_manufacturer->get_parent_id();
            $html->set_variable('id', $selected_manufacturer->get_id(), 'integer');
            $html->set_variable('name', $selected_manufacturer->get_name(), 'string');
            $html->set_variable('address', $selected_manufacturer->get_address(), 'string');
            $html->set_variable('phone_number', $selected_manufacturer->get_phone_number(), 'string');
            $html->set_variable('fax_number', $selected_manufacturer->get_fax_number(), 'string');
            $html->set_variable('email_address', $selected_manufacturer->get_email_address(), 'string');
            $html->set_variable('website', $selected_manufacturer->get_website(), 'string');
            $html->set_variable('auto_product_url', $selected_manufacturer->get_auto_product_url(NULL), 'string');
        } elseif ($action == 'add') {
            $parent_id = $new_parent_id;
        } else {
            $parent_id = 0;
        }
        $manufacturer_list = $root_manufacturer->build_html_tree($selected_id, true, false);
        $html->set_variable('manufacturer_list', $manufacturer_list, 'string');
        $parent_manufacturer_list = $root_manufacturer->build_html_tree($parent_id, true, true);
        $html->set_variable('parent_manufacturer_list', $parent_manufacturer_list, 'string');
    } catch (Exception $e) {
        $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
        $fatal_error = true;
    }
}
/********************************************************************************
 *
 *   Generate HTML Output
 *
 *********************************************************************************/
$reload_link = $fatal_error ? 'edit_manufacturers.php' : '';
// an empty string means that the...