/**
  * @see parent::getPerm()
  */
 function getPerm($permType)
 {
     if (!$this->_ref_category) {
         $this->loadRefsFwd();
     }
     return $this->_ref_category->getPerm($permType);
 }
$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');
<?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');
/**
 * $Id: httpreq_product_selector_categories_list.php 19286 2013-05-26 16:59:04Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage Stock
 * @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;
}
Esempio n. 5
0
    $function_guid = "CFunctions-" . CAppUI::$user->function_id;
}
$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);
/**
 * $Id: httpreq_product_selector_products_list.php 19286 2013-05-26 16:59:04Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage Stock
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19286 $
 */
CCanDo::checkRead();
$category_id = CValue::get('category_id');
$keywords = CValue::get('keywords');
$selected_product = CValue::get('selected_product');
$product = new CProduct();
$category = new CProductCategory();
$total = null;
$count = null;
$where_or = array();
$order = 'name, code';
//FIXME: changer en seek
if ($keywords) {
    foreach ($product->getSeekables() as $field => $spec) {
        $where_or[] = "`{$field}` LIKE '%{$keywords}%'";
    }
    $where = array();
    $where[] = implode(' OR ', $where_or);
    $where[] = "cancelled IS NULL OR cancelled = '0'";
    $list_products = $product->loadList($where, $order, 20);
    $total = $product->countList($where);
} else {
Esempio n. 7
0
<?php

/**
 * $Id: vw_export_stocks.php 28520 2015-06-05 09:16:23Z phenxdesign $
 *  
 * @category Stock
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision: 28520 $
 * @link     http://www.mediboard.org
 */
CCanDo::checkEdit();
$category_id = CValue::get("category_id");
$category = new CProductCategory();
$category->load($category_id);
CStoredObject::$useObjectCache = false;
$backrefs_tree = array("CProductCategory" => array("products"), "CProduct" => array('references', 'stocks_group', 'stocks_service'), "CProductReference" => array(), "CProductStockGroup" => array(), "CProductStockService" => array());
$fwdrefs_tree = array("CProduct" => array("category_id", "societe_id"), "CProductReference" => array("product_id", "societe_id"), "CProductStockGroup" => array("product_id", "group_id", "location_id"), "CProductStockService" => array("product_id", "object_id"), "CProductStockLocation" => array("group_id", "object_id"));
$export = new CMbObjectExport($category, $backrefs_tree);
$export->empty_values = false;
$export->setForwardRefsTree($fwdrefs_tree);
$export->streamXML();