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->add_section_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->add_section_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->add_section_report($this->msg["loan_print_mail"]); if(method_exists($this->proxy, "pmbesLoans_relanceLoansReaders")) { if(method_exists($this->proxy, "pmbesLoans_buildPdfLoansDelayReaders")) { if ($this->isUploadValide()) { $not_all_mail = $this->proxy->pmbesLoans_relanceLoansReaders($t_empr); if ($not_all_mail) { $object_fpdf = $this->proxy->pmbesLoans_buildPdfLoansDelayReaders($t_empr, "", ""); if ($object_fpdf) { $this->generate_docnum($object_fpdf,"application/pdf","pdf"); } } else { $this->add_content_report($this->msg["loan_no_letter"]); } } else { $this->add_content_report("Le chemin du répertoire d'upload est invalide ou protégé en écriture"); } } else { $this->add_function_rights_report("buildPdfLoansDelayReaders","pmbesLoans"); } } else { $this->add_function_rights_report("relanceLoansReaders","pmbesLoans"); } break; case LOAN_CSV_MAIL : $this->add_section_report($this->msg["loan_csv_mail"]); if (method_exists($this->proxy, "pmbesLoans_exportCSV")) { if ($this->isUploadValide()) { $content_csv = $this->proxy->pmbesLoans_exportCSV($t_empr); $this->generate_docnum($content_csv,"application/ms-excel","xls"); } else { $this->add_content_report("Le chemin du répertoire d'upload est invalide ou protégé en écriture"); } } else { $this->add_function_rights_report("exportCSV","pmbesLoans"); } break; } } else { $this->add_content_report($this->msg["loan_no_empr"]); } } } else { $this->add_function_rights_report("filterLoansReaders","pmbesLoans"); } } // $percent = $percent + $p_value; $percent = 100; $this->update_progression($percent); } else { $this->add_content_report("Aucune option choisie !"); } } else { $this->add_rights_bad_user_report(); } } }