/** * Shows an overview of all pricelists * * Also processes requests for deleting one or more Pricelists. * @global array $_ARRAYLANG * @global ADOConnection $objDatabase Database connection object */ function view_pricelists() { global $_ARRAYLANG; self::$pageTitle = $_ARRAYLANG['TXT_PDF_OVERVIEW']; // Note that the "list_id" index may be set but empty in order to // create a new pricelist. if (isset($_REQUEST['list_id'])) { return self::view_pricelist_edit(); } PriceList::deleteByRequest(); self::$objTemplate->loadTemplateFile("module_shop_pricelist_overview.html"); self::$objTemplate->setGlobalVariable($_ARRAYLANG); $arrName = PriceList::getNameArray(); $i = 0; foreach ($arrName as $list_id => $name) { $url = PriceList::getUrl($list_id); //DBG::log("URL: $url"); self::$objTemplate->setVariable(array('SHOP_PRICELIST_ROWCLASS' => 'row' . (++$i % 2 + 1), 'SHOP_PRICELIST_ID' => $list_id, 'SHOP_PRICELIST_NAME' => contrexx_raw2xhtml($name), 'SHOP_PRICELIST_LINK_PDF' => "<a href='{$url}' target='_blank'" . " title='" . $_ARRAYLANG['TXT_DISPLAY'] . "'>{$url}</a>")); self::$objTemplate->parse('shop_pricelist'); } }