unserialize_task_params(); $percent = 0; // On traite les plus anciens en premier $query = "select id_mail from mails_waiting order mail_waiting_date"; $result = pmb_mysql_query($query); //progression $p_value = (int) 100/count(pmb_mysql_num_rows($result)); mail::set_server_configuration($parameters["scheduler_mails_waiting_server_configuration"]); while($row = pmb_mysql_fetch_object($result)) { $this->listen_commande(array(&$this,"traite_commande")); if($this->statut == WAITING) { $this->send_command(RUNNING); } if ($this->statut == RUNNING) { $mail = new mail($row->id_mail); $response = $mail->send(); if($response) { $this->add_content_report('Sent : '.$mail->get_to_name().' ('.$mail->get_to_mail().')'); } else { $this->add_content_report('No sent : '.$mail->get_to_name().' ('.$mail->get_to_mail().')'); } $percent += $p_value; $this->update_progression($percent); } } } else { $this->add_rights_bad_user_report(); } } }