[otrs-cvs] otrs/Kernel/System/Ticket ArticleStorageDB.pm, 1.52, 1.53 ArticleStorageFS.pm, 1.47, 1.48

CVS commits notifications of OTRS.org cvs-log at otrs.org
Tue May 6 22:33:16 GMT 2008


Comments:
Update of /home/cvs/otrs/Kernel/System/Ticket
In directory lancelot:/tmp/cvs-serv17247/Kernel/System/Ticket

Modified Files:
	ArticleStorageDB.pm ArticleStorageFS.pm 
Log Message:
Moved to dedicate ArticleDelete().

Author: martin

Index: ArticleStorageDB.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Ticket/ArticleStorageDB.pm,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** ArticleStorageDB.pm	8 Apr 2008 16:27:08 -0000	1.52
--- ArticleStorageDB.pm	6 May 2008 22:33:10 -0000	1.53
***************
*** 41,45 ****
  
      # check needed stuff
!     for (qw(TicketID UserID)) {
          if ( !$Param{$_} ) {
              $Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
--- 41,45 ----
  
      # check needed stuff
!     for (qw(ArticleID UserID)) {
          if ( !$Param{$_} ) {
              $Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
***************
*** 48,91 ****
      }
  
!     # delete attachments and plain emails
!     my @Articles = $Self->ArticleIndex( TicketID => $Param{TicketID} );
!     for (@Articles) {
  
!         # delete time accounting
!         $Self->ArticleAccountedTimeDelete(
!             ArticleID => $_,
!             UserID    => $Param{UserID},
!         );
  
!         # delete attachments
!         $Self->ArticleDeleteAttachment(
!             ArticleID => $_,
!             UserID    => $Param{UserID},
!         );
  
!         # delete plain message
!         $Self->ArticleDeletePlain(
!             ArticleID => $_,
!             UserID    => $Param{UserID},
!         );
  
!         # delete storage directory
!         $Self->_ArticleDeleteDirectory(
!             ArticleID => $_,
!             UserID    => $Param{UserID},
!         );
!     }
  
      # delete articles
      return if ! $Self->{DBObject}->Do(
!         SQL  => 'DELETE FROM article WHERE ticket_id = ?',
!         Bind => [ \$Param{TicketID} ],
      );
  
-     # delete history
-     return if ! $Self->HistoryDelete(
-         TicketID => $Param{TicketID},
-         UserID => $Param{UserID},
-     );
      return 1;
  }
--- 48,87 ----
      }
  
!     # delete index
!     $Self->ArticleIndexDelete(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
!     # delete time accounting
!     $Self->ArticleAccountedTimeDelete(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
!     # delete attachments
!     $Self->ArticleDeleteAttachment(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
!     # delete plain message
!     $Self->ArticleDeletePlain(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
!     # delete storage directory
!     $Self->_ArticleDeleteDirectory(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
      # delete articles
      return if ! $Self->{DBObject}->Do(
!         SQL  => 'DELETE FROM article WHERE id = ?',
!         Bind => [ \$Param{ArticleID} ],
      );
  
      return 1;
  }

Author: martin

Index: ArticleStorageFS.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Ticket/ArticleStorageFS.pm,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** ArticleStorageFS.pm	8 Apr 2008 16:27:08 -0000	1.47
--- ArticleStorageFS.pm	6 May 2008 22:33:10 -0000	1.48
***************
*** 68,72 ****
  
      # check needed stuff
!     for (qw(TicketID UserID)) {
          if ( !$Param{$_} ) {
              $Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
--- 68,72 ----
  
      # check needed stuff
!     for (qw(ArticleID UserID)) {
          if ( !$Param{$_} ) {
              $Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
***************
*** 75,117 ****
      }
  
!     # delete attachments and plain emails
!     my @Articles = $Self->ArticleIndex( TicketID => $Param{TicketID} );
!     for (@Articles) {
  
!         # delete time accounting
!         $Self->ArticleAccountedTimeDelete(
!             ArticleID => $_,
!             UserID    => $Param{UserID},
!         );
  
!         # delete attachments
!         $Self->ArticleDeleteAttachment(
!             ArticleID => $_,
!             UserID    => $Param{UserID},
!         );
  
!         # delete plain message
!         $Self->ArticleDeletePlain(
!             ArticleID => $_,
!             UserID    => $Param{UserID},
!         );
  
!         # delete storage directory
!         $Self->_ArticleDeleteDirectory(
!             ArticleID => $_,
!             UserID    => $Param{UserID},
!         );
!     }
  
      # delete articles
      return if ! $Self->{DBObject}->Do(
!         SQL  => 'DELETE FROM article WHERE ticket_id = ?',
!         Bind => [ \$Param{TicketID} ],
!     );
! 
!     # delete history
!     return if ! $Self->HistoryDelete(
!         TicketID => $Param{TicketID},
!         UserID => $Param{UserID},
      );
  
--- 75,112 ----
      }
  
!     # delete index
!     $Self->ArticleIndexDelete(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
!     # delete time accounting
!     $Self->ArticleAccountedTimeDelete(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
!     # delete attachments
!     $Self->ArticleDeleteAttachment(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
!     # delete plain message
!     $Self->ArticleDeletePlain(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
!     # delete storage directory
!     $Self->_ArticleDeleteDirectory(
!         ArticleID => $Param{ArticleID},
!         UserID    => $Param{UserID},
!     );
  
      # delete articles
      return if ! $Self->{DBObject}->Do(
!         SQL  => 'DELETE FROM article WHERE id = ?',
!         Bind => [ \$Param{ArticleID} ],
      );
  


More information about the cvs-log mailing list