Sorry ... the diffs in my posting were stupid (wrong order) and inline.
I attached better ones.
RUDOLF
Am Freitag, den 08.04.2005, 11:34 +0200 schrieb Rudolf Harney:
> Hi,
> We were asked, to implement the following and want to give it back to
> all:
> 
> Problem: One user sends many requests (Email, web-form, ...), because he
> thinks, more is better or s.th. like that. The requests become different
> tickets. If different agents fetch them, they're answered seperately.
> Thats waste of time and doesn't give the customer a "warm fuzzy
> feeling".
> 
> Solution: All Emails sent in the past x minutes (e.g. 1440, 24 hours)
> from one Email-Adress are followups.
> 
> we made changes in Kernel/System/PostMaster.pm and
> Kernel/Config/Defaults.pm. We're new to programming for otrs, maybe one
> of the expiriences guys want to have a look over the code and give us
> feedback.

*** PostMaster.pm.org	Fri Apr  8 11:26:42 2005
--- PostMaster.20050408.pm	Fri Apr  8 11:29:30 2005
***************
*** 293,302 ****
--- 293,334 ----
                      return ($Tn, $TicketID);
                  }
              }
          }
      }
+     # was there an Email from same adress, shortly? then make it a followup ticket!
+     # [EMAIL PROTECTED] 2005.04.07
+     if ($Self->{ConfigObject}->Get('PostmasterFollowUpSearchInEmailAddress')) {
+ 	if (!($Self->{ConfigObject}->Get('PostmasterFollowUpSearchInEmailAddressTime'))) {
+ 	    $Self->{LogObject}->Log(
+ 				    Priority => 'error', 
+ 				    Message => "No PostmasterFollowUpSearchInEmailAddressTime found!",
+ 				    );
+ 	    return;
+ 	}
+ 	my $TicketTime = $Self->{ConfigObject}->Get('PostmasterFollowUpSearchInEmailAddressTime');
+ 	my $FromAddress = $Self->{ParseObject}->GetEmailAddress(Email => $Self->{ParseObject}->GetParam(WHAT => 'From'));
+ 	my @TicketIDs = $Self->{TicketObject}->TicketSearch(
+ 							    Limit => 1,
+ 							    UserID => 1,
+ 							    Result => 'ARRAY',
+ 							    From => '%'.$FromAddress.'%',
+ 							    StateType => 'Open',
+ 							    TicketCreateTimeNewerMinutes => $TicketTime,
+ 							    OrderBy => 'Down',
+ 							    SortBy => 'Age',
+ 							    );
+ 	my $TicketID = $TicketIDs[0];
+ 	if ($TicketID) {
+ 	    my $Tn = $Self->{TicketObject}->TicketNumberLookup(
+ 							       TicketID => $TicketID,
+ 							       );
+ 	    if ($TicketID && $Tn) {
+ 		return ($Tn, $TicketID);
+ 	    }
+ 	}
+     }
      return;
  }
  # --
  # GetEmailParams
  # --
*** Defaults.pm.org	Fri Apr  8 11:21:23 2005
--- Defaults.20050408.pm	Fri Apr  8 11:21:40 2005
***************
*** 1049,1058 ****
--- 1049,1065 ----
      # PostmasterFollowUpSearchInReferences
      # (If no ticket number in subject, otrs also looks in In-Reply-To
      # and References for follow up checks)
      $Self->{PostmasterFollowUpSearchInReferences} = 0;
  
+     # PostmasterFollowUpSearchInEmailAddress
+     # if someone sends a request from the same Email Adress, twice, in the
+     # time PostmasterFollowUpSearchInEmailAddressTime [minutes], it will
+     # be a followup ticket
+     $Self->{PostmasterFollowUpSearchInEmailAddress} = 1;
+     $Self->{PostmasterFollowUpSearchInEmailAddressTime} = 1440;
+ 
      # PostmasterUserID
      # (The post master db-uid.) [default: 1]
      $Self->{PostmasterUserID} = 1;
  
      # PostmasterDefaultQueue
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to