Пример #1
0
<?php

/**
 * $Id$
 *  
 * @category ihe
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
$function = new CFunctions();
$functions = $function->loadList();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("functions", $functions);
$smarty->display("configure.tpl");
Пример #2
0
 /**
  * Load functions with permissions for given group, current group by default
  *
  * @param int    $permType Level of permission
  * @param int    $group_id Filter on group
  * @param string $type     Type of function
  *
  * @return CFunctions[] Found functions
  */
 static function loadFonctions($permType = PERM_READ, $group_id = null, $type = null, $name = "")
 {
     $group = CGroups::loadCurrent();
     $function = new CFunctions();
     $where = array();
     $where["actif"] = "= '1'";
     $where["group_id"] = "= '" . CValue::first($group_id, $group->_id) . "'";
     if ($type) {
         $where["type"] = "= '{$type}'";
     }
     if ($name) {
         $where["text"] = "LIKE '{$name}%'";
     }
     $order = "text";
     /** @var CFunctions[] $functions */
     $functions = $function->loadList($where, $order);
     CMbObject::filterByPerm($functions, $permType);
     // Group association
     foreach ($functions as $function) {
         $function->_ref_group = $group;
     }
     return $functions;
 }
 * @version    $Revision$
 */
CCanDo::checkAdmin();
$rule_id = CValue::get("rule_id");
$clone = CValue::get("clone", 0);
$rule_sectorisation = new CRegleSectorisation();
$rule_sectorisation->load($rule_id);
if ($clone) {
    $rule_sectorisation->_id = null;
}
//mediusers
$user = CMediusers::get();
$users = $user->loadPraticiens(PERM_EDIT);
//functions
$function = new CFunctions();
$functions = $function->loadList(null, "text");
//services
$service = new CService();
$services = $service->loadGroupList();
//services
$group = new CGroups();
$groups = $group->loadList();
//smarty
$smarty = new CSmartyDP();
$smarty->assign("rule", $rule_sectorisation);
$smarty->assign("clone", $clone);
$smarty->assign("user", $user);
$smarty->assign("users", $users);
$smarty->assign("functions", $functions);
$smarty->assign("services", $services);
$smarty->assign("groups", $groups);
Пример #4
0
if ($inactif == "0") {
    $where["actif"] = "= '1'";
}
$where["group_id"] = "= '{$group->_id}'";
$order = null;
if ($order_col == "text") {
    $order = "text {$order_way}";
}
if ($order_col == "type") {
    $order = "type {$order_way}, text ASC";
}
if ($filter) {
    $functions = $function->seek($filter, $where, "{$page}, {$step}", true, null, $order);
    $total_functions = $function->_totalSeek;
} else {
    $functions = $function->loadList($where, $order, "{$page}, {$step}");
    $total_functions = $function->countList($where);
}
foreach ($functions as $_function) {
    $_function->countBackRefs("users");
    $_function->countBackRefs("secondary_functions");
}
$function_id = CValue::getOrSession("function_id");
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("inactif", $inactif);
$smarty->assign("functions", $functions);
$smarty->assign("total_functions", $total_functions);
$smarty->assign("page", $page);
$smarty->assign("function_id", $function_id);
$smarty->assign("type", $type);