<?php

/**
 * View Print Sources
 *  
 * @category PRINTING
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @version  SVN: $Id:$ 
 * @link     http://www.mediboard.org
 */
CCanDo::checkEdit();
$source_id = CValue::getOrSession("source_id", 0);
$class = CValue::getOrSession("class", "CSourceLPR");
$sources = array();
// Récupération des sources
$source_lpr = new CSourceLPR();
$sources = $source_lpr->loadlist();
$source_smb = new CSourceSMB();
$sources = array_merge($sources, $source_smb->loadlist());
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sources", $sources);
$smarty->assign("source_id", $source_id);
$smarty->assign("class", $class);
$smarty->display("inc_list_sources.tpl");
 *
 * @package    Mediboard
 * @subpackage Hospi
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$printer_id = CValue::getOrSession("printer_id", 0);
$printer = new CPrinter();
$printer->load($printer_id);
if ($printer->_id) {
    $printer->loadTargetObject();
}
$source = new CSourceLPR();
$sources = $source->loadlist();
if (!$sources) {
    $sources = array();
}
$source = new CSourceSMB();
$sources_smb = $source->loadlist();
if ($sources_smb) {
    $sources = array_merge($sources, $sources_smb);
}
$function = new CFunctions();
$order_by = "text";
$functions = $function->loadListWithPerms(PERM_READ, null, $order_by);
$smarty = new CSmartyDP();
$smarty->assign("printer", $printer);
$smarty->assign("sources", $sources);
$smarty->assign("functions", $functions);
$smarty->display("inc_edit_printer.tpl");