get_profiles_form_list(array(), $selectorIndex);
break;
case 'get_licence_tooltip':
$id+=0;
print explnum_licence::get_explnum_licence_tooltip($id);
break;
case 'get_licence_as_pdf':
$id+=0;
print explnum_licence::get_explnum_licence_as_pdf($id);
break;
case 'get_licence_quotation':
$id+=0;
print explnum_licence::get_explnum_licence_quotation($id);
break;
case 'upload_docnum':
$protocol = $_SERVER["SERVER_PROTOCOL"];
$uploadDir = $base_path."/temp/";
switch ($fnc){
case 'upl':
if (is_dir($uploadDir)) {
if (is_writable($uploadDir)) {
$explnum = explnum::create_doc_from_file();
$link_expl = $explnum->get_display_link();
$link_expl = str_replace('!!analysis_id!!', $explnum->explnum_notice, $link_expl);
$link_expl = str_replace('!!bul_id!!', (isset($bul_id) ? $bul_id : ''), $link_expl);
print encoding_normalize::json_encode(
array(
'response' => show_explnum_per_notice($explnum->explnum_notice, $explnum->explnum_bulletin, $link_expl),
'title' => ''.$msg['explnum_docs_associes'].' ('.show_explnum_per_notice($explnum->explnum_notice, $explnum->explnum_bulletin, $explnum->get_display_link(),array(),true).')',
'bull_display' => (!empty($bul_id) ? get_analysis($bul_id) : '')
)
);
/**
* TODO: check explnum bulletin ou explnum notice
* Faire le traitement en fonction
*/
}else{
header($protocol.' 405 Method Not Allowed');
exit('Upload directory is not writable.');
}
}else{
header($protocol.' 404 Not Found');
exit('Upload directory does not exist.');
}
break;
case 'del':
break;
case 'resume':
break;
case 'getNumWrittenBytes':
break;
}
break;
case 'get_form':
//verification des droits de modification notice
$acces_m=1;
if ($gestion_acces_active==1 && $gestion_acces_user_notice==1) {
require_once("$class_path/acces.class.php");
$ac= new acces();
$dom_1= $ac->setDomain(1);
$acces_m = $dom_1->getRights($PMBuserid,$id,8);
}
if ($acces_m==0) {
error_message('', htmlentities($dom_1->getComment('mod_enum_error'), ENT_QUOTES, $charset), 1, '');
} else {
/**
* TODO: Créer une méthode statique dans la classe
* explnum permettant de retourner le bon lien de suppression
* suivant le type d'entité
*
*/
if(isset($bul_id)){ //Cas d'un bulletin
$deletion_link = "./catalog.php?categ=serials&sub=bulletinage&action=explnum_delete&bul_id=".$bul_id."&explnum_id=".$explnum_id;
}else{
$deletion_link = "./catalog.php?categ=del_explnum&id=$id&explnum_id=$explnum_id";
}
$nex = new explnum($explnum_id, $id, $bul_id);
print encoding_normalize::utf8_normalize($nex->explnum_form("./catalog.php?categ=explnum_update&sub=update&id=$explnum_id", "./catalog.php?categ=isbd&id=$id",$deletion_link));
}
break;
case 'update':
$acces_m=1;
if ($gestion_acces_active==1 && $gestion_acces_user_notice==1) {
require_once("$class_path/acces.class.php");
$ac= new acces();
$dom_1= $ac->setDomain(1);
$acces_m = $dom_1->getRights($PMBuserid,$f_notice,8);
}
if ($acces_m==0) {
if (!$f_explnum_id) {
print encoding_normalize::json_encode(
array(
'status' => false,
'message' => error_message('', htmlentities($dom_1->getComment('mod_noti_error'), ENT_QUOTES, $charset), 1, '')
)
);
} else {
print encoding_normalize::json_encode(
array(
'status' => false,
'message' => error_message('', htmlentities($dom_1->getComment('mod_enum_error'), ENT_QUOTES, $charset), 1, '')
)
);
}
}
$p_perso=new parametres_perso("explnum");
$nberrors=$p_perso->check_submited_fields();
if ($nberrors) {
print encoding_normalize::json_encode(
array(
'status' => false,
'message' => error_message_history($msg["notice_champs_perso"],$p_perso->error_message,1)
)
);
exit();
}
/*if($pmb_explnum_controle_doublons != 0){
//Si controle de dedoublonnage active
if (file_exists($base_path.'/temp/explnum_doublon_'.$f_notice)) {
// On supprime les doublons stockés inutilement
unlink($base_path.'/temp/explnum_doublon_'.$f_notice);
}
// En modification de document numérique, on ne dedoublonne pas
if(!$f_explnum_id) {
$signature = $explnum->gen_signature($_FILES['f_fichier']['tmp_name']);
if ($signature) {
$query = "select explnum_id, explnum_notice, explnum_bulletin, explnum_nom from explnum where explnum_signature = '".$signature."'";
$result = pmb_mysql_query($query, $dbh);
if ($dbls = pmb_mysql_num_rows($result)) {
$new_name = $base_path.'/temp/explnum_doublon_'.$f_notice;
move_uploaded_file($_FILES['f_fichier']['tmp_name'], $new_name);
$_FILES['f_fichier']['tmp_name'] = $new_name;
//affichage de l'erreur, en passant tous les param postes (serialise) pour l'eventuel forcage
$tab = new stdClass();
$tab->POST = $_POST;
$tab->GET = $_GET;
$tab->FILES = $_FILES;
$ret_url = htmlentities(serialize($tab), ENT_QUOTES, $charset);
print "