Changeset 723


Ignore:
Timestamp:
Jan 7, 2014, 4:40:51 PM (11 years ago)
Author:
maron
Message:
  • Fixed: Update LastImport only if is imported version higher then all ready imported
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Import/Import.php

    r720 r723  
    230230          }
    231231          $Output .= '<br />Celkem: '.$Count.'  Nových: '.$this->NewItemCount.'<br />';
    232           $this->System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);
     232          $this->UpdateLastVersion();
    233233        }
    234234        // else $Output .= ShowMessage('Již importován pro verzi '.$this->Version['Version'], MESSAGE_CRITICAL);
     
    387387      }   
    388388      $Output .= '<br />Celkem: '.$Count.'  Nových: '.$this->NewItemCount.'<br />';
    389       $System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);
     389      $this->UpdateLastVersion();
    390390    }
    391391    $Output .= '<strong>Dokončeno.</strong>';
     
    520520    }
    521521    $Output = '<br />Celkem: '.$Count.'  Nových: '.$this->NewItemCount.'<br />';
    522     $this->System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);
     522    $this->UpdateLastVersion();
    523523    return($Output);
    524524  }
     525  function UpdateLastVersion() {
     526    $DbResult = $this->System->Database->query('SELECT * FROM `Group` WHERE `Id`='.$this->Group['Id']);
     527    $Version = $DbResult->fetch_assoc(); 
     528    if ($Version['LastVersion'] < $this->Version['BuildNumber'])
     529      $this->System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);
     530  }
    525531}
  • trunk/includes/Version.php

    r722 r723  
    66// and system will need database update.
    77
    8 $Revision = 722; // Subversion revision
     8$Revision = 723; // Subversion revision
    99$DatabaseRevision = 716; // Database structure revision
    1010$ReleaseTime = '2014-01-07';
Note: See TracChangeset for help on using the changeset viewer.