<?php /** * dPbloc * * @category Bloc * @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(); $type_ressource_id = CValue::getOrSession("type_ressource_id"); $type_ressource = new CTypeRessource(); $type_ressource->group_id = CGroups::loadCurrent()->_id; /** @var CTypeRessource[] $type_ressources */ $type_ressources = $type_ressource->loadMatchingList("libelle"); foreach ($type_ressources as $_type_ressource) { $_type_ressource->loadRefsRessources(); } $smarty = new CSmartyDP(); $smarty->assign("type_ressource_id", $type_ressource_id); $smarty->assign("type_ressources", $type_ressources); $smarty->display("inc_list_type_ressources.tpl");
* @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::read(); $operation_id = CValue::get("operation_id"); $type_ressource_id = CValue::get("type_ressource_id"); $date = CValue::get("date"); $besoin_ressource_id = CValue::get("besoin_ressource_id"); $usage_ressource_id = CValue::get("usage_ressource_id"); $usage = CValue::get("usage"); $operation = new COperation(); $operation->load($operation_id); $operation->loadRefPlageOp(); $debut_op = $operation->_datetime_best; $type_ressource = new CTypeRessource(); $type_ressource->load($type_ressource_id); $ressources = $type_ressource->loadRefsRessources(); if (!$date) { $date = CMbDT::date($debut_op); } $date_min = $date . " 00:00:00"; $date_max = CMbDT::date("+1 day", $date) . " 00:00:00"; $min_fin_op = min($date_max, CMbDT::addDateTime($operation->temp_operation, $debut_op)); $date_before = CMbDT::date("-1 day", $date); $date_after = CMbDT::date("+1 day", $date); $date_temp = $date_min; $hours = array(); while ($date_temp < $date_max) { $hours[] = $date_temp; $date_temp = CMbDT::dateTime("+1 hour", $date_temp);
<?php /** * dPbloc * * @category Bloc * @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(); $type_ressource_id = CValue::getOrSession("type_ressource_id"); $type_ressource = new CTypeRessource(); $type_ressource->load($type_ressource_id); if (!$type_ressource->_id) { $type_ressource->group_id = CGroups::loadCurrent()->_id; } $smarty = new CSmartyDP(); $smarty->assign("type_ressource", $type_ressource); $smarty->display("inc_edit_type_ressource.tpl");
/** * $Id$ * * @package Mediboard * @subpackage dPbloc * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkEdit(); $indispo_ressource_id = CValue::getOrSession("indispo_ressource_id"); $date_indispo = CValue::getOrSession("date_indispo", CMbDT::date()); $date_min = CMbDT::format($date_indispo, "%Y-%m-01"); $date_max = CMbDT::date("-1 day", CMbDT::date("+1 month", $date_min)); $group_id = CGroups::loadCurrent()->_id; $type_ressource = new CTypeRessource(); $where = array("group_id" => "= '{$group_id}'"); /** @var CTypeRessource[] $types_ressources */ $types_ressources = $type_ressource->loadList($where); $ressources = array(); $indispos = array(); foreach ($types_ressources as $_type_ressource) { $ressources[$_type_ressource->_id] = $_type_ressource->loadRefsRessources(); foreach ($ressources[$_type_ressource->_id] as $_ressource) { $indispo = new CIndispoRessource(); $where = array(); $where["deb"] = "<= '{$date_max}'"; $where["fin"] = " >= '{$date_min}'"; $where["ressource_materielle_id"] = "= '{$_ressource->_id}'"; $indispos[$_ressource->_id] = $indispo->loadList($where); }