msg);
}
public function process($source_id, $pmb_user_id) {
global $opac_biblio_name,$opac_biblio_email;
global $biblio_name, $biblio_adr1, $biblio_adr2, $biblio_cp, $biblio_town, $biblio_state, $biblio_country, $biblio_phone, $biblio_email,$biblio_website;
global $biblio_logo;
$source = new bibloto_source($this, $source_id, $this->msg);
$param = $source->config;
$param['biblio']['name'] =$opac_biblio_name;
$param['biblio']['adr1'] =$biblio_adr1;
$param['biblio']['adr2'] =$biblio_adr2;
$param['biblio']['cp'] =$biblio_cp;
$param['biblio']['town'] =$biblio_town;
$param['biblio']['phone'] =$biblio_phone;
$param['biblio']['email'] =$opac_biblio_email;
if (!empty($param['auth_password'])) {
$param['auth_password'] = md5($param['auth_password']);
}
echo encoding_normalize::json_encode($param);
return;
}
}
class bibloto_source extends connecteur_out_source {
public function __construct($connector, $id, $msg) {
parent::__construct($connector, $id, $msg);
}
public function get_config_form() {
global $charset, $pmb_url_base, $_tableau_databases, $_libelle_databases;
$result = parent::get_config_form();
if(!$this->id){
$this->config['pmb_ws_url'] = "http://...pmb/ws/connector_out.php?source_id=1";
$this->config['auth_login'] = "";
$this->config['auth_password'] = "";
$this->config['auth_connexion_phrase'] = "";
$this->config['style_url'] = "styles/bibloto.css";
$this->config['checkout_activate'] = 1;
$this->config['auto_checkout'] = 1;
$this->config['checkin_activate'] = 1;
$this->config['resa_activate'] = 1;
$this->config['email_activate'] = 1;
$this->config['default_action'] = 1;
$this->config['default_action_end'] = 1;
$this->config['rfid_activate'] = 0;
$this->config['rfid_driver'] = "3m";
$this->config['rfid_activate_empr'] = 1;
$this->config['rfid_activate_expl'] = 1;
$this->config['rfid_serveur_url'] = "http://localhost:30000";
$this->config['rfid_library_code'] = "0123456789";
$this->config['rfid_afi_security_code_on'] = "07";
$this->config['rfid_afi_security_code_off'] = "C2";
$this->config['sound_activate'] = 1;
$this->config['trombinoscope_enabled'] = 0;
$this->config['thumbnail_url'] = 'http://website/thumbnails/!!empr_cb!!.jpg';
$this->config['rfid_security_activate'] = 1;
$this->config['printer_activate'] = 0;
$this->config['nb_jours_retard'] = 7;
$this->config['css'] = "";
$this->config['msg_dialog_checkout_no_all'] = 1;
$this->config['home_tpl']="
Automate de prêt
Placez votre carte de lecteur
";
$this->config['empr_tpl']=
"
\${nom} \${prenom}
\${adr1}
\${cp} \${ville}
";
$this->config['printer_tpl']=
"\x1B\x40\x1B\x21\x16{{biblio.name}}\x1B\x21\x04
{{biblio.adr1}}
{{biblio.town}}
{{biblio.phone}}
{{biblio.email}}
Imprimé le \n
Emprunteur:
{% for empr in empr_list %}
{{empr.name}} {{empr.fistname}}
{% endfor %}
{% for expl in expl_list %}
{{expl.tit}}
{{expl.cb}}
{{expl.location}} / {{expl.section}} / {{expl.cote}}
Prêté le {{expl.date_pret}}. \x1B\x21\x14 A retourner le{{expl.date_retour}} \x1B\x21\x04
______________________________________
{% endfor %}
\x1D\x56\x41 \x1B\x40";
$this->config['msg_checkout_button'] = $this->msg['bibloto_msg_checkout_button_value'];
$this->config['msg_checkout_valid_button'] = $this->msg['bibloto_msg_checkout_valid_button_value'];
$this->config['msg_checkin_button'] = $this->msg['bibloto_msg_checkin_button_value'];
$this->config['msg_resa_button'] = $this->msg['bibloto_msg_resa_button_value'];
$this->config['msg_email_button'] = $this->msg['bibloto_msg_email_button_value'];
$this->config['msg_exit_button'] = $this->msg['bibloto_msg_exit_button_value'];
$this->config['msg_action_title'] = $this->msg['bibloto_msg_action_title_value'];
$this->config['msg_checkout_title'] = $this->msg['bibloto_msg_checkout_title_value'];
$this->config['msg_checkin_title'] = $this->msg['bibloto_msg_checkin_title_value'];
$this->config['msg_resa_title'] = $this->msg['bibloto_msg_resa_title_value'];
$this->config['msg_resa_date_title'] = $this->msg['bibloto_msg_resa_date_title_value'];
$this->config['msg_resa_confirme_title'] = $this->msg['bibloto_msg_resa_confirme_title_value'];
$this->config['msg_expl_checkout_list_title'] = $this->msg['bibloto_msg_expl_checkout_list_title_value'];
$this->config['msg_expl_title'] = $this->msg['bibloto_msg_expl_title_value'];
$this->config['msg_expl_statut'] = $this->msg['bibloto_msg_msg_expl_statut_value'];
$this->config['msg_expl_date_checkout'] = $this->msg['bibloto_msg_expl_date_checkout_value'];
$this->config['msg_expl_date_checkin'] = $this->msg['bibloto_msg_expl_date_checkin_value'];
$this->config['msg_expl_rendu'] = $this->msg['bibloto_msg_expl_rendu_value'];
$this->config['msg_dialog_place_item_checkout'] = $this->msg['bibloto_msg_dialog_place_item_checkout_value'];
$this->config['msg_dialog_place_item_checkin'] = $this->msg['bibloto_msg_dialog_place_item_checkin_value'];
$this->config['msg_dialog_too_many_items'] = $this->msg['bibloto_msg_dialog_too_many_items_value'];
$this->config['msg_dialog_item_cb_unknown'] = $this->msg['bibloto_msg_dialog_item_cb_unknown_value'];
$this->config['msg_dialog_checkout_possible'] = $this->msg['bibloto_msg_dialog_item_cb_unknown_value'];
$this->config['msg_dialog_checkout_ok'] = $this->msg['bibloto_msg_dialog_checkout_ok_value'];
$this->config['msg_dialog_checkout_no'] = $this->msg['bibloto_msg_dialog_checkout_no_value'];
$this->config['msg_dialog_checkin_ok'] = $this->msg['bibloto_msg_dialog_checkin_ok_value'];
$this->config['msg_dialog_checkin_no_checkout'] = $this->msg['bibloto_msg_dialog_checkin_no_checkout_value'];
$this->config['msg_dialog_antivol_error'] = $this->msg['bibloto_msg_dialog_antivol_error_value'];
$this->config['msg_printer_exit'] = $this->msg['bibloto_msg_printer_exit_value'];
$this->config['msg_dialog_exit'] = $this->msg['bibloto_msg_dialog_exit_value'];
$this->config['msg_no_user_found'] = $this->msg['bibloto_msg_no_user_found_value'];
$this->config['msg_search_title'] = $this->msg['bibloto_msg_search_title_value'];
$this->config['timeout_disconnect'] = "60";
}
/*
".htmlentities($this->msg['bibloto_printer_activate_yes'],ENT_QUOTES,$charset)." config["printer_activate"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_printer_activate_no'],ENT_QUOTES,$charset)." config["printer_activate"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
*/
//Adresse d'utilisation
$result .= "
".htmlentities($this->msg['bibloto_checkout_activate_yes'],ENT_QUOTES,$charset)." config["checkout_activate"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_checkout_activate_no'],ENT_QUOTES,$charset)." config["checkout_activate"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_auto_checkout_yes'],ENT_QUOTES,$charset)." config["auto_checkout"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_auto_checkout_no'],ENT_QUOTES,$charset)." config["auto_checkout"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_checkin_activate_yes'],ENT_QUOTES,$charset)." config["checkin_activate"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_checkin_activate_no'],ENT_QUOTES,$charset)." config["checkin_activate"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_resa_activate_yes'],ENT_QUOTES,$charset)." config["resa_activate"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_resa_activate_no'],ENT_QUOTES,$charset)." config["resa_activate"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_email_activate_yes'],ENT_QUOTES,$charset)." config["email_activate"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_email_activate_no'],ENT_QUOTES,$charset)." config["email_activate"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_default_action_default'],ENT_QUOTES,$charset)." config["default_action"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_default_action_checkout'],ENT_QUOTES,$charset)." config["default_action"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_default_action_checkin'],ENT_QUOTES,$charset)." config["default_action"] == "2" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_default_action_resa'],ENT_QUOTES,$charset)." config["default_action"] == "3" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_default_action_default'],ENT_QUOTES,$charset)." config["default_action_end"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_default_action_end_home'],ENT_QUOTES,$charset)." config["default_action_end"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_sound_activate_yes'],ENT_QUOTES,$charset)." config["sound_activate"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_sound_activate_no'],ENT_QUOTES,$charset)." config["sound_activate"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_sound_activate_yes'],ENT_QUOTES,$charset)." config["trombinoscope_enabled"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_sound_activate_no'],ENT_QUOTES,$charset)." config["trombinoscope_enabled"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_rfid_activate_yes'],ENT_QUOTES,$charset)." config["rfid_activate"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_rfid_activate_no'],ENT_QUOTES,$charset)." config["rfid_activate"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_rfid_activate_empr_yes'],ENT_QUOTES,$charset)." config["rfid_activate_empr"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_rfid_activate_empr_no'],ENT_QUOTES,$charset)." config["rfid_activate_empr"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_rfid_activate_expl_yes'],ENT_QUOTES,$charset)." config["rfid_activate_expl"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_rfid_activate_expl_no'],ENT_QUOTES,$charset)." config["rfid_activate_expl"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_rfid_security_activate_yes'],ENT_QUOTES,$charset)." config["rfid_security_activate"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_rfid_security_activate_no'],ENT_QUOTES,$charset)." config["rfid_security_activate"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_msg_dialog_checkout_no_yes'],ENT_QUOTES,$charset)." config["msg_dialog_checkout_no_all"] == "1" ? "checked='checked' ": "")."style='vertical-align:bottom;' />
".htmlentities($this->msg['bibloto_msg_dialog_checkout_no_no'],ENT_QUOTES,$charset)." config["msg_dialog_checkout_no_all"] ? "checked='checked' ": "")."style='vertical-align:bottom;' />
";
/*
*/
return $result;
}
public function update_config_from_form() {
global $dbh;
global $pmb_ws_url;
global $auth_login;
global $auth_password;
global $auth_connexion_phrase;
global $style_url;
global $checkout_activate;
global $auto_checkout;
global $checkin_activate;
global $resa_activate;
global $email_activate;
global $printer_activate;
global $printer_name;
global $printer_tpl;
global $sound_activate;
global $trombinoscope_enabled;
global $thumbnail_url;
global $nb_jours_retard;
global $rfid_activate;
global $rfid_driver;
global $rfid_activate_empr ;
global $rfid_activate_expl;
global $rfid_serveur_url;
global $rfid_library_code;
global $rfid_security_activate;
global $rfid_afi_security_code_on ;
global $rfid_afi_security_code_off ;
global $msg_checkout_button;
global $msg_checkout_valid_button;
global $msg_checkin_button;
global $msg_resa_button;
global $msg_email_button;
global $msg_exit_button;
global $msg_action_title;
global $msg_checkout_title;
global $msg_checkin_title;
global $msg_resa_title;
global $msg_resa_date_title;
global $msg_resa_confirme_title;
global $msg_expl_checkout_list_title;
global $msg_expl_title;
global $msg_expl_statut;
global $msg_expl_date_checkout;
global $msg_expl_date_checkin;
global $msg_expl_rendu;
global $msg_dialog_place_item_checkout;
global $msg_dialog_place_item_checkin;
global $msg_dialog_too_many_items;
global $msg_dialog_item_cb_unknown;
global $msg_dialog_checkout_possible;
global $msg_dialog_checkout_no;
global $msg_dialog_checkout_no_all;
global $msg_dialog_checkout_ok;
global $msg_dialog_checkin_ok;
global $msg_dialog_checkin_no_checkout;
global $msg_dialog_antivol_error;
global $msg_printer_button;
global $msg_dialog_exit;
global $msg_no_user_found;
global $msg_search_title;
global $timeout_disconnect;
global $home_tpl;
global $empr_tpl;
global $default_action;
global $default_action_end;
global $css;
parent::update_config_from_form();
$this->config['pmb_ws_url'] = $pmb_ws_url;
$this->config['auth_login'] = $auth_login;
$this->config['auth_password'] = $auth_password;
$this->config['auth_connexion_phrase'] = stripslashes($auth_connexion_phrase);
$this->config['style_url'] = $style_url;
$this->config['checkout_activate'] = $checkout_activate;
$this->config['auto_checkout'] = $auto_checkout;
$this->config['checkin_activate'] = $checkin_activate;
$this->config['resa_activate'] = $resa_activate;
$this->config['email_activate'] = $email_activate;
$this->config['printer_activate'] = $printer_activate;
$this->config['printer_name'] = stripslashes($printer_name);
$this->config['printer_tpl'] = stripslashes($printer_tpl);
$this->config['default_action'] = $default_action;
$this->config['default_action_end'] = $default_action_end;
$this->config['sound_activate'] = $sound_activate;
$this->config['trombinoscope_enabled'] = $trombinoscope_enabled;
$this->config['thumbnail_url'] = $thumbnail_url;
$this->config['nb_jours_retard'] = $nb_jours_retard;
$this->config['rfid_activate'] = $rfid_activate;
$this->config['rfid_driver'] = $rfid_driver;
$this->config['rfid_activate_empr'] = $rfid_activate_empr;
$this->config['rfid_activate_expl'] = $rfid_activate_expl;
$this->config['rfid_serveur_url'] = $rfid_serveur_url;
$this->config['rfid_library_code'] = $rfid_library_code;
$this->config['rfid_afi_security_code_on'] = $rfid_afi_security_code_on;
$this->config['rfid_afi_security_code_off'] = $rfid_afi_security_code_off;
$this->config['rfid_security_activate'] = $rfid_security_activate;
$this->config['home_tpl'] = stripslashes($home_tpl);
$this->config['empr_tpl'] = stripslashes($empr_tpl);
$this->config['msg_checkout_button'] = stripslashes($msg_checkout_button);
$this->config['msg_checkout_valid_button'] = stripslashes($msg_checkout_valid_button);
$this->config['msg_checkin_button'] = stripslashes($msg_checkin_button);
$this->config['msg_resa_button'] = stripslashes($msg_resa_button);
$this->config['msg_email_button'] = stripslashes($msg_email_button);
$this->config['msg_printer_button'] = stripslashes($msg_printer_button);
$this->config['msg_exit_button'] = stripslashes($msg_exit_button);
$this->config['msg_action_title'] = stripslashes($msg_action_title);
$this->config['msg_checkout_title'] = stripslashes($msg_checkout_title);
$this->config['msg_checkin_title'] = stripslashes($msg_checkin_title);
$this->config['msg_resa_title'] = stripslashes($msg_resa_title);
$this->config['msg_resa_date_title'] = stripslashes($msg_resa_date_title);
$this->config['msg_resa_confirme_title'] = stripslashes($msg_resa_confirme_title);
$this->config['msg_expl_checkout_list_title'] = stripslashes($msg_expl_checkout_list_title);
$this->config['msg_expl_title'] = stripslashes($msg_expl_title);
$this->config['msg_expl_statut'] = stripslashes($msg_expl_statut);
$this->config['msg_expl_date_checkout'] = stripslashes($msg_expl_date_checkout);
$this->config['msg_expl_date_checkin'] = stripslashes($msg_expl_date_checkin);
$this->config['msg_expl_rendu'] = stripslashes($msg_expl_rendu);
$this->config['msg_dialog_place_item_checkout'] = stripslashes($msg_dialog_place_item_checkout);
$this->config['msg_dialog_place_item_checkin'] = stripslashes($msg_dialog_place_item_checkin);
$this->config['msg_dialog_too_many_items'] = stripslashes($msg_dialog_too_many_items);
$this->config['msg_dialog_item_cb_unknown'] = stripslashes($msg_dialog_item_cb_unknown);
$this->config['msg_dialog_checkout_possible'] = stripslashes($msg_dialog_checkout_possible);
$this->config['msg_dialog_checkout_ok'] = stripslashes($msg_dialog_checkout_ok);
$this->config['msg_dialog_checkout_no'] = stripslashes($msg_dialog_checkout_no);
$this->config['msg_dialog_checkout_no_all'] = stripslashes($msg_dialog_checkout_no_all);
$this->config['msg_dialog_checkin_ok'] = stripslashes($msg_dialog_checkin_ok);
$this->config['msg_dialog_checkin_no_checkout'] = stripslashes($msg_dialog_checkin_no_checkout);
$this->config['msg_dialog_antivol_error'] = stripslashes($msg_dialog_antivol_error);
$this->config['msg_dialog_exit'] = stripslashes($msg_dialog_exit);
$this->config['msg_no_user_found'] = stripslashes($msg_no_user_found);
$this->config['msg_search_title'] = stripslashes($msg_search_title);
$this->config['timeout_disconnect'] = $timeout_disconnect;
$this->config['css'] = $css;
return;
}
}