Martin Edenhofer | 1 Aug 2004 09:54
Picon

PostgrSQL help?

Hi,

is there somebody who can help me with postgrresql?

I need to change the data type of the article.a_message_id from
varchar(250) to varchar(1000).

> ALTER TABLE article ALTER COLUMN article SET varchar(1000);

is not working, because I think it's not (easy) possible to
change the data type in postgrsql.

What is the syntax for postgresql?

Thanks for your help!

  Martin 

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
        http://www.otrs.de/ :: Manage your communication! 

_______________________________________________
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

Arne Georg Gleditsch | 2 Aug 2004 08:45
Picon

Re: PostgrSQL help?

* Martin Edenhofer
> I need to change the data type of the article.a_message_id from
> varchar(250) to varchar(1000).
>
>> ALTER TABLE article ALTER COLUMN article SET varchar(1000);
>
> is not working, because I think it's not (easy) possible to
> change the data type in postgrsql.
>
> What is the syntax for postgresql?
>
> Thanks for your help!

You might want to see
http://thread.gmane.org/gmane.comp.otrs.devel/530.  Essentially,
you'll have to do something like this:

  ALTER TABLE article ADD COLUMN a_message_id_new varchar(1000);
  UPDATE article SET a_message_id_new = a_message_id;
  ALTER TABLE article DROP COLUMN a_message_id;
  ALTER TABLE article RENAME COLUMN a_message_id_new TO a_message_id;

And then add any necessary default values and keys/constraints to the
new column.  If this is on a live system, you'll have to lock the
table as well, but you can probably do the ADD COLUMN outside the
lock.  If you want to disturb the live system as little as possible,
you probably want to see if renaming the column a_message_id to
a_message_id_old is faster than dropping it, and if so do just that
inside the transaction and then drop it afterwards.

(Continue reading)

Martin Edenhofer | 3 Aug 2004 01:54
Picon

Re: Re: PostgrSQL help?

Hi Arne,

thanks for your really good help! :)

 Martin

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
        http://www.otrs.de/ :: Manage your communication! 

On Mon, Aug 02, 2004 at 08:45:21AM +0200, Arne Georg Gleditsch wrote:
> * Martin Edenhofer
> > I need to change the data type of the article.a_message_id from
> > varchar(250) to varchar(1000).
> >
> >> ALTER TABLE article ALTER COLUMN article SET varchar(1000);
> >
> > is not working, because I think it's not (easy) possible to
> > change the data type in postgrsql.
> >
> > What is the syntax for postgresql?
> >
> > Thanks for your help!
> 
> You might want to see
> http://thread.gmane.org/gmane.comp.otrs.devel/530.  Essentially,
> you'll have to do something like this:
> 
>   ALTER TABLE article ADD COLUMN a_message_id_new varchar(1000);
>   UPDATE article SET a_message_id_new = a_message_id;
(Continue reading)

Robert Heinzmann | 3 Aug 2004 19:17
Picon

Bug in CustomerUser.pm

Hello,

attached you find a patch for Kernel/System/CustomerUser.pm 1.2.3. It is 
a minor bug fix.

Problem: The customer username is not visible, because it is overwritten 
if you have mutiple customer data sources.

Bye,

Robert Heinzmann
--- otrs.orig/Kernel/System/CustomerUser.pm	2004-04-02 15:41:46.000000000 +0200
+++ otrs/Kernel/System/CustomerUser.pm	2004-08-03 19:13:00.000000000 +0200
 <at>  <at>  -106,7 +106,9  <at>  <at> 
     my $Name = $Self->{CustomerUser}->CustomerName(%Param) || ''; 
     foreach (1..10) {
         if ($Self->{"CustomerUser$_"}) {
-            $Name = $Self->{"CustomerUser$_"}->CustomerName(%Param);
+	    if (my $tempName=$Self->{"CustomerUser$_"}->CustomerName(%Param)) {
+	            $Name = $tempName;
+	    }
         }
     }
     return $Name;
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
(Continue reading)

Martin Edenhofer | 4 Aug 2004 08:14
Picon

Re: Bug in CustomerUser.pm

Hi Robert,

thanks for your fix. :) This will work fien for OTRS 1.2.

In OTRS 1.3 we also reworked this module and also improved the 
performance. If the first name from one source is found, the 
the name will be returned and no more lookups will be done:

[...]
    foreach ('', 1..10) {
        if ($Self->{"CustomerUser$_"}) {
            my $Name = $Self->{"CustomerUser$_"}->CustomerName(%Param);
            if ($Name) {
                return $Name;
            }
        }
    }
    return; 
[...]

Anyway, thanks for your good patch for OTRS 1.2! :-)

  Martin Edenhofer

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
        http://www.otrs.de/ :: Manage your communication! 

