$product_id = CValue::get('product_id'); $letter = CValue::getOrSession('letter', "%"); // Loads the stock in function of the stock ID or the product ID $stock = new CProductStockGroup(); // If stock_id has been provided, we load the associated product if ($stock_id) { $stock->stock_id = $stock_id; $stock->loadMatchingObject(); $stock->loadRefsFwd(); $stock->_ref_product->loadRefsFwd(); } else { if ($product_id) { $product = new CProduct(); $product->load($product_id); $stock->product_id = $product_id; $stock->_ref_product = $product; } else { $stock->loadRefsFwd(); } } $stock->updateFormFields(); // Loads the required Category and the complete list $category = new CProductCategory(); $list_categories = $category->loadList(null, 'name'); // Création du template $smarty = new CSmartyDP(); $smarty->assign('stock', $stock); $smarty->assign('category_id', $category_id); $smarty->assign('list_categories', $list_categories); $smarty->assign('letter', $letter); $smarty->display('vw_idx_stock_group.tpl');
* @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 19286 $ */ CCanDo::checkRead(); $keywords = CValue::get('keywords'); $category_id = CValue::get('category_id'); $selected_category = CValue::get('selected_category'); // Loads the required Category and the complete list $category = new CProductCategory(); $total = null; $count = null; if ($keywords) { $where = array(); $where['name'] = "LIKE '%{$keywords}%'"; $list_categories = $category->loadList($where, 'name', 20); $total = $category->countList($where); } else { $list_categories = $category->loadList(null, 'name'); $total = count($list_categories); } $count = count($list_categories); if ($total == $count) { $total = null; } // Création du template $smarty = new CSmartyDP(); $smarty->assign('list_categories', $list_categories); $smarty->assign('category_id', $category_id); $smarty->assign('selected_category', $selected_category); $smarty->assign('count', $count);
<?php /** * $Id$ * * @package Mediboard * @subpackage Stock * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkEdit(); $category_id = CValue::getOrSession('category_id'); // Loads the expected Category $category = new CProductCategory(); $category->load($category_id); // Categories list $list_categories = $category->loadList(); foreach ($list_categories as $_cat) { $_cat->countBackRefs("products"); } // Smarty template $smarty = new CSmartyDP(); $smarty->assign('category', $category); $smarty->assign('list_categories', $list_categories); $smarty->display('vw_idx_category.tpl');
} $function = CMbObject::loadFromGuid($function_guid); // Chargement des produits du livret therapeutique $produits_livret = CBcbProduit::loadRefLivretTherapeutique($function->_guid); $tabLettre = range('A', 'Z'); // --- Chargement de l'arbre ATC --- $codeATC = CValue::get("codeATC"); $classeATC = new CBcbClasseATC(); $chapitreATC = $codeATC ? $classeATC->getLibelle($codeATC) : ''; // Nom du chapitre selectionné $arbreATC = $classeATC->loadArbre($codeATC); // Chargements des sous chapitres $categories = array(); if (CModule::getActive("dPstock")) { $category = new CProductCategory(); $categories = $category->loadList(null, "name"); } // Création du template $smarty = new CSmartyDP(); $smarty->assign("listProduits", $listProduits); $smarty->assign("arbreATC", $arbreATC); $smarty->assign("codeATC", $codeATC); $smarty->assign("chapitreATC", $chapitreATC); $smarty->assign("lettre", $lettre); $smarty->assign("produits_livret", $produits_livret); $smarty->assign("tabLettre", $tabLettre); $smarty->assign("category_id", $category_id); $smarty->assign("categories", $categories); $smarty->assign("livret_cabinet", 1); $smarty->assign('functions', $functions); $smarty->assign("function_guid", $function_guid);