// affichage de la liste collections pour sélection // nombre de références par pages if ($nb_per_page_collection != "") { $nb_per_page = $nb_per_page_collection; } else { $nb_per_page = 10; } // initialisation variables $nav_bar = ''; $collection_list = ''; // traitement de la saisie utilisateur include "{$include_path}/marc_tables/{$pmb_indexation_lang}/empty_words"; require_once $class_path . "/analyse_query.class.php"; if ($user_input) { //a priori pas utile. Armelle $clef = reg_diacrit($user_input); } // $collection_list_tmpl : template pour la liste editeurs $collection_list_tmpl = "\n<br />\n<br />\n<div class='row'>\n\t<h3><! --!!nb_autorite_found!!-- >{$msg['173']} !!cle!! </h3>\n\t</div>\n\t<script type='text/javascript' src='./javascript/sorttable.js'></script>\n\t<table class='sortable'>\n\t\t!!list!!\n\t</table>\n<div class='row'>\n\t!!nav_bar!!\n\t</div>\n"; function list_collection($coll, $collection_list, $nav_bar) { global $collection_list_tmpl; global $charset; $collection_list_tmpl = str_replace("!!cle!!", $coll, $collection_list_tmpl); $collection_list_tmpl = str_replace("!!list!!", $collection_list, $collection_list_tmpl); $collection_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $collection_list_tmpl); collection::search_form(); print pmb_bidi($collection_list_tmpl); } // on récupére le nombre de lignes qui vont bien if (!$nbr_lignes) {
switch ($environement['output_docnum']) { case 'singly': foreach ($explnum_list as $explnum) { print "<script type='text/javascript'>\n\t\t\t\t\t\twindow.open('" . $pmb_url_base . "doc_num_data.php?explnum_id=" . $explnum->explnum_id . "&force_download=1','_blank','');\n\t\t\t\t\t\t</script>"; } break; case 'zip': $zip = new ZipArchive(); $filename = microtime(); $filename = str_replace(".", "", $filename); $filename = str_replace(" ", "", $filename); $filename = "temp/pmb_" . $filename . ".zip"; $res = $zip->open($filename, ZipArchive::CREATE); if ($res) { foreach ($explnum_list as $explnum) { $zip->addFromString(reg_diacrit(basename($explnum->path)), file_get_contents($opac_url_base . "doc_num_data.php?explnum_id=" . $explnum->explnum_id)); } $zip->close(); header("Content-disposition: attachment; filename=\"" . basename($filename) . "\""); header("Content-Type: application/force-download"); header("Content-Transfer-Encoding: application/zip"); header("Content-Length: " . filesize($filename)); header("Pragma: no-cache"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public"); header("Expires: 0"); $fp = fopen($filename, 'rb'); fpassthru($fp); fclose($fp); @unlink($filename); } break;
function analyze_query($query) { // Armelle - a priori plus utilisé // déterminer si la requête est une regexp // si c'est le cas, on utilise la saisie utilisateur sans modification // (on part du principe qu'il sait ce qu'il fait) if (preg_match('/\\^|\\$|\\[|\\]|\\.|\\*|\\{|\\}|\\|\\+/', $query)) { // traitement des caractères accentués $query = preg_replace('/[àáâãäåÀÁÂÃÄÅ]/', 'a', $query); $query = preg_replace('/[éèêëÈÉÊË]/', 'e', $query); $query = preg_replace('/[ìíîïÌÍÎÏ]/', 'i', $query); $query = preg_replace('/[òóôõöÒÓÔÕÖ]/', 'o', $query); $query = preg_replace('/[ùúûüÙÚÛÜ]/', 'u', $query); $query = preg_replace('/[çÇ]/m', 'c', $query); return $query; } else { return reg_diacrit($query); } }
function doc_num_gen_list($id_notices) { global $msg, $dbh, $gestion_acces_active, $gestion_acces_empr_notice; global $opac_allow_download_docnums, $opac_url_base; if (!$opac_allow_download_docnums) { return; } $explnum_list = array(); foreach ($id_notices as $notice_id) { $query = "SELECT explnum_id from explnum where explnum_notice={$notice_id} "; $query .= " union "; $query .= " select explnum_id from explnum ,bulletins where explnum_bulletin=bulletin_id and num_notice={$notice_id} "; $result = pmb_mysql_query($query, $dbh); if ($result) { while ($row = pmb_mysql_fetch_object($result)) { $explnum_id = $row->explnum_id; $res = pmb_mysql_query("SELECT explnum_id, explnum_notice, explnum_bulletin, explnum_nom, explnum_mimetype, explnum_url, explnum_data, length(explnum_data) as taille,explnum_path, concat(repertoire_path,explnum_path,explnum_nomfichier) as path, repertoire_id FROM explnum left join upload_repertoire on repertoire_id=explnum_repertoire WHERE explnum_id = '{$explnum_id}' ", $dbh); $ligne = pmb_mysql_fetch_object($res); $id_for_rigths = $ligne->explnum_notice; if ($ligne->explnum_bulletin != 0) { //si bulletin, les droits sont rattachés à la notice du bulletin, à défaut du pério... $req = "select bulletin_notice,num_notice from bulletins where bulletin_id =" . $ligne->explnum_bulletin; $res = pmb_mysql_query($req, $dbh); if (pmb_mysql_num_rows($res)) { $r = pmb_mysql_fetch_object($res); $id_for_rigths = $r->num_notice; if (!$id_for_rigths) { $id_for_rigths = $r->bulletin_notice; } } } //droits d'acces emprunteur/notice if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) { $ac = new acces(); $dom_2 = $ac->setDomain(2); $rights = $dom_2->getRights($_SESSION['id_empr_session'], $id_for_rigths); } //Accessibilité des documents numériques aux abonnés en opac $req_restriction_abo = "SELECT explnum_visible_opac, explnum_visible_opac_abon ,notice_id FROM notice_statut, explnum, notices WHERE explnum_notice=notice_id AND statut=id_notice_statut AND explnum_id='{$explnum_id}' "; $res_restriction_abo = pmb_mysql_query($req_restriction_abo, $dbh); if (!pmb_mysql_num_rows($res_restriction_abo)) { // bulletin $req_restriction_abo = "SELECT explnum_visible_opac, explnum_visible_opac_abon,notice_id\n\t\t\t\t\t\tFROM notice_statut, explnum, bulletins, notices\n\t\t\t\t\t\tWHERE explnum_bulletin = bulletin_id\n\t\t\t\t\t\tAND num_notice = notice_id\n\t\t\t\t\t\tAND statut = id_notice_statut\n\t\t\t\t\t\tAND explnum_id='{$explnum_id}' "; $res_restriction_abo = pmb_mysql_query($req_restriction_abo, $dbh); } $expl_num = pmb_mysql_fetch_array($res_restriction_abo); if ($rights & 16 || is_null($dom_2) && $expl_num["explnum_visible_opac"] && (!$expl_num["explnum_visible_opac_abon"] || $expl_num["explnum_visible_opac_abon"] && $_SESSION["user_code"])) { if ($ligne->explnum_data || $ligne->explnum_path) { $explnum_list[] = $ligne; } } } } } if (count($explnum_list)) { if ($opac_allow_download_docnums == 1) { foreach ($explnum_list as $explnum) { print "<script type='text/javascript'>\n\t\t\t\t\twindow.open('" . $opac_url_base . "doc_num_data.php?explnum_id=" . $explnum->explnum_id . "&force_download=1','_blank','');\n\t\t\t\t\t</script>"; } } if ($opac_allow_download_docnums == 2) { $zip = new ZipArchive(); $filename = microtime(); $filename = str_replace(".", "", $filename); $filename = str_replace(" ", "", $filename); $filename = "temp/pmb_" . $filename . ".zip"; $res = $zip->open($filename, ZipArchive::CREATE); if ($res) { foreach ($explnum_list as $explnum) { $zip->addFromString(reg_diacrit(basename($explnum->path)), file_get_contents($opac_url_base . "doc_num_data.php?explnum_id=" . $explnum->explnum_id)); } $zip->close(); header("Content-disposition: attachment; filename=\"" . basename($filename) . "\""); header("Content-Type: application/force-download"); header("Content-Transfer-Encoding: application/zip"); header("Content-Length: " . filesize($filename)); header("Pragma: no-cache"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public"); header("Expires: 0"); $fp = fopen($filename, 'rb'); fpassthru($fp); fclose($fp); @unlink($filename); } } } }
function generate_RTF() { global $pmb_gestion_devise, $base_path, $msg, $biblio_logo; //Format des fonts $fontHead = new Font(12, 'Arial', '#0E298A'); $fontHead->setBold(); $fontSmall = new Font(1); $fontComment = new Font(10, 'Arial'); $fontComment->setItalic(); $fontChapter = new Font(10, 'Arial'); $fontChapter->setBold(); $fontSubChapter = new Font(10, 'Arial'); $fontSubChapter->setUnderline(); //Format des paragraphes $parPmb = new ParFormat(); $parPmb->setIndentRight(12.5); $parPmb->setBackColor('#0E298A'); $parPmb->setSpaceAfter(8); $parHead = new ParFormat(); $parHead->setSpaceBefore(5); //$parHead->setSpaceAfter(8); $parChapter = new ParFormat(); $parChapter->setSpaceBefore(2); $parChapter->setSpaceAfter(1); $parComment = new ParFormat(); $parComment->setIndentLeft(1); $parComment->setIndentRight(0.5); $parContenu = new ParFormat('justify'); $parContenu->setIndentLeft(1); $parSubChapter = new ParFormat(); $parSubChapter->setIndentLeft(0.5); $parInfo = new ParFormat(); $parInfo->setIndentLeft(0.5); $parInfo->setSpaceAfter(1.5); //Document $rtf = new Rtf(); $rtf->setMargins(1, 1, 1, 1); $sect =& $rtf->addSection(); $table =& $sect->addTable(); $table->addRows(2, 2); $table->addColumnsList(array(5, 15)); $table->addImageToCell(1, 1, $base_path . "/images/" . $biblio_logo, new ParFormat('center'), 0, 0); $cell =& $table->getCell(1, 2); $titre_general = reg_diacrit($this->intro[0]['TITLE'][0]['value']); $cell->writeText($this->to_utf8(strtoupper($titre_general)), new Font(14, 'Arial', '#0E298A'), new ParFormat('left')); $table->setVerticalAlignmentOfCells('center', 1, 1, 2, 2); $table->writeToCell(2, 1, $this->to_utf8("<u>" . $msg['demandes_rapport_abstract'] . "</u> : "), new Font(12, 'Arial', '#0E298A'), new ParFormat('center')); $cell =& $table->getCell(2, 2); $cell->writeText($this->to_utf8($this->intro[0]['ABSTRACT'][0]['value']), new Font(12, 'Arial', '#0E298A'), new ParFormat('left')); $sect->writeText($msg['demandes_rapport_intro'], $fontHead, $parHead); $sect->emptyParagraph($fontSmall, $parPmb); $date = "<u>" . $msg['demandes_rapport_date'] . "</u> : " . $this->intro[0]['DATE'][0]['value']; $deadline = "<u>" . $msg['demandes_rapport_deadline'] . "</u> : " . $this->intro[0]['DEADLINE'][0]['value']; //$resume = "<u>".$msg['demandes_rapport_abstract']."</u> : ".$this->intro[0]['ABSTRACT'][0]['value']; $doc = "<u>" . $msg['demandes_rapport_documentaliste'] . "</u> : " . $this->intro[0]['DOCUMENTALISTE'][0]['value']; $dmde = "<u>" . $msg['demandes_rapport_demandeur'] . "</u> : " . $this->intro[0]['DEMANDEUR'][0]['value']; $time = "<u>" . $msg['demandes_action_time_elapsed'] . "</u> : " . $this->intro[0]['TIME'][0]['value'] . $msg['demandes_action_time_unit']; $cout = "<u>" . $msg['demandes_action_cout'] . "</u> : " . $this->intro[0]['COST'][0]['value']; $sect->writeText($this->to_utf8($doc), new Font(10, 'Arial'), $parInfo); $sect->writeText($this->to_utf8($dmde), new Font(10, 'Arial'), $parInfo); $sect->writeText($this->to_utf8($date), new Font(10, 'Arial'), $parInfo); $sect->writeText($this->to_utf8($deadline), new Font(10, 'Arial'), $parInfo); $sect->writeText($this->to_utf8($time), new Font(10, 'Arial'), $parInfo); $sect->writeText($this->to_utf8($cout) . html_entity_decode($pmb_gestion_devise, ENT_QUOTES, 'utf-8'), new Font(10, 'Arial'), $parInfo); //$sect->writeText($this->to_utf8($resume), new Font(10,'Arial'), $parInfo); $sect->writeText($this->to_utf8($msg['demandes_rapport']), $fontHead, $parHead); $sect->emptyParagraph($fontSmall, $parPmb); $indice = 1; for ($i = 0; $i < count($this->notes); $i++) { $chapter = ""; $comment = ""; if ($this->notes[$i]['TITRE'] == 'yes') { $chapter = $this->notes[$i]['CONTENT'][0]['value']; $sect->writeText("<br>" . $indice . " - " . $this->to_utf8($chapter) . "<br>", $fontChapter, $parChapter); $indice++; $sujet_old = ""; } else { if ($this->notes[$i]['COMMENTAIRE'] == 'yes') { $comment = $this->notes[$i]['CONTENT'][0]['value']; $sect->writeText($this->to_utf8($comment), $fontComment, $parComment); } else { $sujet = $this->notes[$i]['SUJET'][0]['value']; $contenu = $this->notes[$i]['CONTENT'][0]['value']; if ($sujet != $sujet_old) { $sect->writeText($this->to_utf8($sujet), $fontSubChapter, $parSubChapter); } if ($contenu) { $sect->writeText($this->to_utf8($contenu), new Font(10, 'Arial'), $parContenu); } $sujet_old = $sujet; } } } $rtf->sendRtf("rapport"); }