On Tue, Aug 03, 2004 at 07:17:54PM +0200, Robert Heinzmann wrote:
> attached you find a patch for Kernel/System/CustomerUser.pm 1.2.3. It is 
(Continue reading)

Paul | 6 Aug 2004 14:11

Spell check line breaks

Hi all,

Running spell check on text and pressing "Done" currently adds line breaks
to the text so that subsequent editing becomes almost impossible without
having to manually remove them all. Would it be possible to instead add the
line breaks upon send instead of while the entry is still being composed?

Paul

_______________________________________________
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

Nigel Clarke | 6 Aug 2004 18:10

History.pm

Not sure of the best way to present my changes. If there is a better way
to code this or present it please let me know.

We monitor our staffs activity by counting the number of closures they
do.
Reporting who closed a ticket can be a problem with the current
ticket_history structure when using "pending close" as the admin is
identified as the change_by. 

I have added a current_owner field (int) to ticket_history table. 

Code changes to History.pm as follows:

# -- Modification:
sub OwnerLookup {
        my $Self = shift;
        my %Param =  <at> _;

        if (!$Param{TicketID}) {
                $Self->{LogObject}->Log(Priority => 'error', Message =>
"OwnerLookup:Need TicketID!");
                return; 
        }
        # check if we ask the same request?
        if (exists
$Self->{"Ticket::History::OwnerLookup::$Param{TicketID}"}) {
                return
$Self->{"Ticket::History::OwnerLookup::$Param{TicketID}"};
        }
        my $SQL = "SELECT user_id FROM ticket WHERE id =
(Continue reading)

Martin Edenhofer | 7 Aug 2004 10:49
Picon

Re: History.pm

Hi Nigel,

in OTRS 1.3 (current cvs) you can write a .pm with your own/changed 
Kernel::System::Ticket functions.

Just put your functions in to e. g. Kernel/System/Ticket/Custom.pm
and in Kernel/Config.pm:

    # TicketCustomModule
    # (custom functions to redefine Kernel::System::Ticket functions)
    $Self->{TicketCustomModule} = 'Kernel::System::Ticket::Custom';

This way you will overwrite the Kernel::System::Ticket with
the functions from your Kernel/System/Ticket/Custom.pm.

PS: We also added the OwnerID to the ticket_history table.

Thanks for your idea! .-) 

  Martin Edenhofer

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
        http://www.otrs.de/ :: Manage your communication! 

On Fri, Aug 06, 2004 at 05:10:52PM +0100, Nigel Clarke wrote:
> Not sure of the best way to present my changes. If there is a better way
> to code this or present it please let me know.
> 
> We monitor our staffs activity by counting the number of closures they
(Continue reading)

Andreas Jobs | 9 Aug 2004 14:29
Picon
Favicon

Radius Auth Module


Hi list,

one may find Kernel::System::Auth::Radius useful. Here we go:

# --
# Kernel/System/Auth/Radius.pm - provides the radius authentification 
# based on Martin Edenhofer's Kernel::System::Auth::DB
# Copyright (C) 2004 Andreas Jobs <Andreas.Jobs+dev <at> ruhr-uni-bochum.de>
# --
# $Id: Radius.pm,v 1.0 2004/08/07 00:50:36 jobsanzl Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see 
# the enclosed file COPYING for license information (GPL). If you 
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --
# Note: 
# available objects are: ConfigObject, LogObject and DBObject
# --

package Kernel::System::Auth::Radius;

use strict;
use Authen::Radius;

use vars qw($VERSION);
$VERSION = '$Revision: 1.0 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;

# --
(Continue reading)

Martin Edenhofer | 10 Aug 2004 11:25
Picon

Re: Radius Auth Module

Hi Andreas,

good work! :) 

Is it free to put it into the OTRS framework?

Thanks for feedback!

 -Martin

On Mon, Aug 09, 2004 at 02:29:13PM +0200, Andreas Jobs wrote:
> 
> Hi list,
> 
> one may find Kernel::System::Auth::Radius useful. Here we go:
> 
> 
> # --
> # Kernel/System/Auth/Radius.pm - provides the radius authentification 
> # based on Martin Edenhofer's Kernel::System::Auth::DB
> # Copyright (C) 2004 Andreas Jobs <Andreas.Jobs+dev <at> ruhr-uni-bochum.de>
> # --
> # $Id: Radius.pm,v 1.0 2004/08/07 00:50:36 jobsanzl Exp $
> # --
> # This software comes with ABSOLUTELY NO WARRANTY. For details, see 
> # the enclosed file COPYING for license information (GPL). If you 
> # did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
> # --
> # Note: 
> # available objects are: ConfigObject, LogObject and DBObject
(Continue reading)


Gmane