/**
  * Get a marked where clause
  * 
  * @return string SQL where clause
  */
 function getNewMarkedClause($marked, $max = 100)
 {
     $mark = new CTriggerMark();
     $mark->trigger_class = get_class($this);
     if ($marked) {
         $where["trigger_class"] = "= '{$mark->trigger_class}'";
         $where["done"] = "= '0'";
         $where["mark"] = "!= '========'";
         $marks = $mark->loadList($where, null, $max);
         $clause = "\n WHERE {$this->trigger_key_field} " . CSQLDataSource::prepareIn(CMbArray::pluck($marks, "trigger_number"));
     } else {
         $mark->loadMatchingObject("trigger_number DESC");
         $last_number = $mark->trigger_number ? $mark->trigger_number : 0;
         $clause = "\n WHERE {$this->trigger_key_field} > '{$last_number}'";
     }
     return $clause;
 }
Exemple #2
0
 */
CCanDo::checkRead();
$trigger_classes = CMouvFactory::getClasses();
// Selected mark
$mark = new CTriggerMark();
$mark->load(CValue::getOrSession("mark_id"));
// filtered marks
$filter = new CTriggerMark();
$where = array();
if ($filter->trigger_class = CValue::getOrSession("trigger_class")) {
    $where["trigger_class"] = "= '{$filter->trigger_class}'";
}
if ($filter->trigger_number = CValue::getOrSession("trigger_number")) {
    $where["trigger_number"] = "= '{$filter->trigger_number}'";
}
if ($filter->mark = CValue::getOrSession("mark")) {
    $where["mark"] = "= '{$filter->mark}'";
}
if ("" !== ($filter->done = CValue::getOrSession("done", ""))) {
    $where["done"] = "= '{$filter->done}'";
}
$count = $filter->countList($where);
$marks = $filter->loadList($where, "trigger_number DESC", 100);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("trigger_classes", $trigger_classes);
$smarty->assign("mark", $mark);
$smarty->assign("filter", $filter);
$smarty->assign("marks", $marks);
$smarty->assign("count", $count);
$smarty->display("view_marks.tpl");