Skip to content
Snippets Groups Projects
Commit 813667c6 authored by llaffont's avatar llaffont
Browse files

Cosmogramme, Web Services Koha: on peut spécifier la codification des statuts de disponibilité

parent dd634e3b
Branches
Tags 8.0.61
No related merge requests found
...@@ -6,6 +6,17 @@ define("APPLI","cosmogramme"); ...@@ -6,6 +6,17 @@ define("APPLI","cosmogramme");
define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs"); define("COSMOPATH", "/var/www/html/vhosts/opac2/www/htdocs");
define("CRLF", chr(13) . chr(10)); define("CRLF", chr(13) . chr(10));
define("BR","<br />"); define("BR","<br />");
define('COM_PERGAME', 1);
define('COM_OPSYS', 2);
define('COM_Z3950', 3);
define('COM_VSMART', 4);
define('COM_KOHA', 5);
define('COM_CARTHAME', 6);
define('COM_NANOOK', 7);
define('COM_ORPHEE', 8);
define('COM_MICROBIB', 9);
define('COM_BIBLIXNET', 10);
define('COM_DYNIX', 11);
if (!function_exists('xdebug_break')) { if (!function_exists('xdebug_break')) {
function xdebug_break(){}; function xdebug_break(){};
......
...@@ -29,17 +29,6 @@ require_once( "fonctions/objets_saisie.php"); ...@@ -29,17 +29,6 @@ require_once( "fonctions/objets_saisie.php");
require_once("classe_maj_auto.php"); require_once("classe_maj_auto.php");
require_once("classe_profil_donnees.php"); require_once("classe_profil_donnees.php");
define('COM_PERGAME', 1);
define('COM_OPSYS', 2);
define('COM_Z3950', 3);
define('COM_VSMART', 4);
define('COM_KOHA', 5);
define('COM_CARTHAME', 6);
define('COM_NANOOK', 7);
define('COM_ORPHEE', 8);
define('COM_MICROBIB', 9);
define('COM_BIBLIXNET', 10);
define('COM_DYNIX', 11);
$maj=new maj_auto(); $maj=new maj_auto();
$oProfil=new profil_donnees(); $oProfil=new profil_donnees();
...@@ -237,67 +226,5 @@ function getComboTypeDoc($valeur) ...@@ -237,67 +226,5 @@ function getComboTypeDoc($valeur)
return $champ_valeur; return $champ_valeur;
} }
// Blocs des parametres de communication avec le sigb
function getBlocsParams($id_bib,$type,$valeurs)
{
$valeurs=unserialize($valeurs);
$types=getCodifsVariable("comm_sigb");
foreach($types as $item)
{
$clef=$item["code"];
if($clef == $type) $display="block"; else $display="none";
$bloc.='<div id="comm_'.$id_bib.'_'.$clef.'" style="display:'.$display.'">';
// Parametres en fonction du type
unset($params);
unset($champs_params);
$titres[0]="Paramètres";
if (in_array($clef, array(COM_VSMART, COM_KOHA, COM_CARTHAME, COM_NANOOK, COM_ORPHEE, COM_MICROBIB, COM_BIBLIXNET)))
$champs_params[0]=array("url_serveur");
if ($clef==COM_KOHA) $champs_params[0]=["url_serveur","Interdire_reservation_doc_dispo"];
if ($clef==COM_OPSYS) $champs_params[0]=array("url_serveur", "catalogue_web");
if ($clef==COM_DYNIX) $champs_params[0]=array("url_serveur", "client_id");
if($clef==COM_Z3950) $champs_params[0]=array("url_serveur","login","password","nom_base"); // Serveur z39.50
if($clef==COM_PERGAME) //pergame
{
$titres=array("Règles de réservations","Règles de prolongations");
//$aide=array(BR."0=non, 1=oui");
$champs_params[0]=array("Autoriser_docs_disponibles","Max_par_carte","Max_par_document");
$champs_params[1]=array("Autoriser_prolongations","Interdire_si_reservation","Nombre_max_par_document","Duree_en_jours","Anteriorite_max_en_jours");
}
// valorisation
for($i=0;$i<count($champs_params);$i++)
{
if($champs_params[$i])
{
$num_aide=0;
$bloc.='<div style="margin-top:5px"><b>'.$titres[$i].'</b></div>';
$bloc.='<table>';
foreach($champs_params[$i] as $param)
{
if($clef == $type) $valeur=$valeurs[$param]; else $valeur="";
$bloc.='<tr><td class="form">'.$param.$aide[$num_aide].'</td><td class="form">'.getChamp("comp_".$clef."_".$param,$valeur,30).'</td></tr>';
$num_aide++;
}
$bloc.='</table>';
if ($clef==COM_NANOOK)
{
$bloc .= "Format(0.8.7): ip:port/chemin_tomcat/ilsdi/nom_base <br/>";
$bloc .= "Ex: 62.193.55.152:8080/afi_NanookWs/ilsdi/NANOOK <br/>";
$bloc .= sprintf("<a target='_blank' href='tester_comm_nanook.php?url=%s'>Tester la communication</a>",htmlspecialchars($valeurs['url_serveur']));
}
}
}
$bloc.='</div>';
}
return $bloc;
}
?> ?>
\ No newline at end of file
...@@ -83,4 +83,89 @@ function getTextarea($id,$valeur,$largeur,$hauteur) ...@@ -83,4 +83,89 @@ function getTextarea($id,$valeur,$largeur,$hauteur)
$champ.=$valeur.'</textarea>'; $champ.=$valeur.'</textarea>';
return $champ; return $champ;
} }
// Blocs des parametres de communication avec le sigb
function getBlocsParams($id_bib, $type, $valeurs)
{
$valeurs=unserialize($valeurs);
$types=getCodifsVariable("comm_sigb");
foreach($types as $item)
{
$clef=$item["code"];
if($clef == $type) $display="block"; else $display="none";
$bloc.='<div id="comm_'.$id_bib.'_'.$clef.'" style="display:'.$display.'">';
// Parametres en fonction du type
unset($params);
unset($champs_params);
$titres[0]="Paramètres";
if (in_array($clef, array(COM_VSMART, COM_KOHA, COM_CARTHAME, COM_NANOOK, COM_ORPHEE, COM_MICROBIB, COM_BIBLIXNET)))
$champs_params[0]=array("url_serveur");
if ($clef==COM_KOHA)
$champs_params[0]=[
"url_serveur",
"Interdire_reservation_doc_dispo",
["Codification_disponibilites" => function($id, $valeur){return getTextArea($id, $valeur, 30, 20);} ]
];
if ($clef==COM_OPSYS) $champs_params[0]=array("url_serveur", "catalogue_web");
if ($clef==COM_DYNIX) $champs_params[0]=array("url_serveur", "client_id");
if($clef==COM_Z3950) $champs_params[0]=array("url_serveur","login","password","nom_base"); // Serveur z39.50
if($clef==COM_PERGAME) //pergame
{
$titres=array("Règles de réservations","Règles de prolongations");
//$aide=array(BR."0=non, 1=oui");
$champs_params[0]=array("Autoriser_docs_disponibles","Max_par_carte","Max_par_document");
$champs_params[1]=array("Autoriser_prolongations","Interdire_si_reservation","Nombre_max_par_document","Duree_en_jours","Anteriorite_max_en_jours");
}
// valorisation
$defaultInputRenderer = function($id, $valeur) {
return getChamp($id, $valeur, 30);
};
for($i=0;$i<count($champs_params);$i++)
{
if($champs_params[$i])
{
$num_aide=0;
$bloc.='<div style="margin-top:5px"><b>'.$titres[$i].'</b></div>';
$bloc.='<table>';
foreach($champs_params[$i] as $param) {
$param_name = is_array($param) ? array_keys($param)[0] : $param;
$renderer = is_array($param) ? array_values($param)[0] : $defaultInputRenderer;
$valeur = $clef == $type ? $valeurs[$param_name] : '';
$bloc.=
'<tr>'
.'<td class="form">'.$param_name.$aide[$num_aide].'</td>'
.'<td class="form">'
.$renderer("comp_".$clef."_".$param_name,$valeur)
.'</td>'
.'</tr>';
$num_aide++;
}
$bloc.='</table>';
if ($clef==COM_NANOOK)
{
$bloc .= "Format(0.8.7): ip:port/chemin_tomcat/ilsdi/nom_base <br/>";
$bloc .= "Ex: 62.193.55.152:8080/afi_NanookWs/ilsdi/NANOOK <br/>";
$bloc .= sprintf("<a target='_blank' href='tester_comm_nanook.php?url=%s'>Tester la communication</a>",htmlspecialchars($valeurs['url_serveur']));
}
}
}
$bloc.='</div>';
}
return $bloc;
}
?> ?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment