[otrs-cvs] CVS: Artefact/Kernel/System Artefact.pm,1.6,1.7

cvs-log at otrs.org cvs-log at otrs.org
Tue Nov 14 11:40:01 CET 2006


Update of /home/cvs/Artefact/Kernel/System
In directory lancelot:/tmp/cvs-serv31107/Kernel/System

Modified Files:
	Artefact.pm 
Log Message:
fixed bugs

Index: Artefact.pm
===================================================================
RCS file: /home/cvs/Artefact/Kernel/System/Artefact.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** Artefact.pm	25 Feb 2005 07:43:22 -0000	1.6
--- Artefact.pm	14 Nov 2006 10:39:59 -0000	1.7
***************
*** 1,5 ****
  # --
  # Kernel/System/Artefact.pm - all artefact functions
! # Copyright (C) 2003-2005 OTRS GmbH, http://www.otrs.de/
  # --
  # $Id$
--- 1,5 ----
  # --
  # Kernel/System/Artefact.pm - all artefact functions
! # Copyright (C) 2003-2006 OTRS GmbH, http://otrs.com/
  # --
  # $Id$
***************
*** 34,56 ****
  create a object
  
!   use Kernel::Config;
!   use Kernel::System::Log;
!   use Kernel::System::DB;
!   use Kernel::System::Artefact;
! 
!   my $ConfigObject = Kernel::Config->new();
!   my $LogObject    = Kernel::System::Log->new(
!       ConfigObject => $ConfigObject,
!   );
!   my $DBObject = Kernel::System::DB->new(
!       ConfigObject => $ConfigObject,
!       LogObject => $LogObject,
!   );
!   my $ArtefactObject = Kernel::System::Artefact->new(
!       ConfigObject => $ConfigObject,
!       LogObject => $LogObject,
!       DBObject => $DBObject,
!       UserID => 123,
!   );
  
  =cut
--- 34,56 ----
  create a object
  
!     use Kernel::Config;
!     use Kernel::System::Log;
!     use Kernel::System::DB;
!     use Kernel::System::Artefact;
! 
!     my $ConfigObject = Kernel::Config->new();
!     my $LogObject    = Kernel::System::Log->new(
!         ConfigObject => $ConfigObject,
!     );
!     my $DBObject = Kernel::System::DB->new(
!         ConfigObject => $ConfigObject,
!         LogObject => $LogObject,
!     );
!     my $ArtefactObject = Kernel::System::Artefact->new(
!         ConfigObject => $ConfigObject,
!         LogObject => $LogObject,
!         DBObject => $DBObject,
!         UserID => 123,
!     );
  
  =cut
***************
*** 121,126 ****
      if (my @Row = $Self->{DBObject}->FetchrowArray()) {
          $Self->{LogObject}->Log(
!              Priority => 'error',
!              Message => "The MD5sum of the file $Param{Filename} already exists!",
          );
          return;
--- 121,126 ----
      if (my @Row = $Self->{DBObject}->FetchrowArray()) {
          $Self->{LogObject}->Log(
!             Priority => 'error',
!             Message => "The MD5sum of the file $Param{Filename} already exists!",
          );
          return;
***************
*** 202,207 ****
      # db update
      if ($Self->{DBObject}->Do(SQL => $SQL)) {
!        # Update file
!        if ($Param{Content}) {
              # get MD5
              my $ctx = Digest::MD5->new;
--- 202,207 ----
      # db update
      if ($Self->{DBObject}->Do(SQL => $SQL)) {
!         # Update file
!         if ($Param{Content}) {
              # get MD5
              my $ctx = Digest::MD5->new;
***************
*** 318,329 ****
      $Self->{DBObject}->Prepare (
          SQL => "SELECT a.artefact_id, a.description, a.file_name, a.file_size, ".
!                " a.file_type, a.file_md5, a.type_id, at.description, a.number, a.title, ".
!                " a.created, a.created_by, a.changed, a.changed_by ".
!                " FROM ".
!                " artefact a, artefact_type at  ".
!                " WHERE ".
!                " a.type_id = at.id ".
!                " AND ".
!                " a.artefact_id = $Param{ArtefactID}",
      );
      # fetch Data
--- 318,329 ----
      $Self->{DBObject}->Prepare (
          SQL => "SELECT a.artefact_id, a.description, a.file_name, a.file_size, ".
!             " a.file_type, a.file_md5, a.type_id, at.description, a.number, a.title, ".
!             " a.created, a.created_by, a.changed, a.changed_by ".
!             " FROM ".
!             " artefact a, artefact_type at  ".
!             " WHERE ".
!             " a.type_id = at.id ".
!             " AND ".
!             " a.artefact_id = $Param{ArtefactID}",
      );
      # fetch Data
***************
*** 360,364 ****
  to get an artefact binary
  
!     my %Artefact = $ArtefactObject->ArtefactGet(
          ArtefactID => 4321,
      );
--- 360,364 ----
  to get an artefact binary
  
!     my %Artefact = $ArtefactObject->ArtefactGetBinary(
          ArtefactID => 4321,
      );
***************
*** 384,388 ****
      $Self->{DBObject}->Prepare (
          SQL => "SELECT artefact_id, file_name, file_type, file FROM artefact ".
!                "WHERE artefact_id = $Param{ArtefactID}",
      );
      # fetch Data
--- 384,388 ----
      $Self->{DBObject}->Prepare (
          SQL => "SELECT artefact_id, file_name, file_type, file FROM artefact ".
!             "WHERE artefact_id = $Param{ArtefactID}",
      );
      # fetch Data
***************
*** 462,466 ****
      }
  
- 
      if ($Param{FileMD5}) {
          $Where .= "AND file_md5 = '$Param{FileMD5}' ";
--- 462,465 ----
***************
*** 486,490 ****
  
      $SQL = "SELECT distinct(artefact_id) FROM artefact ".
!        "WHERE artefact_id > 0 $Where ORDER BY $Param{Order}";
      # db select
      $Self->{DBObject}->Prepare (SQL => $SQL, Limit => $Param{Limit} || 3000);
--- 485,489 ----
  
      $SQL = "SELECT distinct(artefact_id) FROM artefact ".
!         "WHERE artefact_id > 0 $Where ORDER BY $Param{Order}";
      # db select
      $Self->{DBObject}->Prepare (SQL => $SQL, Limit => $Param{Limit} || 3000);
***************
*** 650,653 ****
--- 649,654 ----
  1;
  
+ =back
+ 
  =head1 TERMS AND CONDITIONS
  



More information about the cvs-log mailing list