<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: catalog.inc.php,v 1.49.8.1 2025/06/12 09:13:53 rtigero Exp $

use Pmb\Docnums\Controller\DocnumsController;

if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) die("no access");

global $base_path, $class_path, $include_path, $pmb_indexation_lang, $pmb_prefill_cote, $pmb_javascript_office_editor;
global $categ, $msg, $id, $plugin,$sub;

$_SESSION["encodage_fic_source"]="";//On réinitialise l'encodage des fichiers d'entrées (pour z39-50 et connecteur)

require_once("$include_path/templates/catalog.tpl.php");
require_once("$include_path/isbn.inc.php");
require_once("$include_path/marc_tables/$pmb_indexation_lang/empty_words");
require_once("$class_path/marc_table.class.php");
require_once("$class_path/serie.class.php");
require_once("$class_path/indexint.class.php");
require_once("$class_path/author.class.php");
require_once("$class_path/subcollection.class.php");
require_once("$class_path/collection.class.php");
require_once("$class_path/editor.class.php");
require_once("$class_path/category.class.php");
require_once("$class_path/notice.class.php");
require_once("$class_path/serial_display.class.php");
require_once("$class_path/mono_display.class.php");
require_once("$class_path/expl.class.php");
require_once("$class_path/explnum.class.php");
require_once("$class_path/emprunteur.class.php");
require_once("$include_path/fields_empr.inc.php");
require_once("$include_path/datatype.inc.php");
require_once("$include_path/parser.inc.php");
require_once("$include_path/notice_authors.inc.php");
require_once("$include_path/notice_categories.inc.php");
require_once("$include_path/explnum.inc.php") ;
require_once("$include_path/expl_info.inc.php") ;
require_once("$include_path/bull_info.inc.php") ;
require_once("$include_path/resa_func.inc.php") ;
require_once($base_path."/catalog/expl/prix_expl.inc.php");
if ($pmb_prefill_cote) {
	require_once("./catalog/expl/$pmb_prefill_cote");
} else {
	require_once("./catalog/expl/custom_no_cote.inc.php");
}
if($pmb_javascript_office_editor){
	print $pmb_javascript_office_editor;
	print "<script type='text/javascript'>
        pmb_include('$base_path/javascript/tinyMCE_interface.js');
    </script>";
}

switch($categ) {
	case 'update':
		include('./catalog/notices/update_notice.inc.php');
		break;
	case 'notice_form':
		include('./catalog/notices/notice_form.inc.php');
		break;
	case 'isbd':
		include('./catalog/notices/isbd.inc.php');
		break;
	case 'expl_update':
		include('./catalog/expl/expl_update.inc.php');
		break;
	case 'expl_create':
		include('./catalog/expl/expl_create.inc.php');
		break;
	case 'edit_expl':
		include('./catalog/expl/edit_expl.inc.php');
		break;
	case 'create_form':
		include('./catalog/notices/create_form.inc.php');
		break;
	case 'modif':
		include('./catalog/notices/notice_form.inc.php');
		break;
	case 'create':
		include('./catalog/notices/notice_create.inc.php');
		break;
	case 'del_expl':
		include('./catalog/expl/del_expl.inc.php');
		break;
	case 'dupl_expl':
		include('./catalog/expl/dupl_expl.inc.php');
		break;
	case 'search':
		include('./catalog/notices/search/main.inc.php');
		break;
	case 'delete':
		include('./catalog/notices/notice_delete.inc.php');
		break;
	case 'serials':
		include('./catalog/serials/serial_main.inc.php');
		break;
	case 'caddie':
		include('./catalog/caddie/caddie.inc.php');
		break;
	case 'etagere':
		include('./catalog/etagere/main.inc.php');
		break;
	case 'z3950':
		include('./catalog/notices/notice_z3950_replace.inc.php');
		break;
	case 'last_records':
		include('./catalog/last_records.inc.php');
		break;
	case 'search_perso':
		include('./catalog/search_perso/main.inc.php');
		break;
	case 'remplace':
		include('./catalog/notices/notice_replace.inc.php');
		break;
	case 'duplicate':
		// routine de copie
		$notice = new notice($id);
		$notice->id=0 ;
		$notice->code="" ;
		$notice->duplicate_from_id = $id ;
		print pmb_bidi($notice->show_form()) ;
		break;
	case 'explnum_create':
		include('./catalog/explnum/explnum_create.inc.php');
		break;
	case 'explnum_update':
		include('./catalog/explnum/explnum_update.inc.php');
		break;
	case 'edit_explnum':
		include('./catalog/explnum/edit_explnum.inc.php');
		break;
	case 'explnum_associate':
		include('./catalog/explnum/explnum_associate.inc.php');
		break;
	case 'del_explnum':
		include('./catalog/explnum/del_explnum.inc.php');
		break;
	case 'sug' :
		//Création de suggestion
		include("./catalog/suggestions/make_sug.inc.php");
		break;
	case 'avis':
		include("./catalog/notices/avis.inc.php");
		break;
	case 'tags':
		include("./catalog/notices/tags.inc.php");
		break;
	case 'serialcirc_diff':
		include("./catalog/serialcirc_diff/serialcirc_diff.inc.php");
		break;
	case 'harvest':
		include("./catalog/harvest/harvest.inc.php");
		break;
	case 'plugin' :
		$plugins = plugins::get_instance();
		$file = $plugins->proceed("catalog",$plugin,$sub);
		if($file){
			include $file;
		}
		break;
	case 'contribution_area':
		include("./catalog/contribution_area/main.inc.php");
		break;
	case 'docnum_collections':
		$docnumController = new DocnumsController();
		$docnumController->proceed();
		break;
	default:
		include('./catalog/notices/search/main.inc.php');
		break;
}
