示例#1
0
function postVarsToBiblio($post)
{
    require_once "../classes/Biblio.php";
    require_once "../classes/BiblioField.php";
    $biblio = new Biblio();
    $biblio->setMaterialCd($post["materialCd"]);
    $biblio->setCollectionCd($post["collectionCd"]);
    $biblio->setCallNmbr1($post["callNmbr1"]);
    $biblio->setCallNmbr2($post["callNmbr2"]);
    $biblio->setCallNmbr3($post["callNmbr3"]);
    $biblio->setLastChangeUserid($_SESSION["userid"]);
    $biblio->setOpacFlg(isset($post["opacFlg"]));
    $indexes = $post["indexes"];
    foreach ($indexes as $index) {
        $value = $post["values"][$index];
        $fieldid = $post["fieldIds"][$index];
        $tag = $post["tags"][$index];
        $subfieldCd = $post["subfieldCds"][$index];
        $requiredFlg = $post["requiredFlgs"][$index];
        $biblioFld = new BiblioField();
        $biblioFld->setFieldid($fieldid);
        $biblioFld->setTag($tag);
        $biblioFld->setSubfieldCd($subfieldCd);
        $biblioFld->setIsRequired($requiredFlg);
        $biblioFld->setFieldData($value);
        $biblio->addBiblioField($index, $biblioFld);
    }
    return $biblio;
}
示例#2
0
function postVarsToBiblio($post)
{
    require_once "../classes/Biblio.php";
    require_once "../classes/BiblioField.php";
    $biblio = new Biblio();
    $biblio->setMaterialCd($post["materialCd"]);
    $biblio->setCollectionCd($post["collectionCd"]);
    $biblio->setCallNmbr1($post["callNmbr1"]);
    $biblio->setCallNmbr2($post["callNmbr2"]);
    $biblio->setCallNmbr3($post["callNmbr3"]);
    //#C1 - begin
    $biblio->setReadingLevel($post["readingLevel"]);
    $GLOBALS["title"] = $post['values']['245a'];
    $GLOBALS["author"] = $post['values']['100a'];
    $GLOBALS["publication"] = $post['values']['260b'];
    //#C1 - end
    $biblio->setLastChangeUserid($_SESSION["userid"]);
    $biblio->setOpacFlg(isset($post["opacFlg"]));
    $indexes = $post["indexes"];
    foreach ($indexes as $index) {
        $value = $post["values"][$index];
        $fieldid = $post["fieldIds"][$index];
        $tag = $post["tags"][$index];
        $subfieldCd = $post["subfieldCds"][$index];
        $requiredFlg = $post["requiredFlgs"][$index];
        $biblioFld = new BiblioField();
        $biblioFld->setFieldid($fieldid);
        $biblioFld->setTag($tag);
        $biblioFld->setSubfieldCd($subfieldCd);
        $biblioFld->setIsRequired($requiredFlg);
        $biblioFld->setFieldData($value);
        $biblio->addBiblioField($index, $biblioFld);
    }
    return $biblio;
}
 function doQuery($bibid, $tab = "cataloging")
 {
     # reset rowNmbr
     $this->_rowNmbr = 0;
     $this->_currentRowNmbr = 1;
     $this->_rowCount = 1;
     $this->_pageCount = 1;
     $exclude = array("363x", "526x", "583x", "754x", "852x", "856x");
     /***********************************************************
      *  Reading biblio data
      ***********************************************************/
     # setting query that will return all the data in biblio
     $sql = $this->mkSQL("select biblio.*, staff.username " . "from biblio left join staff " . "on biblio.last_change_userid = staff.userid " . "where biblio.bibid = %N ", $bibid);
     if (!$this->_query($sql, $this->_loc->getText("biblioQueryQueryErr1"))) {
         return false;
     }
     $array = $this->_conn->fetchRow();
     $bib = new Biblio();
     $bib->setBibid($array["bibid"]);
     $bib->setCreateDt($array["create_dt"]);
     $bib->setLastChangeDt($array["last_change_dt"]);
     $bib->setLastChangeUserid($array["last_change_userid"]);
     if (isset($array["username"])) {
         $bib->setLastChangeUsername($array["username"]);
     }
     $bib->setMaterialCd($array["material_cd"]);
     $bib->setCollectionCd($array["collection_cd"]);
     $bib->setCallNmbr1($array["call_nmbr1"]);
     $bib->setCallNmbr2($array["call_nmbr2"]);
     $bib->setCallNmbr3($array["call_nmbr3"]);
     if ($array["opac_flg"] == "Y") {
         $bib->setOpacFlg(true);
     } else {
         $bib->setOpacFlg(false);
     }
     /***********************************************************
      *  Reading biblio_field data
      ***********************************************************/
     # setting query that will return all the data in biblio
     $sql = $this->mkSQL("select biblio_field.* " . "from biblio_field " . "where biblio_field.bibid = %N " . "order by tag, subfield_cd ", $bibid);
     if (!$this->_query($sql, $this->_loc->getText("biblioQueryQueryErr2"))) {
         return false;
     }
     /***********************************************************
      *  Adding fields from biblio to Biblio object 
      ***********************************************************/
     foreach ($this->_fieldsInBiblio as $key => $name) {
         $tag = substr($key, 0, 3);
         $subfieldCd = substr($key, 3, 1);
         $subfieldIdx = '';
         if (count($key) > 4) {
             $index = substr($key, 4);
         }
         $this->_addField($tag, $subfieldCd, $array[$name], $bib, $subfieldIdx);
     }
     /***********************************************************
      *  Adding fields from biblio_field to Biblio object 
      ***********************************************************/
     # subfieldIdx will be used to construct index
     $subfieldIdx = 0;
     $saveTag = "";
     $saveSubfield = "";
     while ($array = $this->_conn->fetchRow()) {
         $tag = $array["tag"];
         $subfieldCd = $array["subfield_cd"];
         if ($tab == "opac" and in_array($tag . $subfieldCd, $exclude)) {
             continue;
         }
         # checking for tag and subfield break in order to set the subfield Idx correctly.
         if ($tag == $saveTag and $subfieldCd == $saveSubfield) {
             $subfieldIdx = $subfieldIdx + 1;
         } else {
             $subfieldIdx = 0;
             $saveTag = $tag;
             $saveSubfield = $subfieldCd;
         }
         # setting the index.
         # format is ttts[i] where
         #    t=tag
         #    s=subfield code
         #    i=subfield index if > 0
         # examples: 020a 650a 650a1 650a2
         $index = sprintf("%03d", $tag) . $subfieldCd;
         if ($subfieldIdx > 0) {
             $index = $index . $subfieldIdx;
         }
         $bibFld = new BiblioField();
         $bibFld->setBibid($array["bibid"]);
         $bibFld->setFieldid($array["fieldid"]);
         $bibFld->setTag($array["tag"]);
         $bibFld->setInd1Cd($array["ind1_cd"]);
         $bibFld->setInd2Cd($array["ind2_cd"]);
         $bibFld->setSubfieldCd($array["subfield_cd"]);
         $bibFld->setFieldData($array["field_data"]);
         $bib->addBiblioField($index, $bibFld);
     }
     return $bib;
 }
if (count($_FILES) == 0) {
    header("Location: upload_usmarc_form.php");
    exit;
}
include "../shared/header.php";
require_once "import_usmarc_excludes.php";
$recordterminator = "";
$fieldterminator = "";
$delimiter = "";
$usmarc_str = fileGetContents($_FILES["usmarc_data"]["tmp_name"]);
$records = explode($recordterminator, $usmarc_str);
// We separated with a terminator, so the last element will always be empty.
array_pop($records);
$biblios = array();
foreach ($records as $record) {
    $biblio = new Biblio();
    $biblio->setLastChangeUserid($_POST["userid"]);
    $biblio->setMaterialCd($_POST["materialCd"]);
    $biblio->setCollectionCd($_POST["collectionCd"]);
    $biblio->setOpacFlg($_POST["opac"] == 'Y');
    $start = substr($record, 12, 5);
    $header = substr($record, 24, $start - 25);
    $codes = array();
    for ($l = 0; $l < strlen($header); $l += 12) {
        $code = substr($header, $l, 12);
        $codes[] = substr($code, 0, 3);
    }
    $j = 0;
    foreach (explode($fieldterminator, substr($record, $start)) as $field) {
        if ($codes[$j][0] == '0' and $codes[$j][1] == '0') {
            $j++;
示例#5
0
function postVarsToBiblio($post)
{
    require_once "../classes/Biblio.php";
    require_once "../classes/BiblioField.php";
    $biblio = new Biblio();
    $biblio->setMaterialCd($post["materialCd"]);
    $biblio->setCollectionCd($post["collectionCd"]);
    $biblio->setCallNmbr1($post["callNmbr1"]);
    $biblio->setCallNmbr2($post["callNmbr2"]);
    $biblio->setCallNmbr3($post["callNmbr3"]);
    $biblio->setLanguage($post["language"]);
    $biblio->setOthernumber($post["othernumber"]);
    #print( "input upload = " + $_FILES['input_upload']['size'] );
    //set image location
    if ($_FILES['input_upload']['size'] == 0) {
        $img = DEFAULT_IMAGE;
    } else {
        $img = fileUpload("input_upload");
    }
    $biblio->setImageLocation($img);
    $biblio->setLastChangeUserid($_SESSION["userid"]);
    $biblio->setOpacFlg(isset($post["opacFlg"]));
    $indexes = $post["indexes"];
    foreach ($indexes as $index) {
        $value = $post["values"][$index];
        $fieldid = $post["fieldIds"][$index];
        $tag = $post["tags"][$index];
        $subfieldCd = $post["subfieldCds"][$index];
        $requiredFlg = $post["requiredFlgs"][$index];
        $biblioFld = new BiblioField();
        $biblioFld->setFieldid($fieldid);
        $biblioFld->setTag($tag);
        $biblioFld->setSubfieldCd($subfieldCd);
        $biblioFld->setIsRequired($requiredFlg);
        $biblioFld->setFieldData($value);
        $biblio->addBiblioField($index, $biblioFld);
    }
    return $biblio;
}
示例#6
0
    });
    /**
     * Biblio update
     *
     * @path    /biblio/update/id/token
     *
     * @param   integer   id
     * @param   string    token
     *
     * @return  boolean
     */
    $app->put('/update/{id:[0-9]+}/{token}', function ($request, $response, $args) {
        /*coming soon*/
    });
    /**
     * Biblio delete
     *
     * @path    /biblio/delete/id/token
     *
     * @param   integer   id
     * @param   string    token
     *
     * @return  boolean
     */
    $app->delete('/delete/{id:[0-9]+}/{token}', function ($request, $response, $args) {
        $post = Biblio::find_by_biblio_id($args['id']);
        $post->delete();
        return $response->getBody()->write('Data biblio "' . $post->title . '" deleted.');
    });
})->add($validate);
// inject middleware token auth
 function _getBiblio($post)
 {
     require_once "Biblio.php";
     require_once "BiblioField.php";
     $biblio = new Biblio();
     $biblio->setMaterialCd($post["materialCd"]);
     $biblio->setCollectionCd($post["collectionCd"]);
     $biblio->setCallNmbr1($post["callNmbr1"]);
     $biblio->setLastChangeUserid($_SESSION["userid"]);
     $biblio->setOpacFlg($post["opac"]);
     unset($post['callNmbr1'], $post['callNmbr2'], $post['callNmbr3'], $post['collectionCd'], $post['materialCd'], $post["opac"]);
     $post['020a'] = $this->verifyISBN($post['020a']);
     $title_trail = substr($post['245a'], strlen($post['245a']) - 1);
     if ($title_trail == '/' || $title_trail == ':') {
         $post['245a'] = substr($post['245a'], 0, -1);
     }
     foreach ($post as $index => $val) {
         $value = $val;
         $fieldid = '';
         $tag = 0 + substr($index, 0, 3);
         $subfieldCd = substr($index, 3, 1);
         $requiredFlg = '';
         if ($index == '100a' || $index == '245a') {
             // Author, Title
             $requiredFlg = 1;
         }
         $biblioFld = new BiblioField();
         $biblioFld->setFieldid($fieldid);
         $biblioFld->setTag($tag);
         $biblioFld->setSubfieldCd($subfieldCd);
         $biblioFld->setIsRequired($requiredFlg);
         $biblioFld->setFieldData($value);
         $biblio->addBiblioField($index, $biblioFld);
     }
     return $biblio;
 }
$errorList = array();
$recCount = 0;
$newBarcodes = array();
// TODO: For import of multiple copies, introduce copies array?
foreach ($records as $record) {
    $recCount++;
    $mandatoryCols = array("Call1" => false, '245$a' => false, '100$a' => false);
    $localErrors = array();
    $localWarnings = array();
    $barcode = "";
    $record = trim($record);
    if ($record == "") {
        continue;
    }
    $colCount = 0;
    $biblio = new Biblio();
    $biblio->setLastChangeUserid($_POST["userid"]);
    $biblio->setMaterialCd($defaultMaterial);
    $biblio->setCollectionCd($defaultCollection);
    $biblio->setOpacFlg($_POST["opac"] == 'Y');
    $copy = new BiblioCopy();
    $copy->setBibid("!auto!");
    $copy->setCopyDesc($_POST["copyText"]);
    $copy->setStatusCd($defaultstatus_dm);
    //JALG 3-2015 añadido para opción de estado de materiales
    $entries = explode($fieldterminator, $record);
    for ($colCount = 0; $colCount < count($targets); $colCount++) {
        if (isset($entries[$colCount])) {
            $entry = trim($entries[$colCount]);
            if ($entry == "") {
                continue;
示例#9
0
    $biblio_id = (int) $_GET['id'];
}
/*
if (isset($_GET['style'])) {
  $cite_style = strtolower(trim($_GET['style']));
}
$cite_style_template = SB.'template'.DS.'citation'.DS.$cite_style.'_style_template.php';
if (!file_exists($cite_style_template)) {
  exit(__('Sorry, no cite template available.'));
}
*/
require SIMBIO . 'simbio_FILE/simbio_directory.inc.php';
$dir = new simbio_directory(SB . 'template' . DS . $sysconf['template']['theme'] . DS . 'citation');
$style_files = $dir->getFileList();
// create Biblio
$biblio = new Biblio($dbs, $biblio_id);
$biblio_detail = $biblio->detail();
// var_dump($biblio_detail);
extract($biblio_detail);
// Pre-proccess author
$authors_string = '';
$author_list = array();
$last_author = '';
$a = 0;
foreach ($authors as $auth) {
    // invert first author name if it is not inverted
    if ($a == 0 && stripos($auth['author_name'], ',', 2) === false) {
        $last_name = strrpos($auth['author_name'], ' ') + 1;
        $name = substr($auth['author_name'], $last_name);
        die($name);
        $author_list[] = $name;
示例#10
0
    }
    if (count($_SESSION['marcexport']) < 1) {
        utility::jsAlert(__('There is no data to export!'));
    }
    // concat all ID together
    $item_ids = '';
    foreach ($_SESSION['marcexport'] as $id) {
        $item_ids .= '\'' . $id . '\',';
    }
    // strip the last comma
    $item_ids = substr_replace($item_ids, '', -1);
    // unset the session
    unset($_SESSION['marcexport']);
    header('Content-type: application/marc');
    header('Content-disposition: attachment; filename=slims-marc-export.mrc');
    $biblio = new Biblio($dbs, null);
    echo $biblio->marc_export($item_ids);
    // utility::jsAlert('Done..');
    exit;
}
?>

<fieldset class="menuBox">
<div class="menuBoxInner printIcon">
  <div class="per_title">
	  <h2><?php 
echo __('Export Catalog to Marc Format ');
?>
</h2>
  </div>
  <div class="sub_section">