";
if (($empr_sort_rows)||($empr_show_rows)||($empr_filter_rows)) {
if ($pmb_lecteurs_localises) $localisation=",l";
$filter=new filter_list("empr","empr_list","b,n,c,g","b,n,c,g".$localisation.",2,3,cs","n,g");
if ($pmb_lecteurs_localises) {
$lo="f".$filter->fixedfields["l"]["ID"];
global $$lo;
if (!$$lo) {
$tableau=array();
$tableau[0]=$deflt2docs_location;
$$lo=$tableau;
}
}
$filter->fixedcolumns="b,n,c";
$filter->original_query=$requete;
$filter->multiple=1;
$filter->select_original="table_filter_tempo.empr_nb,empr_mail";
$filter->original_query="select id_empr,count(pret_idexpl) as empr_nb from empr,pret where pret_retourfrom_original="";
$filter->activate_filters();
if (!$filter->error) {
$t_filters = explode(",",$filter->filtercolumns);
foreach ($t_filters as $i=>$f) {
if ((substr($s[$i],0,1)=="#")&&($filter->params["REFERENCE"][0]["DYNAMICFIELDS"]=="yes")) {
//Faut-il adapter les champs perso ??
} elseif (array_key_exists($t_filters[$i],$filter->fixedfields)) {
$filters_selectors="f".$filter->fixedfields[$f]["ID"];
} else {
$filters_selectors="f".$filter->specialfields[$f]["ID"];
}
global $$filters_selectors;
if ($param[$filters_selectors]) {
$tableau=array();
foreach ($param[$filters_selectors] as $categ) {
$tableau[$categ] = $categ;
}
$$filters_selectors = $tableau;
}
}
$form_task .= "
".$filter->display_filters()."
";
$t_sort = explode(",",$filter->sortablecolumns);
//parcours des selecteurs de tris
for ($j=0;$j<=count($t_sort)-1;$j++) {
$sort_selector="sort_list_".$j;
global $$sort_selector;
if ($param[$sort_selector]) {
$$sort_selector = $param[$sort_selector];
}
}
$form_task .= "
".$filter->display_sort()."
";
} else {
$form_task .= $filter->error_message;
}
}
return $form_task;
}
function task_execution() {
global $dbh,$msg,$PMBusername,$pmb_lecteurs_localises,$empr_filter_rows,$empr_sort_rows,$empr_show_rows;
//& (RESTRICTCIRC_AUTH)
if (SESSrights & CIRCULATION_AUTH) {
//requete pour la construction du pdf
$rqt = "select distinct p.libelle_tache, p.rep_upload, p.path_upload from planificateur p
left join taches t on t.num_planificateur = p.id_planificateur
left join tache_docnum tdn on tdn.tache_docnum_repertoire=p.rep_upload
where t.id_tache=".$id_tache;
$res_query = mysql_query($rqt, $dbh);
$parameters = $this->unserialize_task_params();
if ($parameters["chk_loan"]) {
$option = $parameters["chk_loan"];
// $count = count($parameters["chk_loan"]);
// $percent = 0;
// $p_value = (int) 100/$count;
// foreach ($parameters["chk_loan"] as $elem) {
// $this->listen_commande(array(&$this, 'traite_commande')); //fonction a rappeller (traite commande)
// if($this->statut == WAITING) {
// $this->send_command(RUNNING);
// }
if ($this->statut == RUNNING) {
$this->report[] = "
".$this->msg["loan_relance"]."
";
$results=array();
if (method_exists($this->proxy, "pmbesLoans_filterLoansReaders")) {
$results[] = $this->proxy->pmbesLoans_filterLoansReaders("empr","empr_list","b,n,c,g","b,n,c,g,2,3,cs","n,g",$parameters);
$t_empr = array();
if ($results) {
foreach ($results as $result) {
$t_empr[] = $result["id_empr"];
}
//Au minimum 1 emprunteur dans le tableau pour poursuivre..
if (count($t_empr) > 0) {
//traitement des options choisies
switch ($option) {
case LOAN_ALL_ACTIONS :
//Comment connaître le niveau à valider ??
$this->report[] = "
".$this->msg["loan_all_actions"]."
";
foreach ($results as $result) {
if ($result["id_empr"] != "") {
// $this->proxy->fonction_pour_valider_action
}
}
break;
case LOAN_PRINT_MAIL :
$this->report[] = "