/** * @package Mediboard * @subpackage sante400 * @version $Revision: 19326 $ * @author SARL OpenXtrem * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html */ CCanDo::checkAdmin(); $marked = CValue::get("marked"); $action = CValue::get("action"); $type = CValue::get("type"); $types = $type == "all" ? CMouvFactory::getTypes() : array($type); $marked = CValue::get("marked"); $marked = $marked == "all" ? array("0", "1") : array($marked); foreach ($types as $_type) { $mouv = CMouvFactory::create($_type); if ($action == "count") { $mouv->loadLatest(); CAppUI::stepAjax("Latest available trigger for type '%s' is '%s' dating '%s'", UI_MSG_OK, $_type, $mouv->rec, $mouv->when); foreach ($marked as $_marked) { $count = $mouv->count($_marked); CAppUI::stepAjax("%s - %s : %s disponibles ", UI_MSG_OK, CAppUI::tr("CMouvement400-type-{$_type}"), CAppUI::tr("CMouvement400-marked-{$_marked}"), $count); } } if ($action == "obsolete") { $mouv->loadOldest(); CAppUI::stepAjax("Oldest available trigger for type '%s' is '%s' dating '%s'", UI_MSG_OK, $_type, $mouv->rec, $mouv->when); $count = $mouv->count(true, $mouv->rec); CAppUI::stepAjax("Counting '%s' obsolete marked triggers", $count ? UI_MSG_WARNING : UI_MSG_OK, $count); $max = 1000; $count = $mouv->markObsoleteTriggers($mouv->rec, $max);
} $marked = CValue::getOrSession("marked", "1"); $max = CValue::get("max", CAppUI::conf("sante400 nb_rows")); // Load mouvements $class = CValue::get("class"); $type = CValue::getOrSession("type"); $mouvs = array(); $count = 0; $procs = 0; if (!in_array($type, $types)) { $type = null; } // Mouvement type (or class) provided if ($type || $class) { // Mouvement construction by factory $mouv = $class ? new $class() : CMouvFactory::create($type); if (!$mouv) { CAppUI::stepMessage(UI_MSG_ERROR, "CMouvFactory-error-noclass", CValue::first($type, $class)); return; } // Initialisation d'un fichier de verrou $class = $mouv->class; $lock = new CMbLock("synchro_sante400/{$class}"); // Mouvements counting $count = $mouv->count($marked); // Mouvements loading /** @var CMouvement400[] $mouvs */ $mouvs = array(); if ($rec = CValue::get("rec")) { try { $mouv->load($rec);