Пример #1
0
 /**
  * inserts data into the biblio_copy table
  * and create barcodes for the insterted titles
  * barcode is a 12 char code based on the book id
  * @param $data
  * @param $lastInsertID the last inserted id from the biblio table
  * @return nothing
  */
 function insertBiblioCopy($data, $lastInsertID)
 {
     $copy = new BiblioCopy();
     $copy->setBibid($lastInsertID);
     $copy->setCreateDt(date("Y-m-d H:i:s"));
     $copy->setBarcodeNmbr($data[0]);
     $copy->setStatusCd($data[3]);
     $copy->setStatusBeginDt(date("Y-m-d H:i:s"));
     $copy->setBasketNumber($data[5]);
     $copy->setCopyDesc($data[6]);
     $bibcopyQ = new BiblioCopyQuery();
     if ($bibcopyQ->insert($copy) == false) {
         return $bibcopyQ->getError();
     }
     return null;
 }
Пример #2
0
    $nzeros = "5";
    $bibid = $_POST["bibid"];
    $CopyNmbr = $copyQ->nextCopyid($bibid);
    if ($copyQ->errorOccurred()) {
        $copyQ->close();
        displayErrorPage($copyQ);
    }
    $_POST["barcodeNmbr"] = sprintf("%0" . $nzeros . "s", $bibid) . $CopyNmbr;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$bibid = $_POST["bibid"];
$copy = new BiblioCopy();
$copy->setBibid($bibid);
$copy->setCopyDesc($_POST["copyDesc"]);
$_POST["copyDesc"] = $copy->getCopyDesc();
$copy->setBarcodeNmbr($_POST["barcodeNmbr"]);
$_POST["barcodeNmbr"] = $copy->getBarcodeNmbr();
$copy->setLocationid($_POST["location"]);
$_POST["location"] = $copy->getCopyDesc();
$dmQ = new DmQuery();
$dmQ->connect();
$customFields = $dmQ->getAssoc('biblio_copy_fields_dm');
$dmQ->close();
foreach ($customFields as $name => $title) {
    if (isset($_REQUEST['custom_' . $name])) {
        $copy->setCustom($name, $_REQUEST['custom_' . $name]);
    }
}
$validBarco = $_POST["validBarco"];
Пример #3
0
 function _mkObj($array)
 {
     $copy = new BiblioCopy();
     $copy->setBibid($array["bibid"]);
     $copy->setCopyid($array["copyid"]);
     $copy->setCreateDt($array["create_dt"]);
     $copy->setCopyDesc($array["copy_desc"]);
     $copy->setBarcodeNmbr($array["barcode_nmbr"]);
     $copy->setStatusCd($array["status_cd"]);
     $copy->setLocationid($array["locationid"]);
     $copy->setStatusBeginDt($array["status_begin_dt"]);
     $copy->setDueBackDt($array["due_back_dt"]);
     $copy->setDaysLate($array["days_late"]);
     $copy->setMbrid($array["mbrid"]);
     $copy->setRenewalCount($array["renewal_count"]);
     $copy->_custom = $this->getCustomFields($array['bibid'], $array['copyid']);
     return $copy;
 }
Пример #4
0
 $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;
         }
     } else {
         continue;
     }
     $target = trim($targets[$colCount]);
     $mandatoryCols[$target] = true;
     switch ($target) {
Пример #5
0
 function fetchCopy()
 {
     $array = $this->_conn->fetchRow();
     if ($array == false) {
         return false;
     }
     $copy = new BiblioCopy();
     $copy->setBibid($array["bibid"]);
     $copy->setCopyid($array["copyid"]);
     $copy->setCreateDt($array["create_dt"]);
     $copy->setCopyDesc($array["copy_desc"]);
     $copy->setBarcodeNmbr($array["barcode_nmbr"]);
     $copy->setStatusCd($array["status_cd"]);
     $copy->setStatusBeginDt($array["status_begin_dt"]);
     $copy->setDueBackDt($array["due_back_dt"]);
     $copy->setDaysLate($array["days_late"]);
     $copy->setMbrid($array["mbrid"]);
     $copy->setRenewalCount($array["renewal_count"]);
     return $copy;
 }
 function _mkObj(&$array, &$customs = NULL)
 {
     // jalg multi 5-7-2015 ALX
     $copy = new BiblioCopy();
     $copy->setBibid($array["bibid"]);
     $copy->setCopyid($array["copyid"]);
     $copy->setCreateDt($array["create_dt"]);
     $copy->setCopyDesc($array["copy_desc"]);
     $copy->setBarcodeNmbr($array["barcode_nmbr"]);
     $copy->setStatusCd($array["status_cd"]);
     $copy->setStatusBeginDt($array["status_begin_dt"]);
     $copy->setDueBackDt($array["due_back_dt"]);
     $copy->setDaysLate($array["days_late"]);
     $copy->setMbrid($array["mbrid"]);
     $copy->setRenewalCount($array["renewal_count"]);
     if (is_null($customs)) {
         $copy->_custom = $this->getCustomFields($array['bibid'], $array['copyid']);
     } else {
         Fatal::dbError($array["copyid"], "not implemented multycopy method", 'No DBMS error.');
         if (isset($customs[$array['copyid']])) {
             $copy->_custom = $customs[$array['copyid']];
         }
     }
     return $copy;
 }