Skip to content
Snippets Groups Projects

Hotline#15920 regression quality cannot be null on insert

Compare and
+ 24
18
Preferences
Compare changes
@@ -216,44 +216,50 @@ class notice_integration
}
// Mise a jour
if(!$id_notice)
{
if(!$id_notice) {
$this->notice["qualite"]=$this->qualite_bib;
$id_notice=$this->insertNotice();
if(!$id_notice) return;
else $this->statut=1;
}
else
{
} else {
// Controle des identifiants pour dedoublonnage eventuel
if($this->identification["statut"] == "code_barres")
{
if ($this->identification["statut"] == "code_barres") {
// Lecture identifiants de la notice de la base
$new_id_notice=0;
$enreg=$sql->fetchEnreg("Select isbn,ean,id_commerciale from notices where id_notice=$id_notice");
if($this->notice["isbn10"] and $this->notice["isbn10"] != $enreg["isbn"] and $this->notice["isbn13"] != $enreg["isbn"])
{
$enreg = $sql->fetchEnreg("Select isbn,ean,id_commerciale from notices where id_notice=$id_notice");
if ($this->notice["isbn10"]
and $this->notice["isbn10"] != $enreg["isbn"]
and $this->notice["isbn13"] != $enreg["isbn"]) {
$new_id_notice=$this->identification["isbn"];
if(!$new_id_notice) $new_id_notice="creation";
}
if(!$new_id_notice and $this->notice["ean"] and $this->notice["ean"] != $enreg["ean"])
{
if(!$new_id_notice
and $this->notice["ean"]
and $this->notice["ean"] != $enreg["ean"]) {
$new_id_notice=$this->identification["ean"];
if(!$new_id_notice) $new_id_notice="creation";
}
// if(!$new_id_notice and !$ean and $this->notice["id_commerciale"] != $enreg["id_commerciale"])
// {
// $new_id_notice=$this->identification["id_commerciale"];
// if(!$new_id_notice) $new_id_notice="creation";
// }
if($new_id_notice)
{
if($new_id_notice == "creation") { $new_id_notice=$this->insertNotice(); if(!$new_id_notice) return; }
else $this->updateNotice($new_id_notice,$this->qualite_bib);
if ($new_id_notice) {
if ($new_id_notice == "creation") {
$this->notice["qualite"]=$this->qualite_bib;
$new_id_notice = $this->insertNotice();
if (!$new_id_notice) return;
} else {
$this->updateNotice($new_id_notice,$this->qualite_bib);
}
// on supprime les exemplaires de l'ancienne notice
for($i=0; $i<count($this->notice["exemplaires"]); $i++)
{
for($i=0; $i<count($this->notice["exemplaires"]); $i++) {
$ex=$this->notice["exemplaires"][$i];
$sql->execute("delete from exemplaires where id_bib=$id_bib and id_notice=$id_notice and code_barres='".$ex["code_barres"]."'");
}