Пример #1
0
function recup_noticeunimarc_suite($notice)
{
    global $info_949;
    global $info_997;
    $info_949 = array();
    $info_997 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    for ($i = 0; $i < count($record->inner_directory); $i++) {
        $cle = $record->inner_directory[$i]['label'];
        switch ($cle) {
            case "949":
                // infos CNL
                $info_949 = $record->get_subfield($cle, "a", "b", "c");
                break;
            case "997":
                // infos expl CNL
                $info_997 = $record->get_subfield($cle, "3", "a", "c", "d", "t");
                break;
            default:
                break;
        }
        /* end of switch */
    }
    /* end of for */
}
function recup_noticeunimarc_suite($notice)
{
    global $info_900;
    $info_900 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $info_900 = $record->get_subfield("900", "a", "l", "n");
}
Пример #3
0
function recup_noticeunimarc_suite($notice)
{
    global $info_606;
    $info_606 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $info_606 = $record->get_subfield("606", "a", "z");
}
Пример #4
0
function recup_noticeunimarc_suite($notice)
{
    global $info_461, $info_463, $info_530;
    global $info_900, $info_901, $titre_ppal_200, $champ_210, $titre_perio_530a, $info_897;
    global $bl, $hl;
    global $serie, $serie_200, $npages;
    $info_461 = array();
    $info_463 = array();
    $info_530 = array();
    $info_900 = array();
    $info_901 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $bl = $record->inner_guide['bl'];
    $hl = $record->inner_guide['hl'];
    $info_461 = $record->get_subfield("461", "t", "x");
    $info_463 = $record->get_subfield("463", "t", "v", "d", "e");
    $info_530 = $record->get_subfield("530", "a");
    $info_897 = $record->get_subfield("897", "a", "f", "k", "m", "p", "s", "u");
    $info_900 = $record->get_subfield("900", "a", "l", "n");
    $info_901 = $record->get_subfield("901", "a");
    $titre_ppal_200 = $record->get_subfield('200', 'h', 'i');
    $champ_210 = $record->get_subfield('210', 'd', 'h');
    $titre_perio_530a = $record->get_subfield('530', 'a');
    //on vide certains champ en fonction du type de notice...
    if ($bl == "a" && $hl == "2") {
        $serie = array();
        $serie_200 = array();
    } else {
        if ($bl == "s" && $hl == "2") {
            $serie = array();
            $serie_200 = array();
        } else {
        }
    }
}
Пример #5
0
function recup_noticeunimarc_suite($notice)
{
    global $info_207;
    $info_207 = "";
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $info_207 = $record->get_subfield("207", "a");
    //	echo "<br />Lu notice :<pre>"; print_r($info_207) ;echo "</pre>";
}
Пример #6
0
function recup_noticeunimarc_suite($notice)
{
    global $info_956;
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $info_956 = $record->get_subfield("956", "u", "3", "z");
    global $add_explnum;
    $add_explnum = TRUE;
}
Пример #7
0
function recup_noticeunimarc_suite($notice)
{
    global $n_gen, $lien, $eformat, $info_856;
    $info_856 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $lien = $eformat = array();
    $info_856 = $record->get_subfield("856", "u");
}
 function entrepot_to_unimarc($recid)
 {
     global $dbh;
     $requete = "SELECT source_id FROM external_count WHERE rid=" . addslashes($recid) . ";";
     $myQuery = pmb_mysql_query($requete, $dbh);
     $source_id = pmb_mysql_result($myQuery, 0, 0);
     $requete = "select * from entrepot_source_{$source_id} where recid='" . addslashes($recid) . "' group by ufield,usubfield,field_order,subfield_order,value order by field_order,subfield_order";
     $resultat = pmb_mysql_query($requete, $dbh);
     $unimarc = new iso2709_record("", USER_UPDATE);
     $field_order = -1;
     $field = $r->ufield;
     $sfields = array();
     while ($r = pmb_mysql_fetch_object($resultat)) {
         switch ($r->ufield) {
             case "rs":
                 $unimarc->set_rs($r->value);
                 break;
             case "dt":
                 $unimarc->set_dt($r->value);
                 break;
             case "bl":
                 $unimarc->set_bl($r->value);
                 break;
             case "hl":
                 $unimarc->set_hl($r->value);
                 break;
             case "el":
                 $unimarc->set_el($r->value);
                 break;
             case "ru":
                 $unimarc->set_ru($r->value);
                 break;
             case "001":
                 $unimarc->add_field("001", '  ', $r->value);
             default:
                 if ($field_order != $r->field_order) {
                     if (count($sfields)) {
                         $unimarc->add_field($field, '  ', $sfields);
                     }
                     $field = $r->ufield;
                     $sfields = array();
                     $field_order = $r->field_order;
                 }
                 if (!$r->usubfield) {
                     $unimarc->add_field($r->ufield, '', $r->value);
                 } else {
                     $sfields[][0] = $r->usubfield;
                     $sfields[count($sfields) - 1][1] = $r->value;
                 }
                 break;
         }
     }
     if (count($sfields)) {
         $unimarc->add_field($field, '  ', $sfields);
     }
     $unimarc->update();
     $this->sugg_uni_notice = $unimarc->full_record;
 }
Пример #9
0
function recup_noticeunimarc_suite($notice)
{
    global $hl, $bl;
    global $info_461, $info_463;
    global $info_606;
    global $serie;
    $info_461 = array();
    $info_463 = array();
    $info_606 = array();
    $serie = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $bl = $record->inner_guide['bl'];
    $hl = $record->inner_guide['hl'];
    $info_461 = $record->get_subfield("461", "t");
    $info_463 = $record->get_subfield("463", "v", "d");
    $info_606 = $record->get_subfield("606", "a", "2");
}
Пример #10
0
function recup_noticeunimarc_suite($notice)
{
    global $info_949;
    $info_949 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    for ($i = 0; $i < count($record->inner_directory); $i++) {
        $cle = $record->inner_directory[$i]['label'];
        switch ($cle) {
            case "949":
                // infos bibliotheque 27 septembre
                $info_949 = $record->get_subfield($cle, "a", "c", "d");
                break;
            default:
                break;
        }
        /* end of switch */
    }
    /* end of for */
}
Пример #11
0
function recup_noticeunimarc_suite($notice)
{
    global $info_464, $info_200, $info_676;
    global $info_900, $info_901, $info_902, $info_903, $info_904, $info_910;
    global $rs, $bl, $dt;
    $info_464 = "";
    $info_900 = "";
    $info_901 = "";
    $info_902 = "";
    $info_903 = "";
    $info_904 = "";
    $info_910 = "";
    $info_200 = "";
    $info_676 = "";
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $rs = $record->inner_guide["rs"];
    $bl = $record->inner_guide["bl"];
    $dt = $record->inner_guide["dt"];
    for ($i = 0; $i < count($record->inner_directory); $i++) {
        $cle = $record->inner_directory[$i]['label'];
        switch ($cle) {
            case "464":
                //C'est un périodique donc un dépouillement ou une notice objet
                $info_464 = $record->get_subfield($cle, "t", "v", "p", "d", "z", "e", "u");
                break;
            case "200":
                $info_200 = $record->get_subfield($cle, "a");
            default:
                break;
        }
        /* end of switch */
    }
    /* end of for */
    $info_900 = $record->get_subfield("900", "a");
    $info_901 = $record->get_subfield("901", "a");
    $info_902 = $record->get_subfield("902", "a");
    $info_903 = $record->get_subfield("903", "a");
    $info_910 = $record->get_subfield("910", "a");
    $info_904 = $record->get_subfield_array_array("904", "a");
    $info_676 = $record->get_subfield("676", "a");
}
Пример #12
0
function recup_noticeunimarc_suite($notice)
{
    global $n_gen, $lien, $eformat, $info_856, $info_959;
    $info_856 = array();
    $info_959 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $lien = $eformat = array();
    $info_856 = $record->get_subfield("856", "u", "z");
    $info_959 = $record->get_subfield("959", "3");
    $info_334 = array();
    $info_334 = $record->get_subfield("334", "a", "b");
    foreach ($info_334 as $key => $value) {
        if ($tmp = trim($value["a"])) {
            $val = "Note sur la récompense : " . $tmp;
            if ($tmp = trim($value["b"])) {
                $val .= ", " . $tmp;
            }
            $n_gen[] = $val;
        }
    }
}
Пример #13
0
function recup_noticeunimarc_suite($notice)
{
    global $info_464, $index_sujets, $info_610;
    global $info_900, $info_901, $info_902, $info_903, $info_904, $info_905, $info_906, $info_606_a;
    $info_464 = "";
    $info_900 = "";
    $info_901 = "";
    $info_902 = "";
    $info_903 = "";
    $info_904 = "";
    $info_905 = "";
    $info_906 = "";
    $info_610 = $index_sujets;
    $index_sujets = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    for ($i = 0; $i < count($record->inner_directory); $i++) {
        $cle = $record->inner_directory[$i]['label'];
        switch ($cle) {
            case "464":
                //C'est un périodique donc un dépouillement ou une notice objet
                $info_464 = $record->get_subfield($cle, "t", "v", "p", "d", "z", "e");
                break;
            default:
                break;
        }
        /* end of switch */
    }
    /* end of for */
    $info_606_a = $record->get_subfield_array_array("606", "a");
    $info_900 = $record->get_subfield_array_array("900", "a");
    $info_901 = $record->get_subfield_array_array("901", "a");
    $info_902 = $record->get_subfield_array_array("902", "a");
    $info_903 = $record->get_subfield("903", "a");
    $info_904 = $record->get_subfield("904", "a");
    $info_905 = $record->get_subfield("905", "a");
    $info_906 = $record->get_subfield_array_array("906", "a");
}
function recup_noticeunimarc_suite($notice)
{
    global $info_001, $info_464, $info_464_a, $info_464_e, $info_464_f, $info_461_3, $info_461_t, $info_200_a, $info_200_e, $info_210_d, $info_902_a, $info_686_a, $info_462_3, $info_462_t;
    global $aut_700, $aut_701, $aut_702, $aut_710, $aut_711, $aut_712;
    global $accomp_345_c;
    global $info_675_a;
    global $info_600_b, $info_601_b, $info_602_b, $info_605_b, $info_606_b, $info_607_b, $info_610_b;
    global $info_610_a, $info_610_b, $info_610_e, $info_610_j, $info_610_x, $info_610_y, $info_610_z, $info_610_3, $info_610;
    global $info_345_d, $info_071_a, $info_071_b;
    global $info_901;
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $info_001 = $record->get_subfield("001");
    $info_464 = $record->get_subfield_array_array("464");
    $info_464_a = $record->get_subfield_array("464", "a");
    $info_464_e = $record->get_subfield_array("464", "e");
    $info_464_f = $record->get_subfield_array("464", "f");
    $info_461_3 = $record->get_subfield("461", "3");
    $info_461_t = $record->get_subfield("461", "t");
    $info_200_a = $record->get_subfield("200", "a");
    $info_200_e = $record->get_subfield_array("200", "e");
    $info_210_d = $record->get_subfield("210", "d");
    $info_902_a = $record->get_subfield_array_array("902", "a");
    $info_686_a = $record->get_subfield("686", "a");
    $info_462_3 = $record->get_subfield("462", "3");
    $info_462_t = $record->get_subfield("462", "t");
    $info_600_b = $record->get_subfield_array_array("600", "b");
    $info_601_b = $record->get_subfield_array_array("601", "b");
    $info_602_b = $record->get_subfield_array_array("602", "b");
    $info_605_b = $record->get_subfield_array_array("605", "b");
    $info_606_b = $record->get_subfield_array_array("606", "b");
    $info_607_b = $record->get_subfield_array_array("607", "b");
    $info_610_b = $record->get_subfield_array_array("610", "b");
    $info_610_a = $record->get_subfield_array_array("610", "a");
    $info_610_b = $record->get_subfield_array_array("610", "b");
    $info_610_e = $record->get_subfield_array_array("610", "e");
    $info_610_j = $record->get_subfield_array_array("610", "j");
    $info_610_x = $record->get_subfield_array_array("610", "x");
    $info_610_y = $record->get_subfield_array_array("610", "y");
    $info_610_z = $record->get_subfield_array_array("610", "z");
    $info_610_3 = $record->get_subfield_array_array("610", "3");
    $info_610 = $record->get_subfield_array_array("610");
    //$info_610=$record->get_subfield_array_array("610","a","b","3","e");
    $aut_700 = $record->get_subfield("700", "a", "b", "3", "p", "4");
    $aut_701 = $record->get_subfield("701", "a", "b", "3", "p", "4");
    $aut_702 = $record->get_subfield("702", "a", "b", "3", "p", "4");
    $aut_710 = $record->get_subfield("710", "a", "b", "3", "p", "4");
    $aut_711 = $record->get_subfield("711", "a", "b", "3", "p", "4");
    $aut_712 = $record->get_subfield("712", "a", "b", "3", "p", "4");
    $accomp_345_c = $record->get_subfield("345", "c");
    //CDU : classification décimale universelle
    $info_675_a = $record->get_subfield("675", "a");
    // Prix pour disque et video
    $info_345_d = $record->get_subfield("345", "d");
    // Code commercial
    $info_071_a = $record->get_subfield("071", "a");
    // Producteur -> editeur
    $info_071_b = $record->get_subfield("071", "b");
    // Centre d'intérêt
    //$info_901_a=$record->get_subfield_array_array("901","a");
    $info_901 = $record->get_subfield("901", "a", "3");
}
Пример #15
0
function recup_noticeunimarc_suite($notice)
{
    global $info_999, $info_001, $doc_type, $info_901, $info_905, $info_906, $info_994_x, $info_994_y;
    global $info_503, $info_503_j, $info_503_d, $info_305;
    global $info_600_f, $info_600_b, $info_600_3;
    global $info_601_3;
    global $info_606_3;
    global $info_607_3;
    global $info_608_a, $info_608_j, $info_608_x, $info_608_y, $info_608_z, $info_608_3, $serie_200, $tit_200a;
    global $aut_700, $aut_701, $aut_702;
    $info_901 = array();
    $info_905 = array();
    $info_906 = array();
    $info_999 = array();
    $info_305 = array();
    $info_503 = array();
    $info_503_j = array();
    $info_503_d = array();
    $info_001 = array();
    $info_200 = array();
    $info_994_x = array();
    $info_994_y = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $info_001 = $record->get_subfield("001");
    $info_200 = $record->get_subfield("200", "b");
    if (preg_match("#article#i", $info_200[0])) {
        $doc_type = "x";
    }
    $info_901 = $record->get_subfield("901", "a");
    $info_901 = $record->get_subfield("905", "a");
    $info_901 = $record->get_subfield("906", "a");
    $info_999 = $record->get_subfield("999", "a");
    $info_503 = $record->get_subfield("503", "a", "e", "f", "h", "m", "n");
    $info_503_j = $record->get_subfield_array_array("503", "j");
    $info_503_d = $record->get_subfield_array_array("503", "d");
    $info_305 = array();
    $info_305 = $record->get_subfield("305", "a");
    $info_600_3 = array();
    $info_600_3 = $record->get_subfield_array_array("600", "3");
    $info_600_b = array();
    $info_600_b = $record->get_subfield_array_array("600", "b");
    $info_600_f = array();
    $info_600_f = $record->get_subfield_array_array("600", "f");
    $info_601_3 = array();
    $info_601_3 = $record->get_subfield_array_array("601", "3");
    $info_606_3 = array();
    $info_606_3 = $record->get_subfield_array_array("606", "3");
    $info_607_3 = array();
    $info_607_3 = $record->get_subfield_array_array("607", "3");
    $info_608_3 = array();
    $info_608_3 = $record->get_subfield_array_array("608", "3");
    $info_608_a = array();
    $info_608_a = $record->get_subfield_array_array("608", "a");
    $info_608_j = array();
    $info_608_j = $record->get_subfield_array_array("608", "j");
    $info_608_x = array();
    $info_608_x = $record->get_subfield_array_array("608", "x");
    $info_608_y = array();
    $info_608_y = $record->get_subfield_array_array("608", "y");
    $info_608_z = array();
    $info_608_z = $record->get_subfield_array_array("608", "z");
    $aut_700 = array();
    $aut_700 = $record->get_subfield("700", "a", "b", "c", "d", "4", "N");
    $aut_701 = array();
    $aut_701 = $record->get_subfield("701", "a", "b", "c", "d", "4", "N");
    $aut_702 = array();
    $aut_702 = $record->get_subfield("702", "a", "b", "c", "d", "4", "N");
    $info_994_x = $record->get_subfield("994", "x");
    $info_994_y = $record->get_subfield("994", "y");
    if (count($serie_200)) {
        $titre = implode(" ; ", $tit_200a);
        if (trim($serie_200[0]['i'])) {
            $titre .= ". " . trim($serie_200[0]['i']);
        }
        if (trim($serie_200[0]['h'])) {
            $titre .= ", " . trim($serie_200[0]['h']);
        }
        $tit_200a = array();
        $serie_200 = array();
        $tit_200a[] = $titre;
    }
}
Пример #16
0
 global $z3950_debug;
 if ($z3950_debug) {
     $fp = fopen("../../temp/raw" . rand() . ".marc", "wb");
     fwrite($fp, $rec);
     fclose($fp);
 }
 if (strpos($rec, chr(0x1d)) !== false) {
     $rec = substr($rec, 0, strpos($rec, chr(0x1d)) + 1);
 }
 $monEnr = new iso2709_record($rec);
 if ($monEnr->valid()) {
     $messageframe = " {$p} " . $msg['z3950_lu_bin'];
     $pb = 0;
 } else {
     $rec = yaz_record($id, $p, "string");
     $monEnr2 = new iso2709_record($rec);
     if ($monEnr2->valid()) {
         $messageframe = "{$p} " . $msg['z3950_lu_cok'];
         $pb = 0;
     } else {
         // DEBUG
         //$fp = fopen ("../../temp/raw".rand().".sutrs","wb");
         //fwrite ($fp, $rec);
         //fclose ($fp);
         $rec = sutrs_record($rec, $sutrs_lang);
         $messageframe = " {$p} " . $msg['z3950_lu_chs'];
         //$pb = 1;
         //$rec="";
     }
 }
 if ($pb) {
Пример #17
0
function recup_noticeunimarc_suite($notice)
{
    global $info_461, $info_463, $info_464;
    global $info_606_a;
    global $info_900, $info_901, $info_902, $info_903, $info_904, $info_905, $info_906;
    $info_461 = "";
    $info_463 = "";
    $info_464 = "";
    //Compatibilite import memonotices
    $info_900 = "";
    $info_901 = "";
    $info_902 = "";
    $info_903 = "";
    $info_904 = "";
    $info_905 = "";
    $info_906 = "";
    $record = new iso2709_record($notice, AUTO_UPDATE);
    for ($i = 0; $i < count($record->inner_directory); $i++) {
        $cle = $record->inner_directory[$i]['label'];
        switch ($cle) {
            case "461":
                //Lien vers perio
                $info_461 = $record->get_subfield($cle, "t", "v", "e", "9");
                break;
            case "463":
                //Lien vers bulletin
                $info_463 = $record->get_subfield($cle, "t", "v", "e", "9");
                break;
            case "464":
                //Compatibilite import memonotices
                $info_464 = $record->get_subfield($cle, "t", "v", "d", "p", "z", "e");
                break;
            default:
                break;
        }
        /* end of switch */
    }
    /* end of for */
    $info_606_a = $record->get_subfield_array_array("606", "a");
    $info_900 = $record->get_subfield_array_array("900", "a");
    $info_901 = $record->get_subfield_array_array("901", "a");
    $info_902 = $record->get_subfield_array_array("902", "a");
    $info_903 = $record->get_subfield("903", "a");
    $info_904 = $record->get_subfield("904", "a");
    $info_905 = $record->get_subfield_array_array("905", "a");
    $info_906 = $record->get_subfield_array_array("906", "a");
}
Пример #18
0
function entrepot_to_unimarc($recid)
{
    global $dbh, $charset;
    $requete = "SELECT source_id FROM external_count WHERE rid=" . addslashes($recid) . ";";
    $myQuery = mysql_query($requete, $dbh);
    $source_id = mysql_result($myQuery, 0, 0);
    $requete = "select * from entrepot_source_{$source_id} where recid='" . addslashes($recid) . "' group by ufield,usubfield,field_order,subfield_order,value order by field_order,subfield_order";
    $resultat = mysql_query($requete, $dbh);
    $unimarc = new iso2709_record("", USER_UPDATE);
    if ($charset == "utf-8") {
        //Si on est en UTF-8 alors ce qui sort de la base est en UTF-8 et donc la notice sera en utf-8
        $unimarc->is_utf8 = true;
    }
    $field_order = -1;
    $field = $r->ufield;
    $field_ind = $r->field_ind;
    while (strlen($field_ind) < 2) {
        $field_ind .= ' ';
    }
    $sfields = array();
    while ($r = mysql_fetch_object($resultat)) {
        switch ($r->ufield) {
            case "rs":
                $unimarc->set_rs($r->value);
                break;
            case "dt":
                $unimarc->set_dt($r->value);
                break;
            case "bl":
                $unimarc->set_bl($r->value);
                break;
            case "hl":
                $unimarc->set_hl($r->value);
                break;
            case "el":
                $unimarc->set_el($r->value);
                break;
            case "ru":
                $unimarc->set_ru($r->value);
                break;
            case "001":
                $unimarc->add_field("001", '  ', $r->value);
            default:
                if ($field_order != $r->field_order) {
                    if (count($sfields)) {
                        $unimarc->add_field($field, $field_ind, $sfields);
                    }
                    $field = $r->ufield;
                    $field_ind = $r->field_ind;
                    while (strlen($field_ind) < 2) {
                        $field_ind .= ' ';
                    }
                    $sfields = array();
                    $field_order = $r->field_order;
                }
                if (!$r->usubfield) {
                    $unimarc->add_field($r->ufield, '', $r->value);
                } else {
                    $sfields[][0] = $r->usubfield;
                    $sfields[count($sfields) - 1][1] = $r->value;
                }
                break;
        }
    }
    if (count($sfields)) {
        $unimarc->add_field($field, $field_ind, $sfields);
    }
    $unimarc->update();
    return array('notice' => $unimarc->full_record, 'source_id' => $source_id);
}
Пример #19
0
function recup_noticeunimarc_suite($notice)
{
    global $infos_4XX;
    global $bl, $hl, $isbn_only, $isbn_dedoublonnage;
    global $tit_200a, $serie_200;
    global $info_003;
    global $info_900;
    global $info_336, $info_337;
    global $issn_011;
    if (!$isbn_dedoublonnage || $isbn_only == 1) {
        $issn_011[0] .= "_pasToucheACa";
    }
    $zones = array(412, 413, 421, 422, 423, 430, 431, 432, 433, 434, 435, 436, 437, 440, 441, 442, 443, 444, 445, 446, 447, 451, 451, 452, 452, 453, 454, 455, 456, 520);
    $infos_4XX = array();
    $info_003 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $bl = $record->inner_guide['bl'];
    $hl = $record->inner_guide['hl'];
    $info_003 = $record->get_subfield("003");
    $info_336 = $record->get_subfield("336", "a");
    $info_337 = $record->get_subfield("337", "a");
    foreach ($zones as $zone) {
        $infos_4XX[$zone] = $record->get_subfield($zone, "0", "t", "x");
    }
    $info_105 = $record->get_subfield("105", "a");
    if (trim($info_105[0])) {
        //Illustration
        if (($tmp = substr($info_105[0], 0, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_illustration";
            $info_900[] = $val;
        }
        if (($tmp = substr($info_105[0], 1, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_illustration";
            $info_900[] = $val;
        }
        if (($tmp = substr($info_105[0], 2, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_illustration";
            $info_900[] = $val;
        }
        if (($tmp = substr($info_105[0], 3, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_illustration";
            $info_900[] = $val;
        }
        //Nature
        if (($tmp = substr($info_105[0], 4, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_nature";
            $info_900[] = $val;
        }
        if (($tmp = substr($info_105[0], 5, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_nature";
            $info_900[] = $val;
        }
        if (($tmp = substr($info_105[0], 6, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_nature";
            $info_900[] = $val;
        }
        if (($tmp = substr($info_105[0], 7, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_nature";
            $info_900[] = $val;
        }
        //Info
        if (substr($info_105[0], 8, 1) == "1") {
            $val = array();
            $val["a"] = "Congrès";
            $val["t"] = "list";
            $val["n"] = "cp_105_info";
            $info_900[] = $val;
        }
        if (substr($info_105[0], 9, 1) == "1") {
            $val = array();
            $val["a"] = "Constitué de mélange";
            $val["t"] = "list";
            $val["n"] = "cp_105_info";
            $info_900[] = $val;
        }
        if (substr($info_105[0], 10, 1) == "1") {
            $val = array();
            $val["a"] = "Contient un index";
            $val["t"] = "list";
            $val["n"] = "cp_105_info";
            $info_900[] = $val;
        }
        //Genre
        if (($tmp = substr($info_105[0], 11, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_genre";
            $info_900[] = $val;
        }
        //biblio
        if (($tmp = substr($info_105[0], 12, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_105_biblio";
            $info_900[] = $val;
        }
    }
    $info_110 = $record->get_subfield("110", "a");
    if (trim($info_110[0])) {
        $val = array();
        $val["a"] = $info_110[0];
        $val["t"] = "text";
        $val["n"] = "cp_110";
        $info_900[] = $val;
        //Type de ressource continue
        if (($tmp = substr($info_110[0], 0, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_110_typePer";
            $info_900[] = $val;
        }
        //Périodicité
        if (($tmp = substr($info_110[0], 1, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_110_periodicite";
            $info_900[] = $val;
        }
        //Régularité
        if (($tmp = substr($info_110[0], 2, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_110_regularite";
            $info_900[] = $val;
        }
        //Type de publication de référence
        if (($tmp = substr($info_110[0], 3, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_110_typepubli";
            $info_900[] = $val;
        }
        //Nature du contenu
        if (($tmp = substr($info_110[0], 4, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_110_contenu";
            $info_900[] = $val;
        }
        if (($tmp = substr($info_110[0], 5, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_110_contenu";
            $info_900[] = $val;
        }
        if (($tmp = substr($info_110[0], 6, 1)) && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_110_contenu";
            $info_900[] = $val;
        }
        //Congres
        $tmp = substr($info_110[0], 7, 1);
        if ($tmp !== "" && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_110_congres";
            $info_900[] = $val;
        }
    }
    $info_135 = $record->get_subfield("135", "a");
    if (trim($info_135[0])) {
        //Type de contenu electronique
        $tmp = substr($info_135[0], 0, 1);
        if ($tmp !== "" && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_135_type";
            $info_900[] = $val;
        }
        //Support
        $tmp = substr($info_135[0], 1, 1);
        if ($tmp !== "" && $tmp != "|") {
            $val = array();
            $val["a"] = $tmp;
            $val["t"] = "list";
            $val["n"] = "cp_135_support";
            $info_900[] = $val;
        }
    }
    //pour les monographies, le 200$a et 200$i s'inverse...
    if ($bl == "m") {
        if (clean_string($serie_200[0]['i']) != "") {
            $tmp_buffer = $serie_200[0]['i'];
            $serie_200[0]['i'] = $tit_200a[0];
            $tit_200a[0] = $tmp_buffer;
        }
    }
}
Пример #20
0
 function ISO_decode($chaine)
 {
     global $charset;
     $encodage_fic_source = $_SESSION["encodage_fic_source"];
     //On a forcé l'encodage au moment de l'import ou de la convertion
     if ($encodage_fic_source == "iso8859") {
         if ($charset !== 'utf-8') {
             //Le charset de PMB est en iso-8859
             return $chaine;
         } else {
             return utf8_encode($chaine);
         }
     } elseif ($encodage_fic_source == "iso5426") {
         if (is_object($this)) {
             $chaine = $this->ISO_646_5426_decode($chaine);
         } else {
             $chaine = iso2709_record::ISO_646_5426_decode($chaine);
         }
         if ($charset !== 'utf-8') {
             //Le charset de PMB est en iso-8859
             return $chaine;
         } else {
             return utf8_encode($chaine);
         }
     } elseif ($encodage_fic_source == "utf8") {
         //On regarde si il y a les NSBB NSBE
         if (preg_match("/^" . chr(0xc2) . chr(0x98) . "(.*?)" . chr(0xc2) . chr(0x9c) . "(.*)\$/s", $chaine, $matches)) {
             if (count($matches) == 3 && trim($matches[1]) && trim($matches[2])) {
                 $chaine = $matches[1] . $matches[2];
             }
         }
         if ($charset !== 'utf-8') {
             //Le charset de PMB est en iso-8859
             return utf8_decode($chaine);
         } else {
             return $chaine;
         }
     }
     if (is_object($this) && $this->is_utf8 === TRUE) {
         //Cas notices USMARC et UNIMARC encodees en UTF8
         //On regarde si il y a les NSBB NSBE
         if (preg_match("/^" . chr(0xc2) . chr(0x98) . "(.*?)" . chr(0xc2) . chr(0x9c) . "(.*)\$/s", $chaine, $matches)) {
             if (count($matches) == 3 && trim($matches[1]) && trim($matches[2])) {
                 $chaine = $matches[1] . $matches[2];
             }
         }
         if ($charset !== 'utf-8') {
             $chaine = utf8_decode($chaine);
         }
         return $chaine;
     }
     if (is_object($this)) {
         $chaine = $this->ISO_646_5426_decode($chaine);
     } else {
         $chaine = i_2709::ISO_646_5426_decode($chaine);
     }
     if ($charset == 'utf-8') {
         $chaine = utf8_encode($chaine);
     }
     return $chaine;
 }
Пример #21
0
function recup_noticeunimarc_suite($notice)
{
    global $info_100, $info_606_a, $info_606_9, $info_900, $info_999, $info_950, $info_951, $info_996_9;
    $info_100 = array();
    $info_606_a = array();
    $info_606_9 = array();
    $info_900 = array();
    $info_950 = array();
    $info_951 = array();
    $info_999 = array();
    $info_996_9 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $info_100 = $record->get_subfield("100", "a");
    $info_606_a = $record->get_subfield_array_array("606", "a");
    $info_606_9 = $record->get_subfield_array_array("606", "9");
    $info_900 = $record->get_subfield("900", "a", "b", "c", "l", "n", "t");
    $info_950 = $record->get_subfield("950", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k");
    $info_951 = $record->get_subfield("951", "a", "b", "c", "l", "n", "f", "t");
    $info_996_9 = $record->get_subfield_array_array("996", "9");
    $info_999 = $record->get_subfield("999", "a", "b", "c", "l", "n", "f", "t");
}
Пример #22
0
 function getEnrichment($notice_id, $source_id, $type = "", $enrich_params = array())
 {
     global $charset;
     $enrichment = array();
     $this->noticeToEnrich = $notice_id;
     // récupération du code sudoc (PPN) de la notice stocké dans le champ perso de type "resolve" avec pour label "SUDOC"
     $mes_pp = new parametres_perso("notices");
     $mes_pp->get_values($notice_id);
     $values = $mes_pp->values;
     foreach ($values as $field_id => $vals) {
         if ($mes_pp->t_fields[$field_id]['TYPE'] == "resolve") {
             $field_options = _parser_text_no_function_("<?xml version='1.0' encoding='" . $charset . "'?>\n" . $mes_pp->t_fields[$field_id]['OPTIONS'], "OPTIONS");
             foreach ($field_options['RESOLVE'] as $resolve) {
                 if (strtoupper($resolve['LABEL']) == "SUDOC") {
                     $infos = explode('|', $vals[0]);
                     $ppn = $infos[0];
                 }
             }
         }
     }
     if ($ppn == "") {
         return $this->build_error();
     }
     $url = "carmin.sudoc.abes.fr";
     $port = "210";
     $base = "abes-z39-public";
     $format = "unimarc";
     $term = "@attr 1=12 @attr 2=3 \"{$ppn}\" ";
     $id = yaz_connect("{$url}:{$port}/{$base}", array("piggyback" => false));
     yaz_range($id, 1, 1);
     yaz_syntax($id, strtolower($format));
     yaz_search($id, "rpn", $term);
     $options = array("timeout" => 45);
     //Override le timeout du serveur mysql, pour être sûr que le socket dure assez longtemps pour aller jusqu'aux ajouts des résultats dans la base.
     $sql = "set wait_timeout = 120";
     mysql_query($sql);
     yaz_wait($options);
     $error = yaz_error($id);
     $error_info = yaz_addinfo($id);
     if (!empty($error)) {
         yaz_close($id);
         return $this->build_error();
     } else {
         $hits = yaz_hits($id);
         $hits += 0;
         if ($hits) {
             $rec = yaz_record($id, 1, "raw");
             $record = new iso2709_record($rec);
             if (!$record->valid()) {
                 yaz_close($id);
                 return $this->build_error();
             }
             $lines = "";
             $document->document_type = $record->inner_guide[dt];
             $document->bibliographic_level = $record->inner_guide[bl];
             $document->hierarchic_level = $record->inner_guide[hl];
             if ($document->hierarchic_level == "") {
                 if ($document->bibliographic_level == "s") {
                     $document->hierarchic_level = "1";
                 }
                 if ($document->bibliographic_level == "m") {
                     $document->hierarchic_level = "0";
                 }
             }
             $indicateur = array();
             $cle_list = array();
             for ($i = 0; $i < count($record->inner_directory); $i++) {
                 $cle = $record->inner_directory[$i]['label'];
                 $indicateur[$cle][] = substr($record->inner_data[$i]['content'], 0, 2);
                 $field_array = $record->get_subfield_array_array($cle);
                 $line = "";
                 if (!$cle_list[$cle]) {
                     foreach ($field_array as $field) {
                         $line .= $cle . "  ";
                         foreach ($field as $ss_field) {
                             $line .= "\$" . $ss_field["label"] . $ss_field["content"];
                         }
                         $line .= "<br>";
                     }
                 }
                 $cle_list[$cle] = 1;
                 $lines .= $line;
             }
             if ($lines == "") {
                 yaz_close($id);
                 return $this->build_error();
             }
         } else {
             yaz_close($id);
             return $this->build_error();
         }
     }
     yaz_close($id);
     $enrichment['sudoc']['content'] = $lines;
     $enrichment['source_label'] = $this->msg['sudoc_enrichment_source'];
     return $enrichment;
 }
Пример #23
0
function recup_noticeunimarc_link($notice)
{
    global $notices_liees, $titre_ppal_200, $titre_perio_530a, $champ_210;
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $titre_ppal_200 = $record->get_subfield('200', 'a', 'h', 'i');
    $champ_210 = $record->get_subfield('210', 'd', 'h');
    $titre_perio_530a = $record->get_subfield('530', 'a');
    $notices_liees = $record->get_all_fields('4..');
}
function recup_noticeunimarc_suite($notice)
{
    global $info_100, $info_606_a, $info_606_9, $info_900, $info_999;
    $info_100 = array();
    $info_606_a = array();
    $info_606_9 = array();
    $info_900 = array();
    $info_999 = array();
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $info_100 = $record->get_subfield("100", "a");
    $info_606_a = $record->get_subfield_array_array("606", "a");
    $info_606_9 = $record->get_subfield_array_array("606", "9");
    $info_900 = $record->get_subfield("900", "a", "l", "n");
    $info_999 = $record->get_subfield("999", "a", "l", "n", "f");
}
Пример #25
0
 function iso2709toXML_notice($contents, $format = "unimarc")
 {
     global $output_params, $charset;
     $n_notices = 0;
     $n_valid = 0;
     $n_invalid = 0;
     $this->n_traitees = 0;
     $this->n_valid = 0;
     $this->n_invalid = 0;
     $this->error_msg = array();
     $this->warning_msg = array();
     $this->notices_xml_ = array();
     while ($contents != "") {
         $e_notice = strpos($contents, chr(0x1d));
         $notice = substr($contents, 0, $e_notice + 1);
         $contents = substr($contents, $e_notice + 1);
         $n = new iso2709_record($notice, AUTO_UPDATE, $format);
         if ($n->is_utf8) {
             $this->is_utf8 = true;
         } else {
             if ($output_params['CHARSET'] == "utf-8") {
                 $n->inner_guide['pos9'] = "a";
             }
         }
         if ($n->valid()) {
             //Récupération des infos
             //Taille code sous-champ
             $sl = $n->inner_guide["sl"];
             //Taille des inticateurs
             $il = $n->inner_guide["il"];
             $data .= "  <notice>\n";
             //Etat de la notice
             $values = array("rs", "dt", "bl", "hl", "el", "ru");
             for ($i = 0; $i < count($values); $i++) {
                 $v = $n->inner_guide[$values[$i]];
                 if (ord($v) == 32) {
                     $v = "*";
                 }
                 $data .= "    <" . $values[$i] . ">" . $v . "</" . $values[$i] . ">\n";
             }
             for ($i = 0; $i < count($n->inner_data); $i++) {
                 $data .= "    <f c=\"" . $n->inner_data[$i]["label"] . "\"";
                 $content = substr($n->inner_data[$i]["content"], 0, strlen($n->inner_data[$i]["content"]) - 1);
                 $sub_fields = explode(chr(31), $content);
                 if (count($sub_fields) == 1) {
                     $data .= ">" . htmlspecialchars($this->is_utf8 ? $sub_fields[0] : $n->ISO_decode($sub_fields[0]), ENT_QUOTES, $charset) . "</f>\n";
                 } else {
                     if (strlen($sub_fields[0]) > 2) {
                         $sub_fields[0] = substr($sub_fields[0], strlen($sub_fields[0]) - 2);
                     }
                     $data .= " ind=\"" . $sub_fields[0] . "\">\n";
                     for ($j = 1; $j < count($sub_fields); $j++) {
                         $data .= "      <s c=\"" . substr($sub_fields[$j], 0, 1) . "\">" . htmlspecialchars($this->is_utf8 ? substr($sub_fields[$j], 1) : $n->ISO_decode(substr($sub_fields[$j], 1)), ENT_QUOTES, $charset) . "</s>\n";
                     }
                     $data .= "    </f>\n";
                 }
             }
             $data .= "  </notice>\n";
             $this->notices_xml_[] = $data;
             $n_valid++;
         } else {
             $this->error_msg[] = @implode(" / ", $n->errors);
             $n_invalid++;
         }
         $n_notices++;
     }
     $this->n_traitees = $n_notices;
     $this->n_valid = $n_valid;
     $this->n_invalid = $n_invalid;
     return $n_notices;
 }
Пример #26
0
function recup_noticeunimarc_suite($notice)
{
    global $info_461, $info_463;
    global $info_900, $info_901, $info_902, $info_903, $info_904, $info_905, $info_906;
    global $info_907, $info_908, $info_909, $info_910;
    global $info_606_a;
    global $bl, $hl;
    $info_461 = "";
    $info_463 = "";
    $info_900 = "";
    $info_901 = "";
    $info_902 = "";
    $info_903 = "";
    $info_904 = "";
    $info_905 = "";
    $info_906 = "";
    $info_907 = "";
    $info_908 = "";
    $info_909 = "";
    $info_910 = "";
    $record = new iso2709_record($notice, AUTO_UPDATE);
    $bl = $record->inner_guide['bl'];
    $hl = $record->inner_guide['hl'];
    $info_461 = $record->get_subfield("461", "t", "v");
    $info_463 = $record->get_subfield("463", "t", "v");
    $info_606_a = $record->get_subfield_array_array("606", "a");
    $info_900 = $record->get_subfield_array_array("900", "a");
    $info_901 = $record->get_subfield_array_array("901", "a");
    $info_902 = $record->get_subfield_array_array("902", "a");
    $info_903 = $record->get_subfield_array_array("903", "a");
    $info_904 = $record->get_subfield("904", "a");
    $info_905 = $record->get_subfield_array_array("905", "a");
    $info_906 = $record->get_subfield_array_array("906", "a");
    $info_907 = $record->get_subfield_array_array("907", "a");
    $info_908 = $record->get_subfield("908", "a");
    $info_909 = $record->get_subfield("909", "a");
    $info_910 = $record->get_subfield("910", "a");
}