> aucune info de gestion : liste simple define ('GESTION_INFO_GESTION', 1); // pour traitement des prévisions define ('LECTEUR_INFO_GESTION', 2); // pour affichage en fiche lecteur define ('EDIT_INFO_GESTION', 3); // pour affichage en édition function planning_list($idempr=0, $idnotice=0, $order="",$info_gestion=NO_INFO_GESTION) { global $dbh ; global $msg, $charset; global $montrerquoi, $f_loc ; global $current_module ; global $pdflettreresa_priorite_email_manuel; global $pmb_transferts_actif; global $pmb_lecteurs_localises; $aff_final = ""; switch ($info_gestion) { case GESTION_INFO_GESTION: if (!$montrerquoi) $montrerquoi='all' ; $url_gestion = "./circ.php?categ=resa_planning"; $aff_final .= "
" ; break; case LECTEUR_INFO_GESTION: break; case EDIT_INFO_GESTION: break; default: case NO_INFO_GESTION: break; } return $aff_final ; } switch ($info_gestion) { case GESTION_INFO_GESTION: break; case LECTEUR_INFO_GESTION: $url_gestion = "./circ.php?categ=pret"; $aff_final .= ""; break; case EDIT_INFO_GESTION: break; default: case NO_INFO_GESTION: break; } $aff_final .= "".htmlentities($msg['233'], ENT_QUOTES, $charset)." | ".htmlentities($msg['empr_nom_prenom'], ENT_QUOTES, $charset)." | ".($pmb_lecteurs_localises ? "".htmlentities($msg["empr_location"], ENT_QUOTES, $charset)." | " :""); break; case LECTEUR_INFO_GESTION: $aff_final .= "".htmlentities($msg['233'], ENT_QUOTES, $charset)." | "; break; default: case NO_INFO_GESTION: $aff_final .= "".htmlentities($msg['empr_nom_prenom'], ENT_QUOTES, $charset)." | ".($pmb_lecteurs_localises ? "".htmlentities($msg["empr_location"], ENT_QUOTES, $charset)." | " :""); break; } $aff_final .= "".htmlentities($msg['374'], ENT_QUOTES, $charset)." | ".htmlentities($msg['resa_planning_date_debut'], ENT_QUOTES, $charset)." | ".htmlentities($msg['resa_planning_date_fin'], ENT_QUOTES, $charset)." | "; switch ($info_gestion) { case GESTION_INFO_GESTION: $aff_final .= "".htmlentities($msg['resa_validee'], ENT_QUOTES, $charset)." | ".htmlentities($msg['resa_confirmee'], ENT_QUOTES, $charset)." | "; if ($pmb_transferts_actif=="1") $aff_final .= "" . $msg["resa_loc_retrait"] . " | "; $aff_final .= "".htmlentities($msg['resa_selectionner'], ENT_QUOTES, $charset)." | " ; break; case LECTEUR_INFO_GESTION: $aff_final .= "".htmlentities($msg['resa_validee'], ENT_QUOTES, $charset)." | ".htmlentities($msg['resa_confirmee'], ENT_QUOTES, $charset)." | "; if ($pmb_transferts_actif=="1") $aff_final .= "" . $msg["resa_loc_retrait"] . " | "; $aff_final .= "" . $msg["resa_suppr_th"] . " | " ; break; case EDIT_INFO_GESTION: $aff_final .= "".htmlentities($msg['resa_validee'], ENT_QUOTES, $charset)." | ".htmlentities($msg['resa_confirmee'], ENT_QUOTES, $charset)." | "; if ($pmb_transferts_actif=="1") $aff_final .= "" . $msg["resa_loc_retrait"] . " | "; break; default: case NO_INFO_GESTION: break; } $aff_final .= "|||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
".$link." | "; if (SESSrights & CIRCULATION_AUTH) $aff_final .= "empr_cb)."\">".htmlentities($data->empr_nom_prenom, ENT_QUOTES, $charset)." | "; else $aff_final .= "".htmlentities($data->empr_nom_prenom, ENT_QUOTES, $charset)." | "; if ($pmb_lecteurs_localises) $aff_final.= "".$data->location_libelle." | "; break; case LECTEUR_INFO_GESTION: if (SESSrights & CATALOGAGE_AUTH) $link = "".htmlentities($data->tit, ENT_QUOTES, $charset).""; else $link = htmlentities($data->tit, ENT_QUOTES, $charset); $aff_final.= "".$link." | "; break; default: case NO_INFO_GESTION: if (SESSrights & CIRCULATION_AUTH) $aff_final .= "empr_cb)."\">".htmlentities($data->empr_nom_prenom, ENT_QUOTES, $charset)." | "; else $aff_final .= "".htmlentities($data->empr_nom_prenom, ENT_QUOTES, $charset)." | "; if ($pmb_lecteurs_localises) $aff_final.= "".$data->location_libelle." | "; break; } $aff_final.= "".$data->aff_resa_date." | "; switch ($info_gestion) { case GESTION_INFO_GESTION: case LECTEUR_INFO_GESTION: $aff_final.= ""; if($data->resa_validee) { $aff_final.= "".$data->aff_resa_date_debut." | "; $aff_final.= "".$data->aff_resa_date_fin." | "; $aff_final.= "X | "; } else { $aff_final .= ""; $aff_final .= ""; $resa_date_debut = str_replace("-", "", $data->resa_date_debut); $aff_final .= ""; $aff_final .= "id_resa."¶m2=form_resa_date_debut_lib_".$data->id_resa."&auto_submit=NO&date_anterieure=YES&func_to_call=func_callback&id=".$data->id_resa."&sub_param1=1', 'resa_date_debut', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes'); \" value='".$data->aff_resa_date_debut."' name='form_resa_date_debut_lib_".$data->id_resa."'>"; $aff_final .= " | "; $aff_final .= ""; $aff_final .= ""; $resa_date_fin = str_replace("-", "", $data->resa_date_fin); $aff_final .= ""; $aff_final .= "id_resa."¶m2=form_resa_date_fin_lib_".$data->id_resa."&auto_submit=NO&date_anterieure=YES&func_to_call=func_callback&id=".$data->id_resa."&sub_param1=2', 'resa_date_fin', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" value='".$data->aff_resa_date_fin."' name='form_resa_date_fin_lib_".$data->id_resa."'>"; $aff_final .= " | "; $aff_final.= ""; } if($data->resa_confirmee) $aff_final.= " | X | "; else $aff_final.= ""; if ($pmb_transferts_actif=="1") { $loc_retrait = resa_planning_loc_retrait($data->id_resa); $rqt = "SELECT location_libelle FROM docs_location WHERE idlocation='".$loc_retrait."'"; $libloc = @mysql_result(mysql_query($rqt),0); $aff_final .= " | ".$libloc." | "; } break; case EDIT_INFO_GESTION: $aff_final.= "".$data->aff_resa_date_debut." | "; $aff_final.= "".$data->aff_resa_date_fin." | "; if($data->resa_validee) { $aff_final.= "X | "; } else { $aff_final.= ""; } if($data->resa_confirmee) { $aff_final.= " | X | "; } else { $aff_final.= ""; } if ($pmb_transferts_actif=="1") { $loc_retrait = resa_planning_loc_retrait($data->id_resa); $rqt = "SELECT location_libelle FROM docs_location WHERE idlocation='".$loc_retrait."'"; $libloc = @mysql_result(mysql_query($rqt),0); $aff_final .= " | ".$libloc." | "; } break; default: case NO_INFO_GESTION: $aff_final.= "".$data->aff_resa_date_debut." | "; $aff_final.= "".$data->aff_resa_date_fin." | "; break; } switch ($info_gestion) { case GESTION_INFO_GESTION: $aff_final .= "\n" ; break; case LECTEUR_INFO_GESTION: $aff_final .= "\n | id_resa."&id_empr=".$idempr."';\" /> | " ; break; case EDIT_INFO_GESTION: break; default: case NO_INFO_GESTION: break; } $aff_final.= "
".$msg['resa_planning_date_debut']." ".formatdate($resa_date_debut)." ".$msg['resa_planning_date_fin']." ".formatdate($resa_date_fin)." " ; if (!$resa['perimee']) { if ($resa['resa_validee']) $message_resa.= " ".$msg['resa_validee'] ; else $message_resa.= " ".$msg['resa_attente_validation']." " ; } else $message_resa.= " ".$msg['resa_overtime']." " ; $message_resa.= "" ; } return $message_resa; } function alert_empr_resa_planning($id_resa=0, $id_empr_concerne=0) { global $dbh; global $msg, $charset; global $PMBuserid, $PMBuseremail, $PMBuseremailbcc ; global $pdflettreresa_priorite_email ; global $pdflettreresa_before_list , $pdflettreresa_madame_monsieur, $pdflettreresa_after_list, $pdflettreresa_fdp; global $biblio_name, $biblio_email ; global $biblio_adr1, $biblio_adr2, $biblio_cp, $biblio_town, $biblio_phone ; global $pdflettreresa_priorite_email_manuel; if ($pdflettreresa_priorite_email_manuel==3) return ; $query = "select distinct "; $query.= "trim(notices.tit1) as tit, "; $query.= "date_format(resa_date_fin, '".$msg["format_date"]."') as aff_resa_date_fin, "; $query.= "date_format(resa_date_debut, '".$msg["format_date"]."') as aff_resa_date_debut, "; $query.= "empr_prenom, empr_nom, empr_cb, empr_mail "; $query.= "from resa_planning LEFT JOIN notices ON resa_idnotice = notices.notice_id, empr "; $query.= "where id_resa in (".$id_resa.") and resa_idempr=id_empr "; if ($id_empr_concerne) $query .= "and id_empr=$id_empr_concerne "; $result = mysql_query($query, $dbh); $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=".$charset."\n"; $var = "pdflettreresa_fdp"; eval ("\$pdflettreresa_fdp=\"".$$var."\";"); // le texte après la liste des ouvrages en résa $var = "pdflettreresa_after_list"; eval ("\$pdflettreresa_after_list=\"".$$var."\";"); // le texte avant la liste des ouvrages en réservation $var = "pdflettreresa_before_list"; eval ("\$pdflettreresa_before_list=\"".$$var."\";"); // le "Madame, Monsieur," ou tout autre truc du genre "Cher adhérent," $var = "pdflettreresa_madame_monsieur"; eval ("\$pdflettreresa_madame_monsieur=\"".$$var."\";"); while ($empr=mysql_fetch_object($result)) { $id_empr = $empr->id_empr ; if (($pdflettreresa_priorite_email_manuel==1 || $pdflettreresa_priorite_email_manuel==2) && $empr->empr_mail) { $to = $empr->empr_prenom." ".$empr->empr_nom." <".$empr->empr_mail.">"; $output_final = "" ; $texte_madame_monsieur=str_replace("!!empr_name!!", $empr->empr_nom,$pdflettreresa_madame_monsieur); $texte_madame_monsieur=str_replace("!!empr_first_name!!", $empr->empr_prenom,$texte_madame_monsieur); $output_final .= $texte_madame_monsieur.'