<?php

/**
 * $Id: edit_charge_price_indicator.php 19840 2013-07-09 19:36:14Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19840 $
 */
CCanDo::checkAdmin();
$charge_id = CValue::get("charge_id");
$charge = new CChargePriceIndicator();
$charge->load($charge_id);
$charge->loadRefsNotes();
if (!$charge->_id) {
    $charge->group_id = CGroups::loadCurrent()->_id;
}
$smarty = new CSmartyDP();
$smarty->assign("charge", $charge);
$smarty->display("inc_edit_charge_price_indicator.tpl");
 /**
  * Récupération du type d'activité, mode de traitement
  *
  * @param DOMNode $node     PV1 Node
  * @param CSejour $newVenue Admit
  *
  * @return void
  */
 function getChargePriceIndicator(DOMNode $node, CSejour $newVenue)
 {
     $PV1_21 = $this->queryTextNode("PV1.21", $node);
     $sender = $this->_ref_sender;
     if (!$PV1_21) {
         return;
     }
     $charge = new CChargePriceIndicator();
     $charge->code = $PV1_21;
     $charge->actif = 1;
     $charge->group_id = $sender->group_id;
     $charge->loadMatchingObject();
     // On affecte le type d'activité reçu sur le séjour
     $newVenue->charge_id = $charge->_id;
     // Type PEC
     $newVenue->type_pec = $charge->type_pec;
     // Si le type du séjour est différent de celui du type d'activité on modifie son type
     if ($charge->type && $charge->type != $newVenue->type) {
         $newVenue->type = $charge->type;
     }
 }
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$file = CValue::read($_FILES, "import");
$smarty = new CSmartyDP();
if (!$file) {
    $smarty->display("inc_import_mode_traitement_sejour.tpl");
    CApp::rip();
}
$group_id = CGroups::loadCurrent()->_id;
$csv = new CCSVFile($file["tmp_name"], CCSVFile::PROFILE_EXCEL);
$csv->readLine();
while ($line = $csv->readLine()) {
    list($code, $libelle, $type_sejour, $type_pec, $actif) = $line;
    $charge_price = new CChargePriceIndicator();
    $charge_price->code = $code;
    $charge_price->libelle = $libelle;
    $charge_price->type = $type_sejour;
    $charge_price->type_pec = $type_pec;
    $charge_price->group_id = $group_id;
    $charge_price->loadMatchingObject();
    $charge_price->actif = $actif;
    if ($msg = $charge_price->store()) {
        CAppUI::displayAjaxMsg($msg, UI_MSG_WARNING);
        continue;
    }
    CAppUI::displayAjaxMsg("importation terminée", UI_MSG_OK);
}
$smarty->display("inc_import_mode_traitement_sejour.tpl");
 /**
  * Get price indicator
  *
  * @param CSejour $sejour Admit
  *
  * @return string
  */
 function getModeTraitement(CSejour $sejour)
 {
     $charge = new CChargePriceIndicator();
     $charge->type = $sejour->type;
     if ($sejour->type_pec) {
         $charge->type_pec = $sejour->type_pec;
     }
     $charge->group_id = $sejour->group_id;
     $charge->actif = 1;
     $charge->loadMatchingObject();
     return $charge->code;
 }
Beispiel #5
0
<?php

/**
 * $Id$
 *  
 * @category dPplanningOp
 * @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();
$cpi = new CChargePriceIndicator();
$list_cpi = $cpi->loadGroupList();
$mode_entree = new CModeEntreeSejour();
$list_modes_entree = $mode_entree->loadGroupList();
$mode_sortie = new CModeSortieSejour();
$list_modes_sortie = $mode_sortie->loadGroupList();
$smarty = new CSmartyDP();
$smarty->assign("list_cpi", $list_cpi);
$smarty->assign("list_modes_entree", $list_modes_entree);
$smarty->assign("list_modes_sortie", $list_modes_sortie);
$smarty->display("vw_parametrage.tpl");
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage PlanningOp
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$group_id = CValue::get("group_id", CGroups::loadCurrent()->_id);
$type = CValue::get("type");
$selected_id = CValue::get("selected_id");
$cpi = new CChargePriceIndicator();
$cpi->group_id = $group_id;
$cpi->actif = 1;
if ($type) {
    $cpi->type = $type;
}
$cpi_list = $cpi->loadMatchingList("libelle");
$smarty = new CSmartyDP();
$smarty->assign("cpi_list", $cpi_list);
$smarty->assign("selected_id", $selected_id);
$smarty->display("inc_list_cpi.tpl